(text)
| 394 | } |
| 395 | |
| 396 | function truncateText(text) { |
| 397 | if (typeof text !== 'string') { |
| 398 | return '' |
| 399 | } |
| 400 | return text.length > MAX_TOOL_OUTPUT |
| 401 | ? `${text.slice(0, MAX_TOOL_OUTPUT)}\n...[truncated]` |
| 402 | : text |
| 403 | } |
| 404 | |
| 405 | function isObject(value) { |
| 406 | return typeof value === 'object' && value !== null && !Array.isArray(value) |