nexus-agents 2.83.1 → 2.84.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 (120) hide show
  1. package/dist/{child-mcp-config-3ZW2UPKZ.js → child-mcp-config-VSGPMVLL.js} +3 -3
  2. package/dist/{chunk-LM2S2QWO.js → chunk-2PKAWFEU.js} +3 -2
  3. package/dist/{chunk-LM2S2QWO.js.map → chunk-2PKAWFEU.js.map} +1 -1
  4. package/dist/{chunk-I2HMWH4R.js → chunk-2WCYG75B.js} +13 -2
  5. package/dist/chunk-2WCYG75B.js.map +1 -0
  6. package/dist/{chunk-J4ZBKE4B.js → chunk-3PFESR6I.js} +1844 -1552
  7. package/dist/chunk-3PFESR6I.js.map +1 -0
  8. package/dist/{chunk-JA6ON2RP.js → chunk-4IXQ6IXI.js} +2 -2
  9. package/dist/{chunk-O3XJLOEX.js → chunk-5LFUZ5IC.js} +2 -2
  10. package/dist/{chunk-DWOSFYI2.js → chunk-BX3MUA26.js} +2 -2
  11. package/dist/{chunk-MATFDJRW.js → chunk-CJHIKBWI.js} +4 -4
  12. package/dist/{chunk-XODXYOFN.js → chunk-D5BKSM6H.js} +2 -2
  13. package/dist/{chunk-W6MLS2UL.js → chunk-GBGMTN7O.js} +2 -2
  14. package/dist/{chunk-6UI4NKT4.js → chunk-HLNMWGW3.js} +27 -4
  15. package/dist/chunk-HLNMWGW3.js.map +1 -0
  16. package/dist/{chunk-HGPIHDC4.js → chunk-I3O5WOGW.js} +4 -4
  17. package/dist/{chunk-FHY7I736.js → chunk-KK2RZVPU.js} +2 -2
  18. package/dist/{chunk-ZA6AZ7LK.js → chunk-KRRBRT7B.js} +6 -6
  19. package/dist/{chunk-7V367KT4.js → chunk-KVYQOOML.js} +7 -23
  20. package/dist/chunk-KVYQOOML.js.map +1 -0
  21. package/dist/{chunk-5QJPM5CB.js → chunk-MBD5EJBO.js} +3 -3
  22. package/dist/{chunk-ELRNVADA.js → chunk-OE7OL2BE.js} +155 -47
  23. package/dist/chunk-OE7OL2BE.js.map +1 -0
  24. package/dist/{chunk-BUXXAN6V.js → chunk-OROUYVUX.js} +2 -2
  25. package/dist/{chunk-TKGVRHEI.js → chunk-QIRZSDJK.js} +2 -2
  26. package/dist/{chunk-ZLGU7T6J.js → chunk-REH5BB67.js} +78 -63
  27. package/dist/chunk-REH5BB67.js.map +1 -0
  28. package/dist/{chunk-SZZS57X7.js → chunk-RZVEVT3M.js} +7 -7
  29. package/dist/{chunk-IM2B3FK2.js → chunk-T6B6CKU6.js} +4 -4
  30. package/dist/chunk-T6B6CKU6.js.map +1 -0
  31. package/dist/{chunk-VXIHHHLQ.js → chunk-UJMIGLZI.js} +2 -2
  32. package/dist/{chunk-6XRNFLPI.js → chunk-V35FWPHD.js} +2 -2
  33. package/dist/{chunk-ODKIRXN7.js → chunk-V7RC2PIY.js} +20 -11
  34. package/dist/chunk-V7RC2PIY.js.map +1 -0
  35. package/dist/{chunk-4XSCU4B3.js → chunk-VQIWH6X4.js} +8 -8
  36. package/dist/{chunk-BICIQYET.js → chunk-VXHDZULO.js} +3 -3
  37. package/dist/{chunk-UFUR6RBP.js → chunk-XK523BNC.js} +2 -2
  38. package/dist/chunk-YVG32OQF.js +27 -0
  39. package/dist/chunk-YVG32OQF.js.map +1 -0
  40. package/dist/{chunk-A6WC5I7V.js → chunk-ZJGCOJC6.js} +4 -4
  41. package/dist/{cli-circuit-breaker-LC4NZUGD.js → cli-circuit-breaker-6EQKYNAA.js} +5 -5
  42. package/dist/cli.js +36 -33
  43. package/dist/cli.js.map +1 -1
  44. package/dist/{composite-router-GXQ25DO4.js → composite-router-SA4XHXA3.js} +3 -3
  45. package/dist/{consensus-vote-MTLP6E72.js → consensus-vote-QKUHNHS4.js} +13 -12
  46. package/dist/{context-retriever-GQRC2MVM.js → context-retriever-XX4TQBIB.js} +7 -6
  47. package/dist/{doctor-deep-T3UUJX2E.js → doctor-deep-NB7IDWJE.js} +4 -4
  48. package/dist/expert-bridge-4MHM77VW.js +13 -0
  49. package/dist/{factory-OKNCTJO6.js → factory-FKOPQXRS.js} +6 -5
  50. package/dist/factory-UHH4ZZ64.js +14 -0
  51. package/dist/index.d.ts +111 -6
  52. package/dist/index.js +59 -26
  53. package/dist/index.js.map +1 -1
  54. package/dist/{init-opencode-KDTBKLXS.js → init-opencode-AVYAC33Q.js} +6 -6
  55. package/dist/issue-triage-7PYND7PY.js +15 -0
  56. package/dist/{learning-persistence-NX2KHL5T.js → learning-persistence-5ALG6XRC.js} +2 -2
  57. package/dist/{registry-command-D56ROMFJ.js → registry-command-7SFNZRG5.js} +3 -3
  58. package/dist/{repo-security-plan-N3CDMW6L.js → repo-security-plan-MTVL5B73.js} +4 -4
  59. package/dist/{research-helpers-synthesize-36QBOKII.js → research-helpers-synthesize-6CJ5P4WL.js} +4 -4
  60. package/dist/{routing-memory-6IEPJ3EP.js → routing-memory-Y577PXFP.js} +3 -3
  61. package/dist/{session-memory-X6SCDFER.js → session-memory-6YFGMEMP.js} +4 -4
  62. package/dist/{setup-command-5AEO5A4Z.js → setup-command-YBTD6D53.js} +12 -11
  63. package/dist/setup-config-BQYLUJHY.js +10 -0
  64. package/dist/{setup-custom-api-RBOJT3SS.js → setup-custom-api-ZB7LOQC5.js} +5 -5
  65. package/dist/{tool-memory-EEHITQRJ.js → tool-memory-GFYQFRQI.js} +6 -5
  66. package/dist/{weather-report-6BC3JK5H.js → weather-report-CN6WPJI4.js} +3 -3
  67. package/package.json +1 -1
  68. package/dist/chunk-6UI4NKT4.js.map +0 -1
  69. package/dist/chunk-7V367KT4.js.map +0 -1
  70. package/dist/chunk-ELRNVADA.js.map +0 -1
  71. package/dist/chunk-I2HMWH4R.js.map +0 -1
  72. package/dist/chunk-IM2B3FK2.js.map +0 -1
  73. package/dist/chunk-J4ZBKE4B.js.map +0 -1
  74. package/dist/chunk-ODKIRXN7.js.map +0 -1
  75. package/dist/chunk-ZLGU7T6J.js.map +0 -1
  76. package/dist/expert-bridge-7LPGCPPR.js +0 -13
  77. package/dist/factory-3XB5CAAA.js +0 -14
  78. package/dist/issue-triage-MURMDN2G.js +0 -15
  79. package/dist/setup-config-RPSVIQJO.js +0 -10
  80. /package/dist/{child-mcp-config-3ZW2UPKZ.js.map → child-mcp-config-VSGPMVLL.js.map} +0 -0
  81. /package/dist/{chunk-JA6ON2RP.js.map → chunk-4IXQ6IXI.js.map} +0 -0
  82. /package/dist/{chunk-O3XJLOEX.js.map → chunk-5LFUZ5IC.js.map} +0 -0
  83. /package/dist/{chunk-DWOSFYI2.js.map → chunk-BX3MUA26.js.map} +0 -0
  84. /package/dist/{chunk-MATFDJRW.js.map → chunk-CJHIKBWI.js.map} +0 -0
  85. /package/dist/{chunk-XODXYOFN.js.map → chunk-D5BKSM6H.js.map} +0 -0
  86. /package/dist/{chunk-W6MLS2UL.js.map → chunk-GBGMTN7O.js.map} +0 -0
  87. /package/dist/{chunk-HGPIHDC4.js.map → chunk-I3O5WOGW.js.map} +0 -0
  88. /package/dist/{chunk-FHY7I736.js.map → chunk-KK2RZVPU.js.map} +0 -0
  89. /package/dist/{chunk-ZA6AZ7LK.js.map → chunk-KRRBRT7B.js.map} +0 -0
  90. /package/dist/{chunk-5QJPM5CB.js.map → chunk-MBD5EJBO.js.map} +0 -0
  91. /package/dist/{chunk-BUXXAN6V.js.map → chunk-OROUYVUX.js.map} +0 -0
  92. /package/dist/{chunk-TKGVRHEI.js.map → chunk-QIRZSDJK.js.map} +0 -0
  93. /package/dist/{chunk-SZZS57X7.js.map → chunk-RZVEVT3M.js.map} +0 -0
  94. /package/dist/{chunk-VXIHHHLQ.js.map → chunk-UJMIGLZI.js.map} +0 -0
  95. /package/dist/{chunk-6XRNFLPI.js.map → chunk-V35FWPHD.js.map} +0 -0
  96. /package/dist/{chunk-4XSCU4B3.js.map → chunk-VQIWH6X4.js.map} +0 -0
  97. /package/dist/{chunk-BICIQYET.js.map → chunk-VXHDZULO.js.map} +0 -0
  98. /package/dist/{chunk-UFUR6RBP.js.map → chunk-XK523BNC.js.map} +0 -0
  99. /package/dist/{chunk-A6WC5I7V.js.map → chunk-ZJGCOJC6.js.map} +0 -0
  100. /package/dist/{cli-circuit-breaker-LC4NZUGD.js.map → cli-circuit-breaker-6EQKYNAA.js.map} +0 -0
  101. /package/dist/{composite-router-GXQ25DO4.js.map → composite-router-SA4XHXA3.js.map} +0 -0
  102. /package/dist/{consensus-vote-MTLP6E72.js.map → consensus-vote-QKUHNHS4.js.map} +0 -0
  103. /package/dist/{context-retriever-GQRC2MVM.js.map → context-retriever-XX4TQBIB.js.map} +0 -0
  104. /package/dist/{doctor-deep-T3UUJX2E.js.map → doctor-deep-NB7IDWJE.js.map} +0 -0
  105. /package/dist/{expert-bridge-7LPGCPPR.js.map → expert-bridge-4MHM77VW.js.map} +0 -0
  106. /package/dist/{factory-3XB5CAAA.js.map → factory-FKOPQXRS.js.map} +0 -0
  107. /package/dist/{factory-OKNCTJO6.js.map → factory-UHH4ZZ64.js.map} +0 -0
  108. /package/dist/{init-opencode-KDTBKLXS.js.map → init-opencode-AVYAC33Q.js.map} +0 -0
  109. /package/dist/{issue-triage-MURMDN2G.js.map → issue-triage-7PYND7PY.js.map} +0 -0
  110. /package/dist/{learning-persistence-NX2KHL5T.js.map → learning-persistence-5ALG6XRC.js.map} +0 -0
  111. /package/dist/{registry-command-D56ROMFJ.js.map → registry-command-7SFNZRG5.js.map} +0 -0
  112. /package/dist/{repo-security-plan-N3CDMW6L.js.map → repo-security-plan-MTVL5B73.js.map} +0 -0
  113. /package/dist/{research-helpers-synthesize-36QBOKII.js.map → research-helpers-synthesize-6CJ5P4WL.js.map} +0 -0
  114. /package/dist/{routing-memory-6IEPJ3EP.js.map → routing-memory-Y577PXFP.js.map} +0 -0
  115. /package/dist/{session-memory-X6SCDFER.js.map → session-memory-6YFGMEMP.js.map} +0 -0
  116. /package/dist/{setup-command-5AEO5A4Z.js.map → setup-command-YBTD6D53.js.map} +0 -0
  117. /package/dist/{setup-config-RPSVIQJO.js.map → setup-config-BQYLUJHY.js.map} +0 -0
  118. /package/dist/{setup-custom-api-RBOJT3SS.js.map → setup-custom-api-ZB7LOQC5.js.map} +0 -0
  119. /package/dist/{tool-memory-EEHITQRJ.js.map → tool-memory-GFYQFRQI.js.map} +0 -0
  120. /package/dist/{weather-report-6BC3JK5H.js.map → weather-report-CN6WPJI4.js.map} +0 -0
