Skip to main content

Module truncation

Module truncation 

Source
Expand description

Truncation utilities for limiting output size.

Provides smart truncation that:

  • Preserves meaningful content boundaries (lines, words)
  • Adds truncation markers
  • Creates agent hints about hidden content

Structs§

TruncationConfig
Configuration for truncation plugin.
TruncationPlugin
Truncation plugin for limiting output size.

Functions§

truncate_diff
Truncate diff content with context preservation.
truncate_string
Truncate a string to max_chars, preserving word boundaries. The returned string will be at most max_chars characters long (including ellipsis). Safe for non-ASCII (UTF-8 multi-byte characters).