@remnic/core 9.45.3 → 9.45.5
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 -75
- package/dist/access-audit.js +2 -2
- package/dist/access-authorization-probe.d.ts +14 -10
- package/dist/access-authorization-probe.js +85 -76
- package/dist/access-boundary.d.ts +15 -11
- package/dist/access-boundary.js +84 -75
- package/dist/access-citation-namespace.js +2 -2
- package/dist/access-cli.js +191 -177
- 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 -75
- 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 -75
- package/dist/access-http.d.ts +15 -11
- package/dist/access-http.js +104 -90
- package/dist/access-identity-continuity-surface.d.ts +9 -8
- package/dist/access-identity-continuity-surface.js +84 -75
- package/dist/access-lcm-surface.d.ts +14 -10
- package/dist/access-lcm-surface.js +84 -75
- package/dist/access-mcp-output-schemas.js +1 -1
- package/dist/access-mcp.d.ts +14 -10
- package/dist/access-mcp.js +95 -82
- 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 -75
- 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 -75
- 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 -77
- package/dist/access-operations.d.ts +18 -14
- package/dist/access-operations.js +91 -79
- package/dist/access-recall-concurrency.d.ts +16 -26
- package/dist/access-recall-concurrency.js +86 -76
- package/dist/access-recall-response.d.ts +18 -14
- package/dist/access-recall-response.js +84 -75
- package/dist/access-recall-surface.d.ts +29 -24
- package/dist/access-recall-surface.js +84 -75
- package/dist/access-schema.d.ts +84 -84
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-CiJRsgAB.d.ts → access-service-CNN89xyn.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 -75
- 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 +4 -4
- package/dist/adapters/registry.js +2 -2
- 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 +24 -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 +28 -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-E5UK4VPE.js → chunk-2FSTB6BJ.js} +5 -5
- package/dist/{chunk-5ZE7QHTK.js → chunk-2X2T2UVE.js} +5 -5
- package/dist/{chunk-P4DRWEYC.js → chunk-3COYXTGM.js} +2 -2
- package/dist/{chunk-5IVLTFOV.js → chunk-44N6ESJ4.js} +2 -2
- package/dist/{chunk-DL7ZD3JH.js → chunk-4FBVAGV3.js} +14 -9
- package/dist/chunk-4FBVAGV3.js.map +1 -0
- 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-AAIUERNB.js → chunk-5QJQHBLE.js} +6 -6
- package/dist/{chunk-6CZPDBJS.js → chunk-5U7ID3EZ.js} +3 -3
- package/dist/{chunk-RN7DY3FC.js → chunk-6ISC4AVB.js} +31 -12
- package/dist/chunk-6ISC4AVB.js.map +1 -0
- package/dist/chunk-773TRRGT.js +36 -0
- package/dist/chunk-773TRRGT.js.map +1 -0
- package/dist/chunk-7T4TOGMS.js +242 -0
- package/dist/chunk-7T4TOGMS.js.map +1 -0
- package/dist/{chunk-DLVPUX7U.js → chunk-7YKVM5H3.js} +8 -6
- package/dist/chunk-7YKVM5H3.js.map +1 -0
- package/dist/chunk-7YQ6ESEA.js +322 -0
- package/dist/chunk-7YQ6ESEA.js.map +1 -0
- package/dist/{chunk-DNWXFTLD.js → chunk-A4IJCD2Z.js} +2 -2
- 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-PKNLM44P.js → chunk-AC5OWJLV.js} +9 -9
- package/dist/{chunk-LZ4LDKHZ.js → chunk-AMAUBUKY.js} +6 -6
- package/dist/{chunk-CUM2BBPN.js → chunk-AUMWZSE7.js} +19 -10
- package/dist/chunk-AUMWZSE7.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-CK5KOVHW.js +69 -0
- package/dist/chunk-CK5KOVHW.js.map +1 -0
- package/dist/{chunk-Q6IP2ARR.js → chunk-CSOYVTRX.js} +2 -2
- package/dist/{chunk-XOQSEF7X.js → chunk-CVILPI77.js} +6 -6
- package/dist/{chunk-VWAXN2BN.js → chunk-CX4ZUMC6.js} +91 -83
- package/dist/chunk-CX4ZUMC6.js.map +1 -0
- package/dist/{chunk-NVRYW264.js → chunk-DAJPRXBR.js} +16 -13
- package/dist/chunk-DAJPRXBR.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-4LMA77JH.js → chunk-E5XQIWAL.js} +3 -3
- package/dist/{chunk-WUNIWKY4.js → chunk-ELIL2A37.js} +6 -6
- package/dist/{chunk-OQ5PRDDS.js → chunk-ERZ2R42X.js} +6 -6
- package/dist/{chunk-U7GW7NE7.js → chunk-FIK3CQNA.js} +10 -10
- package/dist/{chunk-D3J5SLQK.js → chunk-FR27HBBA.js} +81 -20
- package/dist/chunk-FR27HBBA.js.map +1 -0
- package/dist/{chunk-E6PNLPGJ.js → chunk-FUCYDRE5.js} +838 -480
- package/dist/chunk-FUCYDRE5.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-33PLLLL7.js → chunk-GFCVUY6G.js} +6 -6
- package/dist/{chunk-HREE4JHI.js → chunk-GODSPTOT.js} +477 -278
- package/dist/chunk-GODSPTOT.js.map +1 -0
- package/dist/{chunk-S2NCTZGJ.js → chunk-GRUYA45P.js} +15 -15
- package/dist/chunk-GRUYA45P.js.map +1 -0
- package/dist/{chunk-VUPTKTDV.js → chunk-GUAL4PQH.js} +3 -3
- 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-PDLBLTOK.js → chunk-HC3PBX23.js} +9 -9
- 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-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-HLPD7B7P.js → chunk-JZH4LWHB.js} +2 -2
- package/dist/{chunk-AV5ZEH4M.js → chunk-KVJRXN2E.js} +2 -2
- package/dist/{chunk-WFTIGIIS.js → chunk-L6CQ7WIW.js} +5 -5
- package/dist/{chunk-227UFSEQ.js → chunk-LEPOP46W.js} +4 -4
- 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-QN25OCUF.js → chunk-LPYDOLSM.js} +5 -5
- package/dist/{chunk-AS7YMSL6.js → chunk-M23RF3LJ.js} +4 -4
- package/dist/{chunk-OAEQLRCY.js → chunk-MO4HSXHZ.js} +5 -5
- package/dist/{chunk-ECK75GDJ.js → chunk-N3LL5NEU.js} +43 -24
- package/dist/chunk-N3LL5NEU.js.map +1 -0
- package/dist/chunk-NEF7LR5J.js +29 -0
- package/dist/chunk-NEF7LR5J.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-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-7TWUCYER.js → chunk-PNRA7FAD.js} +7 -7
- package/dist/{chunk-5I4M26Q7.js → chunk-QBSFOKY6.js} +4 -4
- package/dist/{chunk-E53DSZEN.js → chunk-QR6G5KF4.js} +3 -3
- package/dist/{chunk-CJ2ZR7UA.js → chunk-QUENPGWZ.js} +261 -211
- package/dist/chunk-QUENPGWZ.js.map +1 -0
- package/dist/{chunk-4UH4BTGK.js → chunk-QVJPH7SH.js} +84 -84
- package/dist/{chunk-UYLMNVY6.js → chunk-R3KHKU7M.js} +16 -9
- package/dist/chunk-R3KHKU7M.js.map +1 -0
- package/dist/{chunk-JBPKEARU.js → chunk-RKNJBZ55.js} +4 -4
- package/dist/{chunk-WDISJRMG.js → chunk-RMMVQQA6.js} +2 -2
- package/dist/{chunk-JVLCVFQ4.js → chunk-RNHVVMFN.js} +3 -3
- package/dist/{chunk-QJAQNXWI.js → chunk-RVO6TCTU.js} +81 -84
- package/dist/chunk-RVO6TCTU.js.map +1 -0
- package/dist/chunk-S2HLHAZ4.js +16 -0
- package/dist/chunk-S2HLHAZ4.js.map +1 -0
- 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-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-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-BJKPPZ6Z.js → chunk-UW66OZTD.js} +2 -2
- package/dist/{chunk-XYTOI63Z.js → chunk-V2TNYF6Q.js} +19 -11
- package/dist/chunk-V2TNYF6Q.js.map +1 -0
- 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-VL35ZFSZ.js +102 -0
- package/dist/chunk-VL35ZFSZ.js.map +1 -0
- package/dist/{chunk-3Y224NYC.js → chunk-VYISFWVX.js} +2 -2
- package/dist/{chunk-JE7EK33X.js → chunk-W2V7UESE.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-A5OJCXZL.js → chunk-WZ3TOIDW.js} +15 -4
- package/dist/chunk-WZ3TOIDW.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-UVIKWC7M.js → chunk-XAGYS7X6.js} +17 -17
- 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-E6EE5B67.js → chunk-YK6BDDHP.js} +4 -4
- package/dist/{chunk-ES36HTSC.js → chunk-YLHM5BQQ.js} +3 -3
- 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-VOUOLGIP.js → chunk-YRFAYOFQ.js} +11 -13
- package/dist/chunk-YRFAYOFQ.js.map +1 -0
- package/dist/{chunk-IKKWIPYN.js → chunk-YYQAKIDJ.js} +37 -1
- package/dist/chunk-YYQAKIDJ.js.map +1 -0
- package/dist/{chunk-GF22HWS2.js → chunk-Z54EM5YZ.js} +4 -4
- package/dist/{chunk-64UDOIMI.js → chunk-ZLQ37WJX.js} +2 -2
- package/dist/{cli-BUGN3d6_.d.ts → cli-BHBswmUa.d.ts} +5 -5
- package/dist/cli.d.ts +16 -12
- package/dist/cli.js +138 -123
- package/dist/compounding/engine.d.ts +3 -2
- package/dist/compounding/engine.js +25 -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 +24 -22
- package/dist/connectors/codex-materialize.d.ts +2 -1
- package/dist/connectors/index.d.ts +2 -1
- package/dist/connectors/index.js +27 -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 +28 -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 +43 -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 +25 -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 +187 -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 +10 -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 +39 -0
- package/dist/external-wiki.js +14 -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 +46 -43
- package/dist/fallback-llm.d.ts +2 -1
- package/dist/{first-start-migration-F2QJD66E.js → first-start-migration-ZSHEFEI3.js} +10 -12
- package/dist/{first-start-migration-F2QJD66E.js.map → first-start-migration-ZSHEFEI3.js.map} +1 -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 +443 -430
- package/dist/index.js +304 -269
- package/dist/intent.d.ts +2 -1
- package/dist/lcm/engine.d.ts +2 -1
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.d.ts +2 -1
- package/dist/lcm/index.js +7 -7
- 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 +25 -23
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +25 -23
- package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-projection.js +27 -25
- package/dist/{maintenance-LbuS2rUA.d.ts → maintenance-CoRikzIt.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-snapshot.d.ts +10 -0
- package/dist/memory-snapshot.js +8 -0
- package/dist/memory-snapshot.js.map +1 -0
- 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 +41 -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 +24 -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 +46 -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 +60 -55
- package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
- package/dist/orchestration/maintenance.d.ts +5 -4
- package/dist/orchestration/maintenance.js +37 -33
- package/dist/{orchestrator-rHiWt32X.d.ts → orchestrator-BJeq7Pw1.d.ts} +14 -7
- package/dist/orchestrator.d.ts +9 -8
- package/dist/orchestrator.js +200 -186
- 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 +8 -8
- 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 +54 -54
- 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 +20 -20
- 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 +26 -24
- package/dist/semantic-rule-promotion.js +24 -22
- package/dist/semantic-rule-verifier.d.ts +2 -1
- package/dist/semantic-rule-verifier.js +25 -23
- package/dist/{service-DJG3KCQ4.d.ts → service-DWC4tq7p.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 +10 -9
- 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 +43 -40
- package/dist/{storage-F9FVh-w9.d.ts → storage-DPGjB-8e.d.ts} +28 -13
- package/dist/storage.d.ts +3 -2
- package/dist/storage.js +26 -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-migration.js +1 -1
- 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 +66 -66
- 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 +25 -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 +80 -0
- package/src/access-http.test.ts +310 -3
- package/src/access-http.ts +84 -77
- 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 +183 -23
- 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 +88 -62
- 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 +100 -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 +367 -0
- package/src/external-wiki-search.ts +362 -0
- package/src/external-wiki.test.ts +240 -0
- package/src/external-wiki.ts +427 -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 +9 -5
- package/src/maintenance/first-start-migration.ts +11 -11
- package/src/mcp-read-only-tools.ts +1 -0
- package/src/memory-snapshot.ts +15 -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-contract/cache-coherence.test.ts +99 -0
- package/src/storage-deletion-revisions.test.ts +91 -0
- package/src/storage-fact-hash-index-defer.test.ts +460 -170
- package/src/storage.ts +572 -284
- package/src/testing/subjects/first-start-tier-migration.test.ts +75 -0
- package/src/tier-migration.ts +10 -12
- 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-VOUOLGIP.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-E5UK4VPE.js.map → chunk-2FSTB6BJ.js.map} +0 -0
- /package/dist/{chunk-5ZE7QHTK.js.map → chunk-2X2T2UVE.js.map} +0 -0
- /package/dist/{chunk-P4DRWEYC.js.map → chunk-3COYXTGM.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-AAIUERNB.js.map → chunk-5QJQHBLE.js.map} +0 -0
- /package/dist/{chunk-6CZPDBJS.js.map → chunk-5U7ID3EZ.js.map} +0 -0
- /package/dist/{chunk-DNWXFTLD.js.map → chunk-A4IJCD2Z.js.map} +0 -0
- /package/dist/{chunk-PKNLM44P.js.map → chunk-AC5OWJLV.js.map} +0 -0
- /package/dist/{chunk-LZ4LDKHZ.js.map → chunk-AMAUBUKY.js.map} +0 -0
- /package/dist/{chunk-S5SLVSVY.js.map → chunk-BQIFZ2MP.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-4LMA77JH.js.map → chunk-E5XQIWAL.js.map} +0 -0
- /package/dist/{chunk-WUNIWKY4.js.map → chunk-ELIL2A37.js.map} +0 -0
- /package/dist/{chunk-OQ5PRDDS.js.map → chunk-ERZ2R42X.js.map} +0 -0
- /package/dist/{chunk-U7GW7NE7.js.map → chunk-FIK3CQNA.js.map} +0 -0
- /package/dist/{chunk-33PLLLL7.js.map → chunk-GFCVUY6G.js.map} +0 -0
- /package/dist/{chunk-VUPTKTDV.js.map → chunk-GUAL4PQH.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-PDLBLTOK.js.map → chunk-HC3PBX23.js.map} +0 -0
- /package/dist/{chunk-KXB4VXHY.js.map → chunk-JIYDRBVZ.js.map} +0 -0
- /package/dist/{chunk-HLPD7B7P.js.map → chunk-JZH4LWHB.js.map} +0 -0
- /package/dist/{chunk-AV5ZEH4M.js.map → chunk-KVJRXN2E.js.map} +0 -0
- /package/dist/{chunk-WFTIGIIS.js.map → chunk-L6CQ7WIW.js.map} +0 -0
- /package/dist/{chunk-227UFSEQ.js.map → chunk-LEPOP46W.js.map} +0 -0
- /package/dist/{chunk-EJUEXZHX.js.map → chunk-LLJMAULE.js.map} +0 -0
- /package/dist/{chunk-QN25OCUF.js.map → chunk-LPYDOLSM.js.map} +0 -0
- /package/dist/{chunk-AS7YMSL6.js.map → chunk-M23RF3LJ.js.map} +0 -0
- /package/dist/{chunk-OAEQLRCY.js.map → chunk-MO4HSXHZ.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-7TWUCYER.js.map → chunk-PNRA7FAD.js.map} +0 -0
- /package/dist/{chunk-5I4M26Q7.js.map → chunk-QBSFOKY6.js.map} +0 -0
- /package/dist/{chunk-E53DSZEN.js.map → chunk-QR6G5KF4.js.map} +0 -0
- /package/dist/{chunk-4UH4BTGK.js.map → chunk-QVJPH7SH.js.map} +0 -0
- /package/dist/{chunk-JBPKEARU.js.map → chunk-RKNJBZ55.js.map} +0 -0
- /package/dist/{chunk-WDISJRMG.js.map → chunk-RMMVQQA6.js.map} +0 -0
- /package/dist/{chunk-JVLCVFQ4.js.map → chunk-RNHVVMFN.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-7K5Q6COX.js.map → chunk-TVVEYCNW.js.map} +0 -0
- /package/dist/{chunk-4B77XSG5.js.map → chunk-UV72DEZD.js.map} +0 -0
- /package/dist/{chunk-BJKPPZ6Z.js.map → chunk-UW66OZTD.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-JE7EK33X.js.map → chunk-W2V7UESE.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-UVIKWC7M.js.map → chunk-XAGYS7X6.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-E6EE5B67.js.map → chunk-YK6BDDHP.js.map} +0 -0
- /package/dist/{chunk-ES36HTSC.js.map → chunk-YLHM5BQQ.js.map} +0 -0
- /package/dist/{chunk-GF22HWS2.js.map → chunk-Z54EM5YZ.js.map} +0 -0
- /package/dist/{chunk-64UDOIMI.js.map → chunk-ZLQ37WJX.js.map} +0 -0
package/src/offline-sync.ts
CHANGED
|
@@ -54,6 +54,11 @@ export interface OfflineSyncFileDigest {
|
|
|
54
54
|
bytes: number;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
export interface OfflineSyncDeletionRevision {
|
|
58
|
+
path: string;
|
|
59
|
+
mtimeMs: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
57
62
|
export interface OfflineSyncSnapshot {
|
|
58
63
|
format: typeof OFFLINE_SYNC_SNAPSHOT_FORMAT;
|
|
59
64
|
schemaVersion: 1;
|
|
@@ -61,6 +66,7 @@ export interface OfflineSyncSnapshot {
|
|
|
61
66
|
sourceId: string;
|
|
62
67
|
includeTranscripts: boolean;
|
|
63
68
|
files: OfflineSyncFileRecord[];
|
|
69
|
+
deletions?: OfflineSyncDeletionRevision[];
|
|
64
70
|
}
|
|
65
71
|
|
|
66
72
|
export type OfflineSyncChange =
|
|
@@ -74,6 +80,7 @@ export type OfflineSyncChange =
|
|
|
74
80
|
type: "delete";
|
|
75
81
|
path: string;
|
|
76
82
|
baseSha256: string;
|
|
83
|
+
mtimeMs?: number;
|
|
77
84
|
};
|
|
78
85
|
|
|
79
86
|
export interface OfflineSyncChangeset {
|
|
@@ -140,6 +147,14 @@ export interface OfflineSyncFileTarget {
|
|
|
140
147
|
filePath: string;
|
|
141
148
|
}
|
|
142
149
|
|
|
150
|
+
export interface OfflineSyncFileDeleteTarget extends OfflineSyncFileTarget {
|
|
151
|
+
mtimeMs?: number;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export type OfflineSyncRecordDeletionRevision = (
|
|
155
|
+
target: OfflineSyncFileDeleteTarget & { mtimeMs: number },
|
|
156
|
+
) => Promise<void>;
|
|
157
|
+
|
|
143
158
|
export interface OfflineSyncFileWriteTarget extends OfflineSyncFileTarget {
|
|
144
159
|
content: Buffer;
|
|
145
160
|
}
|
|
@@ -360,6 +375,88 @@ function normalizeFileStates(input: readonly unknown[] | undefined): OfflineSync
|
|
|
360
375
|
return input.map((entry, index) => normalizeFileState(entry, `baseFiles[${index}]`));
|
|
361
376
|
}
|
|
362
377
|
|
|
378
|
+
function normalizeDeletionRevisions(
|
|
379
|
+
input: unknown,
|
|
380
|
+
fieldPrefix: string,
|
|
381
|
+
): OfflineSyncDeletionRevision[] | undefined {
|
|
382
|
+
if (input === undefined) return undefined;
|
|
383
|
+
if (!Array.isArray(input)) {
|
|
384
|
+
throw new Error(`${fieldPrefix} must be an array`);
|
|
385
|
+
}
|
|
386
|
+
const deletions = input.map((entry, index): OfflineSyncDeletionRevision => {
|
|
387
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
388
|
+
throw new Error(`${fieldPrefix}[${index}] must be an object`);
|
|
389
|
+
}
|
|
390
|
+
const obj = entry as Record<string, unknown>;
|
|
391
|
+
return {
|
|
392
|
+
path: normalizeRelativePath(obj.path, `${fieldPrefix}[${index}].path`),
|
|
393
|
+
mtimeMs: assertOfflineSyncMtimeMs(obj.mtimeMs, `${fieldPrefix}[${index}].mtimeMs`),
|
|
394
|
+
};
|
|
395
|
+
});
|
|
396
|
+
assertUniquePaths(deletions, fieldPrefix);
|
|
397
|
+
return deletions.sort(compareByPath);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function snapshotBuilderDeletions(options: {
|
|
401
|
+
deletions?: readonly OfflineSyncDeletionRevision[];
|
|
402
|
+
files: readonly OfflineSyncFileState[];
|
|
403
|
+
paths?: readonly string[];
|
|
404
|
+
includeTranscripts: boolean;
|
|
405
|
+
excludeNodeLocalState?: boolean;
|
|
406
|
+
userExcludeRegexps?: readonly RegExp[];
|
|
407
|
+
}): OfflineSyncDeletionRevision[] | undefined {
|
|
408
|
+
const deletions = normalizeDeletionRevisions(options.deletions, "deletions");
|
|
409
|
+
if (deletions === undefined) return undefined;
|
|
410
|
+
if (deletions.length === 0) return deletions;
|
|
411
|
+
const presentPaths = new Set(options.files.map((file) => file.path.toLowerCase()));
|
|
412
|
+
const scopedPaths = options.paths
|
|
413
|
+
? new Set(options.paths.map((relPath) => relPath.toLowerCase()))
|
|
414
|
+
: undefined;
|
|
415
|
+
return deletions.filter((deletion) =>
|
|
416
|
+
(scopedPaths === undefined || scopedPaths.has(deletion.path.toLowerCase())) &&
|
|
417
|
+
!presentPaths.has(deletion.path.toLowerCase()) &&
|
|
418
|
+
!(options.excludeNodeLocalState === false
|
|
419
|
+
? shouldExcludeRelPath(deletion.path, options.includeTranscripts)
|
|
420
|
+
: shouldExcludePushRelPath(
|
|
421
|
+
deletion.path,
|
|
422
|
+
options.includeTranscripts,
|
|
423
|
+
options.userExcludeRegexps,
|
|
424
|
+
)));
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export async function filterOfflineSyncDeletionRevisions(options: {
|
|
428
|
+
root: string;
|
|
429
|
+
deletions: readonly OfflineSyncDeletionRevision[];
|
|
430
|
+
includeTranscripts?: boolean;
|
|
431
|
+
userExcludeRegexps?: readonly RegExp[];
|
|
432
|
+
}): Promise<OfflineSyncDeletionRevision[]> {
|
|
433
|
+
const deletions = normalizeDeletionRevisions(options.deletions, "deletions");
|
|
434
|
+
if (deletions === undefined) throw new Error("deletions must be an array");
|
|
435
|
+
if (deletions.length === 0) return deletions;
|
|
436
|
+
const root = await prepareSafeArchiveRoot(
|
|
437
|
+
path.resolve(options.root),
|
|
438
|
+
"filterOfflineSyncDeletionRevisions",
|
|
439
|
+
"root",
|
|
440
|
+
);
|
|
441
|
+
const includeTranscripts = options.includeTranscripts !== false;
|
|
442
|
+
const filtered: OfflineSyncDeletionRevision[] = [];
|
|
443
|
+
for (const deletion of deletions) {
|
|
444
|
+
if (shouldExcludePushRelPath(deletion.path, includeTranscripts, options.userExcludeRegexps)) {
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
const filePath = path.join(root.abs, ...deletion.path.split("/"));
|
|
448
|
+
const present = await lstat(filePath).then(
|
|
449
|
+
() => true,
|
|
450
|
+
(error: unknown) => {
|
|
451
|
+
if ((error as NodeJS.ErrnoException).code === "ENOENT") return false;
|
|
452
|
+
throw error;
|
|
453
|
+
},
|
|
454
|
+
);
|
|
455
|
+
if (!present) filtered.push(deletion);
|
|
456
|
+
}
|
|
457
|
+
return filtered;
|
|
458
|
+
}
|
|
459
|
+
|
|
363
460
|
export function normalizeOfflineSyncSnapshot(
|
|
364
461
|
input: unknown,
|
|
365
462
|
options: { requireContent?: boolean } = {},
|
|
@@ -385,16 +482,21 @@ export function normalizeOfflineSyncSnapshot(
|
|
|
385
482
|
normalizeFileRecord(entry, `files[${index}]`, options.requireContent === true))
|
|
386
483
|
.filter((file) => !shouldIgnoreIncomingRuntimePath(file.path))
|
|
387
484
|
.sort(compareByPath);
|
|
388
|
-
|
|
485
|
+
const deletions = normalizeDeletionRevisions(obj.deletions, "deletions")
|
|
486
|
+
?.filter((deletion) => !shouldIgnoreIncomingRuntimePath(deletion.path));
|
|
487
|
+
const entries = deletions && deletions.length > 0 ? [...files, ...deletions] : files;
|
|
488
|
+
assertUniquePaths(entries, "offline sync snapshot");
|
|
389
489
|
if (!includeTranscripts) {
|
|
390
|
-
const transcriptPath =
|
|
490
|
+
const transcriptPath = entries
|
|
491
|
+
.find((entry) => entry.path.split("/")[0] === "transcripts")?.path;
|
|
391
492
|
if (transcriptPath) {
|
|
392
493
|
throw new Error(
|
|
393
494
|
`offline sync snapshot includeTranscripts is false but contains transcript path: ${transcriptPath}`,
|
|
394
495
|
);
|
|
395
496
|
}
|
|
396
497
|
}
|
|
397
|
-
const excludedPath =
|
|
498
|
+
const excludedPath = entries
|
|
499
|
+
.find((entry) => shouldExcludeRelPath(entry.path, true))?.path;
|
|
398
500
|
if (excludedPath) {
|
|
399
501
|
throw new Error(`offline sync snapshot contains excluded path: ${excludedPath}`);
|
|
400
502
|
}
|
|
@@ -405,6 +507,7 @@ export function normalizeOfflineSyncSnapshot(
|
|
|
405
507
|
sourceId,
|
|
406
508
|
includeTranscripts,
|
|
407
509
|
files,
|
|
510
|
+
...(deletions === undefined ? {} : { deletions }),
|
|
408
511
|
};
|
|
409
512
|
}
|
|
410
513
|
|
|
@@ -455,10 +558,14 @@ export function normalizeOfflineSyncChangeset(
|
|
|
455
558
|
};
|
|
456
559
|
}
|
|
457
560
|
if (type === "delete") {
|
|
561
|
+
const mtimeMs = change.mtimeMs === undefined
|
|
562
|
+
? undefined
|
|
563
|
+
: assertOfflineSyncMtimeMs(change.mtimeMs, `changes[${index}].mtimeMs`);
|
|
458
564
|
return {
|
|
459
565
|
type: "delete",
|
|
460
566
|
path: relPath,
|
|
461
567
|
baseSha256: assertSha256(change.baseSha256, `changes[${index}].baseSha256`),
|
|
568
|
+
...(mtimeMs === undefined ? {} : { mtimeMs }),
|
|
462
569
|
};
|
|
463
570
|
}
|
|
464
571
|
throw new Error(`changes[${index}].type must be "upsert" or "delete"`);
|
|
@@ -515,7 +622,16 @@ function assertUniquePaths(entries: readonly { path: string }[], context: string
|
|
|
515
622
|
}
|
|
516
623
|
}
|
|
517
624
|
|
|
625
|
+
export function isInternalRemnicStatePath(relPosix: string): boolean {
|
|
626
|
+
const normalized = relPosix.includes("\\") ? relPosix.replaceAll("\\", "/") : relPosix;
|
|
627
|
+
return normalized === ".remnic"
|
|
628
|
+
|| normalized.startsWith(".remnic/")
|
|
629
|
+
|| normalized.endsWith("/.remnic")
|
|
630
|
+
|| normalized.includes("/.remnic/");
|
|
631
|
+
}
|
|
632
|
+
|
|
518
633
|
function shouldExcludeRelPath(relPosix: string, includeTranscripts: boolean): boolean {
|
|
634
|
+
if (isInternalRemnicStatePath(relPosix)) return true;
|
|
519
635
|
const parts = relPosix.split("/");
|
|
520
636
|
if (parts.some((part) => DEFAULT_TRANSFER_EXCLUDE_DIRS.has(part))) return true;
|
|
521
637
|
if (parts.some((part) => part === SYNC_INTERNAL_DIR)) return true;
|
|
@@ -615,6 +731,7 @@ export function parseOfflineSyncExcludes(raw: unknown): string[] {
|
|
|
615
731
|
}
|
|
616
732
|
|
|
617
733
|
function shouldIgnoreIncomingRuntimePath(relPosix: string): boolean {
|
|
734
|
+
if (isInternalRemnicStatePath(relPosix)) return true;
|
|
618
735
|
const parts = relPosix.split("/");
|
|
619
736
|
const basename = parts[parts.length - 1] ?? "";
|
|
620
737
|
return isCanonicalRuntimeStatePath(parts) && basename.includes(".tmp-");
|
|
@@ -826,6 +943,7 @@ export async function buildOfflineSyncSnapshot(options: {
|
|
|
826
943
|
root: string;
|
|
827
944
|
sourceId: string;
|
|
828
945
|
includeContent?: boolean;
|
|
946
|
+
deletions?: readonly OfflineSyncDeletionRevision[];
|
|
829
947
|
includeTranscripts?: boolean;
|
|
830
948
|
now?: Date;
|
|
831
949
|
readFile?: (target: OfflineSyncFileTarget) => Promise<Buffer>;
|
|
@@ -847,13 +965,22 @@ export async function buildOfflineSyncSnapshot(options: {
|
|
|
847
965
|
for await (const file of iterateOfflineSyncSnapshotFileRecords(options)) files.push(file);
|
|
848
966
|
throwIfOfflineSyncAborted(options.signal);
|
|
849
967
|
|
|
968
|
+
const sortedFiles = files.sort(compareByPath);
|
|
969
|
+
const deletions = snapshotBuilderDeletions({
|
|
970
|
+
deletions: options.deletions,
|
|
971
|
+
files: sortedFiles,
|
|
972
|
+
includeTranscripts,
|
|
973
|
+
excludeNodeLocalState: options.excludeNodeLocalState,
|
|
974
|
+
userExcludeRegexps: options.userExcludeRegexps,
|
|
975
|
+
});
|
|
850
976
|
return {
|
|
851
977
|
format: OFFLINE_SYNC_SNAPSHOT_FORMAT,
|
|
852
978
|
schemaVersion: 1,
|
|
853
979
|
createdAt: (options.now ?? new Date()).toISOString(),
|
|
854
980
|
sourceId: normalizeSourceId(options.sourceId, "sourceId"),
|
|
855
981
|
includeTranscripts,
|
|
856
|
-
files:
|
|
982
|
+
files: sortedFiles,
|
|
983
|
+
...(deletions === undefined ? {} : { deletions }),
|
|
857
984
|
};
|
|
858
985
|
}
|
|
859
986
|
|
|
@@ -861,6 +988,7 @@ export async function buildOfflineSyncSnapshotFromBase(options: {
|
|
|
861
988
|
root: string;
|
|
862
989
|
sourceId: string;
|
|
863
990
|
baseFiles?: readonly OfflineSyncFileState[];
|
|
991
|
+
deletions?: readonly OfflineSyncDeletionRevision[];
|
|
864
992
|
baseCapturedAt?: Date;
|
|
865
993
|
includeContent?: boolean;
|
|
866
994
|
includeTranscripts?: boolean;
|
|
@@ -937,13 +1065,22 @@ export async function buildOfflineSyncSnapshotFromBase(options: {
|
|
|
937
1065
|
await walk(root.abs);
|
|
938
1066
|
throwIfOfflineSyncAborted(options.signal);
|
|
939
1067
|
|
|
1068
|
+
const sortedFiles = files.sort(compareByPath);
|
|
1069
|
+
const deletions = snapshotBuilderDeletions({
|
|
1070
|
+
deletions: options.deletions,
|
|
1071
|
+
files: sortedFiles,
|
|
1072
|
+
includeTranscripts,
|
|
1073
|
+
excludeNodeLocalState: options.excludeNodeLocalState,
|
|
1074
|
+
userExcludeRegexps: options.userExcludeRegexps,
|
|
1075
|
+
});
|
|
940
1076
|
return {
|
|
941
1077
|
format: OFFLINE_SYNC_SNAPSHOT_FORMAT,
|
|
942
1078
|
schemaVersion: 1,
|
|
943
1079
|
createdAt: (options.now ?? new Date()).toISOString(),
|
|
944
1080
|
sourceId: normalizeSourceId(options.sourceId, "sourceId"),
|
|
945
1081
|
includeTranscripts,
|
|
946
|
-
files:
|
|
1082
|
+
files: sortedFiles,
|
|
1083
|
+
...(deletions === undefined ? {} : { deletions }),
|
|
947
1084
|
};
|
|
948
1085
|
}
|
|
949
1086
|
|
|
@@ -951,6 +1088,7 @@ export async function buildOfflineSyncSnapshotForPaths(options: {
|
|
|
951
1088
|
root: string;
|
|
952
1089
|
sourceId: string;
|
|
953
1090
|
paths: readonly string[];
|
|
1091
|
+
deletions?: readonly OfflineSyncDeletionRevision[];
|
|
954
1092
|
includeContent?: boolean;
|
|
955
1093
|
includeTranscripts?: boolean;
|
|
956
1094
|
now?: Date;
|
|
@@ -1004,13 +1142,23 @@ export async function buildOfflineSyncSnapshotForPaths(options: {
|
|
|
1004
1142
|
}
|
|
1005
1143
|
throwIfOfflineSyncAborted(options.signal);
|
|
1006
1144
|
|
|
1145
|
+
const sortedFiles = files.sort(compareByPath);
|
|
1146
|
+
const deletions = snapshotBuilderDeletions({
|
|
1147
|
+
deletions: options.deletions,
|
|
1148
|
+
files: sortedFiles,
|
|
1149
|
+
paths: [...seen],
|
|
1150
|
+
includeTranscripts,
|
|
1151
|
+
excludeNodeLocalState: options.excludeNodeLocalState,
|
|
1152
|
+
userExcludeRegexps: options.userExcludeRegexps,
|
|
1153
|
+
});
|
|
1007
1154
|
return {
|
|
1008
1155
|
format: OFFLINE_SYNC_SNAPSHOT_FORMAT,
|
|
1009
1156
|
schemaVersion: 1,
|
|
1010
1157
|
createdAt: (options.now ?? new Date()).toISOString(),
|
|
1011
1158
|
sourceId: normalizeSourceId(options.sourceId, "sourceId"),
|
|
1012
1159
|
includeTranscripts,
|
|
1013
|
-
files:
|
|
1160
|
+
files: sortedFiles,
|
|
1161
|
+
...(deletions === undefined ? {} : { deletions }),
|
|
1014
1162
|
};
|
|
1015
1163
|
}
|
|
1016
1164
|
|
|
@@ -1106,6 +1254,7 @@ export async function buildOfflineSyncChangeset(options: {
|
|
|
1106
1254
|
root: string;
|
|
1107
1255
|
sourceId: string;
|
|
1108
1256
|
baseFiles?: readonly OfflineSyncFileState[];
|
|
1257
|
+
deletions?: readonly OfflineSyncDeletionRevision[];
|
|
1109
1258
|
baseCapturedAt?: Date;
|
|
1110
1259
|
excludePaths?: readonly string[];
|
|
1111
1260
|
includeTranscripts?: boolean;
|
|
@@ -1127,6 +1276,7 @@ export async function buildOfflineSyncChangeset(options: {
|
|
|
1127
1276
|
root: options.root,
|
|
1128
1277
|
sourceId: options.sourceId,
|
|
1129
1278
|
baseFiles: options.baseFiles,
|
|
1279
|
+
deletions: options.deletions,
|
|
1130
1280
|
baseCapturedAt: options.baseCapturedAt,
|
|
1131
1281
|
includeContent: false,
|
|
1132
1282
|
includeTranscripts,
|
|
@@ -1140,6 +1290,7 @@ export async function buildOfflineSyncChangeset(options: {
|
|
|
1140
1290
|
sourceId: options.sourceId,
|
|
1141
1291
|
baseFiles: options.baseFiles,
|
|
1142
1292
|
currentFiles: current.files,
|
|
1293
|
+
deletions: current.deletions,
|
|
1143
1294
|
excludePaths: options.excludePaths,
|
|
1144
1295
|
includeTranscripts,
|
|
1145
1296
|
now: options.now,
|
|
@@ -1153,6 +1304,7 @@ export async function buildOfflineSyncChangesetFromSnapshot(options: {
|
|
|
1153
1304
|
sourceId: string;
|
|
1154
1305
|
currentFiles: readonly OfflineSyncFileState[];
|
|
1155
1306
|
baseFiles?: readonly OfflineSyncFileState[];
|
|
1307
|
+
deletions?: readonly OfflineSyncDeletionRevision[];
|
|
1156
1308
|
excludePaths?: readonly string[];
|
|
1157
1309
|
includeTranscripts?: boolean;
|
|
1158
1310
|
now?: Date;
|
|
@@ -1179,6 +1331,10 @@ export async function buildOfflineSyncChangesetFromSnapshot(options: {
|
|
|
1179
1331
|
normalizeFileStates(options.currentFiles),
|
|
1180
1332
|
includeTranscripts,
|
|
1181
1333
|
));
|
|
1334
|
+
const deletions = normalizeDeletionRevisions(options.deletions, "deletions");
|
|
1335
|
+
const deletionMtimeByPath = deletions === undefined
|
|
1336
|
+
? undefined
|
|
1337
|
+
: new Map(deletions.map((deletion) => [deletion.path, deletion.mtimeMs] as const));
|
|
1182
1338
|
const changes: OfflineSyncChange[] = [];
|
|
1183
1339
|
|
|
1184
1340
|
for (const relPath of unionPaths(base, currentMap)) {
|
|
@@ -1216,10 +1372,12 @@ export async function buildOfflineSyncChangesetFromSnapshot(options: {
|
|
|
1216
1372
|
continue;
|
|
1217
1373
|
}
|
|
1218
1374
|
if (!currentEntry && baseEntry) {
|
|
1375
|
+
const mtimeMs = deletionMtimeByPath?.get(relPath);
|
|
1219
1376
|
changes.push({
|
|
1220
1377
|
type: "delete",
|
|
1221
1378
|
path: relPath,
|
|
1222
1379
|
baseSha256: baseEntry.sha256,
|
|
1380
|
+
...(mtimeMs === undefined ? {} : { mtimeMs }),
|
|
1223
1381
|
});
|
|
1224
1382
|
}
|
|
1225
1383
|
}
|
|
@@ -1343,7 +1501,8 @@ export async function applyOfflineSyncSnapshot(options: {
|
|
|
1343
1501
|
readFile?: (target: OfflineSyncFileTarget) => Promise<Buffer>;
|
|
1344
1502
|
readFileDigest?: (target: OfflineSyncFileTarget) => Promise<OfflineSyncFileDigest>;
|
|
1345
1503
|
writeFile?: (target: OfflineSyncFileWriteTarget) => Promise<void>;
|
|
1346
|
-
deleteFile?: (target:
|
|
1504
|
+
deleteFile?: (target: OfflineSyncFileDeleteTarget) => Promise<void>;
|
|
1505
|
+
recordDeletionRevision?: OfflineSyncRecordDeletionRevision;
|
|
1347
1506
|
}): Promise<OfflineSyncApplySnapshotResult> {
|
|
1348
1507
|
const snapshot = normalizeOfflineSyncSnapshot(options.snapshot);
|
|
1349
1508
|
const baseMap = byPath(filterBaseFilesForMode(
|
|
@@ -1351,6 +1510,9 @@ export async function applyOfflineSyncSnapshot(options: {
|
|
|
1351
1510
|
snapshot.includeTranscripts,
|
|
1352
1511
|
));
|
|
1353
1512
|
const incomingMap = byPath(snapshot.files);
|
|
1513
|
+
const deletionMtimeByPath = snapshot.deletions === undefined
|
|
1514
|
+
? undefined
|
|
1515
|
+
: new Map(snapshot.deletions.map((deletion) => [deletion.path, deletion.mtimeMs] as const));
|
|
1354
1516
|
const incomingBuffers = verifyRecordContents(snapshot.files, "offline sync snapshot", {
|
|
1355
1517
|
requireContent: false,
|
|
1356
1518
|
});
|
|
@@ -1368,6 +1530,23 @@ export async function applyOfflineSyncSnapshot(options: {
|
|
|
1368
1530
|
})).files;
|
|
1369
1531
|
const currentMap = byPath(currentFiles);
|
|
1370
1532
|
const deferredPaths = new Set(options.deferredPaths ?? []);
|
|
1533
|
+
if (deletionMtimeByPath && options.recordDeletionRevision) {
|
|
1534
|
+
for (const [relPath, mtimeMs] of deletionMtimeByPath) {
|
|
1535
|
+
if (
|
|
1536
|
+
currentMap.has(relPath) ||
|
|
1537
|
+
deferredPaths.has(relPath) ||
|
|
1538
|
+
matchesOfflineSyncDefaultExclude(relPath)
|
|
1539
|
+
) {
|
|
1540
|
+
continue;
|
|
1541
|
+
}
|
|
1542
|
+
await options.recordDeletionRevision({
|
|
1543
|
+
root: root.abs,
|
|
1544
|
+
path: relPath,
|
|
1545
|
+
filePath: await resolveSafeArchiveTarget(root, relPath),
|
|
1546
|
+
mtimeMs,
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1371
1550
|
const nextBase = new Map(baseMap);
|
|
1372
1551
|
const conflicts: OfflineSyncConflict[] = [];
|
|
1373
1552
|
let upserted = 0;
|
|
@@ -1490,7 +1669,12 @@ export async function applyOfflineSyncSnapshot(options: {
|
|
|
1490
1669
|
shouldPreferIncomingOfflineRuntimeFile(relPath) &&
|
|
1491
1670
|
(base || shouldDeleteAbsentIncomingOfflineRuntimeFile(relPath))
|
|
1492
1671
|
) {
|
|
1493
|
-
await deleteSafeFile(
|
|
1672
|
+
await deleteSafeFile(
|
|
1673
|
+
root,
|
|
1674
|
+
relPath,
|
|
1675
|
+
options.deleteFile,
|
|
1676
|
+
deletionMtimeByPath?.get(relPath),
|
|
1677
|
+
);
|
|
1494
1678
|
nextBase.delete(relPath);
|
|
1495
1679
|
deleted += 1;
|
|
1496
1680
|
continue;
|
|
@@ -1501,7 +1685,12 @@ export async function applyOfflineSyncSnapshot(options: {
|
|
|
1501
1685
|
continue;
|
|
1502
1686
|
}
|
|
1503
1687
|
if (base && currentEntry.sha256 === base.sha256) {
|
|
1504
|
-
await deleteSafeFile(
|
|
1688
|
+
await deleteSafeFile(
|
|
1689
|
+
root,
|
|
1690
|
+
relPath,
|
|
1691
|
+
options.deleteFile,
|
|
1692
|
+
deletionMtimeByPath?.get(relPath),
|
|
1693
|
+
);
|
|
1505
1694
|
nextBase.delete(relPath);
|
|
1506
1695
|
deleted += 1;
|
|
1507
1696
|
continue;
|
|
@@ -1539,7 +1728,8 @@ export async function applyOfflineSyncChangeset(options: {
|
|
|
1539
1728
|
readFile?: (target: OfflineSyncFileTarget) => Promise<Buffer>;
|
|
1540
1729
|
readFileDigest?: (target: OfflineSyncFileTarget) => Promise<OfflineSyncFileDigest>;
|
|
1541
1730
|
writeFile?: (target: OfflineSyncFileWriteTarget) => Promise<void>;
|
|
1542
|
-
deleteFile?: (target:
|
|
1731
|
+
deleteFile?: (target: OfflineSyncFileDeleteTarget) => Promise<void>;
|
|
1732
|
+
recordDeletionRevision?: OfflineSyncRecordDeletionRevision;
|
|
1543
1733
|
}): Promise<OfflineSyncApplyChangesetResult> {
|
|
1544
1734
|
let changeset: OfflineSyncChangeset;
|
|
1545
1735
|
try {
|
|
@@ -1630,11 +1820,19 @@ export async function applyOfflineSyncChangeset(options: {
|
|
|
1630
1820
|
}
|
|
1631
1821
|
|
|
1632
1822
|
if (!currentEntry) {
|
|
1823
|
+
if (change.mtimeMs !== undefined && options.recordDeletionRevision) {
|
|
1824
|
+
await options.recordDeletionRevision({
|
|
1825
|
+
root: root.abs,
|
|
1826
|
+
path: change.path,
|
|
1827
|
+
filePath: await resolveSafeArchiveTarget(root, change.path),
|
|
1828
|
+
mtimeMs: change.mtimeMs,
|
|
1829
|
+
});
|
|
1830
|
+
}
|
|
1633
1831
|
skipped += 1;
|
|
1634
1832
|
continue;
|
|
1635
1833
|
}
|
|
1636
1834
|
if (currentEntry.sha256 === change.baseSha256) {
|
|
1637
|
-
await deleteSafeFile(root, change.path, options.deleteFile);
|
|
1835
|
+
await deleteSafeFile(root, change.path, options.deleteFile, change.mtimeMs);
|
|
1638
1836
|
currentMap.delete(change.path);
|
|
1639
1837
|
appliedDeletes += 1;
|
|
1640
1838
|
continue;
|
|
@@ -2310,11 +2508,17 @@ async function writeOfflineUploadContent(options: {
|
|
|
2310
2508
|
async function deleteSafeFile(
|
|
2311
2509
|
root: SafeArchiveRoot,
|
|
2312
2510
|
relPath: string,
|
|
2313
|
-
deleteFile?: (target:
|
|
2511
|
+
deleteFile?: (target: OfflineSyncFileDeleteTarget) => Promise<void>,
|
|
2512
|
+
mtimeMs?: number,
|
|
2314
2513
|
): Promise<void> {
|
|
2315
2514
|
const target = await resolveSafeArchiveTarget(root, relPath);
|
|
2316
2515
|
if (deleteFile) {
|
|
2317
|
-
await deleteFile({
|
|
2516
|
+
await deleteFile({
|
|
2517
|
+
root: root.abs,
|
|
2518
|
+
path: relPath,
|
|
2519
|
+
filePath: target,
|
|
2520
|
+
...(mtimeMs === undefined ? {} : { mtimeMs }),
|
|
2521
|
+
});
|
|
2318
2522
|
return;
|
|
2319
2523
|
}
|
|
2320
2524
|
await unlink(target).catch((error: unknown) => {
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { mkdir, symlink } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import test from "node:test";
|
|
5
|
+
|
|
6
|
+
import type { QmdSearchResult } from "../types.js";
|
|
7
|
+
import * as wikiGuard from "../external-wiki-guard.js";
|
|
8
|
+
import { withTempDir } from "../testing/tmp-dir.js";
|
|
9
|
+
import {
|
|
10
|
+
filterRecallCandidates,
|
|
11
|
+
isExternalWikiCollectionName,
|
|
12
|
+
isGenericRecallExcludedPath,
|
|
13
|
+
} from "./generic-recall-paths.js";
|
|
14
|
+
|
|
15
|
+
const { assertExternalWikiRootOutsideMemoryDir } = wikiGuard;
|
|
16
|
+
const assertCanonicalIsolation = (
|
|
17
|
+
wikiGuard as typeof wikiGuard & {
|
|
18
|
+
assertExternalWikiRootOutsideMemoryDirCanonical(memoryDir: string, rootDir: string): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
).assertExternalWikiRootOutsideMemoryDirCanonical;
|
|
21
|
+
|
|
22
|
+
function hit(path: string, snippet: string): QmdSearchResult {
|
|
23
|
+
return { docid: path, path, score: 1, snippet };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const OVERLAPPING_QUERY = "bounded context budgets";
|
|
27
|
+
const MEMORY_HIT = hit("openclaw-engram/facts/context-budget.md", `The operator chose ${OVERLAPPING_QUERY}.`);
|
|
28
|
+
const WIKI_HIT = hit(
|
|
29
|
+
"qmd://external-wiki-reading/wiki/context-budgets.md",
|
|
30
|
+
`A compiled guide to ${OVERLAPPING_QUERY}.`
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const MEMORY_POLICY = {
|
|
34
|
+
qmdCollection: "openclaw-engram",
|
|
35
|
+
qmdColdCollection: "openclaw-engram-cold",
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
test("default recall excludes overlapping external wiki hits before applying its limit", () => {
|
|
39
|
+
const recalled = filterRecallCandidates([WIKI_HIT, MEMORY_HIT], {
|
|
40
|
+
namespacesEnabled: false,
|
|
41
|
+
recallNamespaces: [],
|
|
42
|
+
resolveNamespace: () => "default",
|
|
43
|
+
limit: 1,
|
|
44
|
+
pathPolicy: MEMORY_POLICY,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
assert.deepEqual(recalled, [MEMORY_HIT]);
|
|
48
|
+
assert.equal(isGenericRecallExcludedPath(WIKI_HIT.path, MEMORY_POLICY, "qmd"), true);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test("the recall-only guard leaves on-demand external wiki search results available", () => {
|
|
52
|
+
const onDemandResults = [WIKI_HIT];
|
|
53
|
+
|
|
54
|
+
assert.equal(onDemandResults[0]?.path, WIKI_HIT.path);
|
|
55
|
+
assert.match(onDemandResults[0]?.snippet ?? "", new RegExp(OVERLAPPING_QUERY));
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test("external wiki collection ids cannot masquerade as memory collections", () => {
|
|
59
|
+
assert.equal(isExternalWikiCollectionName("external-wiki-reading"), true);
|
|
60
|
+
assert.equal(isExternalWikiCollectionName("external-wiki-reading--default"), true);
|
|
61
|
+
assert.equal(isExternalWikiCollectionName("openclaw-engram"), false);
|
|
62
|
+
assert.equal(isExternalWikiCollectionName("my-external-wiki-reading"), false);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test("external wiki roots cannot enter the primary memory collection walk", () => {
|
|
66
|
+
assert.throws(
|
|
67
|
+
() => assertExternalWikiRootOutsideMemoryDir("/data/memory", "/data/memory"),
|
|
68
|
+
/must be outside memoryDir/
|
|
69
|
+
);
|
|
70
|
+
assert.throws(
|
|
71
|
+
() => assertExternalWikiRootOutsideMemoryDir("/data/memory", "/data/memory/compiled-wiki"),
|
|
72
|
+
/must be outside memoryDir/
|
|
73
|
+
);
|
|
74
|
+
assert.doesNotThrow(() => assertExternalWikiRootOutsideMemoryDir("/data/memory", "/data/compiled-wiki"));
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test("external wiki root isolation resolves filesystem aliases", async () => {
|
|
78
|
+
assert.equal(typeof assertCanonicalIsolation, "function");
|
|
79
|
+
await withTempDir(async (rootDir) => {
|
|
80
|
+
const memoryDir = path.join(rootDir, "memory");
|
|
81
|
+
const nestedWiki = path.join(memoryDir, "compiled-wiki");
|
|
82
|
+
const wikiAlias = path.join(rootDir, "wiki-alias");
|
|
83
|
+
await mkdir(nestedWiki, { recursive: true });
|
|
84
|
+
await symlink(nestedWiki, wikiAlias);
|
|
85
|
+
const memoryAlias = path.join(rootDir, "memory-alias");
|
|
86
|
+
await symlink(memoryDir, memoryAlias);
|
|
87
|
+
|
|
88
|
+
await assert.rejects(() => assertCanonicalIsolation(memoryDir, wikiAlias), /must be outside memoryDir/);
|
|
89
|
+
await assert.rejects(
|
|
90
|
+
() => assertCanonicalIsolation(memoryDir, path.join(memoryAlias, "future-wiki")),
|
|
91
|
+
/must be outside memoryDir/
|
|
92
|
+
);
|
|
93
|
+
}, "remnic-external-wiki-guard-");
|
|
94
|
+
});
|
|
@@ -419,6 +419,7 @@ export class ExtractionPersistCoordinator {
|
|
|
419
419
|
source: string;
|
|
420
420
|
sources?: ProvenanceSource[];
|
|
421
421
|
provenance?: "verified" | "unverified" | "none";
|
|
422
|
+
toolScoped?: true;
|
|
422
423
|
}): Promise<void> => {
|
|
423
424
|
if (
|
|
424
425
|
!scopeProfileWritePlan ||
|
|
@@ -536,6 +537,7 @@ export class ExtractionPersistCoordinator {
|
|
|
536
537
|
contentHashSource: options.category === "fact" ? dedupContent : rawContent,
|
|
537
538
|
...(options.sources && options.sources.length > 0 ? { sources: options.sources } : {}),
|
|
538
539
|
...(options.provenance ? { provenance: options.provenance } : {}),
|
|
540
|
+
...(options.toolScoped ? { toolScoped: true as const } : {}),
|
|
539
541
|
});
|
|
540
542
|
const promotedId = targetPromotion.id;
|
|
541
543
|
// #1645: if the TARGET namespace's own tombstone blocked this promotion,
|
|
@@ -615,8 +617,12 @@ export class ExtractionPersistCoordinator {
|
|
|
615
617
|
sources?: ProvenanceSource[];
|
|
616
618
|
provenance?: "verified" | "unverified" | "none";
|
|
617
619
|
}): Promise<void> => {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
+
const toolScoped = withholdToolScopedFromSharedNamespace(options);
|
|
621
|
+
await promoteMemoryToProfileTargets({
|
|
622
|
+
...options,
|
|
623
|
+
...(toolScoped ? { toolScoped: true as const } : {}),
|
|
624
|
+
});
|
|
625
|
+
if (lifecycleCaps.extractionScopeClassification && toolScoped) return;
|
|
620
626
|
if (
|
|
621
627
|
!shouldPromoteToShared(
|
|
622
628
|
this.deps.config,
|
|
@@ -939,6 +945,7 @@ export class ExtractionPersistCoordinator {
|
|
|
939
945
|
// Claim-level provenance spans (issue #1575 PR 2).
|
|
940
946
|
...(options.sources && options.sources.length > 0 ? { sources: options.sources } : {}),
|
|
941
947
|
...(options.provenance ? { provenance: options.provenance } : {}),
|
|
948
|
+
...(toolScoped ? { toolScoped: true as const } : {}),
|
|
942
949
|
});
|
|
943
950
|
const promotedId = sharedPromotion.id;
|
|
944
951
|
// #1645: if the shared namespace's own tombstone blocked this promotion,
|
|
@@ -2019,6 +2026,11 @@ export class ExtractionPersistCoordinator {
|
|
|
2019
2026
|
? "extraction-proactive"
|
|
2020
2027
|
: "extraction";
|
|
2021
2028
|
const extractionSourceConnector = sourceContext?.sourceConnector;
|
|
2029
|
+
const factToolScoped = withholdToolScopedFromSharedNamespace({
|
|
2030
|
+
content: fact.content,
|
|
2031
|
+
sourceConnector: extractionSourceConnector,
|
|
2032
|
+
procedureSteps: fact.procedureSteps,
|
|
2033
|
+
});
|
|
2022
2034
|
|
|
2023
2035
|
// Check for contradictions before writing (Phase 2B).
|
|
2024
2036
|
// NOTE: This block was moved above the chunking branch so that the
|
|
@@ -2227,6 +2239,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2227
2239
|
// PR #2016: never defer here — fallible chunk/artifact writes follow this
|
|
2228
2240
|
// durable parent .md; flush the hash now so a throw can't strand it (dup).
|
|
2229
2241
|
deferHashIndexSave: false,
|
|
2242
|
+
...(factToolScoped ? { toolScoped: true as const } : {}),
|
|
2230
2243
|
});
|
|
2231
2244
|
const parentId = parentWrite.id;
|
|
2232
2245
|
// #1645: surface the tombstone block and gate active post-write paths
|
|
@@ -2310,6 +2323,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2310
2323
|
...(fact.sources && fact.sources.length > 0 ? { sources: fact.sources } : {}),
|
|
2311
2324
|
...(fact.provenance ? { provenance: fact.provenance } : {}),
|
|
2312
2325
|
...(extractionSourceConnector ? { sourceConnector: extractionSourceConnector } : {}),
|
|
2326
|
+
...(factToolScoped ? { toolScoped: true as const } : {}),
|
|
2313
2327
|
},
|
|
2314
2328
|
);
|
|
2315
2329
|
}
|
|
@@ -2457,6 +2471,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2457
2471
|
intentActionType: inferredIntent?.actionType,
|
|
2458
2472
|
intentEntityTypes: inferredIntent?.entityTypes,
|
|
2459
2473
|
...(extractionSourceConnector ? { sourceConnector: extractionSourceConnector } : {}),
|
|
2474
|
+
...(factToolScoped ? { toolScoped: true as const } : {}),
|
|
2460
2475
|
});
|
|
2461
2476
|
}
|
|
2462
2477
|
// v8.2: graph edge building for chunked memories. #1576: skip pending_review.
|
|
@@ -2598,6 +2613,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2598
2613
|
// #1909: defer the per-fact index flush to the batch save only when
|
|
2599
2614
|
// fact dedup is on (the batch saver is a no-op otherwise).
|
|
2600
2615
|
deferHashIndexSave: factDedupEnabled,
|
|
2616
|
+
...(factToolScoped ? { toolScoped: true as const } : {}),
|
|
2601
2617
|
});
|
|
2602
2618
|
const memoryId = factWrite.id;
|
|
2603
2619
|
// #1645: surface the tombstone block; gate active post-write paths like #1576
|
|
@@ -2762,6 +2778,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2762
2778
|
intentActionType: inferredIntent?.actionType,
|
|
2763
2779
|
intentEntityTypes: inferredIntent?.entityTypes,
|
|
2764
2780
|
...(extractionSourceConnector ? { sourceConnector: extractionSourceConnector } : {}),
|
|
2781
|
+
...(factToolScoped ? { toolScoped: true as const } : {}),
|
|
2765
2782
|
});
|
|
2766
2783
|
}
|
|
2767
2784
|
// Register in the target storage content-hash index after successful
|