@@ -4,8 +4,8 @@ import {
4
4
  CompositeRoutingError,
5
5
  DEFAULT_COMPOSITE_CONFIG,
6
6
  createCompositeRouter
7
- } from "./chunk-6UI4NKT4.js";
8
- import "./chunk-I2HMWH4R.js";
7
+ } from "./chunk-HLNMWGW3.js";
8
+ import "./chunk-2WCYG75B.js";
9
9
  import "./chunk-PR4QN5HX.js";
10
10
  export {
11
11
  CompositeRouter,
@@ -14,4 +14,4 @@ export {
14
14
  DEFAULT_COMPOSITE_CONFIG,
15
15
  createCompositeRouter
16
16
  };
17
- //# sourceMappingURL=composite-router-GXQ25DO4.js.map
17
+ //# sourceMappingURL=composite-router-SA4XHXA3.js.map
@@ -5,19 +5,20 @@ import {
5
5
  executeVoting,
6
6
  registerConsensusVoteTool,
7
7
  resetCorrelationTracker
8
- } from "./chunk-ODKIRXN7.js";
9
- import "./chunk-JA6ON2RP.js";
10
- import "./chunk-6XRNFLPI.js";
11
- import "./chunk-7V367KT4.js";
12
- import "./chunk-VXIHHHLQ.js";
13
- import "./chunk-DWOSFYI2.js";
8
+ } from "./chunk-V7RC2PIY.js";
9
+ import "./chunk-4IXQ6IXI.js";
10
+ import "./chunk-V35FWPHD.js";
11
+ import "./chunk-KVYQOOML.js";
12
+ import "./chunk-UJMIGLZI.js";
13
+ import "./chunk-BX3MUA26.js";
14
14
  import "./chunk-6T3EPABN.js";
