fix: guard transient controls and verify timeline endpoints
This commit is contained in:
1 parent
479a185192
commit
00e62a663a
29 files changed
+1150
-90
No files matched your search
@@ -1236,7 +1236,12 @@ class OperatorNode:
|
||||
# segments in lockstep).
|
||||
available_actions = self._available_device_actions()
|
||||
all_tools = [
|
||||
operator_shell_tool(name) for name in OPERATOR_SHELL_ORDER if name in available_actions
|
||||
operator_shell_tool(
|
||||
name,
|
||||
sequence_limit=self._max_burst_actions() if name == "action_sequence" else None,
|
||||
)
|
||||
for name in OPERATOR_SHELL_ORDER
|
||||
if name in available_actions
|
||||
] + self.tools
|
||||
|
||||
# 5. Mount the task-output analyzer and collect background ADB task state.
|
||||
@@ -1556,14 +1561,19 @@ class OperatorNode:
|
||||
return {k: v for k, v in el.items() if k != "center"}
|
||||
|
||||
if tool_name in {"drag", "action_sequence"}:
|
||||
from artemis.mcp.gestures import DragRequest, SequenceRequest, plan_drag, plan_sequence
|
||||
from artemis.mcp.gestures import (
|
||||
DragRequest,
|
||||
plan_drag,
|
||||
plan_sequence,
|
||||
validate_sequence,
|
||||
)
|
||||
|
||||
try:
|
||||
if tool_name == "drag":
|
||||
request = DragRequest.model_validate(args)
|
||||
planned = plan_drag(request, width, height)
|
||||
return [{**planned, "args": request.model_dump(mode="json")}], None
|
||||
request_sequence = SequenceRequest.model_validate(args)
|
||||
request_sequence = validate_sequence(args, self._max_burst_actions())
|
||||
plan_sequence(request_sequence, width, height, self._max_burst_actions())
|
||||
return [
|
||||
{"action": "action_sequence", "args": request_sequence.model_dump(mode="json")}
|
||||
|
||||
Reference in new issue
Block a user