omp-fabric 1.24.1 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/chunks/{chunk-ON7LE7QA.js → chunk-D4ANGHR7.js} +4 -4
- package/dist/chunks/chunk-D4ANGHR7.js.map +7 -0
- package/dist/chunks/{chunk-DRIWQ6PD.js → chunk-IGCIGSJW.js} +5 -5
- package/dist/chunks/chunk-JL3KVPFJ.js +291 -0
- package/dist/chunks/chunk-JL3KVPFJ.js.map +7 -0
- package/dist/chunks/{chunk-IE5HUDWQ.js → chunk-KLJLDI3E.js} +3 -3
- package/dist/chunks/{chunk-QP3SVWUV.js → chunk-NBA7CEFR.js} +4 -6
- package/dist/chunks/{chunk-QP3SVWUV.js.map → chunk-NBA7CEFR.js.map} +1 -1
- package/dist/chunks/{chunk-NCPJZXLM.js → chunk-NOZBB266.js} +8 -4
- package/dist/chunks/chunk-NOZBB266.js.map +7 -0
- package/dist/chunks/{chunk-MZUWSNZX.js → chunk-QSRTEINF.js} +70 -3
- package/dist/chunks/{chunk-MZUWSNZX.js.map → chunk-QSRTEINF.js.map} +3 -3
- package/dist/chunks/{chunk-SWHJQ6XH.js → chunk-R5B3W46U.js} +2 -2
- package/dist/chunks/{chunk-3XPR2AZL.js → chunk-UAP6IQIR.js} +3 -1
- package/dist/chunks/chunk-UAP6IQIR.js.map +7 -0
- package/dist/chunks/{chunk-ICADZLLJ.js → chunk-UJEOKJMN.js} +2 -2
- package/dist/chunks/{chunk-66PGUYJJ.js → chunk-XABWRKSU.js} +3 -3
- package/dist/chunks/{chunk-QW5LEEFV.js → chunk-ZHDN5ESL.js} +2 -2
- package/dist/compaction/bounds.d.ts +2 -0
- package/dist/compaction/bounds.d.ts.map +1 -1
- package/dist/compaction/hook.js +3 -4
- package/dist/compaction/lcm-maintenance.d.ts +0 -2
- package/dist/compaction/lcm-maintenance.d.ts.map +1 -1
- package/dist/compaction/lcm-runtime.d.ts +2 -2
- package/dist/compaction/lcm-runtime.js +608 -15
- package/dist/compaction/lcm-runtime.js.map +4 -4
- package/dist/core/skill-prompt.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +12 -14
- package/dist/fabric-runtime-state.js.map +2 -2
- package/dist/index.js +10 -10
- package/dist/index.js.map +2 -2
- package/dist/judgment/host-judge.d.ts.map +1 -1
- package/dist/providers/memory-provider.js +3 -3
- package/dist/providers/omp-session-scope.d.ts.map +1 -1
- package/dist/residency/host.js +9 -10
- package/dist/residency/omp-entry.js +9 -10
- package/dist/residency/omp-entry.js.map +1 -1
- package/dist/ui/conversation-chrome.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.js +1 -1
- package/dist/ui/conversation.js +1 -1
- package/dist/ui/settings.js +2 -5
- package/dist/ui/settings.js.map +1 -1
- package/package.json +11 -11
- package/dist/chunks/chunk-3XPR2AZL.js.map +0 -7
- package/dist/chunks/chunk-G5FBLYOY.js +0 -895
- package/dist/chunks/chunk-G5FBLYOY.js.map +0 -7
- package/dist/chunks/chunk-NCPJZXLM.js.map +0 -7
- package/dist/chunks/chunk-NIWOSO22.js +0 -74
- package/dist/chunks/chunk-NIWOSO22.js.map +0 -7
- package/dist/chunks/chunk-ON7LE7QA.js.map +0 -7
- /package/dist/chunks/{chunk-DRIWQ6PD.js.map → chunk-IGCIGSJW.js.map} +0 -0
- /package/dist/chunks/{chunk-IE5HUDWQ.js.map → chunk-KLJLDI3E.js.map} +0 -0
- /package/dist/chunks/{chunk-SWHJQ6XH.js.map → chunk-R5B3W46U.js.map} +0 -0
- /package/dist/chunks/{chunk-ICADZLLJ.js.map → chunk-UJEOKJMN.js.map} +0 -0
- /package/dist/chunks/{chunk-66PGUYJJ.js.map → chunk-XABWRKSU.js.map} +0 -0
- /package/dist/chunks/{chunk-QW5LEEFV.js.map → chunk-ZHDN5ESL.js.map} +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
MAX_SUMMARY_BYTES,
|
|
2
3
|
canonicalizeText,
|
|
4
|
+
clipUtf8,
|
|
3
5
|
utf8Bytes
|
|
4
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UAP6IQIR.js";
|
|
5
7
|
|
|
6
8
|
// src/compaction/instructions.ts
|
|
7
9
|
var FABRIC_COMPACTION_REQUEST_PREFIX = "__omp_fabric_compact_request_v1__:";
|
|
@@ -391,12 +393,77 @@ var decodeCompactionInstructions = (source) => {
|
|
|
391
393
|
};
|
|
392
394
|
};
|
|
393
395
|
|
|
396
|
+
// src/compaction/render.ts
|
|
397
|
+
var SECTION_ORDER = [
|
|
398
|
+
{ key: "goal", header: "[Session Goal]", maxBytes: 4096 },
|
|
399
|
+
{ key: "files", header: "[Files And Changes]", maxBytes: 4608 },
|
|
400
|
+
{ key: "activity", header: "[Fabric Activity]", maxBytes: 2048 },
|
|
401
|
+
{ key: "outstanding", header: "[Outstanding Context]", maxBytes: 4608 },
|
|
402
|
+
{ key: "earlierTurns", header: "[Earlier Turns]", maxBytes: 3072 },
|
|
403
|
+
{ key: "status", header: "[Current Status]", maxBytes: 2048 }
|
|
404
|
+
];
|
|
405
|
+
var REQUEST_MAX_BYTES = 3072;
|
|
406
|
+
var TRANSCRIPT_MAX_BYTES = 5120;
|
|
407
|
+
var FOOTER_MAX_BYTES = 1536;
|
|
408
|
+
var MAX_INPUT_LINES_PER_SECTION = 128;
|
|
409
|
+
var MAX_RENDERED_LINE_BYTES = 1024;
|
|
410
|
+
var LCM_RECOVERY_POINTER = "For exact pre-summary history, use memory.recall on this range, then memory.expand by stable entry or operation address.";
|
|
411
|
+
var POINTER_LINE = LCM_RECOVERY_POINTER;
|
|
412
|
+
var sampledLines = (lines, keep) => {
|
|
413
|
+
if (lines.length <= keep) return [...lines];
|
|
414
|
+
const earliest = Math.ceil(keep / 2);
|
|
415
|
+
const latest = Math.floor(keep / 2);
|
|
416
|
+
return [
|
|
417
|
+
...lines.slice(0, earliest),
|
|
418
|
+
`\u2026 omitted ${lines.length - keep} rendered lines`,
|
|
419
|
+
...lines.slice(lines.length - latest)
|
|
420
|
+
];
|
|
421
|
+
};
|
|
422
|
+
var boundedBlock = (header, sourceLines, maxBytes) => {
|
|
423
|
+
const clipped = sourceLines.map((line) => clipUtf8(line, MAX_RENDERED_LINE_BYTES));
|
|
424
|
+
const capped = sampledLines(clipped, Math.min(clipped.length, MAX_INPUT_LINES_PER_SECTION));
|
|
425
|
+
for (let keep = capped.length; keep >= 0; keep--) {
|
|
426
|
+
const lines = sampledLines(capped, keep);
|
|
427
|
+
const block = [header, ...lines].join("\n");
|
|
428
|
+
if (utf8Bytes(block) <= maxBytes) return block;
|
|
429
|
+
}
|
|
430
|
+
return clipUtf8(header, maxBytes);
|
|
431
|
+
};
|
|
432
|
+
var renderSummary = (sections, options) => {
|
|
433
|
+
const blocks = [];
|
|
434
|
+
for (const { key, header, maxBytes } of SECTION_ORDER) {
|
|
435
|
+
const lines = sections[key];
|
|
436
|
+
if (lines.length === 0) continue;
|
|
437
|
+
blocks.push(boundedBlock(header, lines, maxBytes));
|
|
438
|
+
if (key === "goal" && options.requestLines && options.requestLines.length > 0) {
|
|
439
|
+
blocks.push(boundedBlock("[Compaction Request]", options.requestLines, REQUEST_MAX_BYTES));
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
if (sections.goal.length === 0 && options.requestLines && options.requestLines.length > 0) {
|
|
443
|
+
blocks.unshift(boundedBlock("[Compaction Request]", options.requestLines, REQUEST_MAX_BYTES));
|
|
444
|
+
}
|
|
445
|
+
if (sections.transcript.length > 0) {
|
|
446
|
+
blocks.push(boundedBlock("---", sections.transcript, TRANSCRIPT_MAX_BYTES));
|
|
447
|
+
}
|
|
448
|
+
const timestamp = options.lastTimestamp || "(unknown time)";
|
|
449
|
+
const range = options.firstEntryId || options.lastEntryId ? `${options.firstEntryId || "(start)"} \u2192 ${options.lastEntryId || "(end)"}` : "(no entries)";
|
|
450
|
+
const footer = options.summaryKind === "branch" ? `[branch summarized ${timestamp}; structural source entries ${range}]` : `[compacted ${timestamp}; cumulative source entries ${range}]`;
|
|
451
|
+
blocks.push(boundedBlock("---", [footer, POINTER_LINE], FOOTER_MAX_BYTES));
|
|
452
|
+
const summary = `${blocks.join("\n\n")}
|
|
453
|
+
`;
|
|
454
|
+
if (utf8Bytes(summary) <= MAX_SUMMARY_BYTES) return summary;
|
|
455
|
+
return `${clipUtf8(summary, MAX_SUMMARY_BYTES - 1, "")}
|
|
456
|
+
`;
|
|
457
|
+
};
|
|
458
|
+
|
|
394
459
|
export {
|
|
395
460
|
MAX_COMPACTION_INSTRUCTIONS_CHARS,
|
|
396
461
|
MAX_PRESERVE_ITEMS,
|
|
397
462
|
MAX_PRESERVE_ITEM_CHARS,
|
|
398
463
|
compactionRequestBoundsError,
|
|
399
464
|
encodeCompactionRequest,
|
|
400
|
-
decodeCompactionInstructions
|
|
465
|
+
decodeCompactionInstructions,
|
|
466
|
+
LCM_RECOVERY_POINTER,
|
|
467
|
+
renderSummary
|
|
401
468
|
};
|
|
402
|
-
//# sourceMappingURL=chunk-
|
|
469
|
+
//# sourceMappingURL=chunk-QSRTEINF.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/compaction/instructions.ts"],
|
|
4
|
-
"sourcesContent": ["import { canonicalizeText, utf8Bytes } from \"./bounds.js\";\n\nexport const FABRIC_COMPACTION_REQUEST_PREFIX = \"__omp_fabric_compact_request_v1__:\";\nexport const MAX_COMPACTION_INSTRUCTIONS_CHARS = 8 * 1024;\nconst MAX_COMPACTION_INSTRUCTIONS_BYTES = 8 * 1024;\nexport const MAX_PRESERVE_ITEMS = 16;\nexport const MAX_PRESERVE_ITEM_CHARS = 2 * 1024;\nconst MAX_PRESERVE_ITEM_BYTES = 2 * 1024;\nexport const MAX_TYPED_COMPACTION_SOURCE_BYTES = 16 * 1024;\n\nexport interface TypedCompactionRequest {\n version: 1;\n instructions?: string;\n preserve?: string[];\n}\n\nexport interface CompactionInstructionPolicy {\n mode: \"none\" | \"plain\" | \"typed-v1\";\n canonicalized: boolean;\n sourceBytes: number;\n truncated: boolean;\n preserveCount: number;\n omittedPreserveCount: number;\n}\n\ntype CompactionInstructionErrorCode =\n | \"encoded-source-too-large\"\n | \"malformed-json\"\n | \"duplicate-field\"\n | \"invalid-unicode\"\n | \"structure-too-complex\"\n | \"invalid-object\"\n | \"unknown-field\"\n | \"unsupported-version\"\n | \"invalid-type\"\n | \"instructions-too-large\"\n | \"preserve-too-many\"\n | \"preserve-item-too-large\";\n\nexport interface CompactionInstructionDecodeError {\n code: CompactionInstructionErrorCode;\n message: string;\n sourceBytes: number;\n}\n\nexport type DecodedCompactionInstructions =\n | {\n ok: true;\n requestLines: string[];\n policy: CompactionInstructionPolicy;\n }\n | {\n ok: false;\n requestLines: [];\n error: CompactionInstructionDecodeError;\n };\n\nconst rejection = (\n code: CompactionInstructionErrorCode,\n message: string,\n sourceBytes: number,\n): DecodedCompactionInstructions => ({\n ok: false,\n requestLines: [],\n error: { code, message, sourceBytes },\n});\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === \"object\" && !Array.isArray(value);\n\nconst hasPairedSurrogates = (value: string): boolean => {\n for (let index = 0; index < value.length; index++) {\n const unit = value.charCodeAt(index);\n if (unit >= 0xd800 && unit <= 0xdbff) {\n const next = value.charCodeAt(index + 1);\n if (!(next >= 0xdc00 && next <= 0xdfff)) return false;\n index += 1;\n } else if (unit >= 0xdc00 && unit <= 0xdfff) {\n return false;\n }\n }\n return true;\n};\n\nexport const compactionRequestBoundsError = (\n request: Omit<TypedCompactionRequest, \"version\">,\n): Omit<CompactionInstructionDecodeError, \"sourceBytes\"> | undefined => {\n if (request.instructions !== undefined) {\n if (!hasPairedSurrogates(request.instructions)) {\n return {\n code: \"invalid-unicode\",\n message: \"typed compaction instructions contain an unpaired UTF-16 surrogate\",\n };\n }\n if (request.instructions.length > MAX_COMPACTION_INSTRUCTIONS_CHARS\n || utf8Bytes(request.instructions) > MAX_COMPACTION_INSTRUCTIONS_BYTES) {\n return {\n code: \"instructions-too-large\",\n message: `typed compaction instructions exceed ${MAX_COMPACTION_INSTRUCTIONS_CHARS} characters or ${MAX_COMPACTION_INSTRUCTIONS_BYTES} UTF-8 bytes`,\n };\n }\n }\n if (request.preserve !== undefined) {\n if (request.preserve.length > MAX_PRESERVE_ITEMS) {\n return {\n code: \"preserve-too-many\",\n message: `typed compaction preserve exceeds ${MAX_PRESERVE_ITEMS} items`,\n };\n }\n for (const item of request.preserve) {\n if (!hasPairedSurrogates(item)) {\n return {\n code: \"invalid-unicode\",\n message: \"typed compaction preserve item contains an unpaired UTF-16 surrogate\",\n };\n }\n if (item.length > MAX_PRESERVE_ITEM_CHARS || utf8Bytes(item) > MAX_PRESERVE_ITEM_BYTES) {\n return {\n code: \"preserve-item-too-large\",\n message: `typed compaction preserve item exceeds ${MAX_PRESERVE_ITEM_CHARS} characters or ${MAX_PRESERVE_ITEM_BYTES} UTF-8 bytes`,\n };\n }\n }\n }\n return undefined;\n};\n\nexport const encodeCompactionRequest = (request: Omit<TypedCompactionRequest, \"version\">): string => {\n const boundsError = compactionRequestBoundsError(request);\n if (boundsError) throw new Error(boundsError.message);\n const payload: TypedCompactionRequest = {\n version: 1,\n ...(request.instructions !== undefined ? { instructions: request.instructions } : {}),\n ...(request.preserve !== undefined ? { preserve: request.preserve } : {}),\n };\n const encoded = `${FABRIC_COMPACTION_REQUEST_PREFIX}${JSON.stringify(payload)}`;\n if (utf8Bytes(encoded) > MAX_TYPED_COMPACTION_SOURCE_BYTES) {\n throw new Error(`typed compaction request exceeds ${MAX_TYPED_COMPACTION_SOURCE_BYTES} encoded UTF-8 bytes`);\n }\n return encoded;\n};\n\nconst plainInstructions = (source: string): DecodedCompactionInstructions => {\n const canonical = canonicalizeText(source);\n return {\n ok: true,\n requestLines: canonical.text ? [canonical.text] : [],\n policy: {\n mode: \"plain\",\n canonicalized: canonical.text !== source,\n sourceBytes: canonical.sourceBytes,\n truncated: canonical.truncated,\n preserveCount: 0,\n omittedPreserveCount: 0,\n },\n };\n};\n\nclass StrictJsonError extends Error {\n constructor(\n readonly code: \"malformed-json\" | \"duplicate-field\" | \"invalid-unicode\" | \"structure-too-complex\",\n message: string,\n ) {\n super(message);\n }\n}\n\nconst MAX_TYPED_JSON_DEPTH = 32;\nconst MAX_TYPED_JSON_NODES = 4096;\n\nclass StrictJsonParser {\n private index = 0;\n private nodes = 0;\n\n constructor(private readonly source: string) {}\n\n parse(): unknown {\n this.skipWhitespace();\n const value = this.parseValue(0);\n this.skipWhitespace();\n if (this.index !== this.source.length) this.malformed();\n return value;\n }\n\n private parseValue(depth: number): unknown {\n if (depth > MAX_TYPED_JSON_DEPTH) {\n throw new StrictJsonError(\"structure-too-complex\", \"typed compaction JSON exceeds the structural depth limit\");\n }\n this.nodes += 1;\n if (this.nodes > MAX_TYPED_JSON_NODES) {\n throw new StrictJsonError(\"structure-too-complex\", \"typed compaction JSON exceeds the structural node limit\");\n }\n const character = this.source[this.index];\n if (character === \"{\") return this.parseObject(depth + 1);\n if (character === \"[\") return this.parseArray(depth + 1);\n if (character === \"\\\"\") return this.parseString();\n if (character === \"t\") return this.parseLiteral(\"true\", true);\n if (character === \"f\") return this.parseLiteral(\"false\", false);\n if (character === \"n\") return this.parseLiteral(\"null\", null);\n if (character === \"-\" || (character !== undefined && character >= \"0\" && character <= \"9\")) {\n return this.parseNumber();\n }\n return this.malformed();\n }\n\n private parseObject(depth: number): Record<string, unknown> {\n this.index += 1;\n this.skipWhitespace();\n const output = Object.create(null) as Record<string, unknown>;\n const keys = new Set<string>();\n if (this.source[this.index] === \"}\") {\n this.index += 1;\n return output;\n }\n while (this.index < this.source.length) {\n if (this.source[this.index] !== \"\\\"\") this.malformed();\n const key = this.parseString();\n if (keys.has(key)) {\n throw new StrictJsonError(\"duplicate-field\", `typed compaction request contains duplicate field ${JSON.stringify(key)}`);\n }\n keys.add(key);\n this.skipWhitespace();\n if (this.source[this.index] !== \":\") this.malformed();\n this.index += 1;\n this.skipWhitespace();\n output[key] = this.parseValue(depth);\n this.skipWhitespace();\n const delimiter = this.source[this.index];\n if (delimiter === \"}\") {\n this.index += 1;\n return output;\n }\n if (delimiter !== \",\") this.malformed();\n this.index += 1;\n this.skipWhitespace();\n }\n return this.malformed();\n }\n\n private parseArray(depth: number): unknown[] {\n this.index += 1;\n this.skipWhitespace();\n const output: unknown[] = [];\n if (this.source[this.index] === \"]\") {\n this.index += 1;\n return output;\n }\n while (this.index < this.source.length) {\n output.push(this.parseValue(depth));\n this.skipWhitespace();\n const delimiter = this.source[this.index];\n if (delimiter === \"]\") {\n this.index += 1;\n return output;\n }\n if (delimiter !== \",\") this.malformed();\n this.index += 1;\n this.skipWhitespace();\n }\n return this.malformed();\n }\n\n private parseString(): string {\n this.index += 1;\n let output = \"\";\n while (this.index < this.source.length) {\n const unit = this.source.charCodeAt(this.index);\n if (unit === 0x22) {\n this.index += 1;\n if (!hasPairedSurrogates(output)) {\n throw new StrictJsonError(\"invalid-unicode\", \"typed compaction JSON string contains an unpaired UTF-16 surrogate\");\n }\n return output;\n }\n if (unit <= 0x1f) this.malformed();\n if (unit !== 0x5c) {\n output += this.source[this.index]!;\n this.index += 1;\n continue;\n }\n this.index += 1;\n const escape = this.source[this.index];\n this.index += 1;\n if (escape === \"\\\"\" || escape === \"\\\\\" || escape === \"/\") output += escape;\n else if (escape === \"b\") output += \"\\b\";\n else if (escape === \"f\") output += \"\\f\";\n else if (escape === \"n\") output += \"\\n\";\n else if (escape === \"r\") output += \"\\r\";\n else if (escape === \"t\") output += \"\\t\";\n else if (escape === \"u\") {\n let value = 0;\n for (let offset = 0; offset < 4; offset++) {\n const digit = this.hexValue(this.source.charCodeAt(this.index + offset));\n if (digit < 0) this.malformed();\n value = value * 16 + digit;\n }\n this.index += 4;\n output += String.fromCharCode(value);\n } else {\n this.malformed();\n }\n }\n return this.malformed();\n }\n\n private parseNumber(): number {\n const start = this.index;\n if (this.source[this.index] === \"-\") this.index += 1;\n if (this.source[this.index] === \"0\") {\n this.index += 1;\n if (this.isDigit(this.source.charCodeAt(this.index))) this.malformed();\n } else {\n if (!this.isDigitOneToNine(this.source.charCodeAt(this.index))) this.malformed();\n while (this.isDigit(this.source.charCodeAt(this.index))) this.index += 1;\n }\n if (this.source[this.index] === \".\") {\n this.index += 1;\n if (!this.isDigit(this.source.charCodeAt(this.index))) this.malformed();\n while (this.isDigit(this.source.charCodeAt(this.index))) this.index += 1;\n }\n const exponent = this.source[this.index];\n if (exponent === \"e\" || exponent === \"E\") {\n this.index += 1;\n const sign = this.source[this.index];\n if (sign === \"+\" || sign === \"-\") this.index += 1;\n if (!this.isDigit(this.source.charCodeAt(this.index))) this.malformed();\n while (this.isDigit(this.source.charCodeAt(this.index))) this.index += 1;\n }\n const value = Number(this.source.slice(start, this.index));\n if (!Number.isFinite(value)) this.malformed();\n return value;\n }\n\n private parseLiteral<T>(literal: string, value: T): T {\n if (!this.source.startsWith(literal, this.index)) this.malformed();\n this.index += literal.length;\n return value;\n }\n\n private skipWhitespace(): void {\n while (this.index < this.source.length) {\n const unit = this.source.charCodeAt(this.index);\n if (unit !== 0x20 && unit !== 0x09 && unit !== 0x0a && unit !== 0x0d) return;\n this.index += 1;\n }\n }\n\n private hexValue(unit: number): number {\n if (unit >= 0x30 && unit <= 0x39) return unit - 0x30;\n if (unit >= 0x41 && unit <= 0x46) return unit - 0x41 + 10;\n if (unit >= 0x61 && unit <= 0x66) return unit - 0x61 + 10;\n return -1;\n }\n\n private isDigit(unit: number): boolean {\n return unit >= 0x30 && unit <= 0x39;\n }\n\n private isDigitOneToNine(unit: number): boolean {\n return unit >= 0x31 && unit <= 0x39;\n }\n\n private malformed(): never {\n throw new StrictJsonError(\"malformed-json\", \"typed compaction request contains malformed JSON\");\n }\n}\n\nexport const decodeCompactionInstructions = (\n source: string | undefined,\n): DecodedCompactionInstructions => {\n if (source === undefined || source === \"\") {\n return {\n ok: true,\n requestLines: [],\n policy: {\n mode: \"none\",\n canonicalized: false,\n sourceBytes: 0,\n truncated: false,\n preserveCount: 0,\n omittedPreserveCount: 0,\n },\n };\n }\n if (!source.startsWith(FABRIC_COMPACTION_REQUEST_PREFIX)) return plainInstructions(source);\n\n const encodedSourceBytes = utf8Bytes(source);\n if (encodedSourceBytes > MAX_TYPED_COMPACTION_SOURCE_BYTES) {\n return rejection(\n \"encoded-source-too-large\",\n `typed compaction request exceeds ${MAX_TYPED_COMPACTION_SOURCE_BYTES} encoded UTF-8 bytes`,\n encodedSourceBytes,\n );\n }\n\n let parsed: unknown;\n try {\n parsed = new StrictJsonParser(source.slice(FABRIC_COMPACTION_REQUEST_PREFIX.length)).parse();\n } catch (error) {\n if (error instanceof StrictJsonError) {\n return rejection(error.code, error.message, encodedSourceBytes);\n }\n return rejection(\"malformed-json\", \"typed compaction request contains malformed JSON\", encodedSourceBytes);\n }\n if (!isRecord(parsed)) {\n return rejection(\"invalid-object\", \"typed compaction request must be a JSON object\", encodedSourceBytes);\n }\n\n const keys = Object.keys(parsed);\n const unknownField = keys.find((key) => key !== \"version\" && key !== \"instructions\" && key !== \"preserve\");\n if (unknownField !== undefined) {\n return rejection(\"unknown-field\", `typed compaction request contains unknown field ${JSON.stringify(unknownField)}`, encodedSourceBytes);\n }\n if (parsed.version !== 1) {\n return rejection(\"unsupported-version\", \"typed compaction request version must be 1\", encodedSourceBytes);\n }\n if (parsed.instructions !== undefined && typeof parsed.instructions !== \"string\") {\n return rejection(\"invalid-type\", \"typed compaction request instructions must be a string\", encodedSourceBytes);\n }\n if (parsed.preserve !== undefined && !Array.isArray(parsed.preserve)) {\n return rejection(\"invalid-type\", \"typed compaction request preserve must be an array\", encodedSourceBytes);\n }\n\n const preserve = parsed.preserve as unknown[] | undefined;\n if (preserve !== undefined && preserve.length > MAX_PRESERVE_ITEMS) {\n return rejection(\n \"preserve-too-many\",\n `typed compaction preserve exceeds ${MAX_PRESERVE_ITEMS} items`,\n encodedSourceBytes,\n );\n }\n if (preserve !== undefined && !preserve.every((item) => typeof item === \"string\")) {\n return rejection(\"invalid-type\", \"typed compaction preserve items must be strings\", encodedSourceBytes);\n }\n\n const request: Omit<TypedCompactionRequest, \"version\"> = {\n ...(parsed.instructions !== undefined ? { instructions: parsed.instructions } : {}),\n ...(preserve !== undefined ? { preserve: preserve as string[] } : {}),\n };\n const boundsError = compactionRequestBoundsError(request);\n if (boundsError) return rejection(boundsError.code, boundsError.message, encodedSourceBytes);\n\n const requestLines: string[] = [];\n let valueSourceBytes = 0;\n let truncated = false;\n let canonicalized = false;\n if (request.instructions !== undefined) {\n const instructions = canonicalizeText(request.instructions, MAX_COMPACTION_INSTRUCTIONS_BYTES);\n valueSourceBytes += instructions.sourceBytes;\n truncated ||= instructions.truncated;\n canonicalized ||= instructions.text !== request.instructions;\n if (instructions.text) requestLines.push(instructions.text);\n }\n\n for (let index = 0; index < (request.preserve?.length ?? 0); index++) {\n const sourceItem = request.preserve![index]!;\n const item = canonicalizeText(sourceItem, MAX_PRESERVE_ITEM_BYTES);\n valueSourceBytes += item.sourceBytes;\n truncated ||= item.truncated;\n canonicalized ||= item.text !== sourceItem;\n if (item.text) requestLines.push(`- ${item.text} [preserve:${index}]`);\n }\n\n return {\n ok: true,\n requestLines,\n policy: {\n mode: \"typed-v1\",\n canonicalized,\n sourceBytes: valueSourceBytes,\n truncated,\n preserveCount: request.preserve?.length ?? 0,\n omittedPreserveCount: 0,\n },\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;AAEO,IAAM,mCAAmC;AACzC,IAAM,oCAAoC,IAAI;AACrD,IAAM,oCAAoC,IAAI;AACvC,IAAM,qBAAqB;AAC3B,IAAM,0BAA0B,IAAI;AAC3C,IAAM,0BAA0B,IAAI;AAC7B,IAAM,oCAAoC,KAAK;AAiDtD,IAAM,YAAY,CAChB,MACA,SACA,iBACmC;AAAA,EACnC,IAAI;AAAA,EACJ,cAAc,CAAC;AAAA,EACf,OAAO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AgB;AACpB,MAAI,QAAQ,iBAAiB,QAAW;AACtC,UAAM,eAAe,iBAAiB,QAAQ,cAAc,iCAAiC;AAC7F,wBAAoB,aAAa;AACjC,kBAAc,aAAa;AAC3B,sBAAkB,aAAa,SAAS,QAAQ;AAChD,QAAI,aAAa,KAAM,cAAa,KAAK,aAAa,IAAI;AAAA,EAC5D;AAEA,WAAS,QAAQ,GAAG,SAAS,QAAQ,UAAU,UAAU,IAAI,SAAS;AACpE,UAAM,aAAa,QAAQ,SAAU,KAAK;AAC1C,UAAM,OAAO,iBAAiB,YAAY,uBAAuB;AACjE,wBAAoB,KAAK;AACzB,kBAAc,KAAK;AACnB,sBAAkB,KAAK,SAAS;AAChC,QAAI,KAAK,KAAM,cAAa,KAAK,KAAK,KAAK,IAAI,cAAc,KAAK,GAAG;AAAA,EACvE;AAEA,SAAO;AAAA,IACL,IAAI;AAAA,IACJ;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN;AAAA,MACA,aAAa;AAAA,MACb;AAAA,MACA,eAAe,QAAQ,UAAU,UAAU;AAAA,MAC3C,sBAAsB;AAAA,IACxB;AAAA,EACF;AACF;",
|
|
3
|
+
"sources": ["../../src/compaction/instructions.ts", "../../src/compaction/render.ts"],
|
|
4
|
+
"sourcesContent": ["import { canonicalizeText, utf8Bytes } from \"./bounds.js\";\n\nexport const FABRIC_COMPACTION_REQUEST_PREFIX = \"__omp_fabric_compact_request_v1__:\";\nexport const MAX_COMPACTION_INSTRUCTIONS_CHARS = 8 * 1024;\nconst MAX_COMPACTION_INSTRUCTIONS_BYTES = 8 * 1024;\nexport const MAX_PRESERVE_ITEMS = 16;\nexport const MAX_PRESERVE_ITEM_CHARS = 2 * 1024;\nconst MAX_PRESERVE_ITEM_BYTES = 2 * 1024;\nexport const MAX_TYPED_COMPACTION_SOURCE_BYTES = 16 * 1024;\n\nexport interface TypedCompactionRequest {\n version: 1;\n instructions?: string;\n preserve?: string[];\n}\n\nexport interface CompactionInstructionPolicy {\n mode: \"none\" | \"plain\" | \"typed-v1\";\n canonicalized: boolean;\n sourceBytes: number;\n truncated: boolean;\n preserveCount: number;\n omittedPreserveCount: number;\n}\n\ntype CompactionInstructionErrorCode =\n | \"encoded-source-too-large\"\n | \"malformed-json\"\n | \"duplicate-field\"\n | \"invalid-unicode\"\n | \"structure-too-complex\"\n | \"invalid-object\"\n | \"unknown-field\"\n | \"unsupported-version\"\n | \"invalid-type\"\n | \"instructions-too-large\"\n | \"preserve-too-many\"\n | \"preserve-item-too-large\";\n\nexport interface CompactionInstructionDecodeError {\n code: CompactionInstructionErrorCode;\n message: string;\n sourceBytes: number;\n}\n\nexport type DecodedCompactionInstructions =\n | {\n ok: true;\n requestLines: string[];\n policy: CompactionInstructionPolicy;\n }\n | {\n ok: false;\n requestLines: [];\n error: CompactionInstructionDecodeError;\n };\n\nconst rejection = (\n code: CompactionInstructionErrorCode,\n message: string,\n sourceBytes: number,\n): DecodedCompactionInstructions => ({\n ok: false,\n requestLines: [],\n error: { code, message, sourceBytes },\n});\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === \"object\" && !Array.isArray(value);\n\nconst hasPairedSurrogates = (value: string): boolean => {\n for (let index = 0; index < value.length; index++) {\n const unit = value.charCodeAt(index);\n if (unit >= 0xd800 && unit <= 0xdbff) {\n const next = value.charCodeAt(index + 1);\n if (!(next >= 0xdc00 && next <= 0xdfff)) return false;\n index += 1;\n } else if (unit >= 0xdc00 && unit <= 0xdfff) {\n return false;\n }\n }\n return true;\n};\n\nexport const compactionRequestBoundsError = (\n request: Omit<TypedCompactionRequest, \"version\">,\n): Omit<CompactionInstructionDecodeError, \"sourceBytes\"> | undefined => {\n if (request.instructions !== undefined) {\n if (!hasPairedSurrogates(request.instructions)) {\n return {\n code: \"invalid-unicode\",\n message: \"typed compaction instructions contain an unpaired UTF-16 surrogate\",\n };\n }\n if (request.instructions.length > MAX_COMPACTION_INSTRUCTIONS_CHARS\n || utf8Bytes(request.instructions) > MAX_COMPACTION_INSTRUCTIONS_BYTES) {\n return {\n code: \"instructions-too-large\",\n message: `typed compaction instructions exceed ${MAX_COMPACTION_INSTRUCTIONS_CHARS} characters or ${MAX_COMPACTION_INSTRUCTIONS_BYTES} UTF-8 bytes`,\n };\n }\n }\n if (request.preserve !== undefined) {\n if (request.preserve.length > MAX_PRESERVE_ITEMS) {\n return {\n code: \"preserve-too-many\",\n message: `typed compaction preserve exceeds ${MAX_PRESERVE_ITEMS} items`,\n };\n }\n for (const item of request.preserve) {\n if (!hasPairedSurrogates(item)) {\n return {\n code: \"invalid-unicode\",\n message: \"typed compaction preserve item contains an unpaired UTF-16 surrogate\",\n };\n }\n if (item.length > MAX_PRESERVE_ITEM_CHARS || utf8Bytes(item) > MAX_PRESERVE_ITEM_BYTES) {\n return {\n code: \"preserve-item-too-large\",\n message: `typed compaction preserve item exceeds ${MAX_PRESERVE_ITEM_CHARS} characters or ${MAX_PRESERVE_ITEM_BYTES} UTF-8 bytes`,\n };\n }\n }\n }\n return undefined;\n};\n\nexport const encodeCompactionRequest = (request: Omit<TypedCompactionRequest, \"version\">): string => {\n const boundsError = compactionRequestBoundsError(request);\n if (boundsError) throw new Error(boundsError.message);\n const payload: TypedCompactionRequest = {\n version: 1,\n ...(request.instructions !== undefined ? { instructions: request.instructions } : {}),\n ...(request.preserve !== undefined ? { preserve: request.preserve } : {}),\n };\n const encoded = `${FABRIC_COMPACTION_REQUEST_PREFIX}${JSON.stringify(payload)}`;\n if (utf8Bytes(encoded) > MAX_TYPED_COMPACTION_SOURCE_BYTES) {\n throw new Error(`typed compaction request exceeds ${MAX_TYPED_COMPACTION_SOURCE_BYTES} encoded UTF-8 bytes`);\n }\n return encoded;\n};\n\nconst plainInstructions = (source: string): DecodedCompactionInstructions => {\n const canonical = canonicalizeText(source);\n return {\n ok: true,\n requestLines: canonical.text ? [canonical.text] : [],\n policy: {\n mode: \"plain\",\n canonicalized: canonical.text !== source,\n sourceBytes: canonical.sourceBytes,\n truncated: canonical.truncated,\n preserveCount: 0,\n omittedPreserveCount: 0,\n },\n };\n};\n\nclass StrictJsonError extends Error {\n constructor(\n readonly code: \"malformed-json\" | \"duplicate-field\" | \"invalid-unicode\" | \"structure-too-complex\",\n message: string,\n ) {\n super(message);\n }\n}\n\nconst MAX_TYPED_JSON_DEPTH = 32;\nconst MAX_TYPED_JSON_NODES = 4096;\n\nclass StrictJsonParser {\n private index = 0;\n private nodes = 0;\n\n constructor(private readonly source: string) {}\n\n parse(): unknown {\n this.skipWhitespace();\n const value = this.parseValue(0);\n this.skipWhitespace();\n if (this.index !== this.source.length) this.malformed();\n return value;\n }\n\n private parseValue(depth: number): unknown {\n if (depth > MAX_TYPED_JSON_DEPTH) {\n throw new StrictJsonError(\"structure-too-complex\", \"typed compaction JSON exceeds the structural depth limit\");\n }\n this.nodes += 1;\n if (this.nodes > MAX_TYPED_JSON_NODES) {\n throw new StrictJsonError(\"structure-too-complex\", \"typed compaction JSON exceeds the structural node limit\");\n }\n const character = this.source[this.index];\n if (character === \"{\") return this.parseObject(depth + 1);\n if (character === \"[\") return this.parseArray(depth + 1);\n if (character === \"\\\"\") return this.parseString();\n if (character === \"t\") return this.parseLiteral(\"true\", true);\n if (character === \"f\") return this.parseLiteral(\"false\", false);\n if (character === \"n\") return this.parseLiteral(\"null\", null);\n if (character === \"-\" || (character !== undefined && character >= \"0\" && character <= \"9\")) {\n return this.parseNumber();\n }\n return this.malformed();\n }\n\n private parseObject(depth: number): Record<string, unknown> {\n this.index += 1;\n this.skipWhitespace();\n const output = Object.create(null) as Record<string, unknown>;\n const keys = new Set<string>();\n if (this.source[this.index] === \"}\") {\n this.index += 1;\n return output;\n }\n while (this.index < this.source.length) {\n if (this.source[this.index] !== \"\\\"\") this.malformed();\n const key = this.parseString();\n if (keys.has(key)) {\n throw new StrictJsonError(\"duplicate-field\", `typed compaction request contains duplicate field ${JSON.stringify(key)}`);\n }\n keys.add(key);\n this.skipWhitespace();\n if (this.source[this.index] !== \":\") this.malformed();\n this.index += 1;\n this.skipWhitespace();\n output[key] = this.parseValue(depth);\n this.skipWhitespace();\n const delimiter = this.source[this.index];\n if (delimiter === \"}\") {\n this.index += 1;\n return output;\n }\n if (delimiter !== \",\") this.malformed();\n this.index += 1;\n this.skipWhitespace();\n }\n return this.malformed();\n }\n\n private parseArray(depth: number): unknown[] {\n this.index += 1;\n this.skipWhitespace();\n const output: unknown[] = [];\n if (this.source[this.index] === \"]\") {\n this.index += 1;\n return output;\n }\n while (this.index < this.source.length) {\n output.push(this.parseValue(depth));\n this.skipWhitespace();\n const delimiter = this.source[this.index];\n if (delimiter === \"]\") {\n this.index += 1;\n return output;\n }\n if (delimiter !== \",\") this.malformed();\n this.index += 1;\n this.skipWhitespace();\n }\n return this.malformed();\n }\n\n private parseString(): string {\n this.index += 1;\n let output = \"\";\n while (this.index < this.source.length) {\n const unit = this.source.charCodeAt(this.index);\n if (unit === 0x22) {\n this.index += 1;\n if (!hasPairedSurrogates(output)) {\n throw new StrictJsonError(\"invalid-unicode\", \"typed compaction JSON string contains an unpaired UTF-16 surrogate\");\n }\n return output;\n }\n if (unit <= 0x1f) this.malformed();\n if (unit !== 0x5c) {\n output += this.source[this.index]!;\n this.index += 1;\n continue;\n }\n this.index += 1;\n const escape = this.source[this.index];\n this.index += 1;\n if (escape === \"\\\"\" || escape === \"\\\\\" || escape === \"/\") output += escape;\n else if (escape === \"b\") output += \"\\b\";\n else if (escape === \"f\") output += \"\\f\";\n else if (escape === \"n\") output += \"\\n\";\n else if (escape === \"r\") output += \"\\r\";\n else if (escape === \"t\") output += \"\\t\";\n else if (escape === \"u\") {\n let value = 0;\n for (let offset = 0; offset < 4; offset++) {\n const digit = this.hexValue(this.source.charCodeAt(this.index + offset));\n if (digit < 0) this.malformed();\n value = value * 16 + digit;\n }\n this.index += 4;\n output += String.fromCharCode(value);\n } else {\n this.malformed();\n }\n }\n return this.malformed();\n }\n\n private parseNumber(): number {\n const start = this.index;\n if (this.source[this.index] === \"-\") this.index += 1;\n if (this.source[this.index] === \"0\") {\n this.index += 1;\n if (this.isDigit(this.source.charCodeAt(this.index))) this.malformed();\n } else {\n if (!this.isDigitOneToNine(this.source.charCodeAt(this.index))) this.malformed();\n while (this.isDigit(this.source.charCodeAt(this.index))) this.index += 1;\n }\n if (this.source[this.index] === \".\") {\n this.index += 1;\n if (!this.isDigit(this.source.charCodeAt(this.index))) this.malformed();\n while (this.isDigit(this.source.charCodeAt(this.index))) this.index += 1;\n }\n const exponent = this.source[this.index];\n if (exponent === \"e\" || exponent === \"E\") {\n this.index += 1;\n const sign = this.source[this.index];\n if (sign === \"+\" || sign === \"-\") this.index += 1;\n if (!this.isDigit(this.source.charCodeAt(this.index))) this.malformed();\n while (this.isDigit(this.source.charCodeAt(this.index))) this.index += 1;\n }\n const value = Number(this.source.slice(start, this.index));\n if (!Number.isFinite(value)) this.malformed();\n return value;\n }\n\n private parseLiteral<T>(literal: string, value: T): T {\n if (!this.source.startsWith(literal, this.index)) this.malformed();\n this.index += literal.length;\n return value;\n }\n\n private skipWhitespace(): void {\n while (this.index < this.source.length) {\n const unit = this.source.charCodeAt(this.index);\n if (unit !== 0x20 && unit !== 0x09 && unit !== 0x0a && unit !== 0x0d) return;\n this.index += 1;\n }\n }\n\n private hexValue(unit: number): number {\n if (unit >= 0x30 && unit <= 0x39) return unit - 0x30;\n if (unit >= 0x41 && unit <= 0x46) return unit - 0x41 + 10;\n if (unit >= 0x61 && unit <= 0x66) return unit - 0x61 + 10;\n return -1;\n }\n\n private isDigit(unit: number): boolean {\n return unit >= 0x30 && unit <= 0x39;\n }\n\n private isDigitOneToNine(unit: number): boolean {\n return unit >= 0x31 && unit <= 0x39;\n }\n\n private malformed(): never {\n throw new StrictJsonError(\"malformed-json\", \"typed compaction request contains malformed JSON\");\n }\n}\n\nexport const decodeCompactionInstructions = (\n source: string | undefined,\n): DecodedCompactionInstructions => {\n if (source === undefined || source === \"\") {\n return {\n ok: true,\n requestLines: [],\n policy: {\n mode: \"none\",\n canonicalized: false,\n sourceBytes: 0,\n truncated: false,\n preserveCount: 0,\n omittedPreserveCount: 0,\n },\n };\n }\n if (!source.startsWith(FABRIC_COMPACTION_REQUEST_PREFIX)) return plainInstructions(source);\n\n const encodedSourceBytes = utf8Bytes(source);\n if (encodedSourceBytes > MAX_TYPED_COMPACTION_SOURCE_BYTES) {\n return rejection(\n \"encoded-source-too-large\",\n `typed compaction request exceeds ${MAX_TYPED_COMPACTION_SOURCE_BYTES} encoded UTF-8 bytes`,\n encodedSourceBytes,\n );\n }\n\n let parsed: unknown;\n try {\n parsed = new StrictJsonParser(source.slice(FABRIC_COMPACTION_REQUEST_PREFIX.length)).parse();\n } catch (error) {\n if (error instanceof StrictJsonError) {\n return rejection(error.code, error.message, encodedSourceBytes);\n }\n return rejection(\"malformed-json\", \"typed compaction request contains malformed JSON\", encodedSourceBytes);\n }\n if (!isRecord(parsed)) {\n return rejection(\"invalid-object\", \"typed compaction request must be a JSON object\", encodedSourceBytes);\n }\n\n const keys = Object.keys(parsed);\n const unknownField = keys.find((key) => key !== \"version\" && key !== \"instructions\" && key !== \"preserve\");\n if (unknownField !== undefined) {\n return rejection(\"unknown-field\", `typed compaction request contains unknown field ${JSON.stringify(unknownField)}`, encodedSourceBytes);\n }\n if (parsed.version !== 1) {\n return rejection(\"unsupported-version\", \"typed compaction request version must be 1\", encodedSourceBytes);\n }\n if (parsed.instructions !== undefined && typeof parsed.instructions !== \"string\") {\n return rejection(\"invalid-type\", \"typed compaction request instructions must be a string\", encodedSourceBytes);\n }\n if (parsed.preserve !== undefined && !Array.isArray(parsed.preserve)) {\n return rejection(\"invalid-type\", \"typed compaction request preserve must be an array\", encodedSourceBytes);\n }\n\n const preserve = parsed.preserve as unknown[] | undefined;\n if (preserve !== undefined && preserve.length > MAX_PRESERVE_ITEMS) {\n return rejection(\n \"preserve-too-many\",\n `typed compaction preserve exceeds ${MAX_PRESERVE_ITEMS} items`,\n encodedSourceBytes,\n );\n }\n if (preserve !== undefined && !preserve.every((item) => typeof item === \"string\")) {\n return rejection(\"invalid-type\", \"typed compaction preserve items must be strings\", encodedSourceBytes);\n }\n\n const request: Omit<TypedCompactionRequest, \"version\"> = {\n ...(parsed.instructions !== undefined ? { instructions: parsed.instructions } : {}),\n ...(preserve !== undefined ? { preserve: preserve as string[] } : {}),\n };\n const boundsError = compactionRequestBoundsError(request);\n if (boundsError) return rejection(boundsError.code, boundsError.message, encodedSourceBytes);\n\n const requestLines: string[] = [];\n let valueSourceBytes = 0;\n let truncated = false;\n let canonicalized = false;\n if (request.instructions !== undefined) {\n const instructions = canonicalizeText(request.instructions, MAX_COMPACTION_INSTRUCTIONS_BYTES);\n valueSourceBytes += instructions.sourceBytes;\n truncated ||= instructions.truncated;\n canonicalized ||= instructions.text !== request.instructions;\n if (instructions.text) requestLines.push(instructions.text);\n }\n\n for (let index = 0; index < (request.preserve?.length ?? 0); index++) {\n const sourceItem = request.preserve![index]!;\n const item = canonicalizeText(sourceItem, MAX_PRESERVE_ITEM_BYTES);\n valueSourceBytes += item.sourceBytes;\n truncated ||= item.truncated;\n canonicalized ||= item.text !== sourceItem;\n if (item.text) requestLines.push(`- ${item.text} [preserve:${index}]`);\n }\n\n return {\n ok: true,\n requestLines,\n policy: {\n mode: \"typed-v1\",\n canonicalized,\n sourceBytes: valueSourceBytes,\n truncated,\n preserveCount: request.preserve?.length ?? 0,\n omittedPreserveCount: 0,\n },\n };\n};\n", "import { clipUtf8, MAX_SUMMARY_BYTES, utf8Bytes } from \"./bounds.js\";\nimport type { Sections } from \"./projections.js\";\n\nconst SECTION_ORDER: { key: keyof Sections; header: string; maxBytes: number }[] = [\n { key: \"goal\", header: \"[Session Goal]\", maxBytes: 4096 },\n { key: \"files\", header: \"[Files And Changes]\", maxBytes: 4608 },\n { key: \"activity\", header: \"[Fabric Activity]\", maxBytes: 2048 },\n { key: \"outstanding\", header: \"[Outstanding Context]\", maxBytes: 4608 },\n { key: \"earlierTurns\", header: \"[Earlier Turns]\", maxBytes: 3072 },\n { key: \"status\", header: \"[Current Status]\", maxBytes: 2048 },\n];\n\nconst REQUEST_MAX_BYTES = 3072;\nconst TRANSCRIPT_MAX_BYTES = 5120;\nconst FOOTER_MAX_BYTES = 1536;\nconst MAX_INPUT_LINES_PER_SECTION = 128;\nconst MAX_RENDERED_LINE_BYTES = 1024;\n\nexport interface RenderOptions {\n firstEntryId: string;\n lastEntryId: string;\n lastTimestamp: string;\n requestLines?: string[];\n summaryKind?: \"compaction\" | \"branch\";\n}\n\nexport const LCM_RECOVERY_POINTER =\n \"For exact pre-summary history, use memory.recall on this range, then memory.expand by stable entry or operation address.\";\nconst POINTER_LINE = LCM_RECOVERY_POINTER;\n\nconst sampledLines = (lines: readonly string[], keep: number): string[] => {\n if (lines.length <= keep) return [...lines];\n const earliest = Math.ceil(keep / 2);\n const latest = Math.floor(keep / 2);\n return [\n ...lines.slice(0, earliest),\n `\u2026 omitted ${lines.length - keep} rendered lines`,\n ...lines.slice(lines.length - latest),\n ];\n};\n\nconst boundedBlock = (header: string, sourceLines: readonly string[], maxBytes: number): string => {\n const clipped = sourceLines.map((line) => clipUtf8(line, MAX_RENDERED_LINE_BYTES));\n const capped = sampledLines(clipped, Math.min(clipped.length, MAX_INPUT_LINES_PER_SECTION));\n for (let keep = capped.length; keep >= 0; keep--) {\n const lines = sampledLines(capped, keep);\n const block = [header, ...lines].join(\"\\n\");\n if (utf8Bytes(block) <= maxBytes) return block;\n }\n return clipUtf8(header, maxBytes);\n};\n\nexport const renderSummary = (sections: Sections, options: RenderOptions): string => {\n const blocks: string[] = [];\n for (const { key, header, maxBytes } of SECTION_ORDER) {\n const lines = sections[key];\n if (lines.length === 0) continue;\n blocks.push(boundedBlock(header, lines, maxBytes));\n if (key === \"goal\" && options.requestLines && options.requestLines.length > 0) {\n blocks.push(boundedBlock(\"[Compaction Request]\", options.requestLines, REQUEST_MAX_BYTES));\n }\n }\n if (sections.goal.length === 0 && options.requestLines && options.requestLines.length > 0) {\n blocks.unshift(boundedBlock(\"[Compaction Request]\", options.requestLines, REQUEST_MAX_BYTES));\n }\n\n if (sections.transcript.length > 0) {\n blocks.push(boundedBlock(\"---\", sections.transcript, TRANSCRIPT_MAX_BYTES));\n }\n\n const timestamp = options.lastTimestamp || \"(unknown time)\";\n const range = options.firstEntryId || options.lastEntryId\n ? `${options.firstEntryId || \"(start)\"} \u2192 ${options.lastEntryId || \"(end)\"}`\n : \"(no entries)\";\n const footer = options.summaryKind === \"branch\"\n ? `[branch summarized ${timestamp}; structural source entries ${range}]`\n : `[compacted ${timestamp}; cumulative source entries ${range}]`;\n blocks.push(boundedBlock(\"---\", [footer, POINTER_LINE], FOOTER_MAX_BYTES));\n\n const summary = `${blocks.join(\"\\n\\n\")}\\n`;\n if (utf8Bytes(summary) <= MAX_SUMMARY_BYTES) return summary;\n return `${clipUtf8(summary, MAX_SUMMARY_BYTES - 1, \"\")}\\n`;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAEO,IAAM,mCAAmC;AACzC,IAAM,oCAAoC,IAAI;AACrD,IAAM,oCAAoC,IAAI;AACvC,IAAM,qBAAqB;AAC3B,IAAM,0BAA0B,IAAI;AAC3C,IAAM,0BAA0B,IAAI;AAC7B,IAAM,oCAAoC,KAAK;AAiDtD,IAAM,YAAY,CAChB,MACA,SACA,iBACmC;AAAA,EACnC,IAAI;AAAA,EACJ,cAAc,CAAC;AAAA,EACf,OAAO,EAAE,MAAM,SAAS,YAAY;AACtC;AAEA,IAAM,WAAW,CAAC,UAChB,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAErE,IAAM,sBAAsB,CAAC,UAA2B;AACtD,WAAS,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS;AACjD,UAAM,OAAO,MAAM,WAAW,KAAK;AACnC,QAAI,QAAQ,SAAU,QAAQ,OAAQ;AACpC,YAAM,OAAO,MAAM,WAAW,QAAQ,CAAC;AACvC,UAAI,EAAE,QAAQ,SAAU,QAAQ,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ACnC,sBAAsB,SAAS,+BAA+B,KAAK,MACnE,cAAc,SAAS,+BAA+B,KAAK;AAC/D,SAAO,KAAK,aAAa,OAAO,CAAC,QAAQ,YAAY,GAAG,gBAAgB,CAAC;AAEzE,QAAM,UAAU,GAAG,OAAO,KAAK,MAAM,CAAC;AAAA;AACtC,MAAI,UAAU,OAAO,KAAK,kBAAmB,QAAO;AACpD,SAAO,GAAG,SAAS,SAAS,oBAAoB,GAAG,EAAE,CAAC;AAAA;AACxD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
hashLcmPayload,
|
|
34
34
|
lcmRawAddress,
|
|
35
35
|
lcmSummaryAddress
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-ZHDN5ESL.js";
|
|
37
37
|
|
|
38
38
|
// src/providers/memory-provider.ts
|
|
39
39
|
import fs from "node:fs";
|
|
@@ -2569,4 +2569,4 @@ export {
|
|
|
2569
2569
|
normalizeMemoryArgs,
|
|
2570
2570
|
MemoryProvider
|
|
2571
2571
|
};
|
|
2572
|
-
//# sourceMappingURL=chunk-
|
|
2572
|
+
//# sourceMappingURL=chunk-R5B3W46U.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/compaction/bounds.ts
|
|
2
2
|
var MAX_SUMMARY_BYTES = 32 * 1024;
|
|
3
|
+
var MAX_LEAF_ENTRIES = 128;
|
|
3
4
|
var MAX_REQUEST_SOURCE_BYTES = 8 * 1024;
|
|
4
5
|
var encoder = new TextEncoder();
|
|
5
6
|
var utf8Bytes = (text) => encoder.encode(text).byteLength;
|
|
@@ -64,6 +65,7 @@ var omissionLine = (count, firstEntryId, lastEntryId, noun) => {
|
|
|
64
65
|
|
|
65
66
|
export {
|
|
66
67
|
MAX_SUMMARY_BYTES,
|
|
68
|
+
MAX_LEAF_ENTRIES,
|
|
67
69
|
utf8Bytes,
|
|
68
70
|
clipUtf8,
|
|
69
71
|
canonicalizeText,
|
|
@@ -71,4 +73,4 @@ export {
|
|
|
71
73
|
sampleAddressed,
|
|
72
74
|
omissionLine
|
|
73
75
|
};
|
|
74
|
-
//# sourceMappingURL=chunk-
|
|
76
|
+
//# sourceMappingURL=chunk-UAP6IQIR.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/compaction/bounds.ts"],
|
|
4
|
+
"sourcesContent": ["export const MAX_SUMMARY_BYTES = 32 * 1024;\n/** The configuration ceiling for entries in one leaf. */\nexport const MAX_LEAF_ENTRIES = 128;\nconst MAX_REQUEST_SOURCE_BYTES = 8 * 1024;\n\nconst encoder = new TextEncoder();\n\nexport const utf8Bytes = (text: string): number => encoder.encode(text).byteLength;\n\nexport const clipUtf8 = (text: string, maxBytes: number, suffix = \"\u2026\"): string => {\n if (maxBytes <= 0) return \"\";\n if (utf8Bytes(text) <= maxBytes) return text;\n const suffixBytes = utf8Bytes(suffix);\n if (suffixBytes >= maxBytes) return \"\";\n let output = \"\";\n let used = 0;\n const available = maxBytes - suffixBytes;\n for (const character of text) {\n const bytes = utf8Bytes(character);\n if (used + bytes > available) break;\n output += character;\n used += bytes;\n }\n return `${output}${suffix}`;\n};\n\nexport interface CanonicalText {\n text: string;\n truncated: boolean;\n sourceBytes: number;\n}\n\nexport const canonicalizeText = (input: string, maxBytes = MAX_REQUEST_SOURCE_BYTES): CanonicalText => {\n const canonical = input.trim().split(/\\s+/u).filter(Boolean).join(\" \");\n const sourceBytes = utf8Bytes(canonical);\n return {\n text: clipUtf8(canonical, maxBytes),\n truncated: sourceBytes > maxBytes,\n sourceBytes,\n };\n};\n\nexport interface AddressedValue {\n entryId: string;\n}\n\nexport interface AddressedSample<T extends AddressedValue> {\n values: T[];\n omitted: number;\n omittedFirstEntryId?: string;\n omittedLastEntryId?: string;\n splitIndex: number;\n}\n\nexport const sampleAddressedFrom = <T extends AddressedValue>(\n source: Iterable<T>,\n maxValues: number,\n): AddressedSample<T> => {\n const earliestLimit = Math.ceil(maxValues / 2);\n const latestLimit = Math.floor(maxValues / 2);\n const earliest: T[] = [];\n const latest: T[] = [];\n let omitted = 0;\n let omittedFirstEntryId: string | undefined;\n let omittedLastEntryId: string | undefined;\n\n for (const value of source) {\n if (earliest.length < earliestLimit) {\n earliest.push(value);\n continue;\n }\n latest.push(value);\n if (latest.length <= latestLimit) continue;\n const displaced = latest.shift()!;\n omitted += 1;\n omittedFirstEntryId ??= displaced.entryId;\n omittedLastEntryId = displaced.entryId;\n }\n\n return {\n values: [...earliest, ...latest],\n omitted,\n ...(omittedFirstEntryId !== undefined ? { omittedFirstEntryId } : {}),\n ...(omittedLastEntryId !== undefined ? { omittedLastEntryId } : {}),\n splitIndex: earliest.length,\n };\n};\n\nexport const sampleAddressed = <T extends AddressedValue>(\n values: readonly T[],\n maxValues: number,\n): AddressedSample<T> => sampleAddressedFrom(values, maxValues);\n\nexport const omissionLine = (\n count: number,\n firstEntryId: string | undefined,\n lastEntryId: string | undefined,\n noun: string,\n): string => {\n const range = firstEntryId || lastEntryId\n ? `${firstEntryId || \"(start)\"} \u2192 ${lastEntryId || \"(end)\"}`\n : \"(unknown range)\";\n return `\u2026 omitted ${count} ${noun}; source entries ${range}`;\n};\n"],
|
|
5
|
+
"mappings": ";AAAO,IAAM,oBAAoB,KAAK;AAE/B,IAAM,mBAAmB;AAChC,IAAM,2BAA2B,IAAI;AAErC,IAAM,UAAU,IAAI,YAAY;AAEzB,IAAM,YAAY,CAAC,SAAyB,QAAQ,OAAO,IAAI,EAAE;AAEjE,IAAM,WAAW,CAAC,MAAc,UAAkB,SAAS,aAAgB;AAChF,MAAI,YAAY,EAAG,QAAO;AAC1B,MAAI,UAAU,IAAI,KAAK,SAAU,QAAO;AACxC,QAAM,cAAc,UAAU,MAAM;AACpC,MAAI,eAAe,SAAU,QAAO;AACpC,MAAI,SAAS;AACb,MAAI,OAAO;AACX,QAAM,YAAY,WAAW;AAC7B,aAAW,aA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BAAgB,cAC1B,GAAG,gBAAgB,SAAS,WAAM,eAAe,OAAO,KACxD;AACJ,SAAO,kBAAa,KAAK,IAAI,IAAI,oBAAoB,KAAK;AAC5D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
buildThinkingDigest,
|
|
13
13
|
snapshotHandoffSession,
|
|
14
14
|
thinkingTransferPolicy
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IGCIGSJW.js";
|
|
16
16
|
import {
|
|
17
17
|
isFabricThinking
|
|
18
18
|
} from "./chunk-SKYNDRW5.js";
|
|
@@ -2810,4 +2810,4 @@ export {
|
|
|
2810
2810
|
resolveFabricIdentity,
|
|
2811
2811
|
MainAgentController
|
|
2812
2812
|
};
|
|
2813
|
-
//# sourceMappingURL=chunk-
|
|
2813
|
+
//# sourceMappingURL=chunk-UJEOKJMN.js.map
|
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
peerLabelPrefix,
|
|
23
23
|
writeHandoffSession
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-IGCIGSJW.js";
|
|
25
25
|
import {
|
|
26
26
|
DEFAULT_FABRIC_CONFIG,
|
|
27
27
|
MAX_AGENT_TIMEOUT_MS,
|
|
28
28
|
MIN_AGENT_TIMEOUT_MS,
|
|
29
29
|
resolveAgentDir
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-D4ANGHR7.js";
|
|
31
31
|
import {
|
|
32
32
|
FABRIC_ACTOR_HOST_EVENTS,
|
|
33
33
|
readJsonlPage
|
|
@@ -6784,4 +6784,4 @@ export {
|
|
|
6784
6784
|
agentParticipantRecords,
|
|
6785
6785
|
actorParticipantRecord
|
|
6786
6786
|
};
|
|
6787
|
-
//# sourceMappingURL=chunk-
|
|
6787
|
+
//# sourceMappingURL=chunk-XABWRKSU.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
utf8Bytes
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UAP6IQIR.js";
|
|
4
4
|
|
|
5
5
|
// src/storage/lcm-identity.ts
|
|
6
6
|
import fs from "node:fs";
|
|
@@ -127,4 +127,4 @@ export {
|
|
|
127
127
|
renderLcmSourceAddresses,
|
|
128
128
|
renderLcmChildAddresses
|
|
129
129
|
};
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
130
|
+
//# sourceMappingURL=chunk-ZHDN5ESL.js.map
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const MAX_SUMMARY_BYTES: number;
|
|
2
|
+
/** The configuration ceiling for entries in one leaf. */
|
|
3
|
+
export declare const MAX_LEAF_ENTRIES = 128;
|
|
2
4
|
export declare const utf8Bytes: (text: string) => number;
|
|
3
5
|
export declare const clipUtf8: (text: string, maxBytes: number, suffix?: string) => string;
|
|
4
6
|
export interface CanonicalText {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bounds.d.ts","sourceRoot":"","sources":["../../src/compaction/bounds.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,QAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"bounds.d.ts","sourceRoot":"","sources":["../../src/compaction/bounds.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,QAAY,CAAC;AAC3C,yDAAyD;AACzD,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAKpC,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,KAAG,MAAyC,CAAC;AAEnF,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,UAAU,MAAM,EAAE,eAAY,KAAG,MAevE,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,EAAE,iBAAmC,KAAG,aAQrF,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,cAAc;IACvD,MAAM,EAAE,CAAC,EAAE,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,cAAc,EAC1D,QAAQ,QAAQ,CAAC,CAAC,CAAC,EACnB,WAAW,MAAM,KAChB,eAAe,CAAC,CAAC,CA6BnB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,cAAc,EACtD,QAAQ,SAAS,CAAC,EAAE,EACpB,WAAW,MAAM,KAChB,eAAe,CAAC,CAAC,CAA2C,CAAC;AAEhE,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,EACb,cAAc,MAAM,GAAG,SAAS,EAChC,aAAa,MAAM,GAAG,SAAS,EAC/B,MAAM,MAAM,KACX,MAKF,CAAC"}
|
package/dist/compaction/hook.js
CHANGED
|
@@ -4,11 +4,10 @@ import {
|
|
|
4
4
|
fabricCompactionVersion,
|
|
5
5
|
rawContextTokens,
|
|
6
6
|
registerCompactionHook
|
|
7
|
-
} from "../chunks/chunk-
|
|
7
|
+
} from "../chunks/chunk-NBA7CEFR.js";
|
|
8
8
|
import "../chunks/chunk-3J7BKUNG.js";
|
|
9
|
-
import "../chunks/chunk-
|
|
10
|
-
import "../chunks/chunk-
|
|
11
|
-
import "../chunks/chunk-3XPR2AZL.js";
|
|
9
|
+
import "../chunks/chunk-QSRTEINF.js";
|
|
10
|
+
import "../chunks/chunk-UAP6IQIR.js";
|
|
12
11
|
import "../chunks/chunk-JXNXHUIJ.js";
|
|
13
12
|
import "../chunks/chunk-3LMPHRDQ.js";
|
|
14
13
|
import "../chunks/chunk-OHPTGVDK.js";
|
|
@@ -64,8 +64,6 @@ export interface LcmMaintenanceOptions {
|
|
|
64
64
|
maxConcurrentJobs?: number | (() => number);
|
|
65
65
|
}
|
|
66
66
|
export declare const DEFAULT_LEAF_ENTRIES = 32;
|
|
67
|
-
/** The configuration ceiling for a leaf, so a bounded pass can never produce more sources than this. */
|
|
68
|
-
export declare const MAX_LEAF_ENTRIES = 128;
|
|
69
67
|
export declare const DEFAULT_MAINTENANCE_CONCURRENCY = 3;
|
|
70
68
|
export declare const LEASE_MS = 30000;
|
|
71
69
|
export declare const LEASE_SWEEP_GRACE_MS = 60000;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lcm-maintenance.d.ts","sourceRoot":"","sources":["../../src/compaction/lcm-maintenance.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAmC,KAAK,cAAc,EAAsB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE9H,KAAK,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAC/D,KAAK,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAClE,MAAM,WAAW,YAAY;IAAG,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;CAAE;AAE5G,MAAM,WAAW,OAAO;IAAG,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAAC,OAAO,EAAE,YAAY,EAAE,CAAC;IAAC,QAAQ,EAAE,MA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EAAC,MAAM,EAAE,MAAM,cAA6B,GAAG,OAAO,CAAC,OAAO,CAAC;IA2C/G,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,MAAM;CACf"}
|
|
@@ -180,7 +180,7 @@ export declare class LcmRuntime {
|
|
|
180
180
|
sourceHash: string;
|
|
181
181
|
policyHash: string;
|
|
182
182
|
modelHash: string;
|
|
183
|
-
state: "
|
|
183
|
+
state: "running" | "failed" | "pending" | "ready";
|
|
184
184
|
createdAt: number;
|
|
185
185
|
}[];
|
|
186
186
|
getNode: (nodeId: string) => {
|
|
@@ -199,7 +199,7 @@ export declare class LcmRuntime {
|
|
|
199
199
|
sourceHash: string;
|
|
200
200
|
policyHash: string;
|
|
201
201
|
modelHash: string;
|
|
202
|
-
state: "
|
|
202
|
+
state: "running" | "failed" | "pending" | "ready";
|
|
203
203
|
createdAt: number;
|
|
204
204
|
} | undefined;
|
|
205
205
|
};
|