Files
OrcaSlicer/tools/mcp/tests/ops_start_slice.json
T
SoftFever d64e10f4dd Regroup the slicer's MCP commands and let each run from its arguments
Outside the Design tab an agent had 175 commands, 50 of them in the tool
list. There are now 118, named by what they act on (`object_`, `plate_`,
`preset_`, `filament_`, `plugin_` and so on), and 115 are listed. Each takes
its target and values in the call, acts on the selection when it names no
target and says what it acted on; an old name is refused. Printers and
system filaments install and uninstall, preferences read and write, plugins
enable, reload, uninstall and refresh, and objects reorder, with no dialog
to drive.

The Speed Dial keeps its 129 tiles under the same ids. Eight defects in the
rows these commands share with the menus are fixed. For a person: an object
row that cannot run says why instead of "Select an object first.", rows
that failed no longer claim success, Duplicate Plate can be undone, and
Refresh Plugins picked while a refresh runs now runs after it instead of
beside it.
2026-11-18 16:50:32 +08:00

123 lines
7.1 KiB
JSON

// Records what starting a slice does through its routes, the slice_and_preview and slice_all tiles run with
// action_run (they return at once) and plate_slice (the current plate, all, an index): with no objects, on
// one plate, on two plates, and with objects that fail validation (spiral vase on a plate with two objects).
// Each call starts from the Prepare tab; after it, the replay waits for idle and reads the plates' slice state,
// the tab, the notifications and the undo snapshots taken since the last read (fixtures/ops_undo.py). Every call
// it records is optional. Run it with
// tools/mcp/orca_mcp.py run-replay tools/mcp/tests/ops_start_slice.json --out <dir>
{
"orca_replay_version": "0.2.0",
"name": "ops start_slice",
"vars": {"undo": "${replay_dir}/fixtures/ops_undo.py"},
"steps": [
{"tool": "app_wait", "args": {"for": "ready"}},
{"tool": "dialog_auto_answer", "args": {"rules": [{"match": "Spiral mode only works", "button": "yes"}]}},
{"tool": "project_new", "args": {"discard_changes": true, "preset_changes": "discard"}},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
// ---- No objects ----
{"tool": "action_run", "args": {"id": "orca_command:slice_and_preview:orca"}, "optional": true},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "app_state"},
{"tool": "plate_list"},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "action_run", "args": {"id": "orca_command:slice_all:orca"}, "optional": true},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "app_state"},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "plate_slice", "args": {}, "optional": true},
{"tool": "app_state"},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "plate_slice", "args": {"plates": "all"}, "optional": true},
{"tool": "app_state"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
// ---- One plate ----
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 20]}},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "action_run", "args": {"id": "orca_command:slice_and_preview:orca"}, "optional": true},
{"tool": "app_state"},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "app_state"},
{"tool": "plate_list"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "object_transform", "args": {"object": 0, "translate": [5, 0, 0]}},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "plate_slice", "args": {}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_list"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
// ---- Two plates, a cube on each ----
{"tool": "action_run", "args": {"id": "orca_command:plate_add:orca"}},
{"tool": "plate_select", "args": {"plate": 1}},
{"tool": "object_select", "args": {"none": true}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 20]}},
{"tool": "plate_select", "args": {"plate": 0}},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "plate_list", "expect": {"/total": {"eq": 2}, "/items/1/objects": {"eq": 1}}},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "action_run", "args": {"id": "orca_command:slice_and_preview:orca"}, "optional": true},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "app_state"},
{"tool": "plate_list"},
{"tool": "object_transform", "args": {"object": 0, "translate": [5, 0, 0]}},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "action_run", "args": {"id": "orca_command:slice_all:orca"}, "optional": true},
{"tool": "app_state"},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "app_state"},
{"tool": "plate_list"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "object_transform", "args": {"object": 0, "translate": [5, 0, 0]}},
{"tool": "object_transform", "args": {"object": 1, "translate": [5, 0, 0]}},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "plate_slice", "args": {"plates": "all"}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_list"},
{"tool": "object_transform", "args": {"object": 1, "translate": [5, 0, 0]}},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "plate_select", "args": {"plate": 0}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "plate_slice", "args": {"plates": 1}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_list"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
// ---- Objects that fail validation: spiral vase on a plate with two objects ----
{"tool": "project_new", "args": {"discard_changes": true}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 20]}},
{"tool": "object_select", "args": {"none": true}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 20]}},
{"tool": "object_arrange", "args": {"plates": "all"}},
{"tool": "plate_set_settings", "args": {"plate": 0, "values": {"spiral_mode": true}}},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "action_run", "args": {"id": "orca_command:slice_and_preview:orca"}, "optional": true},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "app_state"},
{"tool": "plate_list"},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "action_run", "args": {"id": "orca_command:slice_all:orca"}, "optional": true},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "app_state"},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "plate_slice", "args": {}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_list"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "project_new", "args": {"discard_changes": true}}
]
}