nexus-agents 2.30.8 → 2.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/{adaptive-memory-THOGYVKK.js → adaptive-memory-FF4LRS3M.js} +3 -3
  2. package/dist/{chunk-2L6A7RUZ.js → chunk-2DVT67R2.js} +3 -3
  3. package/dist/{chunk-HIVFP5CS.js → chunk-3YEDP3LK.js} +4 -4
  4. package/dist/{chunk-YSBHF2TG.js → chunk-4R2BADP4.js} +2 -2
  5. package/dist/{chunk-32ZTPL7Q.js → chunk-DUGFNXRP.js} +2 -2
  6. package/dist/{chunk-UMM5PVLB.js → chunk-DUGURS54.js} +2 -2
  7. package/dist/{chunk-V7GL5HZF.js → chunk-ESI6I6IF.js} +3 -3
  8. package/dist/{chunk-2HAZZAU5.js → chunk-FTH5Y5II.js} +2 -2
  9. package/dist/{chunk-2W7AM3I7.js → chunk-HNI3NK4K.js} +3 -3
  10. package/dist/{chunk-US7Z5ITC.js → chunk-IPRGKBMI.js} +6 -6
  11. package/dist/{chunk-ILGF6JIL.js → chunk-JPPXO7PQ.js} +126 -73
  12. package/dist/{chunk-ILGF6JIL.js.map → chunk-JPPXO7PQ.js.map} +1 -1
  13. package/dist/{chunk-4PRT4F7I.js → chunk-KZZIPU4X.js} +6 -6
  14. package/dist/{chunk-IFIRZ35E.js → chunk-NPISXFJY.js} +2 -2
  15. package/dist/{chunk-KFHU4P75.js → chunk-PN7EM6R4.js} +4 -4
  16. package/dist/{chunk-GUO4TIIX.js → chunk-RP4ZPI77.js} +2 -2
  17. package/dist/{chunk-ZXIFNJ7Q.js → chunk-SL2N2TEK.js} +2 -2
  18. package/dist/{chunk-VCYDKMGJ.js → chunk-UJ52FKAE.js} +2 -2
  19. package/dist/{chunk-MDFQ3G3Y.js → chunk-XHLEJFLY.js} +6 -6
  20. package/dist/{chunk-I66ZKP33.js → chunk-Z2EQVPEU.js} +2 -2
  21. package/dist/{chunk-6V3HZQRC.js → chunk-ZRYYNLJT.js} +2 -2
  22. package/dist/{chunk-GNR437CG.js → chunk-ZVXTKGMG.js} +325 -67
  23. package/dist/chunk-ZVXTKGMG.js.map +1 -0
  24. package/dist/{cli-circuit-breaker-MBTG6XC7.js → cli-circuit-breaker-PTIXGLJT.js} +4 -4
  25. package/dist/cli.js +22 -20
  26. package/dist/cli.js.map +1 -1
  27. package/dist/{composite-router-IRF52MS7.js → composite-router-UJVTEANR.js} +2 -2
  28. package/dist/{consensus-vote-6U4LANAT.js → consensus-vote-PR6OOWNP.js} +7 -7
  29. package/dist/{doctor-deep-RMOKEOCC.js → doctor-deep-QBOVS2PV.js} +3 -3
  30. package/dist/{expert-bridge-DXSKS5OG.js → expert-bridge-7GT2TPM4.js} +3 -3
  31. package/dist/{factory-SUZOQZOE.js → factory-7CF7KPZD.js} +5 -5
  32. package/dist/{factory-FYHY577A.js → factory-B4RFWJFK.js} +4 -4
  33. package/dist/index.d.ts +34 -34
  34. package/dist/index.js +18 -18
  35. package/dist/index.js.map +1 -1
  36. package/dist/{issue-triage-KGXVGBZR.js → issue-triage-RUAN7U3E.js} +4 -4
  37. package/dist/{mcp-config-PS73M32C.js → mcp-config-IGSZJ6V4.js} +3 -3
  38. package/dist/{mobimem-ATF4YCSJ.js → mobimem-4I3VN7HE.js} +2 -2
  39. package/dist/{repo-security-plan-VMTRN3PJ.js → repo-security-plan-WFPK2V7U.js} +3 -3
  40. package/dist/research-helpers-synthesize-RYXRUNDQ.js +10 -0
  41. package/dist/{routing-memory-5VJTEGLC.js → routing-memory-SS3FLYDV.js} +2 -2
  42. package/dist/{session-memory-UA3L4Q6K.js → session-memory-IGXMRL47.js} +3 -3
  43. package/dist/{setup-command-KUZZLEZ4.js → setup-command-A7XLIUX5.js} +7 -7
  44. package/dist/{setup-config-IJ6RFRA4.js → setup-config-OD6ZZWKZ.js} +3 -3
  45. package/dist/{weather-report-B43EV36T.js → weather-report-3L72MUQ3.js} +2 -2
  46. package/package.json +1 -1
  47. package/dist/chunk-GNR437CG.js.map +0 -1
  48. package/dist/research-helpers-synthesize-A6ZTAYLN.js +0 -10
  49. /package/dist/{adaptive-memory-THOGYVKK.js.map → adaptive-memory-FF4LRS3M.js.map} +0 -0
  50. /package/dist/{chunk-2L6A7RUZ.js.map → chunk-2DVT67R2.js.map} +0 -0
  51. /package/dist/{chunk-HIVFP5CS.js.map → chunk-3YEDP3LK.js.map} +0 -0
  52. /package/dist/{chunk-YSBHF2TG.js.map → chunk-4R2BADP4.js.map} +0 -0
  53. /package/dist/{chunk-32ZTPL7Q.js.map → chunk-DUGFNXRP.js.map} +0 -0
  54. /package/dist/{chunk-UMM5PVLB.js.map → chunk-DUGURS54.js.map} +0 -0
  55. /package/dist/{chunk-V7GL5HZF.js.map → chunk-ESI6I6IF.js.map} +0 -0
  56. /package/dist/{chunk-2HAZZAU5.js.map → chunk-FTH5Y5II.js.map} +0 -0
  57. /package/dist/{chunk-2W7AM3I7.js.map → chunk-HNI3NK4K.js.map} +0 -0
  58. /package/dist/{chunk-US7Z5ITC.js.map → chunk-IPRGKBMI.js.map} +0 -0
  59. /package/dist/{chunk-4PRT4F7I.js.map → chunk-KZZIPU4X.js.map} +0 -0
  60. /package/dist/{chunk-IFIRZ35E.js.map → chunk-NPISXFJY.js.map} +0 -0
  61. /package/dist/{chunk-KFHU4P75.js.map → chunk-PN7EM6R4.js.map} +0 -0
  62. /package/dist/{chunk-GUO4TIIX.js.map → chunk-RP4ZPI77.js.map} +0 -0
  63. /package/dist/{chunk-ZXIFNJ7Q.js.map → chunk-SL2N2TEK.js.map} +0 -0
  64. /package/dist/{chunk-VCYDKMGJ.js.map → chunk-UJ52FKAE.js.map} +0 -0
  65. /package/dist/{chunk-MDFQ3G3Y.js.map → chunk-XHLEJFLY.js.map} +0 -0
  66. /package/dist/{chunk-I66ZKP33.js.map → chunk-Z2EQVPEU.js.map} +0 -0
  67. /package/dist/{chunk-6V3HZQRC.js.map → chunk-ZRYYNLJT.js.map} +0 -0
  68. /package/dist/{cli-circuit-breaker-MBTG6XC7.js.map → cli-circuit-breaker-PTIXGLJT.js.map} +0 -0
  69. /package/dist/{composite-router-IRF52MS7.js.map → composite-router-UJVTEANR.js.map} +0 -0
  70. /package/dist/{consensus-vote-6U4LANAT.js.map → consensus-vote-PR6OOWNP.js.map} +0 -0
  71. /package/dist/{doctor-deep-RMOKEOCC.js.map → doctor-deep-QBOVS2PV.js.map} +0 -0
  72. /package/dist/{expert-bridge-DXSKS5OG.js.map → expert-bridge-7GT2TPM4.js.map} +0 -0
  73. /package/dist/{factory-FYHY577A.js.map → factory-7CF7KPZD.js.map} +0 -0
  74. /package/dist/{factory-SUZOQZOE.js.map → factory-B4RFWJFK.js.map} +0 -0
  75. /package/dist/{issue-triage-KGXVGBZR.js.map → issue-triage-RUAN7U3E.js.map} +0 -0
  76. /package/dist/{mcp-config-PS73M32C.js.map → mcp-config-IGSZJ6V4.js.map} +0 -0
  77. /package/dist/{mobimem-ATF4YCSJ.js.map → mobimem-4I3VN7HE.js.map} +0 -0
  78. /package/dist/{repo-security-plan-VMTRN3PJ.js.map → repo-security-plan-WFPK2V7U.js.map} +0 -0
  79. /package/dist/{research-helpers-synthesize-A6ZTAYLN.js.map → research-helpers-synthesize-RYXRUNDQ.js.map} +0 -0
  80. /package/dist/{routing-memory-5VJTEGLC.js.map → routing-memory-SS3FLYDV.js.map} +0 -0
  81. /package/dist/{session-memory-UA3L4Q6K.js.map → session-memory-IGXMRL47.js.map} +0 -0
  82. /package/dist/{setup-command-KUZZLEZ4.js.map → setup-command-A7XLIUX5.js.map} +0 -0
  83. /package/dist/{setup-config-IJ6RFRA4.js.map → setup-config-OD6ZZWKZ.js.map} +0 -0
  84. /package/dist/{weather-report-B43EV36T.js.map → weather-report-3L72MUQ3.js.map} +0 -0
