nexus-agents 2.30.6 → 2.30.8

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.
@@ -5,7 +5,7 @@ import {
5
5
  executeVoting,
6
6
  registerConsensusVoteTool,
7
7
  resetCorrelationTracker
8
- } from "./chunk-23G7NV6B.js";
8
+ } from "./chunk-4PRT4F7I.js";
9
9
  import "./chunk-ZXIFNJ7Q.js";
10
10
  import "./chunk-I66ZKP33.js";
11
11
  import "./chunk-633WH2ML.js";
@@ -22,4 +22,4 @@ export {
22
22
  registerConsensusVoteTool,
23
23
  resetCorrelationTracker
24
24
  };
25
- //# sourceMappingURL=consensus-vote-MFGKPIAO.js.map
25
+ //# sourceMappingURL=consensus-vote-6U4LANAT.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  executeExpert
3
- } from "./chunk-ZVUNIQLB.js";
3
+ } from "./chunk-US7Z5ITC.js";
4
4
  import "./chunk-GNR437CG.js";
5
5
  import "./chunk-CLYZ7FWP.js";
6
6
  import "./chunk-UP2VWCW5.js";
7
7
  export {
8
8
  executeExpert
9
9
  };
10
- //# sourceMappingURL=expert-bridge-IKR23WRI.js.map
10
+ //# sourceMappingURL=expert-bridge-DXSKS5OG.js.map
package/dist/index.js CHANGED
@@ -656,7 +656,7 @@ import {
656
656
  validateWorkflowDependencies,
657
657
  withLogging,
658
658
  writePredictions
659
- } from "./chunk-T7SJVP5R.js";
659
+ } from "./chunk-ILGF6JIL.js";
660
660
  import {
661
661
  getTokenEnvVars,
662
662
  hasToken,
@@ -778,7 +778,7 @@ import {
778
778
  validateApiKeyPresence,
779
779
  validateToolInput,
780
780
  withTimeout
781
- } from "./chunk-23G7NV6B.js";
781
+ } from "./chunk-4PRT4F7I.js";
782
782
  import "./chunk-6V3HZQRC.js";
783
783
  import {
784
784
  AgentActionSchema,
@@ -850,7 +850,7 @@ import {
850
850
  connectTransport,
851
851
  createServer,
852
852
  startStdioServer
853
- } from "./chunk-MD2ABS6R.js";
853
+ } from "./chunk-MDFQ3G3Y.js";
854
854
  import "./chunk-ZXIFNJ7Q.js";
855
855
  import "./chunk-I66ZKP33.js";
856
856
  import "./chunk-633WH2ML.js";
@@ -864,7 +864,7 @@ import {
864
864
  } from "./chunk-2L6A7RUZ.js";
