@remnic/core 9.3.700 → 9.3.701
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 +3 -3
- package/dist/access-boundary.js +7 -7
- package/dist/access-cli.js +21 -21
- package/dist/access-http.d.ts +3 -3
- package/dist/access-http.js +10 -10
- package/dist/access-mcp.d.ts +3 -3
- package/dist/access-mcp.js +9 -9
- package/dist/access-operations.d.ts +3 -3
- package/dist/access-operations.js +8 -8
- package/dist/{access-service-Cte3ol0W.d.ts → access-service-CGVWK6lZ.d.ts} +1 -1
- package/dist/access-service.d.ts +3 -3
- package/dist/access-service.js +6 -6
- package/dist/access-surface-catalog.d.ts +3 -3
- package/dist/bootstrap.d.ts +2 -2
- package/dist/briefing.js +4 -4
- package/dist/{catalog-DN1PzThs.d.ts → catalog-DBIghceA.d.ts} +26 -52
- package/dist/causal-consolidation.js +5 -5
- package/dist/{chunk-GYVVQYA3.js → chunk-27LQPUMZ.js} +3 -3
- package/dist/{chunk-XJNBEDFE.js → chunk-3FAMU5TX.js} +31 -74
- package/dist/chunk-3FAMU5TX.js.map +1 -0
- package/dist/{chunk-PCZR32VL.js → chunk-3JJWNZTT.js} +2 -2
- package/dist/{chunk-GA5A6MJH.js → chunk-4HIAWLA2.js} +14 -14
- package/dist/{chunk-SEWF2O74.js → chunk-6W2D6FGG.js} +2 -2
- package/dist/{chunk-CHM274U6.js → chunk-7TAQEPLE.js} +2 -2
- package/dist/{chunk-G5PKTQ5J.js → chunk-DEDQXIDL.js} +2 -2
- package/dist/{chunk-3E5WRQNQ.js → chunk-FUCJAZ25.js} +4 -4
- package/dist/{chunk-6JDGADXK.js → chunk-HF4N43Q7.js} +2 -2
- package/dist/{chunk-NHBEO3F3.js → chunk-HXHKLVAS.js} +14 -14
- package/dist/{chunk-RC3CNIPK.js → chunk-IO5NQEGZ.js} +2 -2
- package/dist/{chunk-SMIVW7XC.js → chunk-ISLJ5WIM.js} +2 -2
- package/dist/{chunk-HDLC75NX.js → chunk-IYOPIG3E.js} +2 -2
- package/dist/{chunk-DR2JTSLZ.js → chunk-JKOKX3PS.js} +62 -163
- package/dist/chunk-JKOKX3PS.js.map +1 -0
- package/dist/{chunk-2NWHLAXX.js → chunk-JO3E5VGS.js} +2 -2
- package/dist/{chunk-CCOXIDRM.js → chunk-KF4TXW7Z.js} +4 -4
- package/dist/{chunk-JX3YZVII.js → chunk-KS7WQ4BZ.js} +3 -3
- package/dist/{chunk-YPR7DOPD.js → chunk-LTJAMRGI.js} +4 -4
- package/dist/{chunk-YPR7DOPD.js.map → chunk-LTJAMRGI.js.map} +1 -1
- package/dist/{chunk-ZDK2IW5F.js → chunk-MNU5G4TK.js} +2 -2
- package/dist/{chunk-PQG4T5V3.js → chunk-ODTWHSY2.js} +49 -45
- package/dist/chunk-ODTWHSY2.js.map +1 -0
- package/dist/{chunk-YMTGXDN6.js → chunk-OLOYQZFB.js} +4 -4
- package/dist/{chunk-JKW5XSWC.js → chunk-QP37KL5H.js} +2 -2
- package/dist/{chunk-X74FJSW7.js → chunk-SFMRLXIV.js} +2 -2
- package/dist/{chunk-RJ2THZ4H.js → chunk-TFVVONWD.js} +2 -2
- package/dist/{chunk-XY4WJTEX.js → chunk-WFEZUGU5.js} +2 -2
- package/dist/{chunk-O54DY26V.js → chunk-XTIRCSIH.js} +2 -2
- package/dist/{chunk-EOBJRBLC.js → chunk-YO4MBK3I.js} +2 -2
- package/dist/{chunk-YXIFA36P.js → chunk-ZT7B64BE.js} +2 -2
- package/dist/{chunk-33L6XHU2.js → chunk-ZYNMX6IU.js} +5 -5
- package/dist/{cli--yVN9yEV.d.ts → cli-D3XeenwN.d.ts} +2 -2
- package/dist/cli.d.ts +4 -4
- package/dist/cli.js +21 -21
- package/dist/compounding/engine.js +4 -4
- package/dist/connectors/codex-materialize-runner.js +4 -4
- package/dist/connectors/index.js +4 -4
- package/dist/entity-retrieval.js +4 -4
- package/dist/explicit-capture.d.ts +2 -2
- package/dist/{forget-BEXG5PQC.js → forget-6SOIPUMQ.js} +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.js +29 -29
- package/dist/maintenance/memory-governance.js +4 -4
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +4 -4
- package/dist/maintenance/rebuild-memory-projection.js +5 -5
- package/dist/mcp-memory-inspector-app.d.ts +3 -3
- package/dist/namespaces/migrate.d.ts +1 -1
- package/dist/namespaces/migrate.js +5 -5
- package/dist/namespaces/storage.d.ts +13 -2
- package/dist/namespaces/storage.js +4 -4
- package/dist/operator-toolkit.js +9 -9
- package/dist/orchestration/maintenance.d.ts +1 -1
- package/dist/orchestration/maintenance.js +6 -6
- package/dist/{orchestrator-CJI4xdqV.d.ts → orchestrator-BzMCZlKn.d.ts} +1 -1
- package/dist/orchestrator.d.ts +2 -2
- package/dist/orchestrator.js +17 -17
- package/dist/semantic-consolidation.js +5 -5
- package/dist/semantic-rule-promotion.js +4 -4
- package/dist/semantic-rule-verifier.js +4 -4
- package/dist/storage.js +3 -3
- package/dist/summarizer.js +3 -2
- package/dist/summary-snapshot.js +2 -1
- package/dist/utils/serialize-mutations.js +1 -1
- package/dist/verified-recall.js +4 -4
- package/package.json +2 -2
- package/src/namespaces/catalog.test.ts +222 -14
- package/src/namespaces/catalog.ts +54 -187
- package/src/namespaces/storage.ts +87 -80
- package/src/summary-snapshot.test.ts +63 -1
- package/src/summary-snapshot.ts +61 -80
- package/src/utils/serialize-mutations.ts +10 -6
- package/dist/chunk-DR2JTSLZ.js.map +0 -1
- package/dist/chunk-PQG4T5V3.js.map +0 -1
- package/dist/chunk-XJNBEDFE.js.map +0 -1
- /package/dist/{chunk-GYVVQYA3.js.map → chunk-27LQPUMZ.js.map} +0 -0
- /package/dist/{chunk-PCZR32VL.js.map → chunk-3JJWNZTT.js.map} +0 -0
- /package/dist/{chunk-GA5A6MJH.js.map → chunk-4HIAWLA2.js.map} +0 -0
- /package/dist/{chunk-SEWF2O74.js.map → chunk-6W2D6FGG.js.map} +0 -0
- /package/dist/{chunk-CHM274U6.js.map → chunk-7TAQEPLE.js.map} +0 -0
- /package/dist/{chunk-G5PKTQ5J.js.map → chunk-DEDQXIDL.js.map} +0 -0
- /package/dist/{chunk-3E5WRQNQ.js.map → chunk-FUCJAZ25.js.map} +0 -0
- /package/dist/{chunk-6JDGADXK.js.map → chunk-HF4N43Q7.js.map} +0 -0
- /package/dist/{chunk-NHBEO3F3.js.map → chunk-HXHKLVAS.js.map} +0 -0
- /package/dist/{chunk-RC3CNIPK.js.map → chunk-IO5NQEGZ.js.map} +0 -0
- /package/dist/{chunk-SMIVW7XC.js.map → chunk-ISLJ5WIM.js.map} +0 -0
- /package/dist/{chunk-HDLC75NX.js.map → chunk-IYOPIG3E.js.map} +0 -0
- /package/dist/{chunk-2NWHLAXX.js.map → chunk-JO3E5VGS.js.map} +0 -0
- /package/dist/{chunk-CCOXIDRM.js.map → chunk-KF4TXW7Z.js.map} +0 -0
- /package/dist/{chunk-JX3YZVII.js.map → chunk-KS7WQ4BZ.js.map} +0 -0
- /package/dist/{chunk-ZDK2IW5F.js.map → chunk-MNU5G4TK.js.map} +0 -0
- /package/dist/{chunk-YMTGXDN6.js.map → chunk-OLOYQZFB.js.map} +0 -0
- /package/dist/{chunk-JKW5XSWC.js.map → chunk-QP37KL5H.js.map} +0 -0
- /package/dist/{chunk-X74FJSW7.js.map → chunk-SFMRLXIV.js.map} +0 -0
- /package/dist/{chunk-RJ2THZ4H.js.map → chunk-TFVVONWD.js.map} +0 -0
- /package/dist/{chunk-XY4WJTEX.js.map → chunk-WFEZUGU5.js.map} +0 -0
- /package/dist/{chunk-O54DY26V.js.map → chunk-XTIRCSIH.js.map} +0 -0
- /package/dist/{chunk-EOBJRBLC.js.map → chunk-YO4MBK3I.js.map} +0 -0
- /package/dist/{chunk-YXIFA36P.js.map → chunk-ZT7B64BE.js.map} +0 -0
- /package/dist/{chunk-33L6XHU2.js.map → chunk-ZYNMX6IU.js.map} +0 -0
- /package/dist/{forget-BEXG5PQC.js.map → forget-6SOIPUMQ.js.map} +0 -0
|
@@ -94,8 +94,7 @@ declare class NamespaceCatalog {
|
|
|
94
94
|
private readonly stateDir;
|
|
95
95
|
private readonly catalogPath;
|
|
96
96
|
private readonly rebuildLockPath;
|
|
97
|
-
private readonly
|
|
98
|
-
private writeChain;
|
|
97
|
+
private readonly criticalSection;
|
|
99
98
|
protected onTouchCriticalSectionForTest?: () => Promise<void>;
|
|
100
99
|
protected onRebuildBeforeRenameForTest?: () => Promise<void>;
|
|
101
100
|
protected onRebuildAfterScanForTest?: () => Promise<void>;
|
|
@@ -354,24 +353,23 @@ declare class NamespaceCatalog {
|
|
|
354
353
|
* their respective critical sections — closing the check-then-append gap where a
|
|
355
354
|
* polled-only touch could append into a rebuild's load→rename window.
|
|
356
355
|
*
|
|
357
|
-
*
|
|
358
|
-
* `
|
|
359
|
-
*
|
|
360
|
-
*
|
|
356
|
+
* Issue #1524 adoption: this is now a thin delegation to the shared
|
|
357
|
+
* `withHeldFileLock` utility. The acquire loop, mtime heartbeat, stale-break
|
|
358
|
+
* (NG7Bg replacement-safe), and ownership-checked release (NCzT6) all live in
|
|
359
|
+
* ONE place — the util — so this module no longer re-implements them. The
|
|
360
|
+
* catalog's `REBUILD_LOCK_*` constants and the `onBeforeBreakStaleUnlinkForTest`
|
|
361
|
+
* seam flow straight through. The util generates a per-CALL owner uuid, which
|
|
362
|
+
* is stricter than the previous per-instance `lockOwnerId` (two calls on the
|
|
363
|
+
* same instance get different ids, so neither mistakes the other's lock as
|
|
364
|
+
* self-held — the NBsGP invariant, preserved and tightened).
|
|
361
365
|
*
|
|
362
366
|
* IN-PROCESS SAFETY: every caller invokes this from inside (or wrapping) the
|
|
363
367
|
* per-process `queueCritical` chain, which serializes all catalog mutations in
|
|
364
|
-
* THIS process. So within one process only one
|
|
365
|
-
* acquisition at a time — the file lock is never
|
|
366
|
-
* the lock is acquired and released within a
|
|
367
|
-
* lock adds only the missing CROSS-process
|
|
368
|
-
*
|
|
369
|
-
* HEARTBEAT (round 5, cursor/codex Medium/P2): while WE hold the lock a timer
|
|
370
|
-
* refreshes its mtime every `REBUILD_LOCK_HEARTBEAT_MS`, so a legitimately long
|
|
371
|
-
* holder (> `REBUILD_LOCK_STALE_MS`) is not treated as a crashed holder and
|
|
372
|
-
* unlinked by another process — which would let overlapping windows lose
|
|
373
|
-
* appends. Heartbeat failures are swallowed; the timer is always cleared in
|
|
374
|
-
* `finally`.
|
|
368
|
+
* THIS process (now via `MutationSerializer`). So within one process only one
|
|
369
|
+
* logical holder attempts OS-lock acquisition at a time — the file lock is never
|
|
370
|
+
* self-contended in-process, and the lock is acquired and released within a
|
|
371
|
+
* single in-process turn. The file lock adds only the missing CROSS-process
|
|
372
|
+
* exclusion.
|
|
375
373
|
*
|
|
376
374
|
* ACQUISITION RESULT (round 6, codex P2 — NBPmY): `fn` receives whether WE
|
|
377
375
|
* actually hold the lock. When acquisition TIMED OUT (another holder is active),
|
|
@@ -381,35 +379,6 @@ declare class NamespaceCatalog {
|
|
|
381
379
|
* (touch) when unlocked.
|
|
382
380
|
*/
|
|
383
381
|
private withHeldCatalogLock;
|
|
384
|
-
/** Try to acquire the rebuild lock; returns true if WE created it. */
|
|
385
|
-
private acquireRebuildLock;
|
|
386
|
-
/**
|
|
387
|
-
* Remove the lock file if its mtime is older than the stale threshold.
|
|
388
|
-
*
|
|
389
|
-
* REPLACEMENT-SAFE (NG7Bg, codex P2): a plain `stat` → `unlink` has a TOCTOU
|
|
390
|
-
* window — two processes can both observe the SAME stale lock; one removes it and
|
|
391
|
-
* creates a FRESH lock, and the other's later `unlink` then deletes that fresh
|
|
392
|
-
* holder's ACTIVE lock based on the stale identity it read earlier, leaving the
|
|
393
|
-
* fresh holder running its critical section with no visible lock and reopening the
|
|
394
|
-
* lost-update race the mutex prevents. We therefore capture the lock's IDENTITY
|
|
395
|
-
* (its full content line: `<pid> <owner-uuid> <iso>`) when we judge it stale, then
|
|
396
|
-
* RE-READ immediately before unlinking and only remove it when the content is
|
|
397
|
-
* byte-identical AND still stale. A replacement lock has a different owner id /
|
|
398
|
-
* timestamp, so its content differs and we leave it untouched. We never unlink a
|
|
399
|
-
* lock whose mtime is now fresh (a heartbeat refreshed it) or whose identity
|
|
400
|
-
* changed (a replacement was created). This is best-effort: any mismatch/vanish
|
|
401
|
-
* simply skips the break and the caller polls again.
|
|
402
|
-
*/
|
|
403
|
-
private breakStaleRebuildLock;
|
|
404
|
-
/**
|
|
405
|
-
* Whether the rebuild lock file was written by THIS instance (round 6, codex
|
|
406
|
-
* P2 — NBsGP). Matches the per-instance owner id, NOT just `process.pid`: two
|
|
407
|
-
* NamespaceCatalog instances in the same process share a PID, so a PID-only
|
|
408
|
-
* check would wrongly treat instance A's lock as self-held by instance B and
|
|
409
|
-
* let B's touch skip the wait and append into A's rebuild window. Falls back to
|
|
410
|
-
* the legacy PID-only form for lock files written before owner ids existed.
|
|
411
|
-
*/
|
|
412
|
-
private rebuildLockHeldBySelf;
|
|
413
382
|
/**
|
|
414
383
|
* Merge a prior record's preserved metadata (timestamps, principal hints)
|
|
415
384
|
* onto a freshly-discovered record. Disk-derived fields (storageDir, kind)
|
|
@@ -427,12 +396,17 @@ declare class NamespaceCatalog {
|
|
|
427
396
|
private loadCompacted;
|
|
428
397
|
/**
|
|
429
398
|
* Serialize an arbitrary read-modify-write critical section through the single
|
|
430
|
-
*
|
|
431
|
-
* runs through this so they are mutually exclusive: a touch always
|
|
432
|
-
* latest persisted state before appending, and a rebuild rewrite
|
|
433
|
-
* interleave with a touch's append.
|
|
434
|
-
*
|
|
435
|
-
*
|
|
399
|
+
* per-instance chain. Every catalog mutation (touch read+merge+append, full
|
|
400
|
+
* rewrite) runs through this so they are mutually exclusive: a touch always
|
|
401
|
+
* reads the latest persisted state before appending, and a rebuild rewrite
|
|
402
|
+
* cannot interleave with a touch's append.
|
|
403
|
+
*
|
|
404
|
+
* Issue #1524 adoption: delegates to the shared `MutationSerializer` (stored
|
|
405
|
+
* as `criticalSection`). The util owns the rejection-recovery invariant
|
|
406
|
+
* (CLAUDE.md rule #40 — one failed section never poisons subsequent ones, but
|
|
407
|
+
* the failing section's error still surfaces to ITS awaited promise) and the
|
|
408
|
+
* no-unbounded-growth cleanup. The key is constant: the catalog has ONE
|
|
409
|
+
* logical mutation queue (touches and rebuilds mutually exclude in-process).
|
|
436
410
|
*/
|
|
437
411
|
private queueCritical;
|
|
438
412
|
/**
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./chunk-4NFVPDIL.js";
|
|
5
5
|
import {
|
|
6
6
|
buildExtensionsBlockForConsolidation
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JO3E5VGS.js";
|
|
8
8
|
import {
|
|
9
9
|
runPostConsolidationMaterialize
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ISLJ5WIM.js";
|
|
11
11
|
import "./chunk-UUH4YQOF.js";
|
|
12
12
|
import "./chunk-JLNBQWZ2.js";
|
|
13
13
|
import "./chunk-3UXOZBHV.js";
|
|
@@ -15,15 +15,15 @@ import "./chunk-7FL4CNPV.js";
|
|
|
15
15
|
import {
|
|
16
16
|
resolveCausalTrajectoryStoreDir
|
|
17
17
|
} from "./chunk-YN4ZT4CW.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-SFMRLXIV.js";
|
|
19
|
+
import "./chunk-3JJWNZTT.js";
|
|
20
20
|
import "./chunk-M7XQSUBB.js";
|
|
21
|
-
import "./chunk-YPR7DOPD.js";
|
|
22
21
|
import "./chunk-5UZXUTVO.js";
|
|
23
22
|
import "./chunk-5GPPACXK.js";
|
|
24
23
|
import "./chunk-OMNTQPZO.js";
|
|
25
24
|
import "./chunk-IREVVFTM.js";
|
|
26
25
|
import "./chunk-SVOZFLIQ.js";
|
|
26
|
+
import "./chunk-LTJAMRGI.js";
|
|
27
27
|
import "./chunk-J6A3CX5N.js";
|
|
28
28
|
import "./chunk-IKNQAGBV.js";
|
|
29
29
|
import "./chunk-SCU65EZI.js";
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
listMemoryGovernanceRuns,
|
|
12
12
|
readMemoryGovernanceRunArtifact
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TFVVONWD.js";
|
|
14
14
|
import {
|
|
15
15
|
StorageManager
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-SFMRLXIV.js";
|
|
17
17
|
import {
|
|
18
18
|
normalizeProjectionPreview,
|
|
19
19
|
normalizeProjectionTags
|
|
@@ -929,4 +929,4 @@ export {
|
|
|
929
929
|
verifyMemoryProjection,
|
|
930
930
|
repairMemoryProjection
|
|
931
931
|
};
|
|
932
|
-
//# sourceMappingURL=chunk-
|
|
932
|
+
//# sourceMappingURL=chunk-27LQPUMZ.js.map
|
|
@@ -2,17 +2,13 @@ import {
|
|
|
2
2
|
encodeStoragePathSegment,
|
|
3
3
|
resolvePathInsideStorageRoot
|
|
4
4
|
} from "./chunk-FF4KLI5W.js";
|
|
5
|
+
import {
|
|
6
|
+
serializeMutations,
|
|
7
|
+
withHeldFileLock
|
|
8
|
+
} from "./chunk-LTJAMRGI.js";
|
|
5
9
|
|
|
6
10
|
// src/summary-snapshot.ts
|
|
7
|
-
import {
|
|
8
|
-
mkdir,
|
|
9
|
-
open,
|
|
10
|
-
readFile,
|
|
11
|
-
stat,
|
|
12
|
-
unlink,
|
|
13
|
-
utimes,
|
|
14
|
-
writeFile
|
|
15
|
-
} from "fs/promises";
|
|
11
|
+
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
16
12
|
import path from "path";
|
|
17
13
|
import { z } from "zod";
|
|
18
14
|
var summarySnapshotSchemaVersion = 1;
|
|
@@ -29,7 +25,6 @@ var SummarySnapshotSchema = z.object({
|
|
|
29
25
|
generatedAt: z.string().datetime({ offset: true }),
|
|
30
26
|
summaries: z.array(SummarySnapshotItemSchema)
|
|
31
27
|
});
|
|
32
|
-
var summarySnapshotUpserts = /* @__PURE__ */ new Map();
|
|
33
28
|
var summarySnapshotLockTimeoutMs = 5e3;
|
|
34
29
|
var summarySnapshotLockStaleMs = 3e4;
|
|
35
30
|
var summarySnapshotLockHeartbeatMs = Math.max(
|
|
@@ -101,25 +96,31 @@ async function writeSummarySnapshot(memoryDir, sessionKey, summaries) {
|
|
|
101
96
|
await writeFile(filePath, JSON.stringify(payload, null, 2), "utf-8");
|
|
102
97
|
}
|
|
103
98
|
async function withSummarySnapshotLock(memoryDir, sessionKey, work) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
99
|
+
return serializeMutations(
|
|
100
|
+
`summary-snapshot:${sessionKey}`,
|
|
101
|
+
() => (
|
|
102
|
+
// Cross-process mutex via the shared utility. The lock path, stale
|
|
103
|
+
// threshold, bounded wait, and heartbeat cadence all flow through; the
|
|
104
|
+
// utility's replacement-safe stale break (NG7Bg) and ownership-checked
|
|
105
|
+
// release are stronger than the bare `unlink` this module used before.
|
|
106
|
+
withHeldFileLock(
|
|
107
|
+
summarySnapshotLockPath(memoryDir, sessionKey),
|
|
108
|
+
{
|
|
109
|
+
staleMs: summarySnapshotLockStaleMs,
|
|
110
|
+
maxWaitMs: summarySnapshotLockTimeoutMs,
|
|
111
|
+
heartbeatMs: summarySnapshotLockHeartbeatMs
|
|
112
|
+
},
|
|
113
|
+
async (acquired) => {
|
|
114
|
+
if (!acquired) {
|
|
115
|
+
throw new Error(
|
|
116
|
+
"could not acquire summary snapshot lock (contention timeout or filesystem error)"
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
return work();
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
)
|
|
123
|
+
);
|
|
123
124
|
}
|
|
124
125
|
async function upsertSummarySnapshot(memoryDir, summary) {
|
|
125
126
|
await withSummarySnapshotLock(memoryDir, summary.sessionKey, async () => {
|
|
@@ -139,50 +140,6 @@ async function upsertSummarySnapshot(memoryDir, summary) {
|
|
|
139
140
|
await writeSummarySnapshot(memoryDir, summary.sessionKey, next);
|
|
140
141
|
});
|
|
141
142
|
}
|
|
142
|
-
async function withExclusiveSummarySnapshotFileLock(lockPath, callback) {
|
|
143
|
-
await mkdir(path.dirname(lockPath), { recursive: true });
|
|
144
|
-
const startedAt = Date.now();
|
|
145
|
-
while (true) {
|
|
146
|
-
try {
|
|
147
|
-
const handle = await open(lockPath, "wx");
|
|
148
|
-
let heartbeat = null;
|
|
149
|
-
if (summarySnapshotLockHeartbeatMs > 0) {
|
|
150
|
-
heartbeat = setInterval(() => {
|
|
151
|
-
void utimes(lockPath, /* @__PURE__ */ new Date(), /* @__PURE__ */ new Date()).catch(() => void 0);
|
|
152
|
-
}, summarySnapshotLockHeartbeatMs);
|
|
153
|
-
heartbeat.unref?.();
|
|
154
|
-
}
|
|
155
|
-
try {
|
|
156
|
-
return await callback();
|
|
157
|
-
} finally {
|
|
158
|
-
if (heartbeat) clearInterval(heartbeat);
|
|
159
|
-
await handle.close().catch(() => void 0);
|
|
160
|
-
await unlink(lockPath).catch(() => void 0);
|
|
161
|
-
}
|
|
162
|
-
} catch (error) {
|
|
163
|
-
if (!isAlreadyExistsError(error)) throw error;
|
|
164
|
-
try {
|
|
165
|
-
const lockStat = await stat(lockPath);
|
|
166
|
-
if (Date.now() - lockStat.mtimeMs > summarySnapshotLockStaleMs) {
|
|
167
|
-
await unlink(lockPath).catch(() => void 0);
|
|
168
|
-
continue;
|
|
169
|
-
}
|
|
170
|
-
} catch {
|
|
171
|
-
continue;
|
|
172
|
-
}
|
|
173
|
-
if (Date.now() - startedAt > summarySnapshotLockTimeoutMs) {
|
|
174
|
-
throw new Error("timed out acquiring summary snapshot lock");
|
|
175
|
-
}
|
|
176
|
-
await sleep(10);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
function isAlreadyExistsError(error) {
|
|
181
|
-
return typeof error === "object" && error !== null && "code" in error && error.code === "EEXIST";
|
|
182
|
-
}
|
|
183
|
-
function sleep(ms) {
|
|
184
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
185
|
-
}
|
|
186
143
|
|
|
187
144
|
export {
|
|
188
145
|
summarySnapshotPath,
|
|
@@ -190,4 +147,4 @@ export {
|
|
|
190
147
|
writeSummarySnapshot,
|
|
191
148
|
upsertSummarySnapshot
|
|
192
149
|
};
|
|
193
|
-
//# sourceMappingURL=chunk-
|
|
150
|
+
//# sourceMappingURL=chunk-3FAMU5TX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/summary-snapshot.ts"],"sourcesContent":["import { mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { z } from \"zod\";\nimport {\n encodeStoragePathSegment,\n resolvePathInsideStorageRoot,\n} from \"./storage-paths.js\";\nimport {\n serializeMutations,\n withHeldFileLock,\n} from \"./utils/serialize-mutations.js\";\nimport type { HourlySummary } from \"./types.js\";\n\nconst summarySnapshotSchemaVersion = 1;\n\nconst SummarySnapshotItemSchema = z.object({\n hour: z.string(),\n sessionKey: z.string(),\n bullets: z.array(z.string()),\n turnCount: z.number().int().nonnegative(),\n generatedAt: z.string(),\n});\n\nconst SummarySnapshotSchema = z.object({\n schemaVersion: z.number().default(summarySnapshotSchemaVersion),\n sessionKey: z.string(),\n generatedAt: z.string().datetime({ offset: true }),\n summaries: z.array(SummarySnapshotItemSchema),\n});\n\ntype SummarySnapshot = z.infer<typeof SummarySnapshotSchema>;\n\n// Lock timings for the cross-process summary-snapshot file lock. These are\n// passed straight through to the shared `withHeldFileLock` utility (issue\n// #1524 adoption); the previous bespoke lock used the same numbers.\nconst summarySnapshotLockTimeoutMs = 5_000;\nconst summarySnapshotLockStaleMs = 30_000;\nconst summarySnapshotLockHeartbeatMs = Math.max(\n 1_000,\n Math.floor(summarySnapshotLockStaleMs / 3),\n);\n\nexport function summarySnapshotPath(\n memoryDir: string,\n sessionKey: string,\n): string {\n return resolveSummarySnapshotPath(memoryDir, sessionKey, \"json\");\n}\n\nfunction summarySnapshotLockPath(memoryDir: string, sessionKey: string): string {\n return resolveSummarySnapshotPath(memoryDir, sessionKey, \"lock\");\n}\n\nfunction summarySnapshotRoot(memoryDir: string): string {\n return resolvePathInsideStorageRoot(memoryDir, \"state\", \"summaries\");\n}\n\nfunction resolveSummarySnapshotPath(\n memoryDir: string,\n sessionKey: string,\n extension: \"json\" | \"lock\",\n): string {\n const safeSessionKey = encodeStoragePathSegment(sessionKey, \"session\");\n return resolvePathInsideStorageRoot(\n summarySnapshotRoot(memoryDir),\n `${safeSessionKey}.${extension}`,\n );\n}\n\nfunction legacySummarySnapshotPath(\n memoryDir: string,\n sessionKey: string,\n): string | null {\n if (sessionKey.includes(\"\\0\")) {\n return null;\n }\n try {\n return resolvePathInsideStorageRoot(\n summarySnapshotRoot(memoryDir),\n `${sessionKey}.json`,\n );\n } catch {\n return null;\n }\n}\n\nexport async function readSummarySnapshot(\n memoryDir: string,\n sessionKey: string,\n): Promise<HourlySummary[] | null> {\n const filePath = summarySnapshotPath(memoryDir, sessionKey);\n const snapshot = await readSummarySnapshotFile(filePath, sessionKey);\n if (snapshot !== null) return snapshot;\n\n const legacyPath = legacySummarySnapshotPath(memoryDir, sessionKey);\n if (legacyPath === null || legacyPath === filePath) return null;\n return readSummarySnapshotFile(legacyPath, sessionKey);\n}\n\nasync function readSummarySnapshotFile(\n filePath: string,\n sessionKey: string,\n): Promise<HourlySummary[] | null> {\n try {\n const raw = await readFile(filePath, \"utf-8\");\n const data = SummarySnapshotSchema.parse(JSON.parse(raw));\n if (data.sessionKey !== sessionKey) return null;\n return data.summaries;\n } catch {\n return null;\n }\n}\n\nexport async function writeSummarySnapshot(\n memoryDir: string,\n sessionKey: string,\n summaries: HourlySummary[],\n): Promise<void> {\n const filePath = summarySnapshotPath(memoryDir, sessionKey);\n await mkdir(path.dirname(filePath), { recursive: true });\n const payload: SummarySnapshot = {\n schemaVersion: summarySnapshotSchemaVersion,\n sessionKey,\n generatedAt: new Date().toISOString(),\n summaries: summaries\n .map((summary) => ({\n hour: summary.hour,\n sessionKey: summary.sessionKey,\n bullets: summary.bullets,\n turnCount: summary.turnCount,\n generatedAt: summary.generatedAt,\n }))\n .sort((a, b) => new Date(b.hour).getTime() - new Date(a.hour).getTime()),\n };\n await writeFile(filePath, JSON.stringify(payload, null, 2), \"utf-8\");\n}\n\n// ── Concurrency primitives (issue #1524 adoption) ─────────────────────────\n//\n// Summary-snapshot upserts were previously guarded by TWO bespoke serializers:\n// 1. an in-process `summarySnapshotUpserts` map keyed by sessionKey that\n// chained each upsert off the prior one's release (mirroring\n// `serializeMutations`), and\n// 2. an on-disk `withExclusiveSummarySnapshotFileLock` that re-implemented\n// `open(path, \"wx\")` acquire, mtime heartbeat, stale-break, and\n// ownership-checked release.\n// Both now delegate to the shared utility so there is ONE home for each\n// primitive (`serializeMutations` for in-process, `withHeldFileLock` for\n// cross-process). The behavior contract is preserved:\n// - in-process upserts for the SAME sessionKey are strictly serialized\n// (read-merge-write cannot interleave);\n// - a cross-process holder blocks up to `summarySnapshotLockTimeoutMs`, then\n// the upsert FAILS (a snapshot is advisory; we never race a read-merge-write\n// unlocked). To preserve this strictness on top of a best-effort utility,\n// the work callback throws when `acquired === false`.\n\nasync function withSummarySnapshotLock<T>(\n memoryDir: string,\n sessionKey: string,\n work: () => Promise<T>,\n): Promise<T> {\n // In-process serialization (one upsert per sessionKey at a time). The\n // serializer recovers from rejection, so a failed upsert never poisons the\n // next one — matching the previous chain's `.then(noop, noop)` recovery.\n return serializeMutations(`summary-snapshot:${sessionKey}`, () =>\n // Cross-process mutex via the shared utility. The lock path, stale\n // threshold, bounded wait, and heartbeat cadence all flow through; the\n // utility's replacement-safe stale break (NG7Bg) and ownership-checked\n // release are stronger than the bare `unlink` this module used before.\n withHeldFileLock(\n summarySnapshotLockPath(memoryDir, sessionKey),\n {\n staleMs: summarySnapshotLockStaleMs,\n maxWaitMs: summarySnapshotLockTimeoutMs,\n heartbeatMs: summarySnapshotLockHeartbeatMs,\n },\n async (acquired) => {\n // Strict-fail when the lock could not be acquired: the upsert is a\n // read-merge-write, so a best-effort unlocked run would clobber a\n // concurrent writer. The utility's `acquired === false` covers BOTH a\n // genuine contention timeout AND a filesystem acquire failure (lock-dir\n // mkdir/open/permission errors — the advisory lock is best-effort, so\n // the util degrades rather than throwing). The bespoke lock this\n // replaced propagated fs errors verbatim and reserved the timeout\n // message for contention; we no longer claim \"timed out\" for an fs\n // failure (cursor Low 25143f4f) — the message names both causes so\n // upstream fail-open (runHourly) is unchanged but debugging is honest.\n if (!acquired) {\n throw new Error(\n \"could not acquire summary snapshot lock (contention timeout or filesystem error)\",\n );\n }\n return work();\n },\n ),\n );\n}\n\nexport async function upsertSummarySnapshot(\n memoryDir: string,\n summary: HourlySummary,\n): Promise<void> {\n await withSummarySnapshotLock(memoryDir, summary.sessionKey, async () => {\n const existing = await readSummarySnapshot(memoryDir, summary.sessionKey);\n const byHour = new Map<string, HourlySummary>();\n for (const item of existing ?? []) {\n byHour.set(item.hour, {\n ...item,\n generatedAt: item.generatedAt || new Date().toISOString(),\n sessionKey: summary.sessionKey,\n });\n }\n byHour.set(summary.hour, summary);\n const next = Array.from(byHour.values()).sort(\n (a, b) => new Date(b.hour).getTime() - new Date(a.hour).getTime(),\n );\n await writeSummarySnapshot(memoryDir, summary.sessionKey, next);\n });\n}\n"],"mappings":"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","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
serializeMutations
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LTJAMRGI.js";
|
|
4
4
|
|
|
5
5
|
// src/lifecycle/tombstones.ts
|
|
6
6
|
var TOMBSTONE_PREFIX = "tomb";
|
|
@@ -443,4 +443,4 @@ export {
|
|
|
443
443
|
collectRetiredMemoriesForRebuild,
|
|
444
444
|
buildRetiredFactTombstoneInputs
|
|
445
445
|
};
|
|
446
|
-
//# sourceMappingURL=chunk-
|
|
446
|
+
//# sourceMappingURL=chunk-3JJWNZTT.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-7HYPN2GC.js";
|
|
11
11
|
import {
|
|
12
12
|
MaintenanceScheduler
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZT7B64BE.js";
|
|
14
14
|
import {
|
|
15
15
|
LcmEngine
|
|
16
16
|
} from "./chunk-X5J3JZR3.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
CompoundingEngine,
|
|
22
22
|
defaultTierMigrationCycleBudget
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-MNU5G4TK.js";
|
|
24
24
|
import {
|
|
25
25
|
SharedContextManager
|
|
26
26
|
} from "./chunk-UFS7OXGL.js";
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
} from "./chunk-ECZU5BJH.js";
|
|
50
50
|
import {
|
|
51
51
|
HourlySummarizer
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-IO5NQEGZ.js";
|
|
53
53
|
import {
|
|
54
54
|
buildTargetedFactRecallSection,
|
|
55
55
|
shouldRecallTargetedFactEvidence
|
|
@@ -168,7 +168,7 @@ import {
|
|
|
168
168
|
buildEntityRecallSection,
|
|
169
169
|
entityRecentTranscriptLookbackHours,
|
|
170
170
|
readRecentEntityTranscriptEntries
|
|
171
|
-
} from "./chunk-
|
|
171
|
+
} from "./chunk-7TAQEPLE.js";
|
|
172
172
|
import {
|
|
173
173
|
buildEventOrderRecallSection,
|
|
174
174
|
shouldRecallEventOrderEvidence
|
|
@@ -185,14 +185,14 @@ import {
|
|
|
185
185
|
import {
|
|
186
186
|
compareVerifiedEpisodeResults,
|
|
187
187
|
searchVerifiedEpisodes
|
|
188
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-XTIRCSIH.js";
|
|
189
189
|
import {
|
|
190
190
|
ThreadingManager
|
|
191
191
|
} from "./chunk-QRDOSYOR.js";
|
|
192
192
|
import {
|
|
193
193
|
compareVerifiedSemanticRuleResults,
|
|
194
194
|
searchVerifiedSemanticRules
|
|
195
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-QP37KL5H.js";
|
|
196
196
|
import {
|
|
197
197
|
searchWorkProductLedgerEntries
|
|
198
198
|
} from "./chunk-ZRWB5D4H.js";
|
|
@@ -205,14 +205,14 @@ import {
|
|
|
205
205
|
import {
|
|
206
206
|
runNamespaceMaintenanceFanout,
|
|
207
207
|
summarizeNamespaceMaintenanceHealth
|
|
208
|
-
} from "./chunk-
|
|
208
|
+
} from "./chunk-WFEZUGU5.js";
|
|
209
209
|
import {
|
|
210
210
|
NamespaceCatalog,
|
|
211
211
|
planNamespaceMaintenance
|
|
212
|
-
} from "./chunk-
|
|
212
|
+
} from "./chunk-JKOKX3PS.js";
|
|
213
213
|
import {
|
|
214
214
|
NamespaceStorageRouter
|
|
215
|
-
} from "./chunk-
|
|
215
|
+
} from "./chunk-ODTWHSY2.js";
|
|
216
216
|
import {
|
|
217
217
|
isAboveImportanceThreshold,
|
|
218
218
|
scoreImportance
|
|
@@ -254,7 +254,7 @@ import {
|
|
|
254
254
|
materializeAfterSemanticConsolidation,
|
|
255
255
|
parseConsolidationResponse,
|
|
256
256
|
parseOperatorAwareConsolidationResponse
|
|
257
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-JO3E5VGS.js";
|
|
258
258
|
import {
|
|
259
259
|
buildBehaviorSignalsForMemory,
|
|
260
260
|
dedupeBehaviorSignalsByMemoryAndHash
|
|
@@ -350,7 +350,7 @@ import {
|
|
|
350
350
|
} from "./chunk-YN4ZT4CW.js";
|
|
351
351
|
import {
|
|
352
352
|
buildChainFollowupGenerator
|
|
353
|
-
} from "./chunk-
|
|
353
|
+
} from "./chunk-HF4N43Q7.js";
|
|
354
354
|
import {
|
|
355
355
|
ContentHashIndex,
|
|
356
356
|
StorageManager,
|
|
@@ -358,10 +358,10 @@ import {
|
|
|
358
358
|
fingerprintEntityStructuredFacts,
|
|
359
359
|
normalizeAttributePairs,
|
|
360
360
|
parseEntityFile
|
|
361
|
-
} from "./chunk-
|
|
361
|
+
} from "./chunk-SFMRLXIV.js";
|
|
362
362
|
import {
|
|
363
363
|
buildRetiredFactTombstoneInputs
|
|
364
|
-
} from "./chunk-
|
|
364
|
+
} from "./chunk-3JJWNZTT.js";
|
|
365
365
|
import {
|
|
366
366
|
isValidTranscriptDate,
|
|
367
367
|
loadSpeakerRegistry,
|
|
@@ -15345,4 +15345,4 @@ export {
|
|
|
15345
15345
|
resolvePersistedMemoryRelativePath,
|
|
15346
15346
|
Orchestrator
|
|
15347
15347
|
};
|
|
15348
|
-
//# sourceMappingURL=chunk-
|
|
15348
|
+
//# sourceMappingURL=chunk-4HIAWLA2.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-SFQ6QNL7.js";
|
|
7
7
|
import {
|
|
8
8
|
StorageManager
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SFMRLXIV.js";
|
|
10
10
|
import {
|
|
11
11
|
buildLifecycleEventsForMemory,
|
|
12
12
|
sortMemoryLifecycleEvents
|
|
@@ -74,4 +74,4 @@ export {
|
|
|
74
74
|
backupExistingLedger,
|
|
75
75
|
rebuildMemoryLifecycleLedger
|
|
76
76
|
};
|
|
77
|
-
//# sourceMappingURL=chunk-
|
|
77
|
+
//# sourceMappingURL=chunk-6W2D6FGG.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
compareEntityTimestamps,
|
|
6
6
|
normalizeEntityName
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SFMRLXIV.js";
|
|
8
8
|
import {
|
|
9
9
|
sanitizeMemoryContent
|
|
10
10
|
} from "./chunk-FVQJYWH7.js";
|
|
@@ -679,4 +679,4 @@ export {
|
|
|
679
679
|
entityIndexVersion,
|
|
680
680
|
entityRecentTranscriptLookbackHours
|
|
681
681
|
};
|
|
682
|
-
//# sourceMappingURL=chunk-
|
|
682
|
+
//# sourceMappingURL=chunk-7TAQEPLE.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NamespaceStorageRouter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ODTWHSY2.js";
|
|
4
4
|
import {
|
|
5
5
|
namespaceCollectionName
|
|
6
6
|
} from "./chunk-VPAFWWCL.js";
|
|
@@ -204,4 +204,4 @@ export {
|
|
|
204
204
|
verifyNamespaces,
|
|
205
205
|
runNamespaceMigration
|
|
206
206
|
};
|
|
207
|
-
//# sourceMappingURL=chunk-
|
|
207
|
+
//# sourceMappingURL=chunk-DEDQXIDL.js.map
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
listMemoryGovernanceRuns,
|
|
61
61
|
readMemoryGovernanceRunArtifact,
|
|
62
62
|
runMemoryGovernance
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-TFVVONWD.js";
|
|
64
64
|
import {
|
|
65
65
|
namespaceCollectionName
|
|
66
66
|
} from "./chunk-VPAFWWCL.js";
|
|
@@ -103,10 +103,10 @@ import {
|
|
|
103
103
|
buildBriefing,
|
|
104
104
|
parseBriefingFocus,
|
|
105
105
|
parseBriefingWindow
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-HF4N43Q7.js";
|
|
107
107
|
import {
|
|
108
108
|
parseEntityFile
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-SFMRLXIV.js";
|
|
110
110
|
import {
|
|
111
111
|
stripAttributesSuffix
|
|
112
112
|
} from "./chunk-SVOZFLIQ.js";
|
|
@@ -7743,4 +7743,4 @@ export {
|
|
|
7743
7743
|
shapeMemorySummary,
|
|
7744
7744
|
EngramAccessService
|
|
7745
7745
|
};
|
|
7746
|
-
//# sourceMappingURL=chunk-
|
|
7746
|
+
//# sourceMappingURL=chunk-FUCJAZ25.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager,
|
|
3
3
|
normalizeEntityName
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SFMRLXIV.js";
|
|
5
5
|
import {
|
|
6
6
|
extractJsonCandidates
|
|
7
7
|
} from "./chunk-RGMVMVMF.js";
|
|
@@ -870,4 +870,4 @@ export {
|
|
|
870
870
|
resolveBriefingSaveDir,
|
|
871
871
|
briefingFilename
|
|
872
872
|
};
|
|
873
|
-
//# sourceMappingURL=chunk-
|
|
873
|
+
//# sourceMappingURL=chunk-HF4N43Q7.js.map
|
|
@@ -47,12 +47,12 @@ import {
|
|
|
47
47
|
} from "./chunk-D6RIFG4O.js";
|
|
48
48
|
import {
|
|
49
49
|
rebuildMemoryLifecycleLedger
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-6W2D6FGG.js";
|
|
51
51
|
import {
|
|
52
52
|
rebuildMemoryProjection,
|
|
53
53
|
repairMemoryProjection,
|
|
54
54
|
verifyMemoryProjection
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-27LQPUMZ.js";
|
|
56
56
|
import {
|
|
57
57
|
rebuildObservations
|
|
58
58
|
} from "./chunk-LZZNTPLR.js";
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
} from "./chunk-IQ7WCZRW.js";
|
|
75
75
|
import {
|
|
76
76
|
promoteSemanticRuleFromMemory
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-IYOPIG3E.js";
|
|
78
78
|
import {
|
|
79
79
|
resolveAgentAccessAuthToken
|
|
80
80
|
} from "./chunk-TGQ2NTWH.js";
|
|
@@ -102,12 +102,12 @@ import {
|
|
|
102
102
|
runOperatorInventory,
|
|
103
103
|
runOperatorRepair,
|
|
104
104
|
runOperatorSetup
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-ZYNMX6IU.js";
|
|
106
106
|
import {
|
|
107
107
|
listNamespaces,
|
|
108
108
|
runNamespaceMigration,
|
|
109
109
|
verifyNamespaces
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-DEDQXIDL.js";
|
|
111
111
|
import {
|
|
112
112
|
GraphDashboardServer
|
|
113
113
|
} from "./chunk-YNDLCWXS.js";
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
} from "./chunk-WIWPSQYU.js";
|
|
121
121
|
import {
|
|
122
122
|
searchVerifiedEpisodes
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-XTIRCSIH.js";
|
|
124
124
|
import {
|
|
125
125
|
getUtilityLearningStatus,
|
|
126
126
|
learnUtilityPromotionWeights
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
} from "./chunk-QRDOSYOR.js";
|
|
135
135
|
import {
|
|
136
136
|
searchVerifiedSemanticRules
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-QP37KL5H.js";
|
|
138
138
|
import {
|
|
139
139
|
getWorkProductLedgerStatus,
|
|
140
140
|
recordWorkProductLedgerEntry,
|
|
@@ -149,7 +149,7 @@ import {
|
|
|
149
149
|
} from "./chunk-33JBK2XP.js";
|
|
150
150
|
import {
|
|
151
151
|
formatNamespaceMaintenanceHealthText
|
|
152
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-WFEZUGU5.js";
|
|
153
153
|
import {
|
|
154
154
|
analyzeSessionIntegrity,
|
|
155
155
|
applySessionRepair,
|
|
@@ -219,16 +219,16 @@ import {
|
|
|
219
219
|
} from "./chunk-OADWQ5CR.js";
|
|
220
220
|
import {
|
|
221
221
|
EngramAccessHttpServer
|
|
222
|
-
} from "./chunk-
|
|
222
|
+
} from "./chunk-KF4TXW7Z.js";
|
|
223
223
|
import {
|
|
224
224
|
WearablesInputError
|
|
225
225
|
} from "./chunk-7WV3F5DQ.js";
|
|
226
226
|
import {
|
|
227
227
|
EngramMcpServer
|
|
228
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-OLOYQZFB.js";
|
|
229
229
|
import {
|
|
230
230
|
EngramAccessService
|
|
231
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-FUCJAZ25.js";
|
|
232
232
|
import {
|
|
233
233
|
WorkStorage
|
|
234
234
|
} from "./chunk-GDB4J2H3.js";
|
|
@@ -250,7 +250,7 @@ import {
|
|
|
250
250
|
readMemoryGovernanceRunArtifact,
|
|
251
251
|
restoreMemoryGovernanceRun,
|
|
252
252
|
runMemoryGovernance
|
|
253
|
-
} from "./chunk-
|
|
253
|
+
} from "./chunk-TFVVONWD.js";
|
|
254
254
|
import {
|
|
255
255
|
analyzeGraphHealth
|
|
256
256
|
} from "./chunk-KF74X62T.js";
|
|
@@ -3077,7 +3077,7 @@ function registerCli(api, orchestrator, registerOptions = {}) {
|
|
|
3077
3077
|
const idArg = typeof args[0] === "string" ? args[0] : "";
|
|
3078
3078
|
const options = args[1] ?? {};
|
|
3079
3079
|
const reason = typeof options.reason === "string" && options.reason.trim().length > 0 ? options.reason.trim() : void 0;
|
|
3080
|
-
const { forgetMemory } = await import("./forget-
|
|
3080
|
+
const { forgetMemory } = await import("./forget-6SOIPUMQ.js");
|
|
3081
3081
|
try {
|
|
3082
3082
|
const result = await forgetMemory(orchestrator.storage, {
|
|
3083
3083
|
id: idArg,
|
|
@@ -7328,4 +7328,4 @@ export {
|
|
|
7328
7328
|
listMemoryMarkdownFilePaths,
|
|
7329
7329
|
registerCli
|
|
7330
7330
|
};
|
|
7331
|
-
//# sourceMappingURL=chunk-
|
|
7331
|
+
//# sourceMappingURL=chunk-HXHKLVAS.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
readSummarySnapshot,
|
|
3
3
|
upsertSummarySnapshot,
|
|
4
4
|
writeSummarySnapshot
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3FAMU5TX.js";
|
|
6
6
|
import {
|
|
7
7
|
ModelRegistry
|
|
8
8
|
} from "./chunk-PWFWCGOO.js";
|
|
@@ -686,4 +686,4 @@ ${truncatedConversation}`;
|
|
|
686
686
|
export {
|
|
687
687
|
HourlySummarizer
|
|
688
688
|
};
|
|
689
|
-
//# sourceMappingURL=chunk-
|
|
689
|
+
//# sourceMappingURL=chunk-IO5NQEGZ.js.map
|