Function
truncateToolOutput
(text: string, maxChars?: number)
Source from the content-addressed store, hash-verified
| 47 | export { isMedia } |
| 48 | |
| 49 | function truncateToolOutput(text: string, maxChars?: number) { |
| 50 | if (!maxChars || text.length <= maxChars) return text |
| 51 | const omitted = text.length - maxChars |
| 52 | return `${text.slice(0, maxChars)}\n[Tool output truncated for compaction: omitted ${omitted} chars]` |
| 53 | } |
| 54 | |
| 55 | export const Event = { |
| 56 | Updated: SessionV1.Event.MessageUpdated, |
Tested by
no test coverage detected