@remnic/core 9.3.741 → 9.3.742
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/access-boundary.d.ts +2 -2
- package/dist/access-boundary.js +2 -2
- package/dist/access-cli.js +8 -8
- package/dist/access-http.d.ts +2 -2
- package/dist/access-http.js +6 -6
- package/dist/access-mcp.d.ts +2 -2
- package/dist/access-mcp.js +5 -5
- package/dist/access-operations-batch.js +3 -3
- package/dist/access-operations.d.ts +2 -2
- package/dist/access-operations.js +4 -4
- package/dist/{access-service-Cbk-Kv_A.d.ts → access-service-K8n12dXu.d.ts} +1 -1
- package/dist/access-service.d.ts +2 -2
- package/dist/access-service.js +1 -1
- package/dist/access-surface-catalog.d.ts +2 -2
- package/dist/{auto-sync-G3V5AN4C.js → auto-sync-XHSKKQAH.js} +2 -2
- package/dist/bootstrap.d.ts +1 -1
- package/dist/{chunk-DBVBV2RF.js → chunk-7ADHJ6SU.js} +3 -3
- package/dist/{chunk-VC7QELR6.js → chunk-7HUGLMSW.js} +346 -305
- package/dist/chunk-7HUGLMSW.js.map +1 -0
- package/dist/{chunk-QCO2QFLZ.js → chunk-AM7YKD7V.js} +3 -2
- package/dist/{chunk-QCO2QFLZ.js.map → chunk-AM7YKD7V.js.map} +1 -1
- package/dist/{chunk-OZECYVGI.js → chunk-C7LDPZJJ.js} +6 -4
- package/dist/{chunk-OZECYVGI.js.map → chunk-C7LDPZJJ.js.map} +1 -1
- package/dist/{chunk-4J53ZVPQ.js → chunk-EZZUNKMJ.js} +3 -3
- package/dist/{chunk-H3WSZWHK.js → chunk-GFJ5ABKS.js} +7 -6
- package/dist/chunk-GFJ5ABKS.js.map +1 -0
- package/dist/{chunk-LD6A7XG5.js → chunk-JMMSVRF4.js} +4 -4
- package/dist/{chunk-7Y5KKMIP.js → chunk-NHJYUIII.js} +3 -2
- package/dist/{chunk-7Y5KKMIP.js.map → chunk-NHJYUIII.js.map} +1 -1
- package/dist/{chunk-DGVM5SFL.js → chunk-PHRLJFWZ.js} +3 -2
- package/dist/{chunk-DGVM5SFL.js.map → chunk-PHRLJFWZ.js.map} +1 -1
- package/dist/{chunk-M5KLYHHI.js → chunk-QUNH5UZH.js} +2 -2
- package/dist/{chunk-3TUDKDTQ.js → chunk-UEIF7RWQ.js} +3 -3
- package/dist/{chunk-773DPI6T.js → chunk-V5RVMULT.js} +11 -8
- package/dist/chunk-V5RVMULT.js.map +1 -0
- package/dist/{chunk-XPOOY35N.js → chunk-W4H5A3TJ.js} +3 -2
- package/dist/chunk-W4H5A3TJ.js.map +1 -0
- package/dist/{cli-BQW2xKdb.d.ts → cli-BEOLy1xo.d.ts} +2 -2
- package/dist/cli.d.ts +3 -3
- package/dist/cli.js +8 -8
- package/dist/explicit-capture.d.ts +1 -1
- package/dist/graph-recall.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +13 -13
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.js +2 -2
- package/dist/lcm/summarizer.js +1 -1
- package/dist/mcp-memory-inspector-app.d.ts +2 -2
- package/dist/operator-toolkit.js +1 -1
- package/dist/{orchestrator-BOAFN_Yr.d.ts → orchestrator-Dr-1v5EL.d.ts} +58 -0
- package/dist/orchestrator.d.ts +1 -1
- package/dist/orchestrator.js +4 -4
- package/package.json +2 -2
- package/src/cli.ts +2 -1
- package/src/graph-recall.ts +2 -1
- package/src/lcm/engine.ts +9 -6
- package/src/lcm/summarizer.ts +2 -1
- package/src/operator-toolkit.ts +2 -1
- package/src/orchestration/qmd-result-resolver.ts +377 -0
- package/src/orchestrator.ts +14 -279
- package/src/procedural/procedure-stats.ts +2 -1
- package/src/wearables/pipeline.ts +5 -3
- package/dist/chunk-773DPI6T.js.map +0 -1
- package/dist/chunk-H3WSZWHK.js.map +0 -1
- package/dist/chunk-VC7QELR6.js.map +0 -1
- package/dist/chunk-XPOOY35N.js.map +0 -1
- /package/dist/{auto-sync-G3V5AN4C.js.map → auto-sync-XHSKKQAH.js.map} +0 -0
- /package/dist/{chunk-DBVBV2RF.js.map → chunk-7ADHJ6SU.js.map} +0 -0
- /package/dist/{chunk-4J53ZVPQ.js.map → chunk-EZZUNKMJ.js.map} +0 -0
- /package/dist/{chunk-LD6A7XG5.js.map → chunk-JMMSVRF4.js.map} +0 -0
- /package/dist/{chunk-M5KLYHHI.js.map → chunk-QUNH5UZH.js.map} +0 -0
- /package/dist/{chunk-3TUDKDTQ.js.map → chunk-UEIF7RWQ.js.map} +0 -0
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
|
|
8
8
|
// src/graph-recall.ts
|
|
9
9
|
function runGraphRecall(config, options) {
|
|
10
|
-
|
|
10
|
+
const { recallGraphEnabled } = config;
|
|
11
|
+
if (!recallGraphEnabled) {
|
|
11
12
|
return {
|
|
12
13
|
ran: false,
|
|
13
14
|
results: [],
|
|
@@ -66,4 +67,4 @@ function runGraphRecall(config, options) {
|
|
|
66
67
|
export {
|
|
67
68
|
runGraphRecall
|
|
68
69
|
};
|
|
69
|
-
//# sourceMappingURL=chunk-
|
|
70
|
+
//# sourceMappingURL=chunk-PHRLJFWZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph-recall.ts"],"sourcesContent":["/**\n * Graph-based retrieval integration (issue #559 PR 4 of 5).\n *\n * Pure helper that composes `extractGraphEdges` (PR 2) and `queryGraph`\n * (PR 3) into a single retrieval surface. Operators opt in via the\n * `recallGraphEnabled` config flag; until the `retrieval-graph` bench in\n * PR 5 justifies flipping the default, this tier ships disabled.\n *\n * Kept as a pure function so the orchestrator can call it with whatever\n * candidate pool it has (hot cache, recent window, QMD first-pass, etc.)\n * without forcing a specific storage contract on this module.\n */\n\nimport {\n DEFAULT_PPR_DAMPING,\n DEFAULT_PPR_ITERATIONS,\n type MemoryEdgeSource,\n type RemnicGraph,\n buildGraphFromMemories,\n queryGraph,\n} from \"./graph-retrieval.js\";\n\n/**\n * Subset of `PluginConfig` that governs the graph retrieval tier. Kept\n * as a local interface so this module does not pull in the full\n * `PluginConfig` import — `orchestrator.ts` can pass the fields directly.\n */\nexport interface GraphRecallConfig {\n /** Master enable flag. When false, `runGraphRecall` is a no-op. */\n recallGraphEnabled: boolean;\n /** PPR damping factor (default 0.85). */\n recallGraphDamping: number;\n /** PPR power-iteration cap (default 20). */\n recallGraphIterations: number;\n /**\n * Max memories the graph tier returns. `0` disables the tier's\n * contribution without touching `recallGraphEnabled`.\n */\n recallGraphTopK: number;\n}\n\n/** Per-invocation options for `runGraphRecall`. */\nexport interface GraphRecallOptions {\n /**\n * Candidate memories to build the graph from. Typically the caller's\n * recall candidate pool (hot cache + QMD first-pass). The extractor\n * reads only the fields declared on `MemoryEdgeSource` — callers can\n * safely pass richer memory objects.\n */\n memories: readonly MemoryEdgeSource[];\n /**\n * Seed memory / entity ids produced by the query-to-graph matcher.\n * Typically the ids of the top QMD hits plus any entity-exact matches.\n * If empty, PPR falls back to a uniform distribution over graph nodes.\n */\n seedIds: readonly string[];\n /**\n * Optional per-seed weights. When provided, PPR starts from the\n * weighted distribution instead of uniform-over-seeds.\n */\n seedWeights?: ReadonlyMap<string, number> | Readonly<Record<string, number>>;\n}\n\n/** A single result from the graph tier. */\nexport interface GraphRecallResult {\n /** Memory id (the `to` of the highest-scoring `memory`-typed node). */\n id: string;\n /** PPR score in [0, 1]. Higher is better. */\n score: number;\n}\n\n/** The full shape returned by `runGraphRecall`. */\nexport interface GraphRecallRun {\n /**\n * Whether the graph tier actually ran. `false` when `recallGraphEnabled`\n * is `false` or `recallGraphTopK <= 0` — in both cases `results` is `[]`\n * and `reason` indicates which gate short-circuited.\n */\n ran: boolean;\n /**\n * Memory-typed ranked results. Entity / agent nodes are filtered out\n * because the orchestrator merges this list with memory-typed QMD\n * results via MMR.\n */\n results: GraphRecallResult[];\n /** The graph that was built (or `null` if the tier did not run). */\n graph: RemnicGraph | null;\n /** Debugging tag for tier-explain surfaces. */\n reason: \"ran\" | \"disabled\" | \"topk-zero\" | \"empty-input\";\n /** Number of power-iteration rounds that executed. */\n iterations: number;\n /** Whether PPR's L1 delta fell below tolerance before the iter cap. */\n converged: boolean;\n}\n\n/**\n * Pure graph retrieval run.\n *\n * 1. Short-circuits to `{ ran: false }` when the feature flag is off,\n * `topK <= 0`, or the memory pool is empty. No graph is built, no\n * PPR runs — this preserves the zero-cost guarantee for\n * `recallGraphEnabled: false` (the default).\n * 2. Otherwise builds the retrieval graph from the candidate pool via\n * `buildGraphFromMemories` (PR 2 extractor).\n * 3. Runs Personalized PageRank via `queryGraph` (PR 3).\n * 4. Projects ranked nodes to memory-typed ids only — entity and agent\n * nodes never appear in the recall result set.\n */\nexport function runGraphRecall(\n config: GraphRecallConfig,\n options: GraphRecallOptions,\n): GraphRecallRun {\n if (!
|
|
1
|
+
{"version":3,"sources":["../src/graph-recall.ts"],"sourcesContent":["/**\n * Graph-based retrieval integration (issue #559 PR 4 of 5).\n *\n * Pure helper that composes `extractGraphEdges` (PR 2) and `queryGraph`\n * (PR 3) into a single retrieval surface. Operators opt in via the\n * `recallGraphEnabled` config flag; until the `retrieval-graph` bench in\n * PR 5 justifies flipping the default, this tier ships disabled.\n *\n * Kept as a pure function so the orchestrator can call it with whatever\n * candidate pool it has (hot cache, recent window, QMD first-pass, etc.)\n * without forcing a specific storage contract on this module.\n */\n\nimport {\n DEFAULT_PPR_DAMPING,\n DEFAULT_PPR_ITERATIONS,\n type MemoryEdgeSource,\n type RemnicGraph,\n buildGraphFromMemories,\n queryGraph,\n} from \"./graph-retrieval.js\";\n\n/**\n * Subset of `PluginConfig` that governs the graph retrieval tier. Kept\n * as a local interface so this module does not pull in the full\n * `PluginConfig` import — `orchestrator.ts` can pass the fields directly.\n */\nexport interface GraphRecallConfig {\n /** Master enable flag. When false, `runGraphRecall` is a no-op. */\n recallGraphEnabled: boolean;\n /** PPR damping factor (default 0.85). */\n recallGraphDamping: number;\n /** PPR power-iteration cap (default 20). */\n recallGraphIterations: number;\n /**\n * Max memories the graph tier returns. `0` disables the tier's\n * contribution without touching `recallGraphEnabled`.\n */\n recallGraphTopK: number;\n}\n\n/** Per-invocation options for `runGraphRecall`. */\nexport interface GraphRecallOptions {\n /**\n * Candidate memories to build the graph from. Typically the caller's\n * recall candidate pool (hot cache + QMD first-pass). The extractor\n * reads only the fields declared on `MemoryEdgeSource` — callers can\n * safely pass richer memory objects.\n */\n memories: readonly MemoryEdgeSource[];\n /**\n * Seed memory / entity ids produced by the query-to-graph matcher.\n * Typically the ids of the top QMD hits plus any entity-exact matches.\n * If empty, PPR falls back to a uniform distribution over graph nodes.\n */\n seedIds: readonly string[];\n /**\n * Optional per-seed weights. When provided, PPR starts from the\n * weighted distribution instead of uniform-over-seeds.\n */\n seedWeights?: ReadonlyMap<string, number> | Readonly<Record<string, number>>;\n}\n\n/** A single result from the graph tier. */\nexport interface GraphRecallResult {\n /** Memory id (the `to` of the highest-scoring `memory`-typed node). */\n id: string;\n /** PPR score in [0, 1]. Higher is better. */\n score: number;\n}\n\n/** The full shape returned by `runGraphRecall`. */\nexport interface GraphRecallRun {\n /**\n * Whether the graph tier actually ran. `false` when `recallGraphEnabled`\n * is `false` or `recallGraphTopK <= 0` — in both cases `results` is `[]`\n * and `reason` indicates which gate short-circuited.\n */\n ran: boolean;\n /**\n * Memory-typed ranked results. Entity / agent nodes are filtered out\n * because the orchestrator merges this list with memory-typed QMD\n * results via MMR.\n */\n results: GraphRecallResult[];\n /** The graph that was built (or `null` if the tier did not run). */\n graph: RemnicGraph | null;\n /** Debugging tag for tier-explain surfaces. */\n reason: \"ran\" | \"disabled\" | \"topk-zero\" | \"empty-input\";\n /** Number of power-iteration rounds that executed. */\n iterations: number;\n /** Whether PPR's L1 delta fell below tolerance before the iter cap. */\n converged: boolean;\n}\n\n/**\n * Pure graph retrieval run.\n *\n * 1. Short-circuits to `{ ran: false }` when the feature flag is off,\n * `topK <= 0`, or the memory pool is empty. No graph is built, no\n * PPR runs — this preserves the zero-cost guarantee for\n * `recallGraphEnabled: false` (the default).\n * 2. Otherwise builds the retrieval graph from the candidate pool via\n * `buildGraphFromMemories` (PR 2 extractor).\n * 3. Runs Personalized PageRank via `queryGraph` (PR 3).\n * 4. Projects ranked nodes to memory-typed ids only — entity and agent\n * nodes never appear in the recall result set.\n */\nexport function runGraphRecall(\n config: GraphRecallConfig,\n options: GraphRecallOptions,\n): GraphRecallRun {\n const { recallGraphEnabled } = config;\n if (!recallGraphEnabled) {\n return {\n ran: false,\n results: [],\n graph: null,\n reason: \"disabled\",\n iterations: 0,\n converged: true,\n };\n }\n\n // `isFinite` guard on `topK` mirrors the checks on `damping` and\n // `iterations` below. Without it a `NaN` topK would pass the typeof\n // check, then `NaN <= 0` is false (bypassing the short-circuit) and\n // the downstream `memoryResults.length >= topK` never triggers.\n const topK =\n typeof config.recallGraphTopK === \"number\" && Number.isFinite(config.recallGraphTopK)\n ? config.recallGraphTopK\n : 50;\n if (topK <= 0) {\n return {\n ran: false,\n results: [],\n graph: null,\n reason: \"topk-zero\",\n iterations: 0,\n converged: true,\n };\n }\n\n if (options.memories.length === 0) {\n return {\n ran: false,\n results: [],\n graph: null,\n reason: \"empty-input\",\n iterations: 0,\n converged: true,\n };\n }\n\n const graph = buildGraphFromMemories(options.memories);\n\n const damping =\n typeof config.recallGraphDamping === \"number\" && Number.isFinite(config.recallGraphDamping)\n ? config.recallGraphDamping\n : DEFAULT_PPR_DAMPING;\n const iterations =\n typeof config.recallGraphIterations === \"number\" && Number.isFinite(config.recallGraphIterations)\n ? config.recallGraphIterations\n : DEFAULT_PPR_ITERATIONS;\n\n // PPR runs without a topK so we can post-filter non-memory nodes without\n // the trim dropping memory-typed results. We apply topK after projection.\n const ppr = queryGraph(graph, options.seedIds, {\n damping,\n iterations,\n seedWeights: options.seedWeights,\n });\n\n const memoryResults: GraphRecallResult[] = [];\n for (const node of ppr.rankedNodes) {\n const graphNode = graph.nodes.get(node.id);\n if (!graphNode || graphNode.type !== \"memory\") continue;\n memoryResults.push({ id: node.id, score: node.score });\n if (memoryResults.length >= topK) break;\n }\n\n return {\n ran: true,\n results: memoryResults,\n graph,\n reason: \"ran\",\n iterations: ppr.iterations,\n converged: ppr.converged,\n };\n}\n"],"mappings":";;;;;;;;AA4GO,SAAS,eACd,QACA,SACgB;AAChB,QAAM,EAAE,mBAAmB,IAAI;AAC/B,MAAI,CAAC,oBAAoB;AACvB,WAAO;AAAA,MACL,KAAK;AAAA,MACL,SAAS,CAAC;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,WAAW;AAAA,IACb;AAAA,EACF;AAMA,QAAM,OACJ,OAAO,OAAO,oBAAoB,YAAY,OAAO,SAAS,OAAO,eAAe,IAChF,OAAO,kBACP;AACN,MAAI,QAAQ,GAAG;AACb,WAAO;AAAA,MACL,KAAK;AAAA,MACL,SAAS,CAAC;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,WAAW;AAAA,IACb;AAAA,EACF;AAEA,MAAI,QAAQ,SAAS,WAAW,GAAG;AACjC,WAAO;AAAA,MACL,KAAK;AAAA,MACL,SAAS,CAAC;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,WAAW;AAAA,IACb;AAAA,EACF;AAEA,QAAM,QAAQ,uBAAuB,QAAQ,QAAQ;AAErD,QAAM,UACJ,OAAO,OAAO,uBAAuB,YAAY,OAAO,SAAS,OAAO,kBAAkB,IACtF,OAAO,qBACP;AACN,QAAM,aACJ,OAAO,OAAO,0BAA0B,YAAY,OAAO,SAAS,OAAO,qBAAqB,IAC5F,OAAO,wBACP;AAIN,QAAM,MAAM,WAAW,OAAO,QAAQ,SAAS;AAAA,IAC7C;AAAA,IACA;AAAA,IACA,aAAa,QAAQ;AAAA,EACvB,CAAC;AAED,QAAM,gBAAqC,CAAC;AAC5C,aAAW,QAAQ,IAAI,aAAa;AAClC,UAAM,YAAY,MAAM,MAAM,IAAI,KAAK,EAAE;AACzC,QAAI,CAAC,aAAa,UAAU,SAAS,SAAU;AAC/C,kBAAc,KAAK,EAAE,IAAI,KAAK,IAAI,OAAO,KAAK,MAAM,CAAC;AACrD,QAAI,cAAc,UAAU,KAAM;AAAA,EACpC;AAEA,SAAO;AAAA,IACL,KAAK;AAAA,IACL,SAAS;AAAA,IACT;AAAA,IACA,QAAQ;AAAA,IACR,YAAY,IAAI;AAAA,IAChB,WAAW,IAAI;AAAA,EACjB;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EngramAccessInputError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NHJYUIII.js";
|
|
4
4
|
import {
|
|
5
5
|
expandTildePath
|
|
6
6
|
} from "./chunk-EYIEWJNI.js";
|
|
@@ -130,4 +130,4 @@ export {
|
|
|
130
130
|
listRegisteredOperations,
|
|
131
131
|
__resetRegistryForTest
|
|
132
132
|
};
|
|
133
|
-
//# sourceMappingURL=chunk-
|
|
133
|
+
//# sourceMappingURL=chunk-QUNH5UZH.js.map
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
} from "./chunk-T4WDJPEZ.js";
|
|
22
22
|
import {
|
|
23
23
|
defineOperation
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-QUNH5UZH.js";
|
|
25
25
|
import {
|
|
26
26
|
EngramAccessInputError
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-NHJYUIII.js";
|
|
28
28
|
import {
|
|
29
29
|
projectTagProjectId
|
|
30
30
|
} from "./chunk-OVYBENIJ.js";
|
|
@@ -417,4 +417,4 @@ defineOperation({ name: "offline_sync_snapshot_stream", description: "SSE stream
|
|
|
417
417
|
defineOperation({ name: "graph_events", description: "SSE graph events.", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { stream: "sse" } }) });
|
|
418
418
|
defineOperation({ name: "chat_message", description: "Chat message.", schema: strictSchema({ message: S.str, chatSessionId: S.str }), handler: async (_i, _ctx) => ({ result: { ok: true } }) });
|
|
419
419
|
defineOperation({ name: "chat_events", description: "SSE chat events.", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { stream: "sse" } }) });
|
|
420
|
-
//# sourceMappingURL=chunk-
|
|
420
|
+
//# sourceMappingURL=chunk-UEIF7RWQ.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-KYYL4U6X.js";
|
|
14
14
|
import {
|
|
15
15
|
LcmSummarizer
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-W4H5A3TJ.js";
|
|
17
17
|
import {
|
|
18
18
|
LcmArchive
|
|
19
19
|
} from "./chunk-HW5EF6LV.js";
|
|
@@ -98,6 +98,7 @@ var LcmEngine = class {
|
|
|
98
98
|
const db = openLcmDatabase(this.memoryDir);
|
|
99
99
|
const archive = new LcmArchive(db);
|
|
100
100
|
const dag = new LcmDag(db);
|
|
101
|
+
const { telemetryPrefilterEnabled } = this.config;
|
|
101
102
|
const summarizer = new LcmSummarizer(
|
|
102
103
|
archive,
|
|
103
104
|
dag,
|
|
@@ -107,7 +108,7 @@ var LcmEngine = class {
|
|
|
107
108
|
rollupFanIn: this.config.rollupFanIn,
|
|
108
109
|
maxDepth: this.config.maxDepth,
|
|
109
110
|
deterministicMaxTokens: this.config.deterministicMaxTokens,
|
|
110
|
-
telemetryPrefilterEnabled
|
|
111
|
+
telemetryPrefilterEnabled
|
|
111
112
|
}
|
|
112
113
|
);
|
|
113
114
|
const observeQueue = new LcmWorkQueue({
|
|
@@ -188,16 +189,17 @@ var LcmEngine = class {
|
|
|
188
189
|
if (this.closed || !this.archive || !this.summarizer) return;
|
|
189
190
|
if (messages.length === 0) return;
|
|
190
191
|
const currentMax = this.archive.getMaxTurnIndex(sessionId);
|
|
192
|
+
const { messagePartsEnabled } = this.config;
|
|
191
193
|
const newMessages = messages.map((m, i) => ({
|
|
192
194
|
turnIndex: currentMax + 1 + i,
|
|
193
195
|
role: m.role,
|
|
194
196
|
content: m.content,
|
|
195
|
-
parts:
|
|
196
|
-
rawContent:
|
|
197
|
-
sourceFormat:
|
|
197
|
+
parts: messagePartsEnabled ? m.parts : void 0,
|
|
198
|
+
rawContent: messagePartsEnabled ? m.rawContent : void 0,
|
|
199
|
+
sourceFormat: messagePartsEnabled ? m.sourceFormat : void 0
|
|
198
200
|
}));
|
|
199
201
|
this.archive.appendMessages(sessionId, newMessages, {
|
|
200
|
-
messagePartsEnabled
|
|
202
|
+
messagePartsEnabled
|
|
201
203
|
});
|
|
202
204
|
try {
|
|
203
205
|
await this.summarizer.summarizeIncremental(sessionId);
|
|
@@ -281,7 +283,8 @@ var LcmEngine = class {
|
|
|
281
283
|
});
|
|
282
284
|
}
|
|
283
285
|
async searchStructuredParts(sessionId, query, limit = this.config.messagePartsRecallMaxResults) {
|
|
284
|
-
|
|
286
|
+
const { messagePartsEnabled } = this.config;
|
|
287
|
+
if (!this.config.enabled || !messagePartsEnabled) return [];
|
|
285
288
|
const normalizedSessionId = normalizeLcmSessionId(sessionId);
|
|
286
289
|
if (!normalizedSessionId) return [];
|
|
287
290
|
await this.ensureInitialized();
|
|
@@ -513,4 +516,4 @@ export {
|
|
|
513
516
|
extractLcmConfig,
|
|
514
517
|
LcmEngine
|
|
515
518
|
};
|
|
516
|
-
//# sourceMappingURL=chunk-
|
|
519
|
+
//# sourceMappingURL=chunk-V5RVMULT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lcm/engine.ts"],"sourcesContent":["import type Database from \"better-sqlite3\";\nimport { openLcmDatabase, ensureLcmStateDir } from \"./schema.js\";\nimport { LcmArchive, type LcmStructuredRecallMatch } from \"./archive.js\";\nimport { LcmDag } from \"./dag.js\";\nimport { LcmSummarizer, type SummarizeFn } from \"./summarizer.js\";\nimport { assembleCompressedHistory, type LcmRecallConfig } from \"./recall.js\";\nimport { LcmWorkQueue, type LcmObserveMessage } from \"./queue.js\";\nimport type { PluginConfig } from \"../types.js\";\nimport { log } from \"../logger.js\";\n\nexport interface LcmEngineConfig {\n enabled: boolean;\n leafBatchSize: number;\n rollupFanIn: number;\n freshTailTurns: number;\n maxDepth: number;\n deterministicMaxTokens: number;\n archiveRetentionDays: number;\n recallBudgetShare: number;\n observeConcurrency: number;\n telemetryPrefilterEnabled: boolean;\n messagePartsEnabled: boolean;\n messagePartsRecallMaxResults: number;\n}\n\nfunction positiveInteger(value: unknown, fallback: number, min = 1): number {\n if (typeof value !== \"number\" || !Number.isFinite(value)) return fallback;\n return Math.max(min, Math.floor(value));\n}\n\nexport function extractLcmConfig(cfg: PluginConfig): LcmEngineConfig {\n return {\n enabled: (cfg as any).lcmEnabled === true,\n leafBatchSize: positiveInteger((cfg as any).lcmLeafBatchSize, 8),\n rollupFanIn: positiveInteger((cfg as any).lcmRollupFanIn, 4, 2),\n freshTailTurns: positiveInteger((cfg as any).lcmFreshTailTurns, 16),\n maxDepth: positiveInteger((cfg as any).lcmMaxDepth, 5),\n deterministicMaxTokens: positiveInteger((cfg as any).lcmDeterministicMaxTokens, 512),\n archiveRetentionDays: positiveInteger((cfg as any).lcmArchiveRetentionDays, 90, 0),\n recallBudgetShare: (cfg as any).lcmRecallBudgetShare ?? 0.15,\n observeConcurrency:\n typeof (cfg as any).lcmObserveConcurrency === \"number\" &&\n Number.isFinite((cfg as any).lcmObserveConcurrency)\n ? Math.max(1, Math.floor((cfg as any).lcmObserveConcurrency))\n : 1,\n telemetryPrefilterEnabled: (cfg as any).lcmTelemetryPrefilterEnabled !== false,\n messagePartsEnabled: (cfg as any).messagePartsEnabled === true,\n messagePartsRecallMaxResults:\n typeof (cfg as any).messagePartsRecallMaxResults === \"number\"\n ? Math.max(0, Math.floor((cfg as any).messagePartsRecallMaxResults))\n : 6,\n };\n}\n\nfunction normalizeLcmSessionId(sessionId: string): string {\n return sessionId.trim();\n}\n\nfunction normalizeOptionalLcmSessionId(sessionId?: string): string | undefined {\n if (sessionId === undefined) {\n return undefined;\n }\n const normalized = normalizeLcmSessionId(sessionId);\n return normalized.length > 0 ? normalized : undefined;\n}\n\nconst EMPTY_LCM_STATS = {\n totalMessages: 0,\n totalSummaryNodes: 0,\n maxDepth: -1,\n} as const;\n\nexport class LcmEngine {\n private db: Database.Database | null = null;\n private archive: LcmArchive | null = null;\n private dag: LcmDag | null = null;\n private summarizer: LcmSummarizer | null = null;\n private observeQueue: LcmWorkQueue | null = null;\n private closed = false;\n private readonly config: LcmEngineConfig;\n private readonly memoryDir: string;\n private initPromise: Promise<void> | null = null;\n private readonly pendingObserveInitCounts = new Map<string, number>();\n private readonly pendingObserveInitWaiters = new Map<string, Array<() => void>>();\n private readonly pendingObserveInitIdleWaiters: Array<() => void> = [];\n\n constructor(\n pluginConfig: PluginConfig,\n private readonly summarizeFn: SummarizeFn,\n ) {\n this.config = extractLcmConfig(pluginConfig);\n this.memoryDir = pluginConfig.memoryDir;\n }\n\n get enabled(): boolean {\n return this.config.enabled;\n }\n\n /** Lazy init — open database on first use. */\n async ensureInitialized(): Promise<void> {\n if (this.closed) return;\n if (this.db) return;\n if (this.initPromise) {\n await this.initPromise;\n return;\n }\n this.initPromise = this.doInit().catch((err) => {\n // Reset so next call retries instead of caching the failure\n this.initPromise = null;\n throw err;\n });\n await this.initPromise;\n }\n\n private async doInit(): Promise<void> {\n await ensureLcmStateDir(this.memoryDir);\n const db = openLcmDatabase(this.memoryDir);\n const archive = new LcmArchive(db);\n const dag = new LcmDag(db);\n const { telemetryPrefilterEnabled } = this.config;\n const summarizer = new LcmSummarizer(\n archive,\n dag,\n this.summarizeFn,\n {\n leafBatchSize: this.config.leafBatchSize,\n rollupFanIn: this.config.rollupFanIn,\n maxDepth: this.config.maxDepth,\n deterministicMaxTokens: this.config.deterministicMaxTokens,\n telemetryPrefilterEnabled,\n },\n );\n const observeQueue = new LcmWorkQueue({\n concurrency: this.config.observeConcurrency,\n worker: async (sessionId, messages) => {\n await this.processObserveMessages(sessionId, messages);\n },\n hooks: {\n onJobStart: ({ sessionId, depth, inFlight, waitMs }) => {\n log.debug(\n `LCM observe queue start: session=${sessionId}, depth=${depth}, inFlight=${inFlight}, wait=${waitMs}ms`,\n );\n },\n onJobFinish: ({\n sessionId,\n depth,\n inFlight,\n waitMs,\n runMs,\n totalMs,\n error,\n }) => {\n if (error) {\n log.error(\n `LCM observe queue failure: session=${sessionId}, depth=${depth}, inFlight=${inFlight}, wait=${waitMs}ms, run=${runMs}ms, total=${totalMs}ms, error=${error}`,\n );\n return;\n }\n\n log.debug(\n `LCM observe queue finish: session=${sessionId}, depth=${depth}, inFlight=${inFlight}, wait=${waitMs}ms, run=${runMs}ms, total=${totalMs}ms`,\n );\n },\n },\n });\n\n if (this.closed) {\n db.close();\n return;\n }\n\n this.db = db;\n this.archive = archive;\n this.dag = dag;\n this.summarizer = summarizer;\n this.observeQueue = observeQueue;\n log.info(\"LCM engine initialized\");\n }\n\n /**\n * Enqueue messages from agent_end hook.\n * The queue worker performs the archive append and incremental summarization.\n */\n async observeMessages(\n sessionId: string,\n messages: LcmObserveMessage[],\n ): Promise<void> {\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n this.enqueueObserveMessages(normalizedSessionId, messages);\n }\n\n /** Enqueue an observe job without waiting for worker completion. */\n enqueueObserveMessages(\n sessionId: string,\n messages: LcmObserveMessage[],\n ): void {\n if (!this.config.enabled || this.closed) return;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n if (messages.length === 0) return;\n\n this.reservePendingObserveInit(normalizedSessionId);\n\n void this.ensureInitialized()\n .then(() => {\n if (this.closed || !this.observeQueue) return;\n this.observeQueue.enqueue(normalizedSessionId, messages);\n log.debug(\n `LCM observe enqueued: session=${normalizedSessionId}, depth=${this.observeQueue.depth}, inFlight=${this.observeQueue.inFlightCount}`,\n );\n })\n .catch((err) => {\n if (this.closed) return;\n log.error(`LCM observe enqueue initialization error: ${err}`);\n })\n .finally(() => {\n this.releasePendingObserveInit(normalizedSessionId);\n });\n }\n\n private async processObserveMessages(\n sessionId: string,\n messages: LcmObserveMessage[],\n ): Promise<void> {\n if (this.closed) return;\n await this.ensureInitialized();\n if (this.closed || !this.archive || !this.summarizer) return;\n\n if (messages.length === 0) return;\n\n const currentMax = this.archive.getMaxTurnIndex(sessionId);\n const { messagePartsEnabled } = this.config;\n const newMessages = messages.map((m, i) => ({\n turnIndex: currentMax + 1 + i,\n role: m.role,\n content: m.content,\n parts: messagePartsEnabled ? m.parts : undefined,\n rawContent: messagePartsEnabled ? m.rawContent : undefined,\n sourceFormat: messagePartsEnabled ? m.sourceFormat : undefined,\n }));\n\n this.archive.appendMessages(sessionId, newMessages, {\n messagePartsEnabled,\n });\n\n // Trigger incremental summarization inside the worker, after append.\n try {\n await this.summarizer.summarizeIncremental(sessionId);\n } catch (err) {\n log.debug(`LCM incremental summarization error: ${err}`);\n }\n }\n\n get observeQueueDepth(): number {\n return this.observeQueue?.depth ?? 0;\n }\n\n get observeQueueInFlightCount(): number {\n return this.observeQueue?.inFlightCount ?? 0;\n }\n\n async waitForObserveQueueIdle(): Promise<void> {\n if (!this.config.enabled || this.closed) return;\n await this.ensureInitialized();\n if (this.closed) return;\n await this.waitForPendingObserveInitIdle();\n await this.observeQueue?.whenIdle();\n }\n\n async waitForSessionObserveIdle(sessionId: string): Promise<void> {\n if (!this.config.enabled || this.closed) return;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n await this.ensureInitialized();\n if (this.closed) return;\n await this.waitForPendingObserveInitIdle(normalizedSessionId);\n await this.observeQueue?.whenSessionIdle(normalizedSessionId);\n }\n\n private reservePendingObserveInit(sessionId: string): void {\n const count = this.pendingObserveInitCounts.get(sessionId) ?? 0;\n this.pendingObserveInitCounts.set(sessionId, count + 1);\n }\n\n private releasePendingObserveInit(sessionId: string): void {\n const count = this.pendingObserveInitCounts.get(sessionId);\n if (!count) return;\n\n if (count === 1) {\n this.pendingObserveInitCounts.delete(sessionId);\n const waiters = this.pendingObserveInitWaiters.get(sessionId) ?? [];\n this.pendingObserveInitWaiters.delete(sessionId);\n for (const resolve of waiters) resolve();\n if (this.pendingObserveInitCounts.size === 0) {\n const idleWaiters = this.pendingObserveInitIdleWaiters.splice(\n 0,\n this.pendingObserveInitIdleWaiters.length,\n );\n for (const resolve of idleWaiters) resolve();\n }\n return;\n }\n\n this.pendingObserveInitCounts.set(sessionId, count - 1);\n }\n\n private async waitForPendingObserveInitIdle(sessionId?: string): Promise<void> {\n if (sessionId) {\n if (!this.pendingObserveInitCounts.has(sessionId)) return;\n await new Promise<void>((resolve) => {\n const waiters = this.pendingObserveInitWaiters.get(sessionId) ?? [];\n waiters.push(resolve);\n this.pendingObserveInitWaiters.set(sessionId, waiters);\n });\n return;\n }\n\n if (this.pendingObserveInitCounts.size === 0) return;\n await new Promise<void>((resolve) => {\n this.pendingObserveInitIdleWaiters.push(resolve);\n });\n }\n\n /** Build the compressed history recall section for a session. */\n async assembleRecall(\n sessionId: string,\n budgetChars: number,\n ): Promise<string> {\n if (!this.config.enabled) return \"\";\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return \"\";\n await this.ensureInitialized();\n\n const effectiveBudget = Math.ceil(\n budgetChars * this.config.recallBudgetShare,\n );\n if (effectiveBudget <= 0) return \"\";\n\n return assembleCompressedHistory(this.dag!, this.archive!, normalizedSessionId, {\n freshTailTurns: this.config.freshTailTurns,\n budgetChars: effectiveBudget,\n });\n }\n\n async searchStructuredParts(\n sessionId: string,\n query: string,\n limit = this.config.messagePartsRecallMaxResults,\n ): Promise<LcmStructuredRecallMatch[]> {\n const { messagePartsEnabled } = this.config;\n if (!this.config.enabled || !messagePartsEnabled) return [];\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return [];\n await this.ensureInitialized();\n if (!this.archive) return [];\n return this.archive.searchStructuredParts(query, limit, normalizedSessionId);\n }\n\n formatStructuredRecall(\n matches: LcmStructuredRecallMatch[],\n budgetChars: number,\n ): string {\n if (matches.length === 0 || budgetChars <= 0) return \"\";\n const lines: string[] = [];\n let used = \"## Structured Session Matches\\n\\n\".length;\n for (const match of matches) {\n const label = match.file_path\n ? `${match.kind} ${match.file_path}`\n : match.tool_name\n ? `${match.kind} ${match.tool_name}`\n : match.kind;\n const excerpt = match.content.replace(/\\s+/g, \" \").slice(0, 220);\n const line = `- turn ${match.turn_index} (${match.role}): ${label} — ${excerpt}`;\n if (used + line.length + 1 > budgetChars) break;\n lines.push(line);\n used += line.length + 1;\n }\n return lines.length > 0 ? `## Structured Session Matches\\n\\n${lines.join(\"\\n\")}` : \"\";\n }\n\n /** Flush pending summaries before compaction (called from before_compaction hook). */\n async preCompactionFlush(sessionId: string): Promise<void> {\n if (!this.config.enabled) return;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n await this.ensureInitialized();\n await this.waitForSessionObserveIdle(normalizedSessionId);\n\n try {\n await this.summarizer!.summarizeIncremental(normalizedSessionId);\n } catch (err) {\n log.debug(`LCM pre-compaction flush error: ${err}`);\n }\n }\n\n /** Record a compaction event with real token counts (called from after_compaction hook). */\n async recordCompaction(\n sessionId: string,\n tokensBefore: number,\n tokensAfter: number,\n ): Promise<void> {\n if (!this.config.enabled) return;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n await this.ensureInitialized();\n await this.waitForSessionObserveIdle(normalizedSessionId);\n\n const maxTurn = this.archive!.getMaxTurnIndex(normalizedSessionId);\n\n this.dag!.recordCompaction(normalizedSessionId, maxTurn, tokensBefore, tokensAfter);\n log.info(\n `LCM compaction recorded: session=${normalizedSessionId}, turn=${maxTurn}, tokens ${tokensBefore}→${tokensAfter}`,\n );\n }\n\n /** Verify archive coverage after compaction. */\n async verifyPostCompaction(sessionId: string): Promise<void> {\n if (!this.config.enabled) return;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n await this.ensureInitialized();\n\n const msgCount = this.archive!.getMessageCount(normalizedSessionId);\n const nodeCount = this.dag!.getNodeCount(normalizedSessionId);\n log.debug(\n `LCM post-compaction verify: session=${normalizedSessionId}, messages=${msgCount}, summaryNodes=${nodeCount}`,\n );\n }\n\n // ── MCP Tool implementations ──\n\n /** Search across all conversation history via FTS (snippet mode). */\n async searchContext(\n query: string,\n limit: number,\n sessionId?: string,\n sessionPrefix?: string,\n ): Promise<\n Array<{\n turn_index: number;\n role: string;\n snippet: string;\n session_id: string;\n }>\n > {\n if (!this.config.enabled) return [];\n const normalizedSessionId = normalizeOptionalLcmSessionId(sessionId);\n if (sessionId !== undefined && !normalizedSessionId) return [];\n const normalizedSessionPrefix = normalizeOptionalLcmSessionId(sessionPrefix);\n if (sessionPrefix !== undefined && !normalizedSessionPrefix) return [];\n await this.ensureInitialized();\n return this.archive!.search(query, limit, normalizedSessionId, normalizedSessionPrefix);\n }\n\n /** Search via FTS returning full message content (not snippets). */\n async searchContextFull(\n query: string,\n limit: number,\n sessionId?: string,\n sessionPrefix?: string,\n ): Promise<\n Array<{\n id: number;\n turn_index: number;\n role: string;\n content: string;\n session_id: string;\n score: number;\n }>\n > {\n if (!this.config.enabled) return [];\n const normalizedSessionId = normalizeOptionalLcmSessionId(sessionId);\n if (sessionId !== undefined && !normalizedSessionId) return [];\n const normalizedSessionPrefix = normalizeOptionalLcmSessionId(sessionPrefix);\n if (sessionPrefix !== undefined && !normalizedSessionPrefix) return [];\n await this.ensureInitialized();\n return this.archive!.searchWithContent(\n query,\n limit,\n normalizedSessionId,\n 1000,\n normalizedSessionPrefix,\n );\n }\n\n /** Get a compressed summary of a turn range. */\n async describeContext(\n sessionId: string,\n fromTurn: number,\n toTurn: number,\n ): Promise<{ summary: string; turn_count: number; depth: number } | null> {\n if (!this.config.enabled) return null;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return null;\n await this.ensureInitialized();\n\n const nodes = this.dag!.getCoveringNodes(normalizedSessionId, fromTurn, toTurn);\n if (nodes.length === 0) {\n // No summary exists — build a description from raw messages\n const messages = this.archive!.getMessages(normalizedSessionId, fromTurn, toTurn);\n if (messages.length === 0) return null;\n const preview = messages\n .slice(0, 5)\n .map((m) => `[${m.role}] ${m.content.slice(0, 100)}`)\n .join(\"\\n\");\n return {\n summary: `No summary available for this range. Preview of ${messages.length} messages:\\n${preview}`,\n turn_count: messages.length,\n depth: -1,\n };\n }\n\n // Use the deepest covering node\n const best = nodes[0]; // Already sorted by depth DESC\n return {\n summary: best.summary_text,\n turn_count: best.msg_end - best.msg_start + 1,\n depth: best.depth,\n };\n }\n\n /** Retrieve raw messages for a turn range (lossless expansion). */\n async expandContext(\n sessionId: string,\n fromTurn: number,\n toTurn: number,\n maxTokens: number,\n ): Promise<Array<{ turn_index: number; role: string; content: string }>> {\n if (!this.config.enabled) return [];\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return [];\n await this.ensureInitialized();\n\n const messages = this.archive!.getMessages(normalizedSessionId, fromTurn, toTurn);\n if (messages.length === 0) return [];\n\n // Enforce token budget — keep first and last, truncate middle\n const maxChars = maxTokens * 4;\n let totalChars = 0;\n for (const m of messages) totalChars += m.content.length;\n\n if (totalChars <= maxChars) {\n return messages.map((m) => ({\n turn_index: m.turn_index,\n role: m.role,\n content: m.content,\n }));\n }\n\n // Keep first and last messages, truncate from middle\n const result: Array<{ turn_index: number; role: string; content: string }> =\n [];\n let budget = maxChars;\n\n // Reserve space for the last message\n const lastMsg = messages[messages.length - 1];\n const lastMsgChars = Math.min(\n lastMsg.content.length,\n Math.floor(maxChars * 0.3),\n );\n budget -= lastMsgChars;\n\n // Add messages from the beginning\n for (let i = 0; i < messages.length - 1; i++) {\n if (budget <= 0) break;\n const m = messages[i];\n const truncated = m.content.slice(0, budget);\n result.push({\n turn_index: m.turn_index,\n role: m.role,\n content: truncated,\n });\n budget -= truncated.length;\n }\n\n // Always append the last message\n result.push({\n turn_index: lastMsg.turn_index,\n role: lastMsg.role,\n content: lastMsg.content.slice(0, lastMsgChars + Math.max(0, budget)),\n });\n\n return result;\n }\n\n /** Get statistics about the LCM archive. */\n async getStats(sessionId?: string): Promise<{\n totalMessages: number;\n totalSummaryNodes: number;\n maxDepth: number;\n maxTurnIndex?: number;\n }> {\n if (!this.config.enabled)\n return { totalMessages: 0, totalSummaryNodes: 0, maxDepth: -1 };\n const normalizedSessionId = normalizeOptionalLcmSessionId(sessionId);\n if (sessionId !== undefined && !normalizedSessionId) {\n return { ...EMPTY_LCM_STATS };\n }\n await this.ensureInitialized();\n\n if (normalizedSessionId) {\n return {\n totalMessages: this.archive!.getMessageCount(normalizedSessionId),\n totalSummaryNodes: this.dag!.getNodeCount(normalizedSessionId),\n maxDepth: this.dag!.getMaxDepth(normalizedSessionId),\n maxTurnIndex: this.archive!.getMaxTurnIndex(normalizedSessionId),\n };\n }\n\n return {\n totalMessages: this.archive!.getTotalMessageCount(),\n totalSummaryNodes: 0, // Would need a global count query\n maxDepth: -1,\n };\n }\n\n /** Clear all LCM archive and summary state for one session. */\n async clearSession(sessionId: string): Promise<void> {\n if (!this.config.enabled || this.closed) return;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n await this.ensureInitialized();\n if (this.closed || !this.archive || !this.dag) return;\n await this.waitForSessionObserveIdle(normalizedSessionId);\n this.dag.deleteSession(normalizedSessionId);\n this.archive.deleteSession(normalizedSessionId);\n }\n\n /** Clear all LCM archive and summary state without closing the engine. */\n async clearAll(): Promise<void> {\n if (!this.config.enabled || this.closed) return;\n await this.ensureInitialized();\n if (this.closed || !this.archive || !this.dag) return;\n await this.waitForObserveQueueIdle();\n this.dag.deleteAll();\n this.archive.deleteAll();\n }\n\n /** Prune old data beyond retention period. */\n async prune(): Promise<{ messagesPruned: number; nodesPruned: number }> {\n if (!this.config.enabled) return { messagesPruned: 0, nodesPruned: 0 };\n await this.ensureInitialized();\n\n const messagesPruned = this.archive!.pruneOldMessages(\n this.config.archiveRetentionDays,\n );\n const nodesPruned = this.dag!.pruneOldNodes(\n this.config.archiveRetentionDays,\n );\n return { messagesPruned, nodesPruned };\n }\n\n /** Close the database connection. */\n close(): void {\n this.closed = true;\n if (this.db) {\n this.db.close();\n }\n this.db = null;\n this.archive = null;\n this.dag = null;\n this.summarizer = null;\n this.observeQueue = null;\n this.initPromise = null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAS,gBAAgB,OAAgB,UAAkB,MAAM,GAAW;AAC1E,MAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,EAAG,QAAO;AACjE,SAAO,KAAK,IAAI,KAAK,KAAK,MAAM,KAAK,CAAC;AACxC;AAEO,SAAS,iBAAiB,KAAoC;AACnE,SAAO;AAAA,IACL,SAAU,IAAY,eAAe;AAAA,IACrC,eAAe,gBAAiB,IAAY,kBAAkB,CAAC;AAAA,IAC/D,aAAa,gBAAiB,IAAY,gBAAgB,GAAG,CAAC;AAAA,IAC9D,gBAAgB,gBAAiB,IAAY,mBAAmB,EAAE;AAAA,IAClE,UAAU,gBAAiB,IAAY,aAAa,CAAC;AAAA,IACrD,wBAAwB,gBAAiB,IAAY,2BAA2B,GAAG;AAAA,IACnF,sBAAsB,gBAAiB,IAAY,yBAAyB,IAAI,CAAC;AAAA,IACjF,mBAAoB,IAAY,wBAAwB;AAAA,IACxD,oBACE,OAAQ,IAAY,0BAA0B,YAC5C,OAAO,SAAU,IAAY,qBAAqB,IAChD,KAAK,IAAI,GAAG,KAAK,MAAO,IAAY,qBAAqB,CAAC,IAC1D;AAAA,IACN,2BAA4B,IAAY,iCAAiC;AAAA,IACzE,qBAAsB,IAAY,wBAAwB;AAAA,IAC1D,8BACE,OAAQ,IAAY,iCAAiC,WACjD,KAAK,IAAI,GAAG,KAAK,MAAO,IAAY,4BAA4B,CAAC,IACjE;AAAA,EACR;AACF;AAEA,SAAS,sBAAsB,WAA2B;AACxD,SAAO,UAAU,K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QAAS;AAAA,MACnC,KAAK,OAAO;AAAA,IACd;AACA,UAAM,cAAc,KAAK,IAAK;AAAA,MAC5B,KAAK,OAAO;AAAA,IACd;AACA,WAAO,EAAE,gBAAgB,YAAY;AAAA,EACvC;AAAA;AAAA,EAGA,QAAc;AACZ,SAAK,SAAS;AACd,QAAI,KAAK,IAAI;AACX,WAAK,GAAG,MAAM;AAAA,IAChB;AACA,SAAK,KAAK;AACV,SAAK,UAAU;AACf,SAAK,MAAM;AACX,SAAK,aAAa;AAClB,SAAK,eAAe;AACpB,SAAK,cAAc;AAAA,EACrB;AACF;","names":[]}
|
|
@@ -106,7 +106,8 @@ var LcmSummarizer = class {
|
|
|
106
106
|
* 2 = Deterministic truncation (no LLM)
|
|
107
107
|
*/
|
|
108
108
|
async summarizeWithEscalation(text, targetTokens) {
|
|
109
|
-
|
|
109
|
+
const { telemetryPrefilterEnabled } = this.config;
|
|
110
|
+
if (telemetryPrefilterEnabled && looksLikeMechanicalTelemetryTranscript(text)) {
|
|
110
111
|
return {
|
|
111
112
|
text: deterministicTruncate(
|
|
112
113
|
text,
|
|
@@ -171,4 +172,4 @@ function chunkArray(arr, size) {
|
|
|
171
172
|
export {
|
|
172
173
|
LcmSummarizer
|
|
173
174
|
};
|
|
174
|
-
//# sourceMappingURL=chunk-
|
|
175
|
+
//# sourceMappingURL=chunk-W4H5A3TJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lcm/summarizer.ts"],"sourcesContent":["import { log } from \"../logger.js\";\nimport type { LcmArchive, LcmMessage } from \"./archive.js\";\nimport { LcmDag } from \"./dag.js\";\nimport { estimateTokens } from \"./archive.js\";\nimport { looksLikeMechanicalTelemetryTranscript } from \"../telemetry-transcript.js\";\n\n/** Generate a ULID-like ID (timestamp + random). */\nfunction generateNodeId(): string {\n const ts = Date.now().toString(36).padStart(9, \"0\");\n const rand = Math.random().toString(36).slice(2, 10);\n return `lcm-${ts}-${rand}`;\n}\n\nexport type SummarizeFn = (\n text: string,\n targetTokens: number,\n aggressive: boolean,\n) => Promise<string | null>;\n\nexport interface LcmSummarizerConfig {\n leafBatchSize: number;\n rollupFanIn: number;\n maxDepth: number;\n deterministicMaxTokens: number;\n telemetryPrefilterEnabled: boolean;\n}\n\nexport class LcmSummarizer {\n constructor(\n private readonly archive: LcmArchive,\n private readonly dag: LcmDag,\n private readonly summarizeFn: SummarizeFn,\n private readonly config: LcmSummarizerConfig,\n ) {}\n\n /**\n * Run incremental summarization for a session.\n * Creates leaf nodes from unsummarized messages, then rolls up as needed.\n */\n async summarizeIncremental(sessionId: string): Promise<number> {\n let nodesCreated = 0;\n\n // Phase 1: Create leaf nodes from unsummarized messages\n const unsummarized = this.archive.getUnsummarizedMessages(sessionId);\n if (unsummarized.length >= this.config.leafBatchSize) {\n const batches = chunkArray(unsummarized, this.config.leafBatchSize);\n // Only process complete batches (leave partial for next time)\n const completeBatches = unsummarized.length % this.config.leafBatchSize === 0\n ? batches\n : batches.slice(0, -1);\n\n for (const batch of completeBatches) {\n const created = await this.createLeafNode(sessionId, batch);\n if (created) nodesCreated++;\n }\n }\n\n // Phase 2: Roll up at each depth level\n if (nodesCreated > 0) {\n nodesCreated += await this.rollupAll(sessionId);\n }\n\n return nodesCreated;\n }\n\n /** Create a leaf summary node (depth 0) from a batch of messages. */\n private async createLeafNode(\n sessionId: string,\n messages: LcmMessage[],\n ): Promise<boolean> {\n if (messages.length === 0) return false;\n\n const combinedText = messages\n .map((m) => `[${m.role}] ${m.content}`)\n .join(\"\\n\\n\");\n\n const inputTokens = estimateTokens(combinedText);\n const targetTokens = Math.max(64, Math.ceil(inputTokens * 0.25));\n\n const summary = await this.summarizeWithEscalation(combinedText, targetTokens);\n\n this.dag.insertNode({\n id: generateNodeId(),\n session_id: sessionId,\n depth: 0,\n parent_id: null,\n summary_text: summary.text,\n token_count: estimateTokens(summary.text),\n msg_start: messages[0].turn_index,\n msg_end: messages[messages.length - 1].turn_index,\n escalation: summary.escalation,\n });\n\n return true;\n }\n\n /** Roll up orphan nodes at each depth level up to maxDepth. */\n private async rollupAll(sessionId: string): Promise<number> {\n let totalCreated = 0;\n\n for (let depth = 0; depth < this.config.maxDepth; depth++) {\n const orphans = this.dag.getOrphanNodesAtDepth(sessionId, depth);\n if (orphans.length < this.config.rollupFanIn) continue;\n\n const batches = chunkArray(orphans, this.config.rollupFanIn);\n // Only process complete batches\n const completeBatches = orphans.length % this.config.rollupFanIn === 0\n ? batches\n : batches.slice(0, -1);\n\n for (const batch of completeBatches) {\n const combinedText = batch\n .map((n) => n.summary_text)\n .join(\"\\n\\n\");\n\n const inputTokens = estimateTokens(combinedText);\n const targetTokens = Math.max(64, Math.ceil(inputTokens * 0.25));\n\n const summary = await this.summarizeWithEscalation(combinedText, targetTokens);\n\n const parentId = generateNodeId();\n this.dag.insertNode({\n id: parentId,\n session_id: sessionId,\n depth: depth + 1,\n parent_id: null,\n summary_text: summary.text,\n token_count: estimateTokens(summary.text),\n msg_start: batch[0].msg_start,\n msg_end: batch[batch.length - 1].msg_end,\n escalation: summary.escalation,\n });\n\n this.dag.setParent(\n batch.map((n) => n.id),\n parentId,\n );\n\n totalCreated++;\n }\n }\n\n return totalCreated;\n }\n\n /**\n * Three-level escalation:\n * 0 = Normal LLM summary\n * 1 = Aggressive bullet compression\n * 2 = Deterministic truncation (no LLM)\n */\n private async summarizeWithEscalation(\n text: string,\n targetTokens: number,\n ): Promise<{ text: string; escalation: number }> {\n const { telemetryPrefilterEnabled } = this.config;\n if (\n telemetryPrefilterEnabled &&\n looksLikeMechanicalTelemetryTranscript(text)\n ) {\n return {\n text: deterministicTruncate(\n text,\n Math.min(targetTokens, this.config.deterministicMaxTokens),\n ),\n escalation: 2,\n };\n }\n\n // Level 0: Normal LLM summary\n try {\n const result = await this.summarizeFn(text, targetTokens, false);\n if (result && estimateTokens(result) <= targetTokens * 1.5) {\n return { text: result, escalation: 0 };\n }\n // If too long, try aggressive\n } catch (err) {\n log.debug(`LCM level-0 summary failed: ${err}`);\n }\n\n // Level 1: Aggressive bullet compression\n try {\n const aggressiveTarget = Math.max(32, Math.ceil(targetTokens * 0.5));\n const result = await this.summarizeFn(text, aggressiveTarget, true);\n if (result && estimateTokens(result) <= targetTokens * 1.5) {\n return { text: result, escalation: 1 };\n }\n } catch (err) {\n log.debug(`LCM level-1 summary failed: ${err}`);\n }\n\n // Level 2: Deterministic truncation (guaranteed, no LLM)\n return {\n text: deterministicTruncate(text, this.config.deterministicMaxTokens),\n escalation: 2,\n };\n }\n}\n\n/** Deterministic truncation: first and last sentence, plus middle truncation. */\nfunction deterministicTruncate(text: string, maxTokens: number): string {\n const maxChars = maxTokens * 4;\n if (text.length <= maxChars) return text;\n\n const sentences = text.split(/(?<=[.!?])\\s+/).filter((s) => s.length > 0);\n if (sentences.length <= 2) {\n return text.slice(0, maxChars);\n }\n\n const first = sentences[0];\n const last = sentences[sentences.length - 1];\n const budget = maxChars - first.length - last.length - 20;\n\n if (budget <= 0) {\n return text.slice(0, maxChars);\n }\n\n // Fill from the beginning until budget runs out\n const middle: string[] = [];\n let used = 0;\n for (let i = 1; i < sentences.length - 1; i++) {\n if (used + sentences[i].length > budget) break;\n middle.push(sentences[i]);\n used += sentences[i].length;\n }\n\n return `${first} ${middle.join(\" \")}${middle.length < sentences.length - 2 ? \" [...] \" : \" \"}${last}`;\n}\n\nfunction chunkArray<T>(arr: T[], size: number): T[][] {\n const chunks: T[][] = [];\n for (let i = 0; i < arr.length; i += size) {\n chunks.push(arr.slice(i, i + size));\n }\n return chunks;\n}\n"],"mappings":";;;;;;;;;;;AAOA,SAAS,iBAAyB;AAChC,QAAM,KAAK,KAAK,IAAI,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG;AAClD,QAAM,OAAO,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,GAAG,EAAE;AACnD,SAAO,OAAO,EAAE,IAAI,IAAI;AAC1B;AAgBO,IAAM,gBAAN,MAAoB;AAAA,EACzB,YACmB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,MAAM,GAAG,QAAQ;AAAA,EAC/B;AAGA,QAAM,SAAmB,CAAC;AAC1B,MAAI,OAAO;AACX,WAAS,IAAI,GAAG,IAAI,UAAU,SAAS,GAAG,KAAK;AAC7C,QAAI,OAAO,UAAU,CAAC,EAAE,SAAS,OAAQ;AACzC,WAAO,KAAK,UAAU,CAAC,CAAC;AACxB,YAAQ,UAAU,CAAC,EAAE;AAAA,EACvB;AAEA,SAAO,GAAG,KAAK,IAAI,OAAO,KAAK,GAAG,CAAC,GAAG,OAAO,SAAS,UAAU,SAAS,IAAI,YAAY,GAAG,GAAG,IAAI;AACrG;AAEA,SAAS,WAAc,KAAU,MAAqB;AACpD,QAAM,SAAgB,CAAC;AACvB,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK,MAAM;AACzC,WAAO,KAAK,IAAI,MAAM,GAAG,IAAI,IAAI,CAAC;AAAA,EACpC;AACA,SAAO;AACT;","names":[]}
|
|
@@ -7,7 +7,7 @@ import { RebuildMemoryLifecycleLedgerResult } from './maintenance/rebuild-memory
|
|
|
7
7
|
import { RebuildObservationsResult } from './maintenance/rebuild-observations.js';
|
|
8
8
|
import { ArchiveObservationsResult } from './maintenance/archive-observations.js';
|
|
9
9
|
import { Writable, Readable } from 'node:stream';
|
|
10
|
-
import { O as Orchestrator } from './orchestrator-
|
|
10
|
+
import { O as Orchestrator } from './orchestrator-Dr-1v5EL.js';
|
|
11
11
|
import { ReplayRunSummary } from './replay/runner.js';
|
|
12
12
|
import { ReplaySource, ReplayTurn } from './replay/types.js';
|
|
13
13
|
import { b as BulkImportResult } from './types-gb_SNtjR.js';
|
|
@@ -16,7 +16,7 @@ import { WorkProjectStatus, WorkTaskStatus, WorkTaskPriority } from './work/type
|
|
|
16
16
|
import { RoutePatternType } from './routing/engine.js';
|
|
17
17
|
import { TailscaleSyncOptions } from './network/tailscale.js';
|
|
18
18
|
import { DashboardStatus } from './dashboard-runtime.js';
|
|
19
|
-
import { g as EngramAccessService } from './access-service-
|
|
19
|
+
import { g as EngramAccessService } from './access-service-K8n12dXu.js';
|
|
20
20
|
import { ResolveSecretRefFn } from './resolve-auth-token.js';
|
|
21
21
|
import { CompatRunner, CompatReport } from './compat/types.js';
|
|
22
22
|
import { EvalBaselineDeltaReport, EvalBaselineSnapshot, EvalCiGateReport, EvalBenchmarkPackSummary, EvalHarnessStatus, EvalStoredBaselineCiGateReport } from './evals.js';
|
package/dist/cli.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import './maintenance/rebuild-memory-lifecycle-ledger.js';
|
|
|
7
7
|
import './maintenance/rebuild-observations.js';
|
|
8
8
|
import './maintenance/archive-observations.js';
|
|
9
9
|
import 'node:stream';
|
|
10
|
-
import './orchestrator-
|
|
10
|
+
import './orchestrator-Dr-1v5EL.js';
|
|
11
11
|
import './replay/runner.js';
|
|
12
12
|
import './replay/types.js';
|
|
13
13
|
import './types-gb_SNtjR.js';
|
|
@@ -16,7 +16,7 @@ import './work/types.js';
|
|
|
16
16
|
import './routing/engine.js';
|
|
17
17
|
import './network/tailscale.js';
|
|
18
18
|
import './dashboard-runtime.js';
|
|
19
|
-
import './access-service-
|
|
19
|
+
import './access-service-K8n12dXu.js';
|
|
20
20
|
import './resolve-auth-token.js';
|
|
21
21
|
import './compat/types.js';
|
|
22
22
|
import './evals.js';
|
|
@@ -38,7 +38,7 @@ import './trust-zones.js';
|
|
|
38
38
|
import './session-integrity.js';
|
|
39
39
|
import './recall-state.js';
|
|
40
40
|
import './policy-runtime.js';
|
|
41
|
-
export { A as AccessHttpServeCliCommandOptions, a as ArchiveObservationsCliCommandOptions, B as BulkImportCliCommandOptions, C as CliApi, b as CliCommand, c as CliProgram, d as CompatCliCommandOptions, e as ConnectorsRunCliOutputOptions, f as ConversationIndexHealthCliOrchestrator, D as DashboardStartCliCommandOptions, g as DedupeCandidate, E as ExactDedupePlan, G as GraphHealthCliCommandOptions, M as MemoryActionAuditCliCommandOptions, h as MemoryActionAuditCliNamespaceSummary, i as MemoryActionAuditCliReport, j as MemoryGovernanceCliCommandOptions, k as MemoryGovernanceReportCliCommandOptions, l as MemoryGovernanceRestoreCliCommandOptions, m as MemoryReviewDispositionCliCommandOptions, n as MemoryTimelineCliCommandOptions, o as MigrateCliOrchestrator, q as MigrateCliReport, s as MigrateObservationsCliCommandOptions, P as PolicyDiffCliReport, t as PolicyDiffEntry, u as PolicyRollbackCliReport, v as PolicyStatusCliReport, w as PolicyTuningCliOrchestrator, R as RebuildMemoryLifecycleLedgerCliCommandOptions, x as RebuildMemoryProjectionCliCommandOptions, y as RebuildObservationsCliCommandOptions, z as RepairMemoryProjectionCliCommandOptions, F as ReplayCliCommandOptions, H as ReplayCliOrchestrator, I as RouteCliCommandOptions, S as SessionIntegrityCliCommandOptions, J as SessionRepairCliCommandOptions, T as TailscaleStatusCliCommandOptions, K as TailscaleSyncCliCommandOptions, L as TierMigrationCliOrchestrator, N as TrainingExportCliCommandOptions, V as VerifyMemoryProjectionCliCommandOptions, W as WebDavServeCliCommandOptions, O as WorkProjectCliCommandOptions, Q as WorkTaskCliCommandOptions, U as emitConnectorsRunCliResult, X as filterNormalMemorySearchResults, Y as hasDestructivePurgeFailures, Z as isNormalRetrievalVisibleMemory, _ as listMemoryMarkdownFilePaths, $ as parseDurationToMs, a0 as parseStrictCliDate, a1 as planAggressiveDuplicateDeletions, a2 as planExactDuplicateDeletions, a3 as registerCli, a4 as resolveAccessPrincipalOverride, a5 as resolveMemoryDirForNamespace, a6 as runAbstractionNodeStatusCliCommand, a7 as runAccessHttpServeCliCommand, a8 as runAccessHttpStatusCliCommand, a9 as runAccessHttpStopCliCommand, aa as runAccessMcpServeCliCommand, ab as runArchiveObservationsCliCommand, ac as runBenchmarkBaselineReportCliCommand, ad as runBenchmarkBaselineSnapshotCliCommand, ae as runBenchmarkCiGateCliCommand, af as runBenchmarkImportCliCommand, ag as runBenchmarkStatusCliCommand, ah as runBenchmarkStoredBaselineCiGateCliCommand, ai as runBenchmarkValidateCliCommand, r as runBulkImportCliCommand, aj as runCausalTrajectoryStatusCliCommand, ak as runCommitmentLifecycleCliCommand, al as runCommitmentRecordCliCommand, am as runCommitmentSetStateCliCommand, an as runCommitmentStatusCliCommand, ao as runCompatCliCommand, ap as runCompoundingPromoteCliCommand, aq as runConversationIndexHealthCliCommand, ar as runConversationIndexInspectCliCommand, as as runConversationIndexRebuildCliCommand, at as runCueAnchorStatusCliCommand, au as runDashboardStartCliCommand, av as runDashboardStatusCliCommand, aw as runDashboardStopCliCommand, ax as runGraphHealthCliCommand, ay as runHarmonicSearchCliCommand, az as runMemoryActionAuditCliCommand, aA as runMemoryGovernanceCliCommand, aB as runMemoryGovernanceReportCliCommand, aC as runMemoryGovernanceRestoreCliCommand, aD as runMemoryReviewDispositionCliCommand, aE as runMemoryTimelineCliCommand, aF as runMigrateNormalizeFrontmatterCliCommand, aG as runMigrateObservationsCliCommand, aH as runMigrateRechunkCliCommand, aI as runMigrateReextractCliCommand, aJ as runMigrateRescoreImportanceCliCommand, aK as runObjectiveStateStatusCliCommand, aL as runPolicyDiffCliCommand, aM as runPolicyRollbackCliCommand, aN as runPolicyStatusCliCommand, aO as runRebuildMemoryLifecycleLedgerCliCommand, aP as runRebuildMemoryProjectionCliCommand, aQ as runRebuildObservationsCliCommand, aR as runRepairMemoryProjectionCliCommand, aS as runReplayCliCommand, aT as runResumeBundleBuildCliCommand, aU as runResumeBundleRecordCliCommand, aV as runResumeBundleStatusCliCommand, aW as runRouteCliCommand, aX as runSemanticRulePromoteCliCommand, aY as runSemanticRuleVerifyCliCommand, aZ as runSessionCheckCliCommand, a_ as runSessionRepairCliCommand, a$ as runTailscaleStatusCliCommand, b0 as runTailscaleSyncCliCommand, b1 as runTierMigrateCliCommand, b2 as runTierStatusCliCommand, b3 as runTrainingExportCliCommand, b4 as runTrustZoneDemoSeedCliCommand, b5 as runTrustZonePromoteCliCommand, b6 as runTrustZoneStatusCliCommand, b7 as runUtilityLearningCliCommand, b8 as runUtilityLearningStatusCliCommand, b9 as runUtilityTelemetryRecordCliCommand, ba as runUtilityTelemetryStatusCliCommand, bb as runVerifiedRecallSearchCliCommand, bc as runVerifyMemoryProjectionCliCommand, bd as runWebDavServeCliCommand, be as runWebDavStopCliCommand, bf as runWorkProductRecallSearchCliCommand, bg as runWorkProductRecordCliCommand, bh as runWorkProductStatusCliCommand, bi as runWorkProjectCliCommand, bj as runWorkTaskCliCommand } from './cli-
|
|
41
|
+
export { A as AccessHttpServeCliCommandOptions, a as ArchiveObservationsCliCommandOptions, B as BulkImportCliCommandOptions, C as CliApi, b as CliCommand, c as CliProgram, d as CompatCliCommandOptions, e as ConnectorsRunCliOutputOptions, f as ConversationIndexHealthCliOrchestrator, D as DashboardStartCliCommandOptions, g as DedupeCandidate, E as ExactDedupePlan, G as GraphHealthCliCommandOptions, M as MemoryActionAuditCliCommandOptions, h as MemoryActionAuditCliNamespaceSummary, i as MemoryActionAuditCliReport, j as MemoryGovernanceCliCommandOptions, k as MemoryGovernanceReportCliCommandOptions, l as MemoryGovernanceRestoreCliCommandOptions, m as MemoryReviewDispositionCliCommandOptions, n as MemoryTimelineCliCommandOptions, o as MigrateCliOrchestrator, q as MigrateCliReport, s as MigrateObservationsCliCommandOptions, P as PolicyDiffCliReport, t as PolicyDiffEntry, u as PolicyRollbackCliReport, v as PolicyStatusCliReport, w as PolicyTuningCliOrchestrator, R as RebuildMemoryLifecycleLedgerCliCommandOptions, x as RebuildMemoryProjectionCliCommandOptions, y as RebuildObservationsCliCommandOptions, z as RepairMemoryProjectionCliCommandOptions, F as ReplayCliCommandOptions, H as ReplayCliOrchestrator, I as RouteCliCommandOptions, S as SessionIntegrityCliCommandOptions, J as SessionRepairCliCommandOptions, T as TailscaleStatusCliCommandOptions, K as TailscaleSyncCliCommandOptions, L as TierMigrationCliOrchestrator, N as TrainingExportCliCommandOptions, V as VerifyMemoryProjectionCliCommandOptions, W as WebDavServeCliCommandOptions, O as WorkProjectCliCommandOptions, Q as WorkTaskCliCommandOptions, U as emitConnectorsRunCliResult, X as filterNormalMemorySearchResults, Y as hasDestructivePurgeFailures, Z as isNormalRetrievalVisibleMemory, _ as listMemoryMarkdownFilePaths, $ as parseDurationToMs, a0 as parseStrictCliDate, a1 as planAggressiveDuplicateDeletions, a2 as planExactDuplicateDeletions, a3 as registerCli, a4 as resolveAccessPrincipalOverride, a5 as resolveMemoryDirForNamespace, a6 as runAbstractionNodeStatusCliCommand, a7 as runAccessHttpServeCliCommand, a8 as runAccessHttpStatusCliCommand, a9 as runAccessHttpStopCliCommand, aa as runAccessMcpServeCliCommand, ab as runArchiveObservationsCliCommand, ac as runBenchmarkBaselineReportCliCommand, ad as runBenchmarkBaselineSnapshotCliCommand, ae as runBenchmarkCiGateCliCommand, af as runBenchmarkImportCliCommand, ag as runBenchmarkStatusCliCommand, ah as runBenchmarkStoredBaselineCiGateCliCommand, ai as runBenchmarkValidateCliCommand, r as runBulkImportCliCommand, aj as runCausalTrajectoryStatusCliCommand, ak as runCommitmentLifecycleCliCommand, al as runCommitmentRecordCliCommand, am as runCommitmentSetStateCliCommand, an as runCommitmentStatusCliCommand, ao as runCompatCliCommand, ap as runCompoundingPromoteCliCommand, aq as runConversationIndexHealthCliCommand, ar as runConversationIndexInspectCliCommand, as as runConversationIndexRebuildCliCommand, at as runCueAnchorStatusCliCommand, au as runDashboardStartCliCommand, av as runDashboardStatusCliCommand, aw as runDashboardStopCliCommand, ax as runGraphHealthCliCommand, ay as runHarmonicSearchCliCommand, az as runMemoryActionAuditCliCommand, aA as runMemoryGovernanceCliCommand, aB as runMemoryGovernanceReportCliCommand, aC as runMemoryGovernanceRestoreCliCommand, aD as runMemoryReviewDispositionCliCommand, aE as runMemoryTimelineCliCommand, aF as runMigrateNormalizeFrontmatterCliCommand, aG as runMigrateObservationsCliCommand, aH as runMigrateRechunkCliCommand, aI as runMigrateReextractCliCommand, aJ as runMigrateRescoreImportanceCliCommand, aK as runObjectiveStateStatusCliCommand, aL as runPolicyDiffCliCommand, aM as runPolicyRollbackCliCommand, aN as runPolicyStatusCliCommand, aO as runRebuildMemoryLifecycleLedgerCliCommand, aP as runRebuildMemoryProjectionCliCommand, aQ as runRebuildObservationsCliCommand, aR as runRepairMemoryProjectionCliCommand, aS as runReplayCliCommand, aT as runResumeBundleBuildCliCommand, aU as runResumeBundleRecordCliCommand, aV as runResumeBundleStatusCliCommand, aW as runRouteCliCommand, aX as runSemanticRulePromoteCliCommand, aY as runSemanticRuleVerifyCliCommand, aZ as runSessionCheckCliCommand, a_ as runSessionRepairCliCommand, a$ as runTailscaleStatusCliCommand, b0 as runTailscaleSyncCliCommand, b1 as runTierMigrateCliCommand, b2 as runTierStatusCliCommand, b3 as runTrainingExportCliCommand, b4 as runTrustZoneDemoSeedCliCommand, b5 as runTrustZonePromoteCliCommand, b6 as runTrustZoneStatusCliCommand, b7 as runUtilityLearningCliCommand, b8 as runUtilityLearningStatusCliCommand, b9 as runUtilityTelemetryRecordCliCommand, ba as runUtilityTelemetryStatusCliCommand, bb as runVerifiedRecallSearchCliCommand, bc as runVerifyMemoryProjectionCliCommand, bd as runWebDavServeCliCommand, be as runWebDavStopCliCommand, bf as runWorkProductRecallSearchCliCommand, bg as runWorkProductRecordCliCommand, bh as runWorkProductStatusCliCommand, bi as runWorkProjectCliCommand, bj as runWorkTaskCliCommand } from './cli-BEOLy1xo.js';
|
|
42
42
|
import './connectors-cli-2iaQ5tX2.js';
|
|
43
43
|
import './storage.js';
|
|
44
44
|
import './page-versioning.js';
|
package/dist/cli.js
CHANGED
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
runWorkProductStatusCliCommand,
|
|
91
91
|
runWorkProjectCliCommand,
|
|
92
92
|
runWorkTaskCliCommand
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-GFJ5ABKS.js";
|
|
94
94
|
import "./chunk-7F7Z6MOS.js";
|
|
95
95
|
import "./chunk-MC4FJXPA.js";
|
|
96
96
|
import "./chunk-LQHDIS7L.js";
|
|
@@ -123,7 +123,7 @@ import "./chunk-OBJUKYDO.js";
|
|
|
123
123
|
import "./chunk-TGQ2NTWH.js";
|
|
124
124
|
import "./chunk-CKFLLAIS.js";
|
|
125
125
|
import "./chunk-3T74IZB3.js";
|
|
126
|
-
import "./chunk-
|
|
126
|
+
import "./chunk-AM7YKD7V.js";
|
|
127
127
|
import "./chunk-UYYSOMS2.js";
|
|
128
128
|
import "./chunk-HL4DB7TO.js";
|
|
129
129
|
import "./chunk-7XH7VJN4.js";
|
|
@@ -169,7 +169,7 @@ import "./chunk-G6NKALRN.js";
|
|
|
169
169
|
import "./chunk-OO42R444.js";
|
|
170
170
|
import "./chunk-K6MV3TRQ.js";
|
|
171
171
|
import "./chunk-OADWQ5CR.js";
|
|
172
|
-
import "./chunk-
|
|
172
|
+
import "./chunk-JMMSVRF4.js";
|
|
173
173
|
import "./chunk-SEDEKFYQ.js";
|
|
174
174
|
import "./chunk-JBPKEARU.js";
|
|
175
175
|
import "./chunk-TMSXWOBZ.js";
|
|
@@ -178,10 +178,10 @@ import "./chunk-RSUYKGGZ.js";
|
|
|
178
178
|
import "./chunk-42NQ7AVG.js";
|
|
179
179
|
import "./chunk-7RXCMVFQ.js";
|
|
180
180
|
import "./chunk-7WV3F5DQ.js";
|
|
181
|
-
import "./chunk-
|
|
181
|
+
import "./chunk-EZZUNKMJ.js";
|
|
182
182
|
import "./chunk-D24OXEPB.js";
|
|
183
|
-
import "./chunk-
|
|
184
|
-
import "./chunk-
|
|
183
|
+
import "./chunk-7ADHJ6SU.js";
|
|
184
|
+
import "./chunk-UEIF7RWQ.js";
|
|
185
185
|
import "./chunk-YF6FMLBT.js";
|
|
186
186
|
import "./chunk-ZQNCHPTZ.js";
|
|
187
187
|
import "./chunk-DJECGBBM.js";
|
|
@@ -189,8 +189,8 @@ import "./chunk-M4WI23X3.js";
|
|
|
189
189
|
import "./chunk-35NN3ZFA.js";
|
|
190
190
|
import "./chunk-T4WDJPEZ.js";
|
|
191
191
|
import "./chunk-FVZ2ISIX.js";
|
|
192
|
-
import "./chunk-
|
|
193
|
-
import "./chunk-
|
|
192
|
+
import "./chunk-QUNH5UZH.js";
|
|
193
|
+
import "./chunk-NHJYUIII.js";
|
|
194
194
|
import "./chunk-GDASG7NC.js";
|
|
195
195
|
import "./chunk-GDB4J2H3.js";
|
|
196
196
|
import "./chunk-ARV3AUOM.js";
|
package/dist/graph-recall.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { PluginEntryResolverOptions, resolvePluginEntry } from './plugin-entry-resolver.js';
|
|
2
2
|
export { isOpenaiApiKeyDisabled, parseConfig, resolveEnvVars } from './config.js';
|
|
3
3
|
export { MigrationOptions, MigrationResult, RollbackResult, migrateFromEngram, rollbackFromEngramMigration } from './migrate/from-engram.js';
|
|
4
|
-
import { S as SpeakerRegistry, W as WearablesService } from './orchestrator-
|
|
5
|
-
export { D as DEFAULT_SELF_NAME, O as Orchestrator, R as ResolvedSpeaker, a as SpeakerOverride, b as WEARABLE_SOURCE_PREFIX, c as WearableDayTranscriptView, d as WearableMemoryGenDeps, e as WearableMemoryGenResult, f as WearableMemorySearchResult, g as WearableMemoryWriter, h as WearableSearchBackend, i as WearableStorageIo, j as WearableSyncDeps, k as WearableSyncOptions, l as WearableTranscriptSearchResult, m as WearablesServiceDeps, n as buildExtractionTurns, o as dateInTimezone, p as defaultTimezone, q as defaultWorkspaceDir, r as distinctSpeakerLabels, s as emptySpeakerRegistry, t as generateWearableMemories, u as importNativeMemories, v as loadSpeakerRegistry, w as locateTranscriptPath, x as memoryStatusForMode, y as resolveSpeaker, z as resolveSyncDates, A as sanitizeSessionKeyForFilename, B as saveSpeakerRegistry, C as speakerRegistryKey, E as speakersFilePath, F as syncWearableSource, H as wearableDayTag, J as wearableSourceLabel, K as writeDailyDigestMemory } from './orchestrator-
|
|
4
|
+
import { S as SpeakerRegistry, W as WearablesService } from './orchestrator-Dr-1v5EL.js';
|
|
5
|
+
export { D as DEFAULT_SELF_NAME, O as Orchestrator, R as ResolvedSpeaker, a as SpeakerOverride, b as WEARABLE_SOURCE_PREFIX, c as WearableDayTranscriptView, d as WearableMemoryGenDeps, e as WearableMemoryGenResult, f as WearableMemorySearchResult, g as WearableMemoryWriter, h as WearableSearchBackend, i as WearableStorageIo, j as WearableSyncDeps, k as WearableSyncOptions, l as WearableTranscriptSearchResult, m as WearablesServiceDeps, n as buildExtractionTurns, o as dateInTimezone, p as defaultTimezone, q as defaultWorkspaceDir, r as distinctSpeakerLabels, s as emptySpeakerRegistry, t as generateWearableMemories, u as importNativeMemories, v as loadSpeakerRegistry, w as locateTranscriptPath, x as memoryStatusForMode, y as resolveSpeaker, z as resolveSyncDates, A as sanitizeSessionKeyForFilename, B as saveSpeakerRegistry, C as speakerRegistryKey, E as speakersFilePath, F as syncWearableSource, H as wearableDayTag, J as wearableSourceLabel, K as writeDailyDigestMemory } from './orchestrator-Dr-1v5EL.js';
|
|
6
6
|
export { normalizeProjectionPreview, normalizeProjectionTags } from './memory-projection-format.js';
|
|
7
7
|
export { ModelCapabilities, ModelRegistry } from './model-registry.js';
|
|
8
8
|
export { ACTIVE_STATUSES, ContradictionFilter, ContradictionJudgeBatchResult, ContradictionJudgeInput, ContradictionJudgeResult, ContradictionListResult, ContradictionVerdict, ResolutionResult, ResolutionVerb, ScanDependencies, ScanResult, computePairId, executeResolution, isCoolingDown, isValidResolutionVerb, judgeContradictionPairs, listPairs, readPair, resolvePair, runContradictionScan, writePair, writePairs } from './contradiction/index.js';
|
|
@@ -24,7 +24,7 @@ import { aA as CodingContext, aR as CodingModeConfig, P as PluginConfig, aS as C
|
|
|
24
24
|
export { W as AgentAccessAuthToken, r as BriefingActiveThread, aV as BriefingConfig, p as BriefingFocus, o as BriefingFollowup, aW as BriefingOpenCommitment, t as BriefingRecentEntity, s as BriefingResult, n as BriefingSections, aX as BriefingWindow, O as BufferSurpriseEvent, q as CalendarEvent, C as CalendarSource, aY as CodexCompatConfig, aQ as ConsolidationObservation, a8 as ContinuityImprovementLoop, aZ as DEFAULT_RECALL_DISCLOSURE, E as EntityFile, a4 as EntityStructuredSection, a_ as ExtractedFact, G as GatewayConfig, ae as MemoryActionEligibilityContext, a$ as MemoryActionEligibilitySource, _ as MemoryActionType, g as MemoryFile, k as MemoryFrontmatter, b0 as MemoryObservation, b1 as MemoryScope, b2 as RECALL_DISCLOSURE_LEVELS, i as RecallDisclosure, U as SecretRef, b3 as WearableAuthCheck, b4 as WearableFetchOptions, b5 as WearableFetchPage, aH as WearableMemoryMode, aG as WearableNativeMemory, b6 as WearableNativeMemoryPage, aL as WearableSourceStatus, aK as WearableSyncSummary, b7 as WearableTranscriptSegment, b8 as isRecallDisclosure } from './types-CglNn2V-.js';
|
|
25
25
|
export { JudgeBatchResult, JudgeCandidate, JudgeVerdict, JudgeVerdictKind, clearVerdictCache, createVerdictCache, getVerdictKind, isDurableVerdict, isValidCachedVerdict, judgeFactDurability, normalizeCachedVerdict, verdictCacheSize } from './extraction-judge.js';
|
|
26
26
|
export { hasBroadGraphIntent, inferIntentFromText, intentCompatibilityScore, isTaskInitiationIntent, planRecallMode } from './intent.js';
|
|
27
|
-
export { i as EngramAccessInputError, g as EngramAccessService, P as ProcedureStatsConfigSnapshot, j as ProcedureStatsRecent, k as ProcedureStatsReport, l as ProcedureStatusCounts, m as computeProcedureStats, n as formatProcedureStatsText } from './access-service-
|
|
27
|
+
export { i as EngramAccessInputError, g as EngramAccessService, P as ProcedureStatsConfigSnapshot, j as ProcedureStatsRecent, k as ProcedureStatsReport, l as ProcedureStatusCounts, m as computeProcedureStats, n as formatProcedureStatsText } from './access-service-K8n12dXu.js';
|
|
28
28
|
export { FILTER_LABELS as DIRECT_ANSWER_FILTER_LABELS, DirectAnswerCandidate, DirectAnswerConfig, DirectAnswerInput, DirectAnswerReason, DirectAnswerResult, isDirectAnswerEligible } from './direct-answer.js';
|
|
29
29
|
export { MemoryTier, TierRoutingPolicy, TierTransitionDecision, computeTierValueScore, decideTierTransition } from './tier-routing.js';
|
|
30
30
|
export { ApplyReasoningTraceBoostOptions, BoostableResult, DEFAULT_REASONING_TRACE_BOOST, applyReasoningTraceBoost, isReasoningTracePath, looksLikeProblemSolvingQuery } from './reasoning-trace-recall.js';
|
|
@@ -79,7 +79,7 @@ export { EnrichmentAuditEntry, EnrichmentCandidate, EnrichmentCostTier, Enrichme
|
|
|
79
79
|
export { d as BulkImportError, B as BulkImportOptions, b as BulkImportResult, a as BulkImportSource, e as BulkImportSourceAdapter, f as ImportSourceRole, I as ImportTurn, g as ImportTurnValidationIssue, i as isImportRole, p as parseIsoTimestamp, v as validateImportTurn } from './types-gb_SNtjR.js';
|
|
80
80
|
export { clearBulkImportSources, getBulkImportSource, listBulkImportSources, registerBulkImportSource } from './bulk-import/index.js';
|
|
81
81
|
export { a as ProcessBatchContext, P as ProcessBatchFn, b as ProcessBatchResult, f as formatBatchTranscript, r as resolveBulkImportContext, c as runBulkImportPipeline, v as validateBatchSize } from './pipeline-DmqtvION.js';
|
|
82
|
-
export { B as BulkImportCliCommandOptions, p as parseStrictCliDate, r as runBulkImportCliCommand } from './cli-
|
|
82
|
+
export { B as BulkImportCliCommandOptions, p as parseStrictCliDate, r as runBulkImportCliCommand } from './cli-BEOLy1xo.js';
|
|
83
83
|
export { DEFAULT_IMPORT_BATCH_SIZE, ImportProgress, ImportedMemory, ImporterAdapter, ImporterParseOptions, ImporterTransformOptions, ImporterWriteResult, ImporterWriteTarget, RunImportOptions, RunImporterResult, defaultWriteMemoriesToOrchestrator, importedMemoryToTurn, runImporter, validateImportBatchSize, validateImportRateLimit } from './importers/index.js';
|
|
84
84
|
export { FallbackLlmClient, FallbackLlmOptions, FallbackLlmResponse, FallbackLlmRuntimeContext } from './fallback-llm.js';
|
|
85
85
|
export { ComputeMemoryWorthInput, MemoryWorthResult, computeMemoryWorth } from './memory-worth.js';
|
package/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
} from "./chunk-UG274TNV.js";
|
|
44
44
|
import {
|
|
45
45
|
runGraphRecall
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-PHRLJFWZ.js";
|
|
47
47
|
import {
|
|
48
48
|
DEFAULT_PPR_DAMPING,
|
|
49
49
|
DEFAULT_PPR_ITERATIONS,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
registerTrainingExportAdapter,
|
|
63
63
|
runBulkImportCliCommand,
|
|
64
64
|
runWearablesCliCommand
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-GFJ5ABKS.js";
|
|
66
66
|
import "./chunk-7F7Z6MOS.js";
|
|
67
67
|
import "./chunk-MC4FJXPA.js";
|
|
68
68
|
import "./chunk-LQHDIS7L.js";
|
|
@@ -117,7 +117,7 @@ import {
|
|
|
117
117
|
import {
|
|
118
118
|
parseStrictCliDate
|
|
119
119
|
} from "./chunk-3T74IZB3.js";
|
|
120
|
-
import "./chunk-
|
|
120
|
+
import "./chunk-AM7YKD7V.js";
|
|
121
121
|
import "./chunk-UYYSOMS2.js";
|
|
122
122
|
import "./chunk-HL4DB7TO.js";
|
|
123
123
|
import "./chunk-7XH7VJN4.js";
|
|
@@ -157,7 +157,7 @@ import {
|
|
|
157
157
|
saveTaxonomy,
|
|
158
158
|
validateSlug,
|
|
159
159
|
validateTaxonomy
|
|
160
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-7HUGLMSW.js";
|
|
161
161
|
import {
|
|
162
162
|
WEARABLE_SOURCE_PREFIX,
|
|
163
163
|
buildExtractionTurns,
|
|
@@ -180,7 +180,7 @@ import {
|
|
|
180
180
|
wearableDayTag,
|
|
181
181
|
wearableSourceLabel,
|
|
182
182
|
writeDailyDigestMemory
|
|
183
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-C7LDPZJJ.js";
|
|
184
184
|
import "./chunk-WIMKOTNY.js";
|
|
185
185
|
import "./chunk-BJPL5WAL.js";
|
|
186
186
|
import "./chunk-I74SUMNI.js";
|
|
@@ -204,7 +204,7 @@ import {
|
|
|
204
204
|
import "./chunk-666A3MOW.js";
|
|
205
205
|
import "./chunk-HHLLAQGZ.js";
|
|
206
206
|
import "./chunk-UWK5OXUJ.js";
|
|
207
|
-
import "./chunk-
|
|
207
|
+
import "./chunk-V5RVMULT.js";
|
|
208
208
|
import "./chunk-7N4KAIGN.js";
|
|
209
209
|
import "./chunk-TPDBFYEG.js";
|
|
210
210
|
import "./chunk-KCYE2MZM.js";
|
|
@@ -213,7 +213,7 @@ import {
|
|
|
213
213
|
ensureLcmStateDir,
|
|
214
214
|
openLcmDatabase
|
|
215
215
|
} from "./chunk-KYYL4U6X.js";
|
|
216
|
-
import "./chunk-
|
|
216
|
+
import "./chunk-W4H5A3TJ.js";
|
|
217
217
|
import "./chunk-HW5EF6LV.js";
|
|
218
218
|
import "./chunk-TECVW3JP.js";
|
|
219
219
|
import "./chunk-O7GOFAM3.js";
|
|
@@ -469,7 +469,7 @@ import "./chunk-K6MV3TRQ.js";
|
|
|
469
469
|
import "./chunk-OADWQ5CR.js";
|
|
470
470
|
import {
|
|
471
471
|
EngramAccessHttpServer
|
|
472
|
-
} from "./chunk-
|
|
472
|
+
} from "./chunk-JMMSVRF4.js";
|
|
473
473
|
import "./chunk-SEDEKFYQ.js";
|
|
474
474
|
import "./chunk-JBPKEARU.js";
|
|
475
475
|
import "./chunk-TMSXWOBZ.js";
|
|
@@ -483,15 +483,15 @@ import {
|
|
|
483
483
|
} from "./chunk-7WV3F5DQ.js";
|
|
484
484
|
import {
|
|
485
485
|
EngramMcpServer
|
|
486
|
-
} from "./chunk-
|
|
486
|
+
} from "./chunk-EZZUNKMJ.js";
|
|
487
487
|
import {
|
|
488
488
|
buildCitationGuidance,
|
|
489
489
|
formatOaiMemCitation,
|
|
490
490
|
parseOaiMemCitation,
|
|
491
491
|
sanitizeNoteForCitation
|
|
492
492
|
} from "./chunk-D24OXEPB.js";
|
|
493
|
-
import "./chunk-
|
|
494
|
-
import "./chunk-
|
|
493
|
+
import "./chunk-7ADHJ6SU.js";
|
|
494
|
+
import "./chunk-UEIF7RWQ.js";
|
|
495
495
|
import "./chunk-YF6FMLBT.js";
|
|
496
496
|
import "./chunk-ZQNCHPTZ.js";
|
|
497
497
|
import {
|
|
@@ -529,13 +529,13 @@ import {
|
|
|
529
529
|
suggestionSubmitRequestSchema,
|
|
530
530
|
validateRequest
|
|
531
531
|
} from "./chunk-FVZ2ISIX.js";
|
|
532
|
-
import "./chunk-
|
|
532
|
+
import "./chunk-QUNH5UZH.js";
|
|
533
533
|
import {
|
|
534
534
|
EngramAccessInputError,
|
|
535
535
|
EngramAccessService,
|
|
536
536
|
computeProcedureStats,
|
|
537
537
|
formatProcedureStatsText
|
|
538
|
-
} from "./chunk-
|
|
538
|
+
} from "./chunk-NHJYUIII.js";
|
|
539
539
|
import "./chunk-GDASG7NC.js";
|
|
540
540
|
import "./chunk-GDB4J2H3.js";
|
|
541
541
|
import {
|
package/dist/lcm/engine.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LcmEngine,
|
|
3
3
|
extractLcmConfig
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-V5RVMULT.js";
|
|
5
5
|
import "../chunk-7N4KAIGN.js";
|
|
6
6
|
import "../chunk-TPDBFYEG.js";
|
|
7
7
|
import "../chunk-KCYE2MZM.js";
|
|
8
8
|
import "../chunk-KYYL4U6X.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-W4H5A3TJ.js";
|
|
10
10
|
import "../chunk-HW5EF6LV.js";
|
|
11
11
|
import "../chunk-4RA3C3EV.js";
|
|
12
12
|
import "../chunk-AQEJKOKI.js";
|
package/dist/lcm/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
LcmEngine,
|
|
7
7
|
extractLcmConfig
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-V5RVMULT.js";
|
|
9
9
|
import {
|
|
10
10
|
LcmDag
|
|
11
11
|
} from "../chunk-7N4KAIGN.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "../chunk-KYYL4U6X.js";
|
|
20
20
|
import {
|
|
21
21
|
LcmSummarizer
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-W4H5A3TJ.js";
|
|
23
23
|
import {
|
|
24
24
|
LcmArchive,
|
|
25
25
|
estimateTokens
|
package/dist/lcm/summarizer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as EngramAccessRecallResponse } from './access-service-
|
|
1
|
+
import { h as EngramAccessRecallResponse } from './access-service-K8n12dXu.js';
|
|
2
2
|
import { ActionConfidenceRequest } from './access-schema.js';
|
|
3
3
|
import { RecallXraySnapshot } from './recall-xray.js';
|
|
4
4
|
import { ActionConfidenceResult } from './action-confidence.js';
|
|
@@ -22,7 +22,7 @@ import './memory-provenance.js';
|
|
|
22
22
|
import './user-model.js';
|
|
23
23
|
import './recall-audit-anomaly.js';
|
|
24
24
|
import './recall-audit.js';
|
|
25
|
-
import './orchestrator-
|
|
25
|
+
import './orchestrator-Dr-1v5EL.js';
|
|
26
26
|
import './briefing.js';
|
|
27
27
|
import './buffer.js';
|
|
28
28
|
import './extraction-faithfulness.js';
|