@remnic/core 9.3.613 → 9.3.615
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-cli.js +59 -58
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +4 -2
- package/dist/access-http.js +23 -23
- package/dist/access-mcp.d.ts +9 -2
- package/dist/access-mcp.js +20 -20
- package/dist/access-schema.d.ts +26 -14
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-D2J9dh_9.d.ts → access-service-CBNEKjzN.d.ts} +71 -6
- package/dist/access-service.d.ts +2 -2
- package/dist/access-service.js +17 -17
- package/dist/active-recall.js +20 -3
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/behavior-learner.js +2 -3
- package/dist/behavior-learner.js.map +1 -1
- package/dist/bootstrap.d.ts +1 -1
- package/dist/briefing.js +3 -3
- package/dist/buffer.d.ts +1 -1
- package/dist/buffer.js +1 -1
- package/dist/calibration.d.ts +5 -2
- package/dist/calibration.js +7 -5
- package/dist/calibration.js.map +1 -1
- package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-YO5QJ6L3.js} +2 -2
- package/dist/causal-consolidation.d.ts +8 -2
- package/dist/causal-consolidation.js +13 -11
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/{chunk-3BP57I6J.js → chunk-2F6NP3NT.js} +2 -1
- package/dist/{chunk-3BP57I6J.js.map → chunk-2F6NP3NT.js.map} +1 -1
- package/dist/{chunk-AU7Q3LSC.js → chunk-2QSZNTDO.js} +4 -4
- package/dist/{chunk-HSVJGWYS.js → chunk-2ROPI5OE.js} +2 -2
- package/dist/{chunk-C4SQJZAF.js → chunk-2SGJY2UY.js} +6 -3
- package/dist/chunk-2SGJY2UY.js.map +1 -0
- package/dist/{chunk-ZDTVJXIP.js → chunk-3MAONBX3.js} +13 -5
- package/dist/chunk-3MAONBX3.js.map +1 -0
- package/dist/{chunk-G3Z3QEF5.js → chunk-3PY7VHV7.js} +2 -2
- package/dist/chunk-3PY7VHV7.js.map +1 -0
- package/dist/{chunk-CF3ZF2YU.js → chunk-3QSU4NFF.js} +3 -3
- package/dist/{chunk-AJA46VX5.js → chunk-3T74IZB3.js} +11 -2
- package/dist/chunk-3T74IZB3.js.map +1 -0
- package/dist/{chunk-KVEVLBKC.js → chunk-4HFJQCJZ.js} +13 -8
- package/dist/chunk-4HFJQCJZ.js.map +1 -0
- package/dist/{chunk-KGK2QKWL.js → chunk-4R4KTDIE.js} +1 -1
- package/dist/chunk-4R4KTDIE.js.map +1 -0
- package/dist/{chunk-OI27U2HT.js → chunk-5BTCT236.js} +2 -2
- package/dist/{chunk-TH67Q46T.js → chunk-5OHHEORR.js} +64 -21
- package/dist/chunk-5OHHEORR.js.map +1 -0
- package/dist/{chunk-CO7ZO4TU.js → chunk-5VDJMYTF.js} +2 -2
- package/dist/{chunk-BFBF3XEF.js → chunk-6BDVBBBY.js} +33 -25
- package/dist/{chunk-BFBF3XEF.js.map → chunk-6BDVBBBY.js.map} +1 -1
- package/dist/{chunk-EAZGEEG2.js → chunk-6L46YAEZ.js} +45 -9
- package/dist/chunk-6L46YAEZ.js.map +1 -0
- package/dist/{chunk-YFS5OEKO.js → chunk-7MLB4NCL.js} +2 -2
- package/dist/{chunk-LZ3VEOU5.js → chunk-AL4RAJL5.js} +22 -5
- package/dist/chunk-AL4RAJL5.js.map +1 -0
- package/dist/{chunk-557IAFPD.js → chunk-APRRL26Q.js} +2 -2
- package/dist/{chunk-QDDHYAKV.js → chunk-AZDOWD2L.js} +2 -2
- package/dist/{chunk-MLT75J5S.js → chunk-B6SU7YSE.js} +3 -3
- package/dist/{chunk-FXKPZ3H6.js → chunk-BPSGLMQ4.js} +2 -2
- package/dist/{chunk-2NLLXCJG.js → chunk-BXLOS5AJ.js} +2 -2
- package/dist/{chunk-NOMEVTUD.js → chunk-C6C7XVKG.js} +5 -4
- package/dist/chunk-C6C7XVKG.js.map +1 -0
- package/dist/{chunk-XKIQZXUB.js → chunk-CI7RKSRE.js} +7 -1
- package/dist/chunk-CI7RKSRE.js.map +1 -0
- package/dist/{chunk-IK34DVAC.js → chunk-CIOMS6DI.js} +2 -2
- package/dist/{chunk-2I5JGH3M.js → chunk-CYEPCZN5.js} +2 -2
- package/dist/{chunk-2I5JGH3M.js.map → chunk-CYEPCZN5.js.map} +1 -1
- package/dist/{chunk-JHMFYY7L.js → chunk-DCGT4FPP.js} +13 -5
- package/dist/chunk-DCGT4FPP.js.map +1 -0
- package/dist/{chunk-7DZRO2DC.js → chunk-DEPRLVLK.js} +2 -2
- package/dist/{chunk-CSKLPDN6.js → chunk-DEVUWMME.js} +52 -19
- package/dist/chunk-DEVUWMME.js.map +1 -0
- package/dist/{chunk-DHGSZ3UD.js → chunk-DGNQRNLL.js} +2 -2
- package/dist/{chunk-X7Y7WX73.js → chunk-DQEMWVMT.js} +1 -1
- package/dist/{chunk-HJNQQICM.js → chunk-EXUAP5LH.js} +108 -51
- package/dist/chunk-EXUAP5LH.js.map +1 -0
- package/dist/chunk-FAV25DUZ.js +12 -0
- package/dist/chunk-FAV25DUZ.js.map +1 -0
- package/dist/{chunk-ETUPBUHB.js → chunk-GDASG7NC.js} +2 -2
- package/dist/{chunk-L227SKTB.js → chunk-GDB4J2H3.js} +17 -1
- package/dist/chunk-GDB4J2H3.js.map +1 -0
- package/dist/{chunk-IP73YCZP.js → chunk-GLPBYIXN.js} +4 -2
- package/dist/chunk-GLPBYIXN.js.map +1 -0
- package/dist/{chunk-4HP7HIE3.js → chunk-HP5FMB6L.js} +2 -2
- package/dist/{chunk-EVZFIAPG.js → chunk-IBTZEBUD.js} +23 -10
- package/dist/chunk-IBTZEBUD.js.map +1 -0
- package/dist/{chunk-DOX2CG6Y.js → chunk-IEUU7O4F.js} +2 -2
- package/dist/{chunk-EUML3N6B.js → chunk-IMA6GU4Y.js} +3 -3
- package/dist/chunk-IMA6GU4Y.js.map +1 -0
- package/dist/{chunk-JNANKJLN.js → chunk-JOASJWQR.js} +2 -2
- package/dist/chunk-JOASJWQR.js.map +1 -0
- package/dist/{chunk-WSGF57U2.js → chunk-JQDZQ4TB.js} +2 -2
- package/dist/{chunk-HINSGUA7.js → chunk-KBL3JJR6.js} +9 -13
- package/dist/chunk-KBL3JJR6.js.map +1 -0
- package/dist/{chunk-IOTENEVL.js → chunk-KGLPJROV.js} +57 -50
- package/dist/chunk-KGLPJROV.js.map +1 -0
- package/dist/{chunk-W7L6HXUC.js → chunk-LXOM6IQU.js} +2 -2
- package/dist/{chunk-G6R5UD3Q.js → chunk-MGN7VHWQ.js} +42 -1
- package/dist/{chunk-G6R5UD3Q.js.map → chunk-MGN7VHWQ.js.map} +1 -1
- package/dist/{chunk-DLJ4IR6M.js → chunk-MHQC2WU2.js} +2 -2
- package/dist/chunk-MHQC2WU2.js.map +1 -0
- package/dist/{chunk-5RPTH6AU.js → chunk-NM5NQYJE.js} +20 -19
- package/dist/chunk-NM5NQYJE.js.map +1 -0
- package/dist/{chunk-6JGNHWCI.js → chunk-OBIRVF36.js} +3 -3
- package/dist/{chunk-CHCA44C3.js → chunk-ODPLEWB6.js} +3 -3
- package/dist/chunk-ODPLEWB6.js.map +1 -0
- package/dist/{chunk-HENLZHIT.js → chunk-OIF36KGD.js} +7 -4
- package/dist/chunk-OIF36KGD.js.map +1 -0
- package/dist/{chunk-GUPISBV2.js → chunk-PP2JH3GP.js} +2 -2
- package/dist/{chunk-OXJBNGBK.js → chunk-PSUB67YB.js} +2 -2
- package/dist/{chunk-UWY7GIVS.js → chunk-PYIFUBRK.js} +45 -13
- package/dist/chunk-PYIFUBRK.js.map +1 -0
- package/dist/{chunk-KIB7SDIJ.js → chunk-Q6YIJGXJ.js} +2 -2
- package/dist/{chunk-ZT3EGNLR.js → chunk-QPD426WT.js} +2 -2
- package/dist/{chunk-RLV3PQGH.js → chunk-QVO4YOB7.js} +6 -6
- package/dist/{chunk-GMAG2HS4.js → chunk-RG3LBSGH.js} +46 -9
- package/dist/chunk-RG3LBSGH.js.map +1 -0
- package/dist/{chunk-XSWKORGM.js → chunk-S53OYO3F.js} +3 -1
- package/dist/chunk-S53OYO3F.js.map +1 -0
- package/dist/{chunk-YCN4BVDK.js → chunk-SCPFRKIT.js} +4 -2
- package/dist/chunk-SCPFRKIT.js.map +1 -0
- package/dist/{chunk-NZPF2SYV.js → chunk-T7N6KQGS.js} +138 -5
- package/dist/chunk-T7N6KQGS.js.map +1 -0
- package/dist/{chunk-VJXSUAO7.js → chunk-TNOWU6RP.js} +13 -10
- package/dist/chunk-TNOWU6RP.js.map +1 -0
- package/dist/{chunk-PCI747N2.js → chunk-TZVQQTG4.js} +48 -19
- package/dist/chunk-TZVQQTG4.js.map +1 -0
- package/dist/{chunk-KQAFEZQX.js → chunk-VDX2J7OX.js} +2 -2
- package/dist/{chunk-IK7DCC5H.js → chunk-VMGLYN42.js} +2 -2
- package/dist/{chunk-KM2A35EO.js → chunk-WB3LYXC5.js} +11 -7
- package/dist/chunk-WB3LYXC5.js.map +1 -0
- package/dist/{chunk-PPPZY2EU.js → chunk-WD2W4234.js} +9 -3
- package/dist/chunk-WD2W4234.js.map +1 -0
- package/dist/{chunk-NSKYFGDL.js → chunk-X4QQB7O6.js} +2 -2
- package/dist/{chunk-HPWVAEET.js → chunk-X6IRLNOO.js} +3 -7
- package/dist/chunk-X6IRLNOO.js.map +1 -0
- package/dist/{chunk-46GJIW5M.js → chunk-XAZOWLW4.js} +5 -5
- package/dist/{chunk-46GJIW5M.js.map → chunk-XAZOWLW4.js.map} +1 -1
- package/dist/{chunk-XPSVGJYA.js → chunk-YRMKDTKF.js} +12 -9
- package/dist/chunk-YRMKDTKF.js.map +1 -0
- package/dist/{chunk-6ZZP4EJF.js → chunk-ZJR7VG5L.js} +3 -3
- package/dist/{chunk-6ZZP4EJF.js.map → chunk-ZJR7VG5L.js.map} +1 -1
- package/dist/{chunk-2QANQKSQ.js → chunk-ZK32E74R.js} +156 -45
- package/dist/chunk-ZK32E74R.js.map +1 -0
- package/dist/{cli-OrfKXNU4.d.ts → cli-Cw729yLf.d.ts} +6 -2
- package/dist/cli.d.ts +3 -3
- package/dist/cli.js +61 -60
- package/dist/compounding/engine.js +3 -3
- package/dist/compounding/preference-consolidator.js +39 -11
- package/dist/compounding/preference-consolidator.js.map +1 -1
- package/dist/config.js +1 -1
- package/dist/connectors/codex-materialize-runner.js +3 -3
- package/dist/connectors/index.js +3 -3
- package/dist/consolidation-provenance-check.js +1 -1
- package/dist/contradiction/index.js +4 -4
- package/dist/conversation-index/backend.js +2 -2
- package/dist/conversation-index/indexer.js +1 -1
- package/dist/cross-namespace-budget.js +1 -1
- package/dist/enrichment/index.js +1 -1
- package/dist/entity-retrieval.js +3 -3
- package/dist/evals.js +1 -1
- package/dist/explicit-capture.d.ts +11 -1
- package/dist/explicit-capture.js +1 -1
- package/dist/extraction-judge.js +8 -1
- package/dist/extraction.js +2 -2
- package/dist/fallback-llm.d.ts +23 -6
- package/dist/fallback-llm.js +5 -3
- package/dist/{first-start-migration-GYJWIH36.js → first-start-migration-FF7YFGRP.js} +6 -6
- package/dist/index.d.ts +3 -3
- package/dist/index.js +95 -94
- package/dist/index.js.map +1 -1
- package/dist/lcm/archive.js +2 -2
- package/dist/lcm/engine.js +5 -5
- package/dist/lcm/index.js +7 -7
- package/dist/lcm/summarizer.js +3 -3
- package/dist/maintenance/memory-governance-cron.d.ts +6 -4
- package/dist/maintenance/memory-governance-cron.js +1 -1
- package/dist/maintenance/memory-governance.js +3 -3
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
- package/dist/maintenance/rebuild-memory-projection.js +4 -4
- package/dist/mcp-memory-inspector-app.d.ts +2 -2
- package/dist/mcp-memory-inspector-app.js +1 -1
- package/dist/migrate/from-engram.js +1 -1
- package/dist/namespaces/migrate.js +16 -15
- package/dist/namespaces/search.js +12 -11
- package/dist/namespaces/storage.js +3 -3
- package/dist/network/webdav.d.ts +2 -0
- package/dist/network/webdav.js +1 -1
- package/dist/objective-state-writers.js +2 -2
- package/dist/operator-toolkit.d.ts +3 -1
- package/dist/operator-toolkit.js +21 -20
- package/dist/{orchestrator-DTRQG75J.d.ts → orchestrator-CqWOjfgl.d.ts} +46 -3
- package/dist/orchestrator.d.ts +1 -1
- package/dist/orchestrator.js +48 -45
- package/dist/patterns-cli.js +1 -1
- package/dist/qmd-recall-cache.d.ts +2 -0
- package/dist/qmd-recall-cache.js +1 -1
- package/dist/qmd.d.ts +37 -2
- package/dist/qmd.js +4 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-planner-llm.d.ts +57 -0
- package/dist/recall-planner-llm.js +167 -0
- package/dist/recall-planner-llm.js.map +1 -0
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.js +2 -2
- package/dist/resume-bundles.js +2 -2
- package/dist/retrieval-agents.js +2 -2
- package/dist/routing/store.js +1 -1
- package/dist/schemas.d.ts +22 -22
- package/dist/search/factory.js +11 -10
- package/dist/search/index.js +11 -10
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +3 -2
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +3 -2
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/noop-backend.js +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +3 -2
- package/dist/search/port.d.ts +6 -1
- package/dist/search/port.js +7 -0
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/search/remote-backend.js +1 -1
- package/dist/semantic-consolidation.js +4 -4
- package/dist/semantic-rule-promotion.js +3 -3
- package/dist/semantic-rule-verifier.js +3 -3
- package/dist/session-observer-state.js +1 -1
- package/dist/storage.js +2 -2
- package/dist/summarizer.js +2 -2
- package/dist/temporal-index.js +1 -1
- package/dist/{tier-stats-SKML2OSF.js → tier-stats-3LYQ3VV5.js} +3 -3
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/export-sqlite.js +1 -1
- package/dist/transfer/types.d.ts +12 -12
- package/dist/types.d.ts +32 -0
- package/dist/types.js +1 -1
- package/dist/utility-learner.js +1 -1
- package/dist/utility-runtime.js +2 -2
- package/dist/verified-recall.js +3 -3
- package/dist/work/board.js +2 -2
- package/dist/work/storage.d.ts +2 -0
- package/dist/work/storage.js +1 -1
- package/package.json +1 -1
- package/src/access-http.ts +24 -10
- package/src/access-mcp.test.ts +160 -0
- package/src/access-mcp.ts +72 -7
- package/src/access-schema.ts +11 -0
- package/src/access-service-coding-write.test.ts +478 -0
- package/src/access-service.ts +237 -32
- package/src/active-recall.test.ts +40 -0
- package/src/active-recall.ts +19 -2
- package/src/behavior-learner.ts +5 -3
- package/src/buffer-session.test.ts +58 -0
- package/src/buffer-surprise-trigger.test.ts +4 -18
- package/src/buffer.ts +39 -11
- package/src/calibration.ts +10 -4
- package/src/causal-consolidation.test.ts +47 -2
- package/src/causal-consolidation.ts +13 -9
- package/src/cli.ts +19 -4
- package/src/compounding/engine.ts +2 -0
- package/src/compounding/preference-consolidator.test.ts +292 -0
- package/src/compounding/preference-consolidator.ts +55 -19
- package/src/config.test.ts +213 -0
- package/src/config.ts +175 -4
- package/src/connectors/codex-materialize-runner.ts +7 -4
- package/src/consolidation-provenance-check.ts +24 -5
- package/src/conversation-index/indexer.test.ts +22 -0
- package/src/conversation-index/indexer.ts +7 -3
- package/src/cross-namespace-budget.test.ts +44 -21
- package/src/cross-namespace-budget.ts +2 -2
- package/src/enrichment/pipeline.ts +11 -16
- package/src/evals.ts +1 -1
- package/src/explicit-capture.ts +19 -2
- package/src/extraction-judge-chain.test.ts +55 -0
- package/src/extraction-judge.ts +7 -9
- package/src/extraction.ts +16 -5
- package/src/fallback-llm.test.ts +600 -1
- package/src/fallback-llm.ts +91 -22
- package/src/maintenance/memory-governance-cron.ts +39 -29
- package/src/mcp-memory-inspector-app.ts +54 -12
- package/src/message-parts/index.ts +6 -0
- package/src/message-parts/message-parts.test.ts +30 -0
- package/src/migrate/from-engram.ts +19 -5
- package/src/namespaces/search.test.ts +15 -2
- package/src/namespaces/search.ts +1 -1
- package/src/network/webdav.ts +61 -21
- package/src/operator-toolkit.ts +6 -2
- package/src/orchestrator.ts +173 -20
- package/src/qmd-client.test.ts +85 -0
- package/src/qmd-recall-cache.test.ts +16 -0
- package/src/qmd-recall-cache.ts +7 -0
- package/src/qmd.test.ts +54 -0
- package/src/qmd.ts +119 -19
- package/src/recall-planner-llm.test.ts +224 -0
- package/src/recall-planner-llm.ts +289 -0
- package/src/routing/store.ts +4 -8
- package/src/search/factory.ts +3 -0
- package/src/search/lancedb-backend.ts +15 -3
- package/src/search/meilisearch-backend.ts +70 -7
- package/src/search/noop-backend.ts +5 -1
- package/src/search/orama-backend.ts +15 -3
- package/src/search/port.ts +15 -0
- package/src/search/remote-backend.ts +5 -1
- package/src/session-observer-state.ts +1 -1
- package/src/summarizer.ts +3 -3
- package/src/temporal-index.test.ts +18 -0
- package/src/temporal-index.ts +45 -0
- package/src/training-export/cli-date-validation.test.ts +36 -0
- package/src/training-export/date-parse.ts +21 -2
- package/src/transfer/export-sqlite.ts +3 -0
- package/src/types.ts +35 -0
- package/src/utility-learner.ts +1 -0
- package/src/work/storage.ts +23 -0
- package/dist/chunk-2QANQKSQ.js.map +0 -1
- package/dist/chunk-5RPTH6AU.js.map +0 -1
- package/dist/chunk-AJA46VX5.js.map +0 -1
- package/dist/chunk-C4SQJZAF.js.map +0 -1
- package/dist/chunk-CHCA44C3.js.map +0 -1
- package/dist/chunk-CSKLPDN6.js.map +0 -1
- package/dist/chunk-DLJ4IR6M.js.map +0 -1
- package/dist/chunk-EAZGEEG2.js.map +0 -1
- package/dist/chunk-EUML3N6B.js.map +0 -1
- package/dist/chunk-EVZFIAPG.js.map +0 -1
- package/dist/chunk-G3Z3QEF5.js.map +0 -1
- package/dist/chunk-GMAG2HS4.js.map +0 -1
- package/dist/chunk-HENLZHIT.js.map +0 -1
- package/dist/chunk-HINSGUA7.js.map +0 -1
- package/dist/chunk-HJNQQICM.js.map +0 -1
- package/dist/chunk-HPWVAEET.js.map +0 -1
- package/dist/chunk-IOTENEVL.js.map +0 -1
- package/dist/chunk-IP73YCZP.js.map +0 -1
- package/dist/chunk-JHMFYY7L.js.map +0 -1
- package/dist/chunk-JNANKJLN.js.map +0 -1
- package/dist/chunk-KGK2QKWL.js.map +0 -1
- package/dist/chunk-KM2A35EO.js.map +0 -1
- package/dist/chunk-KVEVLBKC.js.map +0 -1
- package/dist/chunk-L227SKTB.js.map +0 -1
- package/dist/chunk-LZ3VEOU5.js.map +0 -1
- package/dist/chunk-NOMEVTUD.js.map +0 -1
- package/dist/chunk-NZPF2SYV.js.map +0 -1
- package/dist/chunk-PCI747N2.js.map +0 -1
- package/dist/chunk-PPPZY2EU.js.map +0 -1
- package/dist/chunk-TH67Q46T.js.map +0 -1
- package/dist/chunk-UWY7GIVS.js.map +0 -1
- package/dist/chunk-VJXSUAO7.js.map +0 -1
- package/dist/chunk-XKIQZXUB.js.map +0 -1
- package/dist/chunk-XPSVGJYA.js.map +0 -1
- package/dist/chunk-XSWKORGM.js.map +0 -1
- package/dist/chunk-YCN4BVDK.js.map +0 -1
- package/dist/chunk-ZDTVJXIP.js.map +0 -1
- /package/dist/{capsule-crypto-7FJQINUR.js.map → capsule-crypto-YO5QJ6L3.js.map} +0 -0
- /package/dist/{chunk-AU7Q3LSC.js.map → chunk-2QSZNTDO.js.map} +0 -0
- /package/dist/{chunk-HSVJGWYS.js.map → chunk-2ROPI5OE.js.map} +0 -0
- /package/dist/{chunk-CF3ZF2YU.js.map → chunk-3QSU4NFF.js.map} +0 -0
- /package/dist/{chunk-OI27U2HT.js.map → chunk-5BTCT236.js.map} +0 -0
- /package/dist/{chunk-CO7ZO4TU.js.map → chunk-5VDJMYTF.js.map} +0 -0
- /package/dist/{chunk-YFS5OEKO.js.map → chunk-7MLB4NCL.js.map} +0 -0
- /package/dist/{chunk-557IAFPD.js.map → chunk-APRRL26Q.js.map} +0 -0
- /package/dist/{chunk-QDDHYAKV.js.map → chunk-AZDOWD2L.js.map} +0 -0
- /package/dist/{chunk-MLT75J5S.js.map → chunk-B6SU7YSE.js.map} +0 -0
- /package/dist/{chunk-FXKPZ3H6.js.map → chunk-BPSGLMQ4.js.map} +0 -0
- /package/dist/{chunk-2NLLXCJG.js.map → chunk-BXLOS5AJ.js.map} +0 -0
- /package/dist/{chunk-IK34DVAC.js.map → chunk-CIOMS6DI.js.map} +0 -0
- /package/dist/{chunk-7DZRO2DC.js.map → chunk-DEPRLVLK.js.map} +0 -0
- /package/dist/{chunk-DHGSZ3UD.js.map → chunk-DGNQRNLL.js.map} +0 -0
- /package/dist/{chunk-X7Y7WX73.js.map → chunk-DQEMWVMT.js.map} +0 -0
- /package/dist/{chunk-ETUPBUHB.js.map → chunk-GDASG7NC.js.map} +0 -0
- /package/dist/{chunk-4HP7HIE3.js.map → chunk-HP5FMB6L.js.map} +0 -0
- /package/dist/{chunk-DOX2CG6Y.js.map → chunk-IEUU7O4F.js.map} +0 -0
- /package/dist/{chunk-WSGF57U2.js.map → chunk-JQDZQ4TB.js.map} +0 -0
- /package/dist/{chunk-W7L6HXUC.js.map → chunk-LXOM6IQU.js.map} +0 -0
- /package/dist/{chunk-6JGNHWCI.js.map → chunk-OBIRVF36.js.map} +0 -0
- /package/dist/{chunk-GUPISBV2.js.map → chunk-PP2JH3GP.js.map} +0 -0
- /package/dist/{chunk-OXJBNGBK.js.map → chunk-PSUB67YB.js.map} +0 -0
- /package/dist/{chunk-KIB7SDIJ.js.map → chunk-Q6YIJGXJ.js.map} +0 -0
- /package/dist/{chunk-ZT3EGNLR.js.map → chunk-QPD426WT.js.map} +0 -0
- /package/dist/{chunk-RLV3PQGH.js.map → chunk-QVO4YOB7.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-VDX2J7OX.js.map} +0 -0
- /package/dist/{chunk-IK7DCC5H.js.map → chunk-VMGLYN42.js.map} +0 -0
- /package/dist/{chunk-NSKYFGDL.js.map → chunk-X4QQB7O6.js.map} +0 -0
- /package/dist/{first-start-migration-GYJWIH36.js.map → first-start-migration-FF7YFGRP.js.map} +0 -0
- /package/dist/{tier-stats-SKML2OSF.js.map → tier-stats-3LYQ3VV5.js.map} +0 -0
package/dist/orchestrator.js
CHANGED
|
@@ -22,41 +22,42 @@ import {
|
|
|
22
22
|
resolveEffectiveRecallMode,
|
|
23
23
|
resolvePersistedMemoryRelativePath,
|
|
24
24
|
resolveRecallModeDecision,
|
|
25
|
+
resolveRecallModeDecisionAsync,
|
|
25
26
|
resolveRecentThreadMemoryPaths,
|
|
26
27
|
sanitizeSessionKeyForFilename,
|
|
27
28
|
shouldFilterLifecycleRecallCandidate,
|
|
28
29
|
summarizeGraphShadowComparison
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-EXUAP5LH.js";
|
|
30
31
|
import "./chunk-5RIRL3XL.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-4HFJQCJZ.js";
|
|
33
|
+
import "./chunk-6BDVBBBY.js";
|
|
33
34
|
import "./chunk-HHLLAQGZ.js";
|
|
34
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-QVO4YOB7.js";
|
|
36
|
+
import "./chunk-7N4KAIGN.js";
|
|
35
37
|
import "./chunk-TPDBFYEG.js";
|
|
36
38
|
import "./chunk-KCYE2MZM.js";
|
|
37
39
|
import "./chunk-7XYTQGCC.js";
|
|
38
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-5VDJMYTF.js";
|
|
39
41
|
import "./chunk-UWK5OXUJ.js";
|
|
42
|
+
import "./chunk-TECVW3JP.js";
|
|
40
43
|
import "./chunk-T2PO5MUF.js";
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-IP73YCZP.js";
|
|
44
|
+
import "./chunk-HP5FMB6L.js";
|
|
45
|
+
import "./chunk-GLPBYIXN.js";
|
|
44
46
|
import "./chunk-DRD2Q7HQ.js";
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-LXOM6IQU.js";
|
|
48
|
+
import "./chunk-S75M5ZRK.js";
|
|
47
49
|
import "./chunk-ECZU5BJH.js";
|
|
48
50
|
import "./chunk-UHGBNIOS.js";
|
|
49
51
|
import "./chunk-VWT3F4IV.js";
|
|
50
52
|
import "./chunk-K5O2QY6T.js";
|
|
51
53
|
import "./chunk-MDYG7VI7.js";
|
|
52
54
|
import "./chunk-VOUOLGIP.js";
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-46GJIW5M.js";
|
|
55
|
+
import "./chunk-XAZOWLW4.js";
|
|
55
56
|
import "./chunk-XJNBEDFE.js";
|
|
56
|
-
import "./chunk-
|
|
57
|
+
import "./chunk-MHQC2WU2.js";
|
|
57
58
|
import "./chunk-OZKZ2TRP.js";
|
|
58
|
-
import "./chunk-
|
|
59
|
-
import "./chunk-
|
|
59
|
+
import "./chunk-2ROPI5OE.js";
|
|
60
|
+
import "./chunk-MGN7VHWQ.js";
|
|
60
61
|
import "./chunk-5IZL4DCV.js";
|
|
61
62
|
import "./chunk-X7XN6YU4.js";
|
|
62
63
|
import "./chunk-452WDNFO.js";
|
|
@@ -64,7 +65,7 @@ import "./chunk-E3VODCC3.js";
|
|
|
64
65
|
import "./chunk-YDBIWGNI.js";
|
|
65
66
|
import "./chunk-7DHTMOND.js";
|
|
66
67
|
import "./chunk-2IT7WFYE.js";
|
|
67
|
-
import "./chunk-
|
|
68
|
+
import "./chunk-SCPFRKIT.js";
|
|
68
69
|
import "./chunk-ZZTOURJI.js";
|
|
69
70
|
import "./chunk-XKXKSQU7.js";
|
|
70
71
|
import "./chunk-3GPTTA4J.js";
|
|
@@ -74,15 +75,15 @@ import "./chunk-H63EDPFJ.js";
|
|
|
74
75
|
import "./chunk-PD6O7AXF.js";
|
|
75
76
|
import "./chunk-YAZNBMNF.js";
|
|
76
77
|
import "./chunk-7YX23JBA.js";
|
|
77
|
-
import "./chunk-
|
|
78
|
-
import "./chunk-
|
|
78
|
+
import "./chunk-2SGJY2UY.js";
|
|
79
|
+
import "./chunk-WB3LYXC5.js";
|
|
79
80
|
import "./chunk-4RA3C3EV.js";
|
|
80
81
|
import "./chunk-ROZJACKP.js";
|
|
81
82
|
import "./chunk-54V4BZWP.js";
|
|
82
83
|
import "./chunk-XZ4WBBB5.js";
|
|
83
84
|
import "./chunk-77NAFXUD.js";
|
|
84
85
|
import "./chunk-DB5A3NHS.js";
|
|
85
|
-
import "./chunk-
|
|
86
|
+
import "./chunk-IEUU7O4F.js";
|
|
86
87
|
import "./chunk-6NKAQ74D.js";
|
|
87
88
|
import "./chunk-OAZ5MFUB.js";
|
|
88
89
|
import "./chunk-PYPOFEMK.js";
|
|
@@ -93,46 +94,47 @@ import "./chunk-6HEM6HTQ.js";
|
|
|
93
94
|
import "./chunk-XCAZF7KQ.js";
|
|
94
95
|
import "./chunk-3PG3H5TD.js";
|
|
95
96
|
import "./chunk-OD4FM2U7.js";
|
|
96
|
-
import "./chunk-
|
|
97
|
-
import "./chunk-
|
|
97
|
+
import "./chunk-DEPRLVLK.js";
|
|
98
|
+
import "./chunk-C6C7XVKG.js";
|
|
98
99
|
import "./chunk-JFEKNTX7.js";
|
|
99
100
|
import "./chunk-JLNBQWZ2.js";
|
|
100
101
|
import "./chunk-2PRQG7PV.js";
|
|
101
|
-
import "./chunk-
|
|
102
|
-
import "./chunk-
|
|
103
|
-
import "./chunk-3BP57I6J.js";
|
|
102
|
+
import "./chunk-X6IRLNOO.js";
|
|
103
|
+
import "./chunk-2F6NP3NT.js";
|
|
104
104
|
import "./chunk-TERNBNJB.js";
|
|
105
|
+
import "./chunk-QPD426WT.js";
|
|
105
106
|
import "./chunk-W4RVMTHR.js";
|
|
106
|
-
import "./chunk-
|
|
107
|
+
import "./chunk-PP2JH3GP.js";
|
|
107
108
|
import "./chunk-ZRWB5D4H.js";
|
|
108
109
|
import "./chunk-A6D7A2FW.js";
|
|
109
110
|
import "./chunk-FF4KLI5W.js";
|
|
110
111
|
import "./chunk-SFQ6QNL7.js";
|
|
111
|
-
import "./chunk-
|
|
112
|
-
import "./chunk-
|
|
113
|
-
import "./chunk-
|
|
112
|
+
import "./chunk-ZJR7VG5L.js";
|
|
113
|
+
import "./chunk-YRMKDTKF.js";
|
|
114
|
+
import "./chunk-JOASJWQR.js";
|
|
114
115
|
import "./chunk-EWLQPEO6.js";
|
|
115
|
-
import "./chunk-
|
|
116
|
-
import "./chunk-
|
|
117
|
-
import "./chunk-
|
|
118
|
-
import "./chunk-
|
|
119
|
-
import "./chunk-CINZGPSJ.js";
|
|
116
|
+
import "./chunk-3MAONBX3.js";
|
|
117
|
+
import "./chunk-RG3LBSGH.js";
|
|
118
|
+
import "./chunk-CYEPCZN5.js";
|
|
119
|
+
import "./chunk-DCGT4FPP.js";
|
|
120
120
|
import "./chunk-Q4CAQGKQ.js";
|
|
121
|
-
import "./chunk-
|
|
121
|
+
import "./chunk-CINZGPSJ.js";
|
|
122
|
+
import "./chunk-VMGLYN42.js";
|
|
122
123
|
import "./chunk-ZFXCQPNO.js";
|
|
123
|
-
import "./chunk-
|
|
124
|
+
import "./chunk-Q6YIJGXJ.js";
|
|
124
125
|
import "./chunk-ORFGK3XI.js";
|
|
125
|
-
import "./chunk-
|
|
126
|
+
import "./chunk-OIF36KGD.js";
|
|
126
127
|
import "./chunk-7DTASS5T.js";
|
|
127
128
|
import "./chunk-KFY3SGN7.js";
|
|
128
|
-
import "./chunk-
|
|
129
|
+
import "./chunk-TZVQQTG4.js";
|
|
130
|
+
import "./chunk-FAV25DUZ.js";
|
|
129
131
|
import "./chunk-33JBK2XP.js";
|
|
130
132
|
import "./chunk-TQNRI55H.js";
|
|
131
133
|
import "./chunk-6GUG4YNM.js";
|
|
132
134
|
import "./chunk-JXS5PDQ7.js";
|
|
133
135
|
import "./chunk-6GDHLVJC.js";
|
|
134
136
|
import "./chunk-BEUDU7Y4.js";
|
|
135
|
-
import "./chunk-
|
|
137
|
+
import "./chunk-3PY7VHV7.js";
|
|
136
138
|
import "./chunk-AJU4PJGY.js";
|
|
137
139
|
import "./chunk-FZZ2QTJI.js";
|
|
138
140
|
import "./chunk-3ONXXHQO.js";
|
|
@@ -141,8 +143,8 @@ import "./chunk-OKTXM5H4.js";
|
|
|
141
143
|
import "./chunk-3UXOZBHV.js";
|
|
142
144
|
import "./chunk-WCYKT2DE.js";
|
|
143
145
|
import "./chunk-4WMCPJWX.js";
|
|
144
|
-
import "./chunk-
|
|
145
|
-
import "./chunk-
|
|
146
|
+
import "./chunk-IBTZEBUD.js";
|
|
147
|
+
import "./chunk-DEVUWMME.js";
|
|
146
148
|
import "./chunk-B5XMS73R.js";
|
|
147
149
|
import "./chunk-7SI52C65.js";
|
|
148
150
|
import "./chunk-L2EXJQJP.js";
|
|
@@ -158,21 +160,21 @@ import "./chunk-PVGDJXVK.js";
|
|
|
158
160
|
import "./chunk-OADWQ5CR.js";
|
|
159
161
|
import "./chunk-EDQVAMQI.js";
|
|
160
162
|
import "./chunk-JGSKJHF7.js";
|
|
161
|
-
import "./chunk-
|
|
162
|
-
import "./chunk-
|
|
163
|
+
import "./chunk-BPSGLMQ4.js";
|
|
164
|
+
import "./chunk-CI7RKSRE.js";
|
|
163
165
|
import "./chunk-UEY3VB6W.js";
|
|
164
166
|
import "./chunk-EI6V5UXY.js";
|
|
165
167
|
import "./chunk-QY7YA7OL.js";
|
|
166
168
|
import "./chunk-NNVTUXEB.js";
|
|
167
169
|
import "./chunk-QDW3E4RD.js";
|
|
168
|
-
import "./chunk-
|
|
170
|
+
import "./chunk-IMA6GU4Y.js";
|
|
169
171
|
import "./chunk-XL7FK7PJ.js";
|
|
170
172
|
import "./chunk-2LSZVONP.js";
|
|
171
173
|
import "./chunk-DEUNUKTD.js";
|
|
172
|
-
import "./chunk-
|
|
174
|
+
import "./chunk-7MLB4NCL.js";
|
|
173
175
|
import "./chunk-5UZXUTVO.js";
|
|
174
176
|
import "./chunk-4H5ZJHEN.js";
|
|
175
|
-
import "./chunk-
|
|
177
|
+
import "./chunk-4R4KTDIE.js";
|
|
176
178
|
import "./chunk-RULE4VG5.js";
|
|
177
179
|
import "./chunk-SCU65EZI.js";
|
|
178
180
|
import "./chunk-KILOTVIF.js";
|
|
@@ -227,6 +229,7 @@ export {
|
|
|
227
229
|
resolveEffectiveRecallMode,
|
|
228
230
|
resolvePersistedMemoryRelativePath,
|
|
229
231
|
resolveRecallModeDecision,
|
|
232
|
+
resolveRecallModeDecisionAsync,
|
|
230
233
|
resolveRecentThreadMemoryPaths,
|
|
231
234
|
sanitizeSessionKeyForFilename,
|
|
232
235
|
shouldFilterLifecycleRecallCandidate,
|
package/dist/patterns-cli.js
CHANGED
|
@@ -17,6 +17,8 @@ interface QmdRecallCacheKeyOptions {
|
|
|
17
17
|
memoryDir?: string;
|
|
18
18
|
collection?: string;
|
|
19
19
|
searchOptions?: SearchQueryOptions;
|
|
20
|
+
searchStrategy?: string;
|
|
21
|
+
subprocessStrategy?: string;
|
|
20
22
|
}
|
|
21
23
|
declare function buildQmdRecallCacheKey(options: QmdRecallCacheKeyOptions): string;
|
|
22
24
|
declare function getCachedQmdRecall<T>(cacheKey: string, options: {
|
package/dist/qmd-recall-cache.js
CHANGED
package/dist/qmd.d.ts
CHANGED
|
@@ -26,10 +26,31 @@ interface QmdClientOptions {
|
|
|
26
26
|
qmdEmbedModel?: string;
|
|
27
27
|
qmdRerankModel?: string;
|
|
28
28
|
qmdGenerateModel?: string;
|
|
29
|
+
/** Daemon search plan; default "hybrid" preserves lex+vec+hyde. Issue #1335. */
|
|
30
|
+
qmdSearchStrategy?: QmdSearchStrategy;
|
|
31
|
+
/** Subprocess fallback command; default "query" keeps LLM expansion. Issue #1335. */
|
|
32
|
+
qmdSubprocessStrategy?: QmdSubprocessStrategy;
|
|
33
|
+
/** Per-call daemon search timeout in ms; default 8000. Issue #1335. */
|
|
34
|
+
qmdDaemonTimeoutMs?: number;
|
|
29
35
|
}
|
|
30
36
|
type QmdVersionTuple = [number, number, number];
|
|
31
37
|
type QmdChunkStrategy = "auto" | "regex";
|
|
32
38
|
type QmdStructuredSearchType = "lex" | "vec" | "hyde";
|
|
39
|
+
/**
|
|
40
|
+
* Daemon search plan. Issue #1335.
|
|
41
|
+
* - "hybrid" → lex + vec + hyde (DEFAULT — full recall; runs an embedding pass
|
|
42
|
+
* plus a HyDE generate pass, which dominates latency on CPU-only models).
|
|
43
|
+
* - "lex-vec" → lex + vec (drops the expensive HyDE generate leg).
|
|
44
|
+
* - "lex" → lex only (BM25; fastest, no model inference).
|
|
45
|
+
*/
|
|
46
|
+
type QmdSearchStrategy = "hybrid" | "lex-vec" | "lex";
|
|
47
|
+
/**
|
|
48
|
+
* Subprocess fallback command (used only when the daemon is unavailable). Issue #1335.
|
|
49
|
+
* - "query" → `qmd query` (DEFAULT — LLM query expansion + rerank; see CLAUDE.md
|
|
50
|
+
* gotcha #7, this is intentional and must remain the default).
|
|
51
|
+
* - "search" → `qmd search` (BM25-only; fast, but no expansion/rerank).
|
|
52
|
+
*/
|
|
53
|
+
type QmdSubprocessStrategy = "query" | "search";
|
|
33
54
|
interface QmdStructuredSearch {
|
|
34
55
|
type: QmdStructuredSearchType;
|
|
35
56
|
query: string;
|
|
@@ -92,6 +113,17 @@ declare function getQmdPostInstallProbeTargets(qmdPath: string, qmdPathSource: "
|
|
|
92
113
|
qmdPath: string;
|
|
93
114
|
source: "auto-path" | "auto-fallback";
|
|
94
115
|
}>;
|
|
116
|
+
/**
|
|
117
|
+
* Build the structured sub-queries the daemon `query` tool runs in one request.
|
|
118
|
+
*
|
|
119
|
+
* The default `"hybrid"` plan (lex + vec + hyde) intentionally exercises QMD's
|
|
120
|
+
* full RRF + rerank path for best recall. On CPU-only models the `hyde` leg
|
|
121
|
+
* (1.7B generate + embed) dominates wall-clock — operators on constrained
|
|
122
|
+
* hardware can trade recall for latency via `qmdSearchStrategy` (issue #1335)
|
|
123
|
+
* without losing the default behavior. A per-call `structuredSearches` override
|
|
124
|
+
* always wins so callers with stronger query-document structure stay in control.
|
|
125
|
+
*/
|
|
126
|
+
declare function buildDefaultStructuredSearches(query: string, options?: SearchQueryOptions, strategy?: QmdSearchStrategy): QmdStructuredSearch[];
|
|
95
127
|
declare function parseQmdExplain(value: unknown): QmdSearchExplain | undefined;
|
|
96
128
|
declare function getQmdCommandName(args: string[]): string;
|
|
97
129
|
declare class QmdClient implements SearchBackend {
|
|
@@ -115,6 +147,9 @@ declare class QmdClient implements SearchBackend {
|
|
|
115
147
|
private readonly qmdCandidateLimit?;
|
|
116
148
|
private readonly qmdQueryRerankEnabled;
|
|
117
149
|
private readonly qmdIndexName?;
|
|
150
|
+
private readonly qmdSearchStrategy;
|
|
151
|
+
private readonly qmdSubprocessStrategy;
|
|
152
|
+
private readonly daemonTimeoutMs;
|
|
118
153
|
private readonly qmdRuntimeEnv;
|
|
119
154
|
private qmdPathSource;
|
|
120
155
|
private cliVersion;
|
|
@@ -209,7 +244,7 @@ declare class QmdClient implements SearchBackend {
|
|
|
209
244
|
private runUpdateForCollection;
|
|
210
245
|
embed(): Promise<void>;
|
|
211
246
|
embedCollection(collection: string): Promise<void>;
|
|
212
|
-
ensureCollection(memoryDir: string, execution?: SearchExecutionOptions): Promise<"present" | "missing" | "unknown" | "skipped">;
|
|
247
|
+
ensureCollection(memoryDir: string, collectionOrExecution?: string | SearchExecutionOptions, execution?: SearchExecutionOptions): Promise<"present" | "missing" | "unknown" | "skipped">;
|
|
213
248
|
}
|
|
214
249
|
|
|
215
|
-
export { QMD_SUPPORTED_VERSION, type QmdCapabilities, type QmdChunkStrategy, QmdClient, type QmdClientOptions, type QmdDoctorReport, type QmdStructuredSearch, type QmdStructuredSearchType, type QmdVersionStatus, type QmdVersionTuple, compareQmdVersions, getQmdCommandName, getQmdPostInstallProbeTargets, parseQmdExplain, parseQmdVersion, parseQmdVersionOutput, resolveQmdCapabilities, shouldAutoUpgradeQmd, versionAtLeast };
|
|
250
|
+
export { QMD_SUPPORTED_VERSION, type QmdCapabilities, type QmdChunkStrategy, QmdClient, type QmdClientOptions, type QmdDoctorReport, type QmdSearchStrategy, type QmdStructuredSearch, type QmdStructuredSearchType, type QmdSubprocessStrategy, type QmdVersionStatus, type QmdVersionTuple, buildDefaultStructuredSearches, compareQmdVersions, getQmdCommandName, getQmdPostInstallProbeTargets, parseQmdExplain, parseQmdVersion, parseQmdVersionOutput, resolveQmdCapabilities, shouldAutoUpgradeQmd, versionAtLeast };
|
package/dist/qmd.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
QMD_SUPPORTED_VERSION,
|
|
3
3
|
QmdClient,
|
|
4
|
+
buildDefaultStructuredSearches,
|
|
4
5
|
compareQmdVersions,
|
|
5
6
|
getQmdCommandName,
|
|
6
7
|
getQmdPostInstallProbeTargets,
|
|
@@ -10,7 +11,8 @@ import {
|
|
|
10
11
|
resolveQmdCapabilities,
|
|
11
12
|
shouldAutoUpgradeQmd,
|
|
12
13
|
versionAtLeast
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TZVQQTG4.js";
|
|
15
|
+
import "./chunk-FAV25DUZ.js";
|
|
14
16
|
import "./chunk-PVGDJXVK.js";
|
|
15
17
|
import "./chunk-NNVTUXEB.js";
|
|
16
18
|
import "./chunk-CPPS65WS.js";
|
|
@@ -20,6 +22,7 @@ import "./chunk-PZ5AY32C.js";
|
|
|
20
22
|
export {
|
|
21
23
|
QMD_SUPPORTED_VERSION,
|
|
22
24
|
QmdClient,
|
|
25
|
+
buildDefaultStructuredSearches,
|
|
23
26
|
compareQmdVersions,
|
|
24
27
|
getQmdCommandName,
|
|
25
28
|
getQmdPostInstallProbeTargets,
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
toRecallExplainJson,
|
|
6
6
|
toRecallExplainText,
|
|
7
7
|
toRecallXraySnapshotFromLegacy
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PSUB67YB.js";
|
|
9
9
|
import "./chunk-SOBJ6NEY.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-BPSGLMQ4.js";
|
|
11
|
+
import "./chunk-4R4KTDIE.js";
|
|
12
12
|
import "./chunk-AC5LO7IU.js";
|
|
13
13
|
import "./chunk-SOAU2OE2.js";
|
|
14
14
|
import "./chunk-PZ5AY32C.js";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { RecallPlanMode, PluginConfig } from './types.js';
|
|
2
|
+
import { FallbackLlmClient, FallbackLlmOptions } from './fallback-llm.js';
|
|
3
|
+
import './types-BliCnURB.js';
|
|
4
|
+
import './index-DJ9QWMw-.js';
|
|
5
|
+
import './resolve-provider-secret.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* LLM-based recall planning (issue #1367, Option C).
|
|
9
|
+
*
|
|
10
|
+
* Classifies an incoming prompt into a {@link RecallPlanMode} using an LLM
|
|
11
|
+
* instead of (or alongside) the regex heuristic in {@link planRecallMode}.
|
|
12
|
+
*
|
|
13
|
+
* Provider-agnostic by construction: it routes through {@link FallbackLlmClient},
|
|
14
|
+
* which resolves the model chain from gateway providers (OpenAI, Anthropic,
|
|
15
|
+
* Ollama, Codex, …) or gateway agent personas / `taskModelChain`. Nothing here
|
|
16
|
+
* is hard-coded to a single provider or to OpenAI's Responses API — the API
|
|
17
|
+
* dialect is chosen per-provider by the client based on each provider's `api`
|
|
18
|
+
* field. The configured `recallPlannerModel` is tried first, with the broader
|
|
19
|
+
* task chain (and the gateway default) as resilient fallbacks.
|
|
20
|
+
*
|
|
21
|
+
* Invariants:
|
|
22
|
+
* - Never throws to the caller (gotcha #13). Any LLM failure, timeout, empty
|
|
23
|
+
* response, or unavailable backend falls back to the heuristic result and
|
|
24
|
+
* sets `fallbackUsed: true` (gotcha #34 — failures are distinct from a valid
|
|
25
|
+
* classification).
|
|
26
|
+
* - When `recallPlannerLlmEnabled` is false the LLM is never contacted.
|
|
27
|
+
*/
|
|
28
|
+
type RecallPlannerSource = "llm" | "heuristic" | "heuristic-fallback";
|
|
29
|
+
interface RecallPlannerLlmResult {
|
|
30
|
+
/** The mode to act on. */
|
|
31
|
+
mode: RecallPlanMode;
|
|
32
|
+
/** The heuristic mode, always computed (the fallback floor / shadow baseline). */
|
|
33
|
+
heuristicMode: RecallPlanMode;
|
|
34
|
+
/** Where `mode` came from. */
|
|
35
|
+
source: RecallPlannerSource;
|
|
36
|
+
/** Short human-readable rationale (LLM reason, or why we fell back). */
|
|
37
|
+
reason: string;
|
|
38
|
+
/** Model that actually served the classification, when an LLM was used. */
|
|
39
|
+
modelUsed?: string;
|
|
40
|
+
/** Wall-clock spent in the LLM call (0 when no call was made). */
|
|
41
|
+
latencyMs: number;
|
|
42
|
+
/** True when the LLM was enabled but we had to fall back to the heuristic. */
|
|
43
|
+
fallbackUsed: boolean;
|
|
44
|
+
}
|
|
45
|
+
declare function resolveRecallPlannerLlmOptions(config: Pick<PluginConfig, "modelSource" | "taskModelChain" | "gatewayAgentId" | "recallPlannerModel" | "recallPlannerTimeoutMs">): FallbackLlmOptions;
|
|
46
|
+
/**
|
|
47
|
+
* Plan the recall mode for `prompt`, optionally consulting an LLM.
|
|
48
|
+
*
|
|
49
|
+
* Always safe to call: returns the heuristic result when the LLM is disabled,
|
|
50
|
+
* unavailable, or fails.
|
|
51
|
+
*
|
|
52
|
+
* @param llm injectable client (tests pass a stub); constructed from gateway
|
|
53
|
+
* config when omitted.
|
|
54
|
+
*/
|
|
55
|
+
declare function planRecallModeLLM(prompt: string, hints: string[] | undefined, config: PluginConfig, llm?: FallbackLlmClient, signal?: AbortSignal): Promise<RecallPlannerLlmResult>;
|
|
56
|
+
|
|
57
|
+
export { type RecallPlannerLlmResult, type RecallPlannerSource, planRecallModeLLM, resolveRecallPlannerLlmOptions };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import {
|
|
2
|
+
planRecallMode
|
|
3
|
+
} from "./chunk-PD6O7AXF.js";
|
|
4
|
+
import {
|
|
5
|
+
FallbackLlmClient,
|
|
6
|
+
fallbackLlmRuntimeContextFromConfig,
|
|
7
|
+
gatewayTaskChainOptions
|
|
8
|
+
} from "./chunk-DEVUWMME.js";
|
|
9
|
+
import "./chunk-B5XMS73R.js";
|
|
10
|
+
import "./chunk-7SI52C65.js";
|
|
11
|
+
import "./chunk-L2EXJQJP.js";
|
|
12
|
+
import "./chunk-UZB5KHKX.js";
|
|
13
|
+
import "./chunk-RK6F44Y6.js";
|
|
14
|
+
import "./chunk-EYIEWJNI.js";
|
|
15
|
+
import "./chunk-JUC24CTX.js";
|
|
16
|
+
import {
|
|
17
|
+
log
|
|
18
|
+
} from "./chunk-2ODBA7MQ.js";
|
|
19
|
+
import "./chunk-PZ5AY32C.js";
|
|
20
|
+
|
|
21
|
+
// src/recall-planner-llm.ts
|
|
22
|
+
import { z } from "zod";
|
|
23
|
+
var PLANNER_SCHEMA = z.object({
|
|
24
|
+
// gotcha #2: optional fields use .optional().nullable()
|
|
25
|
+
mode: z.enum(["no_recall", "minimal", "full", "graph_mode"]),
|
|
26
|
+
reason: z.string().max(280).optional().nullable()
|
|
27
|
+
});
|
|
28
|
+
var SYSTEM_PROMPT = [
|
|
29
|
+
"You are a recall-planning classifier for a long-term memory system.",
|
|
30
|
+
"Given the user's latest message, decide how much stored memory should be retrieved before the assistant responds.",
|
|
31
|
+
'Reply with a single JSON object: {"mode": <one of no_recall|minimal|full|graph_mode>, "reason": <short string>}.',
|
|
32
|
+
"",
|
|
33
|
+
"Modes:",
|
|
34
|
+
'- "no_recall": low-information acknowledgements or chit-chat with nothing to look up (e.g. "ok", "thanks", "sounds good"). Retrieve nothing.',
|
|
35
|
+
'- "minimal": short, self-contained operational directives that rarely need history (e.g. "restart the service", "run the tests", "show status"). Retrieve a little.',
|
|
36
|
+
'- "full": anything memory-seeking, analytical, or a question that benefits from prior context, decisions, or facts. This is the safe default when unsure.',
|
|
37
|
+
'- "graph_mode": queries about timelines, sequences, history, causal chains, or root cause ("how did we get here", "what led to this regression"). Retrieve relationship/graph context.',
|
|
38
|
+
"",
|
|
39
|
+
'When uncertain, prefer "full" over dropping recall. Never invent facts; only classify intent.'
|
|
40
|
+
].join("\n");
|
|
41
|
+
function clampPrompt(prompt, maxChars) {
|
|
42
|
+
const safeMax = Number.isFinite(maxChars) && maxChars > 0 ? Math.floor(maxChars) : 4e3;
|
|
43
|
+
if (prompt.length <= safeMax) return prompt;
|
|
44
|
+
return prompt.slice(0, safeMax);
|
|
45
|
+
}
|
|
46
|
+
function clampHints(hints, maxHints) {
|
|
47
|
+
if (!Array.isArray(hints) || hints.length === 0) return [];
|
|
48
|
+
const safeMax = Number.isFinite(maxHints) && maxHints > 0 ? Math.floor(maxHints) : 0;
|
|
49
|
+
if (safeMax <= 0) return [];
|
|
50
|
+
const cleaned = [];
|
|
51
|
+
for (const hint of hints) {
|
|
52
|
+
if (typeof hint !== "string") continue;
|
|
53
|
+
const trimmed = hint.trim();
|
|
54
|
+
if (trimmed.length === 0) continue;
|
|
55
|
+
cleaned.push(trimmed);
|
|
56
|
+
if (cleaned.length >= safeMax) break;
|
|
57
|
+
}
|
|
58
|
+
return cleaned;
|
|
59
|
+
}
|
|
60
|
+
function buildMessages(prompt, hints, config) {
|
|
61
|
+
const clampedPrompt = clampPrompt(prompt, config.recallPlannerMaxPromptChars);
|
|
62
|
+
const userParts = [`User message:
|
|
63
|
+
${clampedPrompt}`];
|
|
64
|
+
if (hints.length > 0) {
|
|
65
|
+
userParts.push(
|
|
66
|
+
`
|
|
67
|
+
Recent memory topics (for grounding only, do not treat as the message):
|
|
68
|
+
- ${hints.join("\n- ")}`
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
userParts.push('\nRespond with JSON only: {"mode": "...", "reason": "..."}.');
|
|
72
|
+
return [
|
|
73
|
+
{ role: "system", content: SYSTEM_PROMPT },
|
|
74
|
+
{ role: "user", content: userParts.join("\n") }
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
function qualifiedPlannerModel(recallPlannerModel) {
|
|
78
|
+
if (typeof recallPlannerModel !== "string") return void 0;
|
|
79
|
+
const trimmed = recallPlannerModel.trim();
|
|
80
|
+
return trimmed.includes("/") ? trimmed : void 0;
|
|
81
|
+
}
|
|
82
|
+
function resolveRecallPlannerLlmOptions(config) {
|
|
83
|
+
const chainOptions = config.modelSource === "gateway" ? gatewayTaskChainOptions(config) : {};
|
|
84
|
+
return {
|
|
85
|
+
...chainOptions,
|
|
86
|
+
model: qualifiedPlannerModel(config.recallPlannerModel),
|
|
87
|
+
temperature: 0,
|
|
88
|
+
maxTokens: 64,
|
|
89
|
+
timeoutMs: typeof config.recallPlannerTimeoutMs === "number" && config.recallPlannerTimeoutMs > 0 ? config.recallPlannerTimeoutMs : 1500
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
var warnedNoRoutingSignatures = /* @__PURE__ */ new Set();
|
|
93
|
+
function heuristicResult(heuristicMode, source, reason, latencyMs, fallbackUsed) {
|
|
94
|
+
return { mode: heuristicMode, heuristicMode, source, reason, latencyMs, fallbackUsed };
|
|
95
|
+
}
|
|
96
|
+
async function planRecallModeLLM(prompt, hints, config, llm, signal) {
|
|
97
|
+
const heuristicMode = planRecallMode(prompt);
|
|
98
|
+
if (!config.recallPlannerLlmEnabled) {
|
|
99
|
+
return heuristicResult(heuristicMode, "heuristic", "llm-disabled", 0, false);
|
|
100
|
+
}
|
|
101
|
+
if (signal?.aborted) {
|
|
102
|
+
return heuristicResult(heuristicMode, "heuristic-fallback", "aborted", 0, true);
|
|
103
|
+
}
|
|
104
|
+
const safePrompt = typeof prompt === "string" ? prompt.trim() : "";
|
|
105
|
+
if (safePrompt.length === 0) {
|
|
106
|
+
return heuristicResult(heuristicMode, "heuristic", "empty-prompt", 0, false);
|
|
107
|
+
}
|
|
108
|
+
const client = llm ?? new FallbackLlmClient(
|
|
109
|
+
config.gatewayConfig,
|
|
110
|
+
fallbackLlmRuntimeContextFromConfig(config)
|
|
111
|
+
);
|
|
112
|
+
const options = { ...resolveRecallPlannerLlmOptions(config), signal };
|
|
113
|
+
const availabilityProbe = {
|
|
114
|
+
agentId: options.agentId,
|
|
115
|
+
modelChain: options.modelChain
|
|
116
|
+
};
|
|
117
|
+
if (!client.isAvailable(availabilityProbe) && !options.model) {
|
|
118
|
+
const signature = `${config.modelSource}:${config.recallPlannerModel ?? ""}`;
|
|
119
|
+
if (!warnedNoRoutingSignatures.has(signature)) {
|
|
120
|
+
warnedNoRoutingSignatures.add(signature);
|
|
121
|
+
log.warn(
|
|
122
|
+
"[recall-planner] recallPlannerLlmEnabled is on but no routable model resolves \u2014 set recallPlannerModel to a 'provider/model' value or configure a gateway model chain. Falling back to the heuristic planner."
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
return heuristicResult(heuristicMode, "heuristic-fallback", "llm-no-model", 0, true);
|
|
126
|
+
}
|
|
127
|
+
const clampedHints = clampHints(hints, config.recallPlannerMaxMemoryHints);
|
|
128
|
+
const messages = buildMessages(safePrompt, clampedHints, config);
|
|
129
|
+
const start = Date.now();
|
|
130
|
+
try {
|
|
131
|
+
const detailed = await client.parseWithSchemaDetailed(messages, PLANNER_SCHEMA, options);
|
|
132
|
+
const latencyMs = Date.now() - start;
|
|
133
|
+
if (!detailed?.result) {
|
|
134
|
+
return heuristicResult(heuristicMode, "heuristic-fallback", "llm-empty", latencyMs, true);
|
|
135
|
+
}
|
|
136
|
+
const mode = detailed.result.mode;
|
|
137
|
+
const reason = typeof detailed.result.reason === "string" && detailed.result.reason.trim().length > 0 ? detailed.result.reason.trim() : "llm-classified";
|
|
138
|
+
return {
|
|
139
|
+
mode,
|
|
140
|
+
heuristicMode,
|
|
141
|
+
source: "llm",
|
|
142
|
+
reason,
|
|
143
|
+
modelUsed: detailed.modelUsed,
|
|
144
|
+
latencyMs,
|
|
145
|
+
fallbackUsed: false
|
|
146
|
+
};
|
|
147
|
+
} catch (err) {
|
|
148
|
+
const latencyMs = Date.now() - start;
|
|
149
|
+
if (signal?.aborted) {
|
|
150
|
+
return heuristicResult(heuristicMode, "heuristic-fallback", "aborted", latencyMs, true);
|
|
151
|
+
}
|
|
152
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
153
|
+
log.warn(`[recall-planner] LLM failed, falling back to heuristic: ${message}`);
|
|
154
|
+
return heuristicResult(
|
|
155
|
+
heuristicMode,
|
|
156
|
+
"heuristic-fallback",
|
|
157
|
+
`llm-error:${message}`,
|
|
158
|
+
latencyMs,
|
|
159
|
+
true
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
export {
|
|
164
|
+
planRecallModeLLM,
|
|
165
|
+
resolveRecallPlannerLlmOptions
|
|
166
|
+
};
|
|
167
|
+
//# sourceMappingURL=recall-planner-llm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/recall-planner-llm.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { PluginConfig, RecallPlanMode } from \"./types.js\";\nimport { planRecallMode } from \"./intent.js\";\nimport {\n FallbackLlmClient,\n fallbackLlmRuntimeContextFromConfig,\n gatewayTaskChainOptions,\n type FallbackLlmOptions,\n} from \"./fallback-llm.js\";\nimport { log } from \"./logger.js\";\n\n/**\n * LLM-based recall planning (issue #1367, Option C).\n *\n * Classifies an incoming prompt into a {@link RecallPlanMode} using an LLM\n * instead of (or alongside) the regex heuristic in {@link planRecallMode}.\n *\n * Provider-agnostic by construction: it routes through {@link FallbackLlmClient},\n * which resolves the model chain from gateway providers (OpenAI, Anthropic,\n * Ollama, Codex, …) or gateway agent personas / `taskModelChain`. Nothing here\n * is hard-coded to a single provider or to OpenAI's Responses API — the API\n * dialect is chosen per-provider by the client based on each provider's `api`\n * field. The configured `recallPlannerModel` is tried first, with the broader\n * task chain (and the gateway default) as resilient fallbacks.\n *\n * Invariants:\n * - Never throws to the caller (gotcha #13). Any LLM failure, timeout, empty\n * response, or unavailable backend falls back to the heuristic result and\n * sets `fallbackUsed: true` (gotcha #34 — failures are distinct from a valid\n * classification).\n * - When `recallPlannerLlmEnabled` is false the LLM is never contacted.\n */\n\nexport type RecallPlannerSource = \"llm\" | \"heuristic\" | \"heuristic-fallback\";\n\nexport interface RecallPlannerLlmResult {\n /** The mode to act on. */\n mode: RecallPlanMode;\n /** The heuristic mode, always computed (the fallback floor / shadow baseline). */\n heuristicMode: RecallPlanMode;\n /** Where `mode` came from. */\n source: RecallPlannerSource;\n /** Short human-readable rationale (LLM reason, or why we fell back). */\n reason: string;\n /** Model that actually served the classification, when an LLM was used. */\n modelUsed?: string;\n /** Wall-clock spent in the LLM call (0 when no call was made). */\n latencyMs: number;\n /** True when the LLM was enabled but we had to fall back to the heuristic. */\n fallbackUsed: boolean;\n}\n\nconst PLANNER_SCHEMA = z.object({\n // gotcha #2: optional fields use .optional().nullable()\n mode: z.enum([\"no_recall\", \"minimal\", \"full\", \"graph_mode\"]),\n reason: z.string().max(280).optional().nullable(),\n});\n\nconst SYSTEM_PROMPT = [\n \"You are a recall-planning classifier for a long-term memory system.\",\n \"Given the user's latest message, decide how much stored memory should be retrieved before the assistant responds.\",\n \"Reply with a single JSON object: {\\\"mode\\\": <one of no_recall|minimal|full|graph_mode>, \\\"reason\\\": <short string>}.\",\n \"\",\n \"Modes:\",\n '- \"no_recall\": low-information acknowledgements or chit-chat with nothing to look up (e.g. \"ok\", \"thanks\", \"sounds good\"). Retrieve nothing.',\n '- \"minimal\": short, self-contained operational directives that rarely need history (e.g. \"restart the service\", \"run the tests\", \"show status\"). Retrieve a little.',\n '- \"full\": anything memory-seeking, analytical, or a question that benefits from prior context, decisions, or facts. This is the safe default when unsure.',\n '- \"graph_mode\": queries about timelines, sequences, history, causal chains, or root cause (\"how did we get here\", \"what led to this regression\"). Retrieve relationship/graph context.',\n \"\",\n \"When uncertain, prefer \\\"full\\\" over dropping recall. Never invent facts; only classify intent.\",\n].join(\"\\n\");\n\n/** Clamp a planner prompt to the configured character budget. */\nfunction clampPrompt(prompt: string, maxChars: number): string {\n const safeMax = Number.isFinite(maxChars) && maxChars > 0 ? Math.floor(maxChars) : 4000;\n if (prompt.length <= safeMax) return prompt;\n return prompt.slice(0, safeMax);\n}\n\n/** Trim and cap the optional memory hints used to ground the classification. */\nfunction clampHints(hints: string[] | undefined, maxHints: number): string[] {\n if (!Array.isArray(hints) || hints.length === 0) return [];\n const safeMax = Number.isFinite(maxHints) && maxHints > 0 ? Math.floor(maxHints) : 0;\n if (safeMax <= 0) return [];\n const cleaned: string[] = [];\n for (const hint of hints) {\n if (typeof hint !== \"string\") continue;\n const trimmed = hint.trim();\n if (trimmed.length === 0) continue;\n cleaned.push(trimmed);\n if (cleaned.length >= safeMax) break;\n }\n return cleaned;\n}\n\nfunction buildMessages(\n prompt: string,\n hints: string[],\n config: PluginConfig,\n): Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }> {\n const clampedPrompt = clampPrompt(prompt, config.recallPlannerMaxPromptChars);\n const userParts = [`User message:\\n${clampedPrompt}`];\n if (hints.length > 0) {\n userParts.push(\n `\\nRecent memory topics (for grounding only, do not treat as the message):\\n- ${hints.join(\"\\n- \")}`,\n );\n }\n userParts.push('\\nRespond with JSON only: {\"mode\": \"...\", \"reason\": \"...\"}.');\n return [\n { role: \"system\", content: SYSTEM_PROMPT },\n { role: \"user\", content: userParts.join(\"\\n\") },\n ];\n}\n\n/**\n * Resolve the FallbackLlmClient routing options for the recall planner.\n *\n * - The dedicated `recallPlannerModel` is tried first (as the `model`\n * override — it is prepended to the chain by FallbackLlmClient). If it does\n * not resolve to a configured provider it is silently skipped, so a stale\n * default never breaks routing.\n * - In gateway mode the shared `gatewayTaskChainOptions` (taskModelChain >\n * gatewayAgentId, gotcha #22) is layered in as the fallback chain, plus the\n * implicit gateway default appended by the client.\n * - In plugin mode only the explicit model + gateway providers apply.\n */\n/**\n * A `recallPlannerModel` value is only usable as a FallbackLlmClient `model`\n * override when it is provider-qualified (`provider/model`). The client's\n * `parseModelString` rejects bare names, so forwarding a bare value (e.g. the\n * legacy default `\"gpt-5.5\"`) would log \"invalid model format\" on every call\n * and never resolve. Bare values are dropped so routing falls through to the\n * gateway chain / agent / default instead (issue #1367 review on PR #1428).\n */\nfunction qualifiedPlannerModel(recallPlannerModel: string | undefined): string | undefined {\n if (typeof recallPlannerModel !== \"string\") return undefined;\n const trimmed = recallPlannerModel.trim();\n return trimmed.includes(\"/\") ? trimmed : undefined;\n}\n\nexport function resolveRecallPlannerLlmOptions(\n config: Pick<\n PluginConfig,\n \"modelSource\" | \"taskModelChain\" | \"gatewayAgentId\" | \"recallPlannerModel\" | \"recallPlannerTimeoutMs\"\n >,\n): FallbackLlmOptions {\n const chainOptions =\n config.modelSource === \"gateway\" ? gatewayTaskChainOptions(config) : {};\n return {\n ...chainOptions,\n model: qualifiedPlannerModel(config.recallPlannerModel),\n temperature: 0,\n maxTokens: 64,\n timeoutMs:\n typeof config.recallPlannerTimeoutMs === \"number\" && config.recallPlannerTimeoutMs > 0\n ? config.recallPlannerTimeoutMs\n : 1500,\n };\n}\n\n// One-time warning per distinct routing signature so an opted-in operator with\n// no usable model learns why planning silently uses the heuristic, without\n// spamming a line on every recall.\nconst warnedNoRoutingSignatures = new Set<string>();\n\nfunction heuristicResult(\n heuristicMode: RecallPlanMode,\n source: RecallPlannerSource,\n reason: string,\n latencyMs: number,\n fallbackUsed: boolean,\n): RecallPlannerLlmResult {\n return { mode: heuristicMode, heuristicMode, source, reason, latencyMs, fallbackUsed };\n}\n\n/**\n * Plan the recall mode for `prompt`, optionally consulting an LLM.\n *\n * Always safe to call: returns the heuristic result when the LLM is disabled,\n * unavailable, or fails.\n *\n * @param llm injectable client (tests pass a stub); constructed from gateway\n * config when omitted.\n */\nexport async function planRecallModeLLM(\n prompt: string,\n hints: string[] | undefined,\n config: PluginConfig,\n llm?: FallbackLlmClient,\n signal?: AbortSignal,\n): Promise<RecallPlannerLlmResult> {\n const heuristicMode = planRecallMode(prompt);\n\n if (!config.recallPlannerLlmEnabled) {\n return heuristicResult(heuristicMode, \"heuristic\", \"llm-disabled\", 0, false);\n }\n\n // Participate in the recall cancellation contract: if the outer recall is\n // already aborted (outer timeout / reset / session abort), don't start an LLM\n // round-trip — fall back to the heuristic immediately (#1428 review).\n if (signal?.aborted) {\n return heuristicResult(heuristicMode, \"heuristic-fallback\", \"aborted\", 0, true);\n }\n\n const safePrompt = typeof prompt === \"string\" ? prompt.trim() : \"\";\n if (safePrompt.length === 0) {\n // Empty prompts never need an LLM round-trip.\n return heuristicResult(heuristicMode, \"heuristic\", \"empty-prompt\", 0, false);\n }\n\n const client =\n llm ??\n new FallbackLlmClient(\n config.gatewayConfig,\n fallbackLlmRuntimeContextFromConfig(config),\n );\n\n // Forward the recall abort signal so an aborted/timed-out outer recall can\n // cancel an in-flight planner call (FallbackLlmClient honors `signal`).\n const options = { ...resolveRecallPlannerLlmOptions(config), signal };\n\n // Availability check uses the same routing options so plugin-mode / empty\n // chains short-circuit to the heuristic without a network attempt. `model`\n // here is already provider-qualified (bare names were dropped), so a present\n // model means the override is genuinely routable.\n const availabilityProbe = {\n agentId: options.agentId,\n modelChain: options.modelChain,\n };\n if (!client.isAvailable(availabilityProbe) && !options.model) {\n // Opted-in but nothing routable resolves (e.g. plugin mode with the bare\n // default `recallPlannerModel` and no gateway chain). Warn once so it's not\n // a silent no-op, then fall back to the heuristic.\n const signature = `${config.modelSource}:${config.recallPlannerModel ?? \"\"}`;\n if (!warnedNoRoutingSignatures.has(signature)) {\n warnedNoRoutingSignatures.add(signature);\n log.warn(\n \"[recall-planner] recallPlannerLlmEnabled is on but no routable model resolves — \" +\n \"set recallPlannerModel to a 'provider/model' value or configure a gateway model chain. \" +\n \"Falling back to the heuristic planner.\",\n );\n }\n return heuristicResult(heuristicMode, \"heuristic-fallback\", \"llm-no-model\", 0, true);\n }\n\n const clampedHints = clampHints(hints, config.recallPlannerMaxMemoryHints);\n const messages = buildMessages(safePrompt, clampedHints, config);\n\n const start = Date.now();\n try {\n const detailed = await client.parseWithSchemaDetailed(messages, PLANNER_SCHEMA, options);\n const latencyMs = Date.now() - start;\n if (!detailed?.result) {\n // Distinguish failure from a valid empty (gotcha #34): a null here means\n // no parseable classification, so fall back to the heuristic.\n return heuristicResult(heuristicMode, \"heuristic-fallback\", \"llm-empty\", latencyMs, true);\n }\n const mode = detailed.result.mode;\n const reason =\n typeof detailed.result.reason === \"string\" && detailed.result.reason.trim().length > 0\n ? detailed.result.reason.trim()\n : \"llm-classified\";\n return {\n mode,\n heuristicMode,\n source: \"llm\",\n reason,\n modelUsed: detailed.modelUsed,\n latencyMs,\n fallbackUsed: false,\n };\n } catch (err) {\n const latencyMs = Date.now() - start;\n if (signal?.aborted) {\n // Cancelled by the outer recall — expected, not an error worth warning on.\n return heuristicResult(heuristicMode, \"heuristic-fallback\", \"aborted\", latencyMs, true);\n }\n const message = err instanceof Error ? err.message : String(err);\n log.warn(`[recall-planner] LLM failed, falling back to heuristic: ${message}`);\n return heuristicResult(\n heuristicMode,\n \"heuristic-fallback\",\n `llm-error:${message}`,\n latencyMs,\n true,\n );\n }\n}\n"],"mappings":"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","names":[]}
|
package/dist/recall-xray-cli.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
parseXrayBudgetFlag,
|
|
3
3
|
parseXrayCliOptions,
|
|
4
4
|
parseXrayDisclosureFlag
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-3QSU4NFF.js";
|
|
6
|
+
import "./chunk-PSUB67YB.js";
|
|
7
7
|
import "./chunk-SOBJ6NEY.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-BPSGLMQ4.js";
|
|
9
|
+
import "./chunk-4R4KTDIE.js";
|
|
10
10
|
import "./chunk-AC5LO7IU.js";
|
|
11
11
|
import "./chunk-SOAU2OE2.js";
|
|
12
12
|
import "./chunk-PZ5AY32C.js";
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
renderXrayJson,
|
|
6
6
|
renderXrayMarkdown,
|
|
7
7
|
renderXrayText
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PSUB67YB.js";
|
|
9
9
|
import "./chunk-SOBJ6NEY.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-BPSGLMQ4.js";
|
|
11
|
+
import "./chunk-4R4KTDIE.js";
|
|
12
12
|
import "./chunk-AC5LO7IU.js";
|
|
13
13
|
import "./chunk-SOAU2OE2.js";
|
|
14
14
|
import "./chunk-PZ5AY32C.js";
|
package/dist/recall-xray.js
CHANGED
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
estimateRecallTokens,
|
|
6
6
|
isRecallXrayServedBy,
|
|
7
7
|
summarizeDisclosureTokens
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-BPSGLMQ4.js";
|
|
9
|
+
import "./chunk-4R4KTDIE.js";
|
|
10
10
|
import "./chunk-AC5LO7IU.js";
|
|
11
11
|
import "./chunk-SOAU2OE2.js";
|
|
12
12
|
import "./chunk-PZ5AY32C.js";
|