fix(work): import hashlib and wire heal subparser into main CLI

This commit is contained in:
operator
2026-10-09 23:13:43 +00:00
parent c3b4b1cd28
commit f75977ca6e
202 changed files with 4185 additions and 4142 deletions
+38
View File
@@ -177,6 +177,44 @@ Agents can emit structured tool calls in sidechats:
---
## 4.1. Agentic Flows in Tmux Panes (`box flow` & `[TOOL flow.*]`)
Chromebox browser contexts prune and store chat history aggressively, making direct in-chat execution of long-running build, test, and shell tasks token-expensive and prone to context loss.
To overcome this, Chromebox agents offload multi-turn execution to persistent tmux panes on `/tmp/tmux-muse.sock` using the **Flow Engine** (`bin/flow_engine.py`). Raw stdout/stderr streams to disk (`logs/flows/<flow_id>.log`), and agents read back only concise status and incremental output deltas.
### Lifecycle & Primitives:
1. **Start Flow**:
Spawns pane `flow-<agent>-<id>` and launches command wrapped with an exit code sentinel.
```text
[TOOL flow.start {"flow_id": "audit-tests", "command": "python3 -m unittest discover -s tests"}]
```
*CLI:* `box flow start audit-tests -c "python3 -m unittest discover -s tests"`
2. **Read Incremental Delta & State**:
Inspects the pane for execution state (`working`, `idle`, `waiting_prompt`, `finished`, `failed`), exit code, and reads newly appended log output since the last read cursor.
```text
[TOOL flow.read {"flow_id": "audit-tests"}]
```
*CLI:* `box flow read audit-tests --lines 40`
3. **Advance or Respond to Prompts**:
Sends follow-up commands or keystrokes (such as interactive menu selections) without re-running the whole prompt.
```text
[TOOL flow.send {"flow_id": "audit-tests", "command": "git diff"}]
[TOOL flow.send {"flow_id": "audit-tests", "keys": "1"}]
```
*CLI:* `box flow send audit-tests "git status" --command`
4. **List & Stop**:
```text
[TOOL flow.list {}]
[TOOL flow.stop {"flow_id": "audit-tests"}]
```
*CLI:* `box flow list` / `box flow stop audit-tests`
---
## 5. Direct Operator Directives & Prompt Envelope Specification
When jobs are dispatched to agents via `bin/job-dispatch.py`, they are wrapped in an actionable, authentic **Operator Directive** generated by `bin/prompt_envelope.py`.