15
- import "./chunk-ELRNVADA.js";
16
- import "./chunk-LM2S2QWO.js";
15
+ import "./chunk-OE7OL2BE.js";
16
+ import "./chunk-2PKAWFEU.js";
17
+ import "./chunk-YVG32OQF.js";
17
18
  import "./chunk-PQHVC4BD.js";
18
- import "./chunk-UFUR6RBP.js";
19
- import "./chunk-6UI4NKT4.js";
20
- import "./chunk-I2HMWH4R.js";
19
+ import "./chunk-XK523BNC.js";
20
+ import "./chunk-HLNMWGW3.js";
21
+ import "./chunk-2WCYG75B.js";
21
22
  import "./chunk-PR4QN5HX.js";
22
23
  export {
23
24
  CONSENSUS_VOTE_OUTPUT_SCHEMA,
@@ -27,4 +28,4 @@ export {
27
28
  registerConsensusVoteTool,
28
29
  resetCorrelationTracker
29
30
  };
30
- //# sourceMappingURL=consensus-vote-MTLP6E72.js.map
31
+ //# sourceMappingURL=consensus-vote-QKUHNHS4.js.map
@@ -2,17 +2,18 @@ import {
2
2
  getContextForTask,
3
3
  inferTaskCategory,
4
4
  summarizeContextForPrompt
5
- } from "./chunk-HGPIHDC4.js";
6
- import "./chunk-7V367KT4.js";
5
+ } from "./chunk-I3O5WOGW.js";
6
+ import "./chunk-KVYQOOML.js";
7
7
  import "./chunk-6T3EPABN.js";
8
+ import "./chunk-YVG32OQF.js";
8
9
  import "./chunk-PQHVC4BD.js";
9
- import "./chunk-UFUR6RBP.js";
10
- import "./chunk-6UI4NKT4.js";
11
- import "./chunk-I2HMWH4R.js";
10
+ import "./chunk-XK523BNC.js";
11
+ import "./chunk-HLNMWGW3.js";
12
+ import "./chunk-2WCYG75B.js";
12
13
  import "./chunk-PR4QN5HX.js";
13
14
  export {
14
15
  getContextForTask,
15
16
  inferTaskCategory,
16
17
  summarizeContextForPrompt
17
18
  };
18
- //# sourceMappingURL=context-retriever-GQRC2MVM.js.map
19
+ //# sourceMappingURL=context-retriever-XX4TQBIB.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  formatDeepDiagnostics,
3
3
  runDeepDiagnostics
4
- } from "./chunk-O3XJLOEX.js";
5
- import "./chunk-6UI4NKT4.js";
6
- import "./chunk-I2HMWH4R.js";
4
+ } from "./chunk-5LFUZ5IC.js";
5
+ import "./chunk-HLNMWGW3.js";
6
+ import "./chunk-2WCYG75B.js";
7
7
  import "./chunk-PR4QN5HX.js";
8
8
  export {
9
9
  formatDeepDiagnostics,
10
10
  runDeepDiagnostics
11
11
  };
12
- //# sourceMappingURL=doctor-deep-T3UUJX2E.js.map
12
+ //# sourceMappingURL=doctor-deep-NB7IDWJE.js.map
@@ -0,0 +1,13 @@
1
+ import {
2
+ executeExpert,
3
+ shutdownExpertBridge
4
+ } from "./chunk-RZVEVT3M.js";
5
+ import "./chunk-GBGMTN7O.js";
6
+ import "./chunk-HLNMWGW3.js";
7
+ import "./chunk-2WCYG75B.js";
8
+ import "./chunk-PR4QN5HX.js";
9
+ export {
10
+ executeExpert,
11
+ shutdownExpertBridge
12
+ };
13
+ //# sourceMappingURL=expert-bridge-4MHM77VW.js.map
@@ -3,10 +3,11 @@ import {
3
3
  createCliAdapter,
4
4
  getAvailableClis,
5
5
  isCliAvailable
6
- } from "./chunk-ELRNVADA.js";
7
- import "./chunk-LM2S2QWO.js";
8
- import "./chunk-6UI4NKT4.js";
9
- import "./chunk-I2HMWH4R.js";
6
+ } from "./chunk-OE7OL2BE.js";
7
+ import "./chunk-2PKAWFEU.js";
8
+ import "./chunk-YVG32OQF.js";
9
+ import "./chunk-HLNMWGW3.js";
10
+ import "./chunk-2WCYG75B.js";
10
11
  import "./chunk-PR4QN5HX.js";
11
12
  export {
12
13
  createAllAdapters,
@@ -14,4 +15,4 @@ export {
14
15
  getAvailableClis,
15
16
  isCliAvailable
16
17
  };
17
- //# sourceMappingURL=factory-OKNCTJO6.js.map
18
+ //# sourceMappingURL=factory-FKOPQXRS.js.map
@@ -0,0 +1,14 @@
1
+ import {
2
+ createGitHubProvider,
3
+ createScmProvider
4
+ } from "./chunk-CJHIKBWI.js";
5
+ import "./chunk-D5BKSM6H.js";
6
+ import "./chunk-REH5BB67.js";
7
+ import "./chunk-HLNMWGW3.js";
8
+ import "./chunk-2WCYG75B.js";
9
+ import "./chunk-PR4QN5HX.js";
10
+ export {
11
+ createGitHubProvider,
12
+ createScmProvider
13
+ };
14
+ //# sourceMappingURL=factory-UHH4ZZ64.js.map
package/dist/index.d.ts CHANGED
@@ -1061,6 +1061,14 @@ interface CliTask {
1061
1061
  /** Additional CLI-specific options */
1062
1062
  readonly options?: Record<string, unknown>;
1063
1063
  }
1064
+ /**
1065
+ * Internal resolved-options shape — every "default-able" field is
1066
+ * required, but `signal` stays optional because it's a per-call hook,
1067
+ * not a value with a default. Used by adapter internals (subprocess,
1068
+ * codex-mcp) and tests as the "resolved" execution options. Public
1069
+ * callers should keep using `ExecutionOptions` (everything optional).
1070
+ */
1071
+ type ResolvedExecutionOptions = Required<Omit<ExecutionOptions$1, 'signal'>> & Pick<ExecutionOptions$1, 'signal'>;
1064
1072
  /**
1065
1073
  * Execution options for CLI adapters.
1066
1074
  */
@@ -1075,6 +1083,23 @@ interface ExecutionOptions$1 {
1075
1083
  readonly trackUsage?: boolean;
1076
1084
  /** Progress callback invoked on subprocess stdout activity (Issue #1087). */
1077
1085
  readonly onProgress?: (() => void) | undefined;
1086
+ /**
1087
+ * Cancellation signal (#3026 finding 2). When the signal aborts, the
1088
+ * adapter must cancel the in-flight execution promptly — for
1089
+ * subprocess adapters that means SIGTERM (with SIGKILL escalation
1090
+ * per #3026 finding 1). Without this, callers that use
1091
+ * `Promise.race([adapter.execute(task), timeout])` for cancellation
1092
+ * leak orphan subprocesses on race-loser: the timeout promise wins
1093
+ * the race but the adapter call keeps running, posting late results
1094
+ * into OutcomeStore + LinUCB state for a task whose decision has
1095
+ * already been recorded.
1096
+ *
1097
+ * Typed as `AbortSignal | undefined` (not `AbortSignal?`) so
1098
+ * `Required<ExecutionOptions>` — used pervasively by adapter
1099
+ * internals + tests as a resolved-options shape — keeps accepting
1100
+ * `signal: undefined` under `exactOptionalPropertyTypes`.
1101
+ */
1102
+ readonly signal?: AbortSignal | undefined;
1078
1103
  }
1079
1104
  /**
1080
1105
  * CLI adapter interface.
@@ -2724,6 +2749,22 @@ interface CompletionRequest {
2724
2749
  responseFormat?: ResponseFormat;
2725
2750
  /** Stop sequences */
2726
2751
  stop?: string[];
2752
+ /**
2753
+ * Cancellation signal (#3036). When the signal aborts, the adapter
2754
+ * cancels the in-flight model call. All five concrete adapters
2755
+ * (claude, openai, ollama, gemini, openai-compat) honor this by
2756
+ * passing the signal to their respective vendor SDK.
2757
+ *
2758
+ * Used by `withWatchdog` to cancel race-loser model calls when the
2759
+ * worker-dispatch timeout wins. Without this, the SDK keeps running
2760
+ * after `Promise.race` resolves with the timeout — late results land
2761
+ * in OutcomeStore for a decision already discarded.
2762
+ *
2763
+ * Typed as `AbortSignal | undefined` (not `AbortSignal?`) so adapter
2764
+ * internals that destructure `request` keep working under
2765
+ * `exactOptionalPropertyTypes`.
2766
+ */
2767
+ signal?: AbortSignal | undefined;
2727
2768
  }
2728
2769
  /**
2729
2770
  * Token usage statistics.
@@ -3882,9 +3923,15 @@ interface IWorkflowEngine {
3882
3923
  * Execute a workflow with inputs.
3883
3924
  * @param workflow - Workflow definition
3884
3925
  * @param inputs - Input values
3926
+ * @param options - Optional execution overrides. `phaseTimeoutMs` (#3017)
3927
+ * overrides the per-phase execution timeout for this run only — wins
3928
+ * over both `workflow.timeout` (set in the template YAML) and the
3929
+ * engine's `defaultTimeoutMs`.
3885
3930
  * @returns Result with WorkflowResult or WorkflowError
3886
3931
  */
3887
- execute(workflow: WorkflowDefinition, inputs: Record<string, unknown>): Promise<Result<WorkflowResult, WorkflowError>>;
3932
+ execute(workflow: WorkflowDefinition, inputs: Record<string, unknown>, options?: {
3933
+ phaseTimeoutMs?: number;
3934
+ }): Promise<Result<WorkflowResult, WorkflowError>>;
3888
3935
  /**
3889
3936
  * Get execution status.
3890
3937
  * @param executionId - Execution ID to check
@@ -19774,6 +19821,7 @@ declare const RunWorkflowInputSchema: z.ZodObject<{
19774
19821
  template: z.ZodString;
19775
19822
  inputs: z.ZodRecord<z.ZodString, z.ZodUnknown>;
19776
19823
  dryRun: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
19824
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
19777
19825
  }, z.core.$strip>;
19778
19826
  type RunWorkflowInput = z.infer<typeof RunWorkflowInputSchema>;
19779
19827
  /**
@@ -19952,6 +20000,10 @@ declare const OrchestrateInputSchema: z.ZodObject<{
19952
20000
  context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
19953
20001
  maxIterations: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
19954
20002
  timeout: z.ZodOptional<z.ZodNumber>;
20003
+ mode: z.ZodOptional<z.ZodEnum<{
20004
+ async: "async";
20005
+ sync: "sync";
20006
+ }>>;
19955
20007
  }, z.core.$strip>;
19956
20008
  type OrchestrateInput = z.infer<typeof OrchestrateInputSchema>;
19957
20009
  declare const OrchestrateOutputSchema: z.ZodObject<{
@@ -24748,6 +24800,25 @@ declare class CapacityTracker {
24748
24800
  private readonly usageHistory;
24749
24801
  private requestCount;
24750
24802
  private windowStart;
24803
+ /**
24804
+ * Timestamps of every recorded request (#3026 finding 4).
24805
+ *
24806
+ * Pre-fix, `requestCount` was a plain counter reset only by the
24807
+ * tumbling-window branch of `pruneOldEntries`. Under continuous
24808
+ * traffic across a window boundary, that branch drops requests that
24809
+ * are still inside the *sliding* window — e.g. with windowMs=60s, a
24810
+ * request at t=59s followed by one at t=61s would tumbling-reset
24811
+ * the counter to 1 even though the t=59s request is still inside
24812
+ * the [1s, 61s] window. The downstream `remainingRequests === 0`
24813
+ * exhaustion check fired prematurely (or too late) depending on
24814
+ * burst patterns.
24815
+ *
24816
+ * Counting via a per-request timestamp array that's pruned the same
24817
+ * way as `usageHistory` keeps the two views consistent. Every
24818
+ * `recordUsage` pushes here; `requestCount` is derived from
24819
+ * `.length` after pruning.
24820
+ */
24821
+ private requestTimestamps;
24751
24822
  constructor(config: CapacityTrackerConfig);
