nexus-agents 4.4.0 → 4.6.0

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 (122) hide show
  1. package/dist/{child-mcp-config-6BPBGQB4.js → child-mcp-config-OBOA4PE2.js} +2 -2
  2. package/dist/{chunk-IXMTCWMN.js → chunk-34UKF4FB.js} +3 -3
  3. package/dist/{chunk-65DZ7WHY.js → chunk-5JRYCJ37.js} +2 -2
  4. package/dist/{chunk-LPUJG7C6.js → chunk-6HSDJ5H6.js} +2 -2
  5. package/dist/{chunk-CFEZ2DG6.js → chunk-75K4TN5H.js} +8 -8
  6. package/dist/{chunk-RUN6KRCP.js → chunk-7BMK5VEO.js} +8 -8
  7. package/dist/{chunk-Y3UJ3VLA.js → chunk-7Y7UFVQ5.js} +2 -2
  8. package/dist/{chunk-XJORRLQT.js → chunk-ANTZOHQ6.js} +24 -7
  9. package/dist/{chunk-XJORRLQT.js.map → chunk-ANTZOHQ6.js.map} +1 -1
  10. package/dist/{chunk-K2ZYZZNZ.js → chunk-ARTRA6YC.js} +3 -3
  11. package/dist/{chunk-UH4MK2N7.js → chunk-B6DNL7LG.js} +4 -4
  12. package/dist/{chunk-E6ET2WJI.js → chunk-BAWVMEXA.js} +4 -4
  13. package/dist/{chunk-SSPEB62Y.js → chunk-BLY3DXM2.js} +5 -5
  14. package/dist/{chunk-PZSPL5KN.js → chunk-BT6ONNFH.js} +2 -2
  15. package/dist/{chunk-SHG3MYMD.js → chunk-C6SAPXUV.js} +2 -2
  16. package/dist/{chunk-PG563EVI.js → chunk-D7X2AMEB.js} +2 -2
  17. package/dist/{chunk-FLCUFTXF.js → chunk-EKS3ECXS.js} +24 -24
  18. package/dist/{chunk-FLCUFTXF.js.map → chunk-EKS3ECXS.js.map} +1 -1
  19. package/dist/{chunk-6DLKK5R2.js → chunk-ESWY4Y7S.js} +4 -4
  20. package/dist/{chunk-DFCJUKGD.js → chunk-EYZIMY6I.js} +2 -2
  21. package/dist/{chunk-TKFWYFBD.js → chunk-HBGA62JG.js} +2 -2
  22. package/dist/{chunk-OPH5S776.js → chunk-JDUTA6FI.js} +2 -2
  23. package/dist/{chunk-VWXQHGQ2.js → chunk-KMUOL3AL.js} +2 -2
  24. package/dist/{chunk-AVB5GOSW.js → chunk-LVE7MN2F.js} +6 -6
  25. package/dist/{chunk-U4LM5Q2L.js → chunk-NH3O2D5O.js} +3 -3
  26. package/dist/{chunk-4OSPP2KN.js → chunk-NMX7AYYB.js} +2 -2
  27. package/dist/{chunk-ZQWCL7YB.js → chunk-O32DMSG5.js} +3 -3
  28. package/dist/{chunk-4KDZ4Q6B.js → chunk-RWI6YQXG.js} +8 -8
  29. package/dist/{chunk-UI3WYJSZ.js → chunk-SWUYPFXS.js} +2 -2
  30. package/dist/{chunk-SPZOZGBS.js → chunk-TD6I5UHY.js} +2 -2
  31. package/dist/{chunk-QGXA25PQ.js → chunk-TI65NJOM.js} +2 -2
  32. package/dist/{chunk-QTP4AIVR.js → chunk-VRJAJUUR.js} +7 -7
  33. package/dist/{chunk-EJLOD53Z.js → chunk-XCUO5YUJ.js} +2 -2
  34. package/dist/{chunk-YIV4GQHK.js → chunk-YLESXBB3.js} +2 -2
  35. package/dist/{chunk-NKTANKWH.js → chunk-YY67CP2U.js} +3 -3
  36. package/dist/{chunk-YBGX57DL.js → chunk-ZZED3BWY.js} +79 -59
  37. package/dist/chunk-ZZED3BWY.js.map +1 -0
  38. package/dist/{cli-circuit-breaker-3CH36TPE.js → cli-circuit-breaker-TJVDSJU5.js} +3 -3
  39. package/dist/cli.js +41 -41
  40. package/dist/{composite-router-QK4OPVDX.js → composite-router-CIC4BU6A.js} +2 -2
  41. package/dist/{consensus-vote-DL4XNR7M.js → consensus-vote-77UCSVGM.js} +16 -16
  42. package/dist/{context-retriever-UPHWSEXA.js → context-retriever-CP72SNYZ.js} +8 -8
  43. package/dist/{doctor-deep-UHFL3AE4.js → doctor-deep-WI2ZC7Z3.js} +3 -3
  44. package/dist/{doctor-live-2CGAFGFG.js → doctor-live-W2KY3OIA.js} +9 -9
  45. package/dist/{expert-bridge-KTKJTMMO.js → expert-bridge-HGBVHVJI.js} +4 -4
  46. package/dist/{factory-SC3N2RMX.js → factory-GEBBVQHZ.js} +9 -9
  47. package/dist/{factory-QQKY3UW4.js → factory-LEYEWZ4Y.js} +5 -5
  48. package/dist/{improvement-review-I4WFQK25.js → improvement-review-XN2GZX3V.js} +5 -5
  49. package/dist/index.d.ts +58 -9
  50. package/dist/index.js +30 -30
  51. package/dist/{init-opencode-HTSSQOLE.js → init-opencode-UPA3R362.js} +6 -6
  52. package/dist/issue-triage-QAI2FNMN.js +17 -0
  53. package/dist/{pr-reviewer-helpers-UOP4JVHI.js → pr-reviewer-helpers-KRKXKZIA.js} +4 -4
  54. package/dist/{registry-command-EPG2X2ZI.js → registry-command-2SCTKLEO.js} +2 -2
  55. package/dist/{repo-security-plan-QYSW4MKN.js → repo-security-plan-NFYC64IS.js} +3 -3
  56. package/dist/{research-helpers-synthesize-YSYYUW5H.js → research-helpers-synthesize-K5TX2WM3.js} +4 -4
  57. package/dist/{routing-memory-BZ6IGNXN.js → routing-memory-JPDPHK7P.js} +2 -2
  58. package/dist/{session-memory-GVOVQ3TV.js → session-memory-XIIEIJPT.js} +3 -3
  59. package/dist/{setup-command-4RQUTUDI.js → setup-command-GEWL2HS4.js} +14 -14
  60. package/dist/{setup-config-Q2WGGIQT.js → setup-config-SUEPUZYL.js} +3 -3
  61. package/dist/{setup-custom-api-GXF5MFBG.js → setup-custom-api-5TTLIPV3.js} +4 -4
  62. package/dist/{tool-memory-MHP37ASX.js → tool-memory-ACUOYCYG.js} +5 -5
  63. package/dist/{unified-registry-WX3GDBCZ.js → unified-registry-P3PLOFBN.js} +10 -10
  64. package/dist/{weather-report-YY7BO744.js → weather-report-464SS6FY.js} +2 -2
  65. package/package.json +1 -1
  66. package/dist/chunk-YBGX57DL.js.map +0 -1
  67. package/dist/issue-triage-SAS3D5K4.js +0 -17
  68. /package/dist/{child-mcp-config-6BPBGQB4.js.map → child-mcp-config-OBOA4PE2.js.map} +0 -0
  69. /package/dist/{chunk-IXMTCWMN.js.map → chunk-34UKF4FB.js.map} +0 -0
  70. /package/dist/{chunk-65DZ7WHY.js.map → chunk-5JRYCJ37.js.map} +0 -0
  71. /package/dist/{chunk-LPUJG7C6.js.map → chunk-6HSDJ5H6.js.map} +0 -0
  72. /package/dist/{chunk-CFEZ2DG6.js.map → chunk-75K4TN5H.js.map} +0 -0
  73. /package/dist/{chunk-RUN6KRCP.js.map → chunk-7BMK5VEO.js.map} +0 -0
  74. /package/dist/{chunk-Y3UJ3VLA.js.map → chunk-7Y7UFVQ5.js.map} +0 -0
  75. /package/dist/{chunk-K2ZYZZNZ.js.map → chunk-ARTRA6YC.js.map} +0 -0
  76. /package/dist/{chunk-UH4MK2N7.js.map → chunk-B6DNL7LG.js.map} +0 -0
  77. /package/dist/{chunk-E6ET2WJI.js.map → chunk-BAWVMEXA.js.map} +0 -0
  78. /package/dist/{chunk-SSPEB62Y.js.map → chunk-BLY3DXM2.js.map} +0 -0
  79. /package/dist/{chunk-PZSPL5KN.js.map → chunk-BT6ONNFH.js.map} +0 -0
  80. /package/dist/{chunk-SHG3MYMD.js.map → chunk-C6SAPXUV.js.map} +0 -0
  81. /package/dist/{chunk-PG563EVI.js.map → chunk-D7X2AMEB.js.map} +0 -0
  82. /package/dist/{chunk-6DLKK5R2.js.map → chunk-ESWY4Y7S.js.map} +0 -0
  83. /package/dist/{chunk-DFCJUKGD.js.map → chunk-EYZIMY6I.js.map} +0 -0
  84. /package/dist/{chunk-TKFWYFBD.js.map → chunk-HBGA62JG.js.map} +0 -0
  85. /package/dist/{chunk-OPH5S776.js.map → chunk-JDUTA6FI.js.map} +0 -0
  86. /package/dist/{chunk-VWXQHGQ2.js.map → chunk-KMUOL3AL.js.map} +0 -0
  87. /package/dist/{chunk-AVB5GOSW.js.map → chunk-LVE7MN2F.js.map} +0 -0
  88. /package/dist/{chunk-U4LM5Q2L.js.map → chunk-NH3O2D5O.js.map} +0 -0
  89. /package/dist/{chunk-4OSPP2KN.js.map → chunk-NMX7AYYB.js.map} +0 -0
  90. /package/dist/{chunk-ZQWCL7YB.js.map → chunk-O32DMSG5.js.map} +0 -0
  91. /package/dist/{chunk-4KDZ4Q6B.js.map → chunk-RWI6YQXG.js.map} +0 -0
  92. /package/dist/{chunk-UI3WYJSZ.js.map → chunk-SWUYPFXS.js.map} +0 -0
  93. /package/dist/{chunk-SPZOZGBS.js.map → chunk-TD6I5UHY.js.map} +0 -0
  94. /package/dist/{chunk-QGXA25PQ.js.map → chunk-TI65NJOM.js.map} +0 -0
  95. /package/dist/{chunk-QTP4AIVR.js.map → chunk-VRJAJUUR.js.map} +0 -0
  96. /package/dist/{chunk-EJLOD53Z.js.map → chunk-XCUO5YUJ.js.map} +0 -0
  97. /package/dist/{chunk-YIV4GQHK.js.map → chunk-YLESXBB3.js.map} +0 -0
  98. /package/dist/{chunk-NKTANKWH.js.map → chunk-YY67CP2U.js.map} +0 -0
  99. /package/dist/{cli-circuit-breaker-3CH36TPE.js.map → cli-circuit-breaker-TJVDSJU5.js.map} +0 -0
  100. /package/dist/{composite-router-QK4OPVDX.js.map → composite-router-CIC4BU6A.js.map} +0 -0
  101. /package/dist/{consensus-vote-DL4XNR7M.js.map → consensus-vote-77UCSVGM.js.map} +0 -0
  102. /package/dist/{context-retriever-UPHWSEXA.js.map → context-retriever-CP72SNYZ.js.map} +0 -0
  103. /package/dist/{doctor-deep-UHFL3AE4.js.map → doctor-deep-WI2ZC7Z3.js.map} +0 -0
  104. /package/dist/{doctor-live-2CGAFGFG.js.map → doctor-live-W2KY3OIA.js.map} +0 -0
  105. /package/dist/{expert-bridge-KTKJTMMO.js.map → expert-bridge-HGBVHVJI.js.map} +0 -0
  106. /package/dist/{factory-QQKY3UW4.js.map → factory-GEBBVQHZ.js.map} +0 -0
  107. /package/dist/{factory-SC3N2RMX.js.map → factory-LEYEWZ4Y.js.map} +0 -0
  108. /package/dist/{improvement-review-I4WFQK25.js.map → improvement-review-XN2GZX3V.js.map} +0 -0
  109. /package/dist/{init-opencode-HTSSQOLE.js.map → init-opencode-UPA3R362.js.map} +0 -0
  110. /package/dist/{issue-triage-SAS3D5K4.js.map → issue-triage-QAI2FNMN.js.map} +0 -0
  111. /package/dist/{pr-reviewer-helpers-UOP4JVHI.js.map → pr-reviewer-helpers-KRKXKZIA.js.map} +0 -0
  112. /package/dist/{registry-command-EPG2X2ZI.js.map → registry-command-2SCTKLEO.js.map} +0 -0
  113. /package/dist/{repo-security-plan-QYSW4MKN.js.map → repo-security-plan-NFYC64IS.js.map} +0 -0
  114. /package/dist/{research-helpers-synthesize-YSYYUW5H.js.map → research-helpers-synthesize-K5TX2WM3.js.map} +0 -0
  115. /package/dist/{routing-memory-BZ6IGNXN.js.map → routing-memory-JPDPHK7P.js.map} +0 -0
  116. /package/dist/{session-memory-GVOVQ3TV.js.map → session-memory-XIIEIJPT.js.map} +0 -0
  117. /package/dist/{setup-command-4RQUTUDI.js.map → setup-command-GEWL2HS4.js.map} +0 -0
  118. /package/dist/{setup-config-Q2WGGIQT.js.map → setup-config-SUEPUZYL.js.map} +0 -0
  119. /package/dist/{setup-custom-api-GXF5MFBG.js.map → setup-custom-api-5TTLIPV3.js.map} +0 -0
  120. /package/dist/{tool-memory-MHP37ASX.js.map → tool-memory-ACUOYCYG.js.map} +0 -0
  121. /package/dist/{unified-registry-WX3GDBCZ.js.map → unified-registry-P3PLOFBN.js.map} +0 -0
  122. /package/dist/{weather-report-YY7BO744.js.map → weather-report-464SS6FY.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  generateSecurityPlan
3
- } from "./chunk-SHG3MYMD.js";
3
+ } from "./chunk-C6SAPXUV.js";
4
4
  import {
5
5
  analyzeGitHubRepo
6
6
  } from "./chunk-HFOQKCD2.js";
