Skip to content

Commit 4dbff22

Browse files
committed
Expose TurtleTerm surface and bridge actions in agentctl
1 parent 1cc0ca2 commit 4dbff22

1 file changed

Lines changed: 45 additions & 2 deletions

File tree

assets/sourceos/bin/turtle-agentctl

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,25 @@ def print_json(payload: dict[str, Any]) -> int:
7777
return 0
7878

7979

80+
def join_remainder(values: list[str]) -> str:
81+
return " ".join(values).strip()
82+
83+
8084
def main(argv: list[str]) -> int:
8185
parser = argparse.ArgumentParser(description="TurtleTerm agent gateway CLI v0")
8286
parser.add_argument("--stdio", action="store_true", help="bypass socket and invoke turtle-agentd --stdio")
8387
sub = parser.add_subparsers(dest="command")
8488

8589
sub.add_parser("ping")
8690
sub.add_parser("sessions")
91+
sub.add_parser("surfaces")
92+
93+
inspect_surface_p = sub.add_parser("inspect-surface")
94+
inspect_surface_p.add_argument("surface_id")
95+
96+
surface_exec_p = sub.add_parser("request-surface-execution")
97+
surface_exec_p.add_argument("surface_id")
98+
surface_exec_p.add_argument("cmd", nargs=argparse.REMAINDER)
8799

88100
inspect_p = sub.add_parser("inspect")
89101
inspect_p.add_argument("session_id", nargs="?")
@@ -103,24 +115,55 @@ def main(argv: list[str]) -> int:
103115
promote_p = sub.add_parser("promote-agentplane-bundle")
104116
promote_p.add_argument("session_id", nargs="?")
105117

118+
super_obs_p = sub.add_parser("superconscious-observe")
119+
super_obs_p.add_argument("observation", nargs=argparse.REMAINDER)
120+
121+
super_prop_p = sub.add_parser("superconscious-propose")
122+
super_prop_p.add_argument("prompt", nargs=argparse.REMAINDER)
123+
124+
sub.add_parser("agent-machine-surfaces")
125+
sub.add_parser("agent-machine-probe")
126+
127+
sub.add_parser("cloudfog-surfaces")
128+
cloudfog_inspect_p = sub.add_parser("cloudfog-inspect")
129+
cloudfog_inspect_p.add_argument("surface_id", nargs="?", default="cloudfog/local-devshell")
130+
106131
args = parser.parse_args(argv)
107132

108133
if args.command == "ping":
109134
request = {"action": "ping"}
110135
elif args.command == "sessions":
111136
request = {"action": "sessions"}
137+
elif args.command == "surfaces":
138+
request = {"action": "surfaces"}
139+
elif args.command == "inspect-surface":
140+
request = {"action": "inspect_surface", "surface_id": args.surface_id}
141+
elif args.command == "request-surface-execution":
142+
request = {"action": "request_surface_execution", "surface_id": args.surface_id, "command": join_remainder(args.cmd)}
112143
elif args.command == "inspect":
113144
request = {"action": "inspect", "session_id": args.session_id}
114145
elif args.command == "summarize":
115146
request = {"action": "summarize", "session_id": args.session_id}
116147
elif args.command == "propose":
117-
request = {"action": "propose_command", "command": " ".join(args.cmd).strip()}
148+
request = {"action": "propose_command", "command": join_remainder(args.cmd)}
118149
elif args.command == "request-execution":
119-
request = {"action": "request_execution", "command": " ".join(args.cmd).strip()}
150+
request = {"action": "request_execution", "command": join_remainder(args.cmd)}
120151
elif args.command == "receipts":
121152
request = {"action": "receipts", "session_id": args.session_id}
122153
elif args.command == "promote-agentplane-bundle":
123154
request = {"action": "promote_agentplane_bundle", "session_id": args.session_id}
155+
elif args.command == "superconscious-observe":
156+
request = {"action": "superconscious_observe", "observation": {"text": join_remainder(args.observation)}}
157+
elif args.command == "superconscious-propose":
158+
request = {"action": "superconscious_propose", "prompt": join_remainder(args.prompt)}
159+
elif args.command == "agent-machine-surfaces":
160+
request = {"action": "agent_machine_surfaces"}
161+
elif args.command == "agent-machine-probe":
162+
request = {"action": "agent_machine_probe"}
163+
elif args.command == "cloudfog-surfaces":
164+
request = {"action": "cloudfog_surfaces"}
165+
elif args.command == "cloudfog-inspect":
166+
request = {"action": "cloudfog_inspect", "surface_id": args.surface_id}
124167
else:
125168
parser.print_help(sys.stderr)
126169
return 2

0 commit comments

Comments
 (0)