@remnic/core 9.65.7 → 9.66.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 +15 -14
- package/dist/access-admin-ops-surface.js +65 -62
- package/dist/access-authorization-probe.d.ts +15 -14
- package/dist/access-authorization-probe.js +66 -63
- package/dist/access-boundary.d.ts +15 -14
- package/dist/access-boundary.js +65 -62
- package/dist/access-citation-namespace.js +3 -3
- package/dist/access-cli.js +182 -174
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +2 -2
- package/dist/access-coding-context-resolution.js +2 -2
- package/dist/access-extraction-force-flush.d.ts +15 -14
- package/dist/access-extraction-force-flush.js +65 -62
- package/dist/access-health-types.d.ts +2 -2
- package/dist/access-http-lcm-compaction.d.ts +15 -14
- package/dist/access-http-lifecycle-flush.d.ts +15 -14
- package/dist/access-http-offline-stream.d.ts +15 -14
- package/dist/access-http-query.d.ts +3 -3
- package/dist/access-http-query.js +67 -64
- package/dist/access-http.d.ts +16 -15
- package/dist/access-http.js +87 -84
- package/dist/access-identity-continuity-surface.d.ts +13 -12
- package/dist/access-identity-continuity-surface.js +65 -62
- package/dist/access-lcm-surface.d.ts +15 -14
- package/dist/access-lcm-surface.js +65 -62
- package/dist/access-mcp-output-schemas.js +1 -1
- package/dist/access-mcp.d.ts +15 -14
- package/dist/access-mcp.js +77 -74
- package/dist/access-memory-search-fanout.d.ts +3 -3
- package/dist/{access-namespace-preflight-8VYKmRX0.d.ts → access-namespace-preflight-CLWUoMyW.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +4 -4
- package/dist/access-namespace-preflight.js +65 -62
- package/dist/access-observe-write-surface.d.ts +15 -14
- package/dist/access-observe-write-surface.js +65 -62
- package/dist/access-offline-manifest.d.ts +13 -12
- package/dist/access-offline-manifest.js +16 -16
- package/dist/access-operations-batch.js +69 -66
- package/dist/access-operations.d.ts +16 -15
- package/dist/access-operations.js +74 -71
- package/dist/access-recall-concurrency.d.ts +15 -14
- package/dist/access-recall-concurrency.js +65 -62
- package/dist/access-recall-response.d.ts +15 -14
- package/dist/access-recall-response.js +65 -62
- package/dist/access-recall-surface.d.ts +15 -14
- package/dist/access-recall-surface.js +65 -62
- package/dist/access-schema.js +7 -7
- package/dist/{access-service-Crk__Git.d.ts → access-service-CEUE1Isj.d.ts} +14 -14
- package/dist/access-service-helpers.d.ts +15 -14
- package/dist/access-service.d.ts +15 -14
- package/dist/access-service.js +65 -62
- package/dist/access-surface-catalog.d.ts +15 -14
- package/dist/access-surface-catalog.js +69 -64
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +6 -4
- package/dist/action-confidence.d.ts +2 -2
- package/dist/active-context-config.d.ts +27 -0
- package/dist/active-context-config.js +14 -0
- package/dist/active-context-transform.d.ts +267 -0
- package/dist/active-context-transform.js +31 -0
- package/dist/active-memory-bridge.d.ts +2 -2
- package/dist/active-memory-bridge.js +2 -2
- package/dist/active-recall.d.ts +2 -2
- package/dist/active-recall.js +17 -16
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +7 -7
- package/dist/adapters/registry.js +3 -3
- package/dist/ambient-provenance.d.ts +2 -2
- package/dist/artifact-search.d.ts +2 -2
- package/dist/{auto-sync-XVMLL2RH.js → auto-sync-Q6Q2FVSC.js} +10 -10
- package/dist/behavior-learner.d.ts +2 -2
- package/dist/behavior-signals.d.ts +2 -2
- package/dist/bootstrap.d.ts +13 -12
- package/dist/briefing-window.d.ts +5 -3
- package/dist/briefing.d.ts +5 -3
- package/dist/briefing.js +33 -33
- package/dist/buffer-surprise-report.d.ts +2 -2
- package/dist/buffer-turn-helpers.d.ts +2 -2
- package/dist/buffer.d.ts +5 -3
- package/dist/buffer.js +24 -8
- package/dist/bulk-import/index.d.ts +4 -4
- package/dist/calibration.d.ts +2 -2
- package/dist/calibration.js +1 -1
- package/dist/capabilities.d.ts +2 -2
- package/dist/{capsule-merge-SGIVB3WA.js → capsule-merge-SEHERWWP.js} +4 -4
- package/dist/{catalog-DybwVNW3.d.ts → catalog-D1HgugTA.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +4 -4
- package/dist/causal-consolidation.d.ts +2 -2
- package/dist/causal-consolidation.js +34 -34
- package/dist/causal-trajectory-graph.d.ts +2 -2
- package/dist/{chunk-CFGU52XJ.js → chunk-23CVL7HS.js} +2 -2
- package/dist/{chunk-PO7NXBG2.js → chunk-2GF27PGH.js} +5 -5
- package/dist/{chunk-6CPUQ5D6.js → chunk-2LBAFHOQ.js} +15 -15
- package/dist/{chunk-JBPKEARU.js → chunk-2QSZNTDO.js} +7 -7
- package/dist/{chunk-IP4ZNT4U.js → chunk-33MFRY25.js} +2 -2
- package/dist/{chunk-VFYRYFLL.js → chunk-3TSU662L.js} +3 -3
- package/dist/chunk-43HUVDTD.js +114 -0
- package/dist/chunk-43HUVDTD.js.map +1 -0
- package/dist/{chunk-VXVZ2GM3.js → chunk-4FHRZD5T.js} +2 -2
- package/dist/{chunk-FP7YTTVO.js → chunk-4OFKZAJG.js} +2 -1
- package/dist/chunk-4OFKZAJG.js.map +1 -0
- package/dist/{chunk-5VPQSRQO.js → chunk-4STAANV7.js} +3 -3
- package/dist/{chunk-46WM6JX2.js → chunk-4ZWCQJNM.js} +5 -5
- package/dist/{chunk-LLQCM2U2.js → chunk-56IV4J5W.js} +617 -167
- package/dist/chunk-56IV4J5W.js.map +1 -0
- package/dist/{chunk-52II7PB6.js → chunk-645WOU5I.js} +4 -4
- package/dist/{chunk-YKWFK7XA.js → chunk-6CEGSTBD.js} +7 -7
- package/dist/{chunk-I7EX6KSH.js → chunk-6QDXA26G.js} +264 -210
- package/dist/chunk-6QDXA26G.js.map +1 -0
- package/dist/{chunk-GEPACVWN.js → chunk-6RUHELWR.js} +3 -3
- package/dist/{chunk-ZAOHJDKH.js → chunk-72OIT7KS.js} +4 -4
- package/dist/{chunk-KQAFEZQX.js → chunk-7LCGFUMB.js} +4 -4
- package/dist/{chunk-7TCGNUVP.js → chunk-7UTDHQZ5.js} +3 -3
- package/dist/{chunk-5HK3CJAR.js → chunk-7XOG75AU.js} +3 -3
- package/dist/{chunk-7BDZTALN.js → chunk-AJTG3CP7.js} +12 -2
- package/dist/chunk-AJTG3CP7.js.map +1 -0
- package/dist/{chunk-2LWQSV6A.js → chunk-AL3UYZ5N.js} +3 -2
- package/dist/chunk-AL3UYZ5N.js.map +1 -0
- package/dist/chunk-B32WYRXX.js +77 -0
- package/dist/chunk-B32WYRXX.js.map +1 -0
- package/dist/{chunk-C24UZSFW.js → chunk-CEH2AFXG.js} +6 -6
- package/dist/{chunk-YOXVZJFM.js → chunk-CFVTRUR3.js} +2 -2
- package/dist/{chunk-ACOC27BB.js → chunk-CN4VKV3S.js} +2 -2
- package/dist/{chunk-PMVPCZJZ.js → chunk-CTCGHNWN.js} +6 -6
- package/dist/{chunk-EGBDFJ36.js → chunk-DD5JFCWM.js} +2 -2
- package/dist/{chunk-T42L3S6A.js → chunk-DDX6KIXF.js} +2 -2
- package/dist/{chunk-JIYDRBVZ.js → chunk-DJORULH3.js} +2 -2
- package/dist/{chunk-WTOZBZNN.js → chunk-DMEHOEC7.js} +6 -6
- package/dist/{chunk-OPPBTPUU.js → chunk-DUAJKRR2.js} +4 -4
- package/dist/{chunk-XDL5CYZN.js → chunk-EEOUMG3J.js} +2 -1
- package/dist/{chunk-XDL5CYZN.js.map → chunk-EEOUMG3J.js.map} +1 -1
- package/dist/{chunk-SVVIASVX.js → chunk-EFQCDJZ2.js} +7 -7
- package/dist/{chunk-Q57GOHLF.js → chunk-EGALNSZ4.js} +3 -3
- package/dist/{chunk-KCT36JAW.js → chunk-ESNFSSO4.js} +2 -2
- package/dist/{chunk-XQ3HXAQH.js → chunk-ET2CNMLD.js} +4 -4
- package/dist/{chunk-Z4U3UN56.js → chunk-EZSCW4EM.js} +6 -6
- package/dist/{chunk-F6QHHRWP.js → chunk-FESUGFIL.js} +3 -3
- package/dist/{chunk-S3K2CIK5.js → chunk-FKKGCGYL.js} +3 -3
- package/dist/{chunk-BWGCOLEL.js → chunk-FTTJRVB7.js} +2 -2
- package/dist/{chunk-JAQXUGLN.js → chunk-FYWLSFFS.js} +2 -2
- package/dist/{chunk-BJTHRFFC.js → chunk-GEJKYA7D.js} +77 -36
- package/dist/chunk-GEJKYA7D.js.map +1 -0
- package/dist/chunk-GSKINLAK.js +267 -0
- package/dist/chunk-GSKINLAK.js.map +1 -0
- package/dist/{chunk-OPGL46PX.js → chunk-GX6FTSYH.js} +2 -2
- package/dist/{chunk-A32YEQAM.js → chunk-H7VDIF2V.js} +2 -2
- package/dist/{chunk-PDDSFELN.js → chunk-HJXA6ZM7.js} +2 -2
- package/dist/{chunk-RGCF4XNH.js → chunk-HNPE66LB.js} +8 -8
- package/dist/{chunk-SEA6M7SS.js → chunk-I5VB44ZK.js} +2 -2
- package/dist/{chunk-SDEPLF7V.js → chunk-IBJ6U753.js} +2 -2
- package/dist/{chunk-EUYWQ7TS.js → chunk-IEZ6CGTW.js} +2 -2
- package/dist/{chunk-RQE4TITU.js → chunk-IHGMRDEE.js} +431 -1834
- package/dist/chunk-IHGMRDEE.js.map +1 -0
- package/dist/{chunk-3RI5Y7KU.js → chunk-IVIAHQBR.js} +2 -2
- package/dist/{chunk-7WR462EM.js → chunk-J3OND5QT.js} +4 -4
- package/dist/{chunk-UW5NPZJ2.js → chunk-JALOAKSZ.js} +59 -7
- package/dist/chunk-JALOAKSZ.js.map +1 -0
- package/dist/{chunk-T3JQTCCO.js → chunk-JI7U6AS3.js} +4 -4
- package/dist/{chunk-DVYRD4HY.js → chunk-JRRQ747T.js} +36 -7
- package/dist/chunk-JRRQ747T.js.map +1 -0
- package/dist/{chunk-I32NKXE2.js → chunk-JTWZKNUH.js} +5 -5
- package/dist/chunk-K66OY4EI.js +202 -0
- package/dist/chunk-K66OY4EI.js.map +1 -0
- package/dist/{chunk-XAB6STPO.js → chunk-KODXCHXJ.js} +17 -3
- package/dist/chunk-KODXCHXJ.js.map +1 -0
- package/dist/{chunk-ZPUIRTIZ.js → chunk-KOLJJN5G.js} +12 -75
- package/dist/chunk-KOLJJN5G.js.map +1 -0
- package/dist/{chunk-FMQ4MOQO.js → chunk-KXIXO76C.js} +32 -19
- package/dist/chunk-KXIXO76C.js.map +1 -0
- package/dist/{chunk-VKCAHCBI.js → chunk-L4X4PJYK.js} +2 -2
- package/dist/chunk-LB7WCZHY.js +553 -0
- package/dist/chunk-LB7WCZHY.js.map +1 -0
- package/dist/{chunk-W4BMEGQA.js → chunk-LUDBXTBJ.js} +8 -8
- package/dist/{chunk-I4343FIA.js → chunk-MAH64N55.js} +28 -10
- package/dist/chunk-MAH64N55.js.map +1 -0
- package/dist/{chunk-RIAM7DND.js → chunk-ME35HVDJ.js} +2 -2
- package/dist/{chunk-H63EDPFJ.js → chunk-MI2OTWV5.js} +15 -2
- package/dist/{chunk-H63EDPFJ.js.map → chunk-MI2OTWV5.js.map} +1 -1
- package/dist/{chunk-LBFFNDFM.js → chunk-MINHJ55X.js} +1 -1
- package/dist/chunk-MINHJ55X.js.map +1 -0
- package/dist/{chunk-NG3MBQV4.js → chunk-MJRGVXPQ.js} +2 -2
- package/dist/{chunk-773TRRGT.js → chunk-MJUCDM3C.js} +2 -2
- package/dist/{chunk-7F27PCSN.js → chunk-MN5NOOI7.js} +2 -2
- package/dist/{chunk-JCWY73FK.js → chunk-N4F7ZSSG.js} +2 -2
- package/dist/{chunk-TR7DGXGI.js → chunk-NACLNNFQ.js} +5 -5
- package/dist/{chunk-LC2BDILZ.js → chunk-NBP4EX5N.js} +2 -2
- package/dist/{chunk-ZVPVTPGI.js → chunk-NNZFPYYX.js} +4 -4
- package/dist/{chunk-MFOSZUIT.js → chunk-NPIBN2VL.js} +2 -2
- package/dist/{chunk-IY7UXD3J.js → chunk-O57GM3FR.js} +2 -2
- package/dist/{chunk-I2HTKOOP.js → chunk-O7ERGZDA.js} +5 -5
- package/dist/{chunk-GTSVEEP3.js → chunk-OAJMQKQR.js} +3 -3
- package/dist/{chunk-HSZMX3ZJ.js → chunk-ODW5GDFE.js} +2 -2
- package/dist/{chunk-D4QVPP3G.js → chunk-PEBH5DCK.js} +18 -11
- package/dist/chunk-PEBH5DCK.js.map +1 -0
- package/dist/{chunk-J2WC5LF4.js → chunk-QBC33MPY.js} +2 -1
- package/dist/{chunk-EOHKUWXW.js → chunk-QCRJMU5V.js} +2 -2
- package/dist/chunk-QJCWK2A7.js +1466 -0
- package/dist/chunk-QJCWK2A7.js.map +1 -0
- package/dist/{chunk-THG4GYIE.js → chunk-RDGKVH6T.js} +11 -7
- package/dist/{chunk-THG4GYIE.js.map → chunk-RDGKVH6T.js.map} +1 -1
- package/dist/{chunk-5DH6PG4B.js → chunk-RZ3IZIJG.js} +3 -3
- package/dist/{chunk-AAXJNINV.js → chunk-SN4JXNLL.js} +2 -2
- package/dist/chunk-TB2MJRI6.js +866 -0
- package/dist/chunk-TB2MJRI6.js.map +1 -0
- package/dist/{chunk-7PHI6GUI.js → chunk-TEZ2HTC7.js} +42 -2
- package/dist/chunk-TEZ2HTC7.js.map +1 -0
- package/dist/{chunk-SVSRPG6M.js → chunk-TNGH4ZYI.js} +2 -2
- package/dist/{chunk-HZNYJN77.js → chunk-TNXNECAN.js} +6 -6
- package/dist/{chunk-JOEJG4SD.js → chunk-TVW4C7PV.js} +5 -5
- package/dist/{chunk-UFKPQBXH.js → chunk-U62OK7BB.js} +2 -2
- package/dist/{chunk-R2MZCYA6.js → chunk-UNUMFURP.js} +3 -3
- package/dist/{chunk-AX7UXCHJ.js → chunk-UYA36DQ7.js} +2 -1
- package/dist/chunk-UYA36DQ7.js.map +1 -0
- package/dist/{chunk-AFR6AIM4.js → chunk-VCKWULAK.js} +112 -87
- package/dist/chunk-VCKWULAK.js.map +1 -0
- package/dist/chunk-VOSWUO3K.js +100 -0
- package/dist/chunk-VOSWUO3K.js.map +1 -0
- package/dist/{chunk-YRVAKONL.js → chunk-VQ4AMTGZ.js} +1 -1
- package/dist/{chunk-3BCULS4U.js → chunk-VQNRICAQ.js} +145 -507
- package/dist/chunk-VQNRICAQ.js.map +1 -0
- package/dist/{chunk-RAIUTAZZ.js → chunk-WKAXBXVA.js} +2 -2
- package/dist/{chunk-ZIJDI4CP.js → chunk-WKJFIMVN.js} +2 -2
- package/dist/{chunk-SXIMQLGV.js → chunk-WVGXCBOC.js} +2 -2
- package/dist/{chunk-7BEPVIH3.js → chunk-X5YYSAZX.js} +4 -4
- package/dist/{chunk-FZEEWOI2.js → chunk-XJJYSX6F.js} +2 -2
- package/dist/{chunk-F635GAL7.js → chunk-XKNHFDTT.js} +33 -13
- package/dist/chunk-XKNHFDTT.js.map +1 -0
- package/dist/{chunk-UG6VXIOK.js → chunk-XSTNGNJP.js} +2 -2
- package/dist/{chunk-YDPAE2RD.js → chunk-YFLLGRXO.js} +2 -2
- package/dist/{chunk-EZ25VE3G.js → chunk-YNDLCWXS.js} +4 -4
- package/dist/{chunk-ANJXPFRS.js → chunk-YXFCALVT.js} +14 -14
- package/dist/{chunk-Q4WONDMJ.js → chunk-YYGZJPOK.js} +2 -2
- package/dist/{chunk-5HERQ5FX.js → chunk-Z3YEGSR4.js} +10 -10
- package/dist/{chunk-YWSQD2IB.js → chunk-ZJPM7GZ3.js} +2 -2
- package/dist/{chunk-5S4LQOPE.js → chunk-ZW4VXELZ.js} +2 -2
- package/dist/{cli-B322UMvB.d.ts → cli-BEkm2MEf.d.ts} +5 -5
- package/dist/cli.d.ts +17 -16
- package/dist/cli.js +126 -120
- package/dist/coding/export-okf-codegraph.d.ts +56 -0
- package/dist/coding/export-okf-codegraph.js +526 -0
- package/dist/coding/export-okf-codegraph.js.map +1 -0
- package/dist/coding/pre-action-gate.d.ts +2 -2
- package/dist/compounding/engine.d.ts +5 -3
- package/dist/compounding/engine.js +34 -34
- package/dist/compounding/preference-consolidator.d.ts +4 -4
- package/dist/compression-optimizer.d.ts +2 -2
- package/dist/config-security.js +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/config.js +17 -16
- package/dist/connectors/codex-materialize-runner.d.ts +2 -2
- package/dist/connectors/codex-materialize-runner.js +33 -33
- package/dist/connectors/codex-materialize.d.ts +2 -2
- package/dist/connectors/index.d.ts +2 -2
- package/dist/connectors/index.js +33 -33
- package/dist/consolidation-provenance-check.d.ts +5 -3
- package/dist/consolidation-provenance-check.js +5 -5
- package/dist/consolidation-undo.d.ts +5 -3
- package/dist/consolidation-undo.js +3 -3
- package/dist/context-summary.d.ts +43 -0
- package/dist/context-summary.js +14 -0
- package/dist/context-summary.js.map +1 -0
- package/dist/contradiction/index.d.ts +6 -4
- package/dist/contradiction/index.js +10 -10
- package/dist/{contradiction-scan-AKUWPX5N.js → contradiction-scan-NOYMFG66.js} +3 -3
- package/dist/contradiction-scan-NOYMFG66.js.map +1 -0
- package/dist/converge-config.d.ts +2 -2
- package/dist/convergence-refresh.d.ts +5 -3
- package/dist/convergence-refresh.js +36 -36
- package/dist/conversation-index/backend.d.ts +2 -2
- package/dist/conversation-index/chunker.d.ts +2 -2
- package/dist/conversation-index/faiss-adapter.d.ts +2 -2
- package/dist/conversation-index/indexer.d.ts +2 -2
- package/dist/conversation-index/search.d.ts +2 -2
- package/dist/corpus-watermark.d.ts +2 -2
- package/dist/corpus-watermark.js +35 -35
- package/dist/cross-lingual-recall.d.ts +2 -2
- package/dist/dashboard-runtime.js +2 -2
- package/dist/day-summary.d.ts +2 -2
- package/dist/delinearize.d.ts +2 -2
- package/dist/dependency-propagation-config.d.ts +2 -2
- package/dist/{dependency-propagation-delivery-BGcNairQ.d.ts → dependency-propagation-delivery-BCpeo14F.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +2 -2
- package/dist/direct-answer.d.ts +2 -2
- package/dist/embedding-fallback.d.ts +2 -2
- package/dist/enrichment/index.d.ts +2 -2
- package/dist/entity-origin-fields.d.ts +2 -2
- package/dist/entity-retrieval.d.ts +5 -3
- package/dist/entity-retrieval.js +34 -34
- package/dist/entity-schema.d.ts +2 -2
- package/dist/episodic-context.d.ts +2 -2
- package/dist/eval-trajectory-contracts.d.ts +2 -2
- package/dist/eval-trajectory-store.d.ts +2 -2
- package/dist/eval-trajectory.d.ts +2 -2
- package/dist/event-order-recall.js +3 -3
- package/dist/explicit-capture.d.ts +13 -12
- package/dist/explicit-capture.js +12 -12
- package/dist/external-wiki-access.d.ts +15 -14
- package/dist/external-wiki-access.js +66 -63
- package/dist/external-wiki-collection-registration.d.ts +2 -2
- package/dist/external-wiki-collection.d.ts +2 -2
- package/dist/external-wiki-mcp-tools.d.ts +15 -14
- package/dist/extraction-error-classification.d.ts +2 -2
- package/dist/extraction-faithfulness.d.ts +2 -2
- package/dist/extraction-faithfulness.js +2 -2
- package/dist/extraction-judge-telemetry.d.ts +2 -2
- package/dist/extraction-judge-training.d.ts +2 -2
- package/dist/extraction-judge.d.ts +2 -2
- package/dist/extraction-judge.js +2 -2
- package/dist/extraction-liveness.d.ts +2 -2
- package/dist/extraction-normalization.d.ts +2 -2
- package/dist/extraction-prompt.d.ts +2 -2
- package/dist/extraction-source-grounding-rules.d.ts +2 -2
- package/dist/extraction-source-grounding.d.ts +2 -2
- package/dist/extraction.d.ts +2 -2
- package/dist/extraction.js +47 -44
- package/dist/fallback-llm.d.ts +8 -2
- package/dist/fallback-llm.js +1 -1
- package/dist/{first-start-migration-4NETATFF.js → first-start-migration-KHIMCBIC.js} +3 -3
- package/dist/{forget-SZ2BXDGF.js → forget-2AE4MDK3.js} +3 -3
- package/dist/graph-dashboard-diff.d.ts +2 -2
- package/dist/graph-dashboard-key.d.ts +2 -2
- package/dist/graph-dashboard-parser.d.ts +2 -2
- package/dist/graph-edge-reinforcement.d.ts +2 -2
- package/dist/graph-path-reconstruction.d.ts +2 -2
- package/dist/graph-path-scoring.d.ts +2 -2
- package/dist/graph-snapshot.d.ts +2 -2
- package/dist/graph.d.ts +2 -2
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/importance.d.ts +2 -2
- package/dist/importers/index.d.ts +2 -2
- package/dist/in-flight-reads.d.ts +2 -2
- package/dist/{index-By2QUAMh.d.ts → index-D_pyMUaP.d.ts} +2 -2
- package/dist/index.d.ts +261 -30
- package/dist/index.js +321 -257
- package/dist/intent.d.ts +2 -2
- package/dist/lcm/engine.d.ts +3 -3
- package/dist/lcm/engine.js +5 -4
- package/dist/lcm/index.d.ts +4 -3
- package/dist/lcm/index.js +12 -11
- package/dist/lcm/summarizer.d.ts +4 -6
- package/dist/lcm/summarizer.js +2 -1
- package/dist/lcm/tools.d.ts +4 -4
- package/dist/lifecycle.d.ts +2 -2
- package/dist/live-connectors-runner.d.ts +2 -2
- package/dist/local-llm.d.ts +2 -2
- package/dist/local-model-endpoint.d.ts +2 -2
- package/dist/location/index.d.ts +315 -6
- package/dist/location/index.js +151 -19
- package/dist/maintenance/memory-governance.d.ts +2 -2
- package/dist/maintenance/memory-governance.js +34 -34
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +5 -3
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +33 -33
- package/dist/maintenance/rebuild-memory-projection.d.ts +5 -3
- package/dist/maintenance/rebuild-memory-projection.js +35 -35
- package/dist/{maintenance-Dm2McrIx.d.ts → maintenance-DDUX9d6D.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +15 -14
- package/dist/mcp-read-only-tools.js +1 -1
- package/dist/memory-action-policy.d.ts +18 -3
- package/dist/memory-action-policy.js +3 -1
- package/dist/memory-cache.d.ts +2 -2
- package/dist/memory-controller.d.ts +2 -2
- package/dist/memory-controller.js +2 -2
- package/dist/memory-lifecycle-ledger-utils.d.ts +2 -2
- package/dist/memory-projection-mutations.js +3 -3
- package/dist/memory-projection-store.d.ts +2 -2
- package/dist/memory-projection-store.js +1 -1
- package/dist/memory-provenance.d.ts +2 -2
- package/dist/memory-snapshot.d.ts +2 -2
- package/dist/memory-subject-cli.d.ts +15 -14
- package/dist/memory-subject.d.ts +15 -14
- package/dist/memory-subject.js +5 -5
- package/dist/memory-worth-outcomes.d.ts +5 -3
- package/dist/models-json.d.ts +2 -2
- package/dist/namespaces/migrate.d.ts +6 -4
- package/dist/namespaces/migrate.js +34 -34
- package/dist/namespaces/principal.d.ts +2 -2
- package/dist/namespaces/search.d.ts +2 -2
- package/dist/namespaces/search.js +8 -8
- package/dist/namespaces/storage.d.ts +6 -4
- package/dist/namespaces/storage.js +33 -33
- package/dist/native-knowledge.d.ts +2 -2
- package/dist/offline-sync-file-io.js +3 -3
- package/dist/offline-sync-impression-drain.d.ts +2 -2
- package/dist/offline-sync-impression-drain.js +9 -9
- package/dist/offline-sync.js +4 -4
- package/dist/operator-doctor-corpus.d.ts +2 -2
- package/dist/operator-doctor-corpus.js +36 -36
- package/dist/operator-doctor-replica.d.ts +2 -2
- package/dist/operator-toolkit.d.ts +6 -4
- package/dist/operator-toolkit.js +56 -55
- package/dist/orchestration/compression-guideline-coordinator.d.ts +5 -3
- package/dist/orchestration/maintenance.d.ts +7 -5
- package/dist/orchestration/maintenance.js +48 -47
- package/dist/{orchestrator-Co1DyfuP.d.ts → orchestrator-3F4jihCo.d.ts} +8 -8
- package/dist/orchestrator.d.ts +13 -12
- package/dist/orchestrator.js +182 -174
- package/dist/page-versioning.js +3 -3
- package/dist/patterns-cli.d.ts +2 -2
- package/dist/{pipeline-DotMnb6y.d.ts → pipeline-CB1dj6Uh.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +2 -2
- package/dist/proactive-contention.d.ts +2 -2
- package/dist/provenance.d.ts +2 -2
- package/dist/{public-http-PJRtnSi-.d.ts → public-http-34-JIAGQ.d.ts} +1 -1
- package/dist/{purge-GB7PZHT2.js → purge-OP6BEDFY.js} +2 -2
- package/dist/{qmd-BP0n11fR.d.ts → qmd-edLLZXc5.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +3 -3
- package/dist/qmd-recall-cache.d.ts +2 -2
- package/dist/qmd.d.ts +3 -3
- package/dist/qmd.js +4 -4
- package/dist/recall-concurrency-config.d.ts +2 -2
- package/dist/recall-disclosure-escalation.d.ts +2 -2
- package/dist/recall-explain-renderer.d.ts +2 -2
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +2 -2
- package/dist/recall-planner-llm.d.ts +2 -2
- package/dist/recall-planner-llm.js +1 -1
- package/dist/recall-state.d.ts +2 -2
- package/dist/recall-tag-filter.d.ts +2 -2
- package/dist/recall-timings.d.ts +2 -2
- package/dist/recall-xray-cli.d.ts +2 -2
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +2 -2
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +2 -2
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +2 -2
- package/dist/reconcile/manifest.d.ts +2 -2
- package/dist/reconcile/manifest.js +5 -5
- package/dist/reconcile/plan.d.ts +2 -2
- package/dist/replay/normalizers/chatgpt.d.ts +2 -2
- package/dist/replay/normalizers/claude.d.ts +2 -2
- package/dist/replay/normalizers/openclaw.d.ts +2 -2
- package/dist/replay/normalizers/shared.d.ts +2 -2
- package/dist/replay/runner.d.ts +2 -2
- package/dist/replay/types.d.ts +2 -2
- package/dist/replica-divergence.d.ts +2 -2
- package/dist/replica-peers-config.d.ts +2 -2
- package/dist/{resolution-4552BNRV.js → resolution-4DLI3IOR.js} +11 -11
- package/dist/resolution-4DLI3IOR.js.map +1 -0
- package/dist/resolve-auth-token.d.ts +2 -2
- package/dist/resume-bundles.js +18 -17
- package/dist/retrieval-agents.d.ts +3 -3
- package/dist/retrieval-tiers.d.ts +2 -2
- package/dist/routing/engine.d.ts +2 -2
- package/dist/routing/store.d.ts +2 -2
- package/dist/salvage-envelope.d.ts +2 -2
- package/dist/salvage-envelope.js +7 -7
- package/dist/schemas.d.ts +572 -107
- package/dist/schemas.js +3 -1
- package/dist/{scope-profiles-6ChZKTy-.d.ts → scope-profiles-BF2lu81V.d.ts} +1 -1
- package/dist/search/document-scanner.js +1 -1
- package/dist/search/embed-helper.d.ts +2 -2
- package/dist/search/factory.d.ts +2 -2
- package/dist/search/factory.js +7 -7
- package/dist/search/index.d.ts +2 -2
- package/dist/search/index.js +13 -13
- package/dist/search/lancedb-backend.d.ts +2 -2
- package/dist/search/lancedb-backend.js +1 -1
- package/dist/search/meilisearch-backend.d.ts +2 -2
- package/dist/search/meilisearch-backend.js +1 -1
- package/dist/search/noop-backend.d.ts +2 -2
- package/dist/search/orama-backend.d.ts +2 -2
- package/dist/search/orama-backend.js +1 -1
- package/dist/search/port.d.ts +2 -2
- package/dist/search/remote-backend.d.ts +2 -2
- package/dist/secure-store/index.js +3 -3
- package/dist/{semantic-consolidation-DziYcW5J.d.ts → semantic-consolidation-5OuWXBRt.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +3 -3
- package/dist/semantic-consolidation.js +37 -37
- package/dist/semantic-rule-promotion.js +33 -33
- package/dist/semantic-rule-verifier.d.ts +2 -2
- package/dist/semantic-rule-verifier.js +33 -33
- package/dist/{service-C7rIBuK_.d.ts → service-CrqEhLXD.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +2 -2
- package/dist/session-observer-state.d.ts +2 -2
- package/dist/shared-context/manager.d.ts +2 -2
- package/dist/signal.d.ts +2 -2
- package/dist/source-agent-qualifier.d.ts +2 -2
- package/dist/source-agent-qualifier.js +42 -39
- package/dist/standup/build.d.ts +16 -0
- package/dist/standup/build.js +17 -0
- package/dist/standup/build.js.map +1 -0
- package/dist/{storage-B1hEx8Xg.d.ts → storage-BQn-xnxm.d.ts} +4 -1
- package/dist/storage.d.ts +5 -3
- package/dist/storage.js +32 -32
- package/dist/subject-config.d.ts +2 -2
- package/dist/subject-config.js +6 -6
- package/dist/summarizer.d.ts +2 -2
- package/dist/summarizer.js +2 -2
- package/dist/summary-snapshot.d.ts +2 -2
- package/dist/support-passport/index.d.ts +20 -19
- package/dist/support-passport/index.js +68 -65
- package/dist/temporal-supersession.d.ts +3 -3
- package/dist/temporal-timeline-recall.d.ts +2 -2
- package/dist/temporal-validity.d.ts +2 -2
- package/dist/threading.d.ts +2 -2
- package/dist/tier-migration.d.ts +5 -3
- package/dist/tier-routing.d.ts +2 -2
- package/dist/tier-routing.js +2 -2
- package/dist/{tier-stats-4B5IJ3NE.js → tier-stats-2TOW3QNL.js} +3 -3
- package/dist/topics.d.ts +2 -2
- package/dist/transcript.d.ts +2 -2
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +5 -5
- package/dist/transfer/export-okf.d.ts +39 -0
- package/dist/transfer/export-okf.js +112 -0
- package/dist/transfer/export-okf.js.map +1 -0
- package/dist/transfer/types.d.ts +12 -12
- package/dist/trust-score-stage.d.ts +2 -2
- package/dist/trust-score.d.ts +2 -2
- package/dist/{types-BHDNxGTT.d.ts → types-BRpcNjHZ.d.ts} +119 -3
- package/dist/types.d.ts +2 -2
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +2 -2
- package/dist/verified-recall.js +33 -33
- package/dist/who-knows-cli.d.ts +15 -14
- package/dist/who-knows-cli.js +34 -34
- package/dist/who-knows.d.ts +15 -14
- package/dist/who-knows.js +33 -33
- package/dist/write-envelope.d.ts +2 -2
- package/dist/write-envelope.js +6 -6
- package/package.json +54 -3
- package/src/access-admin-ops-surface.ts +6 -1
- package/src/access-boundary.ts +1 -0
- package/src/access-http.ts +3 -1
- package/src/access-mcp-output-schemas.ts +1 -0
- package/src/access-mcp.ts +3 -3
- package/src/access-operations.ts +1 -0
- package/src/access-service-offline-file-content.test.ts +63 -0
- package/src/access-surface-catalog.ts +2 -0
- package/src/active-context-config.ts +98 -0
- package/src/active-context-transform.test.ts +533 -0
- package/src/active-context-transform.ts +981 -0
- package/src/activity/config.test.ts +1 -0
- package/src/activity/config.ts +21 -1
- package/src/activity/index.ts +1 -0
- package/src/activity/timeline/build.ts +279 -0
- package/src/activity/timeline/categories.ts +111 -0
- package/src/activity/timeline/classify.ts +110 -0
- package/src/activity/timeline/corrections.ts +145 -0
- package/src/activity/timeline/index.ts +6 -0
- package/src/activity/timeline/timeline.test.ts +277 -0
- package/src/activity/timeline/types.ts +106 -0
- package/src/activity/types.ts +6 -0
- package/src/cli/okf-commands.ts +45 -0
- package/src/cli.ts +2 -2
- package/src/coding/export-okf-codegraph.test.ts +381 -0
- package/src/coding/export-okf-codegraph.ts +565 -0
- package/src/config.test.ts +1 -0
- package/src/config.ts +3 -5
- package/src/context-summary.ts +182 -0
- package/src/extraction-prompt-safety.test.ts +14 -2
- package/src/extraction.ts +21 -1
- package/src/fallback-llm.test.ts +134 -0
- package/src/fallback-llm.ts +77 -5
- package/src/index.ts +4 -11
- package/src/lcm/summarizer.ts +14 -93
- package/src/location/access-operations.ts +17 -8
- package/src/location/backfill.ts +137 -0
- package/src/location/config.test.ts +3 -0
- package/src/location/config.ts +46 -2
- package/src/location/http-glue.ts +1 -1
- package/src/location/index.ts +3 -0
- package/src/location/intervals.ts +1 -0
- package/src/location/matching.test.ts +65 -0
- package/src/location/matching.ts +354 -0
- package/src/location/mcp-tools.ts +2 -1
- package/src/location/surfaces.test.ts +15 -2
- package/src/location/surfaces.ts +95 -18
- package/src/location/tagging.test.ts +119 -0
- package/src/location/tagging.ts +277 -0
- package/src/location/types.ts +23 -1
- package/src/mcp-read-only-tools.ts +1 -0
- package/src/memory-action-policy.ts +28 -0
- package/src/memory-projection-store.ts +3 -1
- package/src/okf/cli.ts +18 -5
- package/src/okf/config.ts +5 -0
- package/src/okf/index-files.test.ts +60 -0
- package/src/okf/index-files.ts +114 -0
- package/src/okf/render.ts +133 -0
- package/src/okf/type-mapping.test.ts +3 -0
- package/src/okf/type-mapping.ts +2 -0
- package/src/orchestration/extraction-run.ts +2 -1
- package/src/orchestration/generic-recall-paths.ts +4 -3
- package/src/schemas.ts +17 -1
- package/src/standup/access-operations.ts +14 -0
- package/src/standup/build.test.ts +34 -0
- package/src/standup/build.ts +115 -0
- package/src/standup/http-glue.ts +15 -0
- package/src/standup/mcp-tools.ts +16 -0
- package/src/storage/context-transform-ledger.ts +39 -0
- package/src/storage/secure-line-reader.ts +50 -1
- package/src/storage.ts +4 -1
- package/src/support-passport/card-projection.ts +1 -0
- package/src/support-passport/card-service-commit-forwarding.test.ts +1 -0
- package/src/support-passport/card-service.test.ts +75 -1
- package/src/support-passport/card-service.ts +6 -3
- package/src/support-passport/card-state.ts +5 -1
- package/src/support-passport/offline-sync-guard.ts +14 -1
- package/src/transfer/export-okf.test.ts +164 -0
- package/src/transfer/export-okf.ts +286 -0
- package/src/types.ts +2 -3
- package/dist/chunk-2LWQSV6A.js.map +0 -1
- package/dist/chunk-3BCULS4U.js.map +0 -1
- package/dist/chunk-7BDZTALN.js.map +0 -1
- package/dist/chunk-7PHI6GUI.js.map +0 -1
- package/dist/chunk-AFR6AIM4.js.map +0 -1
- package/dist/chunk-AX7UXCHJ.js.map +0 -1
- package/dist/chunk-BJTHRFFC.js.map +0 -1
- package/dist/chunk-D4QVPP3G.js.map +0 -1
- package/dist/chunk-DVYRD4HY.js.map +0 -1
- package/dist/chunk-F635GAL7.js.map +0 -1
- package/dist/chunk-FMQ4MOQO.js.map +0 -1
- package/dist/chunk-FP7YTTVO.js.map +0 -1
- package/dist/chunk-I4343FIA.js.map +0 -1
- package/dist/chunk-I7EX6KSH.js.map +0 -1
- package/dist/chunk-LBFFNDFM.js.map +0 -1
- package/dist/chunk-LLQCM2U2.js.map +0 -1
- package/dist/chunk-RQE4TITU.js.map +0 -1
- package/dist/chunk-UW5NPZJ2.js.map +0 -1
- package/dist/chunk-XAB6STPO.js.map +0 -1
- package/dist/chunk-ZPUIRTIZ.js.map +0 -1
- package/dist/types-CM86alG1.d.ts +0 -89
- /package/dist/{contradiction-scan-AKUWPX5N.js.map → active-context-config.js.map} +0 -0
- /package/dist/{resolution-4552BNRV.js.map → active-context-transform.js.map} +0 -0
- /package/dist/{auto-sync-XVMLL2RH.js.map → auto-sync-Q6Q2FVSC.js.map} +0 -0
- /package/dist/{capsule-merge-SGIVB3WA.js.map → capsule-merge-SEHERWWP.js.map} +0 -0
- /package/dist/{chunk-CFGU52XJ.js.map → chunk-23CVL7HS.js.map} +0 -0
- /package/dist/{chunk-PO7NXBG2.js.map → chunk-2GF27PGH.js.map} +0 -0
- /package/dist/{chunk-6CPUQ5D6.js.map → chunk-2LBAFHOQ.js.map} +0 -0
- /package/dist/{chunk-JBPKEARU.js.map → chunk-2QSZNTDO.js.map} +0 -0
- /package/dist/{chunk-IP4ZNT4U.js.map → chunk-33MFRY25.js.map} +0 -0
- /package/dist/{chunk-VFYRYFLL.js.map → chunk-3TSU662L.js.map} +0 -0
- /package/dist/{chunk-VXVZ2GM3.js.map → chunk-4FHRZD5T.js.map} +0 -0
- /package/dist/{chunk-5VPQSRQO.js.map → chunk-4STAANV7.js.map} +0 -0
- /package/dist/{chunk-46WM6JX2.js.map → chunk-4ZWCQJNM.js.map} +0 -0
- /package/dist/{chunk-52II7PB6.js.map → chunk-645WOU5I.js.map} +0 -0
- /package/dist/{chunk-YKWFK7XA.js.map → chunk-6CEGSTBD.js.map} +0 -0
- /package/dist/{chunk-GEPACVWN.js.map → chunk-6RUHELWR.js.map} +0 -0
- /package/dist/{chunk-ZAOHJDKH.js.map → chunk-72OIT7KS.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-7LCGFUMB.js.map} +0 -0
- /package/dist/{chunk-7TCGNUVP.js.map → chunk-7UTDHQZ5.js.map} +0 -0
- /package/dist/{chunk-5HK3CJAR.js.map → chunk-7XOG75AU.js.map} +0 -0
- /package/dist/{chunk-C24UZSFW.js.map → chunk-CEH2AFXG.js.map} +0 -0
- /package/dist/{chunk-YOXVZJFM.js.map → chunk-CFVTRUR3.js.map} +0 -0
- /package/dist/{chunk-ACOC27BB.js.map → chunk-CN4VKV3S.js.map} +0 -0
- /package/dist/{chunk-PMVPCZJZ.js.map → chunk-CTCGHNWN.js.map} +0 -0
- /package/dist/{chunk-EGBDFJ36.js.map → chunk-DD5JFCWM.js.map} +0 -0
- /package/dist/{chunk-T42L3S6A.js.map → chunk-DDX6KIXF.js.map} +0 -0
- /package/dist/{chunk-JIYDRBVZ.js.map → chunk-DJORULH3.js.map} +0 -0
- /package/dist/{chunk-WTOZBZNN.js.map → chunk-DMEHOEC7.js.map} +0 -0
- /package/dist/{chunk-OPPBTPUU.js.map → chunk-DUAJKRR2.js.map} +0 -0
- /package/dist/{chunk-SVVIASVX.js.map → chunk-EFQCDJZ2.js.map} +0 -0
- /package/dist/{chunk-Q57GOHLF.js.map → chunk-EGALNSZ4.js.map} +0 -0
- /package/dist/{chunk-KCT36JAW.js.map → chunk-ESNFSSO4.js.map} +0 -0
- /package/dist/{chunk-XQ3HXAQH.js.map → chunk-ET2CNMLD.js.map} +0 -0
- /package/dist/{chunk-Z4U3UN56.js.map → chunk-EZSCW4EM.js.map} +0 -0
- /package/dist/{chunk-F6QHHRWP.js.map → chunk-FESUGFIL.js.map} +0 -0
- /package/dist/{chunk-S3K2CIK5.js.map → chunk-FKKGCGYL.js.map} +0 -0
- /package/dist/{chunk-BWGCOLEL.js.map → chunk-FTTJRVB7.js.map} +0 -0
- /package/dist/{chunk-JAQXUGLN.js.map → chunk-FYWLSFFS.js.map} +0 -0
- /package/dist/{chunk-OPGL46PX.js.map → chunk-GX6FTSYH.js.map} +0 -0
- /package/dist/{chunk-A32YEQAM.js.map → chunk-H7VDIF2V.js.map} +0 -0
- /package/dist/{chunk-PDDSFELN.js.map → chunk-HJXA6ZM7.js.map} +0 -0
- /package/dist/{chunk-RGCF4XNH.js.map → chunk-HNPE66LB.js.map} +0 -0
- /package/dist/{chunk-SEA6M7SS.js.map → chunk-I5VB44ZK.js.map} +0 -0
- /package/dist/{chunk-SDEPLF7V.js.map → chunk-IBJ6U753.js.map} +0 -0
- /package/dist/{chunk-EUYWQ7TS.js.map → chunk-IEZ6CGTW.js.map} +0 -0
- /package/dist/{chunk-3RI5Y7KU.js.map → chunk-IVIAHQBR.js.map} +0 -0
- /package/dist/{chunk-7WR462EM.js.map → chunk-J3OND5QT.js.map} +0 -0
- /package/dist/{chunk-T3JQTCCO.js.map → chunk-JI7U6AS3.js.map} +0 -0
- /package/dist/{chunk-I32NKXE2.js.map → chunk-JTWZKNUH.js.map} +0 -0
- /package/dist/{chunk-VKCAHCBI.js.map → chunk-L4X4PJYK.js.map} +0 -0
- /package/dist/{chunk-W4BMEGQA.js.map → chunk-LUDBXTBJ.js.map} +0 -0
- /package/dist/{chunk-RIAM7DND.js.map → chunk-ME35HVDJ.js.map} +0 -0
- /package/dist/{chunk-NG3MBQV4.js.map → chunk-MJRGVXPQ.js.map} +0 -0
- /package/dist/{chunk-773TRRGT.js.map → chunk-MJUCDM3C.js.map} +0 -0
- /package/dist/{chunk-7F27PCSN.js.map → chunk-MN5NOOI7.js.map} +0 -0
- /package/dist/{chunk-JCWY73FK.js.map → chunk-N4F7ZSSG.js.map} +0 -0
- /package/dist/{chunk-TR7DGXGI.js.map → chunk-NACLNNFQ.js.map} +0 -0
- /package/dist/{chunk-LC2BDILZ.js.map → chunk-NBP4EX5N.js.map} +0 -0
- /package/dist/{chunk-ZVPVTPGI.js.map → chunk-NNZFPYYX.js.map} +0 -0
- /package/dist/{chunk-MFOSZUIT.js.map → chunk-NPIBN2VL.js.map} +0 -0
- /package/dist/{chunk-IY7UXD3J.js.map → chunk-O57GM3FR.js.map} +0 -0
- /package/dist/{chunk-I2HTKOOP.js.map → chunk-O7ERGZDA.js.map} +0 -0
- /package/dist/{chunk-GTSVEEP3.js.map → chunk-OAJMQKQR.js.map} +0 -0
- /package/dist/{chunk-HSZMX3ZJ.js.map → chunk-ODW5GDFE.js.map} +0 -0
- /package/dist/{chunk-J2WC5LF4.js.map → chunk-QBC33MPY.js.map} +0 -0
- /package/dist/{chunk-EOHKUWXW.js.map → chunk-QCRJMU5V.js.map} +0 -0
- /package/dist/{chunk-5DH6PG4B.js.map → chunk-RZ3IZIJG.js.map} +0 -0
- /package/dist/{chunk-AAXJNINV.js.map → chunk-SN4JXNLL.js.map} +0 -0
- /package/dist/{chunk-SVSRPG6M.js.map → chunk-TNGH4ZYI.js.map} +0 -0
- /package/dist/{chunk-HZNYJN77.js.map → chunk-TNXNECAN.js.map} +0 -0
- /package/dist/{chunk-JOEJG4SD.js.map → chunk-TVW4C7PV.js.map} +0 -0
- /package/dist/{chunk-UFKPQBXH.js.map → chunk-U62OK7BB.js.map} +0 -0
- /package/dist/{chunk-R2MZCYA6.js.map → chunk-UNUMFURP.js.map} +0 -0
- /package/dist/{chunk-YRVAKONL.js.map → chunk-VQ4AMTGZ.js.map} +0 -0
- /package/dist/{chunk-RAIUTAZZ.js.map → chunk-WKAXBXVA.js.map} +0 -0
- /package/dist/{chunk-ZIJDI4CP.js.map → chunk-WKJFIMVN.js.map} +0 -0
- /package/dist/{chunk-SXIMQLGV.js.map → chunk-WVGXCBOC.js.map} +0 -0
- /package/dist/{chunk-7BEPVIH3.js.map → chunk-X5YYSAZX.js.map} +0 -0
- /package/dist/{chunk-FZEEWOI2.js.map → chunk-XJJYSX6F.js.map} +0 -0
- /package/dist/{chunk-UG6VXIOK.js.map → chunk-XSTNGNJP.js.map} +0 -0
- /package/dist/{chunk-YDPAE2RD.js.map → chunk-YFLLGRXO.js.map} +0 -0
- /package/dist/{chunk-EZ25VE3G.js.map → chunk-YNDLCWXS.js.map} +0 -0
- /package/dist/{chunk-ANJXPFRS.js.map → chunk-YXFCALVT.js.map} +0 -0
- /package/dist/{chunk-Q4WONDMJ.js.map → chunk-YYGZJPOK.js.map} +0 -0
- /package/dist/{chunk-5HERQ5FX.js.map → chunk-Z3YEGSR4.js.map} +0 -0
- /package/dist/{chunk-YWSQD2IB.js.map → chunk-ZJPM7GZ3.js.map} +0 -0
- /package/dist/{chunk-5S4LQOPE.js.map → chunk-ZW4VXELZ.js.map} +0 -0
- /package/dist/{first-start-migration-4NETATFF.js.map → first-start-migration-KHIMCBIC.js.map} +0 -0
- /package/dist/{forget-SZ2BXDGF.js.map → forget-2AE4MDK3.js.map} +0 -0
- /package/dist/{purge-GB7PZHT2.js.map → purge-OP6BEDFY.js.map} +0 -0
- /package/dist/{tier-stats-4B5IJ3NE.js.map → tier-stats-2TOW3QNL.js.map} +0 -0
package/src/storage.ts
CHANGED
|
@@ -29,6 +29,8 @@ import { runCommittedInvalidation } from "./storage/committed-invalidation.js";
|
|
|
29
29
|
import { renderProfileWithLastUpdated, stripOkfProfileFrontmatter, withOkfProfileFrontmatter } from "./storage/profile-header.js";
|
|
30
30
|
import { parseQuestionFile as parseQuestionFileText } from "./storage/questions-file.js";
|
|
31
31
|
import { assertNotOkfReservedBasename, OKF_QUESTION_TYPE, okfTypeForEntityKind, okfTypeForMemory } from "./okf/type-mapping.js";
|
|
32
|
+
import { appendContextTransformRecords, readContextTransformRecords } from "./storage/context-transform-ledger.js";
|
|
33
|
+
import type { ContextTransformTelemetryRecord } from "./active-context-transform.js";
|
|
32
34
|
import { readMaybeEncryptedLines, readMemoryActionEventRowsFromLines } from "./storage/secure-line-reader.js";
|
|
33
35
|
import {
|
|
34
36
|
appendLifecycleEventsSerialized,
|
|
@@ -5595,7 +5597,8 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
|
|
|
5595
5597
|
await this.appendStorageSecureFile(this.memoryActionsPath, payload);
|
|
5596
5598
|
return events.length;
|
|
5597
5599
|
}
|
|
5598
|
-
|
|
5600
|
+
async appendContextTransformRecords(records: ContextTransformTelemetryRecord[]) { return appendContextTransformRecords(this as never, records); }
|
|
5601
|
+
async readContextTransformRecords(limit = 200) { return readContextTransformRecords(this as never, limit); }
|
|
5599
5602
|
async appendMemoryLifecycleEvents(events: MemoryLifecycleEvent[]): Promise<number> {
|
|
5600
5603
|
if (events.length === 0) return 0;
|
|
5601
5604
|
await this.ensureDirectories();
|
|
@@ -307,6 +307,7 @@ function parseSupportPassportCardMetadata(
|
|
|
307
307
|
export function hasLiveSupportPassportCard(memory: Pick<MemoryFile, "frontmatter" | "content">): boolean {
|
|
308
308
|
const metadata = parseSupportPassportCardMetadata(memory);
|
|
309
309
|
if (metadata?.fields.status !== "active" && metadata?.fields.status !== "pending_review") return false;
|
|
310
|
+
if (metadata.sourceMemoryIds.length === 0) return false;
|
|
310
311
|
return SupportPassportCardSchema.omit({ revision: true }).safeParse({
|
|
311
312
|
...metadata.fields,
|
|
312
313
|
statement: stripAttributesSuffix(memory.content),
|
|
@@ -56,6 +56,7 @@ test("rejected-draft recovery forwards the commit notification", async () => {
|
|
|
56
56
|
assert.ok(replacement);
|
|
57
57
|
const storage = {
|
|
58
58
|
getMemoryById: async (id: string) => (id === "draft-one" ? replaced : null),
|
|
59
|
+
getMemoryByIdIncludingArchived: async (id: string) => (id === "draft-one" ? replaced : null),
|
|
59
60
|
} as unknown as StorageManager;
|
|
60
61
|
const service = new SupportPassportCardService({
|
|
61
62
|
resolveOwner: async () => ({ principal: PRINCIPAL, namespace: NAMESPACE, storage }),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
|
-
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
2
|
+
import { mkdir, mkdtemp, readFile, rename, rm } from "node:fs/promises";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { test } from "node:test";
|
|
@@ -1425,6 +1425,80 @@ test("retrying an interrupted pending-draft replacement reuses one approvable dr
|
|
|
1425
1425
|
}
|
|
1426
1426
|
});
|
|
1427
1427
|
|
|
1428
|
+
test("replacement recovery reads a cold-tier rejected predecessor (#2387)", async () => {
|
|
1429
|
+
const subject = await makeSubject();
|
|
1430
|
+
try {
|
|
1431
|
+
const draft = await subject.service.createManualDraft({
|
|
1432
|
+
principal: "owner:alice",
|
|
1433
|
+
title: "Quiet place",
|
|
1434
|
+
statement: "Offer me a quiet place.",
|
|
1435
|
+
category: "environment",
|
|
1436
|
+
reviewBy: OWNER_REVIEW_BY,
|
|
1437
|
+
});
|
|
1438
|
+
const originalWrite = subject.aliceStorage.writeMemoryFrontmatterIfUnchanged.bind(subject.aliceStorage);
|
|
1439
|
+
let interrupted = false;
|
|
1440
|
+
subject.aliceStorage.writeMemoryFrontmatterIfUnchanged = async (memory, patch, lifecycle) => {
|
|
1441
|
+
if (!interrupted && lifecycle?.reasonCode === "draft-replacement-complete") {
|
|
1442
|
+
interrupted = true;
|
|
1443
|
+
throw new Error("simulated process exit before the prepared marker cleared");
|
|
1444
|
+
}
|
|
1445
|
+
return await originalWrite(memory, patch, lifecycle);
|
|
1446
|
+
};
|
|
1447
|
+
|
|
1448
|
+
await assert.rejects(
|
|
1449
|
+
subject.service.replaceCard({
|
|
1450
|
+
principal: "owner:alice",
|
|
1451
|
+
cardId: draft.cardId,
|
|
1452
|
+
expectedRevision: draft.revision,
|
|
1453
|
+
title: "Quiet place and time",
|
|
1454
|
+
statement: "Offer me a quiet place and time.",
|
|
1455
|
+
category: "environment",
|
|
1456
|
+
reviewBy: OWNER_REVIEW_BY,
|
|
1457
|
+
}),
|
|
1458
|
+
/simulated process exit/
|
|
1459
|
+
);
|
|
1460
|
+
subject.aliceStorage.writeMemoryFrontmatterIfUnchanged = originalWrite;
|
|
1461
|
+
|
|
1462
|
+
// Interrupted state: the prior draft is durably rejected while the
|
|
1463
|
+
// replacement still carries its prepared marker. Simulate tier
|
|
1464
|
+
// migration demoting the rejected predecessor to the cold tier.
|
|
1465
|
+
const beforeRecovery = await subject.aliceStorage.readAllMemories();
|
|
1466
|
+
const replacement = beforeRecovery.find((memory) => memory.frontmatter.id !== draft.cardId);
|
|
1467
|
+
assert.ok(replacement);
|
|
1468
|
+
assert.equal(replacement.frontmatter.status, "pending_review");
|
|
1469
|
+
assert.equal(
|
|
1470
|
+
replacement.frontmatter.structuredAttributes?.["support-passport-draft-replacement-prepared"],
|
|
1471
|
+
"true"
|
|
1472
|
+
);
|
|
1473
|
+
const rejectedDraft = beforeRecovery.find((memory) => memory.frontmatter.id === draft.cardId);
|
|
1474
|
+
assert.ok(rejectedDraft);
|
|
1475
|
+
assert.equal(rejectedDraft.frontmatter.status, "rejected");
|
|
1476
|
+
const coldDir = path.join(subject.aliceStorage.dir, "cold", "preference");
|
|
1477
|
+
await mkdir(coldDir, { recursive: true });
|
|
1478
|
+
await rename(rejectedDraft.path, path.join(coldDir, path.basename(rejectedDraft.path)));
|
|
1479
|
+
StorageManager.clearAllStaticCaches();
|
|
1480
|
+
assert.equal(await subject.aliceStorage.getMemoryById(draft.cardId), null);
|
|
1481
|
+
const replacementCard = projectSupportPassportCard(replacement);
|
|
1482
|
+
assert.ok(replacementCard);
|
|
1483
|
+
const approved = await subject.service.approveCard({
|
|
1484
|
+
principal: "owner:alice",
|
|
1485
|
+
cardId: replacement.frontmatter.id,
|
|
1486
|
+
expectedRevision: replacementCard.card.revision,
|
|
1487
|
+
});
|
|
1488
|
+
assert.equal(approved.status, "active");
|
|
1489
|
+
|
|
1490
|
+
assert.deepEqual(
|
|
1491
|
+
(await subject.service.listCards({ principal: "owner:alice" })).map((card) => [card.cardId, card.status]),
|
|
1492
|
+
[[replacement.frontmatter.id, "active"]]
|
|
1493
|
+
);
|
|
1494
|
+
|
|
1495
|
+
const coldPredecessor = await subject.aliceStorage.getMemoryByIdIncludingArchived(draft.cardId);
|
|
1496
|
+
assert.equal(coldPredecessor?.frontmatter.status, "rejected");
|
|
1497
|
+
} finally {
|
|
1498
|
+
await subject.cleanup();
|
|
1499
|
+
}
|
|
1500
|
+
});
|
|
1501
|
+
|
|
1428
1502
|
test("retrying a recovered pending-draft replacement reuses the exact draft", async () => {
|
|
1429
1503
|
const subject = await makeSubject();
|
|
1430
1504
|
try {
|
|
@@ -832,7 +832,7 @@ export class SupportPassportCardService {
|
|
|
832
832
|
if (currentCard.card.status === "pending_review") {
|
|
833
833
|
const priorId = currentMemory.frontmatter.supersedes;
|
|
834
834
|
if (!priorId) return currentMemory;
|
|
835
|
-
const prior = await storage.
|
|
835
|
+
const prior = await storage.getMemoryByIdIncludingArchived(priorId);
|
|
836
836
|
if (
|
|
837
837
|
prior &&
|
|
838
838
|
ownsMemory(prior, namespace, principal) &&
|
|
@@ -973,7 +973,10 @@ export class SupportPassportCardService {
|
|
|
973
973
|
onCommitted?: () => void
|
|
974
974
|
): Promise<void> {
|
|
975
975
|
if (!replacement.replacesDraftId) return;
|
|
976
|
-
|
|
976
|
+
// Tier-independent: an interrupted edit's rejected predecessor can be
|
|
977
|
+
// demoted to the cold tier before recovery runs; a hot-only lookup would
|
|
978
|
+
// mistake it for deleted and orphan the valid replacement (#2387).
|
|
979
|
+
const replacedDraft = await storage.getMemoryByIdIncludingArchived(replacement.replacesDraftId);
|
|
977
980
|
const projectedDraft = replacedDraft ? projectOwnedCard(replacedDraft, namespace, principal) : null;
|
|
978
981
|
if (
|
|
979
982
|
replacedDraft &&
|
|
@@ -999,7 +1002,7 @@ export class SupportPassportCardService {
|
|
|
999
1002
|
return;
|
|
1000
1003
|
}
|
|
1001
1004
|
}
|
|
1002
|
-
const currentDraft = await storage.
|
|
1005
|
+
const currentDraft = await storage.getMemoryByIdIncludingArchived(replacement.replacesDraftId);
|
|
1003
1006
|
if (
|
|
1004
1007
|
currentDraft &&
|
|
1005
1008
|
ownsMemory(currentDraft, namespace, principal) &&
|
|
@@ -152,7 +152,11 @@ export function ownerListCards(storedCards: StoredSupportPassportCard[]): Stored
|
|
|
152
152
|
if (activeReplacementPredecessors.has(item.card.cardId)) return false;
|
|
153
153
|
if (replacedDraftIds.has(item.card.cardId)) return false;
|
|
154
154
|
if (!item.replacesDraftId) return true;
|
|
155
|
+
// The replaced draft may be demoted to the cold tier or archived after
|
|
156
|
+
// its rejection; a hot-only projection then reports it missing. A
|
|
157
|
+
// missing predecessor must not hide the replacement — only a restored
|
|
158
|
+
// active predecessor does (#2387).
|
|
155
159
|
const replacedStatus = byId.get(item.replacesDraftId)?.card.status;
|
|
156
|
-
return replacedStatus === "pending_review" || replacedStatus === "rejected";
|
|
160
|
+
return replacedStatus === undefined || replacedStatus === "pending_review" || replacedStatus === "rejected";
|
|
157
161
|
});
|
|
158
162
|
}
|
|
@@ -9,9 +9,13 @@ import {
|
|
|
9
9
|
type OfflineSyncApplyChangesetResult,
|
|
10
10
|
type OfflineSyncApplyFileContentChunkResult,
|
|
11
11
|
} from "../offline-sync.js";
|
|
12
|
+
import { parseFrontmatter } from "../storage.js";
|
|
12
13
|
import { validateArchiveRelativePath } from "../transfer/fs-utils.js";
|
|
13
14
|
import type { MemoryFile } from "../types.js";
|
|
14
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
createSupportPassportPrivateFileExclusion,
|
|
17
|
+
isSupportPassportPrivateMemory,
|
|
18
|
+
} from "./card-projection.js";
|
|
15
19
|
|
|
16
20
|
const MAX_SUPPORT_PASSPORT_FRONTMATTER_BYTES = 1_048_576;
|
|
17
21
|
const SUPPORT_PASSPORT_MARKER = "support-passport-";
|
|
@@ -64,6 +68,15 @@ function assertFrontmatterAllowed(frontmatter: string, relativePath: string): vo
|
|
|
64
68
|
if (frontmatter.includes(SUPPORT_PASSPORT_MARKER)) {
|
|
65
69
|
throw new Error(`offline sync cannot modify private support-passport record: ${relativePath}`);
|
|
66
70
|
}
|
|
71
|
+
// Canonical classification (#2387): YAML/JSON escapes — e.g. a
|
|
72
|
+
// structured-attribute key written as `support\u002dpassport-owner` — hide
|
|
73
|
+
// the marker from the raw scan above, while the storage reader's
|
|
74
|
+
// JSON.parse reconstructs it after the write. Validate the parsed
|
|
75
|
+
// frontmatter with the same predicate the read path classifies by.
|
|
76
|
+
const parsed = parseFrontmatter(frontmatter);
|
|
77
|
+
if (parsed && isSupportPassportPrivateMemory({ frontmatter: parsed.frontmatter })) {
|
|
78
|
+
throw new Error(`offline sync cannot modify private support-passport record: ${relativePath}`);
|
|
79
|
+
}
|
|
67
80
|
}
|
|
68
81
|
|
|
69
82
|
function inspectBufferedFrontmatter(
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { mkdtemp, readFile, rm, writeFile, symlink } from "node:fs/promises";
|
|
3
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
4
|
+
import os from "node:os";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import test from "node:test";
|
|
7
|
+
|
|
8
|
+
import { StorageManager } from "../storage.js";
|
|
9
|
+
import {
|
|
10
|
+
DEFAULT_OKF_LOG_MAX_ENTRIES,
|
|
11
|
+
exportOkfBundle,
|
|
12
|
+
OKF_EXPORT_VERSION,
|
|
13
|
+
OKF_LOG_TRUNCATION_MARKER,
|
|
14
|
+
parseIncludeStatus,
|
|
15
|
+
} from "./export-okf.js";
|
|
16
|
+
|
|
17
|
+
async function seedStore(dir: string): Promise<{ factId: string; decisionId: string }> {
|
|
18
|
+
const storage = new StorageManager(dir);
|
|
19
|
+
await storage.ensureDirectories();
|
|
20
|
+
const decision = await storage.writeMemory("decision", "# Use SQLite\n\nWe use SQLite for the local store.", {
|
|
21
|
+
source: "test",
|
|
22
|
+
confidence: 0.9,
|
|
23
|
+
});
|
|
24
|
+
const fact = await storage.writeMemory(
|
|
25
|
+
"fact",
|
|
26
|
+
"# Rate limit\n\nAPI rate limit is 100/min.\n\n<oai-mem-citation>\n<citation_entries>\nfacts/note.md:1-2|note=[source]\n</citation_entries>\n</oai-mem-citation>\n",
|
|
27
|
+
{
|
|
28
|
+
source: "test",
|
|
29
|
+
confidence: 0.9,
|
|
30
|
+
tags: ["api"],
|
|
31
|
+
links: [{ targetId: decision.id, linkType: "supports", strength: 0.8 }],
|
|
32
|
+
},
|
|
33
|
+
);
|
|
34
|
+
const superseded = await storage.writeMemory("fact", "# Old limit\n\nAPI rate limit is 10/min.", { source: "test" });
|
|
35
|
+
await storage.writeMemoryFrontmatter((await storage.getMemoryById(superseded.id))!, { status: "superseded" });
|
|
36
|
+
const pending = await storage.writeMemory("correction", "# Pending\n\nNeeds review.", { source: "test" });
|
|
37
|
+
await storage.writeMemoryFrontmatter((await storage.getMemoryById(pending.id))!, { status: "pending_review" });
|
|
38
|
+
await writeFile(path.join(dir, "profile.md"), "# User\n\nPrefers short answers.\n", "utf8");
|
|
39
|
+
return { factId: fact.id, decisionId: decision.id };
|
|
40
|
+
}
|
|
41
|
+
test("parseIncludeStatus rejects unknown values", () => {
|
|
42
|
+
assert.deepEqual(parseIncludeStatus(undefined), ["active"]);
|
|
43
|
+
assert.throws(() => parseIncludeStatus("nope"), /allowed:/);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test("exportOkfBundle writes a deterministic active-only bundle", async () => {
|
|
47
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-okf-src-"));
|
|
48
|
+
const outA = await mkdtemp(path.join(os.tmpdir(), "remnic-okf-a-"));
|
|
49
|
+
const outB = path.join(os.tmpdir(), `remnic-okf-b-${Date.now()}`);
|
|
50
|
+
try {
|
|
51
|
+
await seedStore(memoryDir);
|
|
52
|
+
await rm(outA, { recursive: true, force: true });
|
|
53
|
+
const first = await exportOkfBundle({ memoryDir, outDir: outA });
|
|
54
|
+
assert.equal(first.exported, 2);
|
|
55
|
+
assert.ok(first.excluded >= 2);
|
|
56
|
+
const root = await readFile(path.join(outA, "index.md"), "utf8");
|
|
57
|
+
assert.match(root, new RegExp(`okf_version: "${OKF_EXPORT_VERSION}"`));
|
|
58
|
+
assert.doesNotMatch(root, /^type:/m);
|
|
59
|
+
assert.equal(existsSync(path.join(outA, "profile.md")), false);
|
|
60
|
+
const files = collectFiles(outA);
|
|
61
|
+
assert.ok(files.some((f) => f.includes("facts/")));
|
|
62
|
+
const factFile = files.find((f) => f.includes("facts/"))!;
|
|
63
|
+
const factBody = await readFile(path.join(outA, factFile), "utf8");
|
|
64
|
+
assert.match(factBody, /# Citations/);
|
|
65
|
+
assert.match(factBody, /# Related/);
|
|
66
|
+
assert.match(factBody, /type: Memory Fact/);
|
|
67
|
+
await exportOkfBundle({ memoryDir, outDir: outB });
|
|
68
|
+
assert.deepEqual(collectFiles(outA), collectFiles(outB));
|
|
69
|
+
for (const rel of collectFiles(outA)) {
|
|
70
|
+
assert.equal(await readFile(path.join(outA, rel), "utf8"), await readFile(path.join(outB, rel), "utf8"));
|
|
71
|
+
}
|
|
72
|
+
} finally {
|
|
73
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
74
|
+
await rm(outA, { recursive: true, force: true });
|
|
75
|
+
await rm(outB, { recursive: true, force: true });
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test("profile stays off unless requested; non-empty out requires --force", async () => {
|
|
80
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-okf-src-"));
|
|
81
|
+
const outDir = await mkdtemp(path.join(os.tmpdir(), "remnic-okf-out-"));
|
|
82
|
+
try {
|
|
83
|
+
await seedStore(memoryDir);
|
|
84
|
+
await rm(outDir, { recursive: true, force: true });
|
|
85
|
+
await exportOkfBundle({ memoryDir, outDir, includeProfile: true });
|
|
86
|
+
const profile = await readFile(path.join(outDir, "profile.md"), "utf8");
|
|
87
|
+
assert.match(profile, /type: Profile/);
|
|
88
|
+
await writeFile(path.join(outDir, "keep.txt"), "old", "utf8");
|
|
89
|
+
await assert.rejects(exportOkfBundle({ memoryDir, outDir }), /not empty/);
|
|
90
|
+
assert.equal(await readFile(path.join(outDir, "keep.txt"), "utf8"), "old");
|
|
91
|
+
await exportOkfBundle({ memoryDir, outDir, force: true });
|
|
92
|
+
assert.equal(existsSync(path.join(outDir, "keep.txt")), false);
|
|
93
|
+
assert.equal(existsSync(path.join(outDir, "index.md")), true);
|
|
94
|
+
} finally {
|
|
95
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
96
|
+
await rm(outDir, { recursive: true, force: true });
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test("log.md is newest-first and marks truncation", async () => {
|
|
101
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-okf-src-"));
|
|
102
|
+
const outDir = path.join(os.tmpdir(), `remnic-okf-log-${Date.now()}`);
|
|
103
|
+
try {
|
|
104
|
+
const storage = new StorageManager(memoryDir);
|
|
105
|
+
await storage.ensureDirectories();
|
|
106
|
+
await storage.writeMemory("fact", "# One\n\nbody", { source: "test" });
|
|
107
|
+
await storage.appendMemoryLifecycleEvents([
|
|
108
|
+
{
|
|
109
|
+
eventId: "e2",
|
|
110
|
+
memoryId: "m1",
|
|
111
|
+
eventType: "created",
|
|
112
|
+
timestamp: "2026-08-02T00:00:00.000Z",
|
|
113
|
+
actor: "test",
|
|
114
|
+
ruleVersion: "1",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
eventId: "e1",
|
|
118
|
+
memoryId: "m1",
|
|
119
|
+
eventType: "updated",
|
|
120
|
+
timestamp: "2026-08-01T00:00:00.000Z",
|
|
121
|
+
actor: "test",
|
|
122
|
+
ruleVersion: "1",
|
|
123
|
+
},
|
|
124
|
+
]);
|
|
125
|
+
await exportOkfBundle({ memoryDir, outDir, includeLog: true, logMaxEntries: 1 });
|
|
126
|
+
const log = await readFile(path.join(outDir, "log.md"), "utf8");
|
|
127
|
+
assert.match(log, /## 20\d{2}-\d{2}-\d{2}/);
|
|
128
|
+
assert.match(log, new RegExp(OKF_LOG_TRUNCATION_MARKER));
|
|
129
|
+
assert.ok(DEFAULT_OKF_LOG_MAX_ENTRIES > 1);
|
|
130
|
+
} finally {
|
|
131
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
132
|
+
await rm(outDir, { recursive: true, force: true });
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test("symlink out is rejected", async () => {
|
|
137
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-okf-src-"));
|
|
138
|
+
const real = await mkdtemp(path.join(os.tmpdir(), "remnic-okf-real-"));
|
|
139
|
+
const link = `${real}-link`;
|
|
140
|
+
try {
|
|
141
|
+
await seedStore(memoryDir);
|
|
142
|
+
await symlink(real, link);
|
|
143
|
+
await assert.rejects(exportOkfBundle({ memoryDir, outDir: link }), /symlink/);
|
|
144
|
+
} finally {
|
|
145
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
146
|
+
await rm(real, { recursive: true, force: true });
|
|
147
|
+
await rm(link, { force: true });
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
function collectFiles(root: string): string[] {
|
|
152
|
+
const out: string[] = [];
|
|
153
|
+
const walk = (dir: string): void => {
|
|
154
|
+
for (const name of readdirSync(dir).sort()) {
|
|
155
|
+
const full = path.join(dir, name);
|
|
156
|
+
const stat = lstatSync(full);
|
|
157
|
+
if (stat.isSymbolicLink()) continue;
|
|
158
|
+
if (stat.isDirectory()) walk(full);
|
|
159
|
+
else out.push(path.relative(root, full).split(path.sep).join("/"));
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
walk(root);
|
|
163
|
+
return out.sort();
|
|
164
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { rmSync } from "node:fs";
|
|
2
|
+
import { mkdtemp } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
|
|
6
|
+
import { parseOaiMemCitation } from "../citations.js";
|
|
7
|
+
import { inferMemoryStatus } from "../memory-lifecycle-ledger-utils.js";
|
|
8
|
+
import { normalizeProjectionPreview } from "../memory-projection-format.js";
|
|
9
|
+
import { lintOkfDir } from "../okf/lint.js";
|
|
10
|
+
import { okfTypeForMemory, OKF_PROFILE_TYPE } from "../okf/type-mapping.js";
|
|
11
|
+
import {
|
|
12
|
+
OKF_EXPORT_VERSION,
|
|
13
|
+
publishBundle,
|
|
14
|
+
renderFrontmatter,
|
|
15
|
+
rejectSymlinkPath,
|
|
16
|
+
writeBundleFile,
|
|
17
|
+
} from "../okf/render.js";
|
|
18
|
+
// Re-exported for the existing `@remnic/core/export-okf` consumers and tests
|
|
19
|
+
// (one public surface; the value itself now lives in okf/render.ts).
|
|
20
|
+
export { OKF_EXPORT_VERSION };
|
|
21
|
+
import { StorageManager } from "../storage.js";
|
|
22
|
+
import type { MemoryFile, MemoryLink, MemoryStatus } from "../types.js";
|
|
23
|
+
|
|
24
|
+
// Shared bundle mechanics (frontmatter, publish, symlink guard, file write)
|
|
25
|
+
// live in ../okf/render.ts — one source of truth for every OKF exporter.
|
|
26
|
+
export const OKF_LOG_TRUNCATION_MARKER = "<!-- okf-log-truncated -->";
|
|
27
|
+
export const DEFAULT_OKF_LOG_MAX_ENTRIES = 500;
|
|
28
|
+
|
|
29
|
+
const MEMORY_STATUSES: readonly MemoryStatus[] = [
|
|
30
|
+
"active",
|
|
31
|
+
"pending_review",
|
|
32
|
+
"rejected",
|
|
33
|
+
"quarantined",
|
|
34
|
+
"superseded",
|
|
35
|
+
"archived",
|
|
36
|
+
"forgotten",
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
export interface ExportOkfOptions {
|
|
40
|
+
memoryDir: string;
|
|
41
|
+
outDir: string;
|
|
42
|
+
includeStatus?: readonly string[];
|
|
43
|
+
includeCategories?: readonly string[];
|
|
44
|
+
excludeTags?: readonly string[];
|
|
45
|
+
includeProfile?: boolean;
|
|
46
|
+
includeWearables?: boolean;
|
|
47
|
+
includeLog?: boolean;
|
|
48
|
+
logMaxEntries?: number;
|
|
49
|
+
force?: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface ExportOkfResult {
|
|
53
|
+
exported: number;
|
|
54
|
+
excluded: number;
|
|
55
|
+
byCategory: Record<string, number>;
|
|
56
|
+
plaintextWarning: boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function parseIncludeStatus(raw: unknown): MemoryStatus[] {
|
|
60
|
+
const values = splitCsv(raw);
|
|
61
|
+
if (values.length === 0) return ["active"];
|
|
62
|
+
const allowed = new Set<string>(MEMORY_STATUSES);
|
|
63
|
+
for (const value of values) {
|
|
64
|
+
if (!allowed.has(value)) {
|
|
65
|
+
throw new Error(`invalid --include-status ${value}; allowed: ${MEMORY_STATUSES.join(", ")}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return values as MemoryStatus[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export async function exportOkfBundle(opts: ExportOkfOptions): Promise<ExportOkfResult> {
|
|
72
|
+
const outDir = path.resolve(opts.outDir);
|
|
73
|
+
rejectSymlinkPath(outDir);
|
|
74
|
+
const includeStatus = new Set(parseIncludeStatus(opts.includeStatus));
|
|
75
|
+
const includeCategories = opts.includeCategories?.length ? new Set(opts.includeCategories) : null;
|
|
76
|
+
const excludeTags = new Set(opts.excludeTags ?? []);
|
|
77
|
+
const storage = new StorageManager(opts.memoryDir);
|
|
78
|
+
const memories = await storage.readAllMemories();
|
|
79
|
+
const included: MemoryFile[] = [];
|
|
80
|
+
let excluded = 0;
|
|
81
|
+
for (const memory of memories) {
|
|
82
|
+
const rel = toRel(memory.path, opts.memoryDir);
|
|
83
|
+
if (!opts.includeWearables && rel.startsWith("wearables/")) {
|
|
84
|
+
excluded += 1;
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const status = inferMemoryStatus(memory.frontmatter, memory.path);
|
|
88
|
+
if (!includeStatus.has(status)) {
|
|
89
|
+
excluded += 1;
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (includeCategories && !includeCategories.has(memory.frontmatter.category)) {
|
|
93
|
+
excluded += 1;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if ((memory.frontmatter.tags ?? []).some((tag) => excludeTags.has(tag))) {
|
|
97
|
+
excluded += 1;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
included.push(memory);
|
|
101
|
+
}
|
|
102
|
+
included.sort((a, b) => toRel(a.path, opts.memoryDir).localeCompare(toRel(b.path, opts.memoryDir)));
|
|
103
|
+
|
|
104
|
+
const staging = await mkdtemp(path.join(os.tmpdir(), "remnic-okf-export-"));
|
|
105
|
+
const byCategory: Record<string, number> = {};
|
|
106
|
+
const idToRel = new Map<string, string>();
|
|
107
|
+
for (const memory of included) {
|
|
108
|
+
const rel = toRel(memory.path, opts.memoryDir);
|
|
109
|
+
idToRel.set(memory.frontmatter.id, rel);
|
|
110
|
+
}
|
|
111
|
+
for (const memory of included) {
|
|
112
|
+
const rel = toRel(memory.path, opts.memoryDir);
|
|
113
|
+
const rendered = renderMemory(memory, rel, idToRel);
|
|
114
|
+
writeBundleFile(staging, rel, rendered);
|
|
115
|
+
const category = memory.frontmatter.category;
|
|
116
|
+
byCategory[category] = (byCategory[category] ?? 0) + 1;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (opts.includeProfile) {
|
|
120
|
+
try {
|
|
121
|
+
const profile = await storage.readProfile();
|
|
122
|
+
if (profile) {
|
|
123
|
+
writeBundleFile(
|
|
124
|
+
staging,
|
|
125
|
+
"profile.md",
|
|
126
|
+
renderFrontmatter({
|
|
127
|
+
type: OKF_PROFILE_TYPE,
|
|
128
|
+
title: "User Profile",
|
|
129
|
+
timestamp: new Date(0).toISOString(),
|
|
130
|
+
}) + profile.replace(/^\uFEFF/, ""),
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
} catch {
|
|
134
|
+
// Profile is optional even when requested.
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (opts.includeLog) {
|
|
139
|
+
const events = await storage.readAllMemoryLifecycleEvents();
|
|
140
|
+
writeBundleFile(staging, "log.md", renderLog(events, idToRel, opts.logMaxEntries ?? DEFAULT_OKF_LOG_MAX_ENTRIES));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
writeIndexes(staging, included, opts.memoryDir);
|
|
144
|
+
const lint = lintOkfDir(staging);
|
|
145
|
+
const blocking = lint.findings.filter((f) => f.code !== "skipped_encrypted" && f.code !== "reserved_basename");
|
|
146
|
+
if (blocking.length > 0) {
|
|
147
|
+
rmSync(staging, { recursive: true, force: true });
|
|
148
|
+
throw new Error(`OKF export failed lint: ${blocking.map((f) => `${f.file}: ${f.message}`).join("; ")}`);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
publishBundle(staging, outDir, opts.force === true);
|
|
152
|
+
return {
|
|
153
|
+
exported: included.length,
|
|
154
|
+
excluded,
|
|
155
|
+
byCategory,
|
|
156
|
+
plaintextWarning: true,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
function renderMemory(memory: MemoryFile, rel: string, idToRel: Map<string, string>): string {
|
|
162
|
+
const fm = memory.frontmatter;
|
|
163
|
+
const title = firstHeading(memory.content) ?? `${humanize(fm.category)} ${fm.created.slice(0, 10)}`;
|
|
164
|
+
const type = fm.type ?? okfTypeForMemory(fm);
|
|
165
|
+
const fields: Record<string, unknown> = {
|
|
166
|
+
...fm,
|
|
167
|
+
type,
|
|
168
|
+
title,
|
|
169
|
+
description: normalizeProjectionPreview(memory.content),
|
|
170
|
+
tags: fm.tags ?? [],
|
|
171
|
+
timestamp: fm.updated,
|
|
172
|
+
};
|
|
173
|
+
if (fm.artifactType) fields.resource = rel;
|
|
174
|
+
let body = memory.content.trim();
|
|
175
|
+
const citation = parseOaiMemCitation(body);
|
|
176
|
+
if (citation) {
|
|
177
|
+
const start = body.indexOf("<oai-mem-citation>");
|
|
178
|
+
const end = body.indexOf("</oai-mem-citation>");
|
|
179
|
+
if (start >= 0 && end > start) {
|
|
180
|
+
body = `${body.slice(0, start).trimEnd()}\n\n${body.slice(end + "</oai-mem-citation>".length).trimStart()}`.trim();
|
|
181
|
+
}
|
|
182
|
+
const lines = citation.entries.map((entry, index) => `${index + 1}. [${entry.path}](${entry.path})`);
|
|
183
|
+
body = `${body}\n\n# Citations\n\n${lines.join("\n")}\n`;
|
|
184
|
+
}
|
|
185
|
+
const links = fm.links ?? [];
|
|
186
|
+
if (links.length > 0) {
|
|
187
|
+
body += `\n# Related\n\n${links.map((link) => renderRelated(link, idToRel)).join("\n")}\n`;
|
|
188
|
+
}
|
|
189
|
+
return renderFrontmatter(fields) + body + (body.endsWith("\n") ? "" : "\n");
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function renderRelated(link: MemoryLink, idToRel: Map<string, string>): string {
|
|
193
|
+
const target = idToRel.get(link.targetId) ?? link.targetId;
|
|
194
|
+
const href = target.startsWith("/") ? target : `/${target}`;
|
|
195
|
+
return `- ${link.linkType}: [${link.targetId}](${href})`;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function writeIndexes(root: string, memories: MemoryFile[], memoryDir: string): void {
|
|
199
|
+
const groups = new Map<string, MemoryFile[]>();
|
|
200
|
+
for (const memory of memories) {
|
|
201
|
+
const rel = toRel(memory.path, memoryDir);
|
|
202
|
+
const dir = path.posix.dirname(rel);
|
|
203
|
+
const key = dir === "." ? "" : dir.split("/")[0] ?? "";
|
|
204
|
+
const list = groups.get(key) ?? [];
|
|
205
|
+
list.push(memory);
|
|
206
|
+
groups.set(key, list);
|
|
207
|
+
}
|
|
208
|
+
const sections = [...groups.keys()].sort().map((key) => {
|
|
209
|
+
const heading = key === "" ? "Root" : humanize(key);
|
|
210
|
+
const lines = (groups.get(key) ?? [])
|
|
211
|
+
.sort((a, b) => toRel(a.path, memoryDir).localeCompare(toRel(b.path, memoryDir)))
|
|
212
|
+
.map((memory) => {
|
|
213
|
+
const rel = toRel(memory.path, memoryDir);
|
|
214
|
+
const title = firstHeading(memory.content) ?? memory.frontmatter.id;
|
|
215
|
+
const description = normalizeProjectionPreview(memory.content);
|
|
216
|
+
return `* [${title}](/${rel}) - ${description}`;
|
|
217
|
+
});
|
|
218
|
+
return `## ${heading}\n\n${lines.join("\n")}`;
|
|
219
|
+
});
|
|
220
|
+
writeBundleFile(root, "index.md", `---\nokf_version: "${OKF_EXPORT_VERSION}"\n---\n\n${sections.join("\n\n")}\n`);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function renderLog(
|
|
224
|
+
events: Array<{ timestamp?: string; type?: string; action?: string; memoryId?: string }>,
|
|
225
|
+
idToRel: Map<string, string>,
|
|
226
|
+
maxEntries: number,
|
|
227
|
+
): string {
|
|
228
|
+
const sorted = [...events].sort((a, b) => String(b.timestamp ?? "").localeCompare(String(a.timestamp ?? "")));
|
|
229
|
+
const truncated = sorted.length > maxEntries;
|
|
230
|
+
const kept = sorted.slice(0, maxEntries);
|
|
231
|
+
const byDay = new Map<string, typeof kept>();
|
|
232
|
+
for (const event of kept) {
|
|
233
|
+
const day = String(event.timestamp ?? "").slice(0, 10) || "unknown";
|
|
234
|
+
const list = byDay.get(day) ?? [];
|
|
235
|
+
list.push(event);
|
|
236
|
+
byDay.set(day, list);
|
|
237
|
+
}
|
|
238
|
+
const days = [...byDay.keys()].sort((a, b) => b.localeCompare(a));
|
|
239
|
+
const parts = ["# Log", ""];
|
|
240
|
+
for (const day of days) {
|
|
241
|
+
parts.push(`## ${day}`, "");
|
|
242
|
+
for (const event of byDay.get(day) ?? []) {
|
|
243
|
+
const action = boldAction(event.type ?? event.action ?? "Update");
|
|
244
|
+
const id = event.memoryId;
|
|
245
|
+
const rel = id ? idToRel.get(id) : undefined;
|
|
246
|
+
const target = rel ? `[${id}](/${rel})` : id ?? "";
|
|
247
|
+
parts.push(`- **${action}** ${target}`.trimEnd());
|
|
248
|
+
}
|
|
249
|
+
parts.push("");
|
|
250
|
+
}
|
|
251
|
+
if (truncated) parts.push(OKF_LOG_TRUNCATION_MARKER, "");
|
|
252
|
+
return `${parts.join("\n")}\n`;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function boldAction(raw: string): string {
|
|
256
|
+
const lower = raw.toLowerCase();
|
|
257
|
+
if (lower.includes("create") || lower.includes("add")) return "Creation";
|
|
258
|
+
if (lower.includes("deprecat") || lower.includes("delete") || lower.includes("archiv")) return "Deprecation";
|
|
259
|
+
return "Update";
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
function firstHeading(content: string): string | undefined {
|
|
264
|
+
for (const line of content.split("\n")) {
|
|
265
|
+
const match = /^#\s+(.+)$/.exec(line.trim());
|
|
266
|
+
if (match) return match[1]!.trim();
|
|
267
|
+
}
|
|
268
|
+
return undefined;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function humanize(value: string): string {
|
|
272
|
+
return value.replace(/[_-]/g, " ").replace(/\b\w/g, (ch) => ch.toUpperCase());
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
function splitCsv(raw: unknown): string[] {
|
|
278
|
+
if (raw === undefined || raw === null || raw === "") return [];
|
|
279
|
+
const parts = Array.isArray(raw) ? raw.map(String) : String(raw).split(",");
|
|
280
|
+
return parts.map((part) => part.trim()).filter((part) => part.length > 0);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function toRel(abs: string, root: string): string {
|
|
284
|
+
return path.relative(path.resolve(root), path.resolve(abs)).split(path.sep).join("/");
|
|
285
|
+
}
|
|
286
|
+
|
package/src/types.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { DriftDetectionSettings, MemoryDriftProvenance, RecallDriftAnnotati
|
|
|
15
15
|
import type { ProceduralMaintenanceConfig } from "./procedural/maintenance-config.js";
|
|
16
16
|
import type { SkillProjectionConfig } from "./procedural/skill-projection.js";
|
|
17
17
|
import type { ActionGateConfig } from "./coding/action-gate.js";
|
|
18
|
-
|
|
18
|
+
import type { ActiveContextConfigFields } from "./active-context-config.js";
|
|
19
19
|
import type { AmbientCaptureProvenance, BufferTurnOwner, SecurityConfig, OriginMetadata } from "./security/types.js";
|
|
20
20
|
export type MemorySubject = "user" | "agent";
|
|
21
21
|
export type SubjectGuardMode = "off" | "warn" | "enforce";
|
|
@@ -682,8 +682,7 @@ export interface SemanticChunkingConfigShape {
|
|
|
682
682
|
fallbackToRecursive: boolean;
|
|
683
683
|
}
|
|
684
684
|
|
|
685
|
-
|
|
686
|
-
export interface PluginConfig extends BoundedJsonlStateConfig, SecurityConfig, DriftDetectionSettings {
|
|
685
|
+
export interface PluginConfig extends BoundedJsonlStateConfig, SecurityConfig, DriftDetectionSettings, ActiveContextConfigFields {
|
|
687
686
|
openaiApiKey: string | undefined;
|
|
688
687
|
openaiBaseUrl: string | undefined;
|
|
689
688
|
model: string;
|