Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 175 to 318

Compare

+8 −3 in 3 places
Lines 18–27 at 318 (were 18–24 at 175)
1818/** JSON.stringify-compatible chunks for canonical data, without a whole-value string.
1919 * Individual input strings and object key lists still belong to the caller.
2020 */
21−export function* jsonValueChunks(input: unknown): IterableIterator<string> {
21+export function* jsonValueChunks(
22+ input: unknown,
23+ options: { maxDepth?: number; unboxPrimitives?: boolean } = {},
24+): IterableIterator<string> {
2225 const active = new Set<object>();
2326 function* string(value: string): IterableIterator<string> {
2427 yield '"';
Lines 41–50 at 318 (were 38–45 at 175)
3841 const streaming = streamingValues.get(value);
3942 if (streaming) return streaming();
4043 const toJSON = (value as { toJSON?: unknown }).toJSON;
41− if (typeof toJSON === "function") return toJSON.call(value, key);
44+ if (typeof toJSON === "function") value = toJSON.call(value, key);
4245 }
46+ if (options.unboxPrimitives && (value instanceof String || value instanceof Number || value instanceof Boolean))
47+ return value.valueOf();
4348 return value;
4449 };
4550 const omitted = (value: unknown) => value === undefined || typeof value === "function" || typeof value === "symbol";
Lines 68–74 at 318 (were 63–69 at 175)
6368 else if (typeof value !== "object" || value === null) throw Error("unsupported canonical JSON value");
6469 else {
6570 if (active.has(value)) throw Error("cyclic canonical JSON value");
66− if (active.size >= 128) throw Error("canonical JSON depth exceeds bound");
71+ if (active.size >= (options.maxDepth ?? 128)) throw Error("canonical JSON depth exceeds bound");
6772 active.add(value);
6873 try {
6974 if (Array.isArray(value)) {
MCP
compare on this site's /mcp
CLI
abso diff 175 318 src/engine/json-value-chunks.ts --json
JSON
/christopher/abso-core/compare/175..318?file=src%2Fengine%2Fjson-value-chunks.ts&format=json