931
932
if (SHELL_TOOL_NAMES.has(toolName) || WRITE_SHELL_TOOL_NAMES.has(toolName)) {
934
>
// Custom tool overrides may wrap the args: { kind: 'custom-tool', args: { command: '...' } }
935
>
const command = args?.command ?? (args as Record<string, unknown> | undefined)?.args;
936
>
if (typeof command === 'string') {
937
return command;
938
}
939
>
if (typeof command === 'object' && command !== null && hasKey(command, { command: true })) {
copilotToolDisplay.ts
940
return (command as ICopilotShellToolArgs).command;
941
}