@remnic/core 9.45.3 → 9.45.4
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/abort-error.d.ts +2 -1
- package/dist/abort-error.js +3 -1
- package/dist/access-admin-ops-surface.d.ts +14 -10
- package/dist/access-admin-ops-surface.js +84 -76
- package/dist/access-audit.js +2 -2
- package/dist/access-authorization-probe.d.ts +14 -10
- package/dist/access-authorization-probe.js +85 -77
- package/dist/access-boundary.d.ts +15 -11
- package/dist/access-boundary.js +84 -76
- package/dist/access-citation-namespace.js +2 -2
- package/dist/access-cli.js +193 -181
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +16 -0
- package/dist/access-coding-context-resolution.js +13 -0
- package/dist/access-coding-context-resolution.js.map +1 -0
- package/dist/access-extraction-force-flush.d.ts +14 -10
- package/dist/access-extraction-force-flush.js +84 -76
- package/dist/access-health-types.d.ts +2 -1
- package/dist/access-http-lcm-compaction.d.ts +16 -12
- package/dist/access-http-lcm-compaction.js +3 -3
- package/dist/access-http-lifecycle-flush.d.ts +14 -10
- package/dist/access-http-lifecycle-flush.js +2 -2
- package/dist/access-http-offline-stream.d.ts +123 -0
- package/dist/access-http-offline-stream.js +10 -0
- package/dist/access-http-offline-stream.js.map +1 -0
- package/dist/access-http-query.js +84 -76
- package/dist/access-http.d.ts +15 -10
- package/dist/access-http.js +105 -92
- package/dist/access-identity-continuity-surface.d.ts +9 -8
- package/dist/access-identity-continuity-surface.js +84 -76
- package/dist/access-lcm-surface.d.ts +14 -10
- package/dist/access-lcm-surface.js +84 -76
- package/dist/access-mcp-output-schemas.js +1 -1
- package/dist/access-mcp.d.ts +14 -10
- package/dist/access-mcp.js +95 -83
- package/dist/access-memory-search-fanout.d.ts +3 -2
- package/dist/{access-namespace-preflight-5yZ4g6F8.d.ts → access-namespace-preflight-CWUDwB4M.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +4 -3
- package/dist/access-namespace-preflight.js +84 -76
- package/dist/access-observe-helpers.d.ts +1 -0
- package/dist/access-observe-helpers.js +1 -1
- package/dist/access-observe-write-surface.d.ts +16 -10
- package/dist/access-observe-write-surface.js +84 -76
- package/dist/access-offline-manifest.d.ts +104 -0
- package/dist/access-offline-manifest.js +45 -0
- package/dist/access-offline-manifest.js.map +1 -0
- package/dist/access-operations-batch.js +86 -78
- package/dist/access-operations.d.ts +15 -11
- package/dist/access-operations.js +91 -80
- package/dist/access-recall-concurrency.d.ts +16 -26
- package/dist/access-recall-concurrency.js +86 -77
- package/dist/access-recall-response.d.ts +18 -14
- package/dist/access-recall-response.js +84 -76
- package/dist/access-recall-surface.d.ts +29 -24
- package/dist/access-recall-surface.js +84 -76
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-CiJRsgAB.d.ts → access-service-CsU-ljFD.d.ts} +25 -16
- package/dist/access-service-helpers.d.ts +14 -10
- package/dist/access-service.d.ts +14 -10
- package/dist/access-service.js +84 -76
- package/dist/access-surface-catalog.d.ts +14 -10
- package/dist/access-surface-catalog.js +4 -0
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +4 -3
- package/dist/action-confidence.d.ts +2 -1
- package/dist/active-memory-bridge.d.ts +2 -1
- package/dist/active-recall.d.ts +2 -1
- package/dist/active-recall.js +10 -8
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +7 -7
- package/dist/adapters/registry.js +3 -3
- package/dist/{auto-sync-5OE5QOZB.js → auto-sync-UPTUVE4X.js} +6 -6
- package/dist/behavior-learner.d.ts +2 -1
- package/dist/behavior-learner.js +1 -1
- package/dist/behavior-signals.d.ts +2 -1
- package/dist/bootstrap.d.ts +9 -8
- package/dist/briefing.d.ts +3 -2
- package/dist/briefing.js +23 -22
- package/dist/buffer-surprise-report.d.ts +2 -1
- package/dist/buffer-turn-helpers.d.ts +2 -1
- package/dist/buffer.d.ts +3 -2
- package/dist/buffer.js +12 -11
- package/dist/bulk-import/index.d.ts +4 -3
- package/dist/calibration.d.ts +2 -1
- package/dist/capabilities.d.ts +2 -1
- package/dist/{capsule-merge-IDWJPCWK.js → capsule-merge-Q6AR3XL7.js} +67 -54
- package/dist/capsule-merge-Q6AR3XL7.js.map +1 -0
- package/dist/{catalog-scBmy0sO.d.ts → catalog-bctMURhN.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +2 -1
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.d.ts +2 -1
- package/dist/causal-consolidation.js +27 -26
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.d.ts +2 -1
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-VUPTKTDV.js → chunk-2MRHJNWL.js} +3 -3
- package/dist/{chunk-JBPKEARU.js → chunk-2QSZNTDO.js} +7 -7
- package/dist/{chunk-5IVLTFOV.js → chunk-44N6ESJ4.js} +2 -2
- package/dist/{chunk-WOCNN776.js → chunk-4POAMKV6.js} +100 -41
- package/dist/chunk-4POAMKV6.js.map +1 -0
- package/dist/{chunk-HO3QBJEY.js → chunk-5546W5SI.js} +2 -2
- package/dist/{chunk-U7GW7NE7.js → chunk-5CEECY6P.js} +10 -10
- package/dist/{chunk-4UH4BTGK.js → chunk-5SNZSWWR.js} +82 -82
- package/dist/{chunk-6CZPDBJS.js → chunk-5U7ID3EZ.js} +3 -3
- package/dist/{chunk-GF22HWS2.js → chunk-6NNNURLK.js} +7 -7
- package/dist/chunk-773TRRGT.js +36 -0
- package/dist/chunk-773TRRGT.js.map +1 -0
- package/dist/chunk-7CITSYSH.js +242 -0
- package/dist/chunk-7CITSYSH.js.map +1 -0
- package/dist/{chunk-227UFSEQ.js → chunk-7RZJWZ46.js} +5 -5
- package/dist/{chunk-E5UK4VPE.js → chunk-7SHJHPTY.js} +5 -5
- package/dist/{chunk-UVIKWC7M.js → chunk-7YERSTN7.js} +17 -17
- package/dist/{chunk-DLVPUX7U.js → chunk-7YKVM5H3.js} +8 -6
- package/dist/chunk-7YKVM5H3.js.map +1 -0
- package/dist/{chunk-3CE77VAP.js → chunk-A4JMGKCD.js} +87 -74
- package/dist/chunk-A4JMGKCD.js.map +1 -0
- package/dist/chunk-A5KNZSNA.js +26 -0
- package/dist/chunk-A5KNZSNA.js.map +1 -0
- package/dist/{chunk-S2NCTZGJ.js → chunk-AJQ57VV3.js} +15 -15
- package/dist/chunk-AJQ57VV3.js.map +1 -0
- package/dist/{chunk-CUM2BBPN.js → chunk-AUMWZSE7.js} +19 -10
- package/dist/chunk-AUMWZSE7.js.map +1 -0
- package/dist/{chunk-XYTOI63Z.js → chunk-BGHFOD5A.js} +19 -11
- package/dist/chunk-BGHFOD5A.js.map +1 -0
- package/dist/{chunk-BUE5E2HL.js → chunk-BGLY7EEM.js} +5 -314
- package/dist/chunk-BGLY7EEM.js.map +1 -0
- package/dist/chunk-BIPBQQFI.js +44 -0
- package/dist/chunk-BIPBQQFI.js.map +1 -0
- package/dist/{chunk-S5SLVSVY.js → chunk-BQIFZ2MP.js} +5 -5
- package/dist/chunk-BTTPKDIL.js +34 -0
- package/dist/{chunk-PVGDJXVK.js.map → chunk-BTTPKDIL.js.map} +1 -1
- package/dist/{chunk-E53DSZEN.js → chunk-C26TE27X.js} +3 -3
- package/dist/{chunk-LZ4LDKHZ.js → chunk-CLB32OHM.js} +6 -6
- package/dist/{chunk-Q6IP2ARR.js → chunk-CSOYVTRX.js} +2 -2
- package/dist/{chunk-XOQSEF7X.js → chunk-CVILPI77.js} +6 -6
- package/dist/chunk-D3I2MCN7.js +29 -0
- package/dist/chunk-D3I2MCN7.js.map +1 -0
- package/dist/{chunk-A5OJCXZL.js → chunk-DSUAAZZX.js} +15 -4
- package/dist/chunk-DSUAAZZX.js.map +1 -0
- package/dist/{chunk-HREE4JHI.js → chunk-DYVMXPCF.js} +486 -287
- package/dist/chunk-DYVMXPCF.js.map +1 -0
- package/dist/{chunk-J7VGGECD.js → chunk-DZPFMQZ7.js} +1 -1
- package/dist/chunk-DZPFMQZ7.js.map +1 -0
- package/dist/{chunk-PDLBLTOK.js → chunk-EITZHSX6.js} +9 -9
- package/dist/{chunk-D3J5SLQK.js → chunk-EJHEWCGQ.js} +81 -20
- package/dist/chunk-EJHEWCGQ.js.map +1 -0
- package/dist/{chunk-WUNIWKY4.js → chunk-ELIL2A37.js} +6 -6
- package/dist/{chunk-E6PNLPGJ.js → chunk-FZP32336.js} +806 -470
- package/dist/chunk-FZP32336.js.map +1 -0
- package/dist/{chunk-HZFHQ4AQ.js → chunk-G7A5HLUS.js} +23 -17
- package/dist/chunk-G7A5HLUS.js.map +1 -0
- package/dist/{chunk-CINZGPSJ.js → chunk-GUMZC2BO.js} +2 -2
- package/dist/{chunk-H24WNPA2.js → chunk-GWFSVJ4P.js} +3 -3
- package/dist/{chunk-7XC2HX75.js → chunk-GYPQL6XN.js} +157 -16
- package/dist/chunk-GYPQL6XN.js.map +1 -0
- package/dist/{chunk-TSH56VPU.js → chunk-HAYSYUAB.js} +2 -2
- package/dist/{chunk-TDHTVMPG.js → chunk-HFPASSFV.js} +7 -2
- package/dist/chunk-HFPASSFV.js.map +1 -0
- package/dist/chunk-J2WC5LF4.js +395 -0
- package/dist/chunk-J2WC5LF4.js.map +1 -0
- package/dist/{chunk-PKNLM44P.js → chunk-JH6BPLOP.js} +9 -9
- package/dist/{chunk-KXB4VXHY.js → chunk-JIYDRBVZ.js} +2 -2
- package/dist/chunk-JV3C2MNQ.js +74 -0
- package/dist/chunk-JV3C2MNQ.js.map +1 -0
- package/dist/{chunk-AV5ZEH4M.js → chunk-KVJRXN2E.js} +2 -2
- package/dist/{chunk-JVLCVFQ4.js → chunk-KXEFRMCF.js} +3 -3
- package/dist/{chunk-WFTIGIIS.js → chunk-L6CQ7WIW.js} +5 -5
- package/dist/{chunk-EJUEXZHX.js → chunk-LLJMAULE.js} +2 -2
- package/dist/{chunk-N5Z4EVOR.js → chunk-LNEWDF2A.js} +36 -11
- package/dist/chunk-LNEWDF2A.js.map +1 -0
- package/dist/{chunk-AS7YMSL6.js → chunk-M23RF3LJ.js} +4 -4
- package/dist/{chunk-UYLMNVY6.js → chunk-MDISBSYA.js} +16 -9
- package/dist/chunk-MDISBSYA.js.map +1 -0
- package/dist/{chunk-3F2LKUMU.js → chunk-NIS256NW.js} +2 -2
- package/dist/{chunk-YIAA2X3D.js → chunk-NK5RGJ65.js} +3 -3
- package/dist/chunk-NLDVVWCL.js +84 -0
- package/dist/chunk-NLDVVWCL.js.map +1 -0
- package/dist/{chunk-OQ5PRDDS.js → chunk-NTOIP2E6.js} +6 -6
- package/dist/{chunk-HLPD7B7P.js → chunk-NUEQKLNB.js} +2 -2
- package/dist/{chunk-4J7G5SY4.js → chunk-NZBZ7IS2.js} +72 -24
- package/dist/chunk-NZBZ7IS2.js.map +1 -0
- package/dist/{chunk-3TBLDMJA.js → chunk-O4KMGRXE.js} +5 -2
- package/dist/chunk-O4KMGRXE.js.map +1 -0
- package/dist/{chunk-33PLLLL7.js → chunk-P7NGM24P.js} +6 -6
- package/dist/{chunk-7TWUCYER.js → chunk-PNRA7FAD.js} +7 -7
- package/dist/{chunk-5I4M26Q7.js → chunk-QBSFOKY6.js} +4 -4
- package/dist/{chunk-QJAQNXWI.js → chunk-QCECHYZL.js} +76 -79
- package/dist/chunk-QCECHYZL.js.map +1 -0
- package/dist/{chunk-P4DRWEYC.js → chunk-QVSBTCVP.js} +2 -2
- package/dist/{chunk-AAIUERNB.js → chunk-R5RFK3CB.js} +6 -6
- package/dist/{chunk-WDISJRMG.js → chunk-RMMVQQA6.js} +2 -2
- package/dist/{chunk-KWMXR7XS.js → chunk-S2V7RUCL.js} +8 -1
- package/dist/{chunk-KWMXR7XS.js.map → chunk-S2V7RUCL.js.map} +1 -1
- package/dist/{chunk-5SM35XZR.js → chunk-S5NZBKKQ.js} +2 -2
- package/dist/{chunk-VNA7W7QF.js → chunk-SVH57F5Z.js} +12 -4
- package/dist/chunk-SVH57F5Z.js.map +1 -0
- package/dist/{chunk-WIPEXG6R.js → chunk-SXIMQLGV.js} +2 -2
- package/dist/{chunk-RVLJEII5.js → chunk-SYUBB3WM.js} +256 -187
- package/dist/chunk-SYUBB3WM.js.map +1 -0
- package/dist/{chunk-OAEQLRCY.js → chunk-TN76AKO3.js} +5 -5
- package/dist/{chunk-QN25OCUF.js → chunk-TQ4GD737.js} +5 -5
- package/dist/{chunk-VCD4PSK2.js → chunk-TQZ4DVBC.js} +7 -4
- package/dist/chunk-TQZ4DVBC.js.map +1 -0
- package/dist/{chunk-7K5Q6COX.js → chunk-TVVEYCNW.js} +4 -4
- package/dist/{chunk-DNWXFTLD.js → chunk-TYISDI6B.js} +2 -2
- package/dist/{chunk-4LMA77JH.js → chunk-U2VLVBBH.js} +3 -3
- package/dist/{chunk-5ZE7QHTK.js → chunk-ULVR5KG7.js} +5 -5
- package/dist/{chunk-NVRYW264.js → chunk-UQWIKLQK.js} +18 -15
- package/dist/chunk-UQWIKLQK.js.map +1 -0
- package/dist/{chunk-YV32N67O.js → chunk-URS5GSM7.js} +1 -1
- package/dist/chunk-URS5GSM7.js.map +1 -0
- package/dist/{chunk-4B77XSG5.js → chunk-UV72DEZD.js} +5 -5
- package/dist/{chunk-S2BBISHU.js → chunk-VANZKHTN.js} +3 -3
- package/dist/chunk-VHFXP27N.js +250 -0
- package/dist/chunk-VHFXP27N.js.map +1 -0
- package/dist/{chunk-3Y224NYC.js → chunk-VYISFWVX.js} +2 -2
- package/dist/{chunk-TIHMZFIV.js → chunk-W3IC7QOY.js} +3 -3
- package/dist/{chunk-NRV4Y3PM.js → chunk-W4FBGYGK.js} +1 -1
- package/dist/{chunk-P2BM76KT.js → chunk-WAS4HV46.js} +174 -43
- package/dist/chunk-WAS4HV46.js.map +1 -0
- package/dist/{chunk-57QKLRBV.js → chunk-WB7JSQCP.js} +2 -1
- package/dist/chunk-WB7JSQCP.js.map +1 -0
- package/dist/chunk-WGP57SR3.js +68 -0
- package/dist/chunk-WGP57SR3.js.map +1 -0
- package/dist/{chunk-ECK75GDJ.js → chunk-WQIHRA5F.js} +43 -24
- package/dist/chunk-WQIHRA5F.js.map +1 -0
- package/dist/{chunk-MU7ZHSZE.js → chunk-WZFAPHIK.js} +2 -2
- package/dist/{chunk-T2TTP3KU.js → chunk-X4IDNPOS.js} +2 -2
- package/dist/{chunk-BLAKS3CP.js → chunk-XL3TATMJ.js} +3 -3
- package/dist/{chunk-W4XJFLAL.js → chunk-XPRJSHNI.js} +2 -2
- package/dist/{chunk-5TFP4CUL.js → chunk-XQ3HXAQH.js} +14 -11
- package/dist/chunk-XQ3HXAQH.js.map +1 -0
- package/dist/{chunk-VWAXN2BN.js → chunk-XSFHWBQO.js} +93 -31
- package/dist/chunk-XSFHWBQO.js.map +1 -0
- package/dist/{chunk-DL7ZD3JH.js → chunk-XTAUXTDO.js} +14 -9
- package/dist/chunk-XTAUXTDO.js.map +1 -0
- package/dist/{chunk-JE7EK33X.js → chunk-Y7HRYCNW.js} +2 -2
- package/dist/{chunk-E6EE5B67.js → chunk-YK6BDDHP.js} +4 -4
- package/dist/{chunk-ES36HTSC.js → chunk-YLHM5BQQ.js} +3 -3
- package/dist/{chunk-RN7DY3FC.js → chunk-YMAQDHQM.js} +31 -12
- package/dist/chunk-YMAQDHQM.js.map +1 -0
- package/dist/{chunk-ULARSG5Z.js → chunk-YN6ASZUG.js} +10 -8
- package/dist/{chunk-ULARSG5Z.js.map → chunk-YN6ASZUG.js.map} +1 -1
- package/dist/{chunk-IKKWIPYN.js → chunk-YYQAKIDJ.js} +37 -1
- package/dist/chunk-YYQAKIDJ.js.map +1 -0
- package/dist/{chunk-BJKPPZ6Z.js → chunk-ZFGZ6PZ2.js} +2 -2
- package/dist/{chunk-CJ2ZR7UA.js → chunk-ZI32MKDW.js} +267 -214
- package/dist/chunk-ZI32MKDW.js.map +1 -0
- package/dist/{chunk-64UDOIMI.js → chunk-ZLQ37WJX.js} +2 -2
- package/dist/chunk-ZMAYKGPN.js +351 -0
- package/dist/chunk-ZMAYKGPN.js.map +1 -0
- package/dist/{cli-BUGN3d6_.d.ts → cli-BBHDtG36.d.ts} +5 -5
- package/dist/cli.d.ts +16 -12
- package/dist/cli.js +138 -124
- package/dist/compounding/engine.d.ts +3 -2
- package/dist/compounding/engine.js +24 -23
- package/dist/compounding/preference-consolidator.d.ts +2 -1
- package/dist/compression-optimizer.d.ts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/config.js +10 -8
- package/dist/connectors/codex-materialize-runner.d.ts +2 -1
- package/dist/connectors/codex-materialize-runner.js +23 -22
- package/dist/connectors/codex-materialize.d.ts +2 -1
- package/dist/connectors/index.d.ts +2 -1
- package/dist/connectors/index.js +26 -25
- package/dist/consolidation-provenance-check.d.ts +3 -2
- package/dist/consolidation-provenance-check.js +4 -4
- package/dist/consolidation-undo.d.ts +3 -2
- package/dist/consolidation-undo.js +10 -7
- package/dist/consolidation-undo.js.map +1 -1
- package/dist/contradiction/index.d.ts +3 -2
- package/dist/converge-config.d.ts +2 -1
- package/dist/convergence-refresh.d.ts +4 -3
- package/dist/convergence-refresh.js +27 -26
- package/dist/conversation-index/backend.d.ts +2 -1
- package/dist/conversation-index/backend.js +2 -2
- package/dist/conversation-index/chunker.d.ts +2 -1
- package/dist/conversation-index/faiss-adapter.d.ts +2 -1
- package/dist/conversation-index/indexer.d.ts +2 -1
- package/dist/conversation-index/search.d.ts +2 -1
- package/dist/corpus-watermark.d.ts +2 -1
- package/dist/corpus-watermark.js +42 -41
- package/dist/day-summary.d.ts +2 -1
- package/dist/delinearize.d.ts +2 -1
- package/dist/direct-answer-wiring.d.ts +2 -1
- package/dist/direct-answer-wiring.js +2 -2
- package/dist/direct-answer.d.ts +2 -1
- package/dist/embedding-fallback.d.ts +2 -1
- package/dist/embedding-fallback.js +2 -2
- package/dist/enrichment/index.d.ts +2 -1
- package/dist/entity-retrieval-boundaries.js +1 -1
- package/dist/entity-retrieval.d.ts +3 -2
- package/dist/entity-retrieval.js +24 -23
- package/dist/entity-schema.d.ts +2 -1
- package/dist/explicit-capture.d.ts +9 -8
- package/dist/explicit-capture.js +11 -9
- package/dist/external-wiki-access.d.ts +127 -0
- package/dist/external-wiki-access.js +186 -0
- package/dist/external-wiki-access.js.map +1 -0
- package/dist/external-wiki-cli.d.ts +13 -0
- package/dist/external-wiki-cli.js +96 -0
- package/dist/external-wiki-cli.js.map +1 -0
- package/dist/external-wiki-collection-registration.d.ts +39 -0
- package/dist/external-wiki-collection-registration.js +79 -0
- package/dist/external-wiki-collection-registration.js.map +1 -0
- package/dist/external-wiki-collection.d.ts +50 -0
- package/dist/external-wiki-collection.js +387 -0
- package/dist/external-wiki-collection.js.map +1 -0
- package/dist/external-wiki-config.d.ts +13 -0
- package/dist/external-wiki-config.js +13 -0
- package/dist/external-wiki-config.js.map +1 -0
- package/dist/external-wiki-guard.d.ts +11 -0
- package/dist/external-wiki-guard.js +18 -0
- package/dist/external-wiki-guard.js.map +1 -0
- package/dist/external-wiki-mcp-tools.d.ts +123 -0
- package/dist/external-wiki-mcp-tools.js +8 -0
- package/dist/external-wiki-mcp-tools.js.map +1 -0
- package/dist/external-wiki-search.d.ts +42 -0
- package/dist/external-wiki-search.js +11 -0
- package/dist/external-wiki-search.js.map +1 -0
- package/dist/external-wiki.d.ts +43 -0
- package/dist/external-wiki.js +16 -0
- package/dist/external-wiki.js.map +1 -0
- package/dist/extraction-error-classification.d.ts +2 -1
- package/dist/extraction-faithfulness.d.ts +2 -1
- package/dist/extraction-judge-telemetry.d.ts +2 -1
- package/dist/extraction-judge-training.d.ts +2 -1
- package/dist/extraction-judge.d.ts +2 -1
- package/dist/extraction-liveness.d.ts +2 -1
- package/dist/extraction-source-grounding-helpers.d.ts +5 -3
- package/dist/extraction-source-grounding-helpers.js +1 -1
- package/dist/extraction-source-grounding-rules.d.ts +2 -1
- package/dist/extraction-source-grounding-rules.js +2 -2
- package/dist/extraction-source-grounding.d.ts +2 -1
- package/dist/extraction-source-grounding.js +5 -5
- package/dist/extraction.d.ts +2 -1
- package/dist/extraction.js +45 -43
- package/dist/fallback-llm.d.ts +2 -1
- package/dist/graph-dashboard-diff.d.ts +2 -1
- package/dist/graph-dashboard-key.d.ts +2 -1
- package/dist/graph-dashboard-parser.d.ts +2 -1
- package/dist/graph-edge-reinforcement.d.ts +2 -1
- package/dist/graph-snapshot.d.ts +2 -1
- package/dist/graph.d.ts +2 -1
- package/dist/harmonic-retrieval.js +2 -2
- package/dist/importance.d.ts +2 -1
- package/dist/importers/index.d.ts +2 -1
- package/dist/in-flight-reads.d.ts +2 -1
- package/dist/index.d.ts +362 -350
- package/dist/index.js +291 -259
- package/dist/intent.d.ts +2 -1
- package/dist/lcm/engine.d.ts +2 -1
- package/dist/lcm/engine.js +3 -3
- package/dist/lcm/index.d.ts +2 -1
- package/dist/lcm/index.js +8 -8
- package/dist/lcm/tools.d.ts +2 -1
- package/dist/lifecycle.d.ts +2 -1
- package/dist/live-connectors-runner.d.ts +2 -1
- package/dist/local-llm.d.ts +2 -1
- package/dist/local-llm.js +2 -2
- package/dist/local-model-endpoint.d.ts +2 -1
- package/dist/maintenance/memory-governance.d.ts +2 -1
- package/dist/maintenance/memory-governance.js +24 -23
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +24 -23
- package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-projection.js +26 -25
- package/dist/{maintenance-LbuS2rUA.d.ts → maintenance-D2mveyCd.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +14 -10
- package/dist/mcp-read-only-tools.js +1 -1
- package/dist/memory-action-policy.d.ts +2 -1
- package/dist/memory-cache.d.ts +2 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
- package/dist/memory-projection-store.d.ts +2 -1
- package/dist/memory-provenance.d.ts +2 -1
- package/dist/memory-worth-outcomes.d.ts +3 -2
- package/dist/models-json.d.ts +2 -1
- package/dist/namespaces/migrate.d.ts +4 -3
- package/dist/namespaces/migrate.js +40 -39
- package/dist/namespaces/principal.d.ts +2 -1
- package/dist/namespaces/search.d.ts +2 -1
- package/dist/namespaces/search.js +18 -18
- package/dist/namespaces/storage.d.ts +4 -3
- package/dist/namespaces/storage.js +23 -22
- package/dist/native-knowledge.d.ts +2 -1
- package/dist/offline-sync-impression-drain.d.ts +2 -1
- package/dist/offline-sync-impression-drain.js +11 -9
- package/dist/offline-sync.d.ts +29 -3
- package/dist/offline-sync.js +6 -2
- package/dist/operator-doctor-corpus.d.ts +2 -1
- package/dist/operator-doctor-corpus.js +45 -44
- package/dist/operator-doctor-replica.d.ts +2 -1
- package/dist/operator-doctor-replica.js +3 -3
- package/dist/operator-toolkit.d.ts +4 -3
- package/dist/operator-toolkit.js +59 -55
- package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
- package/dist/orchestration/maintenance.d.ts +5 -4
- package/dist/orchestration/maintenance.js +36 -33
- package/dist/{orchestrator-rHiWt32X.d.ts → orchestrator-DJYlwiUv.d.ts} +14 -7
- package/dist/orchestrator.d.ts +9 -8
- package/dist/orchestrator.js +201 -189
- package/dist/page-versioning.js +3 -3
- package/dist/patterns-cli.d.ts +2 -1
- package/dist/{pipeline-W_97O8BV.d.ts → pipeline-CNjY4wk3.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +2 -1
- package/dist/policy-runtime.js +1 -1
- package/dist/proactive-contention.d.ts +2 -1
- package/dist/provenance.d.ts +2 -1
- package/dist/provenance.js +2 -2
- package/dist/{qmd-LWtMofAf.d.ts → qmd-C0UDZidt.d.ts} +9 -7
- package/dist/qmd-preflight.d.ts +5 -4
- package/dist/qmd-preflight.js +2 -2
- package/dist/qmd-recall-cache.d.ts +2 -1
- package/dist/qmd.d.ts +4 -3
- package/dist/qmd.js +5 -5
- package/dist/recall-concurrency-config.d.ts +2 -1
- package/dist/recall-disclosure-escalation.d.ts +2 -1
- package/dist/recall-explain-renderer.d.ts +2 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +2 -1
- package/dist/recall-planner-llm.d.ts +2 -1
- package/dist/recall-state.d.ts +2 -1
- package/dist/recall-tag-filter.d.ts +2 -1
- package/dist/recall-timings.d.ts +2 -1
- package/dist/recall-xray-cli.d.ts +2 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +2 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +8 -1
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +12 -2
- package/dist/reconcile/cursor.js +46 -7
- package/dist/reconcile/cursor.js.map +1 -1
- package/dist/reconcile/manifest.d.ts +9 -2
- package/dist/reconcile/manifest.js +15 -268
- package/dist/reconcile/manifest.js.map +1 -1
- package/dist/reconcile/plan.d.ts +4 -1
- package/dist/reconcile/plan.js +4 -4
- package/dist/replay/normalizers/chatgpt.d.ts +2 -1
- package/dist/replay/normalizers/claude.d.ts +2 -1
- package/dist/replay/normalizers/openclaw.d.ts +2 -1
- package/dist/replay/normalizers/shared.d.ts +2 -1
- package/dist/replay/runner.d.ts +2 -1
- package/dist/replay/types.d.ts +2 -1
- package/dist/replica-divergence.d.ts +2 -1
- package/dist/replica-divergence.js +2 -2
- package/dist/replica-peers-config.d.ts +2 -1
- package/dist/resolve-auth-token.d.ts +2 -1
- package/dist/resume-bundles.js +12 -10
- package/dist/retrieval-agents.d.ts +4 -3
- package/dist/retrieval-agents.js +2 -2
- package/dist/retrieval-tiers.d.ts +2 -1
- package/dist/routing/engine.d.ts +2 -1
- package/dist/routing/store.d.ts +2 -1
- package/dist/salvage-envelope.d.ts +2 -1
- package/dist/schemas.d.ts +32 -32
- package/dist/{scope-profiles-BiQKOE-p.d.ts → scope-profiles-BJzp2F5A.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +2 -1
- package/dist/search/embed-helper.js +3 -3
- package/dist/search/factory.d.ts +4 -2
- package/dist/search/factory.js +20 -18
- package/dist/search/index.d.ts +2 -1
- package/dist/search/index.js +22 -22
- package/dist/search/lancedb-backend.d.ts +2 -1
- package/dist/search/lancedb-backend.js +4 -4
- package/dist/search/meilisearch-backend.d.ts +2 -1
- package/dist/search/meilisearch-backend.js +4 -4
- package/dist/search/noop-backend.d.ts +2 -1
- package/dist/search/orama-backend.d.ts +2 -1
- package/dist/search/orama-backend.js +4 -4
- package/dist/search/port.d.ts +18 -1
- package/dist/search/port.js +1 -1
- package/dist/search/remote-backend.d.ts +2 -1
- package/dist/search/remote-backend.js +2 -2
- package/dist/secure-store/index.js +2 -2
- package/dist/{semantic-consolidation-dHYCyqgh.d.ts → semantic-consolidation-D4KAZO2G.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +3 -2
- package/dist/semantic-consolidation.js +25 -24
- package/dist/semantic-rule-promotion.js +23 -22
- package/dist/semantic-rule-verifier.d.ts +2 -1
- package/dist/semantic-rule-verifier.js +24 -23
- package/dist/{service-DJG3KCQ4.d.ts → service-BeDxSqE-.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +2 -1
- package/dist/session-observer-state.d.ts +2 -1
- package/dist/shared-context/manager.d.ts +2 -1
- package/dist/shared-context/manager.js +2 -2
- package/dist/signal.d.ts +2 -1
- package/dist/source-agent-qualifier.d.ts +2 -1
- package/dist/source-agent-qualifier.js +42 -40
- package/dist/{storage-F9FVh-w9.d.ts → storage-DfjxusTE.d.ts} +24 -12
- package/dist/storage.d.ts +3 -2
- package/dist/storage.js +25 -24
- package/dist/summarizer.d.ts +2 -1
- package/dist/summarizer.js +5 -5
- package/dist/summary-snapshot.d.ts +2 -1
- package/dist/temporal-supersession.d.ts +3 -2
- package/dist/temporal-timeline-recall.d.ts +2 -1
- package/dist/temporal-validity.d.ts +2 -1
- package/dist/threading.d.ts +2 -1
- package/dist/tier-migration.d.ts +3 -2
- package/dist/tier-routing.d.ts +2 -1
- package/dist/tool-scoped-memory.d.ts +5 -1
- package/dist/tool-scoped-memory.js +3 -1
- package/dist/topics.d.ts +2 -1
- package/dist/transcript.d.ts +2 -1
- package/dist/transfer/capsule-import.js +4 -4
- package/dist/transfer/types.d.ts +12 -12
- package/dist/trust-score-stage.d.ts +2 -1
- package/dist/trust-score.d.ts +2 -1
- package/dist/{types-rEwubvim.d.ts → types-yX_FwERf.d.ts} +8 -1
- package/dist/types.d.ts +2 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +2 -1
- package/dist/verified-recall.js +24 -23
- package/dist/write-envelope.d.ts +2 -1
- package/package.json +2 -2
- package/src/abort-error.ts +17 -0
- package/src/access-admin-ops-surface.ts +1 -0
- package/src/access-boundary.ts +1 -0
- package/src/access-coding-context-resolution.ts +42 -0
- package/src/access-extraction-force-flush.ts +38 -2
- package/src/access-http-lcm-compaction.ts +5 -2
- package/src/access-http-offline-stream.ts +79 -0
- package/src/access-http.test.ts +310 -3
- package/src/access-http.ts +85 -21
- package/src/access-mcp-output-schemas.ts +36 -0
- package/src/access-mcp.test.ts +95 -1
- package/src/access-mcp.ts +7 -9
- package/src/access-observe-helpers.ts +64 -22
- package/src/access-observe-write-surface.ts +8 -0
- package/src/access-offline-manifest.ts +54 -0
- package/src/access-operations-batch.ts +3 -3
- package/src/access-operations.ts +13 -7
- package/src/access-recall-concurrency.ts +3 -27
- package/src/access-recall-surface.ts +3 -0
- package/src/access-service-health.test.ts +32 -7
- package/src/access-service-namespace.test.ts +55 -0
- package/src/access-service-observe-idempotency.test.ts +34 -2
- package/src/access-service-observe-lcm-parity.test.ts +138 -3
- package/src/access-service-observe-scope.test.ts +160 -1
- package/src/access-service-offline-file-content.test.ts +345 -1
- package/src/access-service.ts +86 -59
- package/src/access-surface-catalog.ts +4 -0
- package/src/admin/admin-surfaces.ts +2 -0
- package/src/binary-lifecycle/pipeline.test.ts +106 -1
- package/src/binary-lifecycle/pipeline.ts +3 -0
- package/src/coding/git-context.test.ts +47 -0
- package/src/coding/git-context.ts +129 -27
- package/src/config.test.ts +24 -0
- package/src/config.ts +9 -12
- package/src/connector-provenance.test.ts +101 -0
- package/src/consolidation-undo.ts +3 -0
- package/src/convergence-refresh.ts +14 -2
- package/src/correction/correction-access-wiring.ts +9 -7
- package/src/correction/correction-executor.test.ts +206 -2
- package/src/correction/correction-executor.ts +29 -20
- package/src/correction/correction-planner.test.ts +36 -0
- package/src/correction/correction-planner.ts +9 -15
- package/src/correction/correction-service.ts +3 -1
- package/src/correction/correction-storage-integration.test.ts +77 -0
- package/src/correction/correction-surfaces.test.ts +41 -28
- package/src/correction/passive-capture.test.ts +59 -0
- package/src/correction/passive-capture.ts +4 -1
- package/src/entity-retrieval-boundaries.ts +17 -4
- package/src/entity-retrieval.ts +27 -6
- package/src/external-wiki-access.test.ts +65 -0
- package/src/external-wiki-access.ts +31 -0
- package/src/external-wiki-cli.ts +92 -0
- package/src/external-wiki-collection-registration.test.ts +163 -0
- package/src/external-wiki-collection-registration.ts +101 -0
- package/src/external-wiki-collection.test.ts +502 -0
- package/src/external-wiki-collection.ts +503 -0
- package/src/external-wiki-config.test.ts +135 -0
- package/src/external-wiki-config.ts +100 -0
- package/src/external-wiki-guard.ts +83 -0
- package/src/external-wiki-mcp-tools.ts +23 -0
- package/src/external-wiki-search.test.ts +301 -0
- package/src/external-wiki-search.ts +362 -0
- package/src/external-wiki.test.ts +240 -0
- package/src/external-wiki.ts +453 -0
- package/src/extraction-scope-source-agent.test.ts +21 -0
- package/src/extraction-source-grounding-helpers.ts +243 -53
- package/src/extraction-source-grounding-rules.ts +133 -39
- package/src/extraction-source-grounding.test.ts +363 -33
- package/src/extraction-timeout.test.ts +1 -0
- package/src/extraction-watermark.test.ts +150 -7
- package/src/extraction.ts +8 -1
- package/src/index.ts +8 -0
- package/src/mcp-read-only-tools.ts +1 -0
- package/src/offline-sync.test.ts +194 -0
- package/src/offline-sync.ts +217 -13
- package/src/orchestration/external-wiki-recall-guard.test.ts +94 -0
- package/src/orchestration/extraction-persist.ts +19 -2
- package/src/orchestration/extraction-run-helpers.ts +37 -19
- package/src/orchestration/extraction-run.test.ts +171 -2
- package/src/orchestration/extraction-run.ts +11 -13
- package/src/orchestration/extraction-watermark.ts +106 -17
- package/src/orchestration/generic-recall-paths.ts +14 -0
- package/src/orchestration/orchestrator-helpers.ts +2 -0
- package/src/orchestration/orchestrator-init.ts +9 -0
- package/src/orchestration/recall-internal-deps.ts +6 -0
- package/src/orchestration/recall-internal.ts +154 -33
- package/src/orchestration/recall-rerank-coordinator.ts +60 -25
- package/src/orchestration/recall-search-pipeline.test.ts +75 -1
- package/src/orchestration/recall-search-pipeline.ts +50 -10
- package/src/orchestrator-convergence-refresh.test.ts +36 -2
- package/src/orchestrator.ts +13 -3
- package/src/page-versioning.ts +5 -19
- package/src/procedural/procedure-recall.ts +5 -1
- package/src/provenance-surfaces.test.ts +3 -0
- package/src/qmd-client.test.ts +78 -17
- package/src/qmd.test.ts +24 -0
- package/src/qmd.ts +224 -315
- package/src/recall-explain-renderer.ts +3 -0
- package/src/recall-rerank-coordinator.test.ts +61 -0
- package/src/recall-xray-renderer.test.ts +6 -0
- package/src/recall-xray.test.ts +88 -1
- package/src/recall-xray.ts +15 -0
- package/src/reconcile/cursor.test.ts +48 -0
- package/src/reconcile/cursor.ts +58 -11
- package/src/reconcile/manifest.test.ts +4 -0
- package/src/reconcile/manifest.ts +41 -51
- package/src/reconcile/plan.test.ts +4 -0
- package/src/reconcile/plan.ts +28 -16
- package/src/search/factory.ts +6 -6
- package/src/search/port.ts +25 -9
- package/src/secure-store/secure-fs.ts +20 -12
- package/src/secure-store/secure-store.test.ts +41 -2
- package/src/spaces/index.test.ts +61 -2
- package/src/spaces/index.ts +44 -18
- package/src/storage/entity-alias-config.ts +97 -0
- package/src/storage/entity-canonical-id-lock.ts +53 -23
- package/src/storage/entity-canonical-id-migration.ts +53 -22
- package/src/storage/entity-canonical-id-references.ts +3 -0
- package/src/storage/entity-id-safety.ts +7 -0
- package/src/storage/entity-store.ts +6 -2
- package/src/storage/memory-frontmatter-metadata.ts +4 -9
- package/src/storage/memory-migration-serialization.ts +10 -15
- package/src/storage/tombstone-blocked-capture-mutation.ts +52 -64
- package/src/storage/tombstone-blocked-capture-sync.ts +244 -199
- package/src/storage-deletion-revisions.test.ts +91 -0
- package/src/storage-fact-hash-index-defer.test.ts +446 -163
- package/src/storage.ts +534 -245
- package/src/tool-scoped-memory.ts +10 -0
- package/src/transfer/capsule-import.ts +13 -0
- package/src/transfer/capsule-merge.ts +13 -0
- package/src/trust-score-recall-paths.test.ts +75 -1
- package/src/types.ts +7 -3
- package/dist/capsule-merge-IDWJPCWK.js.map +0 -1
- package/dist/chunk-3CE77VAP.js.map +0 -1
- package/dist/chunk-3TBLDMJA.js.map +0 -1
- package/dist/chunk-4J7G5SY4.js.map +0 -1
- package/dist/chunk-57QKLRBV.js.map +0 -1
- package/dist/chunk-5TFP4CUL.js.map +0 -1
- package/dist/chunk-7XC2HX75.js.map +0 -1
- package/dist/chunk-A5OJCXZL.js.map +0 -1
- package/dist/chunk-BUE5E2HL.js.map +0 -1
- package/dist/chunk-CJ2ZR7UA.js.map +0 -1
- package/dist/chunk-CUM2BBPN.js.map +0 -1
- package/dist/chunk-D3J5SLQK.js.map +0 -1
- package/dist/chunk-DL7ZD3JH.js.map +0 -1
- package/dist/chunk-DLVPUX7U.js.map +0 -1
- package/dist/chunk-E6PNLPGJ.js.map +0 -1
- package/dist/chunk-ECK75GDJ.js.map +0 -1
- package/dist/chunk-HREE4JHI.js.map +0 -1
- package/dist/chunk-HZFHQ4AQ.js.map +0 -1
- package/dist/chunk-IKKWIPYN.js.map +0 -1
- package/dist/chunk-J7VGGECD.js.map +0 -1
- package/dist/chunk-N5Z4EVOR.js.map +0 -1
- package/dist/chunk-NVRYW264.js.map +0 -1
- package/dist/chunk-P2BM76KT.js.map +0 -1
- package/dist/chunk-PVGDJXVK.js +0 -21
- package/dist/chunk-QJAQNXWI.js.map +0 -1
- package/dist/chunk-RN7DY3FC.js.map +0 -1
- package/dist/chunk-RVLJEII5.js.map +0 -1
- package/dist/chunk-S2NCTZGJ.js.map +0 -1
- package/dist/chunk-TDHTVMPG.js.map +0 -1
- package/dist/chunk-UYLMNVY6.js.map +0 -1
- package/dist/chunk-VCD4PSK2.js.map +0 -1
- package/dist/chunk-VNA7W7QF.js.map +0 -1
- package/dist/chunk-VWAXN2BN.js.map +0 -1
- package/dist/chunk-WOCNN776.js.map +0 -1
- package/dist/chunk-XYTOI63Z.js.map +0 -1
- package/dist/chunk-YV32N67O.js.map +0 -1
- /package/dist/{auto-sync-5OE5QOZB.js.map → auto-sync-UPTUVE4X.js.map} +0 -0
- /package/dist/{chunk-VUPTKTDV.js.map → chunk-2MRHJNWL.js.map} +0 -0
- /package/dist/{chunk-JBPKEARU.js.map → chunk-2QSZNTDO.js.map} +0 -0
- /package/dist/{chunk-5IVLTFOV.js.map → chunk-44N6ESJ4.js.map} +0 -0
- /package/dist/{chunk-HO3QBJEY.js.map → chunk-5546W5SI.js.map} +0 -0
- /package/dist/{chunk-U7GW7NE7.js.map → chunk-5CEECY6P.js.map} +0 -0
- /package/dist/{chunk-4UH4BTGK.js.map → chunk-5SNZSWWR.js.map} +0 -0
- /package/dist/{chunk-6CZPDBJS.js.map → chunk-5U7ID3EZ.js.map} +0 -0
- /package/dist/{chunk-GF22HWS2.js.map → chunk-6NNNURLK.js.map} +0 -0
- /package/dist/{chunk-227UFSEQ.js.map → chunk-7RZJWZ46.js.map} +0 -0
- /package/dist/{chunk-E5UK4VPE.js.map → chunk-7SHJHPTY.js.map} +0 -0
- /package/dist/{chunk-UVIKWC7M.js.map → chunk-7YERSTN7.js.map} +0 -0
- /package/dist/{chunk-S5SLVSVY.js.map → chunk-BQIFZ2MP.js.map} +0 -0
- /package/dist/{chunk-E53DSZEN.js.map → chunk-C26TE27X.js.map} +0 -0
- /package/dist/{chunk-LZ4LDKHZ.js.map → chunk-CLB32OHM.js.map} +0 -0
- /package/dist/{chunk-Q6IP2ARR.js.map → chunk-CSOYVTRX.js.map} +0 -0
- /package/dist/{chunk-XOQSEF7X.js.map → chunk-CVILPI77.js.map} +0 -0
- /package/dist/{chunk-PDLBLTOK.js.map → chunk-EITZHSX6.js.map} +0 -0
- /package/dist/{chunk-WUNIWKY4.js.map → chunk-ELIL2A37.js.map} +0 -0
- /package/dist/{chunk-CINZGPSJ.js.map → chunk-GUMZC2BO.js.map} +0 -0
- /package/dist/{chunk-H24WNPA2.js.map → chunk-GWFSVJ4P.js.map} +0 -0
- /package/dist/{chunk-TSH56VPU.js.map → chunk-HAYSYUAB.js.map} +0 -0
- /package/dist/{chunk-PKNLM44P.js.map → chunk-JH6BPLOP.js.map} +0 -0
- /package/dist/{chunk-KXB4VXHY.js.map → chunk-JIYDRBVZ.js.map} +0 -0
- /package/dist/{chunk-AV5ZEH4M.js.map → chunk-KVJRXN2E.js.map} +0 -0
- /package/dist/{chunk-JVLCVFQ4.js.map → chunk-KXEFRMCF.js.map} +0 -0
- /package/dist/{chunk-WFTIGIIS.js.map → chunk-L6CQ7WIW.js.map} +0 -0
- /package/dist/{chunk-EJUEXZHX.js.map → chunk-LLJMAULE.js.map} +0 -0
- /package/dist/{chunk-AS7YMSL6.js.map → chunk-M23RF3LJ.js.map} +0 -0
- /package/dist/{chunk-3F2LKUMU.js.map → chunk-NIS256NW.js.map} +0 -0
- /package/dist/{chunk-YIAA2X3D.js.map → chunk-NK5RGJ65.js.map} +0 -0
- /package/dist/{chunk-OQ5PRDDS.js.map → chunk-NTOIP2E6.js.map} +0 -0
- /package/dist/{chunk-HLPD7B7P.js.map → chunk-NUEQKLNB.js.map} +0 -0
- /package/dist/{chunk-33PLLLL7.js.map → chunk-P7NGM24P.js.map} +0 -0
- /package/dist/{chunk-7TWUCYER.js.map → chunk-PNRA7FAD.js.map} +0 -0
- /package/dist/{chunk-5I4M26Q7.js.map → chunk-QBSFOKY6.js.map} +0 -0
- /package/dist/{chunk-P4DRWEYC.js.map → chunk-QVSBTCVP.js.map} +0 -0
- /package/dist/{chunk-AAIUERNB.js.map → chunk-R5RFK3CB.js.map} +0 -0
- /package/dist/{chunk-WDISJRMG.js.map → chunk-RMMVQQA6.js.map} +0 -0
- /package/dist/{chunk-5SM35XZR.js.map → chunk-S5NZBKKQ.js.map} +0 -0
- /package/dist/{chunk-WIPEXG6R.js.map → chunk-SXIMQLGV.js.map} +0 -0
- /package/dist/{chunk-OAEQLRCY.js.map → chunk-TN76AKO3.js.map} +0 -0
- /package/dist/{chunk-QN25OCUF.js.map → chunk-TQ4GD737.js.map} +0 -0
- /package/dist/{chunk-7K5Q6COX.js.map → chunk-TVVEYCNW.js.map} +0 -0
- /package/dist/{chunk-DNWXFTLD.js.map → chunk-TYISDI6B.js.map} +0 -0
- /package/dist/{chunk-4LMA77JH.js.map → chunk-U2VLVBBH.js.map} +0 -0
- /package/dist/{chunk-5ZE7QHTK.js.map → chunk-ULVR5KG7.js.map} +0 -0
- /package/dist/{chunk-4B77XSG5.js.map → chunk-UV72DEZD.js.map} +0 -0
- /package/dist/{chunk-S2BBISHU.js.map → chunk-VANZKHTN.js.map} +0 -0
- /package/dist/{chunk-3Y224NYC.js.map → chunk-VYISFWVX.js.map} +0 -0
- /package/dist/{chunk-TIHMZFIV.js.map → chunk-W3IC7QOY.js.map} +0 -0
- /package/dist/{chunk-NRV4Y3PM.js.map → chunk-W4FBGYGK.js.map} +0 -0
- /package/dist/{chunk-MU7ZHSZE.js.map → chunk-WZFAPHIK.js.map} +0 -0
- /package/dist/{chunk-T2TTP3KU.js.map → chunk-X4IDNPOS.js.map} +0 -0
- /package/dist/{chunk-BLAKS3CP.js.map → chunk-XL3TATMJ.js.map} +0 -0
- /package/dist/{chunk-W4XJFLAL.js.map → chunk-XPRJSHNI.js.map} +0 -0
- /package/dist/{chunk-JE7EK33X.js.map → chunk-Y7HRYCNW.js.map} +0 -0
- /package/dist/{chunk-E6EE5B67.js.map → chunk-YK6BDDHP.js.map} +0 -0
- /package/dist/{chunk-ES36HTSC.js.map → chunk-YLHM5BQQ.js.map} +0 -0
- /package/dist/{chunk-BJKPPZ6Z.js.map → chunk-ZFGZ6PZ2.js.map} +0 -0
- /package/dist/{chunk-64UDOIMI.js.map → chunk-ZLQ37WJX.js.map} +0 -0
|
@@ -1,8 +1,58 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
|
+
import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
2
5
|
import test from "node:test";
|
|
3
6
|
|
|
4
7
|
import { EngramAccessInputError, EngramAccessService } from "./access-service.js";
|
|
5
|
-
import { OFFLINE_SYNC_MAX_MTIME_MS } from "./offline-sync.js";
|
|
8
|
+
import { OFFLINE_SYNC_CHANGESET_FORMAT, OFFLINE_SYNC_MAX_MTIME_MS } from "./offline-sync.js";
|
|
9
|
+
import { isEncryptedFile } from "./secure-store/index.js";
|
|
10
|
+
import { ContentHashIndex } from "./storage/content-hash-index.js";
|
|
11
|
+
import { StorageManager } from "./storage.js";
|
|
12
|
+
import { withEntityCanonicalMutationLock } from "./storage/entity-canonical-id-lock.js";
|
|
13
|
+
|
|
14
|
+
class RawEntityMutationProbeStorage extends StorageManager {
|
|
15
|
+
readonly probeEntitiesDir: string;
|
|
16
|
+
writeEntered = false;
|
|
17
|
+
deleteEntered = false;
|
|
18
|
+
|
|
19
|
+
constructor(memoryDir: string) {
|
|
20
|
+
super(memoryDir);
|
|
21
|
+
this.probeEntitiesDir = path.join(memoryDir, "entities");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
override async readMemoryByPath(filePath: string) {
|
|
25
|
+
if (path.dirname(filePath) === this.probeEntitiesDir) return null;
|
|
26
|
+
return super.readMemoryByPath(filePath);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
protected override tombstoneBlockedCaptureIndexOptions() {
|
|
30
|
+
const options = super.tombstoneBlockedCaptureIndexOptions();
|
|
31
|
+
return {
|
|
32
|
+
...options,
|
|
33
|
+
parseMemory: (filePath: string, content: Buffer) =>
|
|
34
|
+
path.dirname(filePath) === this.probeEntitiesDir
|
|
35
|
+
? null
|
|
36
|
+
: options.parseMemory?.(filePath, content) ?? null,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
protected override async writeManagedStorageFile(
|
|
41
|
+
filePath: string,
|
|
42
|
+
write: () => Promise<void>,
|
|
43
|
+
): Promise<void> {
|
|
44
|
+
this.writeEntered = true;
|
|
45
|
+
await super.writeManagedStorageFile(filePath, write);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
protected override async deleteManagedStorageFile(
|
|
49
|
+
filePath: string,
|
|
50
|
+
deletionMtimeMs?: number | null,
|
|
51
|
+
): Promise<boolean> {
|
|
52
|
+
this.deleteEntered = true;
|
|
53
|
+
return super.deleteManagedStorageFile(filePath, deletionMtimeMs);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
6
56
|
|
|
7
57
|
function createOfflineService(): EngramAccessService {
|
|
8
58
|
return new EngramAccessService({
|
|
@@ -18,6 +68,241 @@ function createOfflineService(): EngramAccessService {
|
|
|
18
68
|
} as any);
|
|
19
69
|
}
|
|
20
70
|
|
|
71
|
+
function memoryFile(options: {
|
|
72
|
+
id: string;
|
|
73
|
+
body: string;
|
|
74
|
+
status?: string;
|
|
75
|
+
contentHash?: string;
|
|
76
|
+
}): string {
|
|
77
|
+
return [
|
|
78
|
+
"---",
|
|
79
|
+
`id: ${options.id}`,
|
|
80
|
+
"category: fact",
|
|
81
|
+
...(options.status ? [`status: ${options.status}`] : []),
|
|
82
|
+
...(options.contentHash ? [`contentHash: ${options.contentHash}`] : []),
|
|
83
|
+
"---",
|
|
84
|
+
options.body,
|
|
85
|
+
].join("\n");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function createManifestService(options: {
|
|
89
|
+
root: string;
|
|
90
|
+
storage: StorageManager;
|
|
91
|
+
namespacesEnabled?: boolean;
|
|
92
|
+
}): { service: EngramAccessService; getStorageCalls: string[] } {
|
|
93
|
+
const getStorageCalls: string[] = [];
|
|
94
|
+
const service = new EngramAccessService({
|
|
95
|
+
config: {
|
|
96
|
+
memoryDir: options.root,
|
|
97
|
+
namespacesEnabled: options.namespacesEnabled === true,
|
|
98
|
+
defaultNamespace: "global",
|
|
99
|
+
sharedNamespace: "shared",
|
|
100
|
+
namespacePolicies: options.namespacesEnabled
|
|
101
|
+
? [{ name: "team", readPrincipals: ["reader"], writePrincipals: [] }]
|
|
102
|
+
: [],
|
|
103
|
+
offlineSyncExcludes: [],
|
|
104
|
+
},
|
|
105
|
+
namespaceCatalog: {
|
|
106
|
+
async listNamespaces() {
|
|
107
|
+
return [];
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
async drainPendingRecallImpressions() {
|
|
111
|
+
return { folded: false, pendingDeferred: false };
|
|
112
|
+
},
|
|
113
|
+
async getStorage(namespace: string) {
|
|
114
|
+
getStorageCalls.push(namespace);
|
|
115
|
+
return options.storage;
|
|
116
|
+
},
|
|
117
|
+
} as unknown as ConstructorParameters<typeof EngramAccessService>[0]);
|
|
118
|
+
return { service, getStorageCalls };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
test("offline manifest streams body-free active, archived, old, bad, and encrypted memory rows lazily", async () => {
|
|
122
|
+
const root = await mkdtemp(path.join(os.tmpdir(), "remnic-access-manifest-"));
|
|
123
|
+
try {
|
|
124
|
+
const activeBody = "active body must never leave the service";
|
|
125
|
+
const archivedBody = "archived body must never leave the service";
|
|
126
|
+
const oldBody = "legacy body must never leave the service";
|
|
127
|
+
const encryptedBody = "encrypted body must never leave the service";
|
|
128
|
+
const activeContentHash = ContentHashIndex.computeHash(activeBody);
|
|
129
|
+
const files = new Map<string, string>([
|
|
130
|
+
[
|
|
131
|
+
"facts/active.md",
|
|
132
|
+
memoryFile({
|
|
133
|
+
id: "active-memory",
|
|
134
|
+
body: activeBody,
|
|
135
|
+
status: "active",
|
|
136
|
+
contentHash: activeContentHash,
|
|
137
|
+
}),
|
|
138
|
+
],
|
|
139
|
+
[
|
|
140
|
+
"archive/facts/archived.md",
|
|
141
|
+
memoryFile({ id: "archived-memory", body: archivedBody, status: "active" }),
|
|
142
|
+
],
|
|
143
|
+
["facts/old.md", memoryFile({ id: "old-memory", body: oldBody })],
|
|
144
|
+
["facts/bad.md", `not valid memory frontmatter\n${activeBody}`],
|
|
145
|
+
]);
|
|
146
|
+
for (const [relativePath, content] of files) {
|
|
147
|
+
const filePath = path.join(root, relativePath);
|
|
148
|
+
await mkdir(path.dirname(filePath), { recursive: true });
|
|
149
|
+
await writeFile(filePath, content);
|
|
150
|
+
}
|
|
151
|
+
const storage = new StorageManager(root);
|
|
152
|
+
await storage.ensureDirectories();
|
|
153
|
+
storage.setSecureStoreKey(Buffer.alloc(32, 11));
|
|
154
|
+
storage.setSecureStoreRequired(true);
|
|
155
|
+
const encryptedRelativePath = "facts/encrypted.md";
|
|
156
|
+
await storage.writeOfflineSyncFile(
|
|
157
|
+
path.join(root, encryptedRelativePath),
|
|
158
|
+
Buffer.from(memoryFile({ id: "encrypted-memory", body: encryptedBody, status: "active" })),
|
|
159
|
+
);
|
|
160
|
+
assert.equal(isEncryptedFile(await readFile(path.join(root, encryptedRelativePath))), true);
|
|
161
|
+
|
|
162
|
+
let digestReads = 0;
|
|
163
|
+
let bodyReads = 0;
|
|
164
|
+
const digestOfflineSyncFile = storage.digestOfflineSyncFile.bind(storage);
|
|
165
|
+
const readOfflineSyncFile = storage.readOfflineSyncFile.bind(storage);
|
|
166
|
+
storage.digestOfflineSyncFile = async (filePath: string) => {
|
|
167
|
+
digestReads += 1;
|
|
168
|
+
return digestOfflineSyncFile(filePath);
|
|
169
|
+
};
|
|
170
|
+
storage.readOfflineSyncFile = async (filePath: string) => {
|
|
171
|
+
bodyReads += 1;
|
|
172
|
+
return readOfflineSyncFile(filePath);
|
|
173
|
+
};
|
|
174
|
+
const { service } = createManifestService({ root, storage });
|
|
175
|
+
|
|
176
|
+
const manifest = await service.offlineSyncManifestStream();
|
|
177
|
+
assert.equal(manifest.format, "remnic-reconcile-manifest");
|
|
178
|
+
assert.equal(manifest.schemaVersion, 1);
|
|
179
|
+
assert.equal(Array.isArray(manifest.files), false);
|
|
180
|
+
assert.equal(digestReads, 0);
|
|
181
|
+
assert.equal(bodyReads, 0);
|
|
182
|
+
|
|
183
|
+
const iterator = manifest.files[Symbol.asyncIterator]();
|
|
184
|
+
const first = await iterator.next();
|
|
185
|
+
assert.equal(first.done, false);
|
|
186
|
+
assert.equal(first.value?.path, "archive/facts/archived.md");
|
|
187
|
+
assert.equal(digestReads, 1);
|
|
188
|
+
assert.equal(bodyReads, 1);
|
|
189
|
+
|
|
190
|
+
const rows = first.value ? [first.value] : [];
|
|
191
|
+
for await (const row of { [Symbol.asyncIterator]: () => iterator }) rows.push(row);
|
|
192
|
+
const rowsByPath = new Map(rows.map((row) => [row.path, row]));
|
|
193
|
+
assert.deepEqual(rowsByPath.get("facts/active.md")?.memory, {
|
|
194
|
+
id: "active-memory",
|
|
195
|
+
category: "fact",
|
|
196
|
+
contentHash: activeContentHash,
|
|
197
|
+
status: "active",
|
|
198
|
+
});
|
|
199
|
+
assert.notEqual(rowsByPath.get("facts/active.md")?.sha256, activeContentHash);
|
|
200
|
+
assert.equal(rowsByPath.get("archive/facts/archived.md")?.memory?.status, "archived");
|
|
201
|
+
assert.equal(
|
|
202
|
+
rowsByPath.get("facts/old.md")?.memory?.contentHash,
|
|
203
|
+
ContentHashIndex.computeHash(oldBody),
|
|
204
|
+
);
|
|
205
|
+
assert.equal(rowsByPath.get("facts/old.md")?.memory?.status, "active");
|
|
206
|
+
assert.equal(rowsByPath.get("facts/bad.md")?.memory, undefined);
|
|
207
|
+
assert.equal(rowsByPath.get(encryptedRelativePath)?.memory?.id, "encrypted-memory");
|
|
208
|
+
for (const row of rows) {
|
|
209
|
+
assert.equal("content" in row, false);
|
|
210
|
+
assert.equal("contentBase64" in row, false);
|
|
211
|
+
assert.doesNotMatch(JSON.stringify(row), /body must never leave the service/);
|
|
212
|
+
assert.equal(typeof row.sha256, "string");
|
|
213
|
+
assert.equal(typeof row.bytes, "number");
|
|
214
|
+
assert.equal(typeof row.mtimeMs, "number");
|
|
215
|
+
}
|
|
216
|
+
} finally {
|
|
217
|
+
await rm(root, { recursive: true, force: true });
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
test("offline manifest uses snapshot namespace authorization and storage routing", async () => {
|
|
222
|
+
const root = await mkdtemp(path.join(os.tmpdir(), "remnic-access-manifest-namespace-"));
|
|
223
|
+
try {
|
|
224
|
+
const storage = new StorageManager(path.join(root, "namespaces", "team"));
|
|
225
|
+
await storage.ensureDirectories();
|
|
226
|
+
const { service, getStorageCalls } = createManifestService({
|
|
227
|
+
root,
|
|
228
|
+
storage,
|
|
229
|
+
namespacesEnabled: true,
|
|
230
|
+
});
|
|
231
|
+
await assert.rejects(
|
|
232
|
+
() => service.offlineSyncManifestStream({ namespace: "team", principal: "outsider" }),
|
|
233
|
+
/namespace is not readable: team/,
|
|
234
|
+
);
|
|
235
|
+
const manifest = await service.offlineSyncManifestStream({
|
|
236
|
+
namespace: "team",
|
|
237
|
+
principal: "reader",
|
|
238
|
+
includeTranscripts: false,
|
|
239
|
+
});
|
|
240
|
+
assert.equal(manifest.namespace, "team");
|
|
241
|
+
assert.deepEqual(getStorageCalls, ["team"]);
|
|
242
|
+
} finally {
|
|
243
|
+
await rm(root, { recursive: true, force: true });
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
test("offline file-transfer endpoints reject internal Remnic state paths", async () => {
|
|
248
|
+
const root = await mkdtemp(path.join(os.tmpdir(), "remnic-access-internal-state-"));
|
|
249
|
+
try {
|
|
250
|
+
const storage = new StorageManager(root);
|
|
251
|
+
await storage.ensureDirectories();
|
|
252
|
+
const { service } = createManifestService({ root, storage });
|
|
253
|
+
const internalPath = ".remnic/state/converge-cursors/peer.json";
|
|
254
|
+
const internalFilePath = path.join(root, internalPath);
|
|
255
|
+
await mkdir(path.dirname(internalFilePath), { recursive: true });
|
|
256
|
+
await writeFile(internalFilePath, "cursor");
|
|
257
|
+
|
|
258
|
+
await assert.rejects(
|
|
259
|
+
() => service.offlineSyncFiles({ paths: [internalPath] }),
|
|
260
|
+
(error) =>
|
|
261
|
+
error instanceof EngramAccessInputError
|
|
262
|
+
&& /offline sync snapshot path is excluded/.test(error.message),
|
|
263
|
+
);
|
|
264
|
+
await assert.rejects(
|
|
265
|
+
() => service.offlineSyncFileContent({ path: internalPath, offset: 0, length: 1 }),
|
|
266
|
+
(error) =>
|
|
267
|
+
error instanceof EngramAccessInputError
|
|
268
|
+
&& /offline sync file content path is excluded/.test(error.message),
|
|
269
|
+
);
|
|
270
|
+
await assert.rejects(
|
|
271
|
+
() => service.offlineSyncApplyFileContent({
|
|
272
|
+
sourceId: "peer",
|
|
273
|
+
path: internalPath,
|
|
274
|
+
sha256: "a".repeat(64),
|
|
275
|
+
bytes: 0,
|
|
276
|
+
mtimeMs: 0,
|
|
277
|
+
offset: 0,
|
|
278
|
+
content: Buffer.alloc(0),
|
|
279
|
+
}),
|
|
280
|
+
(error) =>
|
|
281
|
+
error instanceof EngramAccessInputError
|
|
282
|
+
&& /offline sync file content path is excluded/.test(error.message),
|
|
283
|
+
);
|
|
284
|
+
const applyResult = await service.offlineSyncApply({
|
|
285
|
+
changeset: {
|
|
286
|
+
format: OFFLINE_SYNC_CHANGESET_FORMAT,
|
|
287
|
+
schemaVersion: 1,
|
|
288
|
+
createdAt: new Date().toISOString(),
|
|
289
|
+
sourceId: "peer",
|
|
290
|
+
includeTranscripts: true,
|
|
291
|
+
changes: [{
|
|
292
|
+
type: "delete",
|
|
293
|
+
path: internalPath,
|
|
294
|
+
baseSha256: "b".repeat(64),
|
|
295
|
+
}],
|
|
296
|
+
},
|
|
297
|
+
});
|
|
298
|
+
assert.equal(applyResult.appliedDeletes, 0);
|
|
299
|
+
assert.equal(await readFile(internalFilePath, "utf8"), "cursor");
|
|
300
|
+
|
|
301
|
+
} finally {
|
|
302
|
+
await rm(root, { recursive: true, force: true });
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
|
|
21
306
|
test("offline apply-file-content reports invalid metadata as input errors", async () => {
|
|
22
307
|
const service = createOfflineService();
|
|
23
308
|
await assert.rejects(
|
|
@@ -92,3 +377,62 @@ test("offline convergence completion refreshes authorized namespaces as one batc
|
|
|
92
377
|
assert.deepEqual(result, { namespaces: ["global"], refreshed: true });
|
|
93
378
|
assert.deepEqual(refreshed, [["global"]]);
|
|
94
379
|
});
|
|
380
|
+
|
|
381
|
+
test("offline raw entity writes wait for the canonical mutation lock", async () => {
|
|
382
|
+
const root = await mkdtemp(path.join(os.tmpdir(), "remnic-offline-entity-write-lock-"));
|
|
383
|
+
let writePromise: Promise<void> | undefined;
|
|
384
|
+
try {
|
|
385
|
+
await new StorageManager(root).ensureDirectories();
|
|
386
|
+
const storage = new RawEntityMutationProbeStorage(root);
|
|
387
|
+
const target = path.join(root, "entities", "project-replicated.md");
|
|
388
|
+
const content = Buffer.from(
|
|
389
|
+
"---\nid: project-replicated\n---\n\n# Replicated\n\n**Type:** project\n\nReplicated bytes.\n",
|
|
390
|
+
"utf8",
|
|
391
|
+
);
|
|
392
|
+
|
|
393
|
+
await withEntityCanonicalMutationLock(path.join(root, "state"), async () => {
|
|
394
|
+
writePromise = storage.writeOfflineSyncFile(target, content);
|
|
395
|
+
await new Promise<void>((resolve) => setImmediate(resolve));
|
|
396
|
+
assert.equal(
|
|
397
|
+
storage.writeEntered,
|
|
398
|
+
false,
|
|
399
|
+
"the raw entity write must not enter its managed-file mutation while the canonical lock is held",
|
|
400
|
+
);
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
assert.ok(writePromise);
|
|
404
|
+
await writePromise;
|
|
405
|
+
assert.deepEqual(await readFile(target), content);
|
|
406
|
+
} finally {
|
|
407
|
+
await writePromise?.catch(() => undefined);
|
|
408
|
+
await rm(root, { recursive: true, force: true });
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
test("offline raw entity deletes wait for the canonical mutation lock", async () => {
|
|
413
|
+
const root = await mkdtemp(path.join(os.tmpdir(), "remnic-offline-entity-delete-lock-"));
|
|
414
|
+
let deletePromise: Promise<void> | undefined;
|
|
415
|
+
try {
|
|
416
|
+
await new StorageManager(root).ensureDirectories();
|
|
417
|
+
const target = path.join(root, "entities", "project-replicated.md");
|
|
418
|
+
await writeFile(target, "# Replicated\n", "utf8");
|
|
419
|
+
const storage = new RawEntityMutationProbeStorage(root);
|
|
420
|
+
|
|
421
|
+
await withEntityCanonicalMutationLock(path.join(root, "state"), async () => {
|
|
422
|
+
deletePromise = storage.deleteOfflineSyncFile(target, null);
|
|
423
|
+
await new Promise<void>((resolve) => setImmediate(resolve));
|
|
424
|
+
assert.equal(
|
|
425
|
+
storage.deleteEntered,
|
|
426
|
+
false,
|
|
427
|
+
"the raw entity delete must not enter its managed-file mutation while the canonical lock is held",
|
|
428
|
+
);
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
assert.ok(deletePromise);
|
|
432
|
+
await deletePromise;
|
|
433
|
+
await assert.rejects(() => readFile(target));
|
|
434
|
+
} finally {
|
|
435
|
+
await deletePromise?.catch(() => undefined);
|
|
436
|
+
await rm(root, { recursive: true, force: true });
|
|
437
|
+
}
|
|
438
|
+
});
|
package/src/access-service.ts
CHANGED
|
@@ -39,6 +39,10 @@ import {
|
|
|
39
39
|
resolveCodingNamespaceOverlay,
|
|
40
40
|
type CodingNamespaceOverlay,
|
|
41
41
|
} from "./coding/coding-namespace.js";
|
|
42
|
+
import {
|
|
43
|
+
resolveCodingContextFromOptions,
|
|
44
|
+
type InterruptibleCodingScopeInput,
|
|
45
|
+
} from "./access-coding-context-resolution.js";
|
|
42
46
|
import {
|
|
43
47
|
handleCodingDecision,
|
|
44
48
|
type DecisionSurfaceRequest,
|
|
@@ -72,7 +76,7 @@ import {
|
|
|
72
76
|
type DeltaSurfaceResponse,
|
|
73
77
|
type DeltaSurfaceStorage,
|
|
74
78
|
} from "./coding/session-delta-surfaces.js";
|
|
75
|
-
import {
|
|
79
|
+
import { defaultGitInvokerSync } from "./coding/git-context.js";
|
|
76
80
|
import {
|
|
77
81
|
createCorrectionService,
|
|
78
82
|
isCorrectionFeatureEnabled,
|
|
@@ -180,7 +184,7 @@ import type {
|
|
|
180
184
|
Orchestrator,
|
|
181
185
|
RecallInvocationOptions,
|
|
182
186
|
} from "./orchestrator.js";
|
|
183
|
-
import { parseEntityFile, StorageManager } from "./storage.js";
|
|
187
|
+
import { parseEntityFile, parseFrontmatter, StorageManager } from "./storage.js";
|
|
184
188
|
import {
|
|
185
189
|
buildGraphSnapshot,
|
|
186
190
|
type GraphSnapshotRequest,
|
|
@@ -283,6 +287,7 @@ import {
|
|
|
283
287
|
buildOfflineSyncSnapshotFromBase,
|
|
284
288
|
buildOfflineSyncSnapshotForPaths,
|
|
285
289
|
iterateOfflineSyncSnapshotFileRecords,
|
|
290
|
+
filterOfflineSyncDeletionRevisions,
|
|
286
291
|
OFFLINE_SYNC_SNAPSHOT_FORMAT,
|
|
287
292
|
readOfflineSyncFileContentChunk,
|
|
288
293
|
type OfflineSyncApplyFileContentChunkResult,
|
|
@@ -293,6 +298,10 @@ import {
|
|
|
293
298
|
type OfflineSyncSnapshot,
|
|
294
299
|
} from "./offline-sync.js";
|
|
295
300
|
import { offlineSyncStorageForSnapshot } from "./offline-sync-impression-drain.js";
|
|
301
|
+
import {
|
|
302
|
+
createOfflineSyncManifestStream,
|
|
303
|
+
type OfflineSyncManifestStreamResponse,
|
|
304
|
+
} from "./access-offline-manifest.js";
|
|
296
305
|
import {
|
|
297
306
|
evaluateActionConfidence,
|
|
298
307
|
type ActionConfidenceInput,
|
|
@@ -372,6 +381,8 @@ export interface EngramAccessRecallRequest {
|
|
|
372
381
|
sessionKey?: string;
|
|
373
382
|
namespace?: string;
|
|
374
383
|
authenticatedPrincipal?: string;
|
|
384
|
+
/** Trusted connector identity resolved at the transport boundary. */
|
|
385
|
+
sourceConnector?: string;
|
|
375
386
|
idempotencyKey?: string;
|
|
376
387
|
topK?: number;
|
|
377
388
|
mode?: RecallPlanMode | "auto";
|
|
@@ -781,6 +792,12 @@ export interface EngramAccessOfflineSyncSnapshotRequest {
|
|
|
781
792
|
baseFiles?: OfflineSyncFileState[];
|
|
782
793
|
}
|
|
783
794
|
|
|
795
|
+
export interface EngramAccessOfflineSyncManifestRequest {
|
|
796
|
+
namespace?: string;
|
|
797
|
+
principal?: string;
|
|
798
|
+
includeTranscripts?: boolean;
|
|
799
|
+
}
|
|
800
|
+
|
|
784
801
|
export interface EngramAccessOfflineSyncFilesRequest {
|
|
785
802
|
namespace?: string;
|
|
786
803
|
principal?: string;
|
|
@@ -924,6 +941,7 @@ export interface CodingScopedWriteInput {
|
|
|
924
941
|
cwd?: string;
|
|
925
942
|
projectTag?: string;
|
|
926
943
|
}
|
|
944
|
+
|
|
927
945
|
export type { EngramAccessNamespaceWritableRequest } from "./access-namespace-preflight.js";
|
|
928
946
|
/**
|
|
929
947
|
* Internal, single-resolution plan describing the effective memory scope for a
|
|
@@ -1463,38 +1481,6 @@ export class EngramAccessService {
|
|
|
1463
1481
|
return result.namespace;
|
|
1464
1482
|
}
|
|
1465
1483
|
|
|
1466
|
-
/**
|
|
1467
|
-
* Resolve a coding context from `cwd`/`projectTag` WITHOUT persisting it to
|
|
1468
|
-
* any session — the read-only half of `maybeAttachCodingContext`. Returns
|
|
1469
|
-
* null when project scoping is off or nothing resolves. `projectTag` takes
|
|
1470
|
-
* priority over `cwd` (matching `maybeAttachCodingContext`).
|
|
1471
|
-
*/
|
|
1472
|
-
private async resolveCodingContextFromOptions(
|
|
1473
|
-
options: CodingScopedWriteInput,
|
|
1474
|
-
): Promise<CodingContext | null> {
|
|
1475
|
-
if (!this.orchestrator.config.codingMode?.projectScope) return null;
|
|
1476
|
-
if (typeof options.projectTag === "string" && options.projectTag.trim().length > 0) {
|
|
1477
|
-
const projectId = projectTagProjectId(options.projectTag);
|
|
1478
|
-
return { projectId, branch: null, rootPath: projectId, defaultBranch: null };
|
|
1479
|
-
}
|
|
1480
|
-
if (typeof options.cwd === "string" && options.cwd.trim().length > 0) {
|
|
1481
|
-
try {
|
|
1482
|
-
const gitCtx = await resolveGitContext(options.cwd);
|
|
1483
|
-
if (gitCtx) {
|
|
1484
|
-
return {
|
|
1485
|
-
projectId: gitCtx.projectId,
|
|
1486
|
-
branch: gitCtx.branch,
|
|
1487
|
-
rootPath: gitCtx.rootPath,
|
|
1488
|
-
defaultBranch: gitCtx.defaultBranch,
|
|
1489
|
-
};
|
|
1490
|
-
}
|
|
1491
|
-
} catch {
|
|
1492
|
-
// resolveGitContext never throws, but stay defensive — not being in a
|
|
1493
|
-
// repo is normal and must not break the write.
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
return null;
|
|
1497
|
-
}
|
|
1498
1484
|
|
|
1499
1485
|
/** Shared coding-scope derivation for the read/write resolvers below —
|
|
1500
1486
|
* coding context, overlay, principal, scope-profile plan for an IMPLICIT
|
|
@@ -1503,7 +1489,7 @@ export class EngramAccessService {
|
|
|
1503
1489
|
* of truth for the namespacesEnabled/projectScope gates (rule 22; keeps the
|
|
1504
1490
|
* scattered-config-read ratchet flat). READ-ONLY: never mutates session. */
|
|
1505
1491
|
private async resolveCodingScopeInputs(
|
|
1506
|
-
request:
|
|
1492
|
+
request: InterruptibleCodingScopeInput & {
|
|
1507
1493
|
namespace?: string;
|
|
1508
1494
|
sessionKey?: string;
|
|
1509
1495
|
authenticatedPrincipal?: string;
|
|
@@ -1526,7 +1512,7 @@ export class EngramAccessService {
|
|
|
1526
1512
|
resolveNamespaceCapabilities(this.orchestrator.config).namespaces &&
|
|
1527
1513
|
this.orchestrator.config.codingMode?.projectScope
|
|
1528
1514
|
? this.orchestrator.getCodingContextForSession(request.sessionKey) ??
|
|
1529
|
-
(await
|
|
1515
|
+
(await resolveCodingContextFromOptions(request))
|
|
1530
1516
|
: null;
|
|
1531
1517
|
const overlay =
|
|
1532
1518
|
hasSession &&
|
|
@@ -1702,7 +1688,7 @@ export class EngramAccessService {
|
|
|
1702
1688
|
* precedence), falling back to the per-call `cwd`/`projectTag`.
|
|
1703
1689
|
*/
|
|
1704
1690
|
private async resolveMemoryScopePlan(
|
|
1705
|
-
request:
|
|
1691
|
+
request: InterruptibleCodingScopeInput & {
|
|
1706
1692
|
namespace?: string;
|
|
1707
1693
|
sessionKey?: string;
|
|
1708
1694
|
authenticatedPrincipal?: string;
|
|
@@ -2393,6 +2379,16 @@ export class EngramAccessService {
|
|
|
2393
2379
|
extractionWatermark,
|
|
2394
2380
|
caps?.namespaces !== undefined ? undefined : this.extractionLivenessWarn,
|
|
2395
2381
|
);
|
|
2382
|
+
let scopedDegradedReason: string | null = null;
|
|
2383
|
+
if (extraction.degraded) {
|
|
2384
|
+
if (extraction.degradedReason?.includes("watermark unreadable")) {
|
|
2385
|
+
scopedDegradedReason = "daemon extraction pipeline degraded; extraction watermark unreadable";
|
|
2386
|
+
} else if (extraction.degradedReason?.includes("buffer unreadable")) {
|
|
2387
|
+
scopedDegradedReason = "daemon extraction pipeline degraded; extraction buffer unreadable";
|
|
2388
|
+
} else {
|
|
2389
|
+
scopedDegradedReason = "daemon extraction pipeline degraded; backlog pending extraction";
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2396
2392
|
const visibleExtraction =
|
|
2397
2393
|
caps?.namespaces !== undefined
|
|
2398
2394
|
? {
|
|
@@ -2401,7 +2397,7 @@ export class EngramAccessService {
|
|
|
2401
2397
|
bufferedSessionCount: 0,
|
|
2402
2398
|
pendingTurnCount: 0,
|
|
2403
2399
|
oldestBufferedTurnAgeMs: null,
|
|
2404
|
-
degradedReason:
|
|
2400
|
+
degradedReason: scopedDegradedReason,
|
|
2405
2401
|
}
|
|
2406
2402
|
: extraction;
|
|
2407
2403
|
// ONE call: the corpus array and the flag describing it must not come from
|
|
@@ -2844,6 +2840,7 @@ export class EngramAccessService {
|
|
|
2844
2840
|
namespace?: string;
|
|
2845
2841
|
budget?: number;
|
|
2846
2842
|
authenticatedPrincipal?: string;
|
|
2843
|
+
sourceConnector?: string;
|
|
2847
2844
|
/**
|
|
2848
2845
|
* Disclosure depth used to shape per-result payload (issue #677
|
|
2849
2846
|
* PR 3/4). When set, each X-ray result is decorated with the
|
|
@@ -3229,12 +3226,9 @@ export class EngramAccessService {
|
|
|
3229
3226
|
} satisfies DeltaSurfaceStorage;
|
|
3230
3227
|
},
|
|
3231
3228
|
gitInvoker: (cwd, args) => {
|
|
3232
|
-
//
|
|
3233
|
-
//
|
|
3234
|
-
|
|
3235
|
-
// exits without a try/catch.
|
|
3236
|
-
const invoker = defaultGitInvoker();
|
|
3237
|
-
return invoker(cwd, args);
|
|
3229
|
+
// Session-delta remains a synchronous pure calculation; use the
|
|
3230
|
+
// bounded synchronous invoker rather than the abortable scope resolver.
|
|
3231
|
+
return defaultGitInvokerSync()(cwd, args);
|
|
3238
3232
|
},
|
|
3239
3233
|
throwInputError: (msg) => { throw new EngramAccessInputError(msg); },
|
|
3240
3234
|
});
|
|
@@ -3318,23 +3312,28 @@ export class EngramAccessService {
|
|
|
3318
3312
|
}
|
|
3319
3313
|
}
|
|
3320
3314
|
|
|
3321
|
-
async correctionPlan(
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
// misses or collides is an explicit input error, never silent (rule 34/51).
|
|
3315
|
+
async correctionPlan(
|
|
3316
|
+
request: CorrectionRequest,
|
|
3317
|
+
opts?: { abortSignal?: AbortSignal },
|
|
3318
|
+
): Promise<CorrectionPlan> {
|
|
3326
3319
|
if (request.targetIds?.some((id) => isHandleToken(id))) {
|
|
3327
3320
|
const targetIds = request.targetIds.map((id) =>
|
|
3328
3321
|
this.resolveMemoryIdOrHandleInput(id, request.sessionKey),
|
|
3329
3322
|
);
|
|
3330
|
-
return this.correctionService().plan({ ...request, targetIds });
|
|
3323
|
+
return this.correctionService().plan({ ...request, targetIds }, opts);
|
|
3331
3324
|
}
|
|
3332
|
-
return this.correctionService().plan(request);
|
|
3325
|
+
return this.correctionService().plan(request, opts);
|
|
3333
3326
|
}
|
|
3334
3327
|
|
|
3335
3328
|
async correctionApply(
|
|
3336
3329
|
planId: string,
|
|
3337
|
-
opts: {
|
|
3330
|
+
opts: {
|
|
3331
|
+
confirm?: boolean;
|
|
3332
|
+
namespace?: string;
|
|
3333
|
+
sessionKey?: string;
|
|
3334
|
+
principal?: string;
|
|
3335
|
+
abortSignal?: AbortSignal;
|
|
3336
|
+
},
|
|
3338
3337
|
): Promise<CorrectionOutcome> {
|
|
3339
3338
|
return this.correctionService().apply(planId, opts);
|
|
3340
3339
|
}
|
|
@@ -4019,12 +4018,9 @@ export class EngramAccessService {
|
|
|
4019
4018
|
// Explicit namespace pins the scope (resolveMemoryScopePlan returns early),
|
|
4020
4019
|
// so the coding context is irrelevant — skip it to avoid false conflicts
|
|
4021
4020
|
// when the session context changes under a namespace-pinned observe.
|
|
4022
|
-
//
|
|
4023
|
-
//
|
|
4024
|
-
effectiveCodingContext =
|
|
4025
|
-
(typeof this.orchestrator.getCodingContextForSession === "function"
|
|
4026
|
-
? this.orchestrator.getCodingContextForSession(request.sessionKey)
|
|
4027
|
-
: null) ?? (await this.resolveCodingContextFromOptions(request));
|
|
4021
|
+
// Reuse the write resolver's namespace/projectScope gates so context
|
|
4022
|
+
// ignored by runObserve cannot change the retry fingerprint.
|
|
4023
|
+
effectiveCodingContext = (await this.resolveCodingScopeInputs(request)).codingContext;
|
|
4028
4024
|
}
|
|
4029
4025
|
return this.handleIdempotentWrite<EngramAccessObserveResponse>({
|
|
4030
4026
|
operation: "observe",
|
|
@@ -4330,6 +4326,10 @@ export class EngramAccessService {
|
|
|
4330
4326
|
async extractionForceFlush(request: EngramAccessExtractionForceFlushRequest): Promise<EngramAccessExtractionForceFlushResponse> {
|
|
4331
4327
|
return delegateExtractionForceFlush(this.accessObserveWriteSurface, request);
|
|
4332
4328
|
}
|
|
4329
|
+
cancelPendingObservePreparations(sessionKey: string, scopeHint?: string): void {
|
|
4330
|
+
this.accessObserveWriteSurface.cancelPendingObservePreparations(sessionKey, scopeHint);
|
|
4331
|
+
}
|
|
4332
|
+
|
|
4333
4333
|
cancelPendingObserveExtractions(
|
|
4334
4334
|
sessionKey: string,
|
|
4335
4335
|
principal?: string,
|
|
@@ -5469,6 +5469,8 @@ export class EngramAccessService {
|
|
|
5469
5469
|
const resolvedNamespace = this.resolveReadableNamespace(options.namespace, options.principal);
|
|
5470
5470
|
const storage = await offlineSyncStorageForSnapshot(this.orchestrator, resolvedNamespace);
|
|
5471
5471
|
const storageHash = createHash("sha256").update(storage.dir).digest("hex").slice(0, 16);
|
|
5472
|
+
const deletions = [...await storage.readDeletionRevisions()]
|
|
5473
|
+
.map(([path, mtimeMs]) => ({ path, mtimeMs }));
|
|
5472
5474
|
const snapshotBuilder = options.includeContent === false && options.baseFiles && options.baseFiles.length > 0
|
|
5473
5475
|
? buildOfflineSyncSnapshotFromBase
|
|
5474
5476
|
: buildOfflineSyncSnapshot;
|
|
@@ -5482,6 +5484,7 @@ export class EngramAccessService {
|
|
|
5482
5484
|
readFileDigest: async ({ filePath }) => storage.digestOfflineSyncFile(filePath),
|
|
5483
5485
|
signal: options.signal,
|
|
5484
5486
|
userExcludeRegexps: this.offlineSyncUserExcludes,
|
|
5487
|
+
deletions,
|
|
5485
5488
|
});
|
|
5486
5489
|
return {
|
|
5487
5490
|
namespace: resolvedNamespace,
|
|
@@ -5495,6 +5498,13 @@ export class EngramAccessService {
|
|
|
5495
5498
|
const resolvedNamespace = this.resolveReadableNamespace(options.namespace, options.principal);
|
|
5496
5499
|
const storage = await offlineSyncStorageForSnapshot(this.orchestrator, resolvedNamespace);
|
|
5497
5500
|
const storageHash = createHash("sha256").update(storage.dir).digest("hex").slice(0, 16);
|
|
5501
|
+
const deletions = await filterOfflineSyncDeletionRevisions({
|
|
5502
|
+
root: storage.dir,
|
|
5503
|
+
deletions: [...await storage.readDeletionRevisions()]
|
|
5504
|
+
.map(([path, mtimeMs]) => ({ path, mtimeMs })),
|
|
5505
|
+
includeTranscripts: options.includeTranscripts !== false,
|
|
5506
|
+
userExcludeRegexps: this.offlineSyncUserExcludes,
|
|
5507
|
+
});
|
|
5498
5508
|
return {
|
|
5499
5509
|
namespace: resolvedNamespace,
|
|
5500
5510
|
format: OFFLINE_SYNC_SNAPSHOT_FORMAT,
|
|
@@ -5502,6 +5512,7 @@ export class EngramAccessService {
|
|
|
5502
5512
|
createdAt: new Date().toISOString(),
|
|
5503
5513
|
sourceId: `remnic:${resolvedNamespace}:${storageHash}`,
|
|
5504
5514
|
includeTranscripts: options.includeTranscripts !== false,
|
|
5515
|
+
deletions,
|
|
5505
5516
|
files: iterateOfflineSyncSnapshotFileRecords({
|
|
5506
5517
|
root: storage.dir,
|
|
5507
5518
|
includeContent: options.includeContent === true,
|
|
@@ -5513,6 +5524,19 @@ export class EngramAccessService {
|
|
|
5513
5524
|
}),
|
|
5514
5525
|
};
|
|
5515
5526
|
}
|
|
5527
|
+
async offlineSyncManifestStream(
|
|
5528
|
+
options: EngramAccessOfflineSyncManifestRequest & { signal?: AbortSignal } = {},
|
|
5529
|
+
): Promise<OfflineSyncManifestStreamResponse> {
|
|
5530
|
+
const namespace = this.resolveReadableNamespace(options.namespace, options.principal);
|
|
5531
|
+
return createOfflineSyncManifestStream(
|
|
5532
|
+
this.orchestrator,
|
|
5533
|
+
namespace,
|
|
5534
|
+
this.offlineSyncUserExcludes,
|
|
5535
|
+
options,
|
|
5536
|
+
parseFrontmatter,
|
|
5537
|
+
);
|
|
5538
|
+
}
|
|
5539
|
+
|
|
5516
5540
|
|
|
5517
5541
|
async offlineSyncFiles(
|
|
5518
5542
|
options: EngramAccessOfflineSyncFilesRequest,
|
|
@@ -5672,7 +5696,10 @@ export class EngramAccessService {
|
|
|
5672
5696
|
readFile: async ({ filePath }) => storage.readOfflineSyncFile(filePath),
|
|
5673
5697
|
readFileDigest: async ({ filePath }) => storage.digestOfflineSyncFile(filePath),
|
|
5674
5698
|
writeFile: async ({ filePath, content }) => storage.writeOfflineSyncFile(filePath, content),
|
|
5675
|
-
deleteFile: async ({ filePath }) =>
|
|
5699
|
+
deleteFile: async ({ filePath, mtimeMs }) =>
|
|
5700
|
+
storage.deleteOfflineSyncFile(filePath, mtimeMs ?? null),
|
|
5701
|
+
recordDeletionRevision: async ({ filePath, mtimeMs }) =>
|
|
5702
|
+
storage.recordReplicatedDeletionRevision(filePath, mtimeMs),
|
|
5676
5703
|
});
|
|
5677
5704
|
return {
|
|
5678
5705
|
namespace: resolvedNamespace,
|