pi-mono/packages/durable/test/fixtures/utf8-byte-length-without-buffer.ts
Mario Zechner 445770e032 feat(durable): first coding-agent tool turn (Package 16)
Generation offers active registered tools through positional system entries and
hands a tool-calling answer to parallel or sequential pi.tool tasks and a
pi.post-tools task that applies addTools/terminate and continues the run. Tool
tasks validate, run beforeTool/afterTool, record intent with the replay policy,
publish bounded, sanitized, adaptively throttled progress in pi.live.tools, and
write results with a rendered diagnostics block. Hook dispatch with conversation
and subtree scopes, prepareArguments, HarnessOptions.env, and read/bash/edit/write
tools in pi-durable/tools. The env shell now streams raw output and spills past
thresholds; its bounded capture and publisher are removed.
2026-09-29 21:24:32 +02:00

11 lines
349 B
TypeScript

import { truncateHead, utf8ByteLength } from "../../src/truncate.ts";
const inputs: string[] = JSON.parse(process.argv[2] ?? "[]");
process.stdout.write(
JSON.stringify({
bufferAvailable: "Buffer" in globalThis,
lengths: inputs.map((input) => utf8ByteLength(input)),
head: truncateHead("aé🙂\nb", { maxBytes: 7, maxLines: 10 }),
}),
);