@@ -22,10 +22,10 @@ import {
22
22
  DEFAULT_TASK_TTL_MS,
23
23
  DEFAULT_TOOL_RATE_LIMITS,
24
24
  clampTaskTtl
25
- } from "./chunk-4KDZ4Q6B.js";
25
+ } from "./chunk-RWI6YQXG.js";
26
26
  import {
27
27
  executeExpert
28
- } from "./chunk-QTP4AIVR.js";
28
+ } from "./chunk-VRJAJUUR.js";
29
29
  import {
30
30
  JobStatusSchema,
31
31
  abortJob,
@@ -46,24 +46,24 @@ import {
46
46
  simulationDeniedResult,
47
47
  toJobSummary,
48
48
  writeJobCancelled
49
- } from "./chunk-CFEZ2DG6.js";
49
+ } from "./chunk-75K4TN5H.js";
50
50
  import {
51
51
  allOf
52
52
  } from "./chunk-OQB3XC5O.js";
53
53
  import {
54
54
  normalizeTopicToCanonical,
55
55
  synthesizeResearch
56
- } from "./chunk-ZQWCL7YB.js";
56
+ } from "./chunk-O32DMSG5.js";
57
57
  import {
58
58
  IssueTriage
59
- } from "./chunk-AVB5GOSW.js";
59
+ } from "./chunk-LVE7MN2F.js";
60
60
  import {
61
61
  resolveEnvMode,
62
62
  sanitizeInput
63
- } from "./chunk-EJLOD53Z.js";
63
+ } from "./chunk-XCUO5YUJ.js";
64
64
  import {
65
65
  withPrerequisite
66
- } from "./chunk-IXMTCWMN.js";
66
+ } from "./chunk-34UKF4FB.js";
67
67
  import {
68
68
  NOOP_NOTIFIER,
69
69
  RateLimiter,
@@ -87,18 +87,18 @@ import {
87
87
  withAuditTrail,
88
88
  withProgressHeartbeat,
89
89
  wrapToolWithTimeout
90
- } from "./chunk-K2ZYZZNZ.js";
90
+ } from "./chunk-ARTRA6YC.js";
91
91
  import {
92
92
  createAuditTrail,
93
93
  createGraphAuditBridge,
94
94
  emitPipelinePolicyEvent
95
- } from "./chunk-DFCJUKGD.js";
95
+ } from "./chunk-EYZIMY6I.js";
96
96
  import {
97
97
  EventTopics,
98
98
  createEvent,
99
99
  getGlobalEventBus,
100
100
  getGlobalRegistry
101
- } from "./chunk-E6ET2WJI.js";
101
+ } from "./chunk-BAWVMEXA.js";
102
102
  import {
103
103
  IDENTIFIER_RE,
104
104
  LANG_VALUES,
@@ -131,31 +131,31 @@ import {
131
131
  parseRegistry,
132
132
  sourceExistsInRegistry,
133
133
  summarizeContextForPrompt
134
- } from "./chunk-XJORRLQT.js";
134
+ } from "./chunk-ANTZOHQ6.js";
135
135
  import {
136
136
  loadPapersRegistry,
137
137
  loadTechniquesRegistry
138
- } from "./chunk-VWXQHGQ2.js";
138
+ } from "./chunk-KMUOL3AL.js";
139
139
  import {
140
140
  resolveInsideRoot
141
141
  } from "./chunk-NUBSJGQZ.js";
