{"draft":null,"from":162,"to":163,"files":[{"path":"server/src/small-frame-json.ts","added":15,"removed":0,"diff":"--- /dev/null\n+++ b/server/src/small-frame-json.ts\n@@ -0,0 +1,15 @@\n+import { jsonEvents } from \"./json-events.ts\";\n+\n+/** Decode a small canonical frame with the same validation as the streamed path. */\n+export function smallFrameJson(chunks: Iterable<string>): unknown {\n+\tlet text = \"\";\n+\tfor (const chunk of chunks) {\n+\t\tif (text.length + chunk.length > 4096) throw Error(\"small canonical frame exceeds bound\");\n+\t\ttext += chunk;\n+\t}\n+\t// Count UTF-8 after joining so a surrogate pair split across chunks counts once.\n+\tif (new TextEncoder().encode(text).byteLength > 4096) throw Error(\"small canonical frame exceeds bound\");\n+\t// Preserve depth, key and scalar limits; the fast path must not change acceptance.\n+\tfor (const event of jsonEvents([text])) void event;\n+\treturn JSON.parse(text);\n+}"}],"unmatched":[]}