865
865
  import {
866
866
  executeExpert
867
- } from "./chunk-ZVUNIQLB.js";
867
+ } from "./chunk-US7Z5ITC.js";
868
868
  import {
869
869
  BaseCliAdapter,
870
870
  CLI_TIMEOUT_PROFILES,
@@ -5720,7 +5720,7 @@ function buildVotingInput(plan, config) {
5720
5720
  }
5721
5721
  async function executeSingleVote(plan, config, log) {
5722
5722
  try {
5723
- const { executeVoting } = await import("./consensus-vote-MFGKPIAO.js");
5723
+ const { executeVoting } = await import("./consensus-vote-6U4LANAT.js");
5724
5724
  const input = buildVotingInput(plan, config);
5725
5725
  const result = await executeVoting(input, log);
5726
5726
  return parseVotingResult(result);
@@ -7,9 +7,9 @@ import {
7
7
  runWizard,
8
8
  setupCommand,
9
9
  setupCommandAsync
10
- } from "./chunk-Q52QFWDQ.js";
10
+ } from "./chunk-KFHU4P75.js";
11
11
  import "./chunk-32ZTPL7Q.js";
12
- import "./chunk-MD2ABS6R.js";
12
+ import "./chunk-MDFQ3G3Y.js";
13
13
  import "./chunk-633WH2ML.js";
14
14
  import "./chunk-2W7AM3I7.js";
15
15
  import "./chunk-IFIRZ35E.js";
@@ -26,4 +26,4 @@ export {
26
26
  setupCommand,
27
27
  setupCommandAsync
28
28
  };
29
- //# sourceMappingURL=setup-command-JVFJWD7A.js.map
29
+ //# sourceMappingURL=setup-command-KUZZLEZ4.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexus-agents",
3
- "version": "2.30.6",
3
+ "version": "2.30.8",
4
4
  "description": "Intelligent orchestration platform for AI coding tools — routes tasks to the best model, learns from outcomes, and enforces quality through multi-model consensus",
5
5
  "mcpName": "io.github.williamzujkowski/nexus-agents",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/pipeline/expert-bridge.ts"],"sourcesContent":["/**\n * Expert Bridge — Programmatic access to the execute_expert pipeline (#1693)\n *\n * Provides a clean wrapper for calling experts with the full pipeline:\n * timeout, fallback cascade, degradation detection, heartbeat, outcome recording.\n *\n * DRY: reuses createBuiltInExpert + CompositeRouter instead of reimplementing.\n *\n * @module pipeline/expert-bridge\n */\n\nimport { createLogger, getTimeProvider } from '../core/index.js';\nimport type { BuiltInExpertType } from '../agents/experts/expert-config.js';\nimport { isRateLimitText } from '../adapters/rate-limit-detector.js';\n\nconst logger = createLogger({ component: 'expert-bridge' });\n\n/** Base delay for rate limit retry backoff (ms). Scales linearly: 3s, 6s, 9s. */\nconst RATE_LIMIT_BASE_DELAY_MS = 3000;\n\n/** Result of an expert execution. */\nexport interface ExpertBridgeResult {\n readonly success: boolean;\n readonly text: string;\n readonly expertType: BuiltInExpertType;\n readonly durationMs: number;\n readonly error?: string;\n}\n\n/**\n * Execute an expert task with the full nexus-agents expert pipeline.\n *\n * Creates a built-in expert, executes via CompositeRouter (for intelligent\n * CLI routing), and records outcomes. Falls back gracefully on failure.\n *\n * @param expertType - Built-in expert type (code, architecture, security, qa, etc.)\n * @param prompt - Task prompt for the expert\n * @returns Expert result with text output\n */\n/** Minimal router interface for the bridge. */\ninterface RouterLike {\n executeTask(task: {\n content: string;\n options?: Record<string, unknown> | undefined;\n }): Promise<{ ok: boolean; value: { text: string }; error: { message: string } }>;\n}\n\n// Cached router — lazily initialized, reused across calls within a session\nlet cachedRouter: RouterLike | null = null;\n\n// Cached MCP config — generated once, reused across expert calls (#1708)\nlet cachedMcpConfigPath: string | null = null;\n\n/** Get or create cached MCP config path for expert CLI sessions (#1708). */\nasync function getMcpConfigPath(): Promise<string | null> {\n if (cachedMcpConfigPath !== null) return cachedMcpConfigPath;\n try {\n const { generateMcpConfig } = await import('../swe-bench/mcp-config.js');\n const config = await generateMcpConfig();\n cachedMcpConfigPath = config.configPath;\n return cachedMcpConfigPath;\n } catch {\n return null; // MCP config not available — experts run without tools\n }\n}\n\n/** Cached circuit breaker for health monitoring (#1766). */\nlet cachedCircuitBreaker: {\n getHealthStatus(): {\n systemHealthy: boolean;\n healthyCount: number;\n clis: ReadonlyArray<{ name: string; healthy: boolean }>;\n };\n} | null = null;\n\n/** Get or create a cached CompositeRouter with circuit breaker monitoring. */\nasync function getRouter(): Promise<RouterLike | null> {\n if (cachedRouter !== null) return cachedRouter;\n const { createAllAdapters } = await import('../cli-adapters/factory.js');\n const { createCompositeRouter } = await import('../cli-adapters/composite-router.js');\n const adapters = createAllAdapters();\n if (adapters.size === 0) return null;\n cachedRouter = createCompositeRouter(adapters) as unknown as RouterLike;\n\n // Initialize circuit breaker monitoring (#1766)\n try {\n const { createCliCircuitBreakerIntegration } =\n await import('../cli-adapters/cli-circuit-breaker.js');\n cachedCircuitBreaker = createCliCircuitBreakerIntegration([...adapters.values()]);\n } catch (error: unknown) {\n // Circuit breaker not available — continue without it. Log so we can\n // notice if initialization silently stops working (#1913 Class B).\n const msg = error instanceof Error ? error.message : String(error);\n logger.debug('Circuit breaker init failed; continuing without it', { error: msg });\n }\n\n return cachedRouter;\n}\n\n/** Check CLI health before dispatch (#1766). */\nfunction checkCircuitHealth(): { healthy: boolean; message: string } {\n if (cachedCircuitBreaker === null) return { healthy: true, message: '' };\n const status = cachedCircuitBreaker.getHealthStatus();\n if (!status.systemHealthy) {\n return {\n healthy: false,\n message: `All CLI circuits open (${String(status.healthyCount)}/${String(status.clis.length)} healthy)`,\n };\n }\n return { healthy: true, message: '' };\n}\n\n/** Dispatch task to router with rate limit retry (#1802). */\nasync function dispatchWithRateLimitRetry(\n router: RouterLike,\n task: { content: string; options?: Record<string, unknown> | undefined },\n expertType: BuiltInExpertType,\n start: number\n): Promise<ExpertBridgeResult> {\n const maxAttempts = 3;\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n const result = await router.executeTask(task);\n const durationMs = getTimeProvider().now() - start;\n\n if (result.ok) {\n logger.info('Expert executed successfully', { expertType, durationMs });\n return { success: true, text: result.value.text, expertType, durationMs };\n }\n\n const isRateLimit = isRateLimitText(result.error.message);\n if (isRateLimit && attempt < maxAttempts - 1) {\n const backoffMs = RATE_LIMIT_BASE_DELAY_MS * (attempt + 1);\n logger.warn('Expert rate limited, retrying', { expertType, attempt: attempt + 1, backoffMs });\n await new Promise((resolve) => setTimeout(resolve, backoffMs));\n continue;\n }\n\n logger.warn('Expert execution failed', { expertType, error: result.error.message });\n return { success: false, text: '', expertType, durationMs, error: result.error.message };\n }\n\n return {\n success: false,\n text: '',\n expertType,\n durationMs: getTimeProvider().now() - start,\n error: 'Max retry attempts exceeded',\n };\n}\n\nexport async function executeExpert(\n expertType: BuiltInExpertType,\n prompt: string\n): Promise<ExpertBridgeResult> {\n const start = getTimeProvider().now();\n try {\n const { BUILT_IN_EXPERTS } = await import('../agents/experts/expert-config.js');\n const config = BUILT_IN_EXPERTS[expertType];\n const fullPrompt = `${config.systemPrompt}\\n\\n${prompt}`;\n\n const router = await getRouter();\n if (router === null) {\n return {\n success: false,\n text: `[No adapters] ${prompt}`,\n expertType,\n durationMs: getTimeProvider().now() - start,\n error: 'No CLI adapters available',\n };\n }\n\n // Check circuit breaker health before dispatch (#1766)\n const health = checkCircuitHealth();\n if (!health.healthy) {\n logger.warn('Circuit breaker: all CLIs unavailable', { expertType, reason: health.message });\n return {\n success: false,\n text: '',\n expertType,\n durationMs: getTimeProvider().now() - start,\n error: health.message,\n };\n }\n\n // Pass MCP config so CLI experts can call nexus-agents tools (#1708)\n const mcpConfigPath = await getMcpConfigPath();\n const task: { content: string; options?: Record<string, unknown> | undefined } = {\n content: fullPrompt,\n };\n if (mcpConfigPath !== null) task.options = { mcpConfigPath };\n\n return await dispatchWithRateLimitRetry(router, task, expertType, start);\n } catch (error) {\n const durationMs = getTimeProvider().now() - start;\n const msg = error instanceof Error ? error.message : String(error);\n logger.warn('Expert bridge error', { expertType, error: msg });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