( toolName: string, params: Record<string, unknown>, )
| 553 | // ============ Tool Execution ============ |
| 554 | |
| 555 | export async function executeExecTool( |
| 556 | toolName: string, |
| 557 | params: Record<string, unknown>, |
| 558 | ): Promise<{success: boolean; result?: unknown; error?: string}> { |
| 559 | try { |
| 560 | switch (toolName) { |
| 561 | case 'exec_command': |
| 562 | return await handleExecCommand(ExecCommandSchema.parse(params)); |
| 563 | |
| 564 | default: |
| 565 | return {success: false, error: `Unknown tool: ${toolName}`}; |
| 566 | } |
| 567 | } catch (err) { |
| 568 | if (err instanceof zod.ZodError) { |
| 569 | return {success: false, error: `Invalid parameters: ${err.message}`}; |
| 570 | } |
| 571 | return { |
| 572 | success: false, |
| 573 | error: err instanceof Error ? err.message : 'Unknown error', |
| 574 | }; |
| 575 | } |
| 576 | } |
nothing calls this directly
no test coverage detected