@remnic/core 9.38.3 → 9.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-admin-ops-surface.d.ts +5 -5
- package/dist/access-admin-ops-surface.js +12 -12
- package/dist/access-authorization-probe.d.ts +5 -5
- package/dist/access-authorization-probe.js +13 -13
- package/dist/access-boundary.d.ts +5 -5
- package/dist/access-boundary.js +12 -12
- package/dist/access-cli.js +31 -31
- package/dist/access-extraction-force-flush.d.ts +5 -5
- package/dist/access-extraction-force-flush.js +12 -12
- package/dist/access-http-lcm-compaction.d.ts +5 -5
- package/dist/access-http-lifecycle-flush.d.ts +5 -5
- package/dist/access-http.d.ts +5 -5
- package/dist/access-http.js +17 -17
- package/dist/access-identity-continuity-surface.d.ts +4 -4
- package/dist/access-identity-continuity-surface.js +12 -12
- package/dist/access-lcm-surface.d.ts +5 -5
- package/dist/access-lcm-surface.js +12 -12
- package/dist/access-mcp.d.ts +5 -5
- package/dist/access-mcp.js +15 -15
- package/dist/access-namespace-preflight.js +12 -12
- package/dist/access-observe-write-surface.d.ts +5 -5
- package/dist/access-observe-write-surface.js +12 -12
- package/dist/access-operations-batch.js +13 -13
- package/dist/access-operations.d.ts +8 -8
- package/dist/access-operations.js +14 -14
- package/dist/access-recall-concurrency.d.ts +5 -5
- package/dist/access-recall-concurrency.js +12 -12
- package/dist/access-recall-response.d.ts +5 -5
- package/dist/access-recall-response.js +12 -12
- package/dist/access-recall-surface.d.ts +5 -5
- package/dist/access-recall-surface.js +12 -12
- package/dist/access-schema.d.ts +84 -84
- package/dist/{access-service-C2WYT1pO.d.ts → access-service-C6QuKBCG.d.ts} +3 -3
- package/dist/access-service-helpers.d.ts +5 -5
- package/dist/access-service.d.ts +5 -5
- package/dist/access-service.js +12 -12
- package/dist/access-surface-catalog.d.ts +5 -5
- package/dist/access-wearables-meetings-surface.d.ts +2 -2
- package/dist/bootstrap.d.ts +4 -4
- package/dist/briefing.d.ts +1 -1
- package/dist/briefing.js +5 -5
- package/dist/buffer.d.ts +1 -1
- package/dist/causal-consolidation.js +6 -6
- package/dist/{chunk-POQGCS4H.js → chunk-4CSTEPFA.js} +2 -2
- package/dist/{chunk-T3FVAHM7.js → chunk-4VXGRIH6.js} +286 -7
- package/dist/chunk-4VXGRIH6.js.map +1 -0
- package/dist/{chunk-XBJC7RTW.js → chunk-5JUYBWJD.js} +16 -16
- package/dist/{chunk-JYLN6KHH.js → chunk-5TRIAPT4.js} +7 -9
- package/dist/{chunk-JYLN6KHH.js.map → chunk-5TRIAPT4.js.map} +1 -1
- package/dist/{chunk-6D5D5A4M.js → chunk-7ERHAARG.js} +2 -2
- package/dist/{chunk-RMOSIGGI.js → chunk-7OCTH7AJ.js} +2 -2
- package/dist/{chunk-ILGC6JH6.js → chunk-7RJUVTVF.js} +16 -1
- package/dist/chunk-7RJUVTVF.js.map +1 -0
- package/dist/{chunk-FE7MUX7M.js → chunk-AL73FWSS.js} +2 -2
- package/dist/{chunk-6TF4M2LB.js → chunk-AVGTOOYP.js} +2 -2
- package/dist/{chunk-XEM77GGX.js → chunk-BVJIAIB3.js} +7 -7
- package/dist/{chunk-PRP3M5Y3.js → chunk-CMFUYOYB.js} +2 -2
- package/dist/{chunk-AF4HOJMH.js → chunk-CNZLKQEL.js} +2 -2
- package/dist/{chunk-YVMVVE4B.js → chunk-CPD6C6K6.js} +2 -2
- package/dist/{chunk-P2NCTIKE.js → chunk-CYM2PHLB.js} +5 -5
- package/dist/{chunk-RY2XZTFN.js → chunk-DJH35IVS.js} +2 -2
- package/dist/{chunk-Q3CVY7LV.js → chunk-ENLZOWYK.js} +201 -231
- package/dist/chunk-ENLZOWYK.js.map +1 -0
- package/dist/{chunk-IJAQCBGV.js → chunk-F5EVTFQK.js} +2 -2
- package/dist/{chunk-RY7CHVGE.js → chunk-G57BGHQ2.js} +2 -2
- package/dist/{chunk-IMEXE4XS.js → chunk-GYGXKATH.js} +6 -6
- package/dist/{chunk-C3HUHJ4G.js → chunk-JKTHT4KX.js} +3 -3
- package/dist/{chunk-44SRDUI4.js → chunk-KJP2R5MJ.js} +15 -15
- package/dist/{chunk-UBWOCQ3I.js → chunk-MHCRASVK.js} +2 -2
- package/dist/{chunk-DKKZ6SO2.js → chunk-SHTPVI47.js} +22 -45
- package/dist/chunk-SHTPVI47.js.map +1 -0
- package/dist/{chunk-PYTUBWAS.js → chunk-UGAZILZG.js} +2 -2
- package/dist/{chunk-4TAD3B56.js → chunk-VGK33D3K.js} +2 -2
- package/dist/{chunk-BGLDKAYY.js → chunk-VK33JSBR.js} +2 -2
- package/dist/{chunk-NBAEGFXT.js → chunk-VQTRSX4R.js} +11 -14
- package/dist/chunk-VQTRSX4R.js.map +1 -0
- package/dist/{chunk-WET4M3R6.js → chunk-XSPD6KQL.js} +2 -2
- package/dist/{chunk-HUS2XN3T.js → chunk-YFHMW37V.js} +2 -2
- package/dist/{chunk-HKF5VASQ.js → chunk-ZA53AZND.js} +17 -6
- package/dist/chunk-ZA53AZND.js.map +1 -0
- package/dist/{chunk-5ZGHUWTT.js → chunk-ZBDORYWM.js} +2 -2
- package/dist/{cli-jkmzdT8P.d.ts → cli-ClXRCu08.d.ts} +3 -3
- package/dist/cli.d.ts +6 -6
- package/dist/cli.js +26 -26
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +5 -5
- package/dist/connectors/codex-materialize-runner.js +5 -5
- package/dist/connectors/index.js +5 -5
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/contradiction/index.d.ts +1 -1
- package/dist/corpus-watermark.js +7 -7
- package/dist/entity-retrieval.d.ts +1 -1
- package/dist/entity-retrieval.js +5 -5
- package/dist/explicit-capture.d.ts +4 -4
- package/dist/extraction.js +5 -5
- package/dist/index.d.ts +398 -398
- package/dist/index.js +31 -31
- package/dist/maintenance/memory-governance.js +5 -5
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +1 -1
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +5 -5
- package/dist/maintenance/rebuild-memory-projection.d.ts +17 -10
- package/dist/maintenance/rebuild-memory-projection.js +6 -6
- package/dist/{maintenance-Ha9Dg93M.d.ts → maintenance-Dsvprbod.d.ts} +1 -1
- package/dist/mcp-memory-inspector-app.d.ts +5 -5
- package/dist/memory-lifecycle-ledger-utils.d.ts +8 -1
- package/dist/memory-lifecycle-ledger-utils.js +5 -1
- package/dist/memory-worth-outcomes.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +1 -1
- package/dist/namespaces/migrate.js +6 -6
- package/dist/namespaces/storage.d.ts +1 -1
- package/dist/namespaces/storage.js +5 -5
- package/dist/offline-sync-impression-drain.js +5 -3
- package/dist/operator-doctor-corpus.js +8 -8
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +11 -11
- package/dist/orchestration/compression-guideline-coordinator.d.ts +1 -1
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +10 -10
- package/dist/{orchestrator-DV_u9bfx.d.ts → orchestrator-CEhod0MJ.d.ts} +3 -3
- package/dist/orchestrator.d.ts +4 -4
- package/dist/orchestrator.js +31 -31
- package/dist/schemas.d.ts +76 -76
- package/dist/semantic-consolidation.js +6 -6
- package/dist/semantic-rule-promotion.js +5 -5
- package/dist/semantic-rule-verifier.js +5 -5
- package/dist/{service-JxXXY-Eh.d.ts → service-BlOfGid8.d.ts} +1 -1
- package/dist/shared-context/manager.d.ts +8 -8
- package/dist/source-agent-qualifier.js +5 -5
- package/dist/{storage-BbH4HDUS.d.ts → storage-CNKZocJF.d.ts} +1 -1
- package/dist/storage-guards.d.ts +9 -2
- package/dist/storage-guards.js +3 -1
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +4 -4
- package/dist/temporal-supersession.d.ts +1 -1
- package/dist/tier-migration.d.ts +1 -1
- package/dist/transfer/types.d.ts +66 -66
- package/dist/verified-recall.js +5 -5
- package/package.json +2 -2
- package/src/maintenance/projection-support.ts +192 -1
- package/src/maintenance/rebuild-memory-lifecycle-ledger.ts +5 -16
- package/src/maintenance/rebuild-memory-projection.ts +28 -60
- package/src/memory-lifecycle-ledger-utils.ts +21 -0
- package/src/orchestration/maintenance.test.ts +30 -0
- package/src/storage/memory-lifecycle-ledger-access.ts +198 -1
- package/src/storage/secure-line-reader.ts +3 -1
- package/src/storage-guards.ts +28 -7
- package/src/storage-memory-lifecycle-ledger.test.ts +291 -1
- package/src/storage.ts +11 -21
- package/dist/chunk-DKKZ6SO2.js.map +0 -1
- package/dist/chunk-HKF5VASQ.js.map +0 -1
- package/dist/chunk-ILGC6JH6.js.map +0 -1
- package/dist/chunk-NBAEGFXT.js.map +0 -1
- package/dist/chunk-Q3CVY7LV.js.map +0 -1
- package/dist/chunk-T3FVAHM7.js.map +0 -1
- /package/dist/{chunk-POQGCS4H.js.map → chunk-4CSTEPFA.js.map} +0 -0
- /package/dist/{chunk-XBJC7RTW.js.map → chunk-5JUYBWJD.js.map} +0 -0
- /package/dist/{chunk-6D5D5A4M.js.map → chunk-7ERHAARG.js.map} +0 -0
- /package/dist/{chunk-RMOSIGGI.js.map → chunk-7OCTH7AJ.js.map} +0 -0
- /package/dist/{chunk-FE7MUX7M.js.map → chunk-AL73FWSS.js.map} +0 -0
- /package/dist/{chunk-6TF4M2LB.js.map → chunk-AVGTOOYP.js.map} +0 -0
- /package/dist/{chunk-XEM77GGX.js.map → chunk-BVJIAIB3.js.map} +0 -0
- /package/dist/{chunk-PRP3M5Y3.js.map → chunk-CMFUYOYB.js.map} +0 -0
- /package/dist/{chunk-AF4HOJMH.js.map → chunk-CNZLKQEL.js.map} +0 -0
- /package/dist/{chunk-YVMVVE4B.js.map → chunk-CPD6C6K6.js.map} +0 -0
- /package/dist/{chunk-P2NCTIKE.js.map → chunk-CYM2PHLB.js.map} +0 -0
- /package/dist/{chunk-RY2XZTFN.js.map → chunk-DJH35IVS.js.map} +0 -0
- /package/dist/{chunk-IJAQCBGV.js.map → chunk-F5EVTFQK.js.map} +0 -0
- /package/dist/{chunk-RY7CHVGE.js.map → chunk-G57BGHQ2.js.map} +0 -0
- /package/dist/{chunk-IMEXE4XS.js.map → chunk-GYGXKATH.js.map} +0 -0
- /package/dist/{chunk-C3HUHJ4G.js.map → chunk-JKTHT4KX.js.map} +0 -0
- /package/dist/{chunk-44SRDUI4.js.map → chunk-KJP2R5MJ.js.map} +0 -0
- /package/dist/{chunk-UBWOCQ3I.js.map → chunk-MHCRASVK.js.map} +0 -0
- /package/dist/{chunk-PYTUBWAS.js.map → chunk-UGAZILZG.js.map} +0 -0
- /package/dist/{chunk-4TAD3B56.js.map → chunk-VGK33D3K.js.map} +0 -0
- /package/dist/{chunk-BGLDKAYY.js.map → chunk-VK33JSBR.js.map} +0 -0
- /package/dist/{chunk-WET4M3R6.js.map → chunk-XSPD6KQL.js.map} +0 -0
- /package/dist/{chunk-HUS2XN3T.js.map → chunk-YFHMW37V.js.map} +0 -0
- /package/dist/{chunk-5ZGHUWTT.js.map → chunk-ZBDORYWM.js.map} +0 -0
package/dist/access-service.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AccessProfilingReportRequest, a as AccessProfilingReportResponse, C as CodingScopedWriteInput, S as ENGRAM_ACCESS_WRITE_SCHEMA_VERSION, T as EngramAccessActionConfidenceRequest, U as EngramAccessActionConfidenceResponse, n as EngramAccessBriefingRequest, o as EngramAccessBriefingResponse, b as EngramAccessCapsuleListResponse, V as EngramAccessDaySummaryRequest, W as EngramAccessEntityListResponse, X as EngramAccessEntityResponse, Y as EngramAccessEntitySummary, d as EngramAccessExtractionForceFlushRequest, e as EngramAccessExtractionForceFlushResponse, O as EngramAccessLcmCompactionFlushRequest, g as EngramAccessLcmCompactionFlushResponse, Z as EngramAccessLcmCompactionRecordRequest, h as EngramAccessLcmCompactionRecordResponse, i as EngramAccessLcmSearchRequest, j as EngramAccessLcmSearchResponse, _ as EngramAccessLcmStatusResponse, $ as EngramAccessMaintenanceResponse, a0 as EngramAccessMemoryBrowseRequest, a1 as EngramAccessMemoryBrowseResponse, a2 as EngramAccessMemoryRecord, x as EngramAccessMemoryResponse, l as EngramAccessMemoryStoreRequest, G as EngramAccessMemorySummary, a3 as EngramAccessObserveMessage, q as EngramAccessObserveRequest, r as EngramAccessObserveResponse, a4 as EngramAccessOfflineSyncApplyFileContentRequest, a5 as EngramAccessOfflineSyncApplyFileContentResponse, a6 as EngramAccessOfflineSyncApplyRequest, a7 as EngramAccessOfflineSyncApplyResponse, a8 as EngramAccessOfflineSyncFileContentRequest, a9 as EngramAccessOfflineSyncFileContentResponse, aa as EngramAccessOfflineSyncFilesRequest, ab as EngramAccessOfflineSyncFilesResponse, ac as EngramAccessOfflineSyncSnapshotRequest, ad as EngramAccessOfflineSyncSnapshotResponse, ae as EngramAccessOfflineSyncSnapshotStreamResponse, af as EngramAccessQualityResponse, ag as EngramAccessRecallExplainRequest, ah as EngramAccessRecallExplainResponse, F as EngramAccessRecallRequest, B as EngramAccessRecallResponse, ai as EngramAccessReviewDispositionRequest, aj as EngramAccessReviewDispositionResponse, E as EngramAccessReviewQueueResponse, ak as EngramAccessScopeDebug, f as EngramAccessService, H as EngramAccessSetCodingContextRequest, m as EngramAccessSuggestionSubmitRequest, al as EngramAccessTimelineResponse, am as EngramAccessTrustZoneBrowseRequest, an as EngramAccessTrustZoneBrowseResponse, ao as EngramAccessTrustZoneDemoSeedRequest, ap as EngramAccessTrustZoneDemoSeedResponse, aq as EngramAccessTrustZonePromoteRequest, ar as EngramAccessTrustZonePromoteResponse, as as EngramAccessTrustZoneRecordSummary, at as EngramAccessTrustZoneStatusResponse, au as EngramAccessWriteEnvelope, p as EngramAccessWriteResponse, k as MemoryScopePlan, av as buildProjectedGovernanceProposedActions, aw as hasGroupedGovernanceActions, ax as shapeMemorySummary } from './access-service-
|
|
2
|
-
import './storage-
|
|
1
|
+
export { A as AccessProfilingReportRequest, a as AccessProfilingReportResponse, C as CodingScopedWriteInput, S as ENGRAM_ACCESS_WRITE_SCHEMA_VERSION, T as EngramAccessActionConfidenceRequest, U as EngramAccessActionConfidenceResponse, n as EngramAccessBriefingRequest, o as EngramAccessBriefingResponse, b as EngramAccessCapsuleListResponse, V as EngramAccessDaySummaryRequest, W as EngramAccessEntityListResponse, X as EngramAccessEntityResponse, Y as EngramAccessEntitySummary, d as EngramAccessExtractionForceFlushRequest, e as EngramAccessExtractionForceFlushResponse, O as EngramAccessLcmCompactionFlushRequest, g as EngramAccessLcmCompactionFlushResponse, Z as EngramAccessLcmCompactionRecordRequest, h as EngramAccessLcmCompactionRecordResponse, i as EngramAccessLcmSearchRequest, j as EngramAccessLcmSearchResponse, _ as EngramAccessLcmStatusResponse, $ as EngramAccessMaintenanceResponse, a0 as EngramAccessMemoryBrowseRequest, a1 as EngramAccessMemoryBrowseResponse, a2 as EngramAccessMemoryRecord, x as EngramAccessMemoryResponse, l as EngramAccessMemoryStoreRequest, G as EngramAccessMemorySummary, a3 as EngramAccessObserveMessage, q as EngramAccessObserveRequest, r as EngramAccessObserveResponse, a4 as EngramAccessOfflineSyncApplyFileContentRequest, a5 as EngramAccessOfflineSyncApplyFileContentResponse, a6 as EngramAccessOfflineSyncApplyRequest, a7 as EngramAccessOfflineSyncApplyResponse, a8 as EngramAccessOfflineSyncFileContentRequest, a9 as EngramAccessOfflineSyncFileContentResponse, aa as EngramAccessOfflineSyncFilesRequest, ab as EngramAccessOfflineSyncFilesResponse, ac as EngramAccessOfflineSyncSnapshotRequest, ad as EngramAccessOfflineSyncSnapshotResponse, ae as EngramAccessOfflineSyncSnapshotStreamResponse, af as EngramAccessQualityResponse, ag as EngramAccessRecallExplainRequest, ah as EngramAccessRecallExplainResponse, F as EngramAccessRecallRequest, B as EngramAccessRecallResponse, ai as EngramAccessReviewDispositionRequest, aj as EngramAccessReviewDispositionResponse, E as EngramAccessReviewQueueResponse, ak as EngramAccessScopeDebug, f as EngramAccessService, H as EngramAccessSetCodingContextRequest, m as EngramAccessSuggestionSubmitRequest, al as EngramAccessTimelineResponse, am as EngramAccessTrustZoneBrowseRequest, an as EngramAccessTrustZoneBrowseResponse, ao as EngramAccessTrustZoneDemoSeedRequest, ap as EngramAccessTrustZoneDemoSeedResponse, aq as EngramAccessTrustZonePromoteRequest, ar as EngramAccessTrustZonePromoteResponse, as as EngramAccessTrustZoneRecordSummary, at as EngramAccessTrustZoneStatusResponse, au as EngramAccessWriteEnvelope, p as EngramAccessWriteResponse, k as MemoryScopePlan, av as buildProjectedGovernanceProposedActions, aw as hasGroupedGovernanceActions, ax as shapeMemorySummary } from './access-service-C6QuKBCG.js';
|
|
2
|
+
import './storage-CNKZocJF.js';
|
|
3
3
|
import './types-B1VHaf2w.js';
|
|
4
4
|
import './recall-explain-renderer.js';
|
|
5
5
|
import './types-5398p7Zm.js';
|
|
@@ -7,12 +7,12 @@ import './access-citation.js';
|
|
|
7
7
|
import './resolve-auth-token.js';
|
|
8
8
|
export { EngramAccessHealthResponse, EngramAccessQmdCollectionState, EngramAccessQmdHealthResponse } from './access-health-types.js';
|
|
9
9
|
import './recall-audit-anomaly.js';
|
|
10
|
-
import './orchestrator-
|
|
10
|
+
import './orchestrator-CEhod0MJ.js';
|
|
11
11
|
import './explicit-capture.js';
|
|
12
12
|
import './cross-namespace-budget.js';
|
|
13
13
|
import './maintenance/memory-governance.js';
|
|
14
14
|
import './live-connectors-runner.js';
|
|
15
|
-
import './service-
|
|
15
|
+
import './service-BlOfGid8.js';
|
|
16
16
|
export { WearablesMeetingsScope } from './access-wearables-meetings-surface.js';
|
|
17
17
|
import './scope-profiles-C4zY-a2K.js';
|
|
18
18
|
export { E as EngramAccessNamespaceWritableRequest } from './access-namespace-preflight-CWyL4Zai.js';
|
|
@@ -61,7 +61,7 @@ import './resolve-provider-secret.js';
|
|
|
61
61
|
import './transcript.js';
|
|
62
62
|
import './session-integrity.js';
|
|
63
63
|
import './summarizer.js';
|
|
64
|
-
import './maintenance-
|
|
64
|
+
import './maintenance-Dsvprbod.js';
|
|
65
65
|
import './namespaces/search.js';
|
|
66
66
|
import './compounding/engine.js';
|
|
67
67
|
import './shared-context/manager.js';
|
package/dist/access-service.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
buildProjectedGovernanceProposedActions,
|
|
5
5
|
hasGroupedGovernanceActions,
|
|
6
6
|
shapeMemorySummary
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BVJIAIB3.js";
|
|
8
8
|
import "./chunk-GDASG7NC.js";
|
|
9
9
|
import "./chunk-GDB4J2H3.js";
|
|
10
10
|
import "./chunk-3CE77VAP.js";
|
|
@@ -20,11 +20,11 @@ import "./chunk-MYXWPG5O.js";
|
|
|
20
20
|
import "./chunk-SOBJ6NEY.js";
|
|
21
21
|
import "./chunk-KWU6MAD4.js";
|
|
22
22
|
import "./chunk-AHVEHR6K.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-MHCRASVK.js";
|
|
24
24
|
import "./chunk-ICP53SKG.js";
|
|
25
25
|
import "./chunk-AQEJKOKI.js";
|
|
26
26
|
import "./chunk-6HMYUWXR.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-YFHMW37V.js";
|
|
28
28
|
import "./chunk-R6YJI3HE.js";
|
|
29
29
|
import "./chunk-ULARSG5Z.js";
|
|
30
30
|
import "./chunk-XOQSEF7X.js";
|
|
@@ -39,8 +39,8 @@ import "./chunk-NLE6TSLG.js";
|
|
|
39
39
|
import "./chunk-QDW3E4RD.js";
|
|
40
40
|
import "./chunk-Q53RLEW7.js";
|
|
41
41
|
import "./chunk-C37ZRXX7.js";
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-VK33JSBR.js";
|
|
43
|
+
import "./chunk-G57BGHQ2.js";
|
|
44
44
|
import "./chunk-IOQFPVGY.js";
|
|
45
45
|
import "./chunk-UZQCNOPS.js";
|
|
46
46
|
import "./chunk-ES36HTSC.js";
|
|
@@ -51,7 +51,7 @@ import "./chunk-S2BBISHU.js";
|
|
|
51
51
|
import "./chunk-W7IGLX4G.js";
|
|
52
52
|
import "./chunk-CINZGPSJ.js";
|
|
53
53
|
import "./chunk-CYEPCZN5.js";
|
|
54
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-UGAZILZG.js";
|
|
55
55
|
import "./chunk-LEPOP46W.js";
|
|
56
56
|
import "./chunk-72A4L5JJ.js";
|
|
57
57
|
import "./chunk-A7Q43EUZ.js";
|
|
@@ -71,20 +71,20 @@ import "./chunk-64UDOIMI.js";
|
|
|
71
71
|
import "./chunk-O75CRYGF.js";
|
|
72
72
|
import "./chunk-OD4FM2U7.js";
|
|
73
73
|
import "./chunk-ZY2MNJR6.js";
|
|
74
|
-
import "./chunk-
|
|
74
|
+
import "./chunk-ZBDORYWM.js";
|
|
75
75
|
import "./chunk-KSXJOC4F.js";
|
|
76
76
|
import "./chunk-NRV4Y3PM.js";
|
|
77
|
-
import "./chunk-
|
|
78
|
-
import "./chunk-
|
|
77
|
+
import "./chunk-AVGTOOYP.js";
|
|
78
|
+
import "./chunk-ENLZOWYK.js";
|
|
79
79
|
import "./chunk-UHVXE24Y.js";
|
|
80
80
|
import "./chunk-ENTCVTQR.js";
|
|
81
81
|
import "./chunk-WIPEXG6R.js";
|
|
82
|
-
import "./chunk-HKF5VASQ.js";
|
|
83
82
|
import "./chunk-J6A3CX5N.js";
|
|
84
83
|
import "./chunk-HXDWZFNP.js";
|
|
85
|
-
import "./chunk-
|
|
84
|
+
import "./chunk-4VXGRIH6.js";
|
|
86
85
|
import "./chunk-EGGE52UU.js";
|
|
87
|
-
import "./chunk-
|
|
86
|
+
import "./chunk-ZA53AZND.js";
|
|
87
|
+
import "./chunk-7RJUVTVF.js";
|
|
88
88
|
import "./chunk-SCU65EZI.js";
|
|
89
89
|
import "./chunk-WRJVB3C2.js";
|
|
90
90
|
import "./chunk-GCASGYIO.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OperationName } from './access-boundary.js';
|
|
2
2
|
import 'zod';
|
|
3
|
-
import './access-service-
|
|
3
|
+
import './access-service-C6QuKBCG.js';
|
|
4
4
|
import './catalog-Du4bpZWM.js';
|
|
5
5
|
import './types-5398p7Zm.js';
|
|
6
6
|
import './message-parts/index.js';
|
|
@@ -11,7 +11,7 @@ import './access-namespace-preflight-CWyL4Zai.js';
|
|
|
11
11
|
import './access-token-capabilities.js';
|
|
12
12
|
import 'node:async_hooks';
|
|
13
13
|
import './scope-profiles-C4zY-a2K.js';
|
|
14
|
-
import './storage-
|
|
14
|
+
import './storage-CNKZocJF.js';
|
|
15
15
|
import './entity-id-normalization.js';
|
|
16
16
|
import './page-versioning.js';
|
|
17
17
|
import './consolidation-operator.js';
|
|
@@ -36,7 +36,7 @@ import './corpus-watermark.js';
|
|
|
36
36
|
import './replica-divergence.js';
|
|
37
37
|
import './recall-audit-anomaly.js';
|
|
38
38
|
import './recall-audit.js';
|
|
39
|
-
import './orchestrator-
|
|
39
|
+
import './orchestrator-CEhod0MJ.js';
|
|
40
40
|
import './briefing.js';
|
|
41
41
|
import './buffer.js';
|
|
42
42
|
import './extraction-faithfulness.js';
|
|
@@ -47,7 +47,7 @@ import './resolve-provider-secret.js';
|
|
|
47
47
|
import './transcript.js';
|
|
48
48
|
import './session-integrity.js';
|
|
49
49
|
import './summarizer.js';
|
|
50
|
-
import './maintenance-
|
|
50
|
+
import './maintenance-Dsvprbod.js';
|
|
51
51
|
import './namespaces/search.js';
|
|
52
52
|
import './compounding/engine.js';
|
|
53
53
|
import './shared-context/manager.js';
|
|
@@ -91,7 +91,7 @@ import './negative.js';
|
|
|
91
91
|
import './session-observer-state.js';
|
|
92
92
|
import './semantic-TddhF0y7.js';
|
|
93
93
|
import './replay/types.js';
|
|
94
|
-
import './service-
|
|
94
|
+
import './service-BlOfGid8.js';
|
|
95
95
|
import './extraction-judge.js';
|
|
96
96
|
import './lcm/engine.js';
|
|
97
97
|
import './lcm/archive.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { W as WearablesService, M as MeetingsService, a as MeetingsDayBuildSummary, b as MeetingsGetResult, c as MeetingsListResult } from './service-
|
|
1
|
+
import { W as WearablesService, M as MeetingsService, a as MeetingsDayBuildSummary, b as MeetingsGetResult, c as MeetingsListResult } from './service-BlOfGid8.js';
|
|
2
2
|
import './types-5398p7Zm.js';
|
|
3
3
|
import './message-parts/index.js';
|
|
4
4
|
import './bounded-jsonl-state.js';
|
|
5
5
|
import './operator-doctor-types.js';
|
|
6
6
|
import './types-continuity.js';
|
|
7
|
-
import './storage-
|
|
7
|
+
import './storage-CNKZocJF.js';
|
|
8
8
|
import './entity-id-normalization.js';
|
|
9
9
|
import './page-versioning.js';
|
|
10
10
|
import './consolidation-operator.js';
|
package/dist/bootstrap.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as PluginConfig } from './types-5398p7Zm.js';
|
|
2
|
-
import { O as Orchestrator } from './orchestrator-
|
|
2
|
+
import { O as Orchestrator } from './orchestrator-CEhod0MJ.js';
|
|
3
3
|
import './message-parts/index.js';
|
|
4
4
|
import './bounded-jsonl-state.js';
|
|
5
5
|
import './operator-doctor-types.js';
|
|
@@ -8,7 +8,7 @@ import './recall-state.js';
|
|
|
8
8
|
import './utils/serialize-mutations.js';
|
|
9
9
|
import './search/port.js';
|
|
10
10
|
import './briefing.js';
|
|
11
|
-
import './storage-
|
|
11
|
+
import './storage-CNKZocJF.js';
|
|
12
12
|
import './entity-id-normalization.js';
|
|
13
13
|
import './page-versioning.js';
|
|
14
14
|
import './consolidation-operator.js';
|
|
@@ -27,7 +27,7 @@ import './resolve-provider-secret.js';
|
|
|
27
27
|
import './transcript.js';
|
|
28
28
|
import './session-integrity.js';
|
|
29
29
|
import './summarizer.js';
|
|
30
|
-
import './maintenance-
|
|
30
|
+
import './maintenance-Dsvprbod.js';
|
|
31
31
|
import './catalog-Du4bpZWM.js';
|
|
32
32
|
import './namespaces/search.js';
|
|
33
33
|
import './compounding/engine.js';
|
|
@@ -77,7 +77,7 @@ import './negative.js';
|
|
|
77
77
|
import './session-observer-state.js';
|
|
78
78
|
import './semantic-TddhF0y7.js';
|
|
79
79
|
import './replay/types.js';
|
|
80
|
-
import './service-
|
|
80
|
+
import './service-BlOfGid8.js';
|
|
81
81
|
import './extraction-judge.js';
|
|
82
82
|
import './lcm/engine.js';
|
|
83
83
|
import './lcm/archive.js';
|
package/dist/briefing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as StorageManager } from './storage-
|
|
1
|
+
import { S as StorageManager } from './storage-CNKZocJF.js';
|
|
2
2
|
import { B as BriefingSections, d as BriefingFollowup, e as BriefingFocus, C as CalendarSource, f as CalendarEvent, M as MemoryFile, g as BriefingActiveThread, h as BriefingResult, E as EntityFile, i as BriefingRecentEntity } from './types-5398p7Zm.js';
|
|
3
3
|
import './entity-id-normalization.js';
|
|
4
4
|
import './page-versioning.js';
|
package/dist/briefing.js
CHANGED
|
@@ -17,17 +17,17 @@ import {
|
|
|
17
17
|
renderBriefingMarkdown,
|
|
18
18
|
resolveBriefingSaveDir,
|
|
19
19
|
validateBriefingFormat
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-AVGTOOYP.js";
|
|
21
|
+
import "./chunk-ENLZOWYK.js";
|
|
22
22
|
import "./chunk-UHVXE24Y.js";
|
|
23
23
|
import "./chunk-ENTCVTQR.js";
|
|
24
24
|
import "./chunk-WIPEXG6R.js";
|
|
25
|
-
import "./chunk-HKF5VASQ.js";
|
|
26
25
|
import "./chunk-J6A3CX5N.js";
|
|
27
26
|
import "./chunk-HXDWZFNP.js";
|
|
28
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-4VXGRIH6.js";
|
|
29
28
|
import "./chunk-EGGE52UU.js";
|
|
30
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-ZA53AZND.js";
|
|
30
|
+
import "./chunk-7RJUVTVF.js";
|
|
31
31
|
import "./chunk-SCU65EZI.js";
|
|
32
32
|
import "./chunk-WRJVB3C2.js";
|
|
33
33
|
import "./chunk-GCASGYIO.js";
|
package/dist/buffer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as StorageManager } from './storage-
|
|
1
|
+
import { S as StorageManager } from './storage-CNKZocJF.js';
|
|
2
2
|
import { P as PluginConfig, j as BufferTurn, k as ExtractionBufferSnapshot } from './types-5398p7Zm.js';
|
|
3
3
|
import './entity-id-normalization.js';
|
|
4
4
|
import './page-versioning.js';
|
|
@@ -4,26 +4,26 @@ import {
|
|
|
4
4
|
} from "./chunk-MU7ZHSZE.js";
|
|
5
5
|
import {
|
|
6
6
|
buildExtensionsBlockForConsolidation
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AL73FWSS.js";
|
|
8
8
|
import "./chunk-JLNBQWZ2.js";
|
|
9
9
|
import "./chunk-B7RWBZXW.js";
|
|
10
10
|
import {
|
|
11
11
|
runPostConsolidationMaterialize
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZBDORYWM.js";
|
|
13
13
|
import "./chunk-KSXJOC4F.js";
|
|
14
14
|
import {
|
|
15
15
|
resolveCausalTrajectoryStoreDir
|
|
16
16
|
} from "./chunk-NRV4Y3PM.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-ENLZOWYK.js";
|
|
18
18
|
import "./chunk-UHVXE24Y.js";
|
|
19
19
|
import "./chunk-ENTCVTQR.js";
|
|
20
20
|
import "./chunk-WIPEXG6R.js";
|
|
21
|
-
import "./chunk-HKF5VASQ.js";
|
|
22
21
|
import "./chunk-J6A3CX5N.js";
|
|
23
22
|
import "./chunk-HXDWZFNP.js";
|
|
24
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-4VXGRIH6.js";
|
|
25
24
|
import "./chunk-EGGE52UU.js";
|
|
26
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-ZA53AZND.js";
|
|
26
|
+
import "./chunk-7RJUVTVF.js";
|
|
27
27
|
import "./chunk-SCU65EZI.js";
|
|
28
28
|
import "./chunk-WRJVB3C2.js";
|
|
29
29
|
import "./chunk-GCASGYIO.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-IKKWIPYN.js";
|
|
23
23
|
import {
|
|
24
24
|
getOperation
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-BVJIAIB3.js";
|
|
26
26
|
import {
|
|
27
27
|
assertOperationAllowed,
|
|
28
28
|
capabilityAllowsOp,
|
|
@@ -3755,4 +3755,4 @@ export {
|
|
|
3755
3755
|
MCP_SUPPORTED_PROTOCOL_VERSIONS,
|
|
3756
3756
|
EngramMcpServer
|
|
3757
3757
|
};
|
|
3758
|
-
//# sourceMappingURL=chunk-
|
|
3758
|
+
//# sourceMappingURL=chunk-4CSTEPFA.js.map
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
warnProjectionFallback
|
|
3
|
+
} from "./chunk-ZA53AZND.js";
|
|
1
4
|
import {
|
|
2
5
|
MEMORY_LIFECYCLE_LEDGER_APPEND_LOCK_MAX_WAIT_MS,
|
|
3
6
|
MEMORY_LIFECYCLE_LEDGER_LOCK_STALE_MS,
|
|
4
7
|
compareMemoryLifecycleEvents,
|
|
8
|
+
isFrontmatterDerivedLifecycleEventType,
|
|
9
|
+
memoryLifecycleEventProjectionIdentity,
|
|
5
10
|
memoryLifecycleLedgerLockPath,
|
|
6
11
|
sortMemoryLifecycleEvents
|
|
7
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7RJUVTVF.js";
|
|
8
13
|
import {
|
|
9
14
|
ensureContainedSpillDir,
|
|
10
15
|
listContainedSpillFiles
|
|
11
16
|
} from "./chunk-GCASGYIO.js";
|
|
17
|
+
import {
|
|
18
|
+
getMemoryProjectionPath,
|
|
19
|
+
openProjectionReadonly,
|
|
20
|
+
readProjectedEntityMentions,
|
|
21
|
+
readProjectedGovernanceRecord,
|
|
22
|
+
readProjectedNativeKnowledgeChunks
|
|
23
|
+
} from "./chunk-3CSX3ETE.js";
|
|
12
24
|
import {
|
|
13
25
|
displayErrorDetail
|
|
14
26
|
} from "./chunk-RL6NEVXT.js";
|
|
@@ -24,6 +36,135 @@ import {
|
|
|
24
36
|
isErrnoCode
|
|
25
37
|
} from "./chunk-5UZXUTVO.js";
|
|
26
38
|
|
|
39
|
+
// src/maintenance/projection-support.ts
|
|
40
|
+
import path from "path";
|
|
41
|
+
function readProjectionRebuiltAt(memoryDir) {
|
|
42
|
+
const db = openProjectionReadonly(memoryDir);
|
|
43
|
+
if (!db) return null;
|
|
44
|
+
try {
|
|
45
|
+
const row = db.prepare("SELECT value FROM meta WHERE key = 'rebuiltAt'").get();
|
|
46
|
+
return typeof row?.value === "string" && row.value.length > 0 ? row.value : null;
|
|
47
|
+
} catch {
|
|
48
|
+
return null;
|
|
49
|
+
} finally {
|
|
50
|
+
db.close();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function formatProjectionAge(rebuiltAt) {
|
|
54
|
+
if (!rebuiltAt) return "projection never rebuilt";
|
|
55
|
+
const ageMs = Date.now() - Date.parse(rebuiltAt);
|
|
56
|
+
if (!Number.isFinite(ageMs)) return `projection rebuiltAt=${rebuiltAt}`;
|
|
57
|
+
const ageMin = Math.max(0, Math.round(ageMs / 6e4));
|
|
58
|
+
const age = ageMin >= 120 ? `${Math.round(ageMin / 60)}h` : `${ageMin}m`;
|
|
59
|
+
return `projection ${age} stale, last rebuilt ${rebuiltAt}`;
|
|
60
|
+
}
|
|
61
|
+
function readProjectionHighWaterFromDb(db) {
|
|
62
|
+
const sourceRow = db.prepare(
|
|
63
|
+
"SELECT value FROM meta WHERE key = 'sourceLifecycleLedgerEventCount'"
|
|
64
|
+
).get();
|
|
65
|
+
const projectedRow = db.prepare(
|
|
66
|
+
"SELECT value FROM meta WHERE key = 'projectedLifecycleLedgerEventCount'"
|
|
67
|
+
).get();
|
|
68
|
+
if (typeof sourceRow?.value !== "string" || !/^\d+$/.test(sourceRow.value) || typeof projectedRow?.value !== "string" || !/^\d+$/.test(projectedRow.value)) return null;
|
|
69
|
+
const sourceEventCount = Number(sourceRow.value);
|
|
70
|
+
const eventCount = Number(projectedRow.value);
|
|
71
|
+
if (!Number.isSafeInteger(sourceEventCount) || !Number.isSafeInteger(eventCount)) return null;
|
|
72
|
+
return { eventCount, sourceEventCount };
|
|
73
|
+
}
|
|
74
|
+
function openProjectionLifecycleLedgerLagTracker(memoryDir) {
|
|
75
|
+
const db = openProjectionReadonly(memoryDir);
|
|
76
|
+
if (!db) return null;
|
|
77
|
+
try {
|
|
78
|
+
const highWater = readProjectionHighWaterFromDb(db);
|
|
79
|
+
if (!highWater) {
|
|
80
|
+
db.close();
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
db.pragma("temp_store = FILE");
|
|
84
|
+
db.exec(`
|
|
85
|
+
CREATE TEMP TABLE projection_lag_current_identity (
|
|
86
|
+
identity TEXT PRIMARY KEY
|
|
87
|
+
) WITHOUT ROWID;
|
|
88
|
+
`);
|
|
89
|
+
db.pragma("temp.cache_size = -1024");
|
|
90
|
+
const insertCurrent = db.prepare(
|
|
91
|
+
"INSERT OR IGNORE INTO projection_lag_current_identity(identity) VALUES (?)"
|
|
92
|
+
);
|
|
93
|
+
const findProjectedEvent = db.prepare(
|
|
94
|
+
"SELECT 1 FROM memory_timeline WHERE event_id = ? LIMIT 1"
|
|
95
|
+
);
|
|
96
|
+
const findProjectedFrontmatterEvent = db.prepare(`
|
|
97
|
+
SELECT 1
|
|
98
|
+
FROM memory_timeline
|
|
99
|
+
WHERE memory_id = ? AND event_type = ? AND timestamp = ?
|
|
100
|
+
LIMIT 1
|
|
101
|
+
`);
|
|
102
|
+
return {
|
|
103
|
+
highWater,
|
|
104
|
+
record(event) {
|
|
105
|
+
if (!event.memoryId.trim()) return { unique: false, projected: false };
|
|
106
|
+
const identity = memoryLifecycleEventProjectionIdentity(event);
|
|
107
|
+
const inserted = insertCurrent.run(identity);
|
|
108
|
+
if (inserted.changes === 0) return { unique: false, projected: false };
|
|
109
|
+
const projected = isFrontmatterDerivedLifecycleEventType(event.eventType) ? findProjectedFrontmatterEvent.get(event.memoryId, event.eventType, event.timestamp) : findProjectedEvent.get(event.eventId);
|
|
110
|
+
return { unique: true, projected: projected !== void 0 };
|
|
111
|
+
},
|
|
112
|
+
close: () => db.close()
|
|
113
|
+
};
|
|
114
|
+
} catch {
|
|
115
|
+
db.close();
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function writeProjectionMetaHighWater(insertMeta, sourceLifecycleLedgerEventCount, timelineRows) {
|
|
120
|
+
insertMeta.run("sourceLifecycleLedgerEventCount", String(sourceLifecycleLedgerEventCount));
|
|
121
|
+
insertMeta.run(
|
|
122
|
+
"projectedLifecycleLedgerEventCount",
|
|
123
|
+
String(new Set(timelineRows.map(memoryLifecycleEventProjectionIdentity)).size)
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
function readProjectedEntityMentionRows(memoryDir) {
|
|
127
|
+
const rows = readProjectedEntityMentions(memoryDir);
|
|
128
|
+
if (rows === null) return { projectionExists: false, rows: [] };
|
|
129
|
+
return { projectionExists: true, rows };
|
|
130
|
+
}
|
|
131
|
+
function readProjectedNativeKnowledgeRows(memoryDir) {
|
|
132
|
+
const rows = readProjectedNativeKnowledgeChunks(memoryDir);
|
|
133
|
+
if (rows === null) return { projectionExists: false, rows: [] };
|
|
134
|
+
return { projectionExists: true, rows };
|
|
135
|
+
}
|
|
136
|
+
function readProjectedGovernanceRows(memoryDir) {
|
|
137
|
+
const record = readProjectedGovernanceRecord(memoryDir);
|
|
138
|
+
if (record === null) {
|
|
139
|
+
return {
|
|
140
|
+
projectionExists: false,
|
|
141
|
+
runId: null,
|
|
142
|
+
summary: void 0,
|
|
143
|
+
metrics: void 0,
|
|
144
|
+
reviewQueueRows: [],
|
|
145
|
+
appliedActionRows: [],
|
|
146
|
+
report: ""
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
projectionExists: true,
|
|
151
|
+
runId: record.runId,
|
|
152
|
+
summary: record.summary,
|
|
153
|
+
metrics: record.metrics,
|
|
154
|
+
reviewQueueRows: record.reviewQueueRows,
|
|
155
|
+
appliedActionRows: record.appliedActionRows,
|
|
156
|
+
report: record.report
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function assertInjectedStorageRooted(label, memoryDir, injected) {
|
|
160
|
+
if (injected && path.resolve(injected.dir) !== path.resolve(memoryDir)) {
|
|
161
|
+
throw new Error(
|
|
162
|
+
`${label}: storage.dir (${injected.dir}) must match memoryDir (${memoryDir})`
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
return injected;
|
|
166
|
+
}
|
|
167
|
+
|
|
27
168
|
// src/storage/secure-line-reader.ts
|
|
28
169
|
import { createReadStream } from "fs";
|
|
29
170
|
import { lstat, open } from "fs/promises";
|
|
@@ -149,7 +290,7 @@ var BoundedLifecycleTopN = class {
|
|
|
149
290
|
}
|
|
150
291
|
}
|
|
151
292
|
};
|
|
152
|
-
async function readMemoryLifecycleEventsFromLines(lines, limit, memoryId, compare) {
|
|
293
|
+
async function readMemoryLifecycleEventsFromLines(lines, limit, memoryId, compare, onEvent) {
|
|
153
294
|
if (limit <= 0) return [];
|
|
154
295
|
const top = compare ? new BoundedLifecycleTopN(limit, compare) : null;
|
|
155
296
|
const ring = [];
|
|
@@ -160,8 +301,9 @@ async function readMemoryLifecycleEventsFromLines(lines, limit, memoryId, compar
|
|
|
160
301
|
if (!line) continue;
|
|
161
302
|
try {
|
|
162
303
|
const parsed = JSON.parse(line);
|
|
163
|
-
if (memoryId !== void 0 && parsed.memoryId !== memoryId) continue;
|
|
164
304
|
if (!isValidLifecycleEventRow(parsed)) continue;
|
|
305
|
+
onEvent?.(parsed);
|
|
306
|
+
if (memoryId !== void 0 && parsed.memoryId !== memoryId) continue;
|
|
165
307
|
if (top) {
|
|
166
308
|
top.add(parsed, seq++);
|
|
167
309
|
} else if (ring.length < limit) {
|
|
@@ -178,9 +320,9 @@ async function readMemoryLifecycleEventsFromLines(lines, limit, memoryId, compar
|
|
|
178
320
|
}
|
|
179
321
|
|
|
180
322
|
// src/storage/memory-lifecycle-ledger-access.ts
|
|
181
|
-
import { rename, stat, unlink } from "fs/promises";
|
|
323
|
+
import { lstat as lstat2, rename, stat, unlink } from "fs/promises";
|
|
182
324
|
import { randomUUID } from "crypto";
|
|
183
|
-
import
|
|
325
|
+
import path2 from "path";
|
|
184
326
|
async function collectLifecycleEvents(lines) {
|
|
185
327
|
const out = [];
|
|
186
328
|
for await (const line of lines) {
|
|
@@ -254,6 +396,135 @@ async function readBoundedLifecycleEventsFromLedger(ledgerPath, readSecureFile,
|
|
|
254
396
|
return [];
|
|
255
397
|
}
|
|
256
398
|
}
|
|
399
|
+
async function readBoundedLifecycleEventsWithProjectionLag(ledgerPath, readSecureFile, limit, memoryId, tracker) {
|
|
400
|
+
let currentEventCount = 0;
|
|
401
|
+
let deltaEvents = 0;
|
|
402
|
+
let telemetryAvailable = true;
|
|
403
|
+
try {
|
|
404
|
+
const events = await readMemoryLifecycleEventsFromLines(
|
|
405
|
+
readMaybeEncryptedLines(
|
|
406
|
+
ledgerPath,
|
|
407
|
+
() => readSecureFile(ledgerPath),
|
|
408
|
+
STATE_FILE_MAX_DECRYPT_BYTES
|
|
409
|
+
),
|
|
410
|
+
Math.max(0, Math.floor(limit)),
|
|
411
|
+
memoryId,
|
|
412
|
+
compareMemoryLifecycleEvents,
|
|
413
|
+
(event) => {
|
|
414
|
+
if (!telemetryAvailable) return;
|
|
415
|
+
try {
|
|
416
|
+
const tracked = tracker.record(event);
|
|
417
|
+
if (!tracked.unique) return;
|
|
418
|
+
currentEventCount += 1;
|
|
419
|
+
if (!tracked.projected) deltaEvents += 1;
|
|
420
|
+
} catch {
|
|
421
|
+
telemetryAvailable = false;
|
|
422
|
+
currentEventCount = 0;
|
|
423
|
+
deltaEvents = 0;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
);
|
|
427
|
+
return { events, currentEventCount, deltaEvents, telemetryAvailable };
|
|
428
|
+
} catch (err) {
|
|
429
|
+
if (err instanceof SecureStoreLockedError) throw err;
|
|
430
|
+
if (!isErrnoCode(err, "ENOENT")) throw err;
|
|
431
|
+
return { events: [], currentEventCount: 0, deltaEvents: 0, telemetryAvailable: false };
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
async function probeProjectionLedgerIdentities(projectionPath, ledgerPath) {
|
|
435
|
+
try {
|
|
436
|
+
const [projectionIdentity, ledgerIdentity] = await Promise.all(
|
|
437
|
+
[projectionPath, ledgerPath].map(async (filePath) => {
|
|
438
|
+
try {
|
|
439
|
+
const file = await lstat2(filePath);
|
|
440
|
+
return `${file.dev}:${file.ino}:${file.size}:${file.mtimeMs}:${file.ctimeMs}`;
|
|
441
|
+
} catch (err) {
|
|
442
|
+
if (isErrnoCode(err, "ENOENT")) return "absent";
|
|
443
|
+
return null;
|
|
444
|
+
}
|
|
445
|
+
})
|
|
446
|
+
);
|
|
447
|
+
if (!projectionIdentity || !ledgerIdentity) return null;
|
|
448
|
+
return { projectionIdentity, ledgerIdentity };
|
|
449
|
+
} catch {
|
|
450
|
+
return null;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
var ProjectionLedgerLagManager = class {
|
|
454
|
+
lagCache = null;
|
|
455
|
+
lagInFlight = null;
|
|
456
|
+
async resolveTimelineWithLag(options) {
|
|
457
|
+
const { baseDir, ledgerPath, memoryId, cappedLimit, readSecureFile, projectionAge } = options;
|
|
458
|
+
const projectionPath = getMemoryProjectionPath(baseDir);
|
|
459
|
+
const identities = await probeProjectionLedgerIdentities(projectionPath, ledgerPath);
|
|
460
|
+
if (!identities) {
|
|
461
|
+
warnProjectionFallback(baseDir, "getMemoryTimeline", projectionAge);
|
|
462
|
+
return readBoundedLifecycleEventsFromLedger(ledgerPath, readSecureFile, cappedLimit, memoryId);
|
|
463
|
+
}
|
|
464
|
+
const { projectionIdentity, ledgerIdentity } = identities;
|
|
465
|
+
const generation = `${projectionIdentity}\0${ledgerIdentity}`;
|
|
466
|
+
const cachedLag = this.lagCache?.generation === generation ? this.lagCache.telemetry : null;
|
|
467
|
+
if (cachedLag) {
|
|
468
|
+
warnProjectionFallback(baseDir, "getMemoryTimeline", projectionAge, cachedLag);
|
|
469
|
+
return readBoundedLifecycleEventsFromLedger(ledgerPath, readSecureFile, cappedLimit, memoryId);
|
|
470
|
+
}
|
|
471
|
+
const inFlight = this.lagInFlight?.generation === generation ? this.lagInFlight.scan : null;
|
|
472
|
+
if (inFlight) {
|
|
473
|
+
const result = await inFlight;
|
|
474
|
+
if (result.telemetry) {
|
|
475
|
+
this.lagCache = { generation, telemetry: result.telemetry };
|
|
476
|
+
}
|
|
477
|
+
warnProjectionFallback(baseDir, "getMemoryTimeline", projectionAge, result.telemetry ?? void 0);
|
|
478
|
+
if (result.memoryId === memoryId && result.limit === cappedLimit) return result.events;
|
|
479
|
+
return readBoundedLifecycleEventsFromLedger(ledgerPath, readSecureFile, cappedLimit, memoryId);
|
|
480
|
+
}
|
|
481
|
+
const tracker = openProjectionLifecycleLedgerLagTracker(baseDir);
|
|
482
|
+
if (tracker) {
|
|
483
|
+
const highWater = tracker.highWater;
|
|
484
|
+
const scan = (async () => {
|
|
485
|
+
try {
|
|
486
|
+
const fallback = await readBoundedLifecycleEventsWithProjectionLag(
|
|
487
|
+
ledgerPath,
|
|
488
|
+
readSecureFile,
|
|
489
|
+
cappedLimit,
|
|
490
|
+
memoryId,
|
|
491
|
+
tracker
|
|
492
|
+
);
|
|
493
|
+
return {
|
|
494
|
+
telemetry: fallback.telemetryAvailable ? {
|
|
495
|
+
projectedEvents: highWater.eventCount,
|
|
496
|
+
currentLedgerEvents: fallback.currentEventCount,
|
|
497
|
+
deltaEvents: fallback.deltaEvents
|
|
498
|
+
} : null,
|
|
499
|
+
events: fallback.events,
|
|
500
|
+
memoryId,
|
|
501
|
+
limit: cappedLimit
|
|
502
|
+
};
|
|
503
|
+
} finally {
|
|
504
|
+
try {
|
|
505
|
+
tracker.close();
|
|
506
|
+
} catch {
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
})();
|
|
510
|
+
this.lagInFlight = { generation, scan };
|
|
511
|
+
try {
|
|
512
|
+
const result = await scan;
|
|
513
|
+
if (result.telemetry) {
|
|
514
|
+
this.lagCache = { generation, telemetry: result.telemetry };
|
|
515
|
+
}
|
|
516
|
+
warnProjectionFallback(baseDir, "getMemoryTimeline", projectionAge, result.telemetry ?? void 0);
|
|
517
|
+
return result.events;
|
|
518
|
+
} finally {
|
|
519
|
+
if (this.lagInFlight?.scan === scan) {
|
|
520
|
+
this.lagInFlight = null;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
warnProjectionFallback(baseDir, "getMemoryTimeline", projectionAge);
|
|
525
|
+
return readBoundedLifecycleEventsFromLedger(ledgerPath, readSecureFile, cappedLimit, memoryId);
|
|
526
|
+
}
|
|
527
|
+
};
|
|
257
528
|
function pendingLifecycleLedgerDir(ledgerPath) {
|
|
258
529
|
return `${ledgerPath}.pending.d`;
|
|
259
530
|
}
|
|
@@ -275,7 +546,7 @@ function serializeLifecycleAppendPayload(events) {
|
|
|
275
546
|
async function spillPendingAppend(ledgerPath, io, payload) {
|
|
276
547
|
const dir = pendingLifecycleLedgerDir(ledgerPath);
|
|
277
548
|
await ensureContainedSpillDir(dir);
|
|
278
|
-
const finalPath =
|
|
549
|
+
const finalPath = path2.join(dir, `${randomUUID()}.jsonl`);
|
|
279
550
|
await io.writeSecure(finalPath, payload);
|
|
280
551
|
}
|
|
281
552
|
var CLAIMED_SPILL_SUFFIX = ".claimed";
|
|
@@ -432,12 +703,20 @@ async function drainPendingLifecycleForSyncOrThrow(drain, maxAttempts = 3) {
|
|
|
432
703
|
}
|
|
433
704
|
|
|
434
705
|
export {
|
|
706
|
+
readProjectionRebuiltAt,
|
|
707
|
+
formatProjectionAge,
|
|
708
|
+
writeProjectionMetaHighWater,
|
|
709
|
+
readProjectedEntityMentionRows,
|
|
710
|
+
readProjectedNativeKnowledgeRows,
|
|
711
|
+
readProjectedGovernanceRows,
|
|
712
|
+
assertInjectedStorageRooted,
|
|
435
713
|
STATE_FILE_MAX_DECRYPT_BYTES,
|
|
436
714
|
readMaybeEncryptedLines,
|
|
437
715
|
readMemoryActionEventRowsFromLines,
|
|
438
716
|
readAllLifecycleEventsFromLedger,
|
|
439
717
|
readAllLifecycleEventsFromLedgerBuffer,
|
|
440
718
|
readBoundedLifecycleEventsFromLedger,
|
|
719
|
+
ProjectionLedgerLagManager,
|
|
441
720
|
pendingLifecycleLedgerDir,
|
|
442
721
|
serializeLifecycleAppendPayload,
|
|
443
722
|
appendLifecycleEventsSerialized,
|
|
@@ -445,4 +724,4 @@ export {
|
|
|
445
724
|
drainPendingLifecycleLedgerForSync,
|
|
446
725
|
drainPendingLifecycleForSyncOrThrow
|
|
447
726
|
};
|
|
448
|
-
//# sourceMappingURL=chunk-
|
|
727
|
+
//# sourceMappingURL=chunk-4VXGRIH6.js.map
|