Expand description
Output truncation shared by the tools: by lines and by bytes, from the head or the tail.
Structs§
- Middle
Truncation - What
truncate_middlekept. - Truncation
- What was kept, as stored in tool result details.
Enums§
- Truncated
By - Which limit truncated the output.
Constants§
- DEFAULT_
MAX_ BYTES - Bytes kept by default: 50 KB.
- DEFAULT_
MAX_ LINES - Lines kept by default.
- GREP_
MAX_ LINE_ LENGTH - Characters kept per grep match line.
Functions§
- format_
size - pi’s size format:
512B,1.5KB,2.0MB. - tail_
bytes - The last
max_bytesbytes oftext, starting at a character boundary. - truncate_
head - Keeps whole lines from the start.
- truncate_
line - Cuts a line to
max_charsUTF-16 units, as pi counts them. - truncate_
middle - pi’s
truncateMiddle: keeps the start and end ofcontent, half ofmax_byteseach, with a…N chars truncated…marker between, cutting only at character boundaries. - truncate_
tail - Keeps whole lines from the end. A single over-long last line keeps its tail.