agent/terminal: inline answer form under ask → operator rows (#666)
When an agent calls mcp__hyperhive__ask with to==operator (the default), the rich tool-use renderer now mounts an empty ask-answer-inline-slot inside the expanded ask row and enqueues a loose-ends refresh. A new reconcileAskBinds() walks waiting slots on every loose-ends update, matches each against pending operator-bound questions by question text, and injects the same inline answer form the side panel uses (buildAnswerForm → POST to the host dashboard answer-question endpoint). When a question resolves, the form gets replaced by a struck-through [answered ✓] tag so the scrollback reflects the closed state. Lets the operator respond to agent questions inline in the live terminal without context-switching to the loose-ends side panel or the dashboard Y3R C4LL tab. Refreshes loose-ends both on tool_use render (best-effort, may miss the question before the broker persists it) and on the matching tool_result (the right moment — MCP has just returned the assigned id). Slots are pruned on /clear and defensively filtered for isConnected on each reconcile. closes #666
This commit is contained in:
parent
4d64f253c8
commit
e056e82d6d
3 changed files with 194 additions and 1 deletions
|
|
@ -43,6 +43,7 @@ parent's negative pull.
|
|||
| `.tool-use` (flat) | `→ Name args…` | cyan | tool_use w/o rich renderer | stream-json |
|
||||
| `.tool-use` `<details>` | `Write/Edit <path> · +N` (no `→`) | cyan, body is +/- diff | `renderRichToolUse` Write/Edit | stream-json |
|
||||
| `.tool-use` `<details open>` | `send → to · NL`, `ask → to`, `answer #id` | cyan, body is markdown | rich renderer for send / ask / answer | stream-json |
|
||||
| `.tool-use .ask-answer-inline-slot` | (sub-block under `ask → operator`) | inherits row | inline answer form bound by `reconcileAskBinds` to the loose-end | #666 |
|
||||
| `.tool-result` (flat) | `← <txt>` | muted | short `tool_result` (≤120c, non-recv) | stream-json |
|
||||
| `.tool-result-block` `<details>` | `Nl · headline` | muted, body is text | long generic `tool_result` | stream-json |
|
||||
| `.tool-result-block` `<details open>` | `recv ← <txt>` | muted, body is markdown | `tool_result` correlated to a prior `recv` tool_use via id | stream-json |
|
||||
|
|
@ -104,6 +105,26 @@ isn't in the built-in `fmtToolUse` switch:
|
|||
This keeps `mcp__matrix__send_message` and similar from
|
||||
dumping raw JSON.
|
||||
|
||||
## Inline ask-operator answer (#666)
|
||||
|
||||
When an agent calls `mcp__hyperhive__ask` with `to == "operator"`
|
||||
(default), the rich tool-use renderer mounts an empty
|
||||
`<div class="ask-answer-inline-slot">` inside the row's expanded
|
||||
body, then enqueues a loose-ends refresh. `reconcileAskBinds()`
|
||||
runs on every loose-ends refresh, matches each waiting slot
|
||||
against pending operator-bound questions by question text, and
|
||||
injects an inline `.answer-form` (textarea + send button bound to
|
||||
`/answer-question/<id>` on the host dashboard) into the matching
|
||||
slot. When a question subsequently resolves (operator answered via
|
||||
the inline form, the side-panel form, or the dashboard Y3R C4LL
|
||||
tab), the same reconciler replaces the form with a struck-through
|
||||
`[answered ✓]` tag so the scrollback reflects the closed state.
|
||||
|
||||
Lets the operator answer mid-flow without context-switching to the
|
||||
loose-ends side panel or the dashboard tab. Side panel + dashboard
|
||||
forms remain — they're the same `buildAnswerForm` factory, three
|
||||
mount points for the same POST.
|
||||
|
||||
## Dashboard side (not covered here)
|
||||
|
||||
The main dashboard's message-flow pane is a different
|
||||
|
|
|
|||
Loading…
Reference in a new issue