nexus-agents 2.103.0 → 2.103.2

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 (113) hide show
  1. package/dist/{child-mcp-config-IPPKT47T.js → child-mcp-config-I7VKSEW2.js} +2 -2
  2. package/dist/{chunk-6XWIR6JJ.js → chunk-3GUCNISD.js} +2 -2
  3. package/dist/{chunk-TY2M7UQD.js → chunk-3I5UBNXA.js} +9 -9
  4. package/dist/{chunk-Q5DDXJWJ.js → chunk-3UOFGQ2K.js} +3 -3
  5. package/dist/{chunk-TJVGB4OE.js → chunk-3VMTQCEH.js} +2 -2
  6. package/dist/{chunk-CNQZ6BJE.js → chunk-4PWBF3NC.js} +2 -2
  7. package/dist/{chunk-H6QEJT56.js → chunk-4VTJA7FE.js} +2 -2
  8. package/dist/{chunk-4FIY62UC.js → chunk-5L5REFGE.js} +3 -3
  9. package/dist/{chunk-RJ2FCK5T.js → chunk-5ZK25ZWD.js} +4 -4
  10. package/dist/{chunk-BUZ62ZOK.js → chunk-6E6MOJYY.js} +2 -2
  11. package/dist/{chunk-YMBG7LCM.js → chunk-7P3FALEV.js} +2 -2
  12. package/dist/{chunk-K4H5LCSU.js → chunk-AGQU7XWB.js} +79 -8
  13. package/dist/chunk-AGQU7XWB.js.map +1 -0
  14. package/dist/{chunk-S5LL7Y77.js → chunk-DAOUGMA5.js} +4 -4
  15. package/dist/{chunk-FPY53SSC.js → chunk-DOINBQCP.js} +7 -7
  16. package/dist/{chunk-TNX3SEBY.js → chunk-FXPDPPYR.js} +2 -2
  17. package/dist/{chunk-Q732LOXE.js → chunk-GA2ZZERU.js} +3 -2
  18. package/dist/{chunk-VOGIG42V.js → chunk-KSMYBMM6.js} +2 -2
  19. package/dist/{chunk-FSXN5GGJ.js → chunk-L32OQDWK.js} +3 -3
  20. package/dist/{chunk-IEFH53RH.js → chunk-MHVGM6NQ.js} +2 -2
  21. package/dist/{chunk-M6QD4H7S.js → chunk-MMZ5IKQ3.js} +2 -2
  22. package/dist/{chunk-ANHBUWOI.js → chunk-N35KBA5P.js} +3 -3
  23. package/dist/{chunk-QA5IABQ4.js → chunk-NNJLOPGX.js} +5 -5
  24. package/dist/{chunk-3TOHOAB2.js → chunk-O74KAIGB.js} +35 -35
  25. package/dist/{chunk-QSTVUC2C.js → chunk-QQNM4YAL.js} +2 -2
  26. package/dist/{chunk-FESEHMBN.js → chunk-RWSRBLSA.js} +2 -2
  27. package/dist/{chunk-AO2SCUPO.js → chunk-U3GOPZIA.js} +2 -2
  28. package/dist/{chunk-STLETCQJ.js → chunk-UB5S4II3.js} +2 -2
  29. package/dist/{chunk-NO66DOR2.js → chunk-VPPZ45IZ.js} +2 -2
  30. package/dist/{chunk-VU252OUC.js → chunk-WORMJT4K.js} +3 -3
  31. package/dist/{chunk-3VSLKTD6.js → chunk-XISM6YBY.js} +4 -4
  32. package/dist/{chunk-TQLSHKPJ.js → chunk-Y5D6P5JV.js} +3 -3
  33. package/dist/{chunk-F6X6UH6D.js → chunk-Z35RTR2B.js} +7 -7
  34. package/dist/{cli-circuit-breaker-KSNJ2KWP.js → cli-circuit-breaker-M4LZW4RB.js} +4 -4
  35. package/dist/cli.js +38 -38
  36. package/dist/{composite-router-5BO2RU4R.js → composite-router-CYGVTMW6.js} +2 -2
  37. package/dist/{consensus-vote-4W2MOXL2.js → consensus-vote-WBO7Y24Y.js} +13 -12
  38. package/dist/{context-retriever-EFEWHU3Z.js → context-retriever-VZ5HKPWX.js} +6 -6
  39. package/dist/{doctor-deep-AWSHPMB3.js → doctor-deep-A3FHG7A7.js} +3 -3
  40. package/dist/{expert-bridge-P4NWKKOI.js → expert-bridge-TF6C6XPV.js} +4 -4
  41. package/dist/{factory-BSWATZK3.js → factory-3CNPIFWT.js} +6 -5
  42. package/dist/{factory-OHAMFHSF.js → factory-7ENY4JOE.js} +5 -5
  43. package/dist/{improvement-review-5ZWAZUB6.js → improvement-review-6377XBPE.js} +4 -4
  44. package/dist/index.d.ts +12 -1
  45. package/dist/index.js +35 -35
  46. package/dist/{init-opencode-7O6XN2QB.js → init-opencode-6UJPLOHE.js} +5 -5
  47. package/dist/{issue-triage-MBNGFPVS.js → issue-triage-YOFAEUGC.js} +5 -5
  48. package/dist/{pr-reviewer-helpers-L5KOZXJO.js → pr-reviewer-helpers-MK2ZFEEI.js} +4 -4
  49. package/dist/{registry-command-F565N7EI.js → registry-command-JLAE6RAW.js} +2 -2
  50. package/dist/{repo-security-plan-JRL6NQKO.js → repo-security-plan-IGX7AS5P.js} +3 -3
  51. package/dist/{research-helpers-synthesize-KJ7H75QA.js → research-helpers-synthesize-B5KL3S4T.js} +3 -3
  52. package/dist/{routing-memory-YECWDSDV.js → routing-memory-7RKYQEHM.js} +2 -2
  53. package/dist/{session-memory-AG4IM3JY.js → session-memory-S4SBPBP4.js} +3 -3
  54. package/dist/{setup-command-WAUXPMOU.js → setup-command-ZQPW7LPQ.js} +10 -10
  55. package/dist/{setup-config-2GDDU5CV.js → setup-config-2DS2V65J.js} +3 -3
  56. package/dist/{setup-custom-api-6N2BTUGY.js → setup-custom-api-JVYDKH6Y.js} +4 -4
  57. package/dist/{tool-memory-3ZWQVJX3.js → tool-memory-4LVVNSVD.js} +5 -5
  58. package/dist/{weather-report-WAOVQRGI.js → weather-report-FUVJJPE4.js} +2 -2
  59. package/package.json +1 -1
  60. package/dist/chunk-K4H5LCSU.js.map +0 -1
  61. /package/dist/{child-mcp-config-IPPKT47T.js.map → child-mcp-config-I7VKSEW2.js.map} +0 -0
  62. /package/dist/{chunk-6XWIR6JJ.js.map → chunk-3GUCNISD.js.map} +0 -0
  63. /package/dist/{chunk-TY2M7UQD.js.map → chunk-3I5UBNXA.js.map} +0 -0
  64. /package/dist/{chunk-Q5DDXJWJ.js.map → chunk-3UOFGQ2K.js.map} +0 -0
  65. /package/dist/{chunk-TJVGB4OE.js.map → chunk-3VMTQCEH.js.map} +0 -0
  66. /package/dist/{chunk-CNQZ6BJE.js.map → chunk-4PWBF3NC.js.map} +0 -0
  67. /package/dist/{chunk-H6QEJT56.js.map → chunk-4VTJA7FE.js.map} +0 -0
  68. /package/dist/{chunk-4FIY62UC.js.map → chunk-5L5REFGE.js.map} +0 -0
  69. /package/dist/{chunk-RJ2FCK5T.js.map → chunk-5ZK25ZWD.js.map} +0 -0
  70. /package/dist/{chunk-BUZ62ZOK.js.map → chunk-6E6MOJYY.js.map} +0 -0
  71. /package/dist/{chunk-YMBG7LCM.js.map → chunk-7P3FALEV.js.map} +0 -0
  72. /package/dist/{chunk-S5LL7Y77.js.map → chunk-DAOUGMA5.js.map} +0 -0
  73. /package/dist/{chunk-FPY53SSC.js.map → chunk-DOINBQCP.js.map} +0 -0
  74. /package/dist/{chunk-TNX3SEBY.js.map → chunk-FXPDPPYR.js.map} +0 -0
  75. /package/dist/{chunk-Q732LOXE.js.map → chunk-GA2ZZERU.js.map} +0 -0
  76. /package/dist/{chunk-VOGIG42V.js.map → chunk-KSMYBMM6.js.map} +0 -0
  77. /package/dist/{chunk-FSXN5GGJ.js.map → chunk-L32OQDWK.js.map} +0 -0
  78. /package/dist/{chunk-IEFH53RH.js.map → chunk-MHVGM6NQ.js.map} +0 -0
  79. /package/dist/{chunk-M6QD4H7S.js.map → chunk-MMZ5IKQ3.js.map} +0 -0
  80. /package/dist/{chunk-ANHBUWOI.js.map → chunk-N35KBA5P.js.map} +0 -0
  81. /package/dist/{chunk-QA5IABQ4.js.map → chunk-NNJLOPGX.js.map} +0 -0
  82. /package/dist/{chunk-3TOHOAB2.js.map → chunk-O74KAIGB.js.map} +0 -0
  83. /package/dist/{chunk-QSTVUC2C.js.map → chunk-QQNM4YAL.js.map} +0 -0
  84. /package/dist/{chunk-FESEHMBN.js.map → chunk-RWSRBLSA.js.map} +0 -0
  85. /package/dist/{chunk-AO2SCUPO.js.map → chunk-U3GOPZIA.js.map} +0 -0
  86. /package/dist/{chunk-STLETCQJ.js.map → chunk-UB5S4II3.js.map} +0 -0
  87. /package/dist/{chunk-NO66DOR2.js.map → chunk-VPPZ45IZ.js.map} +0 -0
  88. /package/dist/{chunk-VU252OUC.js.map → chunk-WORMJT4K.js.map} +0 -0
  89. /package/dist/{chunk-3VSLKTD6.js.map → chunk-XISM6YBY.js.map} +0 -0
  90. /package/dist/{chunk-TQLSHKPJ.js.map → chunk-Y5D6P5JV.js.map} +0 -0
  91. /package/dist/{chunk-F6X6UH6D.js.map → chunk-Z35RTR2B.js.map} +0 -0
  92. /package/dist/{cli-circuit-breaker-KSNJ2KWP.js.map → cli-circuit-breaker-M4LZW4RB.js.map} +0 -0
  93. /package/dist/{composite-router-5BO2RU4R.js.map → composite-router-CYGVTMW6.js.map} +0 -0
  94. /package/dist/{consensus-vote-4W2MOXL2.js.map → consensus-vote-WBO7Y24Y.js.map} +0 -0
  95. /package/dist/{context-retriever-EFEWHU3Z.js.map → context-retriever-VZ5HKPWX.js.map} +0 -0
  96. /package/dist/{doctor-deep-AWSHPMB3.js.map → doctor-deep-A3FHG7A7.js.map} +0 -0
  97. /package/dist/{expert-bridge-P4NWKKOI.js.map → expert-bridge-TF6C6XPV.js.map} +0 -0
  98. /package/dist/{factory-BSWATZK3.js.map → factory-3CNPIFWT.js.map} +0 -0
  99. /package/dist/{factory-OHAMFHSF.js.map → factory-7ENY4JOE.js.map} +0 -0
  100. /package/dist/{improvement-review-5ZWAZUB6.js.map → improvement-review-6377XBPE.js.map} +0 -0
  101. /package/dist/{init-opencode-7O6XN2QB.js.map → init-opencode-6UJPLOHE.js.map} +0 -0
  102. /package/dist/{issue-triage-MBNGFPVS.js.map → issue-triage-YOFAEUGC.js.map} +0 -0
  103. /package/dist/{pr-reviewer-helpers-L5KOZXJO.js.map → pr-reviewer-helpers-MK2ZFEEI.js.map} +0 -0
  104. /package/dist/{registry-command-F565N7EI.js.map → registry-command-JLAE6RAW.js.map} +0 -0
  105. /package/dist/{repo-security-plan-JRL6NQKO.js.map → repo-security-plan-IGX7AS5P.js.map} +0 -0
  106. /package/dist/{research-helpers-synthesize-KJ7H75QA.js.map → research-helpers-synthesize-B5KL3S4T.js.map} +0 -0
  107. /package/dist/{routing-memory-YECWDSDV.js.map → routing-memory-7RKYQEHM.js.map} +0 -0
  108. /package/dist/{session-memory-AG4IM3JY.js.map → session-memory-S4SBPBP4.js.map} +0 -0
  109. /package/dist/{setup-command-WAUXPMOU.js.map → setup-command-ZQPW7LPQ.js.map} +0 -0
  110. /package/dist/{setup-config-2GDDU5CV.js.map → setup-config-2DS2V65J.js.map} +0 -0
  111. /package/dist/{setup-custom-api-6N2BTUGY.js.map → setup-custom-api-JVYDKH6Y.js.map} +0 -0
  112. /package/dist/{tool-memory-3ZWQVJX3.js.map → tool-memory-4LVVNSVD.js.map} +0 -0
  113. /package/dist/{weather-report-WAOVQRGI.js.map → weather-report-FUVJJPE4.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createLogger
3
- } from "./chunk-Q732LOXE.js";
3
+ } from "./chunk-GA2ZZERU.js";
4
4
  import "./chunk-CH7QIDHQ.js";
