@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
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { ExternalWikiCollectionRoot, ExternalWikiCollectionStatus } from "./external-wiki-collection.js";
|
|
2
|
+
import type { SearchExecutionOptions } from "./search/port.js";
|
|
3
|
+
|
|
4
|
+
export interface ExternalWikiCollectionRefreshTarget {
|
|
5
|
+
refresh(
|
|
6
|
+
roots: readonly ExternalWikiCollectionRoot[],
|
|
7
|
+
execution?: SearchExecutionOptions
|
|
8
|
+
): Promise<ExternalWikiCollectionStatus[]>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ExternalWikiCollectionTimers {
|
|
12
|
+
schedule(callback: () => void, intervalMs: number): object;
|
|
13
|
+
cancel(handle: object): void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ExternalWikiCollectionRegistrarOptions {
|
|
17
|
+
target: ExternalWikiCollectionRefreshTarget;
|
|
18
|
+
getRoots: () => readonly ExternalWikiCollectionRoot[];
|
|
19
|
+
intervalMs: number;
|
|
20
|
+
timers?: ExternalWikiCollectionTimers;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const defaultTimers: ExternalWikiCollectionTimers = {
|
|
24
|
+
schedule(callback, intervalMs) {
|
|
25
|
+
const handle = setInterval(callback, intervalMs);
|
|
26
|
+
handle.unref();
|
|
27
|
+
return handle;
|
|
28
|
+
},
|
|
29
|
+
cancel(handle) {
|
|
30
|
+
clearInterval(handle as NodeJS.Timeout);
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export class ExternalWikiCollectionRegistrar {
|
|
35
|
+
private readonly timers: ExternalWikiCollectionTimers;
|
|
36
|
+
private timer: object | null = null;
|
|
37
|
+
private controller: AbortController | null = null;
|
|
38
|
+
private inFlight: Promise<void> | null = null;
|
|
39
|
+
private disposed = true;
|
|
40
|
+
private parentSignal: AbortSignal | null = null;
|
|
41
|
+
private parentAbortListener: (() => void) | null = null;
|
|
42
|
+
|
|
43
|
+
constructor(private readonly options: ExternalWikiCollectionRegistrarOptions) {
|
|
44
|
+
this.timers = options.timers ?? defaultTimers;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async register(signal?: AbortSignal): Promise<void> {
|
|
48
|
+
await this.dispose();
|
|
49
|
+
if (signal?.aborted) return;
|
|
50
|
+
|
|
51
|
+
this.disposed = false;
|
|
52
|
+
this.controller = new AbortController();
|
|
53
|
+
if (signal) {
|
|
54
|
+
this.parentSignal = signal;
|
|
55
|
+
this.parentAbortListener = () => this.controller?.abort();
|
|
56
|
+
signal.addEventListener("abort", this.parentAbortListener, { once: true });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
await this.refreshNow();
|
|
60
|
+
if (this.disposed || this.controller.signal.aborted) return;
|
|
61
|
+
this.timer = this.timers.schedule(() => {
|
|
62
|
+
void this.refreshNow().catch(() => undefined);
|
|
63
|
+
}, this.options.intervalMs);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async refreshNow(): Promise<void> {
|
|
67
|
+
if (this.disposed || this.controller?.signal.aborted) return;
|
|
68
|
+
if (this.inFlight) return this.inFlight;
|
|
69
|
+
|
|
70
|
+
const execution = this.controller ? { signal: this.controller.signal } : undefined;
|
|
71
|
+
const running = this.options.target.refresh(this.options.getRoots(), execution).then(() => undefined);
|
|
72
|
+
this.inFlight = running;
|
|
73
|
+
const clearInFlight = () => {
|
|
74
|
+
if (this.inFlight === running) this.inFlight = null;
|
|
75
|
+
};
|
|
76
|
+
void running.then(clearInFlight, clearInFlight);
|
|
77
|
+
return running;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async waitForIdle(): Promise<void> {
|
|
81
|
+
while (this.inFlight) {
|
|
82
|
+
await this.inFlight;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async dispose(): Promise<void> {
|
|
87
|
+
this.disposed = true;
|
|
88
|
+
if (this.timer) {
|
|
89
|
+
this.timers.cancel(this.timer);
|
|
90
|
+
this.timer = null;
|
|
91
|
+
}
|
|
92
|
+
this.controller?.abort();
|
|
93
|
+
if (this.parentSignal && this.parentAbortListener) {
|
|
94
|
+
this.parentSignal.removeEventListener("abort", this.parentAbortListener);
|
|
95
|
+
}
|
|
96
|
+
this.parentSignal = null;
|
|
97
|
+
this.parentAbortListener = null;
|
|
98
|
+
await this.waitForIdle();
|
|
99
|
+
this.controller = null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { mkdir, mkdtemp, rm, symlink, writeFile } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import test from "node:test";
|
|
6
|
+
import {
|
|
7
|
+
type ExternalWikiCollectionBackend,
|
|
8
|
+
ExternalWikiCollectionManager,
|
|
9
|
+
type ExternalWikiCollectionRoot,
|
|
10
|
+
externalWikiCollectionName,
|
|
11
|
+
} from "./external-wiki-collection.js";
|
|
12
|
+
import { NoopSearchBackend } from "./search/noop-backend.js";
|
|
13
|
+
import type { SearchResult } from "./search/port.js";
|
|
14
|
+
|
|
15
|
+
interface BackendFixture {
|
|
16
|
+
backend: ExternalWikiCollectionBackend;
|
|
17
|
+
calls: string[];
|
|
18
|
+
results: SearchResult[];
|
|
19
|
+
collectionCounts: Map<string, number>;
|
|
20
|
+
collectionRoots: Map<string, string>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function makeBackendFixture(overrides: Partial<ExternalWikiCollectionBackend> = {}): BackendFixture {
|
|
24
|
+
const calls: string[] = [];
|
|
25
|
+
const results: SearchResult[] = [];
|
|
26
|
+
const collectionCounts = new Map<string, number>([["memories", 7]]);
|
|
27
|
+
const collectionRoots = new Map<string, string>();
|
|
28
|
+
const backend: ExternalWikiCollectionBackend = {
|
|
29
|
+
supportsAdditionalCollections: () => true,
|
|
30
|
+
ensureCollection: async (rootDir, collection) => {
|
|
31
|
+
calls.push(`ensure:${collection}:${rootDir}`);
|
|
32
|
+
if (!collectionRoots.has(collection)) {
|
|
33
|
+
collectionCounts.set(collection, 1);
|
|
34
|
+
collectionRoots.set(collection, rootDir);
|
|
35
|
+
}
|
|
36
|
+
return "present";
|
|
37
|
+
},
|
|
38
|
+
excludeCollectionFromGlobalSearch: async (collection) => {
|
|
39
|
+
calls.push(`exclude:${collection}`);
|
|
40
|
+
},
|
|
41
|
+
updateCollectionStrict: async (collection) => {
|
|
42
|
+
calls.push(`update:${collection}`);
|
|
43
|
+
},
|
|
44
|
+
embedCollection: async (collection) => {
|
|
45
|
+
calls.push(`embed:${collection}`);
|
|
46
|
+
},
|
|
47
|
+
embedCollectionStrict: async (collection) => {
|
|
48
|
+
calls.push(`embed:${collection}`);
|
|
49
|
+
},
|
|
50
|
+
hybridSearch: async (_query, collection) => {
|
|
51
|
+
calls.push(`search:${collection}`);
|
|
52
|
+
return results;
|
|
53
|
+
},
|
|
54
|
+
collectionRoot: async (collection) => collectionRoots.get(collection) ?? null,
|
|
55
|
+
deleteCollection: async (collection) => {
|
|
56
|
+
calls.push(`delete:${collection}`);
|
|
57
|
+
collectionCounts.delete(collection);
|
|
58
|
+
collectionRoots.delete(collection);
|
|
59
|
+
return true;
|
|
60
|
+
},
|
|
61
|
+
collectionStatus: async (collection) => ({
|
|
62
|
+
totalFiles: collectionCounts.get(collection) ?? null,
|
|
63
|
+
}),
|
|
64
|
+
};
|
|
65
|
+
Object.assign(backend, overrides);
|
|
66
|
+
return { backend, calls, results, collectionCounts, collectionRoots };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function makeWiki(): Promise<{ rootDir: string; pagesDir: string }> {
|
|
70
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "remnic-external-wiki-"));
|
|
71
|
+
const pagesDir = path.join(rootDir, "wiki");
|
|
72
|
+
await mkdir(pagesDir);
|
|
73
|
+
await mkdir(path.join(rootDir, "raw"));
|
|
74
|
+
await writeFile(path.join(pagesDir, "retrieval.md"), "# Retrieval\n\nMeaning before exact words.\n", "utf8");
|
|
75
|
+
await writeFile(path.join(rootDir, "raw", "capture.md"), "raw source", "utf8");
|
|
76
|
+
return { rootDir, pagesDir };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function root(rootDir: string, overrides: Partial<ExternalWikiCollectionRoot> = {}): ExternalWikiCollectionRoot {
|
|
80
|
+
return {
|
|
81
|
+
id: "reading",
|
|
82
|
+
rootDir,
|
|
83
|
+
enabled: true,
|
|
84
|
+
pagesDir: "wiki",
|
|
85
|
+
indexInQmd: true,
|
|
86
|
+
...overrides,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
test("external wiki collection names are dedicated and predictable", () => {
|
|
91
|
+
assert.equal(externalWikiCollectionName("Reading Notes"), "external-wiki-reading-notes");
|
|
92
|
+
assert.throws(() => externalWikiCollectionName("---"), /usable characters/i);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test("wiki ids that sanitize to the same collection are rejected together", async () => {
|
|
96
|
+
const wiki = await makeWiki();
|
|
97
|
+
try {
|
|
98
|
+
const fixture = makeBackendFixture();
|
|
99
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
100
|
+
|
|
101
|
+
const statuses = await manager.refresh([
|
|
102
|
+
root(wiki.rootDir, { id: "Reading Notes" }),
|
|
103
|
+
root(wiki.rootDir, { id: "reading-notes" }),
|
|
104
|
+
]);
|
|
105
|
+
|
|
106
|
+
assert.deepEqual(
|
|
107
|
+
statuses.map((status) => status.state),
|
|
108
|
+
["error", "error"]
|
|
109
|
+
);
|
|
110
|
+
assert.ok(statuses.every((status) => status.lastError?.includes("same dedicated collection")));
|
|
111
|
+
assert.deepEqual(fixture.calls, []);
|
|
112
|
+
} finally {
|
|
113
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
test("opt-in indexing targets only pagesDir and preserves the default collection", async () => {
|
|
118
|
+
const wiki = await makeWiki();
|
|
119
|
+
try {
|
|
120
|
+
const fixture = makeBackendFixture();
|
|
121
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
122
|
+
|
|
123
|
+
const statuses = await manager.refresh([root(wiki.rootDir)]);
|
|
124
|
+
|
|
125
|
+
assert.deepEqual(fixture.calls, [
|
|
126
|
+
`ensure:external-wiki-reading:${wiki.pagesDir}`,
|
|
127
|
+
"exclude:external-wiki-reading",
|
|
128
|
+
"update:external-wiki-reading",
|
|
129
|
+
"embed:external-wiki-reading",
|
|
130
|
+
]);
|
|
131
|
+
assert.equal(fixture.collectionCounts.get("memories"), 7);
|
|
132
|
+
assert.equal(statuses[0]?.collection, "external-wiki-reading");
|
|
133
|
+
assert.equal(statuses[0]?.documentCount, 1);
|
|
134
|
+
assert.equal(statuses[0]?.state, "healthy");
|
|
135
|
+
assert.ok(statuses[0]?.lastIndexedAt);
|
|
136
|
+
} finally {
|
|
137
|
+
|
|
138
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
test("changing a wiki pages root rebinds its existing collection", async () => {
|
|
142
|
+
const firstWiki = await makeWiki();
|
|
143
|
+
const secondWiki = await makeWiki();
|
|
144
|
+
try {
|
|
145
|
+
const fixture = makeBackendFixture();
|
|
146
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
147
|
+
await manager.refresh([root(firstWiki.rootDir)]);
|
|
148
|
+
fixture.calls.length = 0;
|
|
149
|
+
|
|
150
|
+
const statuses = await manager.refresh([root(secondWiki.rootDir)]);
|
|
151
|
+
|
|
152
|
+
assert.equal(statuses[0]?.state, "healthy");
|
|
153
|
+
assert.deepEqual(fixture.calls, [
|
|
154
|
+
`ensure:external-wiki-reading:${secondWiki.pagesDir}`,
|
|
155
|
+
"delete:external-wiki-reading",
|
|
156
|
+
`ensure:external-wiki-reading:${secondWiki.pagesDir}`,
|
|
157
|
+
"exclude:external-wiki-reading",
|
|
158
|
+
"update:external-wiki-reading",
|
|
159
|
+
"embed:external-wiki-reading",
|
|
160
|
+
]);
|
|
161
|
+
assert.equal(fixture.collectionRoots.get("external-wiki-reading"), secondWiki.pagesDir);
|
|
162
|
+
} finally {
|
|
163
|
+
await rm(firstWiki.rootDir, { recursive: true, force: true });
|
|
164
|
+
await rm(secondWiki.rootDir, { recursive: true, force: true });
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
test("unchanged pages skip work and changed pages trigger an incremental refresh", async () => {
|
|
169
|
+
const wiki = await makeWiki();
|
|
170
|
+
try {
|
|
171
|
+
const fixture = makeBackendFixture();
|
|
172
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
173
|
+
const configuredRoot = root(wiki.rootDir);
|
|
174
|
+
await manager.refresh([configuredRoot]);
|
|
175
|
+
fixture.calls.length = 0;
|
|
176
|
+
|
|
177
|
+
await manager.refresh([configuredRoot]);
|
|
178
|
+
assert.deepEqual(fixture.calls, []);
|
|
179
|
+
|
|
180
|
+
await writeFile(
|
|
181
|
+
path.join(wiki.pagesDir, "retrieval.md"),
|
|
182
|
+
"# Retrieval\n\nMeaning survives a paraphrase and a changed page.\n",
|
|
183
|
+
"utf8"
|
|
184
|
+
);
|
|
185
|
+
await manager.refresh([configuredRoot]);
|
|
186
|
+
|
|
187
|
+
assert.deepEqual(fixture.calls, [
|
|
188
|
+
`ensure:external-wiki-reading:${wiki.pagesDir}`,
|
|
189
|
+
"exclude:external-wiki-reading",
|
|
190
|
+
"update:external-wiki-reading",
|
|
191
|
+
"embed:external-wiki-reading",
|
|
192
|
+
]);
|
|
193
|
+
} finally {
|
|
194
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
test("pagesDir cannot escape the configured wiki root", async () => {
|
|
199
|
+
const wiki = await makeWiki();
|
|
200
|
+
try {
|
|
201
|
+
const fixture = makeBackendFixture();
|
|
202
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
203
|
+
|
|
204
|
+
const statuses = await manager.refresh([root(wiki.rootDir, { pagesDir: "../raw" })]);
|
|
205
|
+
|
|
206
|
+
assert.equal(statuses[0]?.state, "error");
|
|
207
|
+
assert.match(statuses[0]?.lastError ?? "", /pagesDir must stay inside/i);
|
|
208
|
+
assert.deepEqual(fixture.calls, []);
|
|
209
|
+
} finally {
|
|
210
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
test("pagesDir symlinks cannot escape the configured wiki root", async () => {
|
|
215
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "remnic-external-wiki-root-"));
|
|
216
|
+
const outsideDir = await mkdtemp(path.join(os.tmpdir(), "remnic-external-wiki-outside-"));
|
|
217
|
+
try {
|
|
218
|
+
await writeFile(path.join(outsideDir, "outside.md"), "# Outside", "utf8");
|
|
219
|
+
await symlink(outsideDir, path.join(rootDir, "wiki"), "dir");
|
|
220
|
+
const fixture = makeBackendFixture();
|
|
221
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
222
|
+
|
|
223
|
+
const statuses = await manager.refresh([root(rootDir)]);
|
|
224
|
+
|
|
225
|
+
assert.equal(statuses[0]?.state, "error");
|
|
226
|
+
assert.match(statuses[0]?.lastError ?? "", /pagesDir must stay inside/i);
|
|
227
|
+
assert.deepEqual(fixture.calls, []);
|
|
228
|
+
} finally {
|
|
229
|
+
await rm(rootDir, { recursive: true, force: true });
|
|
230
|
+
await rm(outsideDir, { recursive: true, force: true });
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
test("default-off and disabled roots never touch the search backend", async () => {
|
|
235
|
+
const wiki = await makeWiki();
|
|
236
|
+
try {
|
|
237
|
+
const fixture = makeBackendFixture();
|
|
238
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
239
|
+
|
|
240
|
+
const statuses = await manager.refresh([
|
|
241
|
+
root(wiki.rootDir, { id: "off", indexInQmd: false }),
|
|
242
|
+
root(wiki.rootDir, { id: "disabled", enabled: false }),
|
|
243
|
+
]);
|
|
244
|
+
|
|
245
|
+
assert.deepEqual(fixture.calls, []);
|
|
246
|
+
assert.deepEqual(
|
|
247
|
+
statuses.map((status) => status.state),
|
|
248
|
+
["disabled", "disabled"]
|
|
249
|
+
);
|
|
250
|
+
} finally {
|
|
251
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
test("unsupported extra collections report a clear error and search fails open", async () => {
|
|
256
|
+
const wiki = await makeWiki();
|
|
257
|
+
try {
|
|
258
|
+
const fixture = makeBackendFixture({ supportsAdditionalCollections: () => false });
|
|
259
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
260
|
+
|
|
261
|
+
const statuses = await manager.refresh([root(wiki.rootDir)]);
|
|
262
|
+
const results = await manager.search("reading", "ideas expressed with different words", 5);
|
|
263
|
+
|
|
264
|
+
assert.equal(statuses[0]?.state, "error");
|
|
265
|
+
assert.match(statuses[0]?.lastError ?? "", /does not support dedicated external wiki collections/i);
|
|
266
|
+
assert.equal(results, null);
|
|
267
|
+
assert.deepEqual(fixture.calls, []);
|
|
268
|
+
} finally {
|
|
269
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
test("a backend with no additional-collection capability keeps indexing fail-open", async () => {
|
|
274
|
+
const wiki = await makeWiki();
|
|
275
|
+
try {
|
|
276
|
+
const manager = new ExternalWikiCollectionManager(new NoopSearchBackend(), "memories");
|
|
277
|
+
|
|
278
|
+
const statuses = await manager.refresh([root(wiki.rootDir)]);
|
|
279
|
+
|
|
280
|
+
assert.equal(statuses[0]?.state, "error");
|
|
281
|
+
assert.match(statuses[0]?.lastError ?? "", /does not support dedicated external wiki collections/i);
|
|
282
|
+
} finally {
|
|
283
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
test("healthy collection search uses hybrid retrieval and rejects results outside pagesDir", async () => {
|
|
288
|
+
const wiki = await makeWiki();
|
|
289
|
+
try {
|
|
290
|
+
const fixture = makeBackendFixture();
|
|
291
|
+
fixture.results.push(
|
|
292
|
+
{
|
|
293
|
+
docid: "retrieval",
|
|
294
|
+
path: path.join(wiki.pagesDir, "retrieval.md"),
|
|
295
|
+
snippet: "Meaning before exact words.",
|
|
296
|
+
score: 0.91,
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
docid: "raw-capture",
|
|
300
|
+
path: path.join(wiki.rootDir, "raw", "capture.md"),
|
|
301
|
+
|
|
302
|
+
snippet: "raw source",
|
|
303
|
+
score: 0.99,
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
307
|
+
await manager.refresh([root(wiki.rootDir)]);
|
|
308
|
+
|
|
309
|
+
const results = await manager.search("reading", "ideas expressed with different words", 5);
|
|
310
|
+
|
|
311
|
+
assert.deepEqual(
|
|
312
|
+
results?.map((result) => result.docid),
|
|
313
|
+
["retrieval"]
|
|
314
|
+
);
|
|
315
|
+
assert.equal(fixture.calls.at(-1), "search:external-wiki-reading");
|
|
316
|
+
} finally {
|
|
317
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
test("failed global exclusion rolls back the collection before reporting an error", async () => {
|
|
321
|
+
const wiki = await makeWiki();
|
|
322
|
+
try {
|
|
323
|
+
const fixture = makeBackendFixture({
|
|
324
|
+
excludeCollectionFromGlobalSearch: async () => {
|
|
325
|
+
throw new Error("exclude failed");
|
|
326
|
+
},
|
|
327
|
+
});
|
|
328
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
329
|
+
|
|
330
|
+
const statuses = await manager.refresh([root(wiki.rootDir)]);
|
|
331
|
+
|
|
332
|
+
assert.equal(statuses[0]?.state, "error");
|
|
333
|
+
assert.equal(fixture.collectionRoots.has("external-wiki-reading"), false);
|
|
334
|
+
assert.equal(fixture.calls.at(-1), "delete:external-wiki-reading");
|
|
335
|
+
} finally {
|
|
336
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
test("degraded hybrid search marks the collection unhealthy and falls back", async () => {
|
|
341
|
+
const wiki = await makeWiki();
|
|
342
|
+
try {
|
|
343
|
+
const fixture = makeBackendFixture({
|
|
344
|
+
hybridSearch: async (_query, _collection, _limit, execution) => {
|
|
345
|
+
execution?.onDegradation?.({
|
|
346
|
+
backend: "qmd",
|
|
347
|
+
code: "backend_unavailable",
|
|
348
|
+
});
|
|
349
|
+
return [];
|
|
350
|
+
},
|
|
351
|
+
});
|
|
352
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
353
|
+
await manager.refresh([root(wiki.rootDir)]);
|
|
354
|
+
|
|
355
|
+
const results = await manager.search("reading", "paraphrase", 5);
|
|
356
|
+
|
|
357
|
+
assert.equal(results, null);
|
|
358
|
+
assert.equal(manager.statuses()[0]?.state, "error");
|
|
359
|
+
assert.match(manager.statuses()[0]?.lastError ?? "", /search degraded/i);
|
|
360
|
+
} finally {
|
|
361
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
test("a collection name collision with primary memory is refused", async () => {
|
|
366
|
+
const wiki = await makeWiki();
|
|
367
|
+
try {
|
|
368
|
+
const fixture = makeBackendFixture();
|
|
369
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "external-wiki-reading");
|
|
370
|
+
|
|
371
|
+
const statuses = await manager.refresh([root(wiki.rootDir)]);
|
|
372
|
+
|
|
373
|
+
assert.equal(statuses[0]?.state, "error");
|
|
374
|
+
assert.match(statuses[0]?.lastError ?? "", /default memory collection/i);
|
|
375
|
+
assert.deepEqual(fixture.calls, []);
|
|
376
|
+
} finally {
|
|
377
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
test("concurrent config refreshes serialize so disable wins after enable", async () => {
|
|
382
|
+
const wiki = await makeWiki();
|
|
383
|
+
try {
|
|
384
|
+
let releaseEnsure!: () => void;
|
|
385
|
+
const blockedEnsure = new Promise<void>((resolve) => {
|
|
386
|
+
releaseEnsure = resolve;
|
|
387
|
+
});
|
|
388
|
+
let signalEnsureStarted!: () => void;
|
|
389
|
+
const ensureStarted = new Promise<void>((resolve) => {
|
|
390
|
+
signalEnsureStarted = resolve;
|
|
391
|
+
});
|
|
392
|
+
const fixture = makeBackendFixture({
|
|
393
|
+
ensureCollection: async (pagesDir, collection) => {
|
|
394
|
+
fixture.calls.push(`ensure:${collection}:${pagesDir}`);
|
|
395
|
+
signalEnsureStarted();
|
|
396
|
+
await blockedEnsure;
|
|
397
|
+
fixture.collectionCounts.set(collection, 1);
|
|
398
|
+
return "present";
|
|
399
|
+
},
|
|
400
|
+
});
|
|
401
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
402
|
+
|
|
403
|
+
const enabling = manager.refresh([root(wiki.rootDir)]);
|
|
404
|
+
await ensureStarted;
|
|
405
|
+
const disabling = manager.refresh([root(wiki.rootDir, { indexInQmd: false })]);
|
|
406
|
+
releaseEnsure();
|
|
407
|
+
await enabling;
|
|
408
|
+
const disabledStatuses = await disabling;
|
|
409
|
+
|
|
410
|
+
assert.equal(disabledStatuses[0]?.state, "disabled");
|
|
411
|
+
assert.equal(manager.statuses()[0]?.state, "disabled");
|
|
412
|
+
assert.equal(fixture.calls.at(-1), "delete:external-wiki-reading");
|
|
413
|
+
} finally {
|
|
414
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
test("purge serializes behind an in-flight refresh", async () => {
|
|
419
|
+
const wiki = await makeWiki();
|
|
420
|
+
try {
|
|
421
|
+
let releaseEnsure!: () => void;
|
|
422
|
+
const blockedEnsure = new Promise<void>((resolve) => {
|
|
423
|
+
releaseEnsure = resolve;
|
|
424
|
+
});
|
|
425
|
+
let signalEnsureStarted!: () => void;
|
|
426
|
+
const ensureStarted = new Promise<void>((resolve) => {
|
|
427
|
+
signalEnsureStarted = resolve;
|
|
428
|
+
});
|
|
429
|
+
const fixture = makeBackendFixture({
|
|
430
|
+
ensureCollection: async (pagesDir, collection) => {
|
|
431
|
+
fixture.calls.push(`ensure:${collection}:${pagesDir}`);
|
|
432
|
+
signalEnsureStarted();
|
|
433
|
+
await blockedEnsure;
|
|
434
|
+
fixture.collectionCounts.set(collection, 1);
|
|
435
|
+
return "present";
|
|
436
|
+
},
|
|
437
|
+
});
|
|
438
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
439
|
+
|
|
440
|
+
const indexing = manager.refresh([root(wiki.rootDir)]);
|
|
441
|
+
await ensureStarted;
|
|
442
|
+
const purging = manager.purge("reading");
|
|
443
|
+
releaseEnsure();
|
|
444
|
+
await indexing;
|
|
445
|
+
assert.equal(await purging, true);
|
|
446
|
+
|
|
447
|
+
assert.deepEqual(manager.statuses(), []);
|
|
448
|
+
assert.equal(fixture.calls.at(-1), "delete:external-wiki-reading");
|
|
449
|
+
} finally {
|
|
450
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
test("a removed collection delete failure does not abort remaining wiki refreshes", async () => {
|
|
455
|
+
const wiki = await makeWiki();
|
|
456
|
+
try {
|
|
457
|
+
const fixture = makeBackendFixture({
|
|
458
|
+
deleteCollection: async (collection) => {
|
|
459
|
+
if (collection === "external-wiki-first") throw new Error("delete failed");
|
|
460
|
+
return true;
|
|
461
|
+
},
|
|
462
|
+
});
|
|
463
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
464
|
+
await manager.refresh([root(wiki.rootDir, { id: "first" }), root(wiki.rootDir, { id: "second" })]);
|
|
465
|
+
|
|
466
|
+
const statuses = await manager.refresh([root(wiki.rootDir, { id: "second" })]);
|
|
467
|
+
|
|
468
|
+
assert.equal(statuses[0]?.wikiId, "second");
|
|
469
|
+
assert.equal(statuses[0]?.state, "healthy");
|
|
470
|
+
assert.equal(manager.statuses().find((status) => status.wikiId === "first")?.state, "error");
|
|
471
|
+
} finally {
|
|
472
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
test("turning indexing off removes a collection managed by this process", async () => {
|
|
477
|
+
const wiki = await makeWiki();
|
|
478
|
+
try {
|
|
479
|
+
const fixture = makeBackendFixture();
|
|
480
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
481
|
+
await manager.refresh([root(wiki.rootDir)]);
|
|
482
|
+
fixture.calls.length = 0;
|
|
483
|
+
|
|
484
|
+
const statuses = await manager.refresh([root(wiki.rootDir, { indexInQmd: false })]);
|
|
485
|
+
|
|
486
|
+
assert.deepEqual(fixture.calls, ["delete:external-wiki-reading"]);
|
|
487
|
+
assert.equal(statuses[0]?.state, "disabled");
|
|
488
|
+
} finally {
|
|
489
|
+
await rm(wiki.rootDir, { recursive: true, force: true });
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
test("purge deletes a predictable dedicated collection without touching memory", async () => {
|
|
494
|
+
const fixture = makeBackendFixture();
|
|
495
|
+
const manager = new ExternalWikiCollectionManager(fixture.backend, "memories");
|
|
496
|
+
|
|
497
|
+
const removed = await manager.purge("reading");
|
|
498
|
+
|
|
499
|
+
assert.equal(removed, true);
|
|
500
|
+
assert.deepEqual(fixture.calls, ["delete:external-wiki-reading"]);
|
|
501
|
+
assert.equal(fixture.collectionCounts.get("memories"), 7);
|
|
502
|
+
});
|