singularity-forge/packages
TÂCHES 60a3607ff7 feat: native Rust output truncation module (#268)
* feat: add native Rust output truncation module

Line-boundary-aware truncation for tool outputs (bash, grep, file reads),
replacing JS byte-counting with native Rust via napi-rs. Supports head,
tail, and both modes. Counts by UTF-8 bytes, respects line boundaries,
uses memchr for fast newline scanning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: remove unsafe blocks and fix truncation message byte counts

Replace unsafe from_utf8_unchecked with safe from_utf8().expect() —
the invariant (splitting at newline boundaries) is sound but the perf
difference is negligible, so no reason to use unsafe.

Fix truncateOutput messages that reported the byte budget as "bytes
truncated" instead of the actual number of bytes removed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 16:48:49 -06:00
..
native feat: native Rust output truncation module (#268) 2026-03-13 16:48:49 -06:00
pi-agent-core feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
pi-ai feat: add claude-opus-4-6[1m] model with 1M context window (#288) 2026-03-13 16:25:45 -06:00
pi-coding-agent feat: native Rust xxHash32 for hashline (#272) 2026-03-13 16:46:08 -06:00
pi-tui feat: wire native Rust image module into image processing pipeline 2026-03-13 13:41:53 -06:00