5
5
  import "./chunk-PR4QN5HX.js";
6
6
 
@@ -59,4 +59,4 @@ export {
59
59
  generateMcpConfig,
60
60
  getDefaultAllowedTools
61
61
  };
62
- //# sourceMappingURL=child-mcp-config-IPPKT47T.js.map
62
+ //# sourceMappingURL=child-mcp-config-I7VKSEW2.js.map
@@ -3,7 +3,7 @@ import {
3
3
  MODEL_IDS,
4
4
  getTimeProvider,
5
5
  resolveModelIdentitySync
6
- } from "./chunk-Q732LOXE.js";
6
+ } from "./chunk-GA2ZZERU.js";
7
7
 
8
8
  // src/config/model-availability.ts
9
9
  var DEFAULT_TTL_MS = 6e4;
@@ -150,4 +150,4 @@ export {
150
150
  resetAvailabilityCache,
151
151
  filterAvailableModels
152
152
  };
153
- //# sourceMappingURL=chunk-6XWIR6JJ.js.map
153
+ //# sourceMappingURL=chunk-3GUCNISD.js.map
@@ -4,12 +4,12 @@ import {
4
4
  createStream,
5
5
  requireApiKey,
6
6
  validateApiKeyPresence
7
- } from "./chunk-AO2SCUPO.js";
7
+ } from "./chunk-U3GOPZIA.js";
8
8
  import {
9
9
  CUSTOM_API_BASE_URL_ENV,
10
10
  PROVIDER_ENV_KEYS,
11
11
  validateCustomApiBaseUrl
12
- } from "./chunk-TNX3SEBY.js";
12
+ } from "./chunk-FXPDPPYR.js";
13
13
  import {
14
14
  NOOP_NOTIFIER,
15
15
  createMcpNotifier,
@@ -21,13 +21,13 @@ import {
21
21
  toolSuccess,
22
22
  withProgressHeartbeat,
23
23
  wrapToolWithTimeout
24
- } from "./chunk-FESEHMBN.js";
24
+ } from "./chunk-RWSRBLSA.js";
25
25
  import {
26
26
  getToolMemory
27
- } from "./chunk-S5LL7Y77.js";
27
+ } from "./chunk-DAOUGMA5.js";
28
28
  import {
29
29
  CUSTOM_API_DEFAULT_MODEL
30
- } from "./chunk-M6QD4H7S.js";
30
+ } from "./chunk-MMZ5IKQ3.js";
31
31
  import {
32
32
  authRemediation,
33
33
  createCliAdapter,
@@ -37,7 +37,7 @@ import {
37
37
  isCliAvailable,
38
38
  sanitizeOutput,
39
39
  withTimeout
40
- } from "./chunk-K4H5LCSU.js";
40
+ } from "./chunk-AGQU7XWB.js";
41
41
  import {
42
42
  AgentError,
43
43
  CLI_NAMES,
@@ -77,7 +77,7 @@ import {
77
77
  resolveCliAlias,
78
78
  resolveVoteTimeout,
79
79
  toRateLimitError
80
- } from "./chunk-Q732LOXE.js";
80
+ } from "./chunk-GA2ZZERU.js";
81
81
  import {
82
82
  ensureLearningDir,
83
83
  getOutcomesFile,
@@ -7003,7 +7003,7 @@ async function processVotesWithCascade(engineVotes, opts) {
7003
7003
  var CONTRARIAN_ESCALATION_THRESHOLD = 0.8;
7004
7004
  async function runContrarianCheck(proposal, log) {
7005
7005
  try {
7006
- const { executeExpert } = await import("./expert-bridge-P4NWKKOI.js");
7006
+ const { executeExpert } = await import("./expert-bridge-TF6C6XPV.js");
7007
7007
  const prompt = [
7008
7008
  "You are a contrarian analyst. Your job is to find reasons this proposal should be REJECTED.",
7009
7009
  "Look for: YAGNI (not needed), MISALIGNED (wrong tech/architecture), SECURITY_RISK, SCOPE_CREEP.",
@@ -7496,4 +7496,4 @@ export {
7496
7496
  CONSENSUS_VOTE_OUTPUT_SCHEMA,
7497
7497
  registerConsensusVoteTool
7498
7498
  };
7499
- //# sourceMappingURL=chunk-TY2M7UQD.js.map
7499
+ //# sourceMappingURL=chunk-3I5UBNXA.js.map
@@ -2,14 +2,14 @@ import {
2
2
  CircuitBreakerRegistry,
3
3
  CircuitError,
4
4
  mapCliErrorToCategory
5
- } from "./chunk-CNQZ6BJE.js";
5
+ } from "./chunk-4PWBF3NC.js";
6
6
  import {
7
7
  createLogger,
8
8
  err,
9
9
  getFallbackChainForCategory,
10
10
  getTimeProvider,
11
11
  ok
12
- } from "./chunk-Q732LOXE.js";
12
+ } from "./chunk-GA2ZZERU.js";
13
13
 
14
14
  // src/cli-adapters/cli-circuit-breaker.ts
15
15
  var CATEGORY_TO_FALLBACK = {
@@ -152,4 +152,4 @@ export {
152
152
  CliCircuitBreakerIntegration,
153
153
  createCliCircuitBreakerIntegration
154
154
  };
155
- //# sourceMappingURL=chunk-Q5DDXJWJ.js.map
155
+ //# sourceMappingURL=chunk-3UOFGQ2K.js.map
@@ -3,7 +3,7 @@ import {
3
3
  err,
4
4
  getErrorMessage,
5
5
  ok
6
- } from "./chunk-Q732LOXE.js";
6
+ } from "./chunk-GA2ZZERU.js";
7
7
 
8
8
  // src/scm/types.ts
9
9
  var ScmError = class extends Error {
@@ -258,4 +258,4 @@ export {
258
258
  ScmError,
259
259
  GitHubProvider
260
260
  };
261
- //# sourceMappingURL=chunk-TJVGB4OE.js.map
261
+ //# sourceMappingURL=chunk-3VMTQCEH.js.map
@@ -5,7 +5,7 @@ import {
5
5
  getErrorMessage,
6
6
  getTimeProvider,
7
7
  ok
8
- } from "./chunk-Q732LOXE.js";
8
+ } from "./chunk-GA2ZZERU.js";
9
9
 
10
10
  // src/cli-adapters/circuit-breaker-types.ts
11
11
  var CircuitErrorCode = {
@@ -354,4 +354,4 @@ export {
354
354
  CircuitBreakerRegistry,
355
355
  mapCliErrorToCategory
356
356
  };
357
- //# sourceMappingURL=chunk-CNQZ6BJE.js.map
357
+ //# sourceMappingURL=chunk-4PWBF3NC.js.map
@@ -2,7 +2,7 @@ import {
2
2
  TASK_CATEGORIES,
3
3
  getAdaptiveBonus,
4
4
  getOutcomeStore
5
- } from "./chunk-Q732LOXE.js";
5
+ } from "./chunk-GA2ZZERU.js";
6
6
 
7
7
  // src/cli/doctor-deep.ts
8
8
  var CLI_NAMES = ["claude", "gemini", "codex", "opencode"];
@@ -106,4 +106,4 @@ export {
106
106
  runDeepDiagnostics,
107
107
  formatDeepDiagnostics
108
108
  };
109
- //# sourceMappingURL=chunk-H6QEJT56.js.map
109
+ //# sourceMappingURL=chunk-4VTJA7FE.js.map
@@ -6,7 +6,7 @@ import {
6
6
  toolStructuredError,
7
7
  toolSuccessStructured,
8
8
  wrapToolWithTimeout
9
- } from "./chunk-FESEHMBN.js";
9
+ } from "./chunk-RWSRBLSA.js";
10
10
  import {
11
11
  createLogger,
12
12
  formatZodError,
@@ -14,7 +14,7 @@ import {
14
14
  getOutcomeStore,
15
15
  getPipelineEventBus,
16
16
  getTimeProvider
17
- } from "./chunk-Q732LOXE.js";
17
+ } from "./chunk-GA2ZZERU.js";
18
18
  import {
19
19
  getNexusDataDir
20
20
  } from "./chunk-CH7QIDHQ.js";
@@ -1092,4 +1092,4 @@ export {
1092
1092
  runImprovementReview,
1093
1093
  registerImprovementReviewTool
1094
1094
  };
1095
- //# sourceMappingURL=chunk-4FIY62UC.js.map
1095
+ //# sourceMappingURL=chunk-5L5REFGE.js.map
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  resolveToken
3
- } from "./chunk-YMBG7LCM.js";
3
+ } from "./chunk-7P3FALEV.js";
4
4
  import {
5
5
  GitHubProvider,
6
6
  ScmError
7
- } from "./chunk-TJVGB4OE.js";
7
+ } from "./chunk-3VMTQCEH.js";
8
8
  import {
9
9
  err,
10
10
  ok
11
- } from "./chunk-Q732LOXE.js";
11
+ } from "./chunk-GA2ZZERU.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-RJ2FCK5T.js.map
44
+ //# sourceMappingURL=chunk-5ZK25ZWD.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  createLogger,
6
6
  getTimeProvider
