MCPcopy Index your code
hub / github.com/codeaashu/claude-code / toolCallOf

Function toolCallOf

src/components/messageActions.tsx:122–141  ·  view source on GitHub ↗
(msg: NavigableMessage)

Source from the content-addressed store, hash-verified

120
121// Only AgentTool has renderGroupedToolUse — Edit/Bash/etc. stay as assistant tool_use blocks.
122export 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}
142export type MessageActionCaps = {
143 copy: (text: string) => void;
144 edit: (msg: NormalizedUserMessage) => Promise<void>;

Callers 3

selectFunction · 0.85
messageActions.tsxFile · 0.85
copyTextOfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected