Skip to main contentModule compact
Source - collapse_code_blocks
- Collapse large fenced code blocks and
sections in text. - collapse_code_blocks_mut
- Collapse large fenced code blocks and
sections, mutating cache in place. - compact_discussion
- Compact a discussion JSON string using budget-based adaptive
compaction. Pure-Rust callable in both build modes.
- compact_text
- Collapse code blocks then truncate if over limit.
Returns (text, was_truncated, cache_json).
- compact_text_mut
- Collapse code blocks then truncate if over limit, mutating cache in place.
Returns (text, was_truncated).
- safe_byte_index
- Find the largest valid char boundary <=
pos in s.