@remnic/core 10.0.169 → 10.0.171
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.js +124 -123
- package/dist/access-cli.js +124 -123
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.js +8 -8
- package/dist/access-extraction-force-flush-preempt.js +124 -123
- package/dist/access-extraction-force-flush.js +124 -123
- package/dist/access-http-briefing.js +124 -123
- package/dist/access-http-query.js +124 -123
- package/dist/access-http.js +124 -123
- package/dist/access-identity-continuity-surface.js +124 -123
- package/dist/access-lcm-surface.js +124 -123
- package/dist/access-mcp.js +124 -123
- package/dist/access-observe-write-category.js +8 -8
- package/dist/access-observe-write-surface.js +124 -123
- package/dist/access-offline-manifest.js +5 -5
- package/dist/access-operations-batch.js +124 -123
- package/dist/access-operations.js +124 -123
- package/dist/access-recall-concurrency.js +124 -123
- package/dist/access-recall-diagnostics.js +2 -2
- package/dist/access-recall-response.js +124 -123
- package/dist/access-recall-surface.d.ts.map +1 -1
- package/dist/access-recall-surface.js +124 -123
- package/dist/access-schema.js +7 -7
- package/dist/access-service.js +124 -123
- package/dist/active-recall.js +21 -20
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/behavior-learner.js +1 -1
- package/dist/briefing.js +13 -13
- package/dist/buffer.js +6 -6
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.js +16 -16
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.js +2 -2
- package/dist/causal-trajectory.js +1 -1
- package/dist/chat/chat-engine.d.ts +5 -3
- package/dist/chat/chat-engine.d.ts.map +1 -1
- package/dist/chat/chat-executor.d.ts +3 -4
- package/dist/chat/chat-executor.d.ts.map +1 -1
- package/dist/{chunk-FHWX2REL.js → chunk-2OAFPBQB.js} +2 -2
- package/dist/{chunk-5IZL4DCV.js → chunk-4DF5LMBJ.js} +2 -2
- package/dist/{chunk-FWTGO4NE.js → chunk-4DLGKTM6.js} +2 -2
- package/dist/{chunk-D6YCETHG.js → chunk-4E2Z44CV.js} +2 -2
- package/dist/{chunk-W4EJMMPP.js → chunk-4LVQSHHN.js} +11 -11
- package/dist/{chunk-W4Q65VJL.js → chunk-4X7HQKAG.js} +2 -2
- package/dist/{chunk-I74SUMNI.js → chunk-5ACIRCBO.js} +65 -3
- package/dist/chunk-5ACIRCBO.js.map +1 -0
- package/dist/{chunk-LPUEBFX2.js → chunk-5JCYPBY5.js} +2 -2
- package/dist/{chunk-ID65XTF3.js → chunk-5SOSQTVE.js} +2 -2
- package/dist/{chunk-SEIGLG62.js → chunk-6VFMEBXY.js} +4 -4
- package/dist/{chunk-333SBFXB.js → chunk-7AAMJQFW.js} +2 -2
- package/dist/{chunk-AHOYKJ5X.js → chunk-7SNEJNA3.js} +96 -23
- package/dist/chunk-7SNEJNA3.js.map +1 -0
- package/dist/{chunk-T3MCVSUC.js → chunk-A2XFG462.js} +2 -2
- package/dist/{chunk-HXFIILGF.js → chunk-BFPF5N3H.js} +4 -4
- package/dist/{chunk-GWY5ZFHP.js → chunk-BJOQQCYC.js} +5 -5
- package/dist/{chunk-7OYDFIL4.js → chunk-CY2C5LM4.js} +3 -3
- package/dist/{chunk-BFBS7OFQ.js → chunk-DC55RIEZ.js} +4 -4
- package/dist/{chunk-TGQW3AMK.js → chunk-DNXQVCIC.js} +3 -3
- package/dist/{chunk-TQ4CELUR.js → chunk-E53NLIAP.js} +3 -3
- package/dist/{chunk-2LA3H54D.js → chunk-E5IZTY4W.js} +2 -2
- package/dist/{chunk-PFR6ZKQI.js → chunk-EBI6FI5U.js} +6 -6
- package/dist/{chunk-JN7OSQJR.js → chunk-ETTV5F53.js} +2 -2
- package/dist/{chunk-FRYCXXTB.js → chunk-FSORYJRP.js} +3 -3
- package/dist/{chunk-K36RMINQ.js → chunk-GOZXQNIM.js} +3 -3
- package/dist/{chunk-H4IU24V5.js → chunk-GUF2JKG5.js} +2 -2
- package/dist/{chunk-XTRC6SSS.js → chunk-H6TCS5XX.js} +11 -8
- package/dist/chunk-H6TCS5XX.js.map +1 -0
- package/dist/{chunk-MTJFK42O.js → chunk-HHVK2JRE.js} +2 -2
- package/dist/{chunk-D5ZLTLHF.js → chunk-HR3DKJCU.js} +2 -2
- package/dist/{chunk-AUFPPBC3.js → chunk-IJKO5RVJ.js} +3 -3
- package/dist/{chunk-O3OEVYUR.js → chunk-IK7NPYYU.js} +2 -2
- package/dist/{chunk-ILNPU5W5.js → chunk-IMA4DJ7K.js} +5 -45
- package/dist/chunk-IMA4DJ7K.js.map +1 -0
- package/dist/{chunk-ACPFBVUD.js → chunk-JDH2BA2P.js} +2 -2
- package/dist/{chunk-VF6SC4OD.js → chunk-JNBSTHVT.js} +2 -2
- package/dist/chunk-JVVWCZ2P.js +18 -0
- package/dist/chunk-JVVWCZ2P.js.map +1 -0
- package/dist/{chunk-OBPOIZNR.js → chunk-KBHUGMUW.js} +2 -2
- package/dist/{chunk-M7CFCRWJ.js → chunk-KW4XA7GM.js} +3 -3
- package/dist/{chunk-B5KTTWC7.js → chunk-L5EE2CXU.js} +2 -2
- package/dist/{chunk-QNUNAXBE.js → chunk-L7LZDISF.js} +1 -9
- package/dist/{chunk-QNUNAXBE.js.map → chunk-L7LZDISF.js.map} +1 -1
- package/dist/{chunk-N3FRR6II.js → chunk-LAOJHOTG.js} +2 -2
- package/dist/{chunk-QPLI7LUU.js → chunk-LH57QATU.js} +2 -2
- package/dist/{chunk-JGGNUEVD.js → chunk-NDPS6OU2.js} +2 -2
- package/dist/{chunk-N7AIFTSH.js → chunk-NJG63FY2.js} +1 -1
- package/dist/{chunk-N7AIFTSH.js.map → chunk-NJG63FY2.js.map} +1 -1
- package/dist/{chunk-UPD5XDJX.js → chunk-NKAGGDSL.js} +4 -4
- package/dist/{chunk-G3RLCVJC.js → chunk-OGQL7QC7.js} +2 -2
- package/dist/{chunk-K3FH3LAQ.js → chunk-OJXK5C6Z.js} +4 -4
- package/dist/{chunk-HDLNSDLK.js → chunk-P3XO7HE3.js} +2 -2
- package/dist/{chunk-VMRPLHEU.js → chunk-PQIFYBUX.js} +2 -2
- package/dist/{chunk-WLT6LTQP.js → chunk-PRRWKTK6.js} +2 -2
- package/dist/{chunk-CX24SVLK.js → chunk-Q7OKGBZY.js} +2 -2
- package/dist/{chunk-BHRPZBAH.js → chunk-QJBULLKG.js} +3 -3
- package/dist/{chunk-WCJQ3OUP.js → chunk-QKAFFVSO.js} +2 -2
- package/dist/{chunk-VKXJQF5C.js → chunk-QKBFVLDH.js} +2 -2
- package/dist/{chunk-I7WPLMUX.js → chunk-QRCE77YX.js} +2 -2
- package/dist/{chunk-K2DTHNDY.js → chunk-R2AJAAHJ.js} +4 -4
- package/dist/{chunk-5KDDAQ6K.js → chunk-R3UQIS3F.js} +6 -6
- package/dist/{chunk-B3M56D2A.js → chunk-RDHEBINJ.js} +2 -2
- package/dist/{chunk-3I3NXB6X.js → chunk-RHQL2RIM.js} +2 -2
- package/dist/{chunk-FMIM36I4.js → chunk-SA2YALFU.js} +2 -2
- package/dist/{chunk-DPL5VO5V.js → chunk-SAPC7N43.js} +3 -3
- package/dist/{chunk-7FPI5MFB.js → chunk-SLWD7TB6.js} +5 -5
- package/dist/{chunk-ZA6CYFAK.js → chunk-SOQOUZ2Y.js} +2 -2
- package/dist/{chunk-VHXRLD6S.js → chunk-T2JZF45K.js} +2 -2
- package/dist/{chunk-32OTLNAU.js → chunk-T2KCROPA.js} +230 -216
- package/dist/chunk-T2KCROPA.js.map +1 -0
- package/dist/{chunk-63A2BU2B.js → chunk-T4MKFTJF.js} +2 -2
- package/dist/{chunk-E7ATID4Z.js → chunk-UFX24WNJ.js} +14 -14
- package/dist/{chunk-HQPFACXO.js → chunk-UH3FPX3L.js} +2 -2
- package/dist/{chunk-3LADDLAF.js → chunk-V5W67PQV.js} +4 -4
- package/dist/{chunk-PRC7SZYM.js → chunk-VAQIBC2L.js} +2 -2
- package/dist/{chunk-3Q3XD3NO.js → chunk-W2E2WFXL.js} +3 -3
- package/dist/{chunk-GF5NN3LE.js → chunk-W2UV6VE3.js} +2 -2
- package/dist/{chunk-SH3GOZWK.js → chunk-W35ICLYZ.js} +2 -2
- package/dist/{chunk-ALTLOHO7.js → chunk-WF2LYKOB.js} +2 -2
- package/dist/{chunk-FSXYBIEZ.js → chunk-X5MFCZDL.js} +72 -35
- package/dist/chunk-X5MFCZDL.js.map +1 -0
- package/dist/{chunk-FZVROZKC.js → chunk-XVZA6VXC.js} +4 -4
- package/dist/{chunk-IJVU4ILJ.js → chunk-XYNUEXLC.js} +4 -4
- package/dist/{chunk-RVAPK2S7.js → chunk-Y65XX5PC.js} +2 -2
- package/dist/{chunk-YWMCV5HL.js → chunk-YE77U5HZ.js} +3 -3
- package/dist/{chunk-VPEIWMUT.js → chunk-YLTU2DC4.js} +2 -2
- package/dist/{chunk-62YZOQFR.js → chunk-YRD525ZO.js} +2 -2
- package/dist/{chunk-TBBDFYXW.js → chunk-YVUNHNB6.js} +2 -3
- package/dist/chunk-YVUNHNB6.js.map +1 -0
- package/dist/{chunk-ITGAGNX5.js → chunk-YY5UXARJ.js} +24 -12
- package/dist/chunk-YY5UXARJ.js.map +1 -0
- package/dist/{chunk-U7KP6QFU.js → chunk-ZJ3CEAJD.js} +2 -2
- package/dist/{chunk-QC2MHZDD.js → chunk-ZOJUWVAU.js} +1 -1
- package/dist/{chunk-HH6PXQ2B.js → chunk-ZYP4YEEI.js} +2 -2
- package/dist/cli.js +124 -123
- package/dist/coding/export-okf-codegraph.js +21 -21
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.js +14 -14
- package/dist/config-deprecations.d.ts +3 -0
- package/dist/config-deprecations.d.ts.map +1 -0
- package/dist/config-deprecations.js +9 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +21 -20
- package/dist/connectors/codex-materialize-runner.js +13 -13
- package/dist/connectors/index.js +13 -13
- package/dist/convergence-refresh.js +16 -16
- package/dist/corpus-watermark.js +15 -15
- package/dist/correction/correction-access-wiring.d.ts +4 -1
- package/dist/correction/correction-access-wiring.d.ts.map +1 -1
- package/dist/deep-recall-http-glue.js +8 -8
- package/dist/deep-recall.js +2 -2
- package/dist/embedding-fallback.js +1 -1
- package/dist/entity-retrieval.js +14 -14
- package/dist/explicit-capture.js +124 -123
- package/dist/extraction-span-materialize.js +2 -2
- package/dist/extraction.js +22 -22
- package/dist/{first-start-migration-BPVJ4HJQ.js → first-start-migration-PPPP54X6.js} +5 -5
- package/dist/{graph-edge-decay-CXTNJ7IQ.js → graph-edge-decay-EKWXRBWF.js} +5 -5
- package/dist/graph-jsonl.js +3 -3
- package/dist/graph-snapshot.js +3 -3
- package/dist/graph.js +2 -2
- package/dist/harmonic-retrieval.js +13 -13
- package/dist/index.js +173 -171
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.js +4 -4
- package/dist/lifecycle.d.ts +0 -6
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +1 -1
- package/dist/location/index.js +25 -15
- package/dist/location/provider-setup.d.ts +26 -1
- package/dist/location/provider-setup.d.ts.map +1 -1
- package/dist/maintenance/memory-governance.js +14 -14
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +13 -13
- package/dist/maintenance/rebuild-memory-projection-runner.js +16 -16
- package/dist/maintenance/rebuild-memory-projection.js +15 -15
- package/dist/memory-browse.js +6 -6
- package/dist/{migrate-from-identity-anchor-MJYB6NNN.js → migrate-from-identity-anchor-TZSZXJ6L.js} +2 -2
- package/dist/migrate-from-identity-anchor-TZSZXJ6L.js.map +1 -0
- package/dist/model-registry.d.ts +0 -5
- package/dist/model-registry.d.ts.map +1 -1
- package/dist/model-registry.js +1 -1
- package/dist/namespaces/migrate.js +14 -14
- package/dist/namespaces/search.js +6 -6
- package/dist/namespaces/storage.js +13 -13
- package/dist/offline-sync-changeset-generations.js +3 -3
- package/dist/offline-sync-embedding-generation.js +2 -2
- package/dist/offline-sync-snapshot-stream.js +5 -5
- package/dist/offline-sync.js +4 -4
- package/dist/operator-doctor-corpus.js +16 -16
- package/dist/operator-toolkit.js +32 -31
- package/dist/orchestration/backlog-scheduler.js +125 -124
- package/dist/orchestration/backlog-scheduler.js.map +1 -1
- package/dist/orchestration/buffer-drain-runner.js +125 -124
- package/dist/orchestration/maintenance.js +22 -22
- package/dist/orchestration/semantic-consolidation-coordinator.d.ts.map +1 -1
- package/dist/orchestration/workspace-ops.d.ts.map +1 -1
- package/dist/orchestrator.js +124 -123
- package/dist/peers/index.d.ts +2 -1
- package/dist/peers/index.d.ts.map +1 -1
- package/dist/peers/index.js +3 -3
- package/dist/peers/interaction-log-append.d.ts +8 -0
- package/dist/peers/interaction-log-append.d.ts.map +1 -0
- package/dist/peers/storage.d.ts +22 -8
- package/dist/peers/storage.d.ts.map +1 -1
- package/dist/policy-runtime.js +2 -2
- package/dist/qmd.js +2 -2
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-navigate-access.js +2 -2
- package/dist/recall-navigate-disclosure.js +2 -2
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-navigation.js +124 -123
- package/dist/recall-state-view-admission.js +6 -6
- package/dist/recall-why-service.js +6 -6
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.js +2 -2
- package/dist/resume-bundles.js +22 -21
- package/dist/retrieval.js +2 -2
- package/dist/search/factory.js +5 -5
- package/dist/search/index.js +9 -9
- package/dist/semantic-consolidation.d.ts +10 -16
- package/dist/semantic-consolidation.d.ts.map +1 -1
- package/dist/semantic-consolidation.js +14 -14
- package/dist/semantic-rule-promotion.js +13 -13
- package/dist/semantic-rule-verifier.js +13 -13
- package/dist/source-agent-qualifier.js +17 -17
- package/dist/standup/build.js +13 -13
- package/dist/storage/links-frontmatter.d.ts +3 -0
- package/dist/storage/links-frontmatter.d.ts.map +1 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +12 -12
- package/dist/summarizer.js +2 -2
- package/dist/tier-routing.js +2 -2
- package/dist/{tier-stats-FLFKN7Y6.js → tier-stats-XWJSVEHC.js} +5 -5
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/export-okf.js +13 -13
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-learner.js +2 -2
- package/dist/utility-runtime.js +3 -3
- package/dist/verified-recall.js +13 -13
- package/dist/who-knows-cli.js +14 -14
- package/dist/who-knows.js +13 -13
- package/package.json +2 -2
- package/src/access-recall-surface.ts +0 -2
- package/src/chat/chat-engine.ts +5 -3
- package/src/chat/chat-executor.test.ts +150 -0
- package/src/chat/chat-executor.ts +31 -20
- package/src/chat/chat-factory.ts +1 -1
- package/src/config-deprecations.ts +14 -0
- package/src/config.ts +2 -1
- package/src/correction/correction-access-wiring.ts +4 -1
- package/src/lifecycle.ts +0 -8
- package/src/location/provider-setup.test.ts +273 -2
- package/src/location/provider-setup.ts +138 -32
- package/src/model-registry.ts +0 -11
- package/src/orchestration/semantic-consolidation-coordinator.ts +40 -33
- package/src/orchestration/semantic-consolidation-split.test.ts +72 -0
- package/src/orchestration/workspace-ops.test.ts +23 -0
- package/src/orchestration/workspace-ops.ts +6 -5
- package/src/peers/index.ts +1 -1
- package/src/peers/interaction-log-append.ts +132 -0
- package/src/peers/peers.test.ts +30 -0
- package/src/peers/profile-reasoner.ts +1 -1
- package/src/peers/storage.ts +4 -105
- package/src/semantic-consolidation.ts +35 -27
- package/src/storage/links-frontmatter.ts +69 -0
- package/src/storage-links-parse.test.ts +153 -0
- package/src/storage.ts +4 -18
- package/src/testing/subjects/dependency-propagation.test.ts +5 -4
- package/src/types.ts +1 -0
- package/dist/chunk-32OTLNAU.js.map +0 -1
- package/dist/chunk-AHOYKJ5X.js.map +0 -1
- package/dist/chunk-FSXYBIEZ.js.map +0 -1
- package/dist/chunk-I74SUMNI.js.map +0 -1
- package/dist/chunk-ILNPU5W5.js.map +0 -1
- package/dist/chunk-ITGAGNX5.js.map +0 -1
- package/dist/chunk-TBBDFYXW.js.map +0 -1
- package/dist/chunk-XTRC6SSS.js.map +0 -1
- /package/dist/{chunk-FHWX2REL.js.map → chunk-2OAFPBQB.js.map} +0 -0
- /package/dist/{chunk-5IZL4DCV.js.map → chunk-4DF5LMBJ.js.map} +0 -0
- /package/dist/{chunk-FWTGO4NE.js.map → chunk-4DLGKTM6.js.map} +0 -0
- /package/dist/{chunk-D6YCETHG.js.map → chunk-4E2Z44CV.js.map} +0 -0
- /package/dist/{chunk-W4EJMMPP.js.map → chunk-4LVQSHHN.js.map} +0 -0
- /package/dist/{chunk-W4Q65VJL.js.map → chunk-4X7HQKAG.js.map} +0 -0
- /package/dist/{chunk-LPUEBFX2.js.map → chunk-5JCYPBY5.js.map} +0 -0
- /package/dist/{chunk-ID65XTF3.js.map → chunk-5SOSQTVE.js.map} +0 -0
- /package/dist/{chunk-SEIGLG62.js.map → chunk-6VFMEBXY.js.map} +0 -0
- /package/dist/{chunk-333SBFXB.js.map → chunk-7AAMJQFW.js.map} +0 -0
- /package/dist/{chunk-T3MCVSUC.js.map → chunk-A2XFG462.js.map} +0 -0
- /package/dist/{chunk-HXFIILGF.js.map → chunk-BFPF5N3H.js.map} +0 -0
- /package/dist/{chunk-GWY5ZFHP.js.map → chunk-BJOQQCYC.js.map} +0 -0
- /package/dist/{chunk-7OYDFIL4.js.map → chunk-CY2C5LM4.js.map} +0 -0
- /package/dist/{chunk-BFBS7OFQ.js.map → chunk-DC55RIEZ.js.map} +0 -0
- /package/dist/{chunk-TGQW3AMK.js.map → chunk-DNXQVCIC.js.map} +0 -0
- /package/dist/{chunk-TQ4CELUR.js.map → chunk-E53NLIAP.js.map} +0 -0
- /package/dist/{chunk-2LA3H54D.js.map → chunk-E5IZTY4W.js.map} +0 -0
- /package/dist/{chunk-PFR6ZKQI.js.map → chunk-EBI6FI5U.js.map} +0 -0
- /package/dist/{chunk-JN7OSQJR.js.map → chunk-ETTV5F53.js.map} +0 -0
- /package/dist/{chunk-FRYCXXTB.js.map → chunk-FSORYJRP.js.map} +0 -0
- /package/dist/{chunk-K36RMINQ.js.map → chunk-GOZXQNIM.js.map} +0 -0
- /package/dist/{chunk-H4IU24V5.js.map → chunk-GUF2JKG5.js.map} +0 -0
- /package/dist/{chunk-MTJFK42O.js.map → chunk-HHVK2JRE.js.map} +0 -0
- /package/dist/{chunk-D5ZLTLHF.js.map → chunk-HR3DKJCU.js.map} +0 -0
- /package/dist/{chunk-AUFPPBC3.js.map → chunk-IJKO5RVJ.js.map} +0 -0
- /package/dist/{chunk-O3OEVYUR.js.map → chunk-IK7NPYYU.js.map} +0 -0
- /package/dist/{chunk-ACPFBVUD.js.map → chunk-JDH2BA2P.js.map} +0 -0
- /package/dist/{chunk-VF6SC4OD.js.map → chunk-JNBSTHVT.js.map} +0 -0
- /package/dist/{chunk-OBPOIZNR.js.map → chunk-KBHUGMUW.js.map} +0 -0
- /package/dist/{chunk-M7CFCRWJ.js.map → chunk-KW4XA7GM.js.map} +0 -0
- /package/dist/{chunk-B5KTTWC7.js.map → chunk-L5EE2CXU.js.map} +0 -0
- /package/dist/{chunk-N3FRR6II.js.map → chunk-LAOJHOTG.js.map} +0 -0
- /package/dist/{chunk-QPLI7LUU.js.map → chunk-LH57QATU.js.map} +0 -0
- /package/dist/{chunk-JGGNUEVD.js.map → chunk-NDPS6OU2.js.map} +0 -0
- /package/dist/{chunk-UPD5XDJX.js.map → chunk-NKAGGDSL.js.map} +0 -0
- /package/dist/{chunk-G3RLCVJC.js.map → chunk-OGQL7QC7.js.map} +0 -0
- /package/dist/{chunk-K3FH3LAQ.js.map → chunk-OJXK5C6Z.js.map} +0 -0
- /package/dist/{chunk-HDLNSDLK.js.map → chunk-P3XO7HE3.js.map} +0 -0
- /package/dist/{chunk-VMRPLHEU.js.map → chunk-PQIFYBUX.js.map} +0 -0
- /package/dist/{chunk-WLT6LTQP.js.map → chunk-PRRWKTK6.js.map} +0 -0
- /package/dist/{chunk-CX24SVLK.js.map → chunk-Q7OKGBZY.js.map} +0 -0
- /package/dist/{chunk-BHRPZBAH.js.map → chunk-QJBULLKG.js.map} +0 -0
- /package/dist/{chunk-WCJQ3OUP.js.map → chunk-QKAFFVSO.js.map} +0 -0
- /package/dist/{chunk-VKXJQF5C.js.map → chunk-QKBFVLDH.js.map} +0 -0
- /package/dist/{chunk-I7WPLMUX.js.map → chunk-QRCE77YX.js.map} +0 -0
- /package/dist/{chunk-K2DTHNDY.js.map → chunk-R2AJAAHJ.js.map} +0 -0
- /package/dist/{chunk-5KDDAQ6K.js.map → chunk-R3UQIS3F.js.map} +0 -0
- /package/dist/{chunk-B3M56D2A.js.map → chunk-RDHEBINJ.js.map} +0 -0
- /package/dist/{chunk-3I3NXB6X.js.map → chunk-RHQL2RIM.js.map} +0 -0
- /package/dist/{chunk-FMIM36I4.js.map → chunk-SA2YALFU.js.map} +0 -0
- /package/dist/{chunk-DPL5VO5V.js.map → chunk-SAPC7N43.js.map} +0 -0
- /package/dist/{chunk-7FPI5MFB.js.map → chunk-SLWD7TB6.js.map} +0 -0
- /package/dist/{chunk-ZA6CYFAK.js.map → chunk-SOQOUZ2Y.js.map} +0 -0
- /package/dist/{chunk-VHXRLD6S.js.map → chunk-T2JZF45K.js.map} +0 -0
- /package/dist/{chunk-63A2BU2B.js.map → chunk-T4MKFTJF.js.map} +0 -0
- /package/dist/{chunk-E7ATID4Z.js.map → chunk-UFX24WNJ.js.map} +0 -0
- /package/dist/{chunk-HQPFACXO.js.map → chunk-UH3FPX3L.js.map} +0 -0
- /package/dist/{chunk-3LADDLAF.js.map → chunk-V5W67PQV.js.map} +0 -0
- /package/dist/{chunk-PRC7SZYM.js.map → chunk-VAQIBC2L.js.map} +0 -0
- /package/dist/{chunk-3Q3XD3NO.js.map → chunk-W2E2WFXL.js.map} +0 -0
- /package/dist/{chunk-GF5NN3LE.js.map → chunk-W2UV6VE3.js.map} +0 -0
- /package/dist/{chunk-SH3GOZWK.js.map → chunk-W35ICLYZ.js.map} +0 -0
- /package/dist/{chunk-ALTLOHO7.js.map → chunk-WF2LYKOB.js.map} +0 -0
- /package/dist/{chunk-FZVROZKC.js.map → chunk-XVZA6VXC.js.map} +0 -0
- /package/dist/{chunk-IJVU4ILJ.js.map → chunk-XYNUEXLC.js.map} +0 -0
- /package/dist/{chunk-RVAPK2S7.js.map → chunk-Y65XX5PC.js.map} +0 -0
- /package/dist/{chunk-YWMCV5HL.js.map → chunk-YE77U5HZ.js.map} +0 -0
- /package/dist/{chunk-VPEIWMUT.js.map → chunk-YLTU2DC4.js.map} +0 -0
- /package/dist/{chunk-62YZOQFR.js.map → chunk-YRD525ZO.js.map} +0 -0
- /package/dist/{chunk-U7KP6QFU.js.map → chunk-ZJ3CEAJD.js.map} +0 -0
- /package/dist/{chunk-QC2MHZDD.js.map → chunk-ZOJUWVAU.js.map} +0 -0
- /package/dist/{chunk-HH6PXQ2B.js.map → chunk-ZYP4YEEI.js.map} +0 -0
- /package/dist/{graph-edge-decay-CXTNJ7IQ.js.map → config-deprecations.js.map} +0 -0
- /package/dist/{first-start-migration-BPVJ4HJQ.js.map → first-start-migration-PPPP54X6.js.map} +0 -0
- /package/dist/{migrate-from-identity-anchor-MJYB6NNN.js.map → graph-edge-decay-EKWXRBWF.js.map} +0 -0
- /package/dist/{tier-stats-FLFKN7Y6.js.map → tier-stats-XWJSVEHC.js.map} +0 -0
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sliceSpanText
|
|
3
|
+
} from "./chunk-JE26AUX6.js";
|
|
1
4
|
import {
|
|
2
5
|
stampSpanSource,
|
|
3
6
|
verifySpanSource
|
|
@@ -5,9 +8,6 @@ import {
|
|
|
5
8
|
import {
|
|
6
9
|
validateSpanOffsets
|
|
7
10
|
} from "./chunk-QJ2AX6DU.js";
|
|
8
|
-
import {
|
|
9
|
-
sliceSpanText
|
|
10
|
-
} from "./chunk-JE26AUX6.js";
|
|
11
11
|
import {
|
|
12
12
|
log
|
|
13
13
|
} from "./chunk-3WCASNQZ.js";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
spanAgreesWithContent,
|
|
158
158
|
applyExtractionSpanMaterialization
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=chunk-
|
|
160
|
+
//# sourceMappingURL=chunk-XVZA6VXC.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DevinAdapter
|
|
3
|
+
} from "./chunk-ZTJPFACY.js";
|
|
1
4
|
import {
|
|
2
5
|
HermesAdapter
|
|
3
6
|
} from "./chunk-HCAGBFE7.js";
|
|
@@ -10,9 +13,6 @@ import {
|
|
|
10
13
|
import {
|
|
11
14
|
CodexAdapter
|
|
12
15
|
} from "./chunk-7RKSJVOQ.js";
|
|
13
|
-
import {
|
|
14
|
-
DevinAdapter
|
|
15
|
-
} from "./chunk-ZTJPFACY.js";
|
|
16
16
|
import {
|
|
17
17
|
headerValue
|
|
18
18
|
} from "./chunk-NJAIR57U.js";
|
|
@@ -140,4 +140,4 @@ export {
|
|
|
140
140
|
OpenCodeAdapter,
|
|
141
141
|
AdapterRegistry
|
|
142
142
|
};
|
|
143
|
-
//# sourceMappingURL=chunk-
|
|
143
|
+
//# sourceMappingURL=chunk-XYNUEXLC.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
raceRecallAbort,
|
|
3
3
|
throwIfRecallAborted
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CY2C5LM4.js";
|
|
5
5
|
import {
|
|
6
6
|
emitExtractionLlmFailureError,
|
|
7
7
|
recordExtractionLlmFailure,
|
|
@@ -1183,4 +1183,4 @@ export {
|
|
|
1183
1183
|
ExtractionDeadlineError,
|
|
1184
1184
|
ExtractionRunCoordinator
|
|
1185
1185
|
};
|
|
1186
|
-
//# sourceMappingURL=chunk-
|
|
1186
|
+
//# sourceMappingURL=chunk-Y65XX5PC.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NamespaceStorageRouter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LH57QATU.js";
|
|
4
4
|
import {
|
|
5
5
|
namespaceCollectionName
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-W35ICLYZ.js";
|
|
7
7
|
import {
|
|
8
8
|
isSafeRouteNamespace
|
|
9
9
|
} from "./chunk-PCXDUHQH.js";
|
|
@@ -213,4 +213,4 @@ export {
|
|
|
213
213
|
verifyNamespaces,
|
|
214
214
|
runNamespaceMigration
|
|
215
215
|
};
|
|
216
|
-
//# sourceMappingURL=chunk-
|
|
216
|
+
//# sourceMappingURL=chunk-YE77U5HZ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readAllEdges
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DC55RIEZ.js";
|
|
4
4
|
import {
|
|
5
5
|
readEdgeConfidence
|
|
6
6
|
} from "./chunk-2LSZVONP.js";
|
|
@@ -162,4 +162,4 @@ export {
|
|
|
162
162
|
parseGraphSnapshotSince,
|
|
163
163
|
buildGraphSnapshot
|
|
164
164
|
};
|
|
165
|
-
//# sourceMappingURL=chunk-
|
|
165
|
+
//# sourceMappingURL=chunk-YLTU2DC4.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-5Y43VGYB.js";
|
|
9
9
|
import {
|
|
10
10
|
ModelRegistry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-L7LZDISF.js";
|
|
12
12
|
import {
|
|
13
13
|
LocalLlmClient
|
|
14
14
|
} from "./chunk-BFZFNXOC.js";
|
|
@@ -808,4 +808,4 @@ export {
|
|
|
808
808
|
summarizeHourlyStatus,
|
|
809
809
|
HourlySummarizer
|
|
810
810
|
};
|
|
811
|
-
//# sourceMappingURL=chunk-
|
|
811
|
+
//# sourceMappingURL=chunk-YRD525ZO.js.map
|
|
@@ -70,8 +70,7 @@ function computeHeat(memory, now, signals) {
|
|
|
70
70
|
const frontmatter = memory.frontmatter;
|
|
71
71
|
if (frontmatter.status === "archived") return 0;
|
|
72
72
|
const inputs = computeLifecycleValueInputs(memory, now, signals);
|
|
73
|
-
const
|
|
74
|
-
const score = inputs.confidence * 0.25 + inputs.access * 0.3 + inputs.recency * 0.2 + inputs.importance * 0.15 + inputs.feedback * 0.1 + causalBoost - inputs.disputedPenalty;
|
|
73
|
+
const score = inputs.confidence * 0.25 + inputs.access * 0.3 + inputs.recency * 0.2 + inputs.importance * 0.15 + inputs.feedback * 0.1 - inputs.disputedPenalty;
|
|
75
74
|
return clamp01(score);
|
|
76
75
|
}
|
|
77
76
|
function computeLifecycleValueInputs(memory, now, signals) {
|
|
@@ -186,4 +185,4 @@ export {
|
|
|
186
185
|
computeDecay,
|
|
187
186
|
decideLifecycleTransition
|
|
188
187
|
};
|
|
189
|
-
//# sourceMappingURL=chunk-
|
|
188
|
+
//# sourceMappingURL=chunk-YVUNHNB6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lifecycle.ts"],"sourcesContent":["import type {\n LifecycleState,\n MemoryCategory,\n MemoryFile,\n MemoryFrontmatter,\n VerificationState,\n} from \"./types.js\";\n\nexport interface LifecyclePolicy {\n promoteHeatThreshold: number;\n staleDecayThreshold: number;\n archiveDecayThreshold: number;\n protectedCategories: MemoryCategory[];\n}\n\nexport interface LifecycleSignals {\n /**\n * Optional relevance feedback in [-1, 1]. Negative values increase decay.\n * Positive values raise heat.\n */\n feedbackScore?: number;\n /**\n * Optional bounded prior derived from memory-action outcomes in [-1, 1].\n * This is intentionally low-impact to avoid circular amplification.\n */\n actionPriorScore?: number;\n}\n\nexport interface LifecycleDecision {\n currentState: LifecycleState;\n nextState: LifecycleState;\n heatScore: number;\n decayScore: number;\n changed: boolean;\n reason: string;\n}\n\nexport interface LifecycleValueInputs {\n confidence: number;\n access: number;\n recency: number;\n importance: number;\n feedback: number;\n disputedPenalty: number;\n}\n\nconst DEFAULT_POLICY: LifecyclePolicy = {\n promoteHeatThreshold: 0.55,\n staleDecayThreshold: 0.65,\n archiveDecayThreshold: 0.85,\n protectedCategories: [\"decision\", \"principle\", \"commitment\", \"preference\", \"procedure\"],\n};\n\nexport function clamp01(value: number): number {\n if (!Number.isFinite(value)) return 0;\n if (value < 0) return 0;\n if (value > 1) return 1;\n return value;\n}\n\nexport function clampLifecycleThreshold(value: number): number {\n return clamp01(value);\n}\n\nfunction parseIsoMs(value?: string): number | null {\n if (!value) return null;\n const ms = Date.parse(value);\n return Number.isFinite(ms) ? ms : null;\n}\n\nexport function daysSince(value: string | undefined, nowMs: number): number {\n const ts = parseIsoMs(value);\n if (ts === null) return 365;\n return Math.max(0, (nowMs - ts) / 86_400_000);\n}\n\nfunction confidenceTierWeight(frontmatter: MemoryFrontmatter): number {\n switch (frontmatter.confidenceTier) {\n case \"explicit\":\n return 1;\n case \"implied\":\n return 0.8;\n case \"inferred\":\n return 0.6;\n case \"speculative\":\n return 0.35;\n default:\n return clamp01(frontmatter.confidence ?? 0.5);\n }\n}\n\nfunction accessWeight(accessCount: number | undefined): number {\n const raw = accessCount ?? 0;\n if (raw <= 0) return 0;\n return clamp01(Math.log1p(raw) / Math.log1p(20));\n}\n\nfunction recencyWeight(frontmatter: MemoryFrontmatter, nowMs: number): number {\n const lastTouch = frontmatter.lastAccessed ?? frontmatter.updated ?? frontmatter.created;\n const ageDays = daysSince(lastTouch, nowMs);\n return clamp01(1 - ageDays / 90);\n}\n\nfunction feedbackWeight(signals?: LifecycleSignals): number {\n const raw = (signals?.feedbackScore ?? 0) + (signals?.actionPriorScore ?? 0);\n return clamp01((raw + 1) / 2);\n}\n\nfunction boundedFeedbackScore(signals?: LifecycleSignals): number {\n const raw = (signals?.feedbackScore ?? 0) + (signals?.actionPriorScore ?? 0);\n if (!Number.isFinite(raw)) return 0;\n if (raw < -1) return -1;\n if (raw > 1) return 1;\n return raw;\n}\n\nfunction isProtectedMemory(\n frontmatter: MemoryFrontmatter,\n policy: LifecyclePolicy,\n): boolean {\n return frontmatter.policyClass === \"protected\" || policy.protectedCategories.includes(frontmatter.category);\n}\n\nexport function resolveLifecycleState(frontmatter: MemoryFrontmatter): LifecycleState {\n if (frontmatter.status === \"archived\") return \"archived\";\n return frontmatter.lifecycleState ?? \"candidate\";\n}\n\nexport function computeHeat(\n memory: Pick<MemoryFile, \"frontmatter\">,\n now: Date,\n signals?: LifecycleSignals,\n): number {\n const frontmatter = memory.frontmatter;\n if (frontmatter.status === \"archived\") return 0;\n\n const inputs = computeLifecycleValueInputs(memory, now, signals);\n const score = (inputs.confidence * 0.25)\n + (inputs.access * 0.3)\n + (inputs.recency * 0.2)\n + (inputs.importance * 0.15)\n + (inputs.feedback * 0.1)\n - inputs.disputedPenalty;\n return clamp01(score);\n}\n\nexport function computeLifecycleValueInputs(\n memory: Pick<MemoryFile, \"frontmatter\">,\n now: Date,\n signals?: LifecycleSignals,\n): LifecycleValueInputs {\n const frontmatter = memory.frontmatter;\n const nowMs = now.getTime();\n return {\n confidence: confidenceTierWeight(frontmatter),\n access: accessWeight(frontmatter.accessCount),\n recency: recencyWeight(frontmatter, nowMs),\n importance: clamp01(frontmatter.importance?.score ?? 0.5),\n feedback: feedbackWeight(signals),\n disputedPenalty: frontmatter.verificationState === \"disputed\" ? 0.2 : 0,\n };\n}\n\nexport function computeDecay(\n memory: Pick<MemoryFile, \"frontmatter\">,\n now: Date,\n signals?: LifecycleSignals,\n): number {\n const frontmatter = memory.frontmatter;\n if (frontmatter.status === \"archived\") return 1;\n\n const nowMs = now.getTime();\n const ageDays = daysSince(frontmatter.updated ?? frontmatter.created, nowMs);\n const staleAccessDays = daysSince(frontmatter.lastAccessed, nowMs);\n const ageRisk = clamp01(ageDays / 180);\n const staleAccessRisk = clamp01(staleAccessDays / 120);\n const confidenceRisk = 1 - confidenceTierWeight(frontmatter);\n const feedbackRisk = clamp01((boundedFeedbackScore(signals) * -1 + 1) / 2);\n const heat = computeHeat(memory, now, signals);\n\n const score = (ageRisk * 0.3)\n + (staleAccessRisk * 0.25)\n + (confidenceRisk * 0.2)\n + (feedbackRisk * 0.1)\n + ((1 - heat) * 0.15);\n\n return clamp01(score);\n}\n\nfunction toTerminalDisputedState(\n currentState: LifecycleState,\n): LifecycleState {\n if (currentState === \"archived\") return \"archived\";\n return \"stale\";\n}\n\nfunction isActiveEligible(verificationState?: VerificationState): boolean {\n return verificationState === \"user_confirmed\" || verificationState === \"system_inferred\";\n}\n\nexport function decideLifecycleTransition(\n memory: Pick<MemoryFile, \"frontmatter\">,\n policy: Partial<LifecyclePolicy>,\n now: Date,\n signals?: LifecycleSignals,\n): LifecycleDecision {\n const mergedPolicy: LifecyclePolicy = { ...DEFAULT_POLICY, ...policy };\n const frontmatter = memory.frontmatter;\n const currentState = resolveLifecycleState(frontmatter);\n const heatScore = computeHeat(memory, now, signals);\n const decayScore = computeDecay(memory, now, signals);\n const protectedMemory = isProtectedMemory(frontmatter, mergedPolicy);\n\n if (currentState === \"archived\") {\n return {\n currentState,\n nextState: \"archived\",\n heatScore,\n decayScore,\n changed: false,\n reason: \"archived_is_terminal\",\n };\n }\n\n if (frontmatter.verificationState === \"disputed\") {\n const nextState = toTerminalDisputedState(currentState);\n return {\n currentState,\n nextState,\n heatScore,\n decayScore,\n changed: nextState !== currentState,\n reason: \"disputed_memories_do_not_promote_to_active\",\n };\n }\n\n if (decayScore >= mergedPolicy.archiveDecayThreshold && !protectedMemory) {\n return {\n currentState,\n nextState: \"archived\",\n heatScore,\n decayScore,\n changed: true,\n reason: \"decay_exceeded_archive_threshold\",\n };\n }\n\n if (decayScore >= mergedPolicy.staleDecayThreshold) {\n return {\n currentState,\n nextState: \"stale\",\n heatScore,\n decayScore,\n changed: currentState !== \"stale\",\n reason: \"decay_exceeded_stale_threshold\",\n };\n }\n\n if (heatScore >= mergedPolicy.promoteHeatThreshold) {\n const nextState = isActiveEligible(frontmatter.verificationState)\n ? \"active\"\n : \"validated\";\n return {\n currentState,\n nextState,\n heatScore,\n decayScore,\n changed: currentState !== nextState,\n reason: \"heat_exceeded_promote_threshold\",\n };\n }\n\n return {\n currentState,\n nextState: currentState,\n heatScore,\n decayScore,\n changed: false,\n reason: \"no_transition\",\n };\n}\n"],"mappings":";AA8CA,IAAM,iBAAkC;AAAA,EACtC,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EACvB,qBAAqB,CAAC,YAAY,aAAa,cAAc,cAAc,WAAW;AACxF;AAEO,SAAS,QAAQ,OAAuB;AAC7C,MAAI,CAAC,OAAO,SAAS,KAAK,EAAG,QAAO;AACpC,MAAI,QAAQ,EAAG,QAAO;AACtB,MAAI,QAAQ,EAAG,QAAO;AACtB,SAAO;AACT;AAEO,SAAS,wBAAwB,OAAuB;AAC7D,SAAO,QAAQ,KAAK;AACtB;AAEA,SAAS,WAAW,OAA+B;AACjD,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,KAAK,KAAK,MAAM,KAAK;AAC3B,SAAO,OAAO,SAAS,EAAE,IAAI,KAAK;AACpC;AAEO,SAAS,UAAU,OAA2B,OAAuB;AAC1E,QAAM,KAAK,WAAW,KAAK;AAC3B,MAAI,OAAO,KAAM,QAAO;AACxB,SAAO,KAAK,IAAI,IAAI,QAAQ,MAAM,KAAU;AAC9C;AAEA,SAAS,qBAAqB,aAAwC;AACpE,UAAQ,YAAY,gBAAgB;AAAA,IAClC,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO,QAAQ,YAAY,cAAc,GAAG;AAAA,EAChD;AACF;AAEA,SAAS,aAAa,aAAyC;AAC7D,QAAM,MAAM,eAAe;AAC3B,MAAI,OAAO,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AAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,MAAI,YAAY,sBAAsB,YAAY;AAChD,UAAM,YAAY,wBAAwB,YAAY;AACtD,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,cAAc;AAAA,MACvB,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,MAAI,cAAc,aAAa,yBAAyB,CAAC,iBAAiB;AACxE,WAAO;AAAA,MACL;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,MAAI,cAAc,aAAa,qBAAqB;AAClD,WAAO;AAAA,MACL;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA,SAAS,iBAAiB;AAAA,MAC1B,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,MAAI,aAAa,aAAa,sBAAsB;AAClD,UAAM,YAAY,iBAAiB,YAAY,iBAAiB,IAC5D,WACA;AACJ,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,iBAAiB;AAAA,MAC1B,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPostConsolidationMaterialize
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RHQL2RIM.js";
|
|
4
4
|
import {
|
|
5
5
|
discoverMemoryExtensions,
|
|
6
6
|
renderExtensionsBlock,
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
} from "./chunk-3WCASNQZ.js";
|
|
22
22
|
|
|
23
23
|
// src/semantic-consolidation.ts
|
|
24
|
+
import { z } from "zod";
|
|
24
25
|
function findSimilarClusters(memories, config) {
|
|
25
26
|
const excluded = new Set(config.excludeCategories);
|
|
26
27
|
const byCategory = /* @__PURE__ */ new Map();
|
|
@@ -112,20 +113,26 @@ Pick exactly ONE consolidation operator for this cluster and return a JSON objec
|
|
|
112
113
|
Operator vocabulary:
|
|
113
114
|
- "merge" \u2014 multiple distinct source memories overlap and should be collapsed into one canonical memory (most common).
|
|
114
115
|
- "update" \u2014 one source memory carries a stale value that a newer source supersedes within the same logical fact.
|
|
115
|
-
- "split" \u2014 a single logical source really encodes multiple distinct facts that should be separated (rare
|
|
116
|
+
- "split" \u2014 a single logical source really encodes multiple distinct facts that should be separated (rare). For split, replace "output" with "outputs": an array holding one canonical memory text per separated fact.
|
|
116
117
|
|
|
117
118
|
Output JSON ONLY, no prose before or after. The "operator" key MUST be set to exactly one of the three strings "merge", "update", or "split" \u2014 never a pipe-separated placeholder like "merge|update|split". Example shape:
|
|
118
119
|
{
|
|
119
120
|
"operator": "merge",
|
|
120
121
|
"output": "<the canonical memory text>"
|
|
121
122
|
}
|
|
123
|
+
Split shape:
|
|
124
|
+
{
|
|
125
|
+
"operator": "split",
|
|
126
|
+
"outputs": ["<first fact>", "<second fact>"]
|
|
127
|
+
}
|
|
122
128
|
|
|
123
|
-
|
|
129
|
+
Each canonical memory text must:
|
|
124
130
|
1. Preserve ALL unique information from every source memory
|
|
125
131
|
2. Remove redundancy and repetition
|
|
126
132
|
3. Use clear, concise language
|
|
127
133
|
4. Match the "${cluster.category}" category and tone
|
|
128
134
|
5. NOT add information that isn't in the sources
|
|
135
|
+
For split, the outputs together must hold all of the source information, and each output holds one fact.
|
|
129
136
|
|
|
130
137
|
${memoryTexts}
|
|
131
138
|
|
|
@@ -134,22 +141,27 @@ Return ONLY the JSON object:`;
|
|
|
134
141
|
function parseOperatorAwareConsolidationResponse(response, cluster) {
|
|
135
142
|
const fallback = {
|
|
136
143
|
operator: chooseConsolidationOperator(cluster),
|
|
137
|
-
|
|
144
|
+
outputs: [response.trim()]
|
|
138
145
|
};
|
|
139
146
|
const trimmed = response.trim();
|
|
140
147
|
if (trimmed.length === 0) return fallback;
|
|
141
148
|
const fenced = /^```(?:json)?([\s\S]*?)```$/u.exec(trimmed);
|
|
142
149
|
const payload = fenced ? fenced[1].trim() : trimmed;
|
|
143
|
-
const
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
const rawOperator = typeof obj.operator === "string" ? obj.operator.trim().toLowerCase() : "";
|
|
148
|
-
const rawOutput = typeof obj.output === "string" ? obj.output : "";
|
|
150
|
+
const reply = CONSOLIDATION_LLM_REPLY.safeParse(findLastJsonObjectWithOperator(payload));
|
|
151
|
+
if (!reply.success) return fallback;
|
|
152
|
+
const rawOperator = reply.data.operator?.trim().toLowerCase() ?? "";
|
|
153
|
+
const rawOutput = reply.data.output ?? "";
|
|
149
154
|
const operator = isSemanticConsolidationLlmOperator(rawOperator) ? rawOperator : chooseConsolidationOperator(cluster);
|
|
150
155
|
const output = rawOutput.trim().length > 0 ? rawOutput.trim() : response.trim();
|
|
151
|
-
|
|
156
|
+
const splitOutputs = (reply.data.outputs ?? []).map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
157
|
+
if (operator === "split" && splitOutputs.length > 0) return { operator, outputs: splitOutputs };
|
|
158
|
+
return { operator, outputs: [output] };
|
|
152
159
|
}
|
|
160
|
+
var CONSOLIDATION_LLM_REPLY = z.object({
|
|
161
|
+
operator: z.string().optional().catch(void 0),
|
|
162
|
+
output: z.string().optional().catch(void 0),
|
|
163
|
+
outputs: z.array(z.string()).optional().catch(void 0)
|
|
164
|
+
});
|
|
153
165
|
function findLastJsonObjectWithOperator(text) {
|
|
154
166
|
let searchFrom = 0;
|
|
155
167
|
let last = void 0;
|
|
@@ -220,4 +232,4 @@ export {
|
|
|
220
232
|
buildExtensionsBlockForConsolidation,
|
|
221
233
|
materializeAfterSemanticConsolidation
|
|
222
234
|
};
|
|
223
|
-
//# sourceMappingURL=chunk-
|
|
235
|
+
//# sourceMappingURL=chunk-YY5UXARJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/semantic-consolidation.ts"],"sourcesContent":["/**\n * semantic-consolidation.ts — Semantic Consolidation Engine\n *\n * Finds clusters of semantically similar memories using token overlap,\n * synthesizes canonical versions via LLM, and archives the originals.\n * Reduces memory store bloat while preserving all unique information.\n */\n\nimport { z } from \"zod\";\n\nimport type { MemoryFile, PluginConfig } from \"./types.js\";\nimport { normalizeRecallTokens, countRecallTokenOverlap } from \"./recall-tokenization.js\";\nimport { runPostConsolidationMaterialize } from \"./connectors/codex-materialize-runner.js\";\nimport type { MaterializeResult, RolloutSummaryInput } from \"./connectors/codex-materialize.js\";\nimport { discoverMemoryExtensions, renderExtensionsBlock, resolveExtensionsRoot } from \"./memory-extension-host/index.js\";\nimport { log } from \"./logger.js\";\nimport { resolvePipelineProcessingCapabilities } from \"./capabilities.js\";\n\n// Re-export resolveExtensionsRoot for backward compatibility — existing\n// consumers that import from semantic-consolidation.ts continue to work.\nexport { resolveExtensionsRoot } from \"./memory-extension-host/index.js\";\n\n// Operator vocabulary (issue #561). The types and validators live in a\n// standalone `consolidation-operator.ts` module so `storage.ts` can import\n// them without creating a `storage → semantic-consolidation →\n// codex-materialize-runner → storage` cycle. Re-exported here so existing\n// consumers that reach for `./semantic-consolidation.js` keep working.\nexport {\n CONSOLIDATION_OPERATORS,\n isConsolidationOperator,\n isSemanticConsolidationLlmOperator,\n isValidDerivedFromEntry,\n type ConsolidationOperator,\n type SemanticConsolidationLlmOperator,\n} from \"./consolidation-operator.js\";\n\nimport {\n CONSOLIDATION_OPERATORS as _CONSOLIDATION_OPERATORS,\n isConsolidationOperator as _isConsolidationOperator,\n isSemanticConsolidationLlmOperator as _isSemanticConsolidationLlmOperator,\n type ConsolidationOperator as _ConsolidationOperator,\n type SemanticConsolidationLlmOperator as _SemanticConsolidationLlmOperator,\n} from \"./consolidation-operator.js\";\n\nexport interface ConsolidationCluster {\n category: string;\n memories: MemoryFile[];\n overlapScore: number;\n canonicalContent?: string;\n}\n\nexport interface SemanticConsolidationResult {\n clustersFound: number;\n memoriesConsolidated: number;\n memoriesArchived: number;\n errors: number;\n clusters: ConsolidationCluster[];\n}\n\n/**\n * Find clusters of semantically similar memories using token overlap.\n */\nexport function findSimilarClusters(\n memories: MemoryFile[],\n config: {\n threshold: number;\n minClusterSize: number;\n excludeCategories: string[];\n maxPerRun: number;\n },\n): ConsolidationCluster[] {\n const excluded = new Set(config.excludeCategories);\n\n // Group by category first\n const byCategory = new Map<string, MemoryFile[]>();\n for (const m of memories) {\n const cat = m.frontmatter.category;\n if (excluded.has(cat)) continue;\n if (m.frontmatter.status && m.frontmatter.status !== \"active\") continue;\n const list = byCategory.get(cat) ?? [];\n list.push(m);\n byCategory.set(cat, list);\n }\n\n const clusters: ConsolidationCluster[] = [];\n let totalCandidates = 0;\n\n for (const [category, mems] of byCategory) {\n if (totalCandidates >= config.maxPerRun) break;\n\n // Token-normalize all memories in this category\n const tokenized = mems.map((m) => ({\n memory: m,\n tokens: new Set(normalizeRecallTokens(m.content, [])),\n }));\n\n // Track which memories are already clustered\n const clustered = new Set<string>();\n\n for (let i = 0; i < tokenized.length && totalCandidates < config.maxPerRun; i++) {\n const remainingBudget = config.maxPerRun - totalCandidates;\n if (remainingBudget < config.minClusterSize) break;\n if (clustered.has(tokenized[i].memory.frontmatter.id)) continue;\n\n const cluster: MemoryFile[] = [tokenized[i].memory];\n let totalOverlap = 0;\n let comparisons = 0;\n\n for (let j = i + 1; j < tokenized.length && cluster.length < remainingBudget; j++) {\n if (clustered.has(tokenized[j].memory.frontmatter.id)) continue;\n\n const aTokens = tokenized[i].tokens;\n const bTokens = tokenized[j].tokens;\n if (aTokens.size === 0 || bTokens.size === 0) continue;\n\n // Bidirectional overlap: what fraction of tokens are shared\n const overlap = countRecallTokenOverlap(aTokens, [...bTokens].join(\" \"));\n const maxTokens = Math.max(aTokens.size, bTokens.size);\n const score = maxTokens > 0 ? overlap / maxTokens : 0;\n\n if (score >= config.threshold) {\n cluster.push(tokenized[j].memory);\n totalOverlap += score;\n comparisons++;\n }\n }\n\n if (cluster.length >= config.minClusterSize) {\n for (const m of cluster) clustered.add(m.frontmatter.id);\n clusters.push({\n category,\n memories: cluster,\n overlapScore: comparisons > 0 ? totalOverlap / comparisons : 0,\n });\n totalCandidates += cluster.length;\n }\n }\n }\n\n return clusters;\n}\n\n/**\n * Build the LLM prompt for synthesizing a canonical memory from a cluster.\n */\nexport function buildConsolidationPrompt(cluster: ConsolidationCluster): string {\n const memoryTexts = cluster.memories\n .map(\n (m, i) =>\n `Memory ${i + 1} (${m.frontmatter.id}, created ${m.frontmatter.created}):\\n${m.content}`,\n )\n .join(\"\\n\\n\");\n\n return `You are a memory consolidation system. The following ${cluster.memories.length} memories in the \"${cluster.category}\" category contain overlapping information.\n\nSynthesize them into ONE canonical memory that:\n1. Preserves ALL unique information from every source memory\n2. Removes redundancy and repetition\n3. Uses clear, concise language\n4. Maintains the same category and tone\n5. Does NOT add information that isn't in the sources\n\n${memoryTexts}\n\nWrite ONLY the consolidated memory content (no metadata, no explanation, no preamble):`;\n}\n\n/**\n * Parse the LLM response to extract the canonical content.\n */\nexport function parseConsolidationResponse(response: string): string {\n return response.trim();\n}\n\n// ─── Operator-aware prompt / parse (issue #561 PR 3) ─────────────────────────\n\n/**\n * Structured result from an operator-aware consolidation LLM call.\n *\n * - `operator` — the consolidation operator the LLM chose for this cluster.\n * Falls back to the heuristic default when the LLM omits or returns an\n * unknown value (the parser never surfaces an invalid operator; see\n * `parseOperatorAwareConsolidationResponse`).\n * - `outputs` — the canonical memory bodies to persist, never empty.\n * MERGE and UPDATE always carry exactly one; SPLIT carries one body per\n * separated fact (#3566).\n */\nexport interface OperatorAwareConsolidationResult {\n // Restricted to the LLM-allowed subset (Cursor Bugbot, PR #730):\n // `pattern-reinforcement` is reserved for the maintenance job and\n // must never reach this struct from a consolidation LLM response.\n operator: _SemanticConsolidationLlmOperator;\n outputs: string[];\n}\n\n/**\n * Heuristic default operator for a cluster. Used as the fallback when the\n * LLM does not return a parseable operator, and as the \"floor\" decision in\n * `parseOperatorAwareConsolidationResponse`.\n *\n * Current heuristic (kept deliberately conservative — PR 3 only):\n *\n * - Two or more memories being collapsed into one canonical blob is a\n * MERGE by definition. This is the path the current clustering\n * pipeline exercises.\n * - A cluster of size 1 that still reaches consolidation (future path,\n * e.g. supersession of a single older memory by a newer value) is an\n * UPDATE.\n * - SPLIT is never selected by the heuristic: only the LLM can decide\n * that one logical source encodes several distinct facts. When it\n * does, the coordinator writes one canonical memory per output.\n */\nexport function chooseConsolidationOperator(\n cluster: ConsolidationCluster,\n): _SemanticConsolidationLlmOperator {\n if (cluster.memories.length <= 1) return \"update\";\n return \"merge\";\n}\n\n/**\n * Build the operator-aware LLM prompt. MERGE and UPDATE return\n * `{ \"operator\", \"output\" }`; SPLIT returns `{ \"operator\": \"split\",\n * \"outputs\": [...] }` with one canonical body per separated fact (#3566).\n */\nexport function buildOperatorAwareConsolidationPrompt(\n cluster: ConsolidationCluster,\n): string {\n const memoryTexts = cluster.memories\n .map(\n (m, i) =>\n `Memory ${i + 1} (${m.frontmatter.id}, created ${m.frontmatter.created}):\\n${m.content}`,\n )\n .join(\"\\n\\n\");\n\n return `You are a memory consolidation system. The following ${cluster.memories.length} memories in the \"${cluster.category}\" category contain overlapping information.\n\nPick exactly ONE consolidation operator for this cluster and return a JSON object.\n\nOperator vocabulary:\n - \"merge\" — multiple distinct source memories overlap and should be collapsed into one canonical memory (most common).\n - \"update\" — one source memory carries a stale value that a newer source supersedes within the same logical fact.\n - \"split\" — a single logical source really encodes multiple distinct facts that should be separated (rare). For split, replace \"output\" with \"outputs\": an array holding one canonical memory text per separated fact.\n\nOutput JSON ONLY, no prose before or after. The \"operator\" key MUST be set to exactly one of the three strings \"merge\", \"update\", or \"split\" — never a pipe-separated placeholder like \"merge|update|split\". Example shape:\n {\n \"operator\": \"merge\",\n \"output\": \"<the canonical memory text>\"\n }\nSplit shape:\n {\n \"operator\": \"split\",\n \"outputs\": [\"<first fact>\", \"<second fact>\"]\n }\n\nEach canonical memory text must:\n1. Preserve ALL unique information from every source memory\n2. Remove redundancy and repetition\n3. Use clear, concise language\n4. Match the \"${cluster.category}\" category and tone\n5. NOT add information that isn't in the sources\nFor split, the outputs together must hold all of the source information, and each output holds one fact.\n\n${memoryTexts}\n\nReturn ONLY the JSON object:`;\n}\n\n/**\n * Parse an operator-aware consolidation response.\n *\n * Contract:\n * - Accepts strict JSON `{ \"operator\": \"...\", \"output\": \"...\" }`.\n * - Tolerates a JSON payload wrapped in a fenced code block (```json ...```).\n * - Falls back to the heuristic operator when the JSON is malformed,\n * the `operator` field is missing / unknown, or the raw response is\n * a plain blob with no JSON at all. This keeps PR 3 backwards\n * compatible with older models that ignore the JSON instruction.\n * - Never throws. A missing / empty `output` field falls back to the\n * trimmed raw response so the caller still writes something rather\n * than dropping the cluster.\n */\nexport function parseOperatorAwareConsolidationResponse(\n response: string,\n cluster: ConsolidationCluster,\n): OperatorAwareConsolidationResult {\n const fallback: OperatorAwareConsolidationResult = {\n operator: chooseConsolidationOperator(cluster),\n outputs: [response.trim()],\n };\n\n const trimmed = response.trim();\n if (trimmed.length === 0) return fallback;\n\n // Strip a fenced code block if present.\n // Dropped the \\s* groups around the lazy body (they overlapped it and\n // backtracked polynomially — CodeQL js/polynomial-redos). Input is already\n // trimmed and fenced[1] is trimmed below, so matches are identical.\n const fenced = /^```(?:json)?([\\s\\S]*?)```$/u.exec(trimmed);\n const payload = fenced ? fenced[1].trim() : trimmed;\n\n // Find a balanced brace-delimited JSON object that has an `operator`\n // key (PR #632 round-4 review, codex P1). A first/last-brace slice\n // breaks when the model prepends an earlier brace block (e.g.\n // `Example: {\"note\":\"...\"} ... {\"operator\":\"merge\",...}`). Walk the\n // payload tracking nesting + string/escape state and skip past\n // objects that don't look like our target shape.\n const reply = CONSOLIDATION_LLM_REPLY.safeParse(findLastJsonObjectWithOperator(payload));\n if (!reply.success) return fallback;\n const rawOperator = reply.data.operator?.trim().toLowerCase() ?? \"\";\n const rawOutput = reply.data.output ?? \"\";\n\n // Narrow gate (Cursor Bugbot review on PR #730 head `aa1c2a8`):\n // accept ONLY the legacy split/merge/update LLM vocabulary here.\n // `pattern-reinforcement` joined the broader `ConsolidationOperator`\n // type in #687 PR 2/4 but is reserved for the maintenance job — if\n // an LLM hallucinates that operator we must NOT promote it onto\n // `derived_via`.\n const operator = _isSemanticConsolidationLlmOperator(rawOperator)\n ? rawOperator\n : chooseConsolidationOperator(cluster);\n const output = rawOutput.trim().length > 0 ? rawOutput.trim() : response.trim();\n const splitOutputs = (reply.data.outputs ?? []).map((entry) => entry.trim()).filter((entry) => entry.length > 0);\n if (operator === \"split\" && splitOutputs.length > 0) return { operator, outputs: splitOutputs };\n\n return { operator, outputs: [output] };\n}\n\n// Fields read from the model's JSON object; a wrong-typed field reads as absent.\nconst CONSOLIDATION_LLM_REPLY = z.object({\n operator: z.string().optional().catch(undefined),\n output: z.string().optional().catch(undefined),\n outputs: z.array(z.string()).optional().catch(undefined),\n});\n\n/**\n * Walk `text`, find all balanced top-level `{ ... }` blocks whose\n * JSON.parse result is an object with an `operator` key, and return\n * the LAST one (function name reflects this — PR #632 review,\n * cursor Low). Returns `undefined` when nothing matches. Tracks\n * string state + escape sequences so braces inside string values\n * don't throw off the depth counter.\n *\n * Used by `parseOperatorAwareConsolidationResponse` to tolerate models\n * that prepend an explanatory JSON example block before the real\n * payload (PR #632 round-4 + round-5 review, codex P1). We take the\n * LAST candidate so that an instructional example with an `operator`\n * key ahead of the real answer doesn't steal precedence — models\n * typically write the example first and the real answer last.\n */\nfunction findLastJsonObjectWithOperator(text: string): unknown {\n let searchFrom = 0;\n let last: unknown = undefined;\n while (searchFrom < text.length) {\n const start = text.indexOf(\"{\", searchFrom);\n if (start < 0) return last;\n let depth = 0;\n let inString = false;\n let escape = false;\n let closed = false;\n let endIdx = -1;\n for (let i = start; i < text.length; i++) {\n const ch = text[i];\n if (inString) {\n if (escape) {\n escape = false;\n } else if (ch === \"\\\\\") {\n escape = true;\n } else if (ch === '\"') {\n inString = false;\n }\n continue;\n }\n if (ch === '\"') {\n inString = true;\n } else if (ch === \"{\") {\n depth += 1;\n } else if (ch === \"}\") {\n depth -= 1;\n if (depth === 0) {\n closed = true;\n endIdx = i;\n break;\n }\n }\n }\n if (!closed) return last;\n const slice = text.slice(start, endIdx + 1);\n try {\n const parsed = JSON.parse(slice);\n if (\n typeof parsed === \"object\" &&\n parsed !== null &&\n \"operator\" in (parsed as Record<string, unknown>)\n ) {\n last = parsed;\n }\n } catch {\n // Fall through to the next candidate.\n }\n searchFrom = endIdx + 1;\n }\n return last;\n}\n\n// Silence unused-import warnings when tsup tree-shakes: these are used\n// above in chooseConsolidationOperator + parse helpers.\nvoid _CONSOLIDATION_OPERATORS;\n\n/**\n * Discover extensions and build the block to append to a consolidation prompt.\n * Returns \"\" when extensions are disabled or none are found.\n */\nexport async function buildExtensionsBlockForConsolidation(\n config: PluginConfig,\n): Promise<string> {\n if (!resolvePipelineProcessingCapabilities(config).memoryExtensions) return \"\";\n const root = resolveExtensionsRoot(config);\n const extensions = await discoverMemoryExtensions(root, log);\n if (extensions.length === 0) return \"\";\n return renderExtensionsBlock(extensions);\n}\n\n/**\n * Optional post-consolidation hook — materializes the namespace into Codex's\n * native memory layout when the consolidation run finishes. Kept here (rather\n * than in orchestrator.ts) so #378 doesn't conflict with Wave 1 edits.\n *\n * Safe to call regardless of config state: honors `codexMaterializeMemories`\n * and `codexMaterializeOnConsolidation` and silently becomes a no-op when\n * either is disabled.\n */\nexport async function materializeAfterSemanticConsolidation(options: {\n config: PluginConfig;\n namespace?: string;\n memories?: MemoryFile[];\n memoryDir?: string;\n codexHome?: string;\n rolloutSummaries?: RolloutSummaryInput[];\n now?: Date;\n}): Promise<MaterializeResult | null> {\n // Delegates to the shared post-consolidation helper so semantic and causal\n // flows stay in lock-step — any guard/logging change happens in one place.\n return runPostConsolidationMaterialize(\"[semantic-consolidation]\", options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAQA,SAAS,SAAS;AAsDX,SAAS,oBACd,UACA,QAMwB;AACxB,QAAM,WAAW,IAAI,IAAI,OAAO,iBAAiB;AAGjD,QAAM,aAAa,oBAAI,IAA0B;AACjD,aAAW,KAAK,UAAU;AACxB,UAAM,MAAM,EAAE,YAAY;AAC1B,QAAI,SAAS,IAAI,GAAG,EAAG;AACvB,QAAI,EAAE,YAAY,UAAU,EAAE,YAAY,WAAW,SAAU;AAC/D,UAAM,OAAO,WAAW,IAAI,GAAG,KAAK,CAAC;AACrC,SAAK,KAAK,CAAC;AACX,eAAW,IAAI,KAAK,IAAI;AAAA,EAC1B;AAEA,QAAM,WAAmC,CAAC;AAC1C,MAAI,kBAAkB;AAEtB,aAAW,CAAC,UAAU,IAAI,KAAK,YAAY;AACzC,QAAI,mBAAmB,OAAO,UAAW;AAGzC,UAAM,YAAY,KAAK,IAAI,CAAC,OAAO;AAAA,MACjC,QAAQ;AAAA,MACR,QAAQ,IAAI,IAAI,sBAAsB,EAAE,SAAS,CAAC,CAAC,CAAC;AAAA,IACtD,EAAE;AAGF,UAAM,YAAY,oBAAI,IAAY;AAElC,aAAS,IAAI,GAAG,IAAI,UAAU,UAAU,kBAAkB,OAAO,WAAW,KAAK;AAC/E,YAAM,kBAAkB,OAAO,YAAY;AAC3C,UAAI,kBAAkB,OAAO,eAAgB;AAC7C,UAAI,UAAU,IAAI,UAAU,CAAC,EAAE,OAAO,YAAY,EAAE,EAAG;AAEvD,YAAM,UAAwB,CAAC,UAAU,CAAC,EAAE,MAAM;AAClD,UAAI,eAAe;AACnB,UAAI,cAAc;AAElB,eAAS,IAAI,IAAI,GAAG,IAAI,UAAU,UAAU,QAAQ,SAAS,iBAAiB,KAAK;AACjF,YAAI,UAAU,IAAI,UAAU,CAAC,EAAE,OAAO,YAAY,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,WAAW,QACX,cAAe,QACf;AACA,eAAO;AAAA,MACT;AAAA,IACF,QAAQ;AAAA,IAER;AACA,iBAAa,SAAS;AAAA,EACxB;AACA,SAAO;AACT;AAUA,eAAsB,qCACpB,QACiB;AACjB,MAAI,CAAC,sCAAsC,MAAM,EAAE,iBAAkB,QAAO;AAC5E,QAAM,OAAO,sBAAsB,MAAM;AACzC,QAAM,aAAa,MAAM,yBAAyB,MAAM,GAAG;AAC3D,MAAI,WAAW,WAAW,EAAG,QAAO;AACpC,SAAO,sBAAsB,UAAU;AACzC;AAWA,eAAsB,sCAAsC,SAQtB;AAGpC,SAAO,gCAAgC,4BAA4B,OAAO;AAC5E;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listNamespaces
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YE77U5HZ.js";
|
|
4
4
|
import {
|
|
5
5
|
corpusScanWorker
|
|
6
6
|
} from "./chunk-4LZ7SVKM.js";
|
|
@@ -292,4 +292,4 @@ export {
|
|
|
292
292
|
computeServiceCorpusWatermarks,
|
|
293
293
|
computeServiceCorpusCensus
|
|
294
294
|
};
|
|
295
|
-
//# sourceMappingURL=chunk-
|
|
295
|
+
//# sourceMappingURL=chunk-ZJ3CEAJD.js.map
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-TSUSHXBW.js";
|
|
15
15
|
import {
|
|
16
16
|
iterateOfflineSyncSnapshotFileRecords
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DNXQVCIC.js";
|
|
18
18
|
|
|
19
19
|
// src/access-offline-manifest.ts
|
|
20
20
|
import * as nodePath from "path";
|
|
@@ -250,4 +250,4 @@ export {
|
|
|
250
250
|
retainExcludedClassifications,
|
|
251
251
|
createOfflineSyncManifestStream
|
|
252
252
|
};
|
|
253
|
-
//# sourceMappingURL=chunk-
|
|
253
|
+
//# sourceMappingURL=chunk-ZYP4YEEI.js.map
|