nexus-agents 4.23.0 → 4.26.3

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.
Files changed (132) hide show
  1. package/dist/{child-mcp-config-FEK2HK5L.js → child-mcp-config-TUGS6R7G.js} +2 -2
  2. package/dist/{chunk-MSHZHT5X.js → chunk-4Z7HJXDZ.js} +2 -2
  3. package/dist/{chunk-LLGK3NRY.js → chunk-5UGFRPRO.js} +2 -2
  4. package/dist/{chunk-K2DSQJEH.js → chunk-72QXEEC3.js} +6 -6
  5. package/dist/{chunk-OYFKB64X.js → chunk-7GWPLERY.js} +200 -131
  6. package/dist/chunk-7GWPLERY.js.map +1 -0
  7. package/dist/{chunk-NMFXYX7R.js → chunk-7POSQDHD.js} +2 -2
  8. package/dist/chunk-BAXVGVEV.js +7 -0
  9. package/dist/chunk-BAXVGVEV.js.map +1 -0
  10. package/dist/{chunk-3SMGCYGN.js → chunk-BAYBBQKK.js} +2 -2
  11. package/dist/{chunk-R3H46BNY.js → chunk-BQC3QOHD.js} +2 -2
  12. package/dist/{chunk-XQEWXGJ5.js → chunk-COOYB7X3.js} +47 -17
  13. package/dist/chunk-COOYB7X3.js.map +1 -0
  14. package/dist/{chunk-K7RASYIZ.js → chunk-EYBUDKXP.js} +3 -3
  15. package/dist/{chunk-YFDE4AM3.js → chunk-GQDKGV34.js} +7 -7
  16. package/dist/{chunk-EPZCODRK.js → chunk-HCI3SOTV.js} +15 -8
  17. package/dist/chunk-HCI3SOTV.js.map +1 -0
  18. package/dist/{chunk-PUGRS4KW.js → chunk-IFSLM46W.js} +10 -5
  19. package/dist/chunk-IFSLM46W.js.map +1 -0
  20. package/dist/{chunk-LMTBX4GZ.js → chunk-IIQZ77BJ.js} +2 -2
  21. package/dist/{chunk-GGQOP4VK.js → chunk-IWGOE6JT.js} +5 -5
  22. package/dist/{chunk-IC6WLIGJ.js → chunk-JBOKMCJB.js} +4 -4
  23. package/dist/{chunk-HPGPOZG4.js → chunk-K3UKVFL4.js} +5 -5
  24. package/dist/{chunk-LMENHZQ6.js → chunk-KUNQLRUR.js} +4 -4
  25. package/dist/{chunk-2FYFHAI4.js → chunk-MLX4CMGD.js} +2 -2
  26. package/dist/{chunk-AWMXPIMK.js → chunk-MMN77SDX.js} +2 -2
  27. package/dist/{chunk-5KKJKQVE.js → chunk-NSKEVAK2.js} +2 -2
  28. package/dist/{chunk-LSJ2EPOF.js → chunk-OGVHWFYR.js} +17 -4
  29. package/dist/chunk-OGVHWFYR.js.map +1 -0
  30. package/dist/{chunk-32IMMUXP.js → chunk-PHGT3XKE.js} +2 -2
  31. package/dist/{chunk-K2A24T36.js → chunk-QQFPLIJ4.js} +2 -2
  32. package/dist/{chunk-2MPJ7UDR.js → chunk-QQKT5X2M.js} +99 -56
  33. package/dist/chunk-QQKT5X2M.js.map +1 -0
  34. package/dist/{chunk-YVW743K3.js → chunk-RDJWMBUQ.js} +2 -2
  35. package/dist/{chunk-GVLMTQ46.js → chunk-RNOT2H4K.js} +3 -3
  36. package/dist/{chunk-ADC7YEU2.js → chunk-SLDESHM5.js} +90 -43
  37. package/dist/chunk-SLDESHM5.js.map +1 -0
  38. package/dist/{chunk-Z37OVF33.js → chunk-TG5SQK44.js} +2 -2
  39. package/dist/{chunk-EYQUQ2PZ.js → chunk-UBEH2VOU.js} +2 -2
  40. package/dist/{chunk-TXCJMTLN.js → chunk-UDK2A7TX.js} +9 -10
  41. package/dist/chunk-UDK2A7TX.js.map +1 -0
  42. package/dist/{chunk-WJGTRYWS.js → chunk-VFBNMNDY.js} +2 -2
  43. package/dist/{chunk-CMZGRDKF.js → chunk-ZIUPKCRD.js} +2 -2
  44. package/dist/{cli-circuit-breaker-VUWP2GRN.js → cli-circuit-breaker-5PGGNAXR.js} +3 -3
  45. package/dist/cli.js +49 -51
  46. package/dist/cli.js.map +1 -1
  47. package/dist/{composite-router-4F3ZVLJV.js → composite-router-S2YRQVR2.js} +2 -2
  48. package/dist/{consensus-vote-ETJ63JRC.js → consensus-vote-D3ALVGKQ.js} +17 -16
  49. package/dist/{context-retriever-L2LTCKV6.js → context-retriever-G3UORDWI.js} +8 -8
  50. package/dist/{doctor-deep-HPBHFGBZ.js → doctor-deep-QERHI4YH.js} +3 -3
  51. package/dist/{doctor-live-NQ35PQ5B.js → doctor-live-6LCPVDTF.js} +9 -9
  52. package/dist/{expert-bridge-XN5MFZOG.js → expert-bridge-I4VMWOAZ.js} +4 -4
  53. package/dist/{factory-2TJ44P7L.js → factory-4WA3SMPI.js} +5 -5
  54. package/dist/{factory-GVBBWUOE.js → factory-KHYFJ7SI.js} +9 -9
  55. package/dist/{improvement-review-7VJYOI2F.js → improvement-review-DNKRLYEA.js} +6 -5
  56. package/dist/index.d.ts +113 -3
  57. package/dist/index.js +33 -31
  58. package/dist/index.js.map +1 -1
  59. package/dist/{init-opencode-TLVVMG54.js → init-opencode-R4IXHVBI.js} +6 -6
  60. package/dist/issue-triage-MWEG22WT.js +17 -0
  61. package/dist/{pr-reviewer-helpers-4ERCFSZ7.js → pr-reviewer-helpers-P4RCRFEU.js} +4 -4
  62. package/dist/{registry-command-GN2REQQP.js → registry-command-BTVFJEOS.js} +2 -2
  63. package/dist/{repo-security-plan-VPAXEENC.js → repo-security-plan-3KI6NNJ4.js} +3 -3
  64. package/dist/{research-helpers-synthesize-OZOOIEFW.js → research-helpers-synthesize-EY764EKA.js} +4 -4
  65. package/dist/{routing-memory-OF7J3OE4.js → routing-memory-UVFPT6FL.js} +2 -2
  66. package/dist/{session-memory-O5M3CLRX.js → session-memory-VAMUQSGC.js} +3 -3
  67. package/dist/{setup-config-WW5BNLVS.js → setup-config-H426VPM7.js} +3 -3
  68. package/dist/{setup-custom-api-UX4XNOT6.js → setup-custom-api-RFFSTRMT.js} +4 -4
  69. package/dist/setup-data-dir-RZ4KCZR7.js +29 -0
  70. package/dist/{tool-memory-PIBTMGPH.js → tool-memory-PDK7HIEG.js} +5 -5
  71. package/dist/{unified-registry-MUXCSSG5.js → unified-registry-CLZZ46D5.js} +10 -10
  72. package/dist/{weather-report-JOATSJWU.js → weather-report-YZBDIZSV.js} +2 -2
  73. package/package.json +1 -1
  74. package/dist/chunk-2MPJ7UDR.js.map +0 -1
  75. package/dist/chunk-ADC7YEU2.js.map +0 -1
  76. package/dist/chunk-EPZCODRK.js.map +0 -1
  77. package/dist/chunk-LSJ2EPOF.js.map +0 -1
  78. package/dist/chunk-OYFKB64X.js.map +0 -1
  79. package/dist/chunk-PUGRS4KW.js.map +0 -1
  80. package/dist/chunk-TXCJMTLN.js.map +0 -1
  81. package/dist/chunk-XQEWXGJ5.js.map +0 -1
  82. package/dist/issue-triage-YREC36AC.js +0 -17
  83. package/dist/setup-data-dir-KHLK534F.js +0 -28
  84. /package/dist/{child-mcp-config-FEK2HK5L.js.map → child-mcp-config-TUGS6R7G.js.map} +0 -0
  85. /package/dist/{chunk-MSHZHT5X.js.map → chunk-4Z7HJXDZ.js.map} +0 -0
  86. /package/dist/{chunk-LLGK3NRY.js.map → chunk-5UGFRPRO.js.map} +0 -0
  87. /package/dist/{chunk-K2DSQJEH.js.map → chunk-72QXEEC3.js.map} +0 -0
  88. /package/dist/{chunk-NMFXYX7R.js.map → chunk-7POSQDHD.js.map} +0 -0
  89. /package/dist/{chunk-3SMGCYGN.js.map → chunk-BAYBBQKK.js.map} +0 -0
  90. /package/dist/{chunk-R3H46BNY.js.map → chunk-BQC3QOHD.js.map} +0 -0
  91. /package/dist/{chunk-K7RASYIZ.js.map → chunk-EYBUDKXP.js.map} +0 -0
  92. /package/dist/{chunk-YFDE4AM3.js.map → chunk-GQDKGV34.js.map} +0 -0
  93. /package/dist/{chunk-LMTBX4GZ.js.map → chunk-IIQZ77BJ.js.map} +0 -0
  94. /package/dist/{chunk-GGQOP4VK.js.map → chunk-IWGOE6JT.js.map} +0 -0
  95. /package/dist/{chunk-IC6WLIGJ.js.map → chunk-JBOKMCJB.js.map} +0 -0
  96. /package/dist/{chunk-HPGPOZG4.js.map → chunk-K3UKVFL4.js.map} +0 -0
  97. /package/dist/{chunk-LMENHZQ6.js.map → chunk-KUNQLRUR.js.map} +0 -0
  98. /package/dist/{chunk-2FYFHAI4.js.map → chunk-MLX4CMGD.js.map} +0 -0
  99. /package/dist/{chunk-AWMXPIMK.js.map → chunk-MMN77SDX.js.map} +0 -0
  100. /package/dist/{chunk-5KKJKQVE.js.map → chunk-NSKEVAK2.js.map} +0 -0
  101. /package/dist/{chunk-32IMMUXP.js.map → chunk-PHGT3XKE.js.map} +0 -0
  102. /package/dist/{chunk-K2A24T36.js.map → chunk-QQFPLIJ4.js.map} +0 -0
  103. /package/dist/{chunk-YVW743K3.js.map → chunk-RDJWMBUQ.js.map} +0 -0
  104. /package/dist/{chunk-GVLMTQ46.js.map → chunk-RNOT2H4K.js.map} +0 -0
  105. /package/dist/{chunk-Z37OVF33.js.map → chunk-TG5SQK44.js.map} +0 -0
  106. /package/dist/{chunk-EYQUQ2PZ.js.map → chunk-UBEH2VOU.js.map} +0 -0
  107. /package/dist/{chunk-WJGTRYWS.js.map → chunk-VFBNMNDY.js.map} +0 -0
  108. /package/dist/{chunk-CMZGRDKF.js.map → chunk-ZIUPKCRD.js.map} +0 -0
  109. /package/dist/{cli-circuit-breaker-VUWP2GRN.js.map → cli-circuit-breaker-5PGGNAXR.js.map} +0 -0
  110. /package/dist/{composite-router-4F3ZVLJV.js.map → composite-router-S2YRQVR2.js.map} +0 -0
  111. /package/dist/{consensus-vote-ETJ63JRC.js.map → consensus-vote-D3ALVGKQ.js.map} +0 -0
  112. /package/dist/{context-retriever-L2LTCKV6.js.map → context-retriever-G3UORDWI.js.map} +0 -0
  113. /package/dist/{doctor-deep-HPBHFGBZ.js.map → doctor-deep-QERHI4YH.js.map} +0 -0
  114. /package/dist/{doctor-live-NQ35PQ5B.js.map → doctor-live-6LCPVDTF.js.map} +0 -0
  115. /package/dist/{expert-bridge-XN5MFZOG.js.map → expert-bridge-I4VMWOAZ.js.map} +0 -0
  116. /package/dist/{factory-2TJ44P7L.js.map → factory-4WA3SMPI.js.map} +0 -0
  117. /package/dist/{factory-GVBBWUOE.js.map → factory-KHYFJ7SI.js.map} +0 -0
  118. /package/dist/{improvement-review-7VJYOI2F.js.map → improvement-review-DNKRLYEA.js.map} +0 -0
  119. /package/dist/{init-opencode-TLVVMG54.js.map → init-opencode-R4IXHVBI.js.map} +0 -0
  120. /package/dist/{issue-triage-YREC36AC.js.map → issue-triage-MWEG22WT.js.map} +0 -0
  121. /package/dist/{pr-reviewer-helpers-4ERCFSZ7.js.map → pr-reviewer-helpers-P4RCRFEU.js.map} +0 -0
  122. /package/dist/{registry-command-GN2REQQP.js.map → registry-command-BTVFJEOS.js.map} +0 -0
  123. /package/dist/{repo-security-plan-VPAXEENC.js.map → repo-security-plan-3KI6NNJ4.js.map} +0 -0
  124. /package/dist/{research-helpers-synthesize-OZOOIEFW.js.map → research-helpers-synthesize-EY764EKA.js.map} +0 -0
  125. /package/dist/{routing-memory-OF7J3OE4.js.map → routing-memory-UVFPT6FL.js.map} +0 -0
  126. /package/dist/{session-memory-O5M3CLRX.js.map → session-memory-VAMUQSGC.js.map} +0 -0
  127. /package/dist/{setup-config-WW5BNLVS.js.map → setup-config-H426VPM7.js.map} +0 -0
  128. /package/dist/{setup-custom-api-UX4XNOT6.js.map → setup-custom-api-RFFSTRMT.js.map} +0 -0
  129. /package/dist/{setup-data-dir-KHLK534F.js.map → setup-data-dir-RZ4KCZR7.js.map} +0 -0
  130. /package/dist/{tool-memory-PIBTMGPH.js.map → tool-memory-PDK7HIEG.js.map} +0 -0
  131. /package/dist/{unified-registry-MUXCSSG5.js.map → unified-registry-CLZZ46D5.js.map} +0 -0
  132. /package/dist/{weather-report-JOATSJWU.js.map → weather-report-YZBDIZSV.js.map} +0 -0
