feat(agent-term): matrix-tool icons + formatters, fill remaining fmtToolUse gaps

Add specific icons for matrix tools that had the generic 💬 fallback:
- mcp__matrix__read_room → 📖
- mcp__matrix__mark_read → 👁️
- mcp__matrix__list_rooms / list_room_members / list_invites → 📋
- mcp__bash__kill → 🛑 (was generic 🔧)

Add fmtToolUse cases for high-use tools that fell through to fmtArgsGeneric:
- set_status: 'set_status* "idle"' instead of 'set_status text: "idle"'
- get_loose_ends: 'get_loose_ends* [iris]' or 'get_loose_ends*()'
- get_agent_meta: 'get_agent_meta* iris' or 'get_agent_meta*()'
- cancel_loose_end: 'cancel_loose_end* question #42'
- bash kill: 'kill* abc123 [force]'
- Matrix tools: 'read_room* !abc1234 [50]', 'mark_read* !abc1234',
  'send_message* → !room: "body"', 'send_dm* → @mara: "body"',
  'send_reply*', 'send_reaction*', 'join_room*', 'open_dm*',
  'invite_user*', 'download_file*'

Also extend the short-name shortening to cover mcp__matrix__ prefix
(was only hyperhive + bash), so matrix tool rows show 'read_room*'
instead of 'mcp__matrix__read_room' as the prefix.

Two small helpers added: fmtRoom (truncates !id before ':' for
readability; keeps #alias intact) and fmtUser (@user:server → @user).

Closes #2198. Updates terminal-rendering.md icon list.
This commit is contained in:
iris 2026-07-04 12:36:11 +02:00 committed by mara
commit 6c56bf76d6
2 changed files with 59 additions and 2 deletions

View file

@ -56,7 +56,7 @@ parent's negative pull.
| `.turn-time` | `· HH:MM:SS` on turn-start; `· HH:MM:SS · <dur>` on turn-end (child span) | muted, smaller | per-event `ts` (unix seconds) on the live frame + history row | harness |
| `.text` | (no prefix; markdown body) | fg | claude `assistant.content[].text` | stream-json |
| `.thinking` | `💭 thinking …` | muted, italic | claude `assistant.content[].thinking` | stream-json |
| `.tool-use` (flat) | `<icon> Name args…` | cyan | tool_use w/o rich renderer; `<icon>` from `toolIcon(name)` (📤 send · 📥 recv · ❓ ask · ⏰ remind · 🏷️ set_status · 🪢 loose-ends · 🖥️ bash · 💬 matrix · 📦 request_* · ⏱️ schedule · 🔧 default) | stream-json |
| `.tool-use` (flat) | `<icon> Name args…` | cyan | tool_use w/o rich renderer; `<icon>` from `toolIcon(name)`: 📤 send · 📥 recv · ❓ ask · ⏰ remind · 🏷️ set_status · 🪢 loose-ends · ✂️ cancel_loose_end · get_agent_meta · ✅ ack_until · 📜 get_logs/get_host_journal · ↻ restart · ⏹️ kill · ▶️ start · 🔄 update · 📋 list_containers/list_rooms/list_room_members/list_invites · 📖 read_room/Read · 👁️ mark_read · 🛑 bash kill · 🖥️ bash other · 💬 matrix send/reply/dm · 📦 request_* · ⏱️ schedule · 🔧 default | 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 | rich renderer |