{ "name": "timer_idle_any_fires_on_transition", "presets": { "processes": [ { "name": "echoer", "argv": ["sh", "-lc", "while read line; do echo \"saw:$line\"; done"] }, { "name": "busy", "argv": ["sh", "-lc", "for i in 1 2 3 4 5; do echo tick $i; sleep 0.2; done; sleep 60"], "idle_detection": { "strategy": "output_activity", "idle_threshold_ms": 500 } } ] }, "trust": ["echoer", "busy"], "steps": [ { "type": "mcp_call", "method": "spawn_process", "params": {"kind": "command", "preset": "echoer", "name": "echoer"}, "save_as": "owner" }, { "type": "mcp_call", "method": "spawn_process", "params": {"kind": "command", "preset": "busy", "name": "busy"}, "save_as": "watch" }, { "type": "wait_until_mcp", "method": "get_process_status", "params": {"process_id": "{{watch.process_id}}"}, "path": "idle_state", "equals": "working", "timeout_ms": 3000 }, { "type": "mcp_call", "method": "timer_fire_when_idle_any", "params": { "watched": ["{{watch.process_id}}"], "body": "any-idle", "owner_process_id": "{{owner.process_id}}" }, "save_as": "resp" }, { "type": "assert_saved", "from": "resp", "path": "status", "equals": "pending" }, { "type": "wait_until_mcp", "method": "get_process_output", "params": {"process_id": "{{owner.process_id}}", "mode": "grid"}, "path": "content", "contains": "saw:any-idle", "allow_substring": true, "timeout_ms": 6000 } ] }