Skip to main content

Module text

Module text 

Source
Expand description

Text shaping for tool results: bounded output and numbered line windows.

Functionsยง

bounded
Keep the head and tail of bytes within max, marking the cut. Output is lossy UTF-8; the model sees text, never raw bytes.
numbered_window
A window of numbered lines, cat -n style, starting at 1-based offset and at most limit lines long. Returns the text and whether more lines follow the window.
shell_quote
Escape a string as a single-quoted POSIX shell word.