7
- } from "./chunk-Q732LOXE.js";
7
+ } from "./chunk-GA2ZZERU.js";
8
8
 
9
9
  // src/mcp/tools/scanner-registry-fetcher.ts
10
10
  import { z } from "zod";
@@ -721,4 +721,4 @@ export {
721
721
  generateSecurityPlan,
722
722
  buildPlanFromAnalysis
723
723
  };
724
- //# sourceMappingURL=chunk-BUZ62ZOK.js.map
724
+ //# sourceMappingURL=chunk-6E6MOJYY.js.map
@@ -2,7 +2,7 @@ import {
2
2
  createLogger,
3
3
  err,
4
4
  ok
5
- } from "./chunk-Q732LOXE.js";
5
+ } from "./chunk-GA2ZZERU.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-YMBG7LCM.js.map
90
+ //# sourceMappingURL=chunk-7P3FALEV.js.map
@@ -1,10 +1,13 @@
1
1
  import {
2
2
  CliCircuitBreaker,
3
3
  DEFAULT_CIRCUIT_BREAKER_CONFIG
4
- } from "./chunk-CNQZ6BJE.js";
4
+ } from "./chunk-4PWBF3NC.js";
5
+ import {
6
+ getAvailabilityCache
7
+ } from "./chunk-3GUCNISD.js";
5
8
  import {
6
9
  generateHyphenId
7
- } from "./chunk-VOGIG42V.js";
10
+ } from "./chunk-KSMYBMM6.js";
8
11
  import {
9
12
  CLI_SUBPROCESS_TIMEOUTS,
10
13
  CLI_TIMEOUTS,
@@ -25,10 +28,11 @@ import {
25
28
  getOutcomeStore,
26
29
  getRandomProvider,
27
30
  getTimeProvider,
31
+ isDynamicModelsEnabled,
28
32
  isRateLimitText,
29
33
  loadModelsDevSnapshot,
30
34
  ok
31
- } from "./chunk-Q732LOXE.js";
35
+ } from "./chunk-GA2ZZERU.js";
32
36
 
