// Records the refusals of the send_gcode tile (action_run), and nothing else: it never sets a print host, so
// nothing is ever sent. A Bambu network printer (the harness's X1 Carbon as it starts, then with
// bbl_use_printhost off) with no objects, on a plate not sliced and on a sliced one; then the same printer set
// to print through a host (bbl_use_printhost on, OctoPrint) with no host address, sliced, not sliced and with no
// objects. After each it reads the dialogs and uploads (app_state) and the undo snapshots taken since the
// last read (fixtures/ops_undo.py). It ends by discarding the printer changes. Every call it records is
// optional. Run it with
// tools/mcp/orca_mcp.py run-replay tools/mcp/tests/ops_send_gcode_to_host.json --out
{
"orca_replay_version": "0.2.0",
"name": "ops send_gcode_to_host",
"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": "settings_get", "args": {"type": "printer", "keys": ["bbl_use_printhost", "host_type", "print_host"]}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
// ---- A Bambu network printer: no objects, not sliced, sliced ----
{"tool": "action_run", "args": {"id": "orca_command:send_gcode:orca"}, "optional": true},
{"tool": "app_state"},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 20]}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "action_run", "args": {"id": "orca_command:send_gcode:orca"}, "optional": true},
{"tool": "plate_slice", "expect": {"/plates/0/outcome": {"eq": "ok"}}},
{"tool": "action_run", "args": {"id": "orca_command:send_gcode:orca"}, "optional": true},
{"tool": "settings_set", "args": {"type": "printer", "values": {"bbl_use_printhost": false}}},
{"tool": "action_run", "args": {"id": "orca_command:send_gcode:orca"}, "optional": true},
{"tool": "app_state"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
// ---- Through a print host with no address: sliced, not sliced, no objects ----
{"tool": "settings_set", "args": {"type": "printer", "values": {"bbl_use_printhost": true, "host_type": "octoprint", "print_host": "", "use_3mf": false}}},
{"tool": "plate_slice", "expect": {"/plates/0/outcome": {"eq": "ok"}}},
{"tool": "plate_list"},
{"tool": "action_run", "args": {"id": "orca_command:send_gcode:orca"}, "optional": true},
{"tool": "app_state"},
{"tool": "object_transform", "args": {"object": 0, "translate": [5, 0, 0]}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "plate_list"},
{"tool": "action_run", "args": {"id": "orca_command:send_gcode:orca"}, "optional": true},
{"tool": "project_new", "args": {"discard_changes": true}},
{"tool": "action_run", "args": {"id": "orca_command:send_gcode:orca"}, "optional": true},
{"tool": "app_state"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "project_new", "args": {"discard_changes": true, "preset_changes": "discard"}},
{"tool": "settings_get", "args": {"type": "printer", "keys": ["bbl_use_printhost", "host_type", "print_host"]}}
]
}