MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / toolCallOf

Function toolCallOf

source code/components/messageActions.tsx:124–143  ·  view source on GitHub ↗
(msg: NavigableMessage)

Source from the content-addressed store, hash-verified

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