142
142
  import {
143
143
  getTokenEnvVars,
144
144
  resolveToken
145
- } from "./chunk-UI3WYJSZ.js";
145
+ } from "./chunk-SWUYPFXS.js";
146
146
  import {
147
147
  DEFAULT_RELEVANCE_CONFIG,
148
148
  MemoryImportance,
149
149
  calculateTextJaccardSimilarity,
150
150
  getToolMemory
151
- } from "./chunk-UH4MK2N7.js";
151
+ } from "./chunk-B6DNL7LG.js";
152
152
  import {
153
153
  STOPWORDS,
154
154
  truncateWithInfo
155
155
  } from "./chunk-6T3EPABN.js";
156
156
  import {
157
157
  createSessionMemory
158
- } from "./chunk-PG563EVI.js";
158
+ } from "./chunk-D7X2AMEB.js";
159
159
  import {
160
160
  BUILT_IN_EXPERTS,
161
161
  BuiltInExpertTypeSchema,
@@ -173,25 +173,25 @@ import {
173
173
  getAvailableClis,
174
174
  sleep,
175
175
  withTimeout
176
- } from "./chunk-RUN6KRCP.js";
176
+ } from "./chunk-7BMK5VEO.js";
177
177
  import {
178
178
  BaseAdapter,
179
179
  createStream,
180
180
  requireApiKey,
181
181
  validateApiKeyPresence
182
- } from "./chunk-QGXA25PQ.js";
182
+ } from "./chunk-TI65NJOM.js";
183
183
  import {
184
184
  DEFAULTS
185
- } from "./chunk-65DZ7WHY.js";
185
+ } from "./chunk-5JRYCJ37.js";
186
186
  import {
187
187
  getAvailabilityCache,
188
188
  getCliForModelId,
189
189
  resolveFallback
190
- } from "./chunk-SPZOZGBS.js";
190
+ } from "./chunk-TD6I5UHY.js";
191
191
  import {
192
192
  generateHyphenId,
193
193
  generateUUID
194
- } from "./chunk-PZSPL5KN.js";
194
+ } from "./chunk-BT6ONNFH.js";
195
195
  import {
196
196
  AGENT_ROUTER_TIMEOUTS,
197
197
  API_TIMEOUTS,
@@ -291,7 +291,7 @@ import {
291
291
  selectStrategyByManifest,
292
292
  toExpertTaskAnalysisResult,
293
293
  withStep
294
- } from "./chunk-U4LM5Q2L.js";
294
+ } from "./chunk-NH3O2D5O.js";
295
295
  import {
296
296
  ensureLearningDir,
297
297
  getMetaOutcomesFile,
@@ -5369,15 +5369,22 @@ function buildExpertResults(participants, results) {
5369
5369
  }
5370
5370
  function buildAggregatedResult(input) {
5371
5371
  const { pattern, results, participants, votes, reviews, endTime } = input;
5372
+ const conflicts = [];
5372
5373
  return {
5373
5374
  output: aggregateOutputs(results),
5374
5375
  strategy: getAggregationStrategy(pattern),
5375
5376
  qualityScore: calculateQualityScore(pattern, participants, votes, reviews),
5376
- conflicts: [],
5377
+ conflicts,
5377
5378
  metadata: {
5378
5379
  resultCount: results.length,
5379
- conflictCount: 0,
5380
- averageConfidence: 1,
5380
+ conflictCount: conflicts.length,
5381
+ // Nothing reaching this builder carries a confidence signal: neither
5382
+ // TaskResult, ResultMetadata, VoteMessage nor ExpertParticipation has
5383
+ // the field. This reported 1.0 — a perfect score — for a session whose
5384
+ // confidence was never assessed (#4831). The placeholder now fails in
5385
+ // the safe direction and says it is a placeholder.
5386
+ averageConfidence: 0,
5387
+ confidenceMeasured: false,
5381
5388
  // #4743: shared with result-aggregator so the two cannot drift — they
5382
5389
  // were duplicate expressions computing the same thing.
5383
5390
  ...summarizeTokenUsage(results.map((r) => r.metadata)),
@@ -8301,10 +8308,14 @@ var AdaptiveProtocolSelector = class {
8301
8308
  this.log = config?.logger ?? logger3;
8302
8309
  }
8303
8310
  /**
8304
- * Select the optimal protocol for a task.
8311
+ * Classify a task and report which protocol adaptation would choose.
8312
+ *
8313
+ * The returned `pattern` is always `config.pattern`: `CollaborationPattern`
8314
+ * has no `auto` member, so there is no way for a caller to defer to
8315
+ * adaptation. `adaptivePattern` carries the advisory choice (#4833).
8305
8316
  *
8306
- * @param config - Collaboration config (pattern may be overridden)
8307
- * @returns Selection result with chosen pattern and reasoning
8317
+ * @param config - Collaboration config; its `pattern` is always honoured
8318
+ * @returns The pattern in use, the advisory choice, and the classification
8308
8319
  */
8309
8320
  selectProtocol(config) {
8310
8321
  const explicitPattern = config.pattern;
@@ -8317,16 +8328,20 @@ var AdaptiveProtocolSelector = class {
8317
8328
  const selectedPattern = mapping[classification.type] ?? DEFAULT_PROTOCOL_MAPPING[classification.type];
8318
8329
  const wasOverridden = explicitPattern !== selectedPattern;
8319
8330
  if (this.config.logDecisions) {
8320
- this.log.info("Protocol selection", {
8331
+ this.log.info("Protocol classification (advisory)", {
8321
8332
  taskType: classification.type,
8322
8333
  confidence: classification.confidence,
8323
- selectedPattern,
8324
- explicitPattern,
8325
- wasOverridden
8334
+ adaptivePattern: selectedPattern,
8335
+ patternInUse: explicitPattern,
8336
+ differsFromAdaptive: wasOverridden
8326
8337
  });
8327
8338
  }
8328
8339
  return {
8329
- pattern: wasOverridden ? explicitPattern : selectedPattern,
8340
+ // Always the caller's pattern — the ternary this replaced returned
8341
+ // `explicitPattern` in both branches, since the false branch is reached
8342
+ // only when the two are equal (#4833).
8343
+ pattern: explicitPattern,
8344
+ adaptivePattern: selectedPattern,
8330
8345
  classification,
8331
8346
  wasOverridden
8332
8347
  };
@@ -8356,16 +8371,18 @@ var AdaptiveProtocolSelector = class {
8356
8371
  return this.factory.execute(adaptedConfig, agents);
8357
8372
  }
8358
8373
  /**
8359
- * Get recommended protocol for a task without executing.
8374
+ * Get the recommended protocol for a task without executing.
8360
8375
  *
8361
- * Useful for preview/explanation of what protocol would be selected.
8376
+ * Returns the *adaptive* choice. It previously returned `selection.pattern`
8377
+ * — the caller's own input — so the "recommendation" echoed the question
8378
+ * back with reasoning attached that read as an answer (#4833).
8362
8379
  */
8363
8380
  getRecommendation(config) {
8364
8381
  const selection = this.selectProtocol(config);
8365
8382
  const { type, confidence } = selection.classification;
8366
8383
  const reasoning = type === "unknown" ? "Task type could not be determined with sufficient confidence. Using default protocol." : `Task classified as "${type}" type (confidence: ${(confidence * 100).toFixed(0)}%). ${type === "reasoning" ? "Voting/parallel protocols work better for reasoning tasks (+13.2%)." : "Consensus protocols work better for knowledge tasks (+2.8%)."}`;
8367
8384
  return {
8368
- recommendedPattern: selection.pattern,
8385
+ recommendedPattern: selection.adaptivePattern,
8369
8386
  taskType: type,
8370
8387
  confidence,
8371
8388
  reasoning
@@ -8673,12 +8690,13 @@ var OrchestratorCollaborationHelper = class {
8673
8690
  async executeCollaboration(config, agents, results) {
8674
8691
  const recommendation = this.protocolSelector.getRecommendation(config);
8675
8692
  this.logger.info("Protocol recommendation", {
8676
- pattern: recommendation.recommendedPattern,
8693
+ recommendedPattern: recommendation.recommendedPattern,
8694
+ patternInUse: config.pattern,
8677
8695
  taskType: recommendation.taskType,
8678
8696
  confidence: recommendation.confidence
8679
8697
  });
8680
8698
  const collaborationResult = await this.protocolSelector.execute(
8681
- { ...config, pattern: recommendation.recommendedPattern },
8699
+ { ...config, pattern: config.pattern },
8682
8700
  agents
8683
8701
  );
8684
8702
  if (!collaborationResult.ok) {
@@ -13866,6 +13884,9 @@ var ResultAggregator = class {
13866
13884
  resultCount: results.length,
13867
13885
  conflictCount: conflicts.length,
13868
13886
  averageConfidence: Math.round(avgConfidence * 100) / 100,
13887
+ // Measured: ExpertResult carries confidence, and `aggregate` rejects
13888
+ // an empty result list before reaching here (#4831).
13889
+ confidenceMeasured: true,
13869
13890
  ...usage,
13870
13891
  aggregatedAt: getTimeProvider().nowIso()
13871
13892
  }
@@ -28244,7 +28265,7 @@ function execIdFields(executionId) {
28244
28265
  async function populateUnifiedContextOnState(state, options) {
28245
28266
  const taskCandidate = state["task"];
28246
28267
  if (typeof taskCandidate !== "string" || taskCandidate === "") return;
28247
- const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-UPHWSEXA.js");
28268
+ const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-CP72SNYZ.js");
28248
28269
  const category = inferTaskCategory2(taskCandidate);
28249
28270
  const executionId = options?.executionId;
28250
28271
  const execFields = execIdFields(executionId);
@@ -40540,13 +40561,6 @@ function matchesKeywords(result, keywords) {
40540
40561
  }
40541
40562
 
40542
40563
  // src/orchestration/spec-executor.ts
40543
- var NO_CRITERIA_VALIDATION = {
40544
- satisfaction: 1,
40545
- totalCriteria: 0,
40546
- metCount: 0,
40547
- criteria: [],
40548
- allMet: true
40549
- };
40550
40564
  async function executeSpec(markdown, options) {
40551
40565
  const startTime = getTimeProvider().now();
40552
40566
  const parseResult2 = parseSpec(markdown);
@@ -40559,7 +40573,13 @@ async function executeSpec(markdown, options) {
40559
40573
  const execResult = await executeGraph(compileResult.value, { results: [] });
40560
40574
  if (!execResult.ok) return err({ message: execResult.error.message, stage: "execute" });
40561
40575
  const outputs = extractOutputs(execResult.value.finalState);
40562
- const validation = spec.acceptanceCriteria.length === 0 ? NO_CRITERIA_VALIDATION : validateOrErr(spec, outputs);
40576
+ if (spec.acceptanceCriteria.length === 0) {
40577
+ return err({
40578
+ message: 'Spec has no acceptance criteria, so the execution cannot be validated. Add an "## Acceptance Criteria" section.',
40579
+ stage: "validate"
40580
+ });
40581
+ }
40582
+ const validation = validateOrErr(spec, outputs);
40563
40583
  if (validation === null) {
40564
40584
  return err({ message: "Scenario validation failed", stage: "validate" });
40565
40585
  }
@@ -43929,7 +43949,7 @@ async function tryIssueTriage(task) {
43929
43949
  try {
43930
43950
  const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
43931
43951
  if (issueMatch === null) return null;
43932
- const { createIssueTriage } = await import("./issue-triage-SAS3D5K4.js");
43952
+ const { createIssueTriage } = await import("./issue-triage-QAI2FNMN.js");
43933
43953
  const triage = createIssueTriage();
43934
43954
  const owner = issueMatch[1] ?? "";
43935
43955
  const num = issueMatch[2] ?? "";
@@ -43957,7 +43977,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
43957
43977
  ]);
43958
43978
  async function classifyWithLLM(task) {
43959
43979
  try {
43960
- const { executeExpert: executeExpert2 } = await import("./expert-bridge-KTKJTMMO.js");
43980
+ const { executeExpert: executeExpert2 } = await import("./expert-bridge-HGBVHVJI.js");
43961
43981
  const prompt = [
43962
43982
  "Classify this task into exactly one pipeline template.",
43963
43983
  "Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
@@ -45698,7 +45718,7 @@ var memoryInitPromise = null;
45698
45718
  async function initPipelineMemory() {
45699
45719
  if (cachedMemory !== null) return cachedMemory;
45700
45720
  try {
45701
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-GVOVQ3TV.js");
45721
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-XIIEIJPT.js");
45702
45722
  const { getLearningDir } = await import("./learning-persistence-EGY4VKKO.js");
45703
45723
  const mem = createSessionMemory2(getLearningDir());
45704
45724
  mem.startSession(`pipeline-${String(getTimeProvider().now())}`);
@@ -45760,7 +45780,7 @@ function recordRoutingExperience(category, success, durationMs, tokensUsed = 0,
45760
45780
  callRecord(routingMemoryCache);
45761
45781
  return;
45762
45782
  }
45763
- routingMemoryInitPromise ??= import("./routing-memory-BZ6IGNXN.js").then(({ createRoutingMemory }) => {
45783
+ routingMemoryInitPromise ??= import("./routing-memory-JPDPHK7P.js").then(({ createRoutingMemory }) => {
45764
45784
  routingMemoryCache ??= createRoutingMemory();
45765
45785
  return routingMemoryCache;
45766
45786
  }).catch((error) => {
@@ -45794,7 +45814,7 @@ ${text}` : "";
45794
45814
  }
45795
45815
  async function getWeatherContext() {
45796
45816
  try {
45797
- const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-YY7BO744.js");
45817
+ const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-464SS6FY.js");
45798
45818
  const report = generateWeatherReport2({ includeAdaptive: true });
45799
45819
  const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
45800
45820
  if (!Array.isArray(mappings) || mappings.length === 0) return "";
@@ -45812,7 +45832,7 @@ ${lines}
45812
45832
  }
45813
45833
  async function getMemoryContext(task) {
45814
45834
  try {
45815
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-GVOVQ3TV.js");
45835
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-XIIEIJPT.js");
45816
45836
  const { getLearningDir } = await import("./learning-persistence-EGY4VKKO.js");
45817
45837
  const memory = createSessionMemory2(getLearningDir(), { maxLearningsInContext: 10 });
45818
45838
  const learnings = memory.searchLearnings(task.slice(0, 200));
@@ -45931,7 +45951,7 @@ ${contextBlock}`;
45931
45951
  const strategy = config.votingStrategy ?? "higher_order";
45932
45952
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
45933
45953
  try {
45934
- const { executeVoting } = await import("./consensus-vote-DL4XNR7M.js");
45954
+ const { executeVoting } = await import("./consensus-vote-77UCSVGM.js");
45935
45955
  const votingResult = await executeVoting(
45936
45956
  {
45937
45957
  proposal: buildVoteProposal(plan, research),
@@ -46370,7 +46390,7 @@ async function searchCodebaseForTask(task) {
46370
46390
  }
46371
46391
  async function queryResearchRegistry(task) {
46372
46392
  try {
46373
- const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-YSYYUW5H.js");
46393
+ const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-K5TX2WM3.js");
46374
46394
  const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
46375
46395
  if (topic === void 0) return null;
46376
46396
  const result = await synthesizeResearch2(topic.slice(0, 50));
@@ -46441,7 +46461,7 @@ function createScanStageWrapper() {
46441
46461
  try {
46442
46462
  const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
46443
46463
  if (slug !== void 0) {
46444
- const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-QYSW4MKN.js");
46464
+ const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-NFYC64IS.js");
46445
46465
  const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
46446
46466
  const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
46447
46467
  return output(PIPELINE_STATE_KEYS.FINDINGS, recs, getTimeProvider().now() - start, true);
@@ -49564,7 +49584,7 @@ var GitHubTaskTracker = class {
49564
49584
  cachedProvider = null;
49565
49585
  async getProvider() {
49566
49586
  if (this.cachedProvider !== null) return this.cachedProvider;
49567
- const { createScmProvider } = await import("./factory-QQKY3UW4.js");
49587
+ const { createScmProvider } = await import("./factory-LEYEWZ4Y.js");
49568
49588
  const result = await createScmProvider({ repo: this.config.repo ?? "" });
49569
49589
  if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
49570
49590
  this.cachedProvider = result.value;
@@ -50455,7 +50475,7 @@ async function probeSource(source, includeModelIds) {
50455
50475
  }
50456
50476
  }
50457
50477
  async function defaultSources(includeOpenRouter) {
50458
- const { createAllAdapters: createAllAdapters2 } = await import("./factory-SC3N2RMX.js");
50478
+ const { createAllAdapters: createAllAdapters2 } = await import("./factory-GEBBVQHZ.js");
50459
50479
  const adapters = createAllAdapters2();
50460
50480
  return buildDefaultModelSources(adapters, { includeOpenRouter });
50461
50481
  }
@@ -54497,4 +54517,4 @@ export {
54497
54517
  shutdownFeedbackSubscriber,
54498
54518
  createEventBusBridge
54499
54519
  };
54500
- //# sourceMappingURL=chunk-YBGX57DL.js.map
54520
+ //# sourceMappingURL=chunk-ZZED3BWY.js.map