pi-fabric 0.80.0 → 0.81.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/dist/chunks/{chunk-75CLSHZE.js → chunk-J2C2XS2I.js} +2 -2
- package/dist/chunks/{chunk-IITDYSG5.js → chunk-JNACUKKJ.js} +40 -9
- package/dist/chunks/chunk-JNACUKKJ.js.map +7 -0
- package/dist/chunks/{chunk-U3DHW7UQ.js → chunk-JVMF4CLN.js} +2 -2
- package/dist/chunks/{chunk-BUXNRNJC.js → chunk-MQKL5CPF.js} +20 -2
- package/dist/chunks/chunk-MQKL5CPF.js.map +7 -0
- package/dist/chunks/{chunk-6XUQ7MKH.js → chunk-QJF6UH3U.js} +2 -2
- package/dist/chunks/{chunk-W7PLBXJH.js → chunk-ZWU3CSM2.js} +460 -57
- package/dist/chunks/chunk-ZWU3CSM2.js.map +7 -0
- package/dist/chunks/{fabric-runtime-state-EMLV5K2G.js → fabric-runtime-state-2PYHSF6C.js} +6 -6
- package/dist/commands/fabric.d.ts.map +1 -1
- package/dist/core/action-registry.js +2 -2
- package/dist/entropy/compiled-surface.d.ts +2 -2
- package/dist/entropy/compiled-surface.d.ts.map +1 -1
- package/dist/entropy/compiler.d.ts +5 -1
- package/dist/entropy/compiler.d.ts.map +1 -1
- package/dist/entropy/corpus.d.ts +8 -1
- package/dist/entropy/corpus.d.ts.map +1 -1
- package/dist/entropy/index.d.ts +2 -0
- package/dist/entropy/index.d.ts.map +1 -1
- package/dist/entropy/index.js +33 -3
- package/dist/entropy/passes.d.ts.map +1 -1
- package/dist/entropy/pool-store.d.ts +13 -0
- package/dist/entropy/pool-store.d.ts.map +1 -0
- package/dist/entropy/pool.d.ts +40 -0
- package/dist/entropy/pool.d.ts.map +1 -0
- package/dist/entropy/sessions.d.ts +7 -1
- package/dist/entropy/sessions.d.ts.map +1 -1
- package/dist/entropy/trial.d.ts +2 -1
- package/dist/entropy/trial.d.ts.map +1 -1
- package/dist/entropy/types.d.ts +14 -0
- package/dist/entropy/types.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +73 -7
- package/dist/index.js.map +2 -2
- package/dist/providers/memory-provider.d.ts.map +1 -1
- package/dist/providers/memory-provider.js +1 -1
- package/docs/entropy.md +66 -23
- package/package.json +1 -1
- package/dist/chunks/chunk-BUXNRNJC.js.map +0 -7
- package/dist/chunks/chunk-IITDYSG5.js.map +0 -7
- package/dist/chunks/chunk-W7PLBXJH.js.map +0 -7
- /package/dist/chunks/{chunk-75CLSHZE.js.map → chunk-J2C2XS2I.js.map} +0 -0
- /package/dist/chunks/{chunk-U3DHW7UQ.js.map → chunk-JVMF4CLN.js.map} +0 -0
- /package/dist/chunks/{chunk-6XUQ7MKH.js.map → chunk-QJF6UH3U.js.map} +0 -0
- /package/dist/chunks/{fabric-runtime-state-EMLV5K2G.js.map → fabric-runtime-state-2PYHSF6C.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-SOBEXOWK.js";
|
|
7
7
|
import {
|
|
8
8
|
NESTED_TOOL_CALL_ID_PREFIX
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JVMF4CLN.js";
|
|
10
10
|
import {
|
|
11
11
|
THINKING_DIGEST_CUSTOM_TYPE,
|
|
12
12
|
buildThinkingDigest,
|
|
@@ -2447,4 +2447,4 @@ export {
|
|
|
2447
2447
|
resolveFabricIdentity,
|
|
2448
2448
|
MainAgentController
|
|
2449
2449
|
};
|
|
2450
|
-
//# sourceMappingURL=chunk-
|
|
2450
|
+
//# sourceMappingURL=chunk-J2C2XS2I.js.map
|
|
@@ -101,26 +101,57 @@ var mergeCompiledSurfaces = (local, incoming, live) => {
|
|
|
101
101
|
};
|
|
102
102
|
return { file, droppedOverlays, droppedQuarantines };
|
|
103
103
|
};
|
|
104
|
-
var replaySuccessfulCalls = (surface, traces, touchedRefs) => {
|
|
104
|
+
var replaySuccessfulCalls = (surface, before, traces, touchedRefs, auditCalls) => {
|
|
105
105
|
const schemaByRef = new Map(surface.actions.map((action) => [action.ref, action.inputSchema]));
|
|
106
|
+
const beforeByRef = new Map(before.actions.map((action) => [action.ref, action.inputSchema]));
|
|
107
|
+
const accepts = (schema, args) => {
|
|
108
|
+
try {
|
|
109
|
+
return isPlainRecord(schema) && Value.Check(schema, args);
|
|
110
|
+
} catch {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
106
114
|
const violations = [];
|
|
115
|
+
const auditedRefs = /* @__PURE__ */ new Set();
|
|
116
|
+
if (auditCalls) {
|
|
117
|
+
const auditArgsByRef = /* @__PURE__ */ new Map();
|
|
118
|
+
for (const call of auditCalls) {
|
|
119
|
+
if (!touchedRefs.has(call.ref)) continue;
|
|
120
|
+
const bucket = auditArgsByRef.get(call.ref) ?? [];
|
|
121
|
+
bucket.push(call.args);
|
|
122
|
+
auditArgsByRef.set(call.ref, bucket);
|
|
123
|
+
}
|
|
124
|
+
for (const [ref, argsList] of auditArgsByRef) {
|
|
125
|
+
auditedRefs.add(ref);
|
|
126
|
+
const schema = schemaByRef.get(ref);
|
|
127
|
+
if (schema === void 0) {
|
|
128
|
+
violations.push({ ref, reason: "absent from the candidate surface" });
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const declared = beforeByRef.get(ref);
|
|
132
|
+
for (const args of argsList) {
|
|
133
|
+
if (declared !== void 0 && !accepts(declared, args)) continue;
|
|
134
|
+
if (!accepts(schema, args)) {
|
|
135
|
+
violations.push({
|
|
136
|
+
ref,
|
|
137
|
+
reason: "recorded arguments no longer validate against the compiled schema"
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
107
143
|
for (const sourceTrace of traces) {
|
|
108
144
|
for (const operation of sourceTrace.operations) {
|
|
109
145
|
if (operation.outcome !== "succeeded") continue;
|
|
110
146
|
if (operation.ref.startsWith("fabric.")) continue;
|
|
111
147
|
if (!touchedRefs.has(operation.ref)) continue;
|
|
148
|
+
if (auditedRefs.has(operation.ref)) continue;
|
|
112
149
|
const schema = schemaByRef.get(operation.ref);
|
|
113
150
|
if (schema === void 0) {
|
|
114
151
|
violations.push({ ref: operation.ref, reason: "absent from the candidate surface" });
|
|
115
152
|
continue;
|
|
116
153
|
}
|
|
117
|
-
|
|
118
|
-
try {
|
|
119
|
-
valid = isPlainRecord(schema) && Value.Check(schema, operation.args);
|
|
120
|
-
} catch {
|
|
121
|
-
valid = false;
|
|
122
|
-
}
|
|
123
|
-
if (!valid) {
|
|
154
|
+
if (!accepts(schema, operation.args)) {
|
|
124
155
|
violations.push({
|
|
125
156
|
ref: operation.ref,
|
|
126
157
|
reason: "recorded arguments no longer validate against the compiled schema"
|
|
@@ -142,4 +173,4 @@ export {
|
|
|
142
173
|
mergeCompiledSurfaces,
|
|
143
174
|
replaySuccessfulCalls
|
|
144
175
|
};
|
|
145
|
-
//# sourceMappingURL=chunk-
|
|
176
|
+
//# sourceMappingURL=chunk-JNACUKKJ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/entropy/compiled-surface.ts"],
|
|
4
|
+
"sourcesContent": ["// The compiled entropy surface: the durable artifact the autonomous\n// compiler maintains beside the repair table. Every overlay entry records\n// the digest of the live schema it was compiled against, and every consult\n// re-proves that digest against the live declared schema \u2014 an entry whose\n// base changed underneath it drops out instead of mis-enforcing. The\n// artifact is clock-free and deterministic: the same evidence compiles to\n// the same bytes.\n\nimport { Value } from \"typebox/value\";\nimport { stableJsonHash } from \"../core/stable-hash.js\";\nimport type {\n EntropyAuditCall,\n EntropyProposal,\n EntropySurfaceSnapshot,\n EntropyTraceInput,\n} from \"./types.js\";\n\nexport const COMPILED_SURFACE_VERSION = 1 as const;\nexport const MAX_COMPILED_SURFACE_PROPOSALS = 256;\n\nexport interface CompiledSurfaceOverlayEntry {\n ref: string;\n inputSchema: Record<string, unknown>;\n baseSchemaDigest: string;\n}\n\nexport interface CompiledSurfaceQuarantineEntry {\n ref: string;\n baseSchemaDigest: string;\n}\n\nexport interface CompiledSurfaceAppliedProposal {\n kind: EntropyProposal[\"kind\"];\n ref: string;\n detail: string;\n}\n\nexport interface CompiledSurfaceGateRecord {\n passed: boolean;\n beforeScore: number;\n afterScore: number;\n reasons: string[];\n}\n\nexport interface CompiledSurfaceFile {\n version: typeof COMPILED_SURFACE_VERSION;\n metricVersion: number;\n actions: CompiledSurfaceOverlayEntry[];\n quarantined: CompiledSurfaceQuarantineEntry[];\n applied: CompiledSurfaceAppliedProposal[];\n gate: CompiledSurfaceGateRecord;\n evidenceDigest: string;\n}\n\nconst isPlainRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nexport const schemaDigest = (schema: unknown): string => stableJsonHash(schema);\n\n// Overlay consult for one ref: the compiled schema replaces the declared\n// schema only while the base digest still proves the declared surface did\n// not change underneath the compile.\nexport const effectiveSchemaFor = (\n ref: string,\n liveSchema: unknown,\n file?: CompiledSurfaceFile,\n): unknown => {\n const entry = file?.actions.find((candidate) => candidate.ref === ref);\n if (!entry) return liveSchema;\n return schemaDigest(liveSchema) === entry.baseSchemaDigest ? entry.inputSchema : liveSchema;\n};\n\n// Whole-surface overlay for measurement and export: tightened schemas where\n// the base still matches, quarantined refs hidden where the base still\n// matches. Stale entries fall back to the live surface, never mis-enforce.\nexport const applyCompiledSurface = (\n live: EntropySurfaceSnapshot,\n file?: CompiledSurfaceFile,\n): EntropySurfaceSnapshot => {\n if (!file || (file.actions.length === 0 && file.quarantined.length === 0)) return live;\n const byRef = new Map<string, unknown>(\n live.actions.map((action) => [action.ref, action.inputSchema]),\n );\n const overlayByRef = new Map(file.actions.map((entry) => [entry.ref, entry]));\n const quarantineByRef = new Map(file.quarantined.map((entry) => [entry.ref, entry]));\n const actions: EntropySurfaceSnapshot[\"actions\"] = [];\n for (const action of live.actions) {\n const overlay = overlayByRef.get(action.ref);\n if (overlay && schemaDigest(byRef.get(action.ref)) === overlay.baseSchemaDigest) {\n actions.push({ ref: action.ref, inputSchema: overlay.inputSchema });\n continue;\n }\n const quarantine = quarantineByRef.get(action.ref);\n if (quarantine && schemaDigest(byRef.get(action.ref)) === quarantine.baseSchemaDigest) {\n continue;\n }\n actions.push(action);\n }\n return { version: 1, actions };\n};\n\n// Name-only quarantine view for catalog filtering: hiding there is\n// advisory, so no digest proof is required. Resolution denial is the\n// digested isQuarantinedRef below.\nexport const quarantinedRefNames = (file?: CompiledSurfaceFile): ReadonlySet<string> =>\n new Set(file?.quarantined.map((entry) => entry.ref));\n\n// Resolution denial with digest proof: a quarantined ref stays callable\n// only when the live schema changed underneath the compile.\nexport const isQuarantinedRef = (\n ref: string,\n liveSchema: unknown,\n file?: CompiledSurfaceFile,\n): boolean => {\n const entry = file?.quarantined.find((candidate) => candidate.ref === ref);\n if (!entry) return false;\n return schemaDigest(liveSchema) === entry.baseSchemaDigest;\n};\n\nexport interface MergedCompiledSurface {\n file: CompiledSurfaceFile;\n droppedOverlays: number;\n droppedQuarantines: number;\n}\n\nconst byRefOrder = (left: { ref: string }, right: { ref: string }): number =>\n left.ref < right.ref ? -1 : left.ref > right.ref ? 1 : 0;\n\n// Federation merge: incoming entries earn a slot only where their recorded\n// base digest proves against the live declared surface and the local\n// artifact has nothing to say about that ref (conflicts skip, local wins).\n// Every consult re-proves merged entries against the live schema, so an\n// imported artifact can never enforce a schema the local surface does not\n// still declare. The applied ledger unions by identity, local first,\n// capped at the store's maximum.\nexport const mergeCompiledSurfaces = (\n local: CompiledSurfaceFile | undefined,\n incoming: CompiledSurfaceFile,\n live: EntropySurfaceSnapshot,\n): MergedCompiledSurface => {\n const liveByRef = new Map(live.actions.map((action) => [action.ref, action.inputSchema]));\n const liveDigestOf = (ref: string): string | undefined => {\n const schema = liveByRef.get(ref);\n return schema === undefined ? undefined : schemaDigest(schema);\n };\n const overlayRefs = new Set((local?.actions ?? []).map((entry) => entry.ref));\n const quarantineRefs = new Set((local?.quarantined ?? []).map((entry) => entry.ref));\n const actions = [...(local?.actions ?? [])];\n const quarantined = [...(local?.quarantined ?? [])];\n let droppedOverlays = 0;\n let droppedQuarantines = 0;\n for (const entry of incoming.actions) {\n if (overlayRefs.has(entry.ref) || quarantineRefs.has(entry.ref)) continue;\n if (liveDigestOf(entry.ref) !== entry.baseSchemaDigest) {\n droppedOverlays++;\n continue;\n }\n actions.push(entry);\n overlayRefs.add(entry.ref);\n }\n for (const entry of incoming.quarantined) {\n if (overlayRefs.has(entry.ref) || quarantineRefs.has(entry.ref)) continue;\n if (liveDigestOf(entry.ref) !== entry.baseSchemaDigest) {\n droppedQuarantines++;\n continue;\n }\n quarantined.push(entry);\n quarantineRefs.add(entry.ref);\n }\n actions.sort(byRefOrder);\n quarantined.sort(byRefOrder);\n const applied: CompiledSurfaceAppliedProposal[] = [];\n const seenApplied = new Set<string>();\n for (const source of [local?.applied ?? [], incoming.applied]) {\n for (const entry of source) {\n const identity = `${entry.kind}:${entry.ref}:${entry.detail}`;\n if (seenApplied.has(identity)) continue;\n seenApplied.add(identity);\n if (applied.length >= MAX_COMPILED_SURFACE_PROPOSALS) break;\n applied.push(entry);\n }\n }\n const file: CompiledSurfaceFile = {\n version: COMPILED_SURFACE_VERSION,\n metricVersion: local?.metricVersion ?? incoming.metricVersion,\n actions,\n quarantined,\n applied,\n gate: local?.gate ?? incoming.gate,\n evidenceDigest: stableJsonHash({\n actions,\n quarantined,\n applied,\n sources: [...(local ? [local.evidenceDigest] : []), incoming.evidenceDigest],\n }),\n };\n return { file, droppedOverlays, droppedQuarantines };\n};\n\nexport interface ReplayViolation {\n ref: string;\n reason: string;\n}\n\n// Replay preservation: every successful call to a ref the compile touched\n// must still parse against the candidate surface \u2014 resolution plus the same\n// TypeBox check the registry's validate stage uses. Untouched refs keep\n// their schema by identity, so replay stays scoped to the touched set.\n// When a touched ref has verbatim audit calls, they are the replay corpus:\n// trace V1 projects values away per ref, so validating the projected trace\n// args would phantom-reject calls that actually parsed. Audits the declared\n// surface already rejected are not protected \u2014 those calls never executed,\n// so no compile can invalidate them.\nexport const replaySuccessfulCalls = (\n surface: EntropySurfaceSnapshot,\n before: EntropySurfaceSnapshot,\n traces: readonly EntropyTraceInput[],\n touchedRefs: ReadonlySet<string>,\n auditCalls?: readonly EntropyAuditCall[],\n): ReplayViolation[] => {\n const schemaByRef = new Map(surface.actions.map((action) => [action.ref, action.inputSchema]));\n const beforeByRef = new Map(before.actions.map((action) => [action.ref, action.inputSchema]));\n const accepts = (schema: unknown, args: Record<string, unknown>): boolean => {\n try {\n return isPlainRecord(schema) && Value.Check(schema, args);\n } catch {\n return false;\n }\n };\n const violations: ReplayViolation[] = [];\n const auditedRefs = new Set<string>();\n if (auditCalls) {\n const auditArgsByRef = new Map<string, Record<string, unknown>[]>();\n for (const call of auditCalls) {\n if (!touchedRefs.has(call.ref)) continue;\n const bucket = auditArgsByRef.get(call.ref) ?? [];\n bucket.push(call.args);\n auditArgsByRef.set(call.ref, bucket);\n }\n for (const [ref, argsList] of auditArgsByRef) {\n auditedRefs.add(ref);\n const schema = schemaByRef.get(ref);\n if (schema === undefined) {\n violations.push({ ref, reason: \"absent from the candidate surface\" });\n continue;\n }\n const declared = beforeByRef.get(ref);\n for (const args of argsList) {\n if (declared !== undefined && !accepts(declared, args)) continue;\n if (!accepts(schema, args)) {\n violations.push({\n ref,\n reason: \"recorded arguments no longer validate against the compiled schema\",\n });\n }\n }\n }\n }\n for (const sourceTrace of traces) {\n for (const operation of sourceTrace.operations) {\n if (operation.outcome !== \"succeeded\") continue;\n if (operation.ref.startsWith(\"fabric.\")) continue;\n if (!touchedRefs.has(operation.ref)) continue;\n if (auditedRefs.has(operation.ref)) continue;\n const schema = schemaByRef.get(operation.ref);\n if (schema === undefined) {\n violations.push({ ref: operation.ref, reason: \"absent from the candidate surface\" });\n continue;\n }\n if (!accepts(schema, operation.args)) {\n violations.push({\n ref: operation.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,YAAY,YAAa;AACvC,UAAI,UAAU,IAAI,WAAW,SAAS,EAAG;AACzC,UAAI,CAAC,YAAY,IAAI,UAAU,GAAG,EAAG;AACrC,UAAI,YAAY,IAAI,UAAU,GAAG,EAAG;AACpC,YAAM,SAAS,YAAY,IAAI,UAAU,GAAG;AAC5C,UAAI,WAAW,QAAW;AACxB,mBAAW,KAAK,EAAE,KAAK,UAAU,KAAK,QAAQ,oCAAoC,CAAC;AACnF;AAAA,MACF;AACA,UAAI,CAAC,QAAQ,QAAQ,UAAU,IAAI,GAAG;AACpC,mBAAW,KAAK;AAAA,UACd,KAAK,UAAU;AAAA,UACf,QAAQ;AAAA,QACV,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
effectiveSchemaFor,
|
|
10
10
|
isQuarantinedRef,
|
|
11
11
|
quarantinedRefNames
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JNACUKKJ.js";
|
|
13
13
|
import {
|
|
14
14
|
FABRIC_NESTED_TOOL_CALL_ID_PREFIX
|
|
15
15
|
} from "./chunk-HDKEA77S.js";
|
|
@@ -1561,4 +1561,4 @@ export {
|
|
|
1561
1561
|
NESTED_TOOL_CALL_ID_PREFIX,
|
|
1562
1562
|
ActionRegistry
|
|
1563
1563
|
};
|
|
1564
|
-
//# sourceMappingURL=chunk-
|
|
1564
|
+
//# sourceMappingURL=chunk-JVMF4CLN.js.map
|
|
@@ -270,7 +270,25 @@ var descriptors = [
|
|
|
270
270
|
},
|
|
271
271
|
page: { type: "number", minimum: 1 },
|
|
272
272
|
pageSize: { type: "number", minimum: 1, maximum: RECALL_MAX_PAGE_SIZE },
|
|
273
|
-
role: {
|
|
273
|
+
role: {
|
|
274
|
+
type: "string",
|
|
275
|
+
enum: [
|
|
276
|
+
"assistant",
|
|
277
|
+
"bashExecution",
|
|
278
|
+
"branchCustomMessage",
|
|
279
|
+
"branchSummary",
|
|
280
|
+
"branchUser",
|
|
281
|
+
"compaction",
|
|
282
|
+
"compactionSummary",
|
|
283
|
+
"custom",
|
|
284
|
+
"fabricOperation",
|
|
285
|
+
"fabricPhase",
|
|
286
|
+
"fabricRun",
|
|
287
|
+
"toolResult",
|
|
288
|
+
"user"
|
|
289
|
+
],
|
|
290
|
+
description: "Exact normalized entry role to filter by: the closed set the session normalizer can produce."
|
|
291
|
+
},
|
|
274
292
|
tool: { type: "string" },
|
|
275
293
|
ref: {
|
|
276
294
|
type: "string",
|
|
@@ -865,4 +883,4 @@ export {
|
|
|
865
883
|
normalizeMemoryArgs,
|
|
866
884
|
MemoryProvider
|
|
867
885
|
};
|
|
868
|
-
//# sourceMappingURL=chunk-
|
|
886
|
+
//# sourceMappingURL=chunk-MQKL5CPF.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/providers/memory-provider.ts", "../../src/providers/arg-normalization.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n FabricActionDescriptor,\n FabricInvocationContext,\n FabricProvider,\n FabricProviderListRequest,\n} from \"../protocol.js\";\nimport type { FabricMemoryConfig } from \"../config.js\";\nimport path from \"node:path\";\nimport {\n AmbiguousSessionError,\n enumerateAllSessions,\n resolveScope,\n resolveSessionTarget,\n type ResolveScopeInput,\n type SessionRef,\n} from \"../memory/discovery.js\";\nimport type { LiveSessionBranch, MemoryBranches } from \"../memory/lineage.js\";\nimport { reconstructSessionLineage } from \"../memory/lineage.js\";\nimport { expandSessionEntriesChecked, normalizeSession } from \"../memory/normalize.js\";\nimport {\n DEFAULT_HOT_SESSIONS,\n fingerprintSource,\n loadTieredIndex,\n type EntryRange,\n type MemoryIndexOptions,\n type SearchFilters,\n} from \"../memory/index.js\";\nimport {\n DEFAULT_REGEX_MAX_HAYSTACK_BYTES,\n DEFAULT_REGEX_MAX_HAYSTACK_TERMS,\n DEFAULT_REGEX_MAX_PATTERN_BYTES,\n DEFAULT_REGEX_TIMEOUT_MS,\n formatSearchResult,\n searchMemoryIndex,\n type SearchItem,\n} from \"../memory/search.js\";\nimport type { MemoryQueryMode } from \"../memory/tokenize.js\";\nimport { actionArgNormalizer, type ArgNormalizationSpec } from \"./arg-normalization.js\";\n\nconst RECALL_DEFAULT_PAGE_SIZE = 25;\nconst RECALL_MAX_PAGE_SIZE = 200;\nconst SESSIONS_MAX = 500;\n\nconst descriptors: FabricActionDescriptor[] = [\n {\n name: \"recall\",\n description:\n \"Search hot session entries and cold session digests. Use scope session:<id-or-path> to hydrate a cold session and search its entries.\",\n inputSchema: {\n type: \"object\",\n properties: {\n query: { type: \"string\" },\n queryMode: {\n type: \"string\",\n enum: [\"literal\", \"regex\"],\n description: \"Literal canonical-token matching (default) or explicitly bounded regex.\",\n },\n expectedSourceHash: {\n type: \"string\",\n description: \"SHA-256 from a prior pointer; stale sources are refused.\",\n },\n expectedLineageFingerprint: {\n type: \"string\",\n description: \"Active-lineage fingerprint from a prior pointer; changed leaves are refused.\",\n },\n branches: {\n type: \"string\",\n enum: [\"active\", \"all\"],\n description: \"Search the active parent-linked path (default) or every branch.\",\n },\n scope: {\n type: \"string\",\n description:\n \"session | project | global | session:<id-or-path>. Defaults to session.\",\n },\n page: { type: \"number\", minimum: 1 },\n pageSize: { type: \"number\", minimum: 1, maximum: RECALL_MAX_PAGE_SIZE },\n role: {\n type: \"string\",\n enum: [\n \"assistant\",\n \"bashExecution\",\n \"branchCustomMessage\",\n \"branchSummary\",\n \"branchUser\",\n \"compaction\",\n \"compactionSummary\",\n \"custom\",\n \"fabricOperation\",\n \"fabricPhase\",\n \"fabricRun\",\n \"toolResult\",\n \"user\",\n ],\n description:\n \"Exact normalized entry role to filter by: the closed set the session normalizer can produce.\",\n },\n tool: { type: \"string\" },\n ref: {\n type: \"string\",\n minLength: 1,\n description: \"Exact persisted Fabric action ref, such as pi.grep. This is structural selection, not lexical expansion.\",\n },\n provider: {\n type: \"string\",\n minLength: 1,\n description: \"Exact persisted Fabric provider identity.\",\n },\n action: {\n type: \"string\",\n minLength: 1,\n description: \"Exact persisted Fabric action name.\",\n },\n outcome: {\n type: \"string\",\n enum: [\"succeeded\", \"failed\", \"aborted\", \"timed_out\"],\n description: \"Exact persisted Fabric execution outcome.\",\n },\n since: { type: \"number\" },\n until: { type: \"number\" },\n entryRange: {\n type: \"object\",\n description:\n \"Inclusive normalized-entry range for an explicit session:<id> hydration.\",\n properties: {\n first: { type: \"number\", minimum: 0 },\n last: { type: \"number\", minimum: 0 },\n },\n required: [\"first\", \"last\"],\n additionalProperties: false,\n },\n },\n additionalProperties: false,\n },\n risk: \"read\",\n namespace: \"memory\",\n },\n {\n name: \"expand\",\n description:\n \"Re-read full text or a bounded structured Fabric operation by index, entry id, operation address, or inclusive range.\",\n inputSchema: {\n type: \"object\",\n properties: {\n session: { type: \"string\", description: \"Exact session file path or unambiguous id.\" },\n expectedSourceHash: {\n type: \"string\",\n description: \"SHA-256 from a prior pointer; stale sources are refused.\",\n },\n expectedLineageFingerprint: {\n type: \"string\",\n description: \"Active-lineage fingerprint from a prior pointer; changed leaves are refused.\",\n },\n branches: {\n type: \"string\",\n enum: [\"active\", \"all\"],\n description: \"Expand on the active parent-linked path (default) or across every branch.\",\n },\n indices: { type: \"array\", items: { type: \"number\", minimum: 0 } },\n entryIds: { type: \"array\", items: { type: \"string\" } },\n operationAddresses: { type: \"array\", items: { type: \"string\" } },\n entryRange: {\n type: \"object\",\n properties: {\n first: { type: \"number\", minimum: 0 },\n last: { type: \"number\", minimum: 0 },\n },\n required: [\"first\", \"last\"],\n additionalProperties: false,\n },\n },\n required: [\"session\"],\n additionalProperties: false,\n },\n risk: \"read\",\n namespace: \"memory\",\n },\n {\n name: \"sessions\",\n description: \"List known sessions in scope with id, file, cwd, mtime, entry count, and hot/cold tier.\",\n inputSchema: {\n type: \"object\",\n properties: {\n scope: { type: \"string\" },\n branches: {\n type: \"string\",\n enum: [\"active\", \"all\"],\n description: \"Count the active parent-linked path (default) or every branch.\",\n },\n limit: {\n type: \"number\",\n minimum: 1,\n description: \"Maximum sessions returned; capped at the internal session ceiling.\",\n },\n },\n additionalProperties: false,\n },\n risk: \"read\",\n namespace: \"memory\",\n },\n];\n\n// Value spellings models reliably substitute for the documented memory scopes,\n// e.g. scope \"cwd\" for \"project\". Same discipline as the key aliases below:\n// identical intent only. Unknown scopes still fall through to resolveScope's\n// default \"session\" handling.\nconst MEMORY_SCOPE_VALUE_ALIASES: Record<string, string> = {\n cwd: \"project\",\n repo: \"project\",\n directory: \"project\",\n folder: \"project\",\n all: \"global\",\n current: \"session\",\n};\n\nconst MEMORY_ARG_NORMALIZATION: Record<string, ArgNormalizationSpec> = {\n recall: { values: { scope: MEMORY_SCOPE_VALUE_ALIASES } },\n sessions: { values: { scope: MEMORY_SCOPE_VALUE_ALIASES } },\n};\n\n// Argument repair derives from the action schemas plus the shared synonym\n// lexicon; only scope value spellings stay table-bound because the schema\n// spells scope as a free string rather than an enum.\nexport const normalizeMemoryArgs = actionArgNormalizer(\n () => descriptors,\n MEMORY_ARG_NORMALIZATION,\n);\n\nexport interface MemoryProviderContext {\n agentDir: string;\n cwd: string;\n config: FabricMemoryConfig;\n sessionId?: string;\n sessionFile?: string;\n getLiveBranch?: () => LiveSessionBranch;\n}\n\nconst parseBranches = (value: unknown, action: string): MemoryBranches => {\n if (value === undefined) return \"active\";\n if (value === \"active\" || value === \"all\") return value;\n throw new Error(`${action} branches must be \"active\" or \"all\"`);\n};\n\nconst resolveIndexOptions = (\n config: FabricMemoryConfig,\n agentDir: string,\n branches: MemoryBranches,\n liveBranchForFile?: MemoryIndexOptions[\"liveBranchForFile\"],\n): MemoryIndexOptions => ({\n indexDir: config.indexDir ?? `${agentDir}/fabric/memory-index`,\n maxEntryChars: config.maxEntryChars,\n branches,\n indexThinking: config.indexThinking ?? false,\n indexToolOutput: config.indexToolOutput ?? true,\n ...(liveBranchForFile ? { liveBranchForFile } : {}),\n hotSessions: config.hotSessions ?? DEFAULT_HOT_SESSIONS,\n digestTerms: config.digestTerms ?? 200,\n ...(config.maxColdVocabularyBytes === undefined\n ? {} : { maxColdVocabularyBytes: config.maxColdVocabularyBytes }),\n ...(config.maxColdCacheBytes === undefined ? {} : { maxColdCacheBytes: config.maxColdCacheBytes }),\n ...(config.maxSyncSessions === undefined ? {} : { maxSyncSessions: config.maxSyncSessions }),\n ...(config.maxSyncSourceBytes === undefined ? {} : { maxSyncSourceBytes: config.maxSyncSourceBytes }),\n ...(config.maxCacheCleanupFiles === undefined\n ? {} : { maxCacheCleanupFiles: config.maxCacheCleanupFiles }),\n});\n\nconst resolveTierRefs = (refs: SessionRef[], context: MemoryProviderContext): SessionRef[] => {\n const all = enumerateAllSessions(context.agentDir, Number.MAX_SAFE_INTEGER);\n const known = new Set(all.map((ref) => ref.file));\n for (const ref of refs) {\n if (!known.has(ref.file)) all.push(ref);\n }\n return all;\n};\n\nconst resolveRefs = (\n scope: string | undefined,\n context: MemoryProviderContext,\n boundedBrowse: boolean,\n): SessionRef[] => {\n const effectiveScope = scope ?? \"session\";\n const input: ResolveScopeInput = {\n agentDir: context.agentDir,\n cwd: context.cwd,\n scope: effectiveScope,\n maxSessions: boundedBrowse ? context.config.maxSessions : Number.MAX_SAFE_INTEGER,\n };\n if (context.sessionId) input.sessionId = context.sessionId;\n if (context.sessionFile) input.sessionFile = context.sessionFile;\n return resolveScope(input);\n};\n\nconst liveBranchResolver = (\n context: MemoryProviderContext,\n): MemoryIndexOptions[\"liveBranchForFile\"] | undefined => {\n if (!context.sessionFile || !context.getLiveBranch) return undefined;\n const current = path.resolve(context.sessionFile);\n return (sessionFile) => path.resolve(sessionFile) === current\n ? context.getLiveBranch?.()\n : undefined;\n};\n\nconst stalePointerError = (\n sessionFile: string,\n expectedSourceHash: string | undefined,\n actualSourceHash: string,\n expectedLineageFingerprint?: string,\n actualLineageFingerprint?: string,\n) => ({\n code: \"stale_pointer\",\n message: expectedLineageFingerprint !== undefined &&\n expectedLineageFingerprint !== actualLineageFingerprint\n ? \"Session active lineage changed after the pointer was issued.\"\n : \"Session source changed after the pointer was issued.\",\n sessionFile,\n ...(expectedSourceHash === undefined ? {} : { expectedSourceHash }),\n actualSourceHash,\n ...(expectedLineageFingerprint === undefined ? {} : { expectedLineageFingerprint }),\n ...(actualLineageFingerprint === undefined ? {} : { actualLineageFingerprint }),\n});\n\nconst addressError = (message: string, entryCount?: number) => ({\n code: \"index_out_of_bounds\",\n message,\n ...(entryCount === undefined ? {} : { entryCount }),\n});\n\nexport class MemoryProvider implements FabricProvider {\n readonly name = \"memory\";\n readonly description =\n \"Cross-session memory: a search engine over every Pi session timeline on this machine\";\n\n constructor(private readonly context: MemoryProviderContext) {}\n\n async list(\n request: FabricProviderListRequest,\n _context: FabricInvocationContext,\n ): Promise<FabricActionDescriptor[]> {\n const query = request.query?.toLowerCase();\n return query\n ? descriptors.filter((descriptor) =>\n `${descriptor.name} ${descriptor.description}`.toLowerCase().includes(query),\n )\n : descriptors;\n }\n\n async describe(\n actionName: string,\n _context: FabricInvocationContext,\n ): Promise<FabricActionDescriptor | undefined> {\n return descriptors.find((descriptor) => descriptor.name === actionName);\n }\n\n prepareArguments(\n actionName: string,\n args: Record<string, unknown>,\n ): Record<string, unknown> {\n return normalizeMemoryArgs(actionName, args);\n }\n\n async invoke(\n actionName: string,\n args: Record<string, unknown>,\n invocationContext: FabricInvocationContext,\n ): Promise<unknown> {\n try {\n switch (actionName) {\n case \"recall\":\n return await this.recall(args, invocationContext);\n case \"expand\":\n return await this.expand(args);\n case \"sessions\":\n return await this.sessions(args);\n default:\n throw new Error(`Unknown memory action: ${actionName}`);\n }\n } catch (error) {\n if (error instanceof AmbiguousSessionError) {\n return {\n error: {\n code: error.code,\n message: error.message,\n session: error.session,\n candidates: error.candidates,\n },\n };\n }\n throw error;\n }\n }\n\n private async recall(\n args: Record<string, unknown>,\n invocationContext: FabricInvocationContext,\n ): Promise<unknown> {\n const query = typeof args.query === \"string\" ? args.query : undefined;\n const rawQueryMode = args.queryMode;\n if (rawQueryMode !== undefined && rawQueryMode !== \"literal\" && rawQueryMode !== \"regex\") {\n throw new Error('memory.recall queryMode must be \"literal\" or \"regex\"');\n }\n const queryMode: MemoryQueryMode = rawQueryMode === \"regex\" ? \"regex\" : \"literal\";\n const expectedSourceHash = typeof args.expectedSourceHash === \"string\"\n ? args.expectedSourceHash\n : undefined;\n const expectedLineageFingerprint = typeof args.expectedLineageFingerprint === \"string\"\n ? args.expectedLineageFingerprint\n : undefined;\n const branches = parseBranches(args.branches, \"memory.recall\");\n const scope = typeof args.scope === \"string\" ? args.scope : undefined;\n const role = typeof args.role === \"string\" ? args.role : undefined;\n const tool = typeof args.tool === \"string\" ? args.tool : undefined;\n const ref = typeof args.ref === \"string\" ? args.ref : undefined;\n const provider = typeof args.provider === \"string\" ? args.provider : undefined;\n const action = typeof args.action === \"string\" ? args.action : undefined;\n const rawOutcome = args.outcome;\n if (\n rawOutcome !== undefined &&\n rawOutcome !== \"succeeded\" &&\n rawOutcome !== \"failed\" &&\n rawOutcome !== \"aborted\" &&\n rawOutcome !== \"timed_out\"\n ) {\n throw new Error(\"memory.recall outcome must be succeeded, failed, aborted, or timed_out\");\n }\n const outcome = rawOutcome as SearchFilters[\"outcome\"];\n const since = typeof args.since === \"number\" ? args.since : undefined;\n const until = typeof args.until === \"number\" ? args.until : undefined;\n const page = typeof args.page === \"number\" && args.page >= 1 ? Math.floor(args.page) : 1;\n const pageSize =\n typeof args.pageSize === \"number\" && args.pageSize >= 1\n ? Math.min(Math.floor(args.pageSize), RECALL_MAX_PAGE_SIZE)\n : RECALL_DEFAULT_PAGE_SIZE;\n\n const refs = resolveRefs(scope, this.context, false);\n const liveResolver = liveBranchResolver(this.context);\n const options = resolveIndexOptions(\n this.context.config,\n this.context.agentDir,\n branches,\n liveResolver,\n );\n const hydrate = scope?.trim().startsWith(\"session:\") ?? false;\n if ((expectedSourceHash !== undefined || expectedLineageFingerprint !== undefined) && !hydrate) {\n throw new Error(\"memory.recall integrity expectations require scope session:<id-or-path>\");\n }\n if (hydrate && refs[0]) {\n const state = fingerprintSource(refs[0].file);\n const lineage = reconstructSessionLineage(\n refs[0].file,\n branches,\n liveResolver?.(refs[0].file),\n );\n const sourceChanged = expectedSourceHash !== undefined &&\n state?.sourceHash !== expectedSourceHash;\n const lineageChanged = expectedLineageFingerprint !== undefined &&\n lineage.fingerprint !== expectedLineageFingerprint;\n if (state && (sourceChanged || lineageChanged)) {\n return {\n scope: scope ?? \"session\",\n query: query ?? null,\n branches,\n error: stalePointerError(\n refs[0].file,\n expectedSourceHash,\n state.sourceHash,\n expectedLineageFingerprint,\n lineage.fingerprint,\n ),\n segments: [],\n digestHits: [],\n items: [],\n };\n }\n }\n\n const rawRange = args.entryRange;\n const entryRange = rawRange && typeof rawRange === \"object\" && !Array.isArray(rawRange)\n ? rawRange as Record<string, unknown>\n : undefined;\n const first = entryRange?.first;\n const last = entryRange?.last;\n if ((first === undefined) !== (last === undefined)) {\n throw new Error(\"memory.recall entryRange requires both first and last\");\n }\n if ((first !== undefined || last !== undefined) && !hydrate) {\n throw new Error(\"memory.recall entryRange requires scope session:<id-or-path>\");\n }\n if (first !== undefined && (\n typeof first !== \"number\" ||\n typeof last !== \"number\" ||\n !Number.isSafeInteger(first) ||\n !Number.isSafeInteger(last) ||\n first < 0 ||\n last < first\n )) {\n return {\n scope: scope ?? \"session\",\n query: query ?? null,\n error: addressError(\"Entry range requires safe integers with 0 <= first <= last.\"),\n segments: [],\n digestHits: [],\n items: [],\n };\n }\n const selectedRange: EntryRange | undefined =\n typeof first === \"number\" && typeof last === \"number\" ? { first, last } : undefined;\n const index = loadTieredIndex(\n refs,\n resolveTierRefs(refs, this.context),\n options,\n hydrate,\n selectedRange,\n );\n const hydratedShard = index.shards[0];\n const hydratedSourceChanged = expectedSourceHash !== undefined &&\n hydratedShard?.sourceHash !== expectedSourceHash;\n const hydratedLineageChanged = expectedLineageFingerprint !== undefined &&\n hydratedShard?.lineageFingerprint !== expectedLineageFingerprint;\n if (hydrate && hydratedShard && (hydratedSourceChanged || hydratedLineageChanged)) {\n return {\n scope: scope ?? \"session\",\n query: query ?? null,\n branches,\n error: stalePointerError(\n hydratedShard.sessionFile,\n expectedSourceHash,\n hydratedShard.sourceHash,\n expectedLineageFingerprint,\n hydratedShard.lineageFingerprint,\n ),\n segments: [],\n digestHits: [],\n items: [],\n };\n }\n if (hydrate && selectedRange && index.shards[0] && selectedRange.last >= index.shards[0].totalEntryCount) {\n return {\n scope: scope ?? \"session\",\n query: query ?? null,\n error: addressError(\n `Entry range ends at ${selectedRange.last}, but the session has ${index.shards[0].totalEntryCount} entries.`,\n index.shards[0].totalEntryCount,\n ),\n segments: [],\n digestHits: [],\n items: [],\n };\n }\n\n const filters: SearchFilters = {};\n if (role) filters.role = role;\n if (tool) filters.tool = tool;\n if (ref) filters.ref = ref;\n if (provider) filters.provider = provider;\n if (action) filters.action = action;\n if (outcome) filters.outcome = outcome;\n if (since !== undefined) filters.since = since;\n if (until !== undefined) filters.until = until;\n const searchQuery = {\n ...(query === undefined ? {} : { query }),\n queryMode,\n filters,\n regexLimits: {\n maxPatternBytes: this.context.config.regexMaxPatternBytes\n ?? DEFAULT_REGEX_MAX_PATTERN_BYTES,\n maxHaystackTerms: this.context.config.regexMaxHaystackTerms\n ?? DEFAULT_REGEX_MAX_HAYSTACK_TERMS,\n maxHaystackBytes: this.context.config.regexMaxHaystackBytes\n ?? DEFAULT_REGEX_MAX_HAYSTACK_BYTES,\n timeoutMs: this.context.config.regexTimeoutMs ?? DEFAULT_REGEX_TIMEOUT_MS,\n },\n };\n const result = await searchMemoryIndex(index.shards, index.digests, searchQuery);\n const coverage = {\n ...index.coverage,\n complete: index.coverage.complete && result.queryCoverage.complete,\n reasons: [...new Set([...index.coverage.reasons, ...result.queryCoverage.reasons])].sort(),\n ...(result.queryCoverage.error ? { error: result.queryCoverage.error } : {}),\n };\n\n const start = (page - 1) * pageSize;\n const pagedItems = result.items.slice(start, start + pageSize);\n const pagedSegments = pagedItems\n .filter((item): item is Extract<SearchItem, { kind: \"entry\" }> => item.kind === \"entry\")\n .map((item) => item.segment);\n const pagedDigests = pagedItems\n .filter((item): item is Extract<SearchItem, { kind: \"digest\" }> => item.kind === \"digest\")\n .map((item) => item.digest);\n const displayResult = {\n ...result,\n segments: pagedSegments,\n digestHits: pagedDigests,\n items: pagedItems,\n };\n const pagedResult = {\n scope: scope ?? \"session\",\n branches,\n query: query ?? null,\n queryMode,\n matchMode: result.matchMode,\n structuralFilters: filters,\n matchedCount: result.matchedCount,\n totalMatches: result.totalMatches,\n totalItems: result.totalItems,\n segmentCount: result.segmentCount,\n segments: pagedSegments,\n digestHits: pagedDigests,\n items: pagedItems,\n page,\n pageSize,\n hasNext: start + pageSize < result.totalItems,\n coverage,\n text: formatSearchResult(displayResult, query, coverage, filters),\n };\n invocationContext.update(\n result.matchMode === \"structural\"\n ? `memory.recall: ${result.matchedCount} structural result items`\n : result.matchMode === \"combined\"\n ? `memory.recall: ${result.matchedCount} lexical matches within exact structural filters`\n : query\n ? `memory.recall: ${result.matchedCount} matches across ${result.segmentCount} segments`\n : `memory.recall: ${result.matchedCount} recent entries`,\n );\n return pagedResult;\n }\n\n private async expand(args: Record<string, unknown>): Promise<unknown> {\n const session = typeof args.session === \"string\" ? args.session : \"\";\n const expectedSourceHash = typeof args.expectedSourceHash === \"string\"\n ? args.expectedSourceHash\n : undefined;\n const expectedLineageFingerprint = typeof args.expectedLineageFingerprint === \"string\"\n ? args.expectedLineageFingerprint\n : undefined;\n const branches = parseBranches(args.branches, \"memory.expand\");\n const rawIndices = args.indices;\n if (rawIndices !== undefined && !Array.isArray(rawIndices)) {\n throw new Error(\"memory.expand indices must be an array\");\n }\n if (Array.isArray(rawIndices) && !rawIndices.every((index) =>\n typeof index === \"number\" && Number.isSafeInteger(index) && index >= 0)) {\n return { session, error: addressError(\"Every entry index must be a non-negative safe integer.\"), expanded: [] };\n }\n const indices = (rawIndices as number[] | undefined) ?? [];\n const entryIds = Array.isArray(args.entryIds)\n ? args.entryIds.filter(\n (entryId): entryId is string => typeof entryId === \"string\" && entryId.length > 0,\n )\n : [];\n const operationAddresses = Array.isArray(args.operationAddresses)\n ? args.operationAddresses.filter(\n (address): address is string => typeof address === \"string\" && address.length > 0,\n )\n : [];\n const rawRange = args.entryRange;\n const rangeRecord = rawRange && typeof rawRange === \"object\" && !Array.isArray(rawRange)\n ? rawRange as Record<string, unknown>\n : undefined;\n const first = rangeRecord?.first;\n const last = rangeRecord?.last;\n if (!session) throw new Error(\"memory.expand requires a session\");\n if ((first === undefined) !== (last === undefined)) {\n throw new Error(\"memory.expand entryRange requires both first and last\");\n }\n if (first !== undefined && (\n typeof first !== \"number\" ||\n typeof last !== \"number\" ||\n !Number.isSafeInteger(first) ||\n !Number.isSafeInteger(last) ||\n first < 0 ||\n last < first\n )) {\n return { session, error: addressError(\"Entry range requires safe integers with 0 <= first <= last.\"), expanded: [] };\n }\n\n const ref = resolveSessionTarget(this.context.agentDir, session);\n if (!ref) {\n return {\n session,\n error: { code: \"session_not_found\", message: `Session not found: ${session}` },\n expanded: [],\n };\n }\n const liveResolver = liveBranchResolver(this.context);\n const initialState = fingerprintSource(ref.file);\n const initialLineage = reconstructSessionLineage(\n ref.file,\n branches,\n liveResolver?.(ref.file),\n );\n if (!initialState) {\n return {\n session: ref.file,\n error: { code: \"source_unavailable\", message: `Session source is unavailable: ${ref.file}` },\n expanded: [],\n };\n }\n const sourceChanged = expectedSourceHash !== undefined &&\n initialState.sourceHash !== expectedSourceHash;\n const lineageChanged = expectedLineageFingerprint !== undefined &&\n initialLineage.fingerprint !== expectedLineageFingerprint;\n if (sourceChanged || lineageChanged) {\n return {\n session: ref.file,\n branches,\n error: stalePointerError(\n ref.file,\n expectedSourceHash,\n initialState.sourceHash,\n expectedLineageFingerprint,\n initialLineage.fingerprint,\n ),\n expanded: [],\n };\n }\n\n const expansionOptions = {\n lineage: initialLineage,\n indexThinking: true,\n indexToolOutput: true,\n };\n const entryCount = normalizeSession(\n ref.file,\n Number.MAX_SAFE_INTEGER,\n expansionOptions,\n ).entries.length;\n const outOfBounds = indices.find((index) => index >= entryCount);\n if (outOfBounds !== undefined) {\n return {\n session: ref.file,\n error: addressError(`Entry index ${outOfBounds} is outside 0..${Math.max(0, entryCount - 1)}.`, entryCount),\n expanded: [],\n };\n }\n if (typeof last === \"number\" && last >= entryCount) {\n return {\n session: ref.file,\n error: addressError(`Entry range ends at ${last}, but the session has ${entryCount} entries.`, entryCount),\n expanded: [],\n };\n }\n if (\n indices.length === 0 &&\n entryIds.length === 0 &&\n operationAddresses.length === 0 &&\n (first === undefined || last === undefined)\n ) {\n return {\n session: ref.file,\n sourceHash: initialState.sourceHash,\n branches,\n lineageFingerprint: initialLineage.fingerprint,\n expanded: [],\n };\n }\n\n const selection: {\n indices?: number[];\n entryIds?: string[];\n operationAddresses?: string[];\n entryRange?: { first: number; last: number };\n } = {};\n if (indices.length > 0) selection.indices = indices;\n if (entryIds.length > 0) selection.entryIds = entryIds;\n if (operationAddresses.length > 0) selection.operationAddresses = operationAddresses;\n if (typeof first === \"number\" && typeof last === \"number\") {\n selection.entryRange = { first, last };\n }\n const expansion = expandSessionEntriesChecked(ref.file, selection, expansionOptions);\n const finalState = fingerprintSource(ref.file);\n const finalLineage = reconstructSessionLineage(\n ref.file,\n branches,\n liveResolver?.(ref.file),\n );\n if (\n !finalState ||\n finalState.sourceHash !== initialState.sourceHash ||\n finalLineage.fingerprint !== initialLineage.fingerprint\n ) {\n return {\n session: ref.file,\n error: stalePointerError(\n ref.file,\n expectedSourceHash ?? initialState.sourceHash,\n finalState?.sourceHash ?? \"\",\n expectedLineageFingerprint ?? initialLineage.fingerprint,\n finalLineage.fingerprint,\n ),\n expanded: [],\n };\n }\n if (\"error\" in expansion) {\n return {\n session: ref.file,\n sourceHash: finalState.sourceHash,\n branches,\n lineageFingerprint: finalLineage.fingerprint,\n error: expansion.error,\n expanded: [],\n };\n }\n return {\n session: ref.file,\n sourceHash: finalState.sourceHash,\n branches,\n lineageFingerprint: finalLineage.fingerprint,\n expanded: expansion.expanded,\n };\n }\n\n private async sessions(args: Record<string, unknown>): Promise<unknown> {\n const scope = typeof args.scope === \"string\" ? args.scope : undefined;\n const branches = parseBranches(args.branches, \"memory.sessions\");\n const limit =\n typeof args.limit === \"number\" && Number.isSafeInteger(args.limit) && args.limit >= 1\n ? Math.min(args.limit, SESSIONS_MAX)\n : SESSIONS_MAX;\n const refs = resolveRefs(scope, this.context, true).slice(0, limit);\n const options = resolveIndexOptions(\n this.context.config,\n this.context.agentDir,\n branches,\n liveBranchResolver(this.context),\n );\n const index = loadTieredIndex(refs, resolveTierRefs(refs, this.context), options);\n const shards = new Map(index.shards.map((shard) => [shard.sessionFile, shard]));\n const digests = new Map(index.digests.map((digest) => [digest.file, digest]));\n const sessions = refs.map((ref) => {\n const tier = index.tiers.get(ref.file) ?? \"cold\";\n const shard = shards.get(ref.file);\n const digest = digests.get(ref.file);\n return {\n id: shard?.sessionId ?? digest?.sessionId ?? ref.id,\n file: ref.file,\n cwd: digest?.cwd ?? ref.cwd,\n mtime: ref.mtime,\n entryCount: shard?.entries.length ?? digest?.entryCount ?? 0,\n tier,\n branches,\n lineageFingerprint: shard?.lineageFingerprint ?? digest?.lineageFingerprint ?? null,\n };\n });\n return { scope: scope ?? \"session\", branches, sessions };\n }\n}\n", "import type { FabricActionDescriptor } from \"../protocol.js\";\n\n// Argument-shape normalization shared by the stable Fabric providers,\n// mirroring the pi core tool architecture:\n//\n// 1. prepareArguments canonicalizes near-miss argument spellings at the\n// registry prepare stage \u2014 aliases resolve to the canonical key (which\n// wins on conflict), value spellings repair, numeric strings coerce for\n// schema-declared numeric fields, and nullish values of declared\n// optionals are stripped.\n// 2. validateArguments then owns the didactic failure tier: required\n// canonical keys are enforced and unknown keys fail\n// additionalProperties: false validation with the offending path named.\n//\n// Most of the repair surface is derived from each action's inputSchema\n// rather than maintained by hand: key casing/spacing variants and\n// singular/plural near-misses come from the declared property names,\n// numeric coercion from the declared property types, and enum-value\n// repairs (casing variants plus the shared synonym classes below) from the\n// declared enum members. Only genuinely semantic synonyms need explicit\n// vocabulary: the shared KEY_SYNONYM_CLASSES / ENUM_VALUE_CLASSES classes\n// here, and provider-local `values` tables where the schema spells a\n// concept as a free string instead of an enum (memory scope).\n\ninterface JsonSchemaObject {\n type?: unknown;\n properties?: unknown;\n enum?: unknown;\n items?: unknown;\n oneOf?: unknown;\n anyOf?: unknown;\n}\n\nexport interface ArgNormalizationSpec {\n // Explicit escape-hatch rows. Prefer derivation or a shared synonym\n // class; keep entries here only for action-local semantics.\n aliases?: Readonly<Record<string, string>>;\n numerics?: readonly string[];\n numericArrays?: readonly string[];\n values?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;\n // Declared property names whose nullish values are stripped before\n // validation. Derived from the descriptor schema when omitted.\n knownKeys?: readonly string[];\n}\n\nexport type ActionArgNormalizer = (\n actionName: string,\n args: Record<string, unknown>,\n) => Record<string, unknown>;\n\n// Casing/spacing/underscore-insensitive key and value form, e.g.\n// \"requested_by\", \"requestedBy\", and \"REQUESTED-BY\" all share one form.\nconst normalizeForm = (key: string): string =>\n key.toLowerCase().replace(/[^a-z0-9]/g, \"\");\n\n// Semantic near-miss vocabulary shared by every stable provider. A spilled\n// key belonging to a class repairs to a declared canonical key only when\n// exactly one member of that class is declared by the action's schema \u2014\n// ambiguity (or absence) leaves the key untouched so the validate stage\n// owns its failure. `id` deliberately appears in several classes: the\n// declared members of each action's schema disambiguate which repair fires\n// (memory.expand takes a session id; agents.wait takes an agent id).\nconst KEY_SYNONYM_CLASSES: ReadonlyArray<ReadonlyArray<string>> = [\n [\"session\", \"sessionId\", \"id\", \"file\", \"path\"],\n [\"hypothesisId\", \"id\"],\n [\"id\", \"agentId\", \"actorId\", \"runId\"],\n [\"query\", \"q\"],\n [\"limit\", \"max\", \"pageSize\"],\n [\"task\", \"prompt\", \"instructions\"],\n [\"label\", \"labels\", \"name\", \"title\"],\n [\"summary\", \"description\"],\n [\"text\", \"message\", \"body\"],\n [\"check\", \"command\", \"cmd\", \"script\", \"predicate\"],\n [\"files\", \"paths\"],\n [\"ifVersion\", \"versionRef\", \"version\"],\n [\"indices\", \"index\"],\n];\n\nconst KEY_CLASS_FORMS = KEY_SYNONYM_CLASSES.map(\n (cls) => new Set(cls.map(normalizeForm)),\n);\n\n// Synonym classes for schema enum values, applied only when the declared\n// enum contains exactly one class member. Scope spellings such as `cwd` \u2192\n// \"project\" repair wherever an enum spells that concept this way; a schema\n// whose enum lacks the concept keeps the value untouched for validation.\nconst ENUM_VALUE_CLASSES: ReadonlyArray<ReadonlyArray<string>> = [\n [\"project\", \"cwd\", \"repo\", \"repository\", \"workspace\", \"checkout\", \"tree\"],\n [\"global\", \"all\"],\n [\"permanent\", \"pinned\", \"sticky\", \"durable\"],\n];\n\nconst VALUE_CLASS_FORMS = ENUM_VALUE_CLASSES.map(\n (cls) => new Set(cls.map(normalizeForm)),\n);\n\ntype NumericKind = \"scalar\" | \"array\" | undefined;\n\nconst numericKind = (property: unknown): NumericKind => {\n if (!property || typeof property !== \"object\") return undefined;\n const schema = property as JsonSchemaObject;\n if (schema.type === \"number\" || schema.type === \"integer\") return \"scalar\";\n if (schema.type === \"array\") {\n const items = schema.items;\n if (\n items &&\n typeof items === \"object\" &&\n ((items as JsonSchemaObject).type === \"number\" ||\n (items as JsonSchemaObject).type === \"integer\")\n ) {\n return \"array\";\n }\n }\n return undefined;\n};\n\nconst stringEnumValues = (property: unknown): readonly string[] | undefined => {\n if (!property || typeof property !== \"object\") return undefined;\n const schema = property as JsonSchemaObject;\n if (Array.isArray(schema.enum)) {\n const values = schema.enum.filter(\n (entry): entry is string => typeof entry === \"string\",\n );\n return values.length > 0 ? values : undefined;\n }\n for (const branch of [schema.oneOf, schema.anyOf]) {\n if (!Array.isArray(branch)) continue;\n const consts = branch\n .map((entry) =>\n entry && typeof entry === \"object\"\n ? (entry as { const?: unknown }).const\n : undefined,\n )\n .filter((entry): entry is string => typeof entry === \"string\");\n if (consts.length > 0) return consts;\n }\n return undefined;\n};\n\n// form \u2192 enum value. Exact forms of declared members win; class synonyms\n// fill in only when exactly one declared member belongs to the class.\nconst deriveEnumValueMap = (\n values: readonly string[],\n): Map<string, string> => {\n const map = new Map<string, string>();\n const seen = new Map<string, string | undefined>();\n for (const value of values) {\n const form = normalizeForm(value);\n seen.set(form, seen.has(form) ? undefined : value);\n }\n for (const [form, value] of seen) if (value !== undefined) map.set(form, value);\n for (const classForms of VALUE_CLASS_FORMS) {\n const members = values.filter((value) => classForms.has(normalizeForm(value)));\n if (members.length !== 1) continue;\n const [hit] = members as [string];\n for (const form of classForms) {\n if (form !== normalizeForm(hit) && !map.has(form)) map.set(form, hit);\n }\n }\n return map;\n};\n\ntype DerivedAction = {\n declared: Set<string>;\n declaredForms: Map<string, string>;\n singulars: Map<string, string>;\n numerics: Set<string>;\n numericArrays: Set<string>;\n values: Map<string, Map<string, unknown>>;\n aliases?: Readonly<Record<string, string>> | undefined;\n};\n\n// The value-column meaning of the schema, precomputed once per action.\nconst deriveAction = (\n inputSchema: JsonSchemaObject | undefined,\n explicit: ArgNormalizationSpec | undefined,\n): DerivedAction => {\n const properties =\n inputSchema && typeof inputSchema === \"object\" &&\n inputSchema.properties &&\n typeof inputSchema.properties === \"object\"\n ? (inputSchema.properties as Record<string, unknown>)\n : undefined;\n const declared = new Set(Object.keys(properties ?? {}));\n const declaredForms = new Map<string, string>();\n const ambiguousForms = new Set<string>();\n for (const key of declared) {\n const form = normalizeForm(key);\n if (declaredForms.has(form)) {\n ambiguousForms.add(form);\n declaredForms.delete(form);\n } else if (!ambiguousForms.has(form)) {\n declaredForms.set(form, key);\n }\n }\n const singulars = new Map<string, string>();\n for (const key of declared) {\n const form = normalizeForm(key);\n if (!form.endsWith(\"s\")) continue;\n const singular = form.slice(0, -1);\n if (!singular || declaredForms.has(singular) || singular === form) continue;\n if (singulars.get(singular) !== undefined) singulars.delete(singular);\n else singulars.set(singular, key);\n }\n for (const form of ambiguousForms) singulars.delete(form);\n\n const numerics = new Set(explicit?.numerics ?? []);\n const numericArrays = new Set(explicit?.numericArrays ?? []);\n const values = new Map<string, Map<string, unknown>>();\n if (properties) {\n for (const [key, property] of Object.entries(properties)) {\n const kind = numericKind(property);\n if (kind === \"scalar\") numerics.add(key);\n else if (kind === \"array\") numericArrays.add(key);\n const enumValues = stringEnumValues(property);\n if (enumValues) values.set(key, new Map(deriveEnumValueMap(enumValues)));\n }\n }\n for (const [key, remaps] of Object.entries(explicit?.values ?? {})) {\n const map = values.get(key) ?? new Map<string, unknown>();\n for (const [spelling, target] of Object.entries(remaps)) {\n map.set(normalizeForm(spelling), target);\n }\n values.set(key, map);\n }\n return { declared, declaredForms, singulars, numerics, numericArrays, values, aliases: explicit?.aliases };\n};\n\nconst lexiconRepair = (\n form: string,\n declaredForms: Map<string, string>,\n): string | undefined => {\n const candidates = new Set<string>();\n for (const classForms of KEY_CLASS_FORMS) {\n if (!classForms.has(form)) continue;\n for (const [declaredForm, declaredKey] of declaredForms) {\n if (declaredForm !== form && classForms.has(declaredForm)) {\n candidates.add(declaredKey);\n }\n }\n }\n return candidates.size === 1 ? [...candidates][0] : undefined;\n};\n\n/** Unique declared key for a spilled spelling, or undefined when already\n * canonical / ambiguous / unmatched. Used by the catalog repair compiler. */\nexport const uniqueDeclaredKeyForSpelling = (\n spilled: string,\n declared: readonly string[],\n): string | undefined => {\n if (declared.includes(spilled)) return undefined;\n const derived = deriveAction(\n {\n type: \"object\",\n properties: Object.fromEntries(declared.map((key) => [key, {}])),\n },\n undefined,\n );\n const form = normalizeForm(spilled);\n const canonical =\n derived.declaredForms.get(form) ??\n derived.singulars.get(form) ??\n lexiconRepair(form, derived.declaredForms);\n return canonical && canonical !== spilled ? canonical : undefined;\n};\n\nconst applyDerived = (\n args: Record<string, unknown>,\n derived: DerivedAction,\n): Record<string, unknown> => {\n const out: Record<string, unknown> = { ...args };\n\n // Explicit action-local aliases first, then derived repairs. Both obey\n // canonical-wins: the canonical key keeps an already-supplied value and\n // the spelling variant is dropped either way.\n const repair = (alias: string, canonical: string) => {\n if (!(alias in out) || alias === canonical) return;\n if (!(canonical in out)) out[canonical] = out[alias];\n delete out[alias];\n };\n for (const [alias, canonical] of Object.entries(derived.aliases ?? {})) {\n repair(alias, canonical);\n }\n for (const key of [...Object.keys(out)]) {\n if (derived.declared.has(key)) continue;\n const form = normalizeForm(key);\n const canonical =\n derived.declaredForms.get(form) ??\n derived.singulars.get(form) ??\n lexiconRepair(form, derived.declaredForms);\n if (canonical && canonical !== key) repair(key, canonical);\n }\n\n for (const key of derived.numerics) {\n const value = out[key];\n if (typeof value === \"string\" && value.trim() !== \"\" && !Number.isNaN(Number(value))) {\n out[key] = Number(value);\n }\n }\n for (const key of derived.numericArrays) {\n const value = out[key];\n if (Array.isArray(value)) {\n out[key] = value.map((entry) =>\n typeof entry === \"string\" && entry.trim() !== \"\" && !Number.isNaN(Number(entry))\n ? Number(entry)\n : entry,\n );\n }\n }\n for (const [key, remaps] of derived.values) {\n const value = out[key];\n if (typeof value === \"string\") {\n const next = remaps.get(normalizeForm(value));\n if (next !== undefined) out[key] = next;\n }\n }\n if (derived.declared.size > 0) {\n for (const key of Object.keys(out)) {\n if (derived.declared.has(key) && (out[key] === null || out[key] === undefined)) {\n delete out[key];\n }\n }\n }\n return out;\n};\n\n// Low-level explicit-spec normalizer. Used directly by tests and as the\n// shared mechanics for per-key aliases, value spellings, numeric strings,\n// and nullish stripping; actionArgNormalizer layers schema derivation and\n// the shared synonym lexicon on top.\nexport const normalizeActionArgs = (\n args: Record<string, unknown>,\n spec: ArgNormalizationSpec,\n): Record<string, unknown> => {\n const derived: DerivedAction = {\n // The low-level path strips nullish values only for explicit knownKeys;\n // schema-derived declared keys come from actionArgNormalizer.\n declared: new Set(spec.knownKeys ?? []),\n declaredForms: new Map(),\n singulars: new Map(),\n numerics: new Set(spec.numerics ?? []),\n numericArrays: new Set(spec.numericArrays ?? []),\n values: new Map(\n Object.entries(spec.values ?? {}).map(([key, remaps]) => [\n key,\n new Map(\n Object.entries(remaps).map(([spelling, target]) => [normalizeForm(spelling), target]),\n ),\n ]),\n ),\n aliases: spec.aliases,\n };\n if (!args || typeof args !== \"object\" || Array.isArray(args)) return args;\n return applyDerived(args, derived);\n};\n\n// Build a provider prepareArguments hook. Repair behavior derives from each\n// action's inputSchema (declared key forms, singular/plural variants,\n// numeric property types, enum value spellings) plus the shared synonym\n// lexicon; the residual table holds only action-local semantics the schema\n// cannot express.\nexport const actionArgNormalizer = (\n describeActions: () => ReadonlyArray<Pick<FabricActionDescriptor, \"name\" | \"inputSchema\">>,\n table: Record<string, ArgNormalizationSpec> = {},\n): ActionArgNormalizer => {\n const derived = new Map<string, DerivedAction>();\n for (const descriptor of describeActions()) {\n derived.set(\n descriptor.name,\n deriveAction(\n descriptor.inputSchema as JsonSchemaObject | undefined,\n table[descriptor.name],\n ),\n );\n }\n return (actionName, args) => {\n if (!args || typeof args !== \"object\" || Array.isArray(args)) return args;\n const action = derived.get(actionName);\n return action ? applyDerived(args, action) : args;\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAOA,OAAO,UAAU;;;AC6CjB,IAAM,gBAAgB,CAAC,QACrB,IAAI,YAAY,EAAE,QAAQ,cAAc,EAAE;AAS5C,IAAM,sBAA4D;AAAA,EAChE,CAAC,WAAW,aAAa,MAAM,QAAQ,MAAM;AAAA,EAC7C,CAAC,gBAAgB,IAAI;AAAA,EACrB,CAAC,MAAM,WAAW,WAAW,OAAO;AAAA,EACpC,CAAC,SAAS,GAAG;AAAA,EACb,CAAC,SAAS,OAAO,UAAU;AAAA,EAC3B,CAAC,QAAQ,UAAU,cAAc;AAAA,EACjC,CAAC,SAAS,UAAU,QAAQ,OAAO;AAAA,EACnC,CAAC,WAAW,aAAa;AAAA,EACzB,CAAC,QAAQ,WAAW,MAAM;AAAA,EAC1B,CA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}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMPILED_SURFACE_VERSION,
|
|
3
3
|
MAX_COMPILED_SURFACE_PROPOSALS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JNACUKKJ.js";
|
|
5
5
|
import {
|
|
6
6
|
writeJsonAtomic
|
|
7
7
|
} from "./chunk-3SGRTVFP.js";
|
|
@@ -272,4 +272,4 @@ export {
|
|
|
272
272
|
loadCompiledSurface,
|
|
273
273
|
saveCompiledSurface
|
|
274
274
|
};
|
|
275
|
-
//# sourceMappingURL=chunk-
|
|
275
|
+
//# sourceMappingURL=chunk-QJF6UH3U.js.map
|