(msg: NavigableMessage)
| 120 | |
| 121 | // Only AgentTool has renderGroupedToolUse — Edit/Bash/etc. stay as assistant tool_use blocks. |
| 122 | export function toolCallOf(msg: NavigableMessage): { |
| 123 | name: string; |
| 124 | input: Record<string, unknown>; |
| 125 | } | undefined { |
| 126 | if (msg.type === 'assistant') { |
| 127 | const b = msg.message.content[0]; |
| 128 | if (b?.type === 'tool_use') return { |
| 129 | name: b.name, |
| 130 | input: b.input as Record<string, unknown> |
| 131 | }; |
| 132 | } |
| 133 | if (msg.type === 'grouped_tool_use') { |
| 134 | const b = msg.messages[0]?.message.content[0]; |
| 135 | if (b?.type === 'tool_use') return { |
| 136 | name: msg.toolName, |
| 137 | input: b.input as Record<string, unknown> |
| 138 | }; |
| 139 | } |
| 140 | return undefined; |
| 141 | } |
| 142 | export type MessageActionCaps = { |
| 143 | copy: (text: string) => void; |
| 144 | edit: (msg: NormalizedUserMessage) => Promise<void>; |
no outgoing calls
no test coverage detected