@@ -2,9 +2,9 @@ import {
2
2
  AdaptiveMemoryBackend,
3
3
  DEFAULT_SCORING_CONFIG,
4
4
  createAdaptiveMemory
5
- } from "./chunk-I66ZKP33.js";
5
+ } from "./chunk-Z2EQVPEU.js";
6
6
  import "./chunk-633WH2ML.js";
7
- import "./chunk-GNR437CG.js";
7
+ import "./chunk-ZVXTKGMG.js";
8
8
  import "./chunk-CLYZ7FWP.js";
9
9
  import "./chunk-UP2VWCW5.js";
10
10
  export {
@@ -12,4 +12,4 @@ export {
12
12
  DEFAULT_SCORING_CONFIG,
13
13
  createAdaptiveMemory
14
14
  };
15
- //# sourceMappingURL=adaptive-memory-THOGYVKK.js.map
15
+ //# sourceMappingURL=adaptive-memory-FF4LRS3M.js.map
@@ -2,13 +2,13 @@ import {
2
2
  CircuitBreakerRegistry,
3
3
  CircuitError,
4
4
  mapCliErrorToCategory
5
- } from "./chunk-IFIRZ35E.js";
5
+ } from "./chunk-NPISXFJY.js";
6
6
  import {
7
7
  createLogger,
8
8
  err,
9
9
  getTimeProvider,
10
10
  ok
11
- } from "./chunk-GNR437CG.js";
11
+ } from "./chunk-ZVXTKGMG.js";
12
12
 