24752
24823
  /**
24753
24824
  * Records token usage from a completed request.
@@ -24816,7 +24887,7 @@ declare abstract class BaseCliAdapter implements ICliAdapter {
24816
24887
  * Abstract method for executing a task.
24817
24888
  * Implemented by concrete adapters.
24818
24889
  */
24819
- abstract executeTask(task: CliTask, options: Required<ExecutionOptions$1>): Promise<Result<CliResponse, CliError>>;
24890
+ abstract executeTask(task: CliTask, options: ResolvedExecutionOptions): Promise<Result<CliResponse, CliError>>;
24820
24891
  /**
24821
24892
  * Abstract method for getting model info.
24822
24893
  * Implemented by concrete adapters.
@@ -24852,7 +24923,7 @@ declare abstract class BaseCliAdapter implements ICliAdapter {
24852
24923
  * the outer loop when their own transient-retry layer is active, so the
24853
24924
  * two layers do not nest into multiplied spawns (#2824).
24854
24925
  */
24855
- protected shouldOuterRetry(opts: Required<ExecutionOptions$1>): boolean;
24926
+ protected shouldOuterRetry(opts: ResolvedExecutionOptions): boolean;
24856
24927
  /**
24857
24928
  * Executes task with retry logic via shared retry loop.
24858
24929
  */