@@ -5,7 +5,7 @@ import {
5
5
  getErrorMessage,
6
6
  ok,
7
7
  parseBoolEnv
8
- } from "./chunk-OYFKB64X.js";
8
+ } from "./chunk-7GWPLERY.js";
9
9
 
10
10
  // src/cli/research-helpers-io.ts
11
11
  import * as fs2 from "fs/promises";
@@ -156,4 +156,4 @@ export {
156
156
  loadPapersRegistry,
157
157
  savePapersRegistry
158
158
  };
159
- //# sourceMappingURL=chunk-YVW743K3.js.map
159
+ //# sourceMappingURL=chunk-RDJWMBUQ.js.map
@@ -7,7 +7,7 @@ import {
7
7
  toolStructuredError,
8
8
  toolSuccessStructured,
9
9
  wrapToolWithTimeout
10
- } from "./chunk-LSJ2EPOF.js";
10
+ } from "./chunk-OGVHWFYR.js";
11
11
  import {
12
12
  JsonlStore,
13
13
  SECURITY_KEYWORDS,
@@ -19,7 +19,7 @@ import {
19
19
  getPipelineEventBus,
20
20
  getTimeProvider,
21
21
  isDeclaredNeverDeprecate
22
- } from "./chunk-OYFKB64X.js";
22
+ } from "./chunk-7GWPLERY.js";
23
23
  import {
24
24
  getNexusDataDir,
25
25
  nexusDataPath
@@ -2132,4 +2132,4 @@ export {
2132
2132
  runImprovementReview,
2133
2133
  registerImprovementReviewTool
2134
2134
  };
2135
- //# sourceMappingURL=chunk-GVLMTQ46.js.map
2135
+ //# sourceMappingURL=chunk-RNOT2H4K.js.map
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-6T3EPABN.js";
6
6
  import {
7
7
  SessionMemory
8
- } from "./chunk-R3H46BNY.js";
8
+ } from "./chunk-BQC3QOHD.js";
9
9
  import {
10
10
  StatsOnlyAdapter,
11
11
  ensureSharedMemoryRegistry
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-KSQSWEFH.js";
16
16
  import {
17
17
  generateId
18
- } from "./chunk-LMTBX4GZ.js";
18
+ } from "./chunk-IIQZ77BJ.js";
19
19
  import {
20
20
  ErrorCode,
21
21
  NexusError,
@@ -28,7 +28,7 @@ import {
28
28
  getTimeProvider,
29
29
  ok,
30
30
  setSharedMobiMemDbPathResolver
31
- } from "./chunk-OYFKB64X.js";
31
+ } from "./chunk-7GWPLERY.js";
32
32
  import {
33
33
  nexusDataPath
34
34
  } from "./chunk-OGHEKPLD.js";
