feat(relay): add subagent spawn, thread tools, and container box client

- Upgrade exec-constrained.py with subagent.spawn, thread.list, thread.view, pipeline.run ops
- Grant full ops permissions to all fleet agent identities (646, pip, muse, opm)
- Implement bin/box-relay.sh zero-dependency client supporting bearer and SSH signature auth
- Add fast hybrid gateway path to dm.py for sub-2s verified deliveries
- Fix wait=0 handling in super-cli.py subagent deployments
- Add hourly check-in jobs and scheduler for 646, pip, muse
- Document agent tooling and relay APIs in docs/AGENT-TOOLING.md
This commit is contained in:
operator
2026-10-04 23:30:18 +00:00
parent c1545fe6db
commit d6ca600394
16 changed files with 953 additions and 15 deletions
+17 -4
View File
@@ -24,7 +24,7 @@ def is_node_configured(node):
conf_dir = Path.home() / ".config" / "muse-cli" / node
return (conf_dir / "cookies.txt").exists()
def run_muse_cli(node, args, timeout=30):
def run_muse_cli(node, args, timeout=60):
cmd = [str(MUSE_CLI_NODE), node] + args
res = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
return res.returncode, res.stdout, res.stderr
@@ -40,6 +40,20 @@ def get_threads(node):
except Exception as e:
return None, f"JSON parse error: {e}"
def start_session(node, title=None):
"""Start a new session/subagent via fast gateway. Returns (dict, error_str)."""
args = ["session-start"]
if title:
args.extend(["--title", title])
rc, stdout, stderr = run_muse_cli(node, args)
if rc != 0:
return None, stderr or stdout
try:
data = json.loads(stdout)
return data, None
except Exception as e:
return None, f"JSON parse error: {e}"
def get_history(node, thread_id=None, limit=15):
"""Retrieve message history via fast gateway. Returns (history_list, error_str)."""
args = ["history", "--limit", str(limit)]
@@ -59,10 +73,9 @@ def send_message(node, text, thread_id=None, wait=0):
args = ["send"]
if thread_id and thread_id != "main":
args.extend(["--thread", str(thread_id)])
if wait > 0:
args.extend(["--wait", str(wait)])
args.extend(["--wait", str(wait)])
args.append(text)
rc, stdout, stderr = run_muse_cli(node, args, timeout=max(30, wait + 15))
rc, stdout, stderr = run_muse_cli(node, args, timeout=max(60, wait + 30))
if rc != 0:
return None, stderr or stdout
try: