@remnic/core 1.0.3 → 1.1.1
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 +32 -0
- package/dist/abort-error.js +11 -0
- package/dist/access-audit.d.ts +56 -0
- package/dist/access-audit.js +9 -0
- package/dist/access-audit.js.map +1 -0
- package/dist/access-cli.js +72 -54
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +16 -8
- package/dist/access-http.js +25 -17
- package/dist/access-mcp.d.ts +16 -8
- package/dist/access-mcp.js +28 -6
- package/dist/access-schema.d.ts +130 -39
- package/dist/access-schema.js +5 -1
- package/dist/access-service-Br8ZydTK.d.ts +827 -0
- package/dist/access-service.d.ts +20 -660
- package/dist/access-service.js +22 -14
- package/dist/bootstrap.d.ts +6 -3
- package/dist/briefing.d.ts +1 -0
- package/dist/briefing.js +6 -5
- package/dist/buffer-surprise-report.d.ts +70 -0
- package/dist/buffer-surprise-report.js +7 -0
- package/dist/buffer-surprise-report.js.map +1 -0
- package/dist/buffer-surprise.d.ts +98 -0
- package/dist/buffer-surprise.js +11 -0
- package/dist/buffer-surprise.js.map +1 -0
- package/dist/buffer.d.ts +100 -2
- package/dist/buffer.js +1 -1
- package/dist/calibration.js +5 -5
- package/dist/causal-behavior.js +4 -4
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.js +17 -16
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +4 -4
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-QNJMBKFK.js → chunk-2LGMW3DJ.js} +3 -2
- package/dist/chunk-2LGMW3DJ.js.map +1 -0
- package/dist/{chunk-QDYXG4CS.js → chunk-3FPTCC3Z.js} +4 -3
- package/dist/chunk-3FPTCC3Z.js.map +1 -0
- package/dist/chunk-3GPTTA4J.js +57 -0
- package/dist/chunk-3GPTTA4J.js.map +1 -0
- package/dist/{chunk-QKAH5B6E.js → chunk-3GXCSUXR.js} +94 -6
- package/dist/chunk-3GXCSUXR.js.map +1 -0
- package/dist/{chunk-POBPGDWI.js → chunk-3OGMS3PE.js} +2 -2
- package/dist/chunk-54V4BZWP.js +139 -0
- package/dist/chunk-54V4BZWP.js.map +1 -0
- package/dist/chunk-5JRF2PZA.js +67 -0
- package/dist/chunk-5JRF2PZA.js.map +1 -0
- package/dist/chunk-64NJRYU2.js +332 -0
- package/dist/chunk-64NJRYU2.js.map +1 -0
- package/dist/chunk-6AUUAZEX.js +150 -0
- package/dist/chunk-6AUUAZEX.js.map +1 -0
- package/dist/{chunk-HITJFT7E.js → chunk-7I7FKFZH.js} +28 -21
- package/dist/chunk-7I7FKFZH.js.map +1 -0
- package/dist/chunk-AJU4PJGY.js +126 -0
- package/dist/chunk-AJU4PJGY.js.map +1 -0
- package/dist/chunk-ASAITVLA.js +64 -0
- package/dist/chunk-ASAITVLA.js.map +1 -0
- package/dist/{chunk-X4WESCKA.js → chunk-B5WXLVDY.js} +187 -6
- package/dist/chunk-B5WXLVDY.js.map +1 -0
- package/dist/{chunk-RCICHSHL.js → chunk-BGJGXLZ7.js} +111 -2
- package/dist/{chunk-RCICHSHL.js.map → chunk-BGJGXLZ7.js.map} +1 -1
- package/dist/{chunk-OJFGVJS6.js → chunk-BK2EFTE2.js} +319 -18
- package/dist/chunk-BK2EFTE2.js.map +1 -0
- package/dist/chunk-C4SQJZAF.js +486 -0
- package/dist/chunk-C4SQJZAF.js.map +1 -0
- package/dist/{chunk-GJQPH5G3.js → chunk-CUPFXL3J.js} +2 -2
- package/dist/chunk-DF3RVK3X.js +119 -0
- package/dist/chunk-DF3RVK3X.js.map +1 -0
- package/dist/{chunk-PMB3WGDL.js → chunk-DFTTJYSO.js} +167 -7
- package/dist/chunk-DFTTJYSO.js.map +1 -0
- package/dist/chunk-DGVM5SFL.js +69 -0
- package/dist/chunk-DGVM5SFL.js.map +1 -0
- package/dist/chunk-EIR5VLIH.js +90 -0
- package/dist/chunk-EIR5VLIH.js.map +1 -0
- package/dist/{chunk-PAORGQRI.js → chunk-EPQJM2GC.js} +37 -23
- package/dist/chunk-EPQJM2GC.js.map +1 -0
- package/dist/{chunk-POMSFKTB.js → chunk-F5VP6YCB.js} +368 -10
- package/dist/chunk-F5VP6YCB.js.map +1 -0
- package/dist/{chunk-6ZH4TU6I.js → chunk-FAAFWE4G.js} +2 -1
- package/dist/chunk-FAAFWE4G.js.map +1 -0
- package/dist/{chunk-74JR4N5J.js → chunk-FVA6TGI3.js} +2 -2
- package/dist/chunk-GDFS42HT.js +206 -0
- package/dist/chunk-GDFS42HT.js.map +1 -0
- package/dist/{chunk-BKQJBXXX.js → chunk-GGD5W7TB.js} +2 -2
- package/dist/chunk-GGD5W7TB.js.map +1 -0
- package/dist/{chunk-V7XCAHIB.js → chunk-GKFXUTJ2.js} +508 -26
- package/dist/chunk-GKFXUTJ2.js.map +1 -0
- package/dist/{chunk-NSB3WSYS.js → chunk-HK3FGIEW.js} +278 -3
- package/dist/chunk-HK3FGIEW.js.map +1 -0
- package/dist/{chunk-AAI7JARD.js → chunk-HMDCOMYU.js} +8 -11
- package/dist/chunk-HMDCOMYU.js.map +1 -0
- package/dist/chunk-IISBCCWR.js +52 -0
- package/dist/chunk-IISBCCWR.js.map +1 -0
- package/dist/{chunk-YFYL2SIJ.js → chunk-INXV5JBT.js} +290 -46
- package/dist/chunk-INXV5JBT.js.map +1 -0
- package/dist/chunk-JBMSGZEQ.js +441 -0
- package/dist/chunk-JBMSGZEQ.js.map +1 -0
- package/dist/{chunk-UPMD5XND.js → chunk-JL2PU6AI.js} +16 -5
- package/dist/chunk-JL2PU6AI.js.map +1 -0
- package/dist/{chunk-J4IYOZZ5.js → chunk-JXS5PDQ7.js} +3 -1
- package/dist/chunk-JXS5PDQ7.js.map +1 -0
- package/dist/{chunk-AYPYCLR7.js → chunk-KUB6JU6H.js} +4 -4
- package/dist/chunk-KVBLZUKV.js +173 -0
- package/dist/chunk-KVBLZUKV.js.map +1 -0
- package/dist/chunk-LBLXEFWK.js +51 -0
- package/dist/chunk-LBLXEFWK.js.map +1 -0
- package/dist/{chunk-U2IQTSBY.js → chunk-LTCGGW2D.js} +1 -1
- package/dist/chunk-LTCGGW2D.js.map +1 -0
- package/dist/{chunk-UEYA6UC7.js → chunk-NZLQTHS5.js} +25 -2
- package/dist/chunk-NZLQTHS5.js.map +1 -0
- package/dist/chunk-PVGDJXVK.js +21 -0
- package/dist/chunk-PVGDJXVK.js.map +1 -0
- package/dist/chunk-PVPWZSSI.js +37 -0
- package/dist/chunk-PVPWZSSI.js.map +1 -0
- package/dist/{chunk-4NRAJUDS.js → chunk-RBBWYEFJ.js} +1 -1
- package/dist/chunk-RFYAYKTD.js +146 -0
- package/dist/chunk-RFYAYKTD.js.map +1 -0
- package/dist/{chunk-JROGC36Y.js → chunk-RGLL5SPU.js} +2 -2
- package/dist/{chunk-2VFW5K5U.js → chunk-S3EEFKNY.js} +103 -65
- package/dist/chunk-S3EEFKNY.js.map +1 -0
- package/dist/chunk-SOBJ6NEY.js +18 -0
- package/dist/chunk-SOBJ6NEY.js.map +1 -0
- package/dist/{chunk-MYQWXITD.js → chunk-SPI27QT6.js} +2 -2
- package/dist/chunk-TVVEYCNW.js +65 -0
- package/dist/chunk-TVVEYCNW.js.map +1 -0
- package/dist/chunk-ULYOGL6R.js +322 -0
- package/dist/chunk-ULYOGL6R.js.map +1 -0
- package/dist/{chunk-S4LX5EBI.js → chunk-VBVG2M5G.js} +64 -10
- package/dist/chunk-VBVG2M5G.js.map +1 -0
- package/dist/{chunk-KWP7T3DP.js → chunk-VDX363PS.js} +2 -2
- package/dist/{chunk-XMGSSBFX.js → chunk-VYM3VWOF.js} +1560 -244
- package/dist/chunk-VYM3VWOF.js.map +1 -0
- package/dist/{chunk-MTLYEMJB.js → chunk-WCLICCGB.js} +18 -3
- package/dist/chunk-WCLICCGB.js.map +1 -0
- package/dist/{chunk-ECKDIK5F.js → chunk-WVVA7F5A.js} +2 -2
- package/dist/chunk-X6GF3FX2.js +26 -0
- package/dist/chunk-X6GF3FX2.js.map +1 -0
- package/dist/{chunk-3QFQGRHO.js → chunk-XMHBH5H6.js} +4 -4
- package/dist/{chunk-KEG4GNGI.js → chunk-XZ2TIKGC.js} +38 -8
- package/dist/chunk-XZ2TIKGC.js.map +1 -0
- package/dist/chunk-Y4FHOFJ2.js +140 -0
- package/dist/chunk-Y4FHOFJ2.js.map +1 -0
- package/dist/chunk-YNB73F22.js +137 -0
- package/dist/chunk-YNB73F22.js.map +1 -0
- package/dist/{chunk-7PA4OZEU.js → chunk-YNQKWQT4.js} +55 -30
- package/dist/chunk-YNQKWQT4.js.map +1 -0
- package/dist/chunk-ZAIM4TUE.js +488 -0
- package/dist/chunk-ZAIM4TUE.js.map +1 -0
- package/dist/{chunk-BTY5RRRF.js → chunk-ZEM3OK2K.js} +5 -5
- package/dist/chunk-ZZTOURJI.js +91 -0
- package/dist/chunk-ZZTOURJI.js.map +1 -0
- package/dist/{cli-DwIBnp2g.d.ts → cli-BkeRaYfk.d.ts} +2 -2
- package/dist/cli.d.ts +13 -5
- package/dist/cli.js +45 -33
- package/dist/config.js +1 -1
- package/dist/consolidation-operator.d.ts +41 -0
- package/dist/consolidation-operator.js +11 -0
- package/dist/consolidation-operator.js.map +1 -0
- package/dist/consolidation-provenance-check.d.ts +68 -0
- package/dist/consolidation-provenance-check.js +9 -0
- package/dist/consolidation-provenance-check.js.map +1 -0
- package/dist/consolidation-undo.d.ts +123 -0
- package/dist/consolidation-undo.js +426 -0
- package/dist/consolidation-undo.js.map +1 -0
- package/dist/contradiction-review-WIUBAR52.js +21 -0
- package/dist/contradiction-review-WIUBAR52.js.map +1 -0
- package/dist/contradiction-scan-E3GJTI4F.js +412 -0
- package/dist/contradiction-scan-E3GJTI4F.js.map +1 -0
- package/dist/cross-namespace-budget.d.ts +133 -0
- package/dist/cross-namespace-budget.js +9 -0
- package/dist/cross-namespace-budget.js.map +1 -0
- package/dist/direct-answer-wiring.d.ts +77 -0
- package/dist/direct-answer-wiring.js +10 -0
- package/dist/direct-answer-wiring.js.map +1 -0
- package/dist/direct-answer.d.ts +106 -0
- package/dist/direct-answer.js +10 -0
- package/dist/direct-answer.js.map +1 -0
- package/dist/{engine-X7X3AAG3.js → engine-F3GOXGE5.js} +7 -6
- package/dist/engine-F3GOXGE5.js.map +1 -0
- package/dist/entity-retrieval.d.ts +1 -0
- package/dist/entity-retrieval.js +6 -5
- package/dist/explicit-capture.d.ts +6 -3
- package/dist/explicit-capture.js +2 -2
- package/dist/extraction-judge-telemetry.d.ts +113 -0
- package/dist/extraction-judge-telemetry.js +14 -0
- package/dist/extraction-judge-telemetry.js.map +1 -0
- package/dist/extraction-judge-training.d.ts +85 -0
- package/dist/extraction-judge-training.js +16 -0
- package/dist/extraction-judge-training.js.map +1 -0
- package/dist/extraction-judge.d.ts +124 -2
- package/dist/extraction-judge.js +11 -1
- package/dist/extraction.js +7 -6
- package/dist/fallback-llm.d.ts +11 -2
- package/dist/fallback-llm.js +2 -2
- package/dist/graph-recall.d.ts +100 -0
- package/dist/graph-recall.js +8 -0
- package/dist/graph-recall.js.map +1 -0
- package/dist/graph-retrieval.d.ts +271 -0
- package/dist/graph-retrieval.js +21 -0
- package/dist/graph-retrieval.js.map +1 -0
- package/dist/harmonic-retrieval.js +2 -1
- package/dist/importance.js +1 -1
- package/dist/index.d.ts +589 -138
- package/dist/index.js +531 -403
- package/dist/index.js.map +1 -1
- package/dist/intent.js +1 -1
- package/dist/local-llm.d.ts +10 -3
- package/dist/local-llm.js +1 -1
- package/dist/memory-worth-bench.d.ts +51 -0
- package/dist/memory-worth-bench.js +131 -0
- package/dist/memory-worth-bench.js.map +1 -0
- package/dist/memory-worth-filter.d.ts +128 -0
- package/dist/memory-worth-filter.js +10 -0
- package/dist/memory-worth-filter.js.map +1 -0
- package/dist/memory-worth-outcomes.d.ts +118 -0
- package/dist/memory-worth-outcomes.js +9 -0
- package/dist/memory-worth-outcomes.js.map +1 -0
- package/dist/memory-worth.d.ts +102 -0
- package/dist/memory-worth.js +7 -0
- package/dist/memory-worth.js.map +1 -0
- package/dist/operator-toolkit.d.ts +40 -1
- package/dist/operator-toolkit.js +24 -14
- package/dist/{orchestrator-B9kwlCep.d.ts → orchestrator-CmJ-NTdJ.d.ts} +254 -10
- package/dist/orchestrator.d.ts +6 -3
- package/dist/orchestrator.js +59 -48
- package/dist/page-versioning.d.ts +12 -1
- package/dist/page-versioning.js +5 -3
- package/dist/{port-C1GZFv8h.d.ts → port-BADbLZU5.d.ts} +2 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +5 -3
- package/dist/qmd.js +2 -1
- package/dist/reasoning-trace-recall.d.ts +90 -0
- package/dist/reasoning-trace-recall.js +13 -0
- package/dist/reasoning-trace-recall.js.map +1 -0
- package/dist/reasoning-trace-types.d.ts +54 -0
- package/dist/reasoning-trace-types.js +17 -0
- package/dist/reasoning-trace-types.js.map +1 -0
- package/dist/recall-audit-anomaly.d.ts +112 -0
- package/dist/recall-audit-anomaly.js +11 -0
- package/dist/recall-audit-anomaly.js.map +1 -0
- package/dist/recall-audit.js +5 -44
- package/dist/recall-audit.js.map +1 -1
- package/dist/recall-explain-renderer.d.ts +49 -0
- package/dist/recall-explain-renderer.js +18 -0
- package/dist/recall-explain-renderer.js.map +1 -0
- package/dist/recall-state.d.ts +39 -1
- package/dist/recall-state.js +1 -1
- package/dist/recall-xray-cli.d.ts +40 -0
- package/dist/recall-xray-cli.js +11 -0
- package/dist/recall-xray-cli.js.map +1 -0
- package/dist/recall-xray-renderer.d.ts +44 -0
- package/dist/recall-xray-renderer.js +18 -0
- package/dist/recall-xray-renderer.js.map +1 -0
- package/dist/recall-xray.d.ts +179 -0
- package/dist/recall-xray.js +13 -0
- package/dist/recall-xray.js.map +1 -0
- package/dist/resolution-QBTDHTG7.js +100 -0
- package/dist/resolution-QBTDHTG7.js.map +1 -0
- package/dist/resolve-provider-secret.d.ts +24 -1
- package/dist/resolve-provider-secret.js +3 -1
- package/dist/resume-bundles.js +6 -6
- package/dist/retrieval-agents.d.ts +1 -1
- package/dist/retrieval-tiers.d.ts +17 -0
- package/dist/retrieval-tiers.js +9 -0
- package/dist/retrieval-tiers.js.map +1 -0
- package/dist/schemas.d.ts +301 -45
- package/dist/schemas.js +1 -1
- package/dist/{semantic-consolidation-DrvSYRdB.d.ts → semantic-consolidation-CxJU6MJk.d.ts} +62 -1
- package/dist/semantic-consolidation.d.ts +2 -1
- package/dist/semantic-consolidation.js +20 -6
- package/dist/semantic-rule-promotion.js +6 -5
- package/dist/semantic-rule-verifier.js +6 -5
- package/dist/storage.d.ts +82 -1
- package/dist/storage.js +5 -4
- package/dist/summarizer.js +4 -4
- package/dist/temporal-supersession.d.ts +1 -0
- package/dist/tier-migration.d.ts +2 -1
- package/dist/types-DJhqDJUV.d.ts +50 -0
- package/dist/types.d.ts +309 -3
- package/dist/types.js +1 -1
- package/dist/verified-recall.js +6 -5
- package/package.json +1 -1
- package/dist/chunk-2VFW5K5U.js.map +0 -1
- package/dist/chunk-6ZH4TU6I.js.map +0 -1
- package/dist/chunk-7PA4OZEU.js.map +0 -1
- package/dist/chunk-AAI7JARD.js.map +0 -1
- package/dist/chunk-BKQJBXXX.js.map +0 -1
- package/dist/chunk-HITJFT7E.js.map +0 -1
- package/dist/chunk-J4IYOZZ5.js.map +0 -1
- package/dist/chunk-KEG4GNGI.js.map +0 -1
- package/dist/chunk-LAYN4LDC.js +0 -267
- package/dist/chunk-LAYN4LDC.js.map +0 -1
- package/dist/chunk-MTLYEMJB.js.map +0 -1
- package/dist/chunk-NSB3WSYS.js.map +0 -1
- package/dist/chunk-OJFGVJS6.js.map +0 -1
- package/dist/chunk-PAORGQRI.js.map +0 -1
- package/dist/chunk-PMB3WGDL.js.map +0 -1
- package/dist/chunk-POMSFKTB.js.map +0 -1
- package/dist/chunk-QDYXG4CS.js.map +0 -1
- package/dist/chunk-QKAH5B6E.js.map +0 -1
- package/dist/chunk-QNJMBKFK.js.map +0 -1
- package/dist/chunk-S4LX5EBI.js.map +0 -1
- package/dist/chunk-U2IQTSBY.js.map +0 -1
- package/dist/chunk-UEYA6UC7.js.map +0 -1
- package/dist/chunk-UPMD5XND.js.map +0 -1
- package/dist/chunk-UVJFDP7P.js +0 -202
- package/dist/chunk-UVJFDP7P.js.map +0 -1
- package/dist/chunk-V7XCAHIB.js.map +0 -1
- package/dist/chunk-X4WESCKA.js.map +0 -1
- package/dist/chunk-XMGSSBFX.js.map +0 -1
- package/dist/chunk-YFYL2SIJ.js.map +0 -1
- /package/dist/{engine-X7X3AAG3.js.map → abort-error.js.map} +0 -0
- /package/dist/{chunk-POBPGDWI.js.map → chunk-3OGMS3PE.js.map} +0 -0
- /package/dist/{chunk-GJQPH5G3.js.map → chunk-CUPFXL3J.js.map} +0 -0
- /package/dist/{chunk-74JR4N5J.js.map → chunk-FVA6TGI3.js.map} +0 -0
- /package/dist/{chunk-AYPYCLR7.js.map → chunk-KUB6JU6H.js.map} +0 -0
- /package/dist/{chunk-4NRAJUDS.js.map → chunk-RBBWYEFJ.js.map} +0 -0
- /package/dist/{chunk-JROGC36Y.js.map → chunk-RGLL5SPU.js.map} +0 -0
- /package/dist/{chunk-MYQWXITD.js.map → chunk-SPI27QT6.js.map} +0 -0
- /package/dist/{chunk-KWP7T3DP.js.map → chunk-VDX363PS.js.map} +0 -0
- /package/dist/{chunk-ECKDIK5F.js.map → chunk-WVVA7F5A.js.map} +0 -0
- /package/dist/{chunk-3QFQGRHO.js.map → chunk-XMHBH5H6.js.map} +0 -0
- /package/dist/{chunk-BTY5RRRF.js.map → chunk-ZEM3OK2K.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
export { LEGACY_PLUGIN_ID, PLUGIN_ID, resolveRemnicPluginEntry } from './plugin-id.js';
|
|
2
2
|
export { parseConfig } from './config.js';
|
|
3
|
-
import { f as BulkImportSourceAdapter } from './orchestrator-
|
|
4
|
-
export { g as BulkImportError, c as BulkImportOptions, d as BulkImportResult, B as BulkImportSource, h as ImportSourceRole,
|
|
3
|
+
import { f as BulkImportSourceAdapter, b as ImportTurn } from './orchestrator-CmJ-NTdJ.js';
|
|
4
|
+
export { g as BulkImportError, c as BulkImportOptions, d as BulkImportResult, B as BulkImportSource, h as ImportSourceRole, i as ImportTurnValidationIssue, O as Orchestrator, j as SemanticDedupDecision, k as SemanticDedupHit, S as SemanticDedupLookup, l as SemanticDedupOptions, m as decideSemanticDedup, n as defaultWorkspaceDir, o as isImportRole, p as parseIsoTimestamp, s as sanitizeSessionKeyForFilename, v as validateImportTurn } from './orchestrator-CmJ-NTdJ.js';
|
|
5
5
|
import { StorageManager } from './storage.js';
|
|
6
6
|
export { ExtractionEngine } from './extraction.js';
|
|
7
|
-
export {
|
|
7
|
+
export { BufferSurpriseProbe, SmartBuffer, TriggerDecision } from './buffer.js';
|
|
8
|
+
export { ComputeSurpriseOptions, DEFAULT_SURPRISE_K, RecentMemoryLike, computeSurprise } from './buffer-surprise.js';
|
|
9
|
+
export { BufferSurpriseDistribution, BufferSurpriseReader, BufferSurpriseReportOptions, reportBufferSurpriseDistribution } from './buffer-surprise-report.js';
|
|
10
|
+
import { PluginConfig, CodingContext, CodingModeConfig, MemoryFile, MemoryCategory, ImportanceLevel } from './types.js';
|
|
11
|
+
export { BriefingActiveThread, BriefingConfig, BriefingFocus, BriefingFollowup, BriefingOpenCommitment, BriefingRecentEntity, BriefingResult, BriefingSections, BriefingWindow, BufferSurpriseEvent, CalendarEvent, CalendarSource, CodexCompatConfig, ContinuityImprovementLoop, GatewayConfig, MemoryActionEligibilityContext, MemoryActionEligibilitySource, MemoryActionType } from './types.js';
|
|
12
|
+
export { JudgeBatchResult, JudgeCandidate, JudgeVerdict, JudgeVerdictKind, clearVerdictCache, createVerdictCache, getVerdictKind, isDurableVerdict, isValidCachedVerdict, judgeFactDurability, normalizeCachedVerdict, verdictCacheSize } from './extraction-judge.js';
|
|
8
13
|
export { hasBroadGraphIntent, inferIntentFromText, intentCompatibilityScore, isTaskInitiationIntent, planRecallMode } from './intent.js';
|
|
9
|
-
|
|
10
|
-
export {
|
|
14
|
+
export { a as EngramAccessInputError, E as EngramAccessService, P as ProcedureStatsConfigSnapshot, b as ProcedureStatsRecent, c as ProcedureStatsReport, d as ProcedureStatusCounts, e as computeProcedureStats, f as formatProcedureStatsText } from './access-service-Br8ZydTK.js';
|
|
15
|
+
export { FILTER_LABELS as DIRECT_ANSWER_FILTER_LABELS, DirectAnswerCandidate, DirectAnswerConfig, DirectAnswerInput, DirectAnswerReason, DirectAnswerResult, isDirectAnswerEligible } from './direct-answer.js';
|
|
16
|
+
export { ApplyReasoningTraceBoostOptions, BoostableResult, DEFAULT_REASONING_TRACE_BOOST, applyReasoningTraceBoost, isReasoningTracePath, looksLikeProblemSolvingQuery } from './reasoning-trace-recall.js';
|
|
11
17
|
export { CITATION_UNKNOWN, CitationContext, DEFAULT_CITATION_FORMAT, ParsedCitation, attachCitation, deriveSessionId, formatCitation, hasCitation, parseAllCitations, parseCitation, stripCitation } from './source-attribution.js';
|
|
12
18
|
export { QmdClient } from './qmd.js';
|
|
13
|
-
import { S as SearchBackend, a as SearchQueryOptions, b as SearchExecutionOptions, c as SearchResult } from './port-
|
|
19
|
+
import { S as SearchBackend, a as SearchQueryOptions, b as SearchExecutionOptions, c as SearchResult } from './port-BADbLZU5.js';
|
|
14
20
|
export { buildEntityRecallSection } from './entity-retrieval.js';
|
|
15
21
|
export { TrustZoneName, TrustZoneRecord, TrustZoneRecordKind, TrustZoneSourceClass, isTrustZoneName } from './trust-zones.js';
|
|
16
|
-
export { EngramAccessInputError, EngramAccessService } from './access-service.js';
|
|
17
22
|
export { EngramAccessHttpServer } from './access-http.js';
|
|
18
23
|
export { EngramMcpServer } from './access-mcp.js';
|
|
24
|
+
export { ParsedXrayCliOptions, parseXrayBudgetFlag, parseXrayCliOptions } from './recall-xray-cli.js';
|
|
25
|
+
export { RECALL_XRAY_FORMATS, RecallXrayFormat, parseXrayFormat, renderXray, renderXrayJson, renderXrayMarkdown, renderXrayText } from './recall-xray-renderer.js';
|
|
26
|
+
export { RecallFilterTrace, RecallXrayResult, RecallXrayScoreDecomposition, RecallXrayServedBy, RecallXraySnapshot } from './recall-xray.js';
|
|
19
27
|
export { MemoryStoreRequest, ObserveRequest, RecallRequest, SchemaName, SchemaValidationError, SuggestionSubmitRequest, formatZodError, memoryStoreRequestSchema, observeRequestSchema, recallRequestSchema, suggestionSubmitRequestSchema, validateRequest } from './access-schema.js';
|
|
20
28
|
export { buildExtensionsFooterForSummary, loadDaySummaryPrompt } from './day-summary.js';
|
|
21
29
|
export { ActiveMemoryGetOutput, ActiveMemoryMetadata, ActiveMemoryRecallParams, ActiveMemorySearchOutput, ActiveMemorySearchResult, getMemoryForActiveMemory, recallForActiveMemory } from './active-memory-bridge.js';
|
|
@@ -26,15 +34,23 @@ export { PageVersion, VersionHistory, VersionTrigger, VersioningConfig, Versioni
|
|
|
26
34
|
export { CitationBlock, CitationEntry, CitationMetadata, buildCitationGuidance, formatOaiMemCitation, parseOaiMemCitation, sanitizeNoteForCitation } from './citations.js';
|
|
27
35
|
import { LoggerBackend } from './logger.js';
|
|
28
36
|
export { initLogger, log } from './logger.js';
|
|
29
|
-
import { D as DiscoveredExtension } from './semantic-consolidation-
|
|
30
|
-
export { E as ExtensionSchema, R as REMNIC_EXTENSIONS_TOTAL_TOKEN_LIMIT, b as buildExtensionsBlockForConsolidation, d as discoverMemoryExtensions, r as resolveExtensionsRoot } from './semantic-consolidation-
|
|
37
|
+
import { D as DiscoveredExtension } from './semantic-consolidation-CxJU6MJk.js';
|
|
38
|
+
export { E as ExtensionSchema, R as REMNIC_EXTENSIONS_TOTAL_TOKEN_LIMIT, b as buildExtensionsBlockForConsolidation, d as discoverMemoryExtensions, r as resolveExtensionsRoot } from './semantic-consolidation-CxJU6MJk.js';
|
|
31
39
|
export { TokenEntry, TokenStore, generateToken, getAllValidTokens, getAllValidTokensCached, listTokens, loadTokenStore, resolveConnectorFromToken, revokeToken, saveTokenStore } from './tokens.js';
|
|
32
40
|
import { R as RolloutSummaryInput, M as MaterializeResult } from './codex-materialize-CQlLTzke.js';
|
|
33
41
|
export { a as MATERIALIZE_VERSION, b as MaterializeOptions, S as SENTINEL_FILE, d as describeMemoriesDir, e as ensureSentinel, m as materializeForNamespace } from './codex-materialize-CQlLTzke.js';
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
import { T as Taxonomy, R as ResolverDecision } from './types-DJhqDJUV.js';
|
|
43
|
+
export { a as TaxonomyCategory } from './types-DJhqDJUV.js';
|
|
44
|
+
export { B as BulkImportCliCommandOptions, P as ProcessBatchFn, a as ProcessBatchResult, f as formatBatchTranscript, p as parseStrictCliDate, r as runBulkImportCliCommand, b as runBulkImportPipeline } from './cli-BkeRaYfk.js';
|
|
45
|
+
export { FallbackLlmClient, FallbackLlmOptions, FallbackLlmResponse, FallbackLlmRuntimeContext } from './fallback-llm.js';
|
|
46
|
+
export { ComputeMemoryWorthInput, MemoryWorthResult, computeMemoryWorth } from './memory-worth.js';
|
|
47
|
+
export { MemoryOutcomeKind, RecordMemoryOutcomeInput, RecordMemoryOutcomeResult, memoryWorthOutcomeEligibleCategories, recordMemoryOutcome } from './memory-worth-outcomes.js';
|
|
48
|
+
export { MemoryWorthCounters, MemoryWorthFilterCandidate, MemoryWorthFilterOptions, MemoryWorthFilterResultItem, applyMemoryWorthFilter, buildMemoryWorthCounterMap } from './memory-worth-filter.js';
|
|
49
|
+
export { DEFAULT_PPR_DAMPING, DEFAULT_PPR_ITERATIONS, DEFAULT_PPR_TOLERANCE, EdgeType, ExtractGraphEdgesOptions, MemoryEdgeSource, NodeType, QueryGraphOptions, QueryGraphResult, RankedGraphNode, RemnicGraph, RemnicGraphEdge, RemnicGraphNode, buildGraphFromMemories, extractGraphEdges, isEdgeType, isNodeType, queryGraph } from './graph-retrieval.js';
|
|
50
|
+
export { GraphRecallConfig, GraphRecallOptions, GraphRecallResult, GraphRecallRun, runGraphRecall } from './graph-recall.js';
|
|
51
|
+
export { BudgetDecision, BudgetDecisionReason, CrossNamespaceBudget, CrossNamespaceBudgetConfig, DEFAULT_CROSS_NAMESPACE_BUDGET } from './cross-namespace-budget.js';
|
|
52
|
+
export { AnomalyDetectorConfig, AnomalyDetectorInput, AnomalyDetectorResult, AnomalyFlag, AnomalyKind, AnomalySeverity, DEFAULT_ANOMALY_DETECTOR_CONFIG, detectRecallAnomalies, normalizeQueryText } from './recall-audit-anomaly.js';
|
|
53
|
+
export { AccessAuditAdapter, AccessAuditConfig, AccessAuditResult } from './access-audit.js';
|
|
38
54
|
import './transcript.js';
|
|
39
55
|
import './session-integrity.js';
|
|
40
56
|
import './summarizer.js';
|
|
@@ -48,10 +64,14 @@ import './embedding-fallback.js';
|
|
|
48
64
|
import 'zod';
|
|
49
65
|
import './policy-runtime.js';
|
|
50
66
|
import './profiling.js';
|
|
67
|
+
import './consolidation-operator.js';
|
|
68
|
+
import './memory-projection-store-DeSXPh1j.js';
|
|
69
|
+
import 'better-sqlite3';
|
|
51
70
|
import './schemas.js';
|
|
52
|
-
import './
|
|
71
|
+
import './recall-explain-renderer.js';
|
|
53
72
|
import './explicit-capture.js';
|
|
54
73
|
import 'node:http';
|
|
74
|
+
import './recall-audit.js';
|
|
55
75
|
import 'node:stream';
|
|
56
76
|
import './dashboard-runtime.js';
|
|
57
77
|
import './evals.js';
|
|
@@ -233,8 +253,8 @@ declare class LanceDbBackend implements SearchBackend {
|
|
|
233
253
|
bm25Search(query: string, collection?: string, maxResults?: number, _execution?: SearchExecutionOptions): Promise<SearchResult[]>;
|
|
234
254
|
vectorSearch(query: string, collection?: string, maxResults?: number, _execution?: SearchExecutionOptions): Promise<SearchResult[]>;
|
|
235
255
|
hybridSearch(query: string, collection?: string, maxResults?: number, _execution?: SearchExecutionOptions): Promise<SearchResult[]>;
|
|
236
|
-
update(): Promise<void>;
|
|
237
|
-
updateCollection(collection: string): Promise<void>;
|
|
256
|
+
update(execution?: SearchExecutionOptions): Promise<void>;
|
|
257
|
+
updateCollection(collection: string, _execution?: SearchExecutionOptions): Promise<void>;
|
|
238
258
|
embed(): Promise<void>;
|
|
239
259
|
embedCollection(collection: string): Promise<void>;
|
|
240
260
|
ensureCollection(_memoryDir: string): Promise<"present" | "missing" | "unknown" | "skipped">;
|
|
@@ -279,8 +299,8 @@ declare class OramaBackend implements SearchBackend {
|
|
|
279
299
|
bm25Search(query: string, collection?: string, maxResults?: number, _execution?: SearchExecutionOptions): Promise<SearchResult[]>;
|
|
280
300
|
vectorSearch(query: string, collection?: string, maxResults?: number, _execution?: SearchExecutionOptions): Promise<SearchResult[]>;
|
|
281
301
|
hybridSearch(query: string, collection?: string, maxResults?: number, _execution?: SearchExecutionOptions): Promise<SearchResult[]>;
|
|
282
|
-
update(): Promise<void>;
|
|
283
|
-
updateCollection(collection: string): Promise<void>;
|
|
302
|
+
update(execution?: SearchExecutionOptions): Promise<void>;
|
|
303
|
+
updateCollection(collection: string, _execution?: SearchExecutionOptions): Promise<void>;
|
|
284
304
|
embed(): Promise<void>;
|
|
285
305
|
embedCollection(collection: string): Promise<void>;
|
|
286
306
|
ensureCollection(_memoryDir: string): Promise<"present" | "missing" | "unknown" | "skipped">;
|
|
@@ -327,8 +347,8 @@ declare class MeilisearchBackend implements SearchBackend {
|
|
|
327
347
|
bm25Search(query: string, collection?: string, maxResults?: number, _execution?: SearchExecutionOptions): Promise<SearchResult[]>;
|
|
328
348
|
vectorSearch(query: string, collection?: string, maxResults?: number, _execution?: SearchExecutionOptions): Promise<SearchResult[]>;
|
|
329
349
|
hybridSearch(query: string, collection?: string, maxResults?: number, _execution?: SearchExecutionOptions): Promise<SearchResult[]>;
|
|
330
|
-
update(): Promise<void>;
|
|
331
|
-
updateCollection(collection: string): Promise<void>;
|
|
350
|
+
update(execution?: SearchExecutionOptions): Promise<void>;
|
|
351
|
+
updateCollection(collection: string, _execution?: SearchExecutionOptions): Promise<void>;
|
|
332
352
|
embed(): Promise<void>;
|
|
333
353
|
embedCollection(collection: string): Promise<void>;
|
|
334
354
|
ensureCollection(_memoryDir: string): Promise<"present" | "missing" | "unknown" | "skipped">;
|
|
@@ -339,6 +359,316 @@ declare class MeilisearchBackend implements SearchBackend {
|
|
|
339
359
|
|
|
340
360
|
declare function resolvePrincipal(sessionKey: string | undefined, config: PluginConfig): string;
|
|
341
361
|
|
|
362
|
+
/**
|
|
363
|
+
* Shared path helpers. CLAUDE.md #17 requires consistent `~` expansion across
|
|
364
|
+
* every user-facing path input, but Node's `fs` does not expand `~`, so every
|
|
365
|
+
* call site must go through this helper.
|
|
366
|
+
*/
|
|
367
|
+
/**
|
|
368
|
+
* Expand a leading `~` or `~/…` to the resolved home directory.
|
|
369
|
+
*
|
|
370
|
+
* Leaves paths without a leading `~` unchanged — including absolute paths,
|
|
371
|
+
* relative paths, and paths that contain `~` in the middle.
|
|
372
|
+
*
|
|
373
|
+
* Accepts both `~/` (POSIX) and `~\` (Windows) as separators so call sites
|
|
374
|
+
* don't have to branch on platform.
|
|
375
|
+
*/
|
|
376
|
+
declare function expandTildePath(p: string): string;
|
|
377
|
+
|
|
378
|
+
interface GitContext {
|
|
379
|
+
/**
|
|
380
|
+
* Stable identifier for the project. Derived from `git remote get-url origin`
|
|
381
|
+
* when an origin remote is configured, otherwise from the repo root path.
|
|
382
|
+
*
|
|
383
|
+
* Formatted as `origin:<hex>` or `root:<hex>` so that the source is visible
|
|
384
|
+
* to operators (see `remnic doctor`, issue #569 acceptance criteria).
|
|
385
|
+
*/
|
|
386
|
+
projectId: string;
|
|
387
|
+
/**
|
|
388
|
+
* Current branch, e.g. `main`, `feat/foo`. `null` only in detached-HEAD
|
|
389
|
+
* state (e.g. rebase in progress). Callers should treat `null` as "no
|
|
390
|
+
* branch-scope overlay applies" without erroring.
|
|
391
|
+
*/
|
|
392
|
+
branch: string | null;
|
|
393
|
+
/**
|
|
394
|
+
* Absolute path to the repository root (the directory containing `.git`).
|
|
395
|
+
* Tilde-expanded per CLAUDE.md #17.
|
|
396
|
+
*/
|
|
397
|
+
rootPath: string;
|
|
398
|
+
/**
|
|
399
|
+
* Best-effort default branch (usually `main` or `master`). Derived from the
|
|
400
|
+
* `refs/remotes/origin/HEAD` symbolic ref. `null` when not available (e.g.
|
|
401
|
+
* fresh clone without a default branch symref, or no origin remote).
|
|
402
|
+
*/
|
|
403
|
+
defaultBranch: string | null;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Injectable git-invocation surface. Only the commands `resolveGitContext`
|
|
407
|
+
* actually needs are exposed. Tests inject a mock implementation to avoid
|
|
408
|
+
* spawning a real git process.
|
|
409
|
+
*/
|
|
410
|
+
interface GitInvoker {
|
|
411
|
+
/**
|
|
412
|
+
* Run `git <args>` with `cwd` as the working directory. Must return
|
|
413
|
+
* `{ stdout, exitCode }` with `stdout` trimmed by the caller as needed.
|
|
414
|
+
* Implementations should NOT throw for non-zero exit codes — they should
|
|
415
|
+
* return the exit code so the resolver can decide how to recover.
|
|
416
|
+
*/
|
|
417
|
+
(cwd: string, args: string[]): {
|
|
418
|
+
stdout: string;
|
|
419
|
+
exitCode: number;
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Non-cryptographic stable hash. Used only to derive a deterministic
|
|
424
|
+
* `projectId` from either the origin URL or the root path. The hash does not
|
|
425
|
+
* need to be collision-resistant against adversarial input — it is purely a
|
|
426
|
+
* namespace discriminator.
|
|
427
|
+
*
|
|
428
|
+
* Uses FNV-1a 32-bit so we don't pull in `node:crypto` for a simple bucket
|
|
429
|
+
* key. Output is lowercase hex, zero-padded to 8 characters.
|
|
430
|
+
*/
|
|
431
|
+
declare function stableHash(input: string): string;
|
|
432
|
+
/**
|
|
433
|
+
* Normalize a git remote URL so that equivalent SSH / HTTPS forms of the
|
|
434
|
+
* same repo produce the same `projectId`. Handles:
|
|
435
|
+
* - `git@github.com:foo/bar.git` → `github.com/foo/bar`
|
|
436
|
+
* - `https://github.com/foo/bar` → `github.com/foo/bar`
|
|
437
|
+
* - `https://github.com/foo/bar.git` → `github.com/foo/bar`
|
|
438
|
+
* - `ssh://git@github.com/foo/bar` → `github.com/foo/bar`
|
|
439
|
+
* - `ssh://git@github.com:2222/foo/bar` → `github.com/foo/bar` (port stripped)
|
|
440
|
+
*
|
|
441
|
+
* Case-insensitive (remote hostnames and most repo paths on major forges are
|
|
442
|
+
* case-insensitive in practice).
|
|
443
|
+
*/
|
|
444
|
+
declare function normalizeOriginUrl(rawUrl: string): string;
|
|
445
|
+
interface ResolveGitContextOptions {
|
|
446
|
+
/** Inject a git invoker (tests). Defaults to spawning real `git`. */
|
|
447
|
+
invoker?: GitInvoker;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Detect the git project + branch for `cwd`.
|
|
451
|
+
*
|
|
452
|
+
* Returns `null` when:
|
|
453
|
+
* - `cwd` is not an absolute path (invalid input, CLAUDE.md #51)
|
|
454
|
+
* - `cwd` is not inside a git worktree
|
|
455
|
+
* - `git` is not available on PATH
|
|
456
|
+
*
|
|
457
|
+
* Never throws.
|
|
458
|
+
*/
|
|
459
|
+
declare function resolveGitContext(cwd: string, options?: ResolveGitContextOptions): Promise<GitContext | null>;
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Coding-agent namespace overlay (issue #569 PR 2 + PR 3).
|
|
463
|
+
*
|
|
464
|
+
* Given a `CodingContext` (from `resolveGitContext`) and a `CodingModeConfig`,
|
|
465
|
+
* returns the namespace that recall + write paths should use — or `null` when
|
|
466
|
+
* no overlay should apply (coding mode disabled, no context supplied, or
|
|
467
|
+
* feature flags off).
|
|
468
|
+
*
|
|
469
|
+
* PR 2 ships the project overlay. PR 3 will add the branch overlay; the
|
|
470
|
+
* function here already handles both flags so the schema / types / plumbing
|
|
471
|
+
* don't have to change a second time when branch-scope lands.
|
|
472
|
+
*
|
|
473
|
+
* Pure function — no orchestrator, no config side-effects. Callers keep rule
|
|
474
|
+
* 42 (read + write through same namespace layer) by consulting the same
|
|
475
|
+
* function on both paths.
|
|
476
|
+
*/
|
|
477
|
+
|
|
478
|
+
interface CodingNamespaceOverlay {
|
|
479
|
+
/**
|
|
480
|
+
* Effective namespace to use for this session's memory operations. When
|
|
481
|
+
* `branchScope` is on, takes the form `project:<id>/branch:<b>`; otherwise
|
|
482
|
+
* `project:<id>`.
|
|
483
|
+
*/
|
|
484
|
+
namespace: string;
|
|
485
|
+
/**
|
|
486
|
+
* Read fallbacks — additional namespaces a caller should include in recall
|
|
487
|
+
* so that, for example, a branch-scoped session still sees project-level
|
|
488
|
+
* memories that were written before the branch scope was enabled.
|
|
489
|
+
*
|
|
490
|
+
* Writes MUST go to `namespace` only; these are read-side only.
|
|
491
|
+
*
|
|
492
|
+
* Introduced to carry PR 3's branch→project fallback; PR 2 returns an empty
|
|
493
|
+
* array here.
|
|
494
|
+
*/
|
|
495
|
+
readFallbacks: string[];
|
|
496
|
+
/**
|
|
497
|
+
* `"project"` when only project scope applies, `"branch"` when branch scope
|
|
498
|
+
* is also layered on. Used for diagnostics (`remnic doctor`) and logging.
|
|
499
|
+
*/
|
|
500
|
+
scope: "project" | "branch";
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Produce the project-scope namespace name. Exported for tests and for
|
|
504
|
+
* `remnic doctor` to render. Guaranteed to satisfy `isSafeRouteNamespace`:
|
|
505
|
+
* no `/`, no `:`, lowercase only, length-capped to 64 chars.
|
|
506
|
+
*/
|
|
507
|
+
declare function projectNamespaceName(projectId: string): string;
|
|
508
|
+
/**
|
|
509
|
+
* Produce the branch-scope namespace name. Format:
|
|
510
|
+
* `project-<id>-branch-<name>[-<hash>]`. Uses `-` as the structural separator
|
|
511
|
+
* rather than `/` or `:` so the result is a single safe route-namespace
|
|
512
|
+
* token that can be used directly as a filesystem directory.
|
|
513
|
+
*
|
|
514
|
+
* Two failure modes must not collapse distinct branches to one namespace:
|
|
515
|
+
*
|
|
516
|
+
* 1. Sanitization is lossy (`feat/x` and `feat-x` both sanitize to
|
|
517
|
+
* `feat-x`; `Feature` and `feature` both sanitize to `feature`). When
|
|
518
|
+
* sanitization rewrote any character, we append a short hash of the
|
|
519
|
+
* RAW branch so distinct inputs stay distinct.
|
|
520
|
+
* 2. Truncation is applied when the total exceeds 64 chars. In that
|
|
521
|
+
* mode `capLength` appends its own hash of the full pre-truncated
|
|
522
|
+
* value.
|
|
523
|
+
*
|
|
524
|
+
* Long branches that also sanitize may receive both kinds of hashes — that
|
|
525
|
+
* is acceptable: the router only requires the result be unique and
|
|
526
|
+
* deterministic, and the two hashes derive from different domains so they
|
|
527
|
+
* don't conflict.
|
|
528
|
+
*/
|
|
529
|
+
declare function branchNamespaceName(projectId: string, branch: string): string;
|
|
530
|
+
/**
|
|
531
|
+
* Compute the namespace overlay for a session.
|
|
532
|
+
*
|
|
533
|
+
* Returns `null` when no overlay applies — callers should then use their
|
|
534
|
+
* existing `defaultNamespaceForPrincipal(...)` result unchanged. This keeps
|
|
535
|
+
* CLAUDE.md #30 (escape hatch): setting `codingMode.projectScope: false`
|
|
536
|
+
* exactly restores pre-#569 behaviour at every call site.
|
|
537
|
+
*/
|
|
538
|
+
declare function resolveCodingNamespaceOverlay(codingContext: CodingContext | null | undefined, config: Pick<CodingModeConfig, "projectScope" | "branchScope">): CodingNamespaceOverlay | null;
|
|
539
|
+
interface CodingScopeDescription {
|
|
540
|
+
/** "none" when no overlay is active; otherwise the resolved scope level. */
|
|
541
|
+
scope: "none" | "project" | "branch";
|
|
542
|
+
/** Project id (raw, not sanitized) when a context is attached. */
|
|
543
|
+
projectId: string | null;
|
|
544
|
+
/** Branch name (raw, not sanitized) when available. */
|
|
545
|
+
branch: string | null;
|
|
546
|
+
/** Effective namespace writes route to. `null` when no overlay applies. */
|
|
547
|
+
effectiveNamespace: string | null;
|
|
548
|
+
/** Read fallbacks included in recall (non-empty only when branch-scope is on). */
|
|
549
|
+
readFallbacks: string[];
|
|
550
|
+
/**
|
|
551
|
+
* Why no overlay applies, when `scope === "none"`. One of:
|
|
552
|
+
* - `"no-context"` — connector didn't attach a CodingContext
|
|
553
|
+
* - `"disabled"` — codingMode.projectScope is false
|
|
554
|
+
* - `"empty-project"` — codingContext.projectId was empty/whitespace
|
|
555
|
+
*/
|
|
556
|
+
disabledReason: "no-context" | "disabled" | "empty-project" | null;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Human-readable description of the coding-agent scope that currently applies
|
|
560
|
+
* for a session. Consumed by `remnic doctor` (PR 8) and by logs to surface
|
|
561
|
+
* why recall routes where it does.
|
|
562
|
+
*
|
|
563
|
+
* Pure — callers pass the coding context + config they already have.
|
|
564
|
+
*/
|
|
565
|
+
declare function describeCodingScope(codingContext: CodingContext | null | undefined, config: Pick<CodingModeConfig, "projectScope" | "branchScope">): CodingScopeDescription;
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Diff-aware review-context packer (issue #569 PR 4).
|
|
569
|
+
*
|
|
570
|
+
* When an agent is asked "review this PR" / "what changed in this diff" /
|
|
571
|
+
* "look at this diff", the prompt that reaches recall is short and generic
|
|
572
|
+
* — the real signal is the diff itself. This module:
|
|
573
|
+
*
|
|
574
|
+
* 1. Detects review-intent prompts via `isReviewPrompt`.
|
|
575
|
+
* 2. Extracts the touched file list from a unified diff via
|
|
576
|
+
* `parseTouchedFiles`.
|
|
577
|
+
* 3. Re-ranks a set of candidate memories so that memories whose
|
|
578
|
+
* `entityRefs` mention a touched path float to the top. The boost is
|
|
579
|
+
* additive and bounded so it doesn't obliterate the original ranking —
|
|
580
|
+
* it's a bias, not a filter.
|
|
581
|
+
*
|
|
582
|
+
* Pure — no orchestrator, no storage. Callers inject the candidate memories
|
|
583
|
+
* they already have from their normal recall pipeline. This keeps the
|
|
584
|
+
* module easy to test and integrates cleanly with the existing tiered-recall
|
|
585
|
+
* code in `orchestrator.ts` (the tier itself can be wired later; the pure
|
|
586
|
+
* surface is what PRs 5/6/7 will call).
|
|
587
|
+
*/
|
|
588
|
+
/**
|
|
589
|
+
* A memory candidate as fed into review-context ranking. The shape is a
|
|
590
|
+
* deliberate subset of the core `MemorySummary` / recall result — only the
|
|
591
|
+
* fields we actually need — so this module stays decoupled from the rest of
|
|
592
|
+
* the codebase and can be reused by CLI tools, bench fixtures, etc.
|
|
593
|
+
*/
|
|
594
|
+
interface ReviewCandidate {
|
|
595
|
+
/** Opaque identifier. Echoed unchanged in the output. */
|
|
596
|
+
id: string;
|
|
597
|
+
/**
|
|
598
|
+
* Pre-review relevance score from the upstream recall pipeline. Higher is
|
|
599
|
+
* better. `0` is treated as "no prior signal" and gets the full review
|
|
600
|
+
* boost when a path match is found.
|
|
601
|
+
*/
|
|
602
|
+
score: number;
|
|
603
|
+
/**
|
|
604
|
+
* References the memory mentions (file paths, entity names, etc.). Used
|
|
605
|
+
* to decide whether any touched file appears in the memory's scope.
|
|
606
|
+
*
|
|
607
|
+
* Accepts `undefined`/missing so callers can pass sparse records from
|
|
608
|
+
* legacy storage without pre-filling.
|
|
609
|
+
*/
|
|
610
|
+
entityRefs?: string[];
|
|
611
|
+
}
|
|
612
|
+
interface ReviewContext {
|
|
613
|
+
/**
|
|
614
|
+
* Normalized file paths touched by the diff. Each entry is forward-slashed
|
|
615
|
+
* and relative to the repo root when possible.
|
|
616
|
+
*/
|
|
617
|
+
touchedFiles: string[];
|
|
618
|
+
/**
|
|
619
|
+
* Candidates re-sorted so memories whose `entityRefs` mention a touched
|
|
620
|
+
* path are boosted. Shape matches the input `ReviewCandidate[]` — the
|
|
621
|
+
* boost is recorded on each entry as `boost` for observability.
|
|
622
|
+
*/
|
|
623
|
+
rankedRecall: Array<ReviewCandidate & {
|
|
624
|
+
boost: number;
|
|
625
|
+
}>;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* `true` when the prompt looks like a review / diff-explanation request.
|
|
629
|
+
*
|
|
630
|
+
* Empty / non-string input → `false` (the caller shouldn't branch on an
|
|
631
|
+
* invalid prompt).
|
|
632
|
+
*/
|
|
633
|
+
declare function isReviewPrompt(prompt: string | null | undefined): boolean;
|
|
634
|
+
/**
|
|
635
|
+
* Parse a unified diff and return the set of files touched. Accepts both the
|
|
636
|
+
* `diff --git` form (`diff --git a/foo b/bar`) and the `--- / +++` form
|
|
637
|
+
* (`--- a/foo\n+++ b/bar`). Returns deduplicated, repo-root-relative paths
|
|
638
|
+
* (with the conventional `a/` / `b/` prefixes stripped).
|
|
639
|
+
*
|
|
640
|
+
* Path entries of `/dev/null` (used in adds/deletes) are excluded.
|
|
641
|
+
*/
|
|
642
|
+
declare function parseTouchedFiles(diff: string | null | undefined): string[];
|
|
643
|
+
/**
|
|
644
|
+
* Build a review-context ranking for a set of candidate memories.
|
|
645
|
+
*
|
|
646
|
+
* Contract:
|
|
647
|
+
* - `touchedFiles` is the parsed diff file list.
|
|
648
|
+
* - `candidates` is passed through unchanged when no boost applies.
|
|
649
|
+
* - When a boost applies, the result is sorted by `(score + boost)` desc,
|
|
650
|
+
* with a stable secondary sort on the original `id` for determinism
|
|
651
|
+
* (CLAUDE.md #19 — comparators must return 0 for equal items).
|
|
652
|
+
*/
|
|
653
|
+
declare function rankReviewCandidates(candidates: ReviewCandidate[], touchedFiles: string[]): Array<ReviewCandidate & {
|
|
654
|
+
boost: number;
|
|
655
|
+
}>;
|
|
656
|
+
interface PackReviewContextInput {
|
|
657
|
+
/** Unified diff, as produced by `git diff`. */
|
|
658
|
+
diff: string | null | undefined;
|
|
659
|
+
/** Candidate memories from the upstream recall pipeline. */
|
|
660
|
+
candidates: ReviewCandidate[];
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Top-level entry point used by the orchestrator (and CLI / bench) when a
|
|
664
|
+
* review-intent prompt is detected.
|
|
665
|
+
*
|
|
666
|
+
* Parses the diff, re-ranks the candidates, and returns both artefacts so
|
|
667
|
+
* the caller can surface `touchedFiles` as context and `rankedRecall` as
|
|
668
|
+
* the recall result.
|
|
669
|
+
*/
|
|
670
|
+
declare function packReviewContext(input: PackReviewContextInput): ReviewContext;
|
|
671
|
+
|
|
342
672
|
/**
|
|
343
673
|
* Binary file lifecycle management types.
|
|
344
674
|
*
|
|
@@ -807,74 +1137,6 @@ interface ContradictionPair {
|
|
|
807
1137
|
declare function findDuplicates(options: DedupOptions): DedupResult;
|
|
808
1138
|
declare function findContradictions(options: ContradictionOptions): ContradictionResult;
|
|
809
1139
|
|
|
810
|
-
/**
|
|
811
|
-
* @remnic/core — Write-time semantic dedup guard
|
|
812
|
-
*
|
|
813
|
-
* Complements the exact content-hash check in the orchestrator's write path
|
|
814
|
-
* by detecting near-duplicate candidate facts via embedding cosine similarity.
|
|
815
|
-
*
|
|
816
|
-
* The module intentionally has no dependency on the EmbeddingFallback or QMD
|
|
817
|
-
* classes directly — callers pass in a `lookup` function that returns the
|
|
818
|
-
* top-K nearest neighbors with their cosine scores. This keeps the decision
|
|
819
|
-
* logic pure and trivially testable with synthetic fixtures, and lets the
|
|
820
|
-
* orchestrator reuse whichever backend it already has wired up.
|
|
821
|
-
*
|
|
822
|
-
* Related issue: joshuaswarren/remnic#373
|
|
823
|
-
*/
|
|
824
|
-
/** A single nearest-neighbor hit from the embedding backend. */
|
|
825
|
-
interface SemanticDedupHit {
|
|
826
|
-
/** Memory id of the existing neighbor. */
|
|
827
|
-
id: string;
|
|
828
|
-
/** Cosine similarity score in [0, 1]. */
|
|
829
|
-
score: number;
|
|
830
|
-
/** Optional source path, purely informational. */
|
|
831
|
-
path?: string;
|
|
832
|
-
}
|
|
833
|
-
/**
|
|
834
|
-
* Lookup function passed by the caller. Must return an array of hits sorted
|
|
835
|
-
* descending by score. Implementations should return an empty array (never
|
|
836
|
-
* throw) when the embedding backend is unavailable — the decision function
|
|
837
|
-
* treats that as "no near duplicate" (fail-open).
|
|
838
|
-
*/
|
|
839
|
-
type SemanticDedupLookup = (content: string, limit: number) => Promise<SemanticDedupHit[]>;
|
|
840
|
-
interface SemanticDedupOptions {
|
|
841
|
-
/** Master switch. When false, `decideSemanticDedup` always returns `keep`. */
|
|
842
|
-
enabled: boolean;
|
|
843
|
-
/** Cosine similarity threshold (0-1). ≥ threshold ⇒ treat as duplicate. */
|
|
844
|
-
threshold: number;
|
|
845
|
-
/** How many nearest neighbors to compare against. */
|
|
846
|
-
candidates: number;
|
|
847
|
-
}
|
|
848
|
-
type SemanticDedupDecision = {
|
|
849
|
-
action: "keep";
|
|
850
|
-
reason: "disabled" | "backend_unavailable" | "no_candidates" | "no_near_duplicate";
|
|
851
|
-
topScore?: number;
|
|
852
|
-
topId?: string;
|
|
853
|
-
} | {
|
|
854
|
-
action: "skip";
|
|
855
|
-
reason: "near_duplicate";
|
|
856
|
-
topScore: number;
|
|
857
|
-
topId: string;
|
|
858
|
-
topPath?: string;
|
|
859
|
-
};
|
|
860
|
-
/**
|
|
861
|
-
* Pure decision function: given a lookup callback and options, decide whether
|
|
862
|
-
* the candidate content should be written or skipped as a near-duplicate.
|
|
863
|
-
*
|
|
864
|
-
* Contract:
|
|
865
|
-
* - When `options.enabled` is false → always keep, reason="disabled".
|
|
866
|
-
* - When the lookup throws (provider down / network error) → keep,
|
|
867
|
-
* reason="backend_unavailable". Fail-open: a lookup failure must not block
|
|
868
|
-
* writes.
|
|
869
|
-
* - When the lookup succeeds but returns 0 hits (empty index or no
|
|
870
|
-
* neighbors above the score floor) → keep, reason="no_candidates".
|
|
871
|
-
* This is distinct from backend_unavailable so telemetry dashboards can
|
|
872
|
-
* correctly distinguish "provider is down" from "index is empty".
|
|
873
|
-
* - When the top hit's score ≥ threshold → skip with reason="near_duplicate".
|
|
874
|
-
* - Otherwise → keep with reason="no_near_duplicate".
|
|
875
|
-
*/
|
|
876
|
-
declare function decideSemanticDedup(content: string, lookup: SemanticDedupLookup, options: SemanticDedupOptions): Promise<SemanticDedupDecision>;
|
|
877
|
-
|
|
878
1140
|
/**
|
|
879
1141
|
* @remnic/core — Review Inbox
|
|
880
1142
|
*
|
|
@@ -1687,55 +1949,6 @@ declare function publisherFor(hostId: string): MemoryExtensionPublisher | undefi
|
|
|
1687
1949
|
*/
|
|
1688
1950
|
declare function publisherForConnector(connectorId: string): MemoryExtensionPublisher | undefined;
|
|
1689
1951
|
|
|
1690
|
-
/**
|
|
1691
|
-
* Taxonomy types for the MECE knowledge directory.
|
|
1692
|
-
*
|
|
1693
|
-
* A taxonomy defines a set of categories that partition the knowledge
|
|
1694
|
-
* space so that every memory maps to exactly one category (Mutually
|
|
1695
|
-
* Exclusive, Collectively Exhaustive).
|
|
1696
|
-
*/
|
|
1697
|
-
/**
|
|
1698
|
-
* A single category in the taxonomy.
|
|
1699
|
-
*
|
|
1700
|
-
* @property id - Slug: lowercase letters, digits, hyphens; max 32 chars.
|
|
1701
|
-
* @property name - Human-readable display name.
|
|
1702
|
-
* @property description - What belongs in this category.
|
|
1703
|
-
* @property filingRules - Prose rules used by the resolver decision tree.
|
|
1704
|
-
* @property parentId - Optional parent category for nesting.
|
|
1705
|
-
* @property priority - Tie-breaker: lower number wins when a memory
|
|
1706
|
-
* could belong to multiple categories.
|
|
1707
|
-
* @property memoryCategories - Which MemoryCategory values map here.
|
|
1708
|
-
*/
|
|
1709
|
-
interface TaxonomyCategory {
|
|
1710
|
-
id: string;
|
|
1711
|
-
name: string;
|
|
1712
|
-
description: string;
|
|
1713
|
-
filingRules: string[];
|
|
1714
|
-
parentId?: string;
|
|
1715
|
-
priority: number;
|
|
1716
|
-
memoryCategories: string[];
|
|
1717
|
-
}
|
|
1718
|
-
/**
|
|
1719
|
-
* A versioned taxonomy comprising an ordered list of categories.
|
|
1720
|
-
*/
|
|
1721
|
-
interface Taxonomy {
|
|
1722
|
-
version: number;
|
|
1723
|
-
categories: TaxonomyCategory[];
|
|
1724
|
-
}
|
|
1725
|
-
/**
|
|
1726
|
-
* The output of the resolver: which category a piece of knowledge
|
|
1727
|
-
* belongs to, with confidence and alternatives.
|
|
1728
|
-
*/
|
|
1729
|
-
interface ResolverDecision {
|
|
1730
|
-
categoryId: string;
|
|
1731
|
-
confidence: number;
|
|
1732
|
-
reason: string;
|
|
1733
|
-
alternatives: Array<{
|
|
1734
|
-
categoryId: string;
|
|
1735
|
-
reason: string;
|
|
1736
|
-
}>;
|
|
1737
|
-
}
|
|
1738
|
-
|
|
1739
1952
|
/**
|
|
1740
1953
|
* Default MECE taxonomy that maps every existing MemoryCategory value
|
|
1741
1954
|
* to exactly one taxonomy category, ordered by priority.
|
|
@@ -1979,6 +2192,244 @@ declare function appendAuditEntry(auditDir: string, entry: EnrichmentAuditEntry)
|
|
|
1979
2192
|
*/
|
|
1980
2193
|
declare function readAuditLog(auditDir: string, since?: string): Promise<EnrichmentAuditEntry[]>;
|
|
1981
2194
|
|
|
2195
|
+
/**
|
|
2196
|
+
* A single imported memory record with provenance.
|
|
2197
|
+
*
|
|
2198
|
+
* Every importer MUST attach a truthful `sourceLabel` (e.g. `"chatgpt"`,
|
|
2199
|
+
* `"claude"`, `"gemini"`, `"mem0"`) and MAY attach the export's origin path or
|
|
2200
|
+
* URL in `importedFromPath`. `importedAt` is always set by `runImporter` so
|
|
2201
|
+
* adapters do not need to timestamp records themselves.
|
|
2202
|
+
*/
|
|
2203
|
+
interface ImportedMemory {
|
|
2204
|
+
/**
|
|
2205
|
+
* The user-facing memory content. This is the string that will eventually
|
|
2206
|
+
* land in the memory store (after extraction / orchestrator processing).
|
|
2207
|
+
*/
|
|
2208
|
+
content: string;
|
|
2209
|
+
/**
|
|
2210
|
+
* Source-specific identifier for idempotent re-imports. Optional — when
|
|
2211
|
+
* present, adapters SHOULD use the source's stable id (e.g. ChatGPT memory
|
|
2212
|
+
* uuid); when absent, the orchestrator's own content hashing provides dedup.
|
|
2213
|
+
*/
|
|
2214
|
+
sourceId?: string;
|
|
2215
|
+
/**
|
|
2216
|
+
* Source-specific timestamp at which the memory was originally created or
|
|
2217
|
+
* last updated. ISO 8601. Optional — adapters fall back to `importedAt`
|
|
2218
|
+
* when the source does not expose a creation timestamp.
|
|
2219
|
+
*/
|
|
2220
|
+
sourceTimestamp?: string;
|
|
2221
|
+
/**
|
|
2222
|
+
* Human-readable short label identifying the origin platform
|
|
2223
|
+
* (`"chatgpt"`, `"claude"`, `"gemini"`, `"mem0"`). Required so the
|
|
2224
|
+
* orchestrator can attribute recalled memories correctly.
|
|
2225
|
+
*/
|
|
2226
|
+
sourceLabel: string;
|
|
2227
|
+
/**
|
|
2228
|
+
* Path to the export file the memory was parsed from, OR the endpoint URL
|
|
2229
|
+
* for API-based imports. Optional but strongly recommended so users can
|
|
2230
|
+
* trace a memory back to the file they imported.
|
|
2231
|
+
*/
|
|
2232
|
+
importedFromPath?: string;
|
|
2233
|
+
/**
|
|
2234
|
+
* ISO 8601 timestamp set by `runImporter` immediately before writeTo().
|
|
2235
|
+
* Adapters MAY populate this themselves; `runImporter` will fill in the
|
|
2236
|
+
* current wall-clock time when absent.
|
|
2237
|
+
*/
|
|
2238
|
+
importedAt?: string;
|
|
2239
|
+
/**
|
|
2240
|
+
* Adapter-specific raw metadata preserved for debugging / future rehydration
|
|
2241
|
+
* (e.g. conversation id, thread id, tags). Must be JSON-serializable;
|
|
2242
|
+
* adapters MUST NOT stash functions or circular references here.
|
|
2243
|
+
*/
|
|
2244
|
+
metadata?: Record<string, unknown>;
|
|
2245
|
+
}
|
|
2246
|
+
/**
|
|
2247
|
+
* Options threaded through every importer run. Adapters receive this object
|
|
2248
|
+
* from `runImporter`; the top-level CLI populates it from `--dry-run`,
|
|
2249
|
+
* `--batch-size`, and `--rate-limit` flags.
|
|
2250
|
+
*/
|
|
2251
|
+
interface RunImportOptions {
|
|
2252
|
+
/**
|
|
2253
|
+
* When true, parse + transform but skip writeTo(). `runImporter` prints a
|
|
2254
|
+
* summary of what WOULD have been imported and returns early.
|
|
2255
|
+
*/
|
|
2256
|
+
dryRun?: boolean;
|
|
2257
|
+
/**
|
|
2258
|
+
* Target batch size for writeTo(). Adapters that chunk memories into
|
|
2259
|
+
* smaller orchestrator calls should honor this. Defaults to
|
|
2260
|
+
* `DEFAULT_IMPORT_BATCH_SIZE` when undefined. Values outside the valid
|
|
2261
|
+
* range throw from `validateImportBatchSize`.
|
|
2262
|
+
*/
|
|
2263
|
+
batchSize?: number;
|
|
2264
|
+
/**
|
|
2265
|
+
* Optional rate limit for API-backed importers (mem0). Expressed as
|
|
2266
|
+
* requests-per-second. Adapters that do not hit an external API may ignore
|
|
2267
|
+
* this. When provided, `validateImportRateLimit` enforces the positive-
|
|
2268
|
+
* finite contract.
|
|
2269
|
+
*/
|
|
2270
|
+
rateLimit?: number;
|
|
2271
|
+
/**
|
|
2272
|
+
* Invoked after every chunk of memories is processed. `total` is the full
|
|
2273
|
+
* count of memories produced by `transform`; `processed` counts memories
|
|
2274
|
+
* already ingested (or skipped in dry-run mode). Adapters SHOULD call this
|
|
2275
|
+
* incrementally — `runImporter` itself calls it once per batch.
|
|
2276
|
+
*/
|
|
2277
|
+
onProgress?: (progress: ImportProgress) => void;
|
|
2278
|
+
}
|
|
2279
|
+
interface ImportProgress {
|
|
2280
|
+
processed: number;
|
|
2281
|
+
total: number;
|
|
2282
|
+
/** Current phase for human-readable logging. */
|
|
2283
|
+
phase: "parse" | "transform" | "write" | "dry-run";
|
|
2284
|
+
}
|
|
2285
|
+
/**
|
|
2286
|
+
* Interface every importer package implements.
|
|
2287
|
+
*
|
|
2288
|
+
* The three-method surface intentionally mirrors the issue #568 spec:
|
|
2289
|
+
*
|
|
2290
|
+
* - `parse(input)`: raw payload → intermediate representation.
|
|
2291
|
+
* - `transform(parsed)`: intermediate representation → `ImportedMemory[]`.
|
|
2292
|
+
* - `writeTo(target, memories, options)`: actually commit to the
|
|
2293
|
+
* orchestrator (or whatever target the host provides).
|
|
2294
|
+
*
|
|
2295
|
+
* Adapters MAY keep `parse` and `transform` separate (e.g. ChatGPT conversions
|
|
2296
|
+
* that need to split saved-memories from conversation summaries) or collapse
|
|
2297
|
+
* them into a single operation — what matters is that the combined pipeline
|
|
2298
|
+
* produces an array of `ImportedMemory` records with correct provenance.
|
|
2299
|
+
*
|
|
2300
|
+
* `Parsed` is generic so strongly-typed intermediate shapes survive through
|
|
2301
|
+
* the adapter's own code without leaking to callers of `runImporter`.
|
|
2302
|
+
*/
|
|
2303
|
+
interface ImporterAdapter<Parsed = unknown> {
|
|
2304
|
+
/** Short stable name used by `remnic import --adapter <name>`. */
|
|
2305
|
+
name: string;
|
|
2306
|
+
/** Human-readable label surfaced in CLI output and source attribution. */
|
|
2307
|
+
sourceLabel: string;
|
|
2308
|
+
/**
|
|
2309
|
+
* Parse a raw payload (file contents, API response, etc.) into the adapter
|
|
2310
|
+
* intermediate representation. Pure — MUST NOT call the orchestrator.
|
|
2311
|
+
*/
|
|
2312
|
+
parse(input: unknown, options?: ImporterParseOptions): Parsed | Promise<Parsed>;
|
|
2313
|
+
/**
|
|
2314
|
+
* Flatten parsed input into an array of importable memories. Pure — MUST
|
|
2315
|
+
* NOT call the orchestrator. Provenance fields (`sourceLabel`,
|
|
2316
|
+
* `importedFromPath`) should be populated here.
|
|
2317
|
+
*/
|
|
2318
|
+
transform(parsed: Parsed, options?: ImporterTransformOptions): ImportedMemory[] | Promise<ImportedMemory[]>;
|
|
2319
|
+
/**
|
|
2320
|
+
* Commit the transformed memories to the orchestrator (or equivalent
|
|
2321
|
+
* target). `runImporter` only invokes this when dryRun is false.
|
|
2322
|
+
*
|
|
2323
|
+
* Adapters typically call `orchestrator.ingestBulkImportBatch` once per
|
|
2324
|
+
* batch after converting `ImportedMemory` records into `ImportTurn` shapes.
|
|
2325
|
+
*/
|
|
2326
|
+
writeTo(target: ImporterWriteTarget, memories: ImportedMemory[], options: RunImportOptions): Promise<ImporterWriteResult>;
|
|
2327
|
+
}
|
|
2328
|
+
/**
|
|
2329
|
+
* Shape of the "target" passed to `writeTo`.
|
|
2330
|
+
*
|
|
2331
|
+
* This is intentionally narrower than the full `Orchestrator` class: importer
|
|
2332
|
+
* adapters only need to push `ImportTurn[]` batches and read the active
|
|
2333
|
+
* bulk-import namespace. Narrowing keeps test doubles simple (the slice-1
|
|
2334
|
+
* integration test uses a pure in-memory mock) and prevents adapters from
|
|
2335
|
+
* reaching into orchestrator internals that would make them harder to move
|
|
2336
|
+
* between host environments.
|
|
2337
|
+
*/
|
|
2338
|
+
interface ImporterWriteTarget {
|
|
2339
|
+
ingestBulkImportBatch(turns: ImportTurn[], options?: {
|
|
2340
|
+
deadlineMs?: number;
|
|
2341
|
+
}): Promise<void>;
|
|
2342
|
+
bulkImportWriteNamespace?(): string;
|
|
2343
|
+
}
|
|
2344
|
+
interface ImporterWriteResult {
|
|
2345
|
+
memoriesIngested: number;
|
|
2346
|
+
/** Optional: adapter-surfaced duplicates or skipped entries. */
|
|
2347
|
+
skipped?: number;
|
|
2348
|
+
}
|
|
2349
|
+
/** Options forwarded to `parse`. Adapter-specific; additive by design. */
|
|
2350
|
+
interface ImporterParseOptions {
|
|
2351
|
+
strict?: boolean;
|
|
2352
|
+
/** Source path passed through for provenance. */
|
|
2353
|
+
filePath?: string;
|
|
2354
|
+
/**
|
|
2355
|
+
* Requests-per-second throttle, forwarded from the top-level
|
|
2356
|
+
* `RunImportOptions.rateLimit`. Only meaningful for API-backed importers
|
|
2357
|
+
* (mem0) — file-based adapters ignore it. `runImporter` copies this
|
|
2358
|
+
* through automatically so CLI users never have to stash it on
|
|
2359
|
+
* `parseOptions` themselves. Cursor review on PR #602.
|
|
2360
|
+
*/
|
|
2361
|
+
rateLimit?: number;
|
|
2362
|
+
}
|
|
2363
|
+
/** Options forwarded to `transform`. */
|
|
2364
|
+
interface ImporterTransformOptions {
|
|
2365
|
+
/** When true, adapters that normally skip bulk conversations should include them. */
|
|
2366
|
+
includeConversations?: boolean;
|
|
2367
|
+
/** Maximum number of memories to emit. Primarily for tests. */
|
|
2368
|
+
maxMemories?: number;
|
|
2369
|
+
}
|
|
2370
|
+
declare const DEFAULT_IMPORT_BATCH_SIZE = 25;
|
|
2371
|
+
/**
|
|
2372
|
+
* Coerce and validate the caller-supplied batch size. CLAUDE.md rule 14/51:
|
|
2373
|
+
* reject invalid CLI input rather than silently defaulting.
|
|
2374
|
+
*/
|
|
2375
|
+
declare function validateImportBatchSize(value: number | undefined): number;
|
|
2376
|
+
/**
|
|
2377
|
+
* Validate the `--rate-limit` (requests per second) value used by API
|
|
2378
|
+
* importers. Zero / negative / non-finite values throw — the CLI must reject
|
|
2379
|
+
* them rather than silently import at unlimited speed.
|
|
2380
|
+
*/
|
|
2381
|
+
declare function validateImportRateLimit(value: number | undefined): number | undefined;
|
|
2382
|
+
/**
|
|
2383
|
+
* Convert an `ImportedMemory` into an `ImportTurn` suitable for
|
|
2384
|
+
* `orchestrator.ingestBulkImportBatch`. The resulting turn is always
|
|
2385
|
+
* `role="user"` because every downstream source (saved memories, personal
|
|
2386
|
+
* context, mem0 entries) represents a first-person statement rather than an
|
|
2387
|
+
* assistant response.
|
|
2388
|
+
*
|
|
2389
|
+
* Keeps provenance on the turn via `participantName` so the extraction
|
|
2390
|
+
* pipeline's transcript renderer labels the speaker with the source platform.
|
|
2391
|
+
*/
|
|
2392
|
+
declare function importedMemoryToTurn(memory: ImportedMemory): ImportTurn;
|
|
2393
|
+
interface RunImporterResult {
|
|
2394
|
+
adapter: string;
|
|
2395
|
+
sourceLabel: string;
|
|
2396
|
+
/**
|
|
2397
|
+
* Total memories produced by `transform`. In dry-run mode this is the same
|
|
2398
|
+
* as the number of memories that WOULD have been written.
|
|
2399
|
+
*/
|
|
2400
|
+
memoriesPlanned: number;
|
|
2401
|
+
/**
|
|
2402
|
+
* Number of memories actually handed to writeTo(). Always zero in dry-run
|
|
2403
|
+
* mode.
|
|
2404
|
+
*/
|
|
2405
|
+
memoriesWritten: number;
|
|
2406
|
+
batchesProcessed: number;
|
|
2407
|
+
dryRun: boolean;
|
|
2408
|
+
/** Mirrors the importedAt stamped on every memory. */
|
|
2409
|
+
importedAt: string;
|
|
2410
|
+
}
|
|
2411
|
+
/**
|
|
2412
|
+
* Orchestrate `parse → transform → writeTo` for an adapter. This is the
|
|
2413
|
+
* default pipeline used by the CLI; adapters are free to implement their own
|
|
2414
|
+
* orchestration when they need per-record rate-limiting or streaming parses
|
|
2415
|
+
* that would not fit in the "produce full array before writing" shape.
|
|
2416
|
+
*
|
|
2417
|
+
* Mutates the supplied memory records by filling in `importedAt` when the
|
|
2418
|
+
* adapter did not set it (CLAUDE.md rule 38: records are written in insertion
|
|
2419
|
+
* order to keep the provenance log stable).
|
|
2420
|
+
*/
|
|
2421
|
+
declare function runImporter<Parsed>(adapter: ImporterAdapter<Parsed>, input: unknown, target: ImporterWriteTarget, options?: RunImportOptions & {
|
|
2422
|
+
parseOptions?: ImporterParseOptions;
|
|
2423
|
+
transformOptions?: ImporterTransformOptions;
|
|
2424
|
+
}): Promise<RunImporterResult>;
|
|
2425
|
+
/**
|
|
2426
|
+
* Default `writeTo` implementation for importers that want to hand every
|
|
2427
|
+
* memory to `orchestrator.ingestBulkImportBatch` without custom routing.
|
|
2428
|
+
* Adapters that need per-record rate-limiting or conversation-thread linking
|
|
2429
|
+
* are free to implement their own `writeTo`.
|
|
2430
|
+
*/
|
|
2431
|
+
declare function defaultWriteMemoriesToOrchestrator(target: ImporterWriteTarget, memories: ImportedMemory[]): Promise<ImporterWriteResult>;
|
|
2432
|
+
|
|
1982
2433
|
/**
|
|
1983
2434
|
* Training-data export types.
|
|
1984
2435
|
*
|
|
@@ -2052,4 +2503,4 @@ declare function clearTrainingExportAdapters(): void;
|
|
|
2052
2503
|
*/
|
|
2053
2504
|
declare function convertMemoriesToRecords(options: TrainingExportOptions): Promise<TrainingExportRecord[]>;
|
|
2054
2505
|
|
|
2055
|
-
export { type AuditEntry, type BinaryAssetRecord, type BinaryAssetStatus, type BinaryLifecycleConfig, type BinaryLifecycleManifest, type BinaryStorageBackend, type BinaryStorageBackendConfig, BulkImportSourceAdapter, ClaudeCodeMemoryExtensionPublisher, CodexMemoryExtensionPublisher, type ConflictEntry, type ConnectorCapability, type ConnectorInstance, type ConnectorManifest, type ConnectorRegistry, type ContradictionOptions, type ContradictionPair, type ContradictionResult$1 as CurateContradictionResult, type DuplicateResult as CurateDuplicateResult, type CurateOptions, type CurateResult, type CuratedStatement, DEFAULT_GRACE_PERIOD_DAYS, DEFAULT_MAX_BINARY_SIZE_BYTES, DEFAULT_SCAN_PATTERNS, DEFAULT_TAXONOMY, type DedupOptions, type DedupResult, DiscoveredExtension, type DocFile, type DoctorCheck, type DoctorResult, type DuplicatePair, type EnrichmentAuditEntry, type EnrichmentCandidate, type EnrichmentCostTier, type EnrichmentPipelineConfig, type EnrichmentProvider, type EnrichmentProviderConfig, EnrichmentProviderRegistry, type EnrichmentResult, type EntityEnrichmentInput, type FileChange, FilesystemBackend, type GenerateOptions, type GenerateResult, HermesMemoryExtensionPublisher, type IngestionPlan, type InstallOptions, type InstallResult, LanceDbBackend, type LanguageInfo, MARKETPLACE_MANIFEST_FILENAME, MARKETPLACE_SCHEMA_VERSION, type MarketplaceConfig, type MarketplaceEntry, type MarketplaceInstallResult, type MarketplaceInstallType, type MarketplaceLogger, type MarketplaceManifest, type MarketplaceValidation, MaterializeResult, MeilisearchBackend, MemoryCategory, type MemoryEntry, type MemoryExtensionPublisher, MemoryFile, type MergeResult, type MigrationOptions, type MigrationResult, NoneBackend, type OnboardOptions, type OnboardResult, OramaBackend, PUBLISHERS, type PipelineResult, PluginConfig, type PostConsolidationMaterializeOptions, type ProjectShape, type ProvenanceEntry, type PublishContext, type PublishResult, type PublisherCapabilities, REMNIC_CITATION_FORMAT, REMNIC_MCP_TOOL_INVENTORY, REMNIC_RECALL_DECISION_RULES, REMNIC_SEMANTIC_OVERVIEW, type RemoveResult,
|
|
2506
|
+
export { type AuditEntry, type BinaryAssetRecord, type BinaryAssetStatus, type BinaryLifecycleConfig, type BinaryLifecycleManifest, type BinaryStorageBackend, type BinaryStorageBackendConfig, BulkImportSourceAdapter, ClaudeCodeMemoryExtensionPublisher, CodexMemoryExtensionPublisher, type CodingNamespaceOverlay, type CodingScopeDescription, type ConflictEntry, type ConnectorCapability, type ConnectorInstance, type ConnectorManifest, type ConnectorRegistry, type ContradictionOptions, type ContradictionPair, type ContradictionResult$1 as CurateContradictionResult, type DuplicateResult as CurateDuplicateResult, type CurateOptions, type CurateResult, type CuratedStatement, DEFAULT_GRACE_PERIOD_DAYS, DEFAULT_IMPORT_BATCH_SIZE, DEFAULT_MAX_BINARY_SIZE_BYTES, DEFAULT_SCAN_PATTERNS, DEFAULT_TAXONOMY, type DedupOptions, type DedupResult, DiscoveredExtension, type DocFile, type DoctorCheck, type DoctorResult, type DuplicatePair, type EnrichmentAuditEntry, type EnrichmentCandidate, type EnrichmentCostTier, type EnrichmentPipelineConfig, type EnrichmentProvider, type EnrichmentProviderConfig, EnrichmentProviderRegistry, type EnrichmentResult, type EntityEnrichmentInput, type FileChange, FilesystemBackend, type GenerateOptions, type GenerateResult, type GitContext, type GitInvoker, HermesMemoryExtensionPublisher, type ImportProgress, ImportTurn, type ImportedMemory, type ImporterAdapter, type ImporterParseOptions, type ImporterTransformOptions, type ImporterWriteResult, type ImporterWriteTarget, type IngestionPlan, type InstallOptions, type InstallResult, LanceDbBackend, type LanguageInfo, MARKETPLACE_MANIFEST_FILENAME, MARKETPLACE_SCHEMA_VERSION, type MarketplaceConfig, type MarketplaceEntry, type MarketplaceInstallResult, type MarketplaceInstallType, type MarketplaceLogger, type MarketplaceManifest, type MarketplaceValidation, MaterializeResult, MeilisearchBackend, MemoryCategory, type MemoryEntry, type MemoryExtensionPublisher, MemoryFile, type MergeResult, type MigrationOptions, type MigrationResult, NoneBackend, type OnboardOptions, type OnboardResult, OramaBackend, PUBLISHERS, type PipelineResult, PluginConfig, type PostConsolidationMaterializeOptions, type ProjectShape, type ProvenanceEntry, type PublishContext, type PublishResult, type PublisherCapabilities, REMNIC_CITATION_FORMAT, REMNIC_MCP_TOOL_INVENTORY, REMNIC_RECALL_DECISION_RULES, REMNIC_SEMANTIC_OVERVIEW, type RemoveResult, ResolverDecision, type ReviewAction, type ReviewCandidate, type ReviewContext, type ReviewItem, type ReviewListResult, type ReviewOptions, type ReviewResult, type RollbackResult, RolloutSummaryInput, type RunImportOptions, type RunImporterResult, type RunMaterializeOptions, type Space, type SpaceKind, type SpaceManifest, type SpacePromoteResult, type SpacePullResult, type SpacePushResult, type SpaceShareResult, type SpaceSwitchResult, type StatementProvenance, StorageManager, type SyncOptions, type SyncResult, type SyncState, Taxonomy, type TrainingExportAdapter, type TrainingExportOptions, type TrainingExportRecord, type TreeNode, type WebSearchFn, WebSearchProvider, type WebSearchProviderOptions, appendAuditEntry, branchNamespaceName, buildProcedureMarkdownBody, buildProcedureRecallSection, checkMarketplaceManifest, clearBulkImportSources, clearTrainingExportAdapters, coerceInstallExtension, convertMemoriesToRecords, createBackend, createSpace, curate, defaultEnrichmentPipelineConfig, defaultWriteMemoriesToOrchestrator, deleteSpace, describeCodingScope, doctorConnector, emptyManifest, expandTildePath, findContradictions, findDuplicates, generateContextTree, generateMarketplaceManifest, generateResolverDocument, getActiveSpace, getAuditLog, getBulkImportSource, getManifestPath, getSpacesDir, getTaxonomyDir, getTaxonomyFilePath, getTrainingExportAdapter, hostIdForConnector, importedMemoryToTurn, installConnector, installFromMarketplace, isReviewPrompt, listBulkImportSources, listConnectors, listReviewItems, listSpaces, listTrainingExportAdapters, loadManifest, loadRegistry, loadTaxonomy, manifestDir, manifestPath, matchesPatterns, mergeSpaces, migrateFromEngram, normalizeOriginUrl, onboard, packReviewContext, parseProcedureStepsFromBody, parseTouchedFiles, performReview, projectNamespaceName, promoteSpace, publisherFor, publisherForConnector, pullFromSpace, pushToSpace, rankReviewCandidates, readAuditLog, readManifest, registerBulkImportSource, registerPublisher, registerTrainingExportAdapter, removeConnector, renderExtensionsBlock, renderExtensionsFooter, resolveCategory, resolveCodingNamespaceOverlay, resolveGitContext, resolvePrincipal, rollbackFromEngramMigration, runBinaryLifecyclePipeline, runCodexMaterialize, runEnrichmentPipeline, runImporter, runPostConsolidationMaterialize, saveManifest, saveRegistry, saveTaxonomy, scanForBinaries, shareSpace, stableHash, switchSpace, syncChanges, validateImportBatchSize, validateImportRateLimit, validateMarketplaceManifest, validateSlug, validateTaxonomy, watchForChanges, writeManifest, writeMarketplaceManifest };
|