33
37
  // src/cli-adapters/subprocess-adapter.ts
34
38
  import { spawn } from "child_process";
@@ -2765,6 +2769,39 @@ var OpenCodeResponseParser = class {
2765
2769
  }
2766
2770
  };
2767
2771
 
2772
+ // src/config/resolve-live-model.ts
2773
+ function splitTier(id) {
2774
+ const colon = id.indexOf(":");
2775
+ return colon >= 0 ? { base: id.slice(0, colon), tier: id.slice(colon) } : { base: id, tier: "" };
2776
+ }
2777
+ function isTokenBoundaryPrefix(prefix, full) {
2778
+ if (prefix.length > full.length || !full.startsWith(prefix)) return false;
2779
+ if (full.length === prefix.length) return true;
2780
+ const next = full[prefix.length];
2781
+ return next === "-" || next === "/";
2782
+ }
2783
+ function resolveLiveModelId(configured, available) {
2784
+ const set = available instanceof Set ? available : new Set(available);
2785
+ if (set.size === 0 || set.has(configured)) return configured;
2786
+ const slash = configured.indexOf("/");
2787
+ const providerPrefix = slash > 0 ? configured.slice(0, slash + 1) : "";
2788
+ const cfg = splitTier(configured);
2789
+ const candidates = [...set].filter((c) => providerPrefix === "" || c.startsWith(providerPrefix)).map((c) => splitTier(c)).filter((cand) => isTokenBoundaryPrefix(cand.base, cfg.base)).map((cand) => ({
2790
+ id: cand.base + cand.tier,
2791
+ baseLen: cand.base.length,
2792
+ tierMatch: cand.tier === cfg.tier
2793
+ }));
2794
+ if (candidates.length === 0) return configured;
2795
+ candidates.sort(
2796
+ (a, b) => b.baseLen - a.baseLen || // most-specific simplification (closest to configured)
2797
+ Number(b.tierMatch) - Number(a.tierMatch) || // matching :free / paid tier
2798
+ a.id.length - b.id.length || // shorter overall
2799
+ (a.id < b.id ? -1 : a.id > b.id ? 1 : 0)
2800
+ // lexicographic — fully deterministic
2801
+ );
2802
+ return candidates[0]?.id ?? configured;
2803
+ }
2804
+
2768
2805
  // src/cli-adapters/adapters/opencode-adapter.ts