13
13
  // src/cli-adapters/fallback-chains.ts
14
14
  import { z } from "zod";
@@ -192,4 +192,4 @@ export {
192
192
  CliCircuitBreakerIntegration,
193
193
  createCliCircuitBreakerIntegration
194
194
  };
195
- //# sourceMappingURL=chunk-2L6A7RUZ.js.map
195
+ //# sourceMappingURL=chunk-2DVT67R2.js.map
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  resolveToken
3
- } from "./chunk-2HAZZAU5.js";
3
+ } from "./chunk-FTH5Y5II.js";
4
4
  import {
5
5
  GitHubProvider,
6
6
  ScmError
7
- } from "./chunk-UMM5PVLB.js";
7
+ } from "./chunk-DUGURS54.js";
8
8
  import {
9
9
  err,
10
10
  ok
11
- } from "./chunk-GNR437CG.js";
11
+ } from "./chunk-ZVXTKGMG.js";
12
12
 
13
13
  // src/scm/factory.ts
14
14
  async function createScmProvider(config) {
@@ -41,4 +41,4 @@ export {
41
41
  createScmProvider,
42
42
  createGitHubProvider
43
43
  };
44
- //# sourceMappingURL=chunk-HIVFP5CS.js.map
44
+ //# sourceMappingURL=chunk-3YEDP3LK.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-BC3M4VLP.js";
4
4
  import {
5
5
  createLogger
6
- } from "./chunk-GNR437CG.js";
6
+ } from "./chunk-ZVXTKGMG.js";
7
7
 
8
8
  // src/mcp/tools/scanner-registry-fetcher.ts
9
9
  import { z } from "zod";
@@ -697,4 +697,4 @@ export {
697
697
  generateSecurityPlan,
698
698
  buildPlanFromAnalysis
699
699
  };
700
- //# sourceMappingURL=chunk-YSBHF2TG.js.map
700
+ //# sourceMappingURL=chunk-4R2BADP4.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getErrorMessage
3
- } from "./chunk-GNR437CG.js";
3
+ } from "./chunk-ZVXTKGMG.js";
4
4
 
5
5
  // src/cli/setup-config.ts
6
6
  import { existsSync, writeFileSync } from "fs";
@@ -59,4 +59,4 @@ function runConfigInitSync(projectRoot, force, dryRun) {
59
59
  export {
60
60
  runConfigInitSync
61
61
  };
62
- //# sourceMappingURL=chunk-32ZTPL7Q.js.map
62
+ //# sourceMappingURL=chunk-DUGFNXRP.js.map
@@ -3,7 +3,7 @@ import {
3
3
  err,
4
4
  getErrorMessage,
5
5
  ok
6
- } from "./chunk-GNR437CG.js";
6
+ } from "./chunk-ZVXTKGMG.js";
7
7
 
8
8
  // src/scm/types.ts
9
9
  var ScmError = class extends Error {
@@ -243,4 +243,4 @@ export {
243
243
  ScmError,
244
244
  GitHubProvider
245
245
  };
246
- //# sourceMappingURL=chunk-UMM5PVLB.js.map
246
+ //# sourceMappingURL=chunk-DUGURS54.js.map
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  GitHubProvider,
3
3
  ScmError
4
- } from "./chunk-UMM5PVLB.js";
4
+ } from "./chunk-DUGURS54.js";
5
5
  import {
6
6
  CACHE_TIMEOUTS,
7
7
  createLogger,
8
8
  err,
9
9
  getTimeProvider,
10
10
  ok
11
- } from "./chunk-GNR437CG.js";
11
+ } from "./chunk-ZVXTKGMG.js";
12
12
 
