agent ui: live event panel via SSE + stream-json
This commit is contained in:
parent
3c9d42b2a7
commit
9eab28a716
8 changed files with 277 additions and 33 deletions
18
CLAUDE.md
18
CLAUDE.md
|
|
@ -182,6 +182,24 @@ and the MCP tools. Claude drives any further `recv`/`send` itself —
|
|||
harness no longer relays claude's stdout as a reply. Stdout is logged for
|
||||
debugging; the side effects (sends via MCP) are what matter.
|
||||
|
||||
**Live view.** Each agent runs a `hive_ag3nt::events::Bus` (a
|
||||
`tokio::sync::broadcast<LiveEvent>` wrapper). The harness emits:
|
||||
- `TurnStart { from, body }` when a wake-up message is popped.
|
||||
- `Stream(value)` for every line claude prints on stdout (parsed
|
||||
stream-json; flattened under `{kind: "stream", type: ...}` via serde
|
||||
internal tagging).
|
||||
- `Note(text)` for stderr lines and non-JSON stdout (so nothing's lost).
|
||||
- `TurnEnd { ok, note }` when claude exits.
|
||||
|
||||
The web UI subscribes via `/events/stream` (SSE) and a small JS panel on
|
||||
`/` appends rows. No full-page reload — the login form (and anything else
|
||||
the operator is typing into) stays put.
|
||||
|
||||
claude is invoked with `--print --verbose --output-format stream-json` so
|
||||
tool calls + assistant text + tool results all land as structured events.
|
||||
The harness no longer reads claude's text stdout into a reply; claude
|
||||
calls `mcp__hyperhive__send` itself.
|
||||
|
||||
**Tool envelope.** Every MCP tool handler in `hive_ag3nt::mcp::AgentServer`
|
||||
wraps its logic in `run_tool(name, args_debug, async { ... })`. The
|
||||
envelope guarantees:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue