(value: string, limit: number)
| 21 | } |
| 22 | |
| 23 | function truncate(value: string, limit: number) { |
| 24 | return value.length > limit |
| 25 | ? `${value.slice(0, limit)}\n... (truncated, ${value.length} total chars)` |
| 26 | : value; |
| 27 | } |
| 28 | |
| 29 | export async function executeLocalTool(toolName: string, input: unknown, mode: ModeType) { |
| 30 | if (mode === Mode.PLAN && !["readFile", "listDirectory", "glob", "grep"].includes(toolName)) { |