13
13
  // src/security/trust-types.ts
14
14
  import { z } from "zod";
@@ -1582,4 +1582,4 @@ export {
1582
1582
  IssueTriage,
1583
1583
  createIssueTriage
1584
1584
  };
1585
- //# sourceMappingURL=chunk-V7GL5HZF.js.map
1585
+ //# sourceMappingURL=chunk-ESI6I6IF.js.map
@@ -2,7 +2,7 @@ import {
2
2
  createLogger,
3
3
  err,
4
4
  ok
5
- } from "./chunk-GNR437CG.js";
5
+ } from "./chunk-ZVXTKGMG.js";
6
6
 
7
7
  // src/scm/token-resolver.ts
8
8
  import { execFile } from "child_process";
@@ -87,4 +87,4 @@ export {
87
87
  hasToken,
88
88
  getTokenEnvVars
89
89
  };
90
- //# sourceMappingURL=chunk-2HAZZAU5.js.map
90
+ //# sourceMappingURL=chunk-FTH5Y5II.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CliCircuitBreaker,
3
3
  DEFAULT_CIRCUIT_BREAKER_CONFIG
4
- } from "./chunk-IFIRZ35E.js";
4
+ } from "./chunk-NPISXFJY.js";
5
5
  import {
6
6
  CLI_SUBPROCESS_TIMEOUTS,
7
7
  CLI_TIMEOUTS,
@@ -25,7 +25,7 @@ import {
25
25
  getTimeProvider,
26
26
  isRateLimitText,
27
27
  ok
28
- } from "./chunk-GNR437CG.js";
28
+ } from "./chunk-ZVXTKGMG.js";
29
29
 
30
30
  // src/cli-adapters/subprocess-adapter.ts
31
31
  import { spawn } from "child_process";
@@ -2727,4 +2727,4 @@ export {
2727
2727
  isCliAvailable,
2728
2728
  getAvailableClis
2729
2729
  };
2730
- //# sourceMappingURL=chunk-2W7AM3I7.js.map
2730
+ //# sourceMappingURL=chunk-HNI3NK4K.js.map
@@ -2,7 +2,7 @@ import {
2
2
  createLogger,
3
3
  getTimeProvider,
4
4
  isRateLimitText
5
- } from "./chunk-GNR437CG.js";
5
+ } from "./chunk-ZVXTKGMG.js";
6
6
 
7
7
  // src/pipeline/expert-bridge.ts
8
8
  var logger = createLogger({ component: "expert-bridge" });
