feat(tmux): add shared muse tmux socket manager with CLI and agent [TOOL tmux.*] integration

This commit is contained in:
operator
2026-10-05 16:11:19 +00:00
parent 07c67e5da3
commit 0ca0fd0c1a
5 changed files with 346 additions and 1 deletions
+32 -1
View File
@@ -72,7 +72,38 @@ box muse <self> send --thread <thread_uuid> "<message>"
---
## 4. Best Practices & Invariants
## 4. Shared Tmux Socket Tooling (`muse tmux` & `[TOOL tmux.*]`)
Agents and operators can spawn background sessions and send keystrokes to long-running tasks via the shared socket `/tmp/tmux-muse.sock`.
### Via Native CLI:
```bash
# List sessions on shared socket
muse <account> tmux list
# Create or send commands to a background session
muse <account> tmux send <session> "command to execute"
# Capture recent scrollback output from a session
muse <account> tmux capture <session> --lines 30
# Kill a session
muse <account> tmux kill <session>
```
### Via Autonomous Agent Directives:
Agents can emit structured tool calls in sidechats:
```text
[TOOL tmux.new {"session": "build-worker", "command": "python3 /srv/worker.py"}]
[TOOL tmux.send {"session": "build-worker", "keys": "ls -la"}]
[TOOL tmux.capture {"session": "build-worker", "lines": 20}]
[TOOL tmux.list {}]
[TOOL tmux.kill {"session": "build-worker"}]
```
---
## 5. Best Practices & Invariants
1. **Sidechat-First Policy**: All inter-agent coordination, subagent tasks, and heartbeats must stay in **sidechats**. Do not send automated routine messages to `main` chat.
2. **Sub-Agent Prioritization**: Break down complex diagnostic or verification jobs by delegating sub-tasks to dedicated subagent threads.