(output: string)
| 90 | } |
| 91 | |
| 92 | function truncateOutput(output: string): string { |
| 93 | if (output.length <= MAX_OUTPUT_CHARS) return output; |
| 94 | const truncated = output.slice(0, MAX_OUTPUT_CHARS); |
| 95 | return `${truncated}\n\n[OUTPUT TRUNCATED: showing ${MAX_OUTPUT_CHARS.toLocaleString()} of ${output.length.toLocaleString()} characters. Use head, grep, or more specific commands to narrow results.]`; |
| 96 | } |
| 97 | |
| 98 | // Tool descriptions for the system prompt |
| 99 | const TOOL_DESCRIPTIONS: Record<string, string> = { |