2769
2806
  var logger5 = createLogger({ component: "opencode-adapter" });
2770
2807
  var ALLOWED_VARIANTS = ["high", "max", "minimal"];
@@ -2864,19 +2901,53 @@ var OpenCodeCliAdapter = class extends SubprocessCliAdapter {
2864
2901
  if (this.availableModels === void 0 || this.availableModels.size === 0) return false;
2865
2902
  return this.availableModels.has(cliModel);
2866
2903
  }
2867
- /** Appends --model if the resolved model is available (#1402). */
2904
+ /** #3408: true if the model is in rate-limit cooldown (recent 429). Opt-in. */
2905
+ isCooled(cliModel) {
2906
+ return isDynamicModelsEnabled() && getAvailabilityCache().isKnownUnavailable(cliModel);
2907
+ }
2908
+ /** Usable = offered by the OpenCode install AND not in rate-limit cooldown. */
2909
+ isModelUsable(cliModel) {
2910
+ return this.isModelAvailable(cliModel) && !this.isCooled(cliModel);
2911
+ }
2912
+ /** Appends --model if the resolved model is usable (#1402, #3407, #3408). */
2868
2913
  appendModelArg(args, task) {
2869
2914
  const internalModel = task.model ?? this.model;
2870
- const cliModel = resolveOpenCodeModel(internalModel);
2871
- if (this.isModelAvailable(cliModel)) {
2915
+ let cliModel = resolveOpenCodeModel(internalModel);
2916
+ if (!this.isModelUsable(cliModel) && isDynamicModelsEnabled() && this.availableModels !== void 0) {
2917
+ const usable = new Set([...this.availableModels].filter((m) => !this.isCooled(m)));
2918
+ const resolved = resolveLiveModelId(cliModel, usable);
2919
+ if (resolved !== cliModel) {
2920
+ logger5.debug("Resolved to live/non-cooled model (#3407/#3408)", {
2921
+ from: cliModel,
2922
+ to: resolved
2923
+ });
2924
+ cliModel = resolved;
2925
+ }
2926
+ }
2927
+ if (this.isModelUsable(cliModel)) {
2872
2928
  args.push("--model", cliModel);
2873
2929
  } else {
2874
- logger5.debug("Model not available, using OpenCode default", {
2930
+ logger5.debug("Model not usable (unavailable or cooled), using OpenCode default", {
2875
2931
  requested: cliModel,
2876
2932
  available: this.availableModels?.size ?? 0
2877
2933
  });
2878
2934
  }
2879
2935
  }
2936
+ /**
2937
+ * #3408: mark a model in rate-limit cooldown when a call returns RATE_LIMITED,
2938
+ * so subsequent selections skip it until the AvailabilityCache TTL recovers.
2939
+ * Wraps the base executeTask; opt-in + fail-open (no-op when discovery is off).
2940
+ * Advisory: a cooled model is still usable via an explicit, available --model.
2941
+ */
2942
+ async executeTask(task, options) {
2943
+ const result = await super.executeTask(task, options);
2944
+ if (isDynamicModelsEnabled() && !result.ok && result.error.code === "RATE_LIMITED") {
2945
+ const cliModel = resolveOpenCodeModel(task.model ?? this.model);
2946
+ getAvailabilityCache().markUnavailable(cliModel, "rate-limited (429)");
2947
+ logger5.debug("Cooldown: marked model rate-limited (#3408)", { model: cliModel });
2948
+ }
2949
+ return result;
2950
+ }
2880
2951
  /** Appends optional task flags (workDir, variant, thinking). */
2881
2952
  appendTaskFlags(args, task) {
2882
2953
  const workDir = task.options?.["workDir"];
@@ -3374,4 +3445,4 @@ export {
3374
3445
  isCliAvailable,
3375
3446
  getAvailableClis
3376
3447
  };
3377
- //# sourceMappingURL=chunk-K4H5LCSU.js.map
3448
+ //# sourceMappingURL=chunk-AGQU7XWB.js.map