Files
OrcaSlicer/tools/mcp/tests/ops_select_plate.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

94 lines
6.0 KiB
JSON

// Records how a plate is selected: plate_select with a plate in range, past the last plate and negative
// (refused), not a number and not a whole number (refused), and its plate_goto tile (plate 0), and each command
// that takes a plate index given one the project lacks (plate_slice, project_export, object_arrange,
// plate_rename and plate_get_settings, object_list, object_transform) and given one it has. After each it
// reads the current plate (app_state, plate_list) and the undo snapshots taken since the last read
// (fixtures/ops_undo.py). The project has three plates with a cube on the first. Every call it records is
// optional. Run it with
// tools/mcp/orca_mcp.py run-replay tools/mcp/tests/ops_select_plate.json --out <dir>
{
"orca_replay_version": "0.2.0",
"name": "ops select_plate",
"vars": {"undo": "${replay_dir}/fixtures/ops_undo.py"},
"steps": [
{"tool": "app_wait", "args": {"for": "ready"}},
{"tool": "project_new", "args": {"discard_changes": true, "preset_changes": "discard"}},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 20]}},
{"tool": "action_run", "args": {"id": "orca_command:plate_add:orca"}},
{"tool": "action_run", "args": {"id": "orca_command:plate_add:orca"}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "plate_list", "expect": {"/total": {"eq": 3}}},
{"tool": "app_state"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
// ---- plate_select: in range, past the last, negative, not a number, not a whole number; the tile ----
{"tool": "plate_select", "args": {"plate": 1}, "optional": true},
{"tool": "app_state"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "plate_select", "args": {"plate": 2}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_select", "args": {"plate": 0}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_select", "args": {"plate": 3}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_select", "args": {"plate": 7}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_select", "args": {"plate": -3}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_select", "args": {"plate": 2}, "optional": true},
{"tool": "plate_select", "args": {"plate": "abc"}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_select", "args": {"plate": 2}, "optional": true},
{"tool": "plate_select", "args": {"plate": 1.7}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_select", "args": {"plate": 2}, "optional": true},
{"tool": "action_run", "args": {"id": "orca_command:plate_goto:orca"}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_list"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
// ---- Commands given a plate the project lacks, from plate 1 ----
{"tool": "plate_select", "args": {"plate": 1}},
{"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": {"plates": 5}, "optional": true},
{"tool": "plate_slice", "args": {"plates": -1}, "optional": true},
{"tool": "project_export", "args": {"format": "stl", "path": "${out_dir}/noplate.stl", "plates": 5, "overwrite": true}, "optional": true},
{"tool": "project_export", "args": {"format": "stl", "path": "${out_dir}/noplate.stl", "plates": -1, "overwrite": true}, "optional": true},
{"tool": "object_arrange", "args": {"plates": 5}, "optional": true},
{"tool": "object_arrange", "args": {"plates": -1}, "optional": true},
{"tool": "plate_rename", "args": {"plate": 5, "name": "x"}, "optional": true},
{"tool": "plate_get_settings", "args": {"plate": 5, "keys": ["curr_bed_type"]}, "optional": true},
{"tool": "object_list", "args": {"plate": 5}, "optional": true},
{"tool": "object_transform", "args": {"object": 0, "plate": 5}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_list"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
// ---- Commands given a plate the project has: which one is current afterwards ----
{"tool": "project_export", "args": {"format": "stl", "path": "${out_dir}/plate2.stl", "plates": 2, "overwrite": true}, "optional": true},
{"tool": "app_state"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "plate_rename", "args": {"plate": 1, "name": "One"}, "optional": true},
{"tool": "app_state"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "plate_get_settings", "args": {"plate": 2, "keys": ["curr_bed_type"]}, "optional": true},
{"tool": "app_state"},
{"tool": "plate_slice", "args": {"plates": 0}, "optional": true},
{"tool": "app_state"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "object_arrange", "args": {"plates": 2}, "optional": true},
{"tool": "object_arrange", "args": {"plates": 0}, "optional": true},
{"tool": "app_state"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "object_transform", "args": {"object": 0, "plate": 2}, "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}}
]
}