mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
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.
11 lines
349 B
TypeScript
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 }),
|
|
}),
|
|
);
|