@@ -4607,26 +4607,26 @@ function querySessionMemory(learnings, keywords, limit) {
4607
4607
  metadata: { confidence: l.confidence, source: l.source }
4608
4608
  }));
4609
4609
  }
4610
- async function queryBeliefMemory(beliefs, query, keywords, limit, log) {
4610
+ async function keywordScanBeliefs(beliefs, keywords, onFailure) {
4611
+ if (keywords.length === 0) return [];
4612
+ const KEYWORD_SCAN_LIMIT = 1e3;
4613
+ const allResult = await beliefs.query({ includeSuperseded: false, limit: KEYWORD_SCAN_LIMIT });
4614
+ if (!allResult.ok) {
4615
+ onFailure?.();
4616
+ return [];
4617
+ }
4618
+ return allResult.value.filter((b) => {
4619
+ const text = (b.subject + " " + b.predicate + " " + b.object).toLowerCase();
4620
+ return keywords.some((k) => text.includes(k));
4621
+ });
4622
+ }
4623
+ async function queryBeliefMemory(beliefs, query, keywords, limit, ctx) {
4624
+ const { log, onFailure } = ctx;
4611
4625
  const results = [];
4612
4626
  try {
4613
4627
  const beliefResult = await beliefs.recallBySubject(query, limit);
4614
- let matched = [];
4615
- if (beliefResult.ok && beliefResult.value.length > 0) {
4616
- matched = beliefResult.value;
4617
- } else if (keywords.length > 0) {
4618
- const KEYWORD_SCAN_LIMIT = 1e3;
4619
- const allResult = await beliefs.query({
4620
- includeSuperseded: false,
4621
- limit: KEYWORD_SCAN_LIMIT
4622
- });
4623
- if (allResult.ok) {
4624
- matched = allResult.value.filter((b) => {
4625
- const text = (b.subject + " " + b.predicate + " " + b.object).toLowerCase();
4626
- return keywords.some((k) => text.includes(k));
4627
- });
4628
- }
4629
- }
4628
+ if (!beliefResult.ok) onFailure?.();
4629
+ const matched = beliefResult.ok && beliefResult.value.length > 0 ? beliefResult.value : await keywordScanBeliefs(beliefs, keywords, onFailure);
4630
4630
  for (const b of matched.filter((x) => !x.superseded)) {
4631
4631
  results.push({
4632
4632
  source: "belief",
@@ -4639,13 +4639,16 @@ async function queryBeliefMemory(beliefs, query, keywords, limit, log) {
4639
4639
  }
4640
4640
  } catch (e) {
4641
4641
  log.debug("Belief memory query failed", { error: String(e) });
4642
+ onFailure?.();
4642
4643
  }
4643
4644
  return results;
4644
4645
  }
4645
- async function queryAgenticMemory(agentic, query, keywords, limit, log) {
4646
+ async function queryAgenticMemory(agentic, query, keywords, limit, ctx) {
4647
+ const { log, onFailure } = ctx;
4646
4648
  const results = [];
4647
4649
  try {
4648
4650
  const agResult = await agentic.searchAgentic(query, limit);
4651
+ if (!agResult.ok) onFailure?.();
4649
4652
  if (agResult.ok) {
4650
4653
  for (const e of agResult.value) {
4651
4654
  results.push({
@@ -4660,10 +4663,12 @@ async function queryAgenticMemory(agentic, query, keywords, limit, log) {
4660
4663
  }
4661
4664
  } catch (e) {
4662
4665
  log.debug("Agentic memory query failed", { error: String(e) });
4666
+ onFailure?.();
4663
4667
  }
4664
4668
  return results;
4665
4669
  }
4666
- async function queryTypedMemory(typed, query, keywords, limitPerType, log) {
4670
+ async function queryTypedMemory(typed, query, keywords, limitPerType, ctx) {
4671
+ const { log, onFailure } = ctx;
4667
4672
  const results = [];
4668
4673
  try {
4669
4674
  const [semanticResult, episodicResult] = await Promise.all([
@@ -4671,6 +4676,7 @@ async function queryTypedMemory(typed, query, keywords, limitPerType, log) {
4671
4676
  typed.queryByType("episodic", query, limitPerType)
4672
4677
  ]);
4673
4678
  for (const r of [semanticResult, episodicResult]) {
4679
+ if (!r.ok) onFailure?.();
4674
4680
  if (r.ok) {
4675
4681
  for (const e of r.value) {
4676
4682
  results.push({
@@ -4685,13 +4691,16 @@ async function queryTypedMemory(typed, query, keywords, limitPerType, log) {
4685
4691
  }
4686
4692
  } catch (e) {
4687
4693
  log.debug("Typed memory query failed", { error: String(e) });
4694
+ onFailure?.();
4688
4695
  }
4689
4696
  return results;
4690
4697
  }
4691
- async function queryAdaptiveMemory(adaptive, query, keywords, limit, log) {
4698
+ async function queryAdaptiveMemory(adaptive, query, keywords, limit, ctx) {
4699
+ const { log, onFailure } = ctx;
4692
4700
  const results = [];
4693
4701
  try {
4694
4702
  const searchResult = await adaptive.search(query, limit);
4703
+ if (!searchResult.ok) onFailure?.();
4695
4704
  if (searchResult.ok) {
4696
4705
  for (const e of searchResult.value) {
4697
4706
  results.push({
@@ -4706,6 +4715,7 @@ async function queryAdaptiveMemory(adaptive, query, keywords, limit, log) {
4706
4715
  }
4707
4716
  } catch (e) {
4708
4717
  log.debug("Adaptive memory query failed", { error: String(e) });
4718
+ onFailure?.();
4709
4719
  }
4710
4720
  return results;
4711
4721
  }
@@ -5335,7 +5345,7 @@ var ToolMemoryManager = class {
5335
5345
  * Returns results from SessionMemory, BeliefMemory, AgenticMemory, and TypedMemory
5336
5346
  * with source attribution and relevance scoring.
5337
5347
  */
5338
- async queryAll(query, limit = 10) {
5348
+ async queryAll(query, limit = 10, errored) {
5339
5349
  if (this.initPromise !== null) {
5340
5350
  await this.initPromise;
5341
5351
  this.initPromise = null;
@@ -5345,21 +5355,41 @@ var ToolMemoryManager = class {
5345
5355
  const perSource = Math.ceil(limit / sourceCount);
5346
5356
  const results = [
5347
5357
  ...this.querySessionMemory(query, keywords, perSource),
5348
- ...await this.queryBeliefMemory(query, keywords, perSource),
5349
- ...await this.queryAgenticMemory(query, keywords, perSource),
5350
- ...await this.queryTypedMemory(query, keywords, Math.ceil(perSource / 2)),
5351
- ...await this.queryAdaptiveMemory(query, keywords, perSource)
5358
+ ...await this.queryBeliefMemory(query, keywords, perSource, () => errored?.("belief")),
5359
+ ...await this.queryAgenticMemory(query, keywords, perSource, () => errored?.("agentic")),
5360
+ ...await this.queryTypedMemory(
5361
+ query,
5362
+ keywords,
5363
+ Math.ceil(perSource / 2),
5364
+ () => errored?.("typed")
5365
+ ),
5366
+ ...await this.queryAdaptiveMemory(query, keywords, perSource, () => errored?.("adaptive"))
5352
5367
  ];
5353
5368
  return results.sort((a, b) => b.relevance - a.relevance).slice(0, limit);
5354
5369
  }
5370
+ /**
5371
+ * `queryBySource`, plus the names of the backends that threw while answering (#4999).
5372
+ *
5373
+ * Each per-backend helper swallows its error and contributes `[]`, so a store
5374
+ * that failed is invisible in the merged result set — indistinguishable from
5375
+ * one that simply matched nothing. Callers that report coverage need the
5376
+ * difference, and only this variant can tell them. Single-source queries get
5377
+ * the same treatment as `'all'` — a corrupt store must not read as an empty
5378
+ * one whichever way it was asked.
5379
+ */
5380
+ async queryWithStatus(source, query, limit = 10) {
5381
+ const failures = /* @__PURE__ */ new Set();
5382
+ const results = await this.queryBySource(source, query, limit, (name) => failures.add(name));
5383
+ return { results, errored: [...failures] };
5384
+ }
5355
5385
  /**
5356
5386
  * Query a specific memory backend directly, bypassing cross-backend limit dilution.
5357
5387
  * When source is 'all', delegates to queryAll(). Otherwise dispatches to the
5358
5388
  * single-backend method so the full limit is applied to that backend only.
5359
5389
  */
5360
- async queryBySource(source, query, limit = 10) {
5390
+ async queryBySource(source, query, limit = 10, errored) {
5361
5391
  if (source === "all") {
5362
- return this.queryAll(query, limit);
5392
+ return this.queryAll(query, limit, errored);
5363
5393
  }
5364
5394
  if (this.initPromise !== null) {
5365
5395
  await this.initPromise;
@@ -5372,16 +5402,21 @@ var ToolMemoryManager = class {
5372
5402
  results = this.querySessionMemory(query, keywords, limit);
5373
5403
  break;
5374
5404
  case "belief":
5375
- results = await this.queryBeliefMemory(query, keywords, limit);
5405
+ results = await this.queryBeliefMemory(query, keywords, limit, () => errored?.("belief"));
5376
5406
  break;
5377
5407
  case "agentic":
5378
- results = await this.queryAgenticMemory(query, keywords, limit);
5408
+ results = await this.queryAgenticMemory(query, keywords, limit, () => errored?.("agentic"));
5379
5409
  break;
5380
5410
  case "typed":
5381
- results = await this.queryTypedMemory(query, keywords, limit);
5411
+ results = await this.queryTypedMemory(query, keywords, limit, () => errored?.("typed"));
5382
5412
  break;
5383
5413
  case "adaptive":
5384
- results = await this.queryAdaptiveMemory(query, keywords, limit);
5414
+ results = await this.queryAdaptiveMemory(
5415
+ query,
5416
+ keywords,
5417
+ limit,
5418
+ () => errored?.("adaptive")
5419
+ );
5385
5420
  break;
5386
5421
  }
5387
5422
  return results.sort((a, b) => b.relevance - a.relevance).slice(0, limit);
@@ -5391,20 +5426,32 @@ var ToolMemoryManager = class {
5391
5426
  querySessionMemory(query, keywords, limit) {
5392
5427
  return querySessionMemory(this.searchLearnings(query), keywords, limit);
5393
5428
  }
5394
- async queryBeliefMemory(query, keywords, limit) {
5395
- return queryBeliefMemory(this.beliefs, query, keywords, limit, this.log);
5429
+ async queryBeliefMemory(query, keywords, limit, onFailure) {
5430
+ return queryBeliefMemory(this.beliefs, query, keywords, limit, {
5431
+ log: this.log,
5432
+ onFailure
5433
+ });
5396
5434
  }
5397
- async queryAgenticMemory(query, keywords, limit) {
5435
+ async queryAgenticMemory(query, keywords, limit, onFailure) {
5398
5436
  if (this.agentic === null) return [];
5399
- return queryAgenticMemory(this.agentic, query, keywords, limit, this.log);
5437
+ return queryAgenticMemory(this.agentic, query, keywords, limit, {
5438
+ log: this.log,
5439
+ onFailure
5440
+ });
5400
5441
  }
5401
- async queryTypedMemory(query, keywords, limitPerType) {
5442
+ async queryTypedMemory(query, keywords, limitPerType, onFailure) {
5402
5443
  if (this.typed === null) return [];
5403
- return queryTypedMemory(this.typed, query, keywords, limitPerType, this.log);
5444
+ return queryTypedMemory(this.typed, query, keywords, limitPerType, {
5445
+ log: this.log,
5446
+ onFailure
5447
+ });
5404
5448
  }
5405
- async queryAdaptiveMemory(query, keywords, limit) {
5449
+ async queryAdaptiveMemory(query, keywords, limit, onFailure) {
5406
5450
  if (this.adaptive === null) return [];
5407
- return queryAdaptiveMemory(this.adaptive, query, keywords, limit, this.log);
5451
+ return queryAdaptiveMemory(this.adaptive, query, keywords, limit, {
5452
+ log: this.log,
5453
+ onFailure
5454
+ });
5408
5455
  }
5409
5456
  // ==========================================================================
5410
5457
  // Memory Promotion Pipeline (Phase 4 #746)
@@ -5561,4 +5608,4 @@ export {
5561
5608
  reinitializeMemoryBackends,
5562
5609
  ToolMemoryManager
5563
5610
  };
5564
- //# sourceMappingURL=chunk-ADC7YEU2.js.map
5611
+ //# sourceMappingURL=chunk-SLDESHM5.js.map