root@studio:~$ cd
Tracing route… ///
Tracing route… ///
Trim a chat message array to fit a token/size budget , keep the system prompt, pin the most recent turns, never split a message.
Trim a chat message array to fit a token/size budget , keep the system prompt, pin the most recent turns, never split a message.
$ npm install @azghr/foreshorten@azghr/shornTruncate strings by byte budget without ever breaking a grapheme , safe for DB columns, headers, and anything with a byte limit.
@azghr/extricateExtract the first (or every) valid JSON value embedded in text or markdown fences from an LLM reply. Locates and parses; does not repair.
@azghr/decantParse Server-Sent Events from a streamed LLM response , cross-chunk safe, spec-correct, transport-agnostic, zero deps.