@@ -12,7 +12,7 @@ var cachedMcpConfigPath = null;
12
12
  async function getMcpConfigPath() {
13
13
  if (cachedMcpConfigPath !== null) return cachedMcpConfigPath;
14
14
  try {
15
- const { generateMcpConfig } = await import("./mcp-config-PS73M32C.js");
15
+ const { generateMcpConfig } = await import("./mcp-config-IGSZJ6V4.js");
16
16
  const config = await generateMcpConfig();
17
17
  cachedMcpConfigPath = config.configPath;
18
18
  return cachedMcpConfigPath;
@@ -38,13 +38,13 @@ function adaptCompositeRouter(compositeRouter) {
38
38
  }
39
39
  async function getRouter() {
40
40
  if (cachedRouter !== null) return cachedRouter;
41
- const { createAllAdapters } = await import("./factory-FYHY577A.js");
42
- const { createCompositeRouter } = await import("./composite-router-IRF52MS7.js");
41
+ const { createAllAdapters } = await import("./factory-B4RFWJFK.js");
42
+ const { createCompositeRouter } = await import("./composite-router-UJVTEANR.js");
43
43
  const adapters = createAllAdapters();
44
44
  if (adapters.size === 0) return null;
45
45
  cachedRouter = adaptCompositeRouter(createCompositeRouter(adapters));
46
46
  try {
47
- const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-MBTG6XC7.js");
47
+ const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-PTIXGLJT.js");
48
48
  cachedCircuitBreaker = createCliCircuitBreakerIntegration([...adapters.values()]);
49
49
  } catch (error) {
50
50
  const msg = error instanceof Error ? error.message : String(error);
@@ -136,4 +136,4 @@ ${prompt}`;
136
136
  export {
137
137
  executeExpert
138
138
  };
139
- //# sourceMappingURL=chunk-US7Z5ITC.js.map
139
+ //# sourceMappingURL=chunk-IPRGKBMI.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getTokenEnvVars,
3
3
  resolveToken
4
- } from "./chunk-2HAZZAU5.js";
4
+ } from "./chunk-FTH5Y5II.js";
5
5
  import {
6
6
  ClaudeAdapter,
7
7
  DEFAULT_RELEVANCE_CONFIG,
@@ -25,7 +25,7 @@ import {
25
25
  toolSuccessStructured,
26
26
  withProgressHeartbeat,
27
27
  wrapToolWithTimeout
28
- } from "./chunk-4PRT4F7I.js";
28
+ } from "./chunk-KZZIPU4X.js";
29
29
  import {
30
30
  REGISTRY_PATH,
31
31
  getProjectRoot,
@@ -35,14 +35,14 @@ import {
35
35
  resolveInsideRoot,
36
36
  savePapersRegistry,
37
37
  synthesizeResearch
38
- } from "./chunk-6V3HZQRC.js";
38
+ } from "./chunk-ZRYYNLJT.js";
39
39
  import {
40
40
  IssueTriage,
41
41
  sanitizeInput
42
- } from "./chunk-V7GL5HZF.js";
42
+ } from "./chunk-ESI6I6IF.js";
43
43
  import {
44
44
  generateSecurityPlan
45
- } from "./chunk-YSBHF2TG.js";
45
+ } from "./chunk-4R2BADP4.js";
46
46
  import {
47
47
  analyzeGitHubRepo
48
48
  } from "./chunk-BC3M4VLP.js";
@@ -65,14 +65,14 @@ import {
65
65
  import {
66
66
  DEFAULT_TASK_TTL_MS,
67
67
  clampTaskTtl
68
- } from "./chunk-MDFQ3G3Y.js";
68
+ } from "./chunk-XHLEJFLY.js";
69
69
  import {
70
70
  createSessionMemory
71
- } from "./chunk-ZXIFNJ7Q.js";
71
+ } from "./chunk-SL2N2TEK.js";
72
72
  import {
73
73
  MemoryImportance,
74
74
  calculateTextJaccardSimilarity
75
- } from "./chunk-I66ZKP33.js";
75
+ } from "./chunk-Z2EQVPEU.js";
76
76
  import {
77
77
  STOPWORDS,
78
78
  capitalize,
@@ -81,13 +81,13 @@ import {
81
81
  } from "./chunk-633WH2ML.js";
82
82
  import {
83
83
  generateMcpConfig
84
- } from "./chunk-GUO4TIIX.js";
84
+ } from "./chunk-RP4ZPI77.js";
85
85
  import {
86
86
  getFallbackChainForCategory
87
- } from "./chunk-2L6A7RUZ.js";
87
+ } from "./chunk-2DVT67R2.js";
88
88
  import {
89
89
  executeExpert
90
- } from "./chunk-US7Z5ITC.js";
90
+ } from "./chunk-IPRGKBMI.js";
91
91
  import {
92
92
  ClaudeCliAdapter,
93
93
  CliDetectionCache,
@@ -96,7 +96,7 @@ import {
96
96
  getAvailableClis,
97
97
  sleep,
98
98
  withTimeout
99
- } from "./chunk-2W7AM3I7.js";
99
+ } from "./chunk-HNI3NK4K.js";
100
100
  import {
101
101
  AGENT_ROUTER_TIMEOUTS,
102
102
  API_TIMEOUTS,
@@ -165,8 +165,9 @@ import {
165
165
  isRateLimitLikeError,
166
166
  modelSupportsAll,
167
167
  ok,
168
- toExpertTaskAnalysisResult
169
- } from "./chunk-GNR437CG.js";
168
+ toExpertTaskAnalysisResult,
169
+ withStep
170
+ } from "./chunk-ZVXTKGMG.js";
170
171
  import {
171
172
  isPersistenceEnabled
172
173
  } from "./chunk-CLYZ7FWP.js";
@@ -28233,23 +28234,35 @@ function emitHookFailed(opts) {
28233
28234
  });
28234
28235
  }
28235
28236
  async function executeHook(base, run, onSuccess, onFailure) {
28236
- const startTime = getTimeProvider().now();
28237
- emitHookEvent({ type: "hook_started", ...base });
28238
- try {
28239
- const result = await run();
28240
- const durationMs = getTimeProvider().now() - startTime;
28241
- if (result.ok) {
28242
- emitHookEvent({ type: "hook_completed", ...base, durationMs });
28243
- return onSuccess(durationMs);
28237
+ return withStep(
28238
+ {
28239
+ name: `hook:${base.hookPhase}:${base.nodeId}`,
28240
+ kind: "graph.hook",
28241
+ attrs: { nodeId: base.nodeId, hookName: base.hookName, phase: base.hookPhase }
28242
+ },
28243
+ async (ctx) => {
28244
+ const startTime = getTimeProvider().now();
28245
+ emitHookEvent({ type: "hook_started", ...base });
28246
+ try {
28247
+ const result = await run();
28248
+ const durationMs = getTimeProvider().now() - startTime;
28249
+ if (result.ok) {
28250
+ emitHookEvent({ type: "hook_completed", ...base, durationMs });
28251
+ ctx.setSummary(`${base.hookPhase} passed`);
28252
+ return onSuccess(durationMs);
28253
+ }
28254
+ emitHookFailed({ ...base, error: result.error.message });
28255
+ ctx.setSummary(`${base.hookPhase} failed: ${result.error.message}`);
28256
+ return onFailure(durationMs, result.error.message);
28257
+ } catch (error) {
28258
+ const durationMs = getTimeProvider().now() - startTime;
28259
+ const msg = error instanceof Error ? error.message : String(error);
28260
+ emitHookFailed({ ...base, error: msg });
28261
+ ctx.setSummary(`${base.hookPhase} error: ${msg}`);
28262
+ return onFailure(durationMs, msg);
28263
+ }
28244
28264
  }
28245
- emitHookFailed({ ...base, error: result.error.message });
28246
- return onFailure(durationMs, result.error.message);
28247
- } catch (error) {
28248
- const durationMs = getTimeProvider().now() - startTime;
28249
- const msg = error instanceof Error ? error.message : String(error);
28250
- emitHookFailed({ ...base, error: msg });
28251
- return onFailure(durationMs, msg);
28252
- }
28265
+ );
28253
28266
  }
28254
28267
  async function runSinglePrecondition(config, ctx, options) {
28255
28268
  const base = {
@@ -35957,25 +35970,38 @@ async function runExpertTask(deps, args, expert) {
35957
35970
  const fallback = await tryExpertFallback(expert, task, deps.logger);
35958
35971
  if (fallback !== void 0) return fallback;
35959
35972
  }
35960
- deps.logger?.info("Executing expert task", { expertId, role: expert.role, taskId: task.id });
35961
- const monitor = getHeartbeatMonitor();
35962
- const sessionId = monitor.startSession(expertId);
35963
- const startTime = getTimeProvider().now();
35964
- const heartbeatTimer = setInterval(() => {
35965
- if (monitor.isExpired(sessionId)) {
35966
- deps.logger?.warn("Expert session expired", { expertId, sessionId });
35973
+ return withStep(
35974
+ { name: `expert:${expert.role}`, kind: "expert.exec", attrs: { expertId, role: expert.role } },
35975
+ async (ctx) => {
35976
+ const monitor = getHeartbeatMonitor();
35977
+ const sessionId = monitor.startSession(expertId);
35978
+ const startTime = getTimeProvider().now();
35979
+ const heartbeatTimer = setInterval(() => {
35980
+ if (monitor.isExpired(sessionId)) {
35981
+ deps.logger?.warn("Expert session expired", { expertId, sessionId });
35982
+ }
35983
+ monitor.heartbeat(sessionId);
35984
+ }, HEARTBEAT_TIMEOUTS.heartbeatIntervalMs);
35985
+ let result;
35986
+ try {
35987
+ result = await expert.execute(task);
35988
+ } finally {
35989
+ clearInterval(heartbeatTimer);
35990
+ monitor.endSession(sessionId);
35991
+ }
35992
+ const durationMs = getTimeProvider().now() - startTime;
35993
+ const classified = await classifyExpertResult({
35994
+ result,
35995
+ expert,
35996
+ task,
35997
+ args,
35998
+ durationMs,
35999
+ logger: deps.logger
36000
+ });
36001
+ ctx.setSummary(classified.ok ? `${expert.role} ok` : `${expert.role} failed`);
36002
+ return classified;
35967
36003
  }
35968
- monitor.heartbeat(sessionId);
35969
- }, HEARTBEAT_TIMEOUTS.heartbeatIntervalMs);
35970
- let result;
35971
- try {
35972
- result = await expert.execute(task);
35973
- } finally {
35974
- clearInterval(heartbeatTimer);
35975
- monitor.endSession(sessionId);
35976
- }
35977
- const durationMs = getTimeProvider().now() - startTime;
35978
- return classifyExpertResult({ result, expert, task, args, durationMs, logger: deps.logger });
36004
+ );
35979
36005
  }
35980
36006
  async function handleExecuteExpert(deps, args) {
35981
36007
  const lookup = lookupExpert(deps.expertRegistry, args.expertId);
@@ -40971,7 +40997,7 @@ async function tryIssueTriage(task) {
40971
40997
  try {
40972
40998
  const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
40973
40999
  if (issueMatch === null) return null;
40974
- const { createIssueTriage } = await import("./issue-triage-KGXVGBZR.js");
41000
+ const { createIssueTriage } = await import("./issue-triage-RUAN7U3E.js");
40975
41001
  const triage = createIssueTriage();
40976
41002
  const owner = issueMatch[1] ?? "";
40977
41003
  const num = issueMatch[2] ?? "";
@@ -40999,7 +41025,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
40999
41025
  ]);
41000
41026
  async function classifyWithLLM(task) {
41001
41027
  try {
41002
- const { executeExpert: executeExpert2 } = await import("./expert-bridge-DXSKS5OG.js");
41028
+ const { executeExpert: executeExpert2 } = await import("./expert-bridge-7GT2TPM4.js");
41003
41029
  const prompt = [
41004
41030
  "Classify this task into exactly one pipeline template.",
41005
41031
  "Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
@@ -41793,7 +41819,7 @@ var memoryInitPromise = null;
41793
41819
  async function initPipelineMemory() {
41794
41820
  if (cachedMemory !== null) return cachedMemory;
41795
41821
  try {
41796
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-UA3L4Q6K.js");
41822
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-IGXMRL47.js");
41797
41823
  const { LEARNING_DIR } = await import("./learning-persistence-WMWZJZ35.js");
41798
41824
  const mem = createSessionMemory2(LEARNING_DIR);
41799
41825
  mem.startSession(`pipeline-${String(Date.now())}`);
@@ -41846,7 +41872,7 @@ async function persistMobiMemState() {
41846
41872
  if (!isPersistenceEnabled2()) return;
41847
41873
  const os5 = await import("os");
41848
41874
  const path19 = await import("path");
41849
- const { createMobiMem } = await import("./mobimem-ATF4YCSJ.js");
41875
+ const { createMobiMem } = await import("./mobimem-4I3VN7HE.js");
41850
41876
  const mobimem = createMobiMem();
41851
41877
  const savePath = path19.join(os5.homedir(), ".nexus-agents", "memory", "mobimem-state.json");
41852
41878
  await mobimem.save(savePath);
@@ -41863,7 +41889,7 @@ function recordRoutingExperience(category, success, durationMs) {
41863
41889
  callRecord(routingMemoryCache);
41864
41890
  return;
41865
41891
  }
41866
- void import("./routing-memory-5VJTEGLC.js").then(({ createRoutingMemory }) => {
41892
+ void import("./routing-memory-SS3FLYDV.js").then(({ createRoutingMemory }) => {
41867
41893
  routingMemoryCache = createRoutingMemory();
41868
41894
  callRecord(routingMemoryCache);
41869
41895
  }).catch((error) => {
@@ -41892,7 +41918,7 @@ ${text}` : "";
41892
41918
  }
41893
41919
  async function getWeatherContext() {
41894
41920
  try {
41895
- const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-B43EV36T.js");
41921
+ const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-3L72MUQ3.js");
41896
41922
  const report = generateWeatherReport2({ includeAdaptive: true });
41897
41923
  const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
41898
41924
  if (!Array.isArray(mappings) || mappings.length === 0) return "";
@@ -41909,7 +41935,7 @@ ${lines}
41909
41935
  }
41910
41936
  async function getMemoryContext(task) {
41911
41937
  try {
41912
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-UA3L4Q6K.js");
41938
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-IGXMRL47.js");
41913
41939
  const { LEARNING_DIR } = await import("./learning-persistence-WMWZJZ35.js");
41914
41940
  const memory = createSessionMemory2(LEARNING_DIR, { maxLearningsInContext: 10 });
41915
41941
  const learnings = memory.searchLearnings(task.slice(0, 200));
@@ -42002,7 +42028,7 @@ ${contextBlock}`;
42002
42028
  const strategy = config.votingStrategy ?? "higher_order";
42003
42029
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
42004
42030
  try {
42005
- const { executeVoting } = await import("./consensus-vote-6U4LANAT.js");
42031
+ const { executeVoting } = await import("./consensus-vote-PR6OOWNP.js");
42006
42032
  const votingResult = await executeVoting(
42007
42033
  {
42008
42034
  proposal: plan.slice(0, 4e3),
@@ -42422,10 +42448,18 @@ function buildDryRunResult(planResult) {
42422
42448
  };
42423
42449
  }
42424
42450
  async function runPlanningPhase(task, stages, sid, prior) {
42425
- const research = await runOrResume(prior, "research", () => {
42426
- logger39.info("Stage: research", { task: task.slice(0, 100) });
42427
- return stages.research(task);
42428
- });
42451
+ const research = await runOrResume(
42452
+ prior,
42453
+ "research",
42454
+ () => withStep(
42455
+ { name: "research", kind: "pipeline.stage", attrs: { task: task.slice(0, 100) } },
42456
+ async (ctx) => {
42457
+ const r = await stages.research(task);
42458
+ ctx.setSummary(`${String(r.length)} chars`);
42459
+ return r;
42460
+ }
42461
+ )
42462
+ );
42429
42463
  if (sid !== void 0) saveStageCheckpoint(sid, "research", { type: "research", text: research });
42430
42464
  const planResult = await runPlanOrResume(prior, task, research, stages);
42431
42465
  if (sid !== void 0) {
@@ -42459,8 +42493,14 @@ async function runImplSecurityPhase(planResult, tasks, stages, sid) {
42459
42493
  const implResult = await implementQaLoop(tasks, stages);
42460
42494
  if (sid !== void 0)
42461
42495
  saveStageCheckpoint(sid, "implement", { type: "implement", tasks: implResult.completedTasks });
42462
- logger39.info("Stage: security scan");
42463
- const security = await stages.securityScan();
42496
+ const security = await withStep(
42497
+ { name: "security-scan", kind: "pipeline.stage" },
42498
+ async (ctx) => {
42499
+ const r = await stages.securityScan();
42500
+ ctx.setSummary(r.passed ? "passed" : "FAILED");
42501
+ return r;
42502
+ }
42503
+ );
42464
42504
  if (sid !== void 0) {
42465
42505
  saveStageCheckpoint(sid, "security", { type: "security", passed: security.passed });
42466
42506
  if (security.passed) cleanupCheckpoint2(sid);
@@ -42499,8 +42539,11 @@ async function runOrResumeDecompose(prior, plan, stages, meta) {
42499
42539
  logger39.info("Resuming from checkpoint", { stage: "decompose" });
42500
42540
  return [...prior.tasks];
42501
42541
  }
42502
- logger39.info("Stage: decompose");
42503
- const tasks = await stages.decompose(plan);
42542
+ const tasks = await withStep({ name: "decompose", kind: "pipeline.stage" }, async (ctx) => {
42543
+ const r = await stages.decompose(plan);
42544
+ ctx.setSummary(`${String(r.length)} tasks`);
42545
+ return r;
42546
+ });
42504
42547
  if (meta.conditional && tasks.length > 0) {
42505
42548
  return tasks.map((t) => ({
42506
42549
  ...t,
@@ -42520,10 +42563,20 @@ async function planVoteLoop(task, research, stages) {
42520
42563
  let feedback;
42521
42564
  let plan = "";
42522
42565
  for (let i = 1; i <= MAX_VOTE_ITERATIONS; i++) {
42523
- logger39.info("Stage: plan", { iteration: i });
42524
- plan = await stages.plan(task, research, feedback);
42525
- logger39.info("Stage: vote", { iteration: i });
42526
- const vote = await stages.vote(plan);
42566
+ plan = await withStep(
42567
+ { name: `plan (i=${String(i)})`, kind: "pipeline.stage", attrs: { iteration: i } },
42568
+ () => stages.plan(task, research, feedback)
42569
+ );
42570
+ const vote = await withStep(
42571
+ { name: `vote (i=${String(i)})`, kind: "consensus.vote", attrs: { iteration: i } },
42572
+ async (ctx) => {
42573
+ const r = await stages.vote(plan);
42574
+ ctx.setSummary(
42575
+ `${String(Math.round(r.approvalPercentage))}% ${isApproved(r) ? "approved" : "rejected"}`
42576
+ );
42577
+ return r;
42578
+ }
42579
+ );
42527
42580
  if (isApproved(vote)) {
42528
42581
  const meta = extractConditionalMeta(vote);
42529
42582
  logger39.info("Plan approved", { iteration: i, approval: vote.approvalPercentage, ...meta });
@@ -42844,7 +42897,7 @@ async function extractSymbolsForTask(task) {
42844
42897
  }
42845
42898
  async function retrieveAdaptiveMemory(task) {
42846
42899
  try {
42847
- const { AdaptiveMemoryBackend } = await import("./adaptive-memory-THOGYVKK.js");
42900
+ const { AdaptiveMemoryBackend } = await import("./adaptive-memory-FF4LRS3M.js");
42848
42901
  const os5 = await import("os");
42849
42902
  const path19 = await import("path");
42850
42903
  const baseDir = path19.join(os5.homedir(), ".nexus-agents", "memory");
@@ -42863,7 +42916,7 @@ async function retrieveAdaptiveMemory(task) {
42863
42916
  }
42864
42917
  async function queryResearchRegistry(task) {
42865
42918
  try {
42866
- const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-A6ZTAYLN.js");
42919
+ const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-RYXRUNDQ.js");
42867
42920
  const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
42868
42921
  if (topic === void 0) return null;
42869
42922
  const result = await synthesizeResearch2(topic.slice(0, 50));
@@ -42948,7 +43001,7 @@ function createScanStageWrapper() {
42948
43001
  try {
42949
43002
  const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
42950
43003
  if (slug !== void 0) {
42951
- const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-VMTRN3PJ.js");
43004
+ const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-WFPK2V7U.js");
42952
43005
  const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
42953
43006
  const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
42954
43007
  ctx.sharedMemory.write("scan", "decision", { recommendations: recs });
@@ -52367,7 +52420,7 @@ var GitHubTaskTracker = class {
52367
52420
  cachedProvider = null;
52368
52421
  async getProvider() {
52369
52422
  if (this.cachedProvider !== null) return this.cachedProvider;
52370
- const { createScmProvider } = await import("./factory-SUZOQZOE.js");
52423
+ const { createScmProvider } = await import("./factory-7CF7KPZD.js");
52371
52424
  const result = await createScmProvider({ repo: this.config.repo ?? "" });
52372
52425
  if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
52373
52426
  this.cachedProvider = result.value;
@@ -53206,4 +53259,4 @@ export {
53206
53259
  detectBackend,
53207
53260
  createTaskTracker
53208
53261
  };
53209
- //# sourceMappingURL=chunk-ILGF6JIL.js.map
53262
+ //# sourceMappingURL=chunk-JPPXO7PQ.js.map