@@ -25012,31 +25083,65 @@ declare abstract class SubprocessCliAdapter extends BaseCliAdapter {
25012
25083
  * (#2824). The outer loop still runs once, so circuit-breaker failure
25013
25084
  * recording is unaffected.
25014
25085
  */
25015
- protected shouldOuterRetry(opts: Required<ExecutionOptions$1>): boolean;
25086
+ protected shouldOuterRetry(opts: ResolvedExecutionOptions): boolean;
25016
25087
  /**
25017
25088
  * Gets CLI command and arguments for execution.
25018
25089
  * If stdin is provided, it will be written to the process stdin.
25019
25090
  */
25020
25091
  protected abstract getCommand(task: CliTask): CommandConfig;
25092
+ /**
25093
+ * Invokes the optional cleanup hook supplied by getCommand(). Sync
25094
+ * throws are swallowed (warn-only) and async rejections are caught
25095
+ * so cleanup failures never bubble up and mask the real subprocess
25096
+ * result.
25097
+ */
25098
+ private runSubprocessCleanup;
25099
+ /**
25100
+ * #3026 finding 2: SIGTERM the child when the caller's AbortSignal
25101
+ * aborts mid-execution. Listener auto-detaches on `'close'` so we
25102
+ * don't leak across child lifetimes.
25103
+ */
25104
+ private attachAbortSignal;
25021
25105
  /**
25022
25106
  * Executes a task via subprocess, with optional transient-error retry.
25023
25107
  * When `transientRetry.enabled` is true, transient errors (timeout,
25024
25108
  * rate_limit, connection, parse) are retried with exponential backoff
25025
25109
  * (500ms, 1000ms). Parse errors get max 1 retry (#1533); others get 2.
25026
25110
  */
25027
- executeTask(task: CliTask, options: Required<ExecutionOptions$1>): Promise<Result<CliResponse, CliError>>;
25111
+ executeTask(task: CliTask, options: ResolvedExecutionOptions): Promise<Result<CliResponse, CliError>>;
25028
25112
  /**
25029
25113
  * Retries a transient error with bounded exponential backoff.
25030
25114
  */
25031
25115
  private retryTransient;
25032
25116
  /**
25033
25117
  * Spawns a single subprocess execution (no retry).
25118
+ *
25119
+ * `requestId` (#2963 site 3) correlates the timing-breakdown log emitted
25120
+ * on subprocess close back to the parent `executeTask` invocation —
25121
+ * essential when multiple subprocesses for the same CLI run concurrently
25122
+ * (pipelines, votes) and the JSDoc's stated goal ("group by cli + provider
25123
+ * + model and surface tail-latency outliers") requires a way to
25124
+ * disambiguate which timing row belongs to which call.
25034
25125
  */
25035
25126
  private spawnSubprocess;
25036
25127
  /**
25037
25128
  * Sets up child process event handlers for output collection and error handling.
25038
25129
  */
25039
25130
  private setupChildProcessHandlers;
25131
+ /**
25132
+ * Schedules the SIGTERM-on-timeout + SIGKILL-on-grace escalation
25133
+ * (#3026 finding 1).
25134
+ *
25135
+ * The primary timer fires SIGTERM and resolves the caller's promise
25136
+ * immediately so it doesn't wait on a hung child. The escalation
25137
+ * timer (`SIGKILL_GRACE_MS` later) checks whether the child actually
25138
+ * exited and force-reaps it with SIGKILL if not — preventing
25139
+ * zombie accumulation when a child ignores SIGTERM (Node CLIs that
25140
+ * install graceful-shutdown handlers can hang on a broken stream).
25141
+ * Both timers are cleared from the `'close'` handler so a child
25142
+ * that exits within the grace window doesn't see the second signal.
25143
+ */
25144
+ private scheduleTimeoutWithSigkillEscalation;
25040
25145
  /** Attach stdout/stderr data handlers + capture first-byte time (#2472). */
25041
25146
  private attachStdoutHandlers;
25042
25147
  /**
@@ -25310,7 +25415,7 @@ declare class CodexMcpAdapter extends BaseCliAdapter {
25310
25415
  * Executes a task via MCP client.
25311
25416
  * Called by BaseCliAdapter.execute() with retry handling.
25312
25417
  */
25313
- executeTask(_task: CliTask, options: Required<ExecutionOptions$1>): Promise<Result<CliResponse, CliError>>;
25418
+ executeTask(_task: CliTask, options: ResolvedExecutionOptions): Promise<Result<CliResponse, CliError>>;
25314
25419
  /**
25315
25420
  * Calls the codex or codex-reply tool on Codex MCP server.
25316
25421
  * @see https://developers.openai.com/codex/mcp/
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createGitHubProvider,
3
3
  createScmProvider
4
- } from "./chunk-MATFDJRW.js";
4
+ } from "./chunk-CJHIKBWI.js";
5
5
  import {
6
6
  ALLOWED_COMMANDS,
7
7
  ARTIFACT_TYPES,
@@ -519,26 +519,26 @@ import {
519
519
  validateWorkflow,
520
520
  validateWorkflowDependencies,
521
521
  withLogging
522
- } from "./chunk-J4ZBKE4B.js";
522
+ } from "./chunk-3PFESR6I.js";
523
523
  import {
524
524
  getTokenEnvVars,
525
525
  hasToken,
526
526
  resolveToken
527
- } from "./chunk-XODXYOFN.js";
527
+ } from "./chunk-D5BKSM6H.js";
528
528
  import "./chunk-X2M7OF27.js";
529
529
  import {
530
530
  OPENAI_MODELS,
531
531
  OPENAI_MODEL_ALIASES,
532
532
  OpenAIAdapter,
533
533
  createOpenAIAdapter
534
- } from "./chunk-IM2B3FK2.js";
534
+ } from "./chunk-T6B6CKU6.js";
535
535
  import {
536
536
  CliCircuitBreakerIntegration,
537
537
  createCliCircuitBreakerIntegration
538
- } from "./chunk-BICIQYET.js";
538
+ } from "./chunk-VXHDZULO.js";
539
539
  import {
540
540
  executeExpert
541
- } from "./chunk-SZZS57X7.js";
541
+ } from "./chunk-RZVEVT3M.js";
542
542
  import {
543
543
  AgentFindingSchema,
544
544
  AgentPerformanceSchema,
@@ -632,7 +632,7 @@ import {
632
632
  validateToolInput,
633
633
  withModelNotFoundFallback,
634
634
  wrapResilientWithFallback
635
- } from "./chunk-ODKIRXN7.js";
635
+ } from "./chunk-V7RC2PIY.js";
636
636
  import {
637
637
  AdapterModelError,
638
638
  BaseAdapter,
@@ -656,11 +656,11 @@ import {
656
656
  transformStream,
657
657
  validateApiKeyPresence,
658
658
  withTimeout
659
- } from "./chunk-JA6ON2RP.js";
659
+ } from "./chunk-4IXQ6IXI.js";
660
660
  import {
661
661
  PROVIDER_ENV_KEYS
662
- } from "./chunk-6XRNFLPI.js";
663
- import "./chunk-FHY7I736.js";
662
+ } from "./chunk-V35FWPHD.js";
663
+ import "./chunk-KK2RZVPU.js";
664
664
  import {
665
665
  AgentActionSchema,
666
666
  GitHubReviewer,
@@ -693,11 +693,11 @@ import {
693
693
  sanitizeInput,
694
694
  validateAgentAction,
695
695
  validateCorroboration
696
- } from "./chunk-5QJPM5CB.js";
696
+ } from "./chunk-MBD5EJBO.js";
697
697
  import {
698
698
  GitHubProvider,
699
699
  ScmError
700
- } from "./chunk-ZLGU7T6J.js";
700
+ } from "./chunk-REH5BB67.js";
701
701
  import {
702
702
  FALLBACK_SCANNER_DATA,
703
703
  buildPlanFromAnalysis,
@@ -705,7 +705,7 @@ import {
705
705
  generateSecurityPlan,
706
706
  getRegistryManifest,
707
707
  resolveScannerData
708
- } from "./chunk-TKGVRHEI.js";
708
+ } from "./chunk-QIRZSDJK.js";
709
709
  import {
710
710
  analyzeGitHubRepo,
711
711
  analyzeRepo,
@@ -715,10 +715,10 @@ import "./chunk-3ACDP4E6.js";
715
715
  import {
716
716
  PersistentStrategyDistiller,
717
717
  RulesSnapshotSchema
718
- } from "./chunk-HGPIHDC4.js";
718
+ } from "./chunk-I3O5WOGW.js";
719
719
  import {
720
720
  MemoryError
721
- } from "./chunk-7V367KT4.js";
721
+ } from "./chunk-KVYQOOML.js";
722
722
  import {
723
723
  AppConfigSchema,
724
724
  ExpertConfigSchema,
@@ -737,7 +737,7 @@ import {
737
737
  getKnownNexusVarNames,
738
738
  startStdioServer,
739
739
  validateNexusEnv
740
- } from "./chunk-4XSCU4B3.js";
740
+ } from "./chunk-VQIWH6X4.js";
741
741
  import {
742
742
  AvailabilityCache,
743
743
  filterAvailableModels,
@@ -746,15 +746,15 @@ import {
746
746
  getFallbackChain,
747
747
  resetAvailabilityCache,
748
748
  resolveFallback
749
- } from "./chunk-W6MLS2UL.js";
749
+ } from "./chunk-GBGMTN7O.js";
750
750
  import {
751
751
  AvailableModelsCache,
752
752
  getDefaultAvailableModelsCache,
753
753
  setDefaultAvailableModelsCache
754
- } from "./chunk-VXIHHHLQ.js";
754
+ } from "./chunk-UJMIGLZI.js";
755
755
  import {
756
756
  DEFAULTS
757
- } from "./chunk-DWOSFYI2.js";
757
+ } from "./chunk-BX3MUA26.js";
758
758
  import "./chunk-NUBSJGQZ.js";
759
759
  import "./chunk-6T3EPABN.js";
760
760
  import {
@@ -785,8 +785,9 @@ import {
785
785
  isCliAvailable,
786
786
  isRetryableError,
787
787
  sleep
788
- } from "./chunk-ELRNVADA.js";
789
- import "./chunk-LM2S2QWO.js";
788
+ } from "./chunk-OE7OL2BE.js";
789
+ import "./chunk-2PKAWFEU.js";
790
+ import "./chunk-YVG32OQF.js";
790
791
  import {
791
792
  BUILT_IN_EXPERTS,
792
793
  BuiltInExpertTypeSchema,
@@ -797,7 +798,7 @@ import {
797
798
  validateExpertConfig
798
799
  } from "./chunk-ZM4O442V.js";
799
800
  import "./chunk-PQHVC4BD.js";
800
- import "./chunk-UFUR6RBP.js";
801
+ import "./chunk-XK523BNC.js";
801
802
  import {
802
803
  AgentCapability,
803
804
  AgentError,
@@ -872,8 +873,8 @@ import {
872
873
  toError,
873
874
  unwrap,
874
875
  unwrapOr
875
- } from "./chunk-6UI4NKT4.js";
876
- import "./chunk-I2HMWH4R.js";
876
+ } from "./chunk-HLNMWGW3.js";
877
+ import "./chunk-2WCYG75B.js";
877
878
  import "./chunk-PR4QN5HX.js";
878
879
 
879
880
  // src/adapters/factory.ts
@@ -1484,6 +1485,36 @@ function withRetryWrapper(fn, options = {}) {
1484
1485
 
1485
1486
  // src/adapters/ollama-adapter.ts
1486
1487
  import { Ollama } from "ollama";
1488
+
1489
+ // src/adapters/abort-utils.ts
1490
+ var AbortError = class extends Error {
1491
+ name = "AbortError";
1492
+ constructor(message = "Operation aborted") {
1493
+ super(message);
1494
+ }
1495
+ };
1496
+ function raceAbort(promise, signal) {
1497
+ if (signal === void 0) return promise;
1498
+ if (signal.aborted) return Promise.reject(new AbortError());
1499
+ return new Promise((resolve2, reject) => {
1500
+ const onAbort = () => {
1501
+ reject(new AbortError());
1502
+ };
1503
+ signal.addEventListener("abort", onAbort, { once: true });
1504
+ promise.then(
1505
+ (value) => {
1506
+ signal.removeEventListener("abort", onAbort);
1507
+ resolve2(value);
1508
+ },
1509
+ (error) => {
1510
+ signal.removeEventListener("abort", onAbort);
1511
+ reject(error instanceof Error ? error : new Error(String(error)));
1512
+ }
1513
+ );
1514
+ });
1515
+ }
1516
+
1517
+ // src/adapters/ollama-adapter.ts
1487
1518
  var OLLAMA_MODELS = {
1488
1519
  LLAMA3_8B: "llama3:8b",
1489
1520
  LLAMA3_70B: "llama3:70b",
@@ -1603,7 +1634,8 @@ var OllamaAdapter = class extends BaseAdapter {
1603
1634
  this.logRequest(request);
1604
1635
  try {
1605
1636
  const params = this.buildRequestParams(request);
1606
- const response = await this.client.chat({ ...params, stream: false });
1637
+ const chatPromise = this.client.chat({ ...params, stream: false });
1638
+ const response = await raceAbort(chatPromise, request.signal);
1607
1639
  const result = this.mapResponse(response);
1608
1640
  this.logResponse(result);
1609
1641
  return ok(result);
@@ -1965,6 +1997,7 @@ var GeminiAdapter = class extends BaseAdapter {
1965
1997
  if (request.tools !== void 0 && request.tools.length > 0) {
1966
1998
  config.tools = [{ functionDeclarations: request.tools.map(mapToolToFunctionDeclaration) }];
1967
1999
  }
2000
+ if (request.signal !== void 0) config.abortSignal = request.signal;
1968
2001
  return config;
1969
2002
  }
1970
2003
  /**
@@ -5937,7 +5970,7 @@ function buildVotingInput(plan, config) {
5937
5970
  }
5938
5971
  async function executeSingleVote(plan, config, log) {
5939
5972
  try {
5940
- const { executeVoting } = await import("./consensus-vote-MTLP6E72.js");
5973
+ const { executeVoting } = await import("./consensus-vote-QKUHNHS4.js");
5941
5974
  const input = buildVotingInput(plan, config);
5942
5975
  const result = await executeVoting(input, log);
5943
5976
  return parseVotingResult(result);