nexus-agents 2.166.3 → 2.167.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 (128) hide show
  1. package/dist/{child-mcp-config-AUA4TFBG.js → child-mcp-config-X4YLQKGK.js} +2 -2
  2. package/dist/{chunk-P54BDACX.js → chunk-2NU774CB.js} +2 -2
  3. package/dist/{chunk-JBH4CU46.js → chunk-2S7T66IQ.js} +34 -34
  4. package/dist/{chunk-UO6C5J5D.js → chunk-3T6KLPGT.js} +5 -5
  5. package/dist/{chunk-FZV4YAYT.js → chunk-6KCZA3IO.js} +190 -4
  6. package/dist/chunk-6KCZA3IO.js.map +1 -0
  7. package/dist/{chunk-ORRKK563.js → chunk-7K5LSUEU.js} +3 -3
  8. package/dist/{chunk-GS3UPAUE.js → chunk-7USEQLMS.js} +2 -2
  9. package/dist/{chunk-K2IX6BEK.js → chunk-7YD3TRDX.js} +4 -4
  10. package/dist/{chunk-IF46G2LM.js → chunk-BB7KSLNA.js} +2 -2
  11. package/dist/{chunk-NEQJSYJH.js → chunk-COIZLMGV.js} +3 -3
  12. package/dist/{chunk-Z66EEQ4A.js → chunk-CURHM4TH.js} +3 -3
  13. package/dist/{chunk-PXTZ6RPP.js → chunk-EUQNHT7O.js} +26 -7
  14. package/dist/chunk-EUQNHT7O.js.map +1 -0
  15. package/dist/{chunk-BZFF3YWU.js → chunk-GGYQTV2Y.js} +4 -4
  16. package/dist/{chunk-HNAFWKJG.js → chunk-GRWHPG72.js} +7 -7
  17. package/dist/{chunk-AWPSFL5C.js → chunk-GVNY4ZB6.js} +2 -2
  18. package/dist/{chunk-YKTVN2TF.js → chunk-IFSIKGHI.js} +2 -2
  19. package/dist/{chunk-LRBEUBZ3.js → chunk-JKUX73VD.js} +3 -3
  20. package/dist/{chunk-I7OZP6FS.js → chunk-KM3YEIEN.js} +4 -4
  21. package/dist/{chunk-THI3VWHO.js → chunk-O6VL6LA4.js} +2 -2
  22. package/dist/{chunk-6LXTT6AK.js → chunk-PC4Y4VPX.js} +2 -2
  23. package/dist/{chunk-DMFMJFRY.js → chunk-QPSYBHK6.js} +2 -2
  24. package/dist/{chunk-BFDVV3Q3.js → chunk-QV52AXTF.js} +2 -2
  25. package/dist/chunk-QZUG667L.js +56 -0
  26. package/dist/chunk-QZUG667L.js.map +1 -0
  27. package/dist/{chunk-JYVPM37A.js → chunk-RKIPSMCN.js} +5 -5
  28. package/dist/{chunk-ZI4PO2A3.js → chunk-S6HCREYY.js} +12 -62
  29. package/dist/chunk-S6HCREYY.js.map +1 -0
  30. package/dist/{chunk-F2YZ3U6O.js → chunk-SRNAXDOT.js} +2 -2
  31. package/dist/{chunk-V5RPW2ZX.js → chunk-STMW5BSR.js} +3 -3
  32. package/dist/{chunk-FQNG6ZIW.js → chunk-TGAVZ2ZL.js} +8 -8
  33. package/dist/{chunk-UWRDWX6L.js → chunk-UNIDAVVR.js} +2 -2
  34. package/dist/{chunk-76Q6GTPU.js → chunk-VNVGGM73.js} +2 -2
  35. package/dist/{chunk-FKHQWC2L.js → chunk-XUMLVCFL.js} +2 -2
  36. package/dist/{chunk-WL4SGKAW.js → chunk-ZAPCPHGZ.js} +2 -2
  37. package/dist/{chunk-PRSGZQNB.js → chunk-ZIC6ZZFU.js} +3 -3
  38. package/dist/{chunk-WOY6TQCH.js → chunk-ZSUN7BHE.js} +439 -12
  39. package/dist/chunk-ZSUN7BHE.js.map +1 -0
  40. package/dist/{chunk-3LVB5OE2.js → chunk-ZTTUXPBQ.js} +2 -2
  41. package/dist/{cli-circuit-breaker-FSUDU7BV.js → cli-circuit-breaker-2AAHSCHR.js} +4 -4
  42. package/dist/cli.js +59 -45
  43. package/dist/cli.js.map +1 -1
  44. package/dist/{composite-router-HC4YLG5W.js → composite-router-WOVGICBS.js} +2 -2
  45. package/dist/{consensus-vote-KWPS6WNH.js → consensus-vote-322S65GQ.js} +16 -15
  46. package/dist/{context-retriever-YCKTCDGM.js → context-retriever-YMJY6YBJ.js} +9 -8
  47. package/dist/{doctor-deep-4UARVVSD.js → doctor-deep-DALT3OXC.js} +3 -3
  48. package/dist/{expert-bridge-EAR6XZJA.js → expert-bridge-WNV3ST2T.js} +4 -4
  49. package/dist/factory-33HQYVCK.js +23 -0
  50. package/dist/{factory-7SVW7XMV.js → factory-TLSTFONW.js} +5 -5
  51. package/dist/{improvement-review-AHSY5ZXD.js → improvement-review-2W6LKP74.js} +5 -5
  52. package/dist/index.js +43 -317
  53. package/dist/index.js.map +1 -1
  54. package/dist/{init-opencode-5BKE7UEB.js → init-opencode-XVTVJ6FN.js} +5 -6
  55. package/dist/{init-opencode-5BKE7UEB.js.map → init-opencode-XVTVJ6FN.js.map} +1 -1
  56. package/dist/{issue-triage-TNV4R33I.js → issue-triage-CVMVZ3IV.js} +6 -6
  57. package/dist/{pr-reviewer-helpers-ZC2I5ZYD.js → pr-reviewer-helpers-SAMOVLNJ.js} +4 -4
  58. package/dist/{registry-command-O2GLHG3G.js → registry-command-5D2DJT53.js} +2 -2
  59. package/dist/{repo-security-plan-CFRLHIMY.js → repo-security-plan-F7V5SHAQ.js} +3 -3
  60. package/dist/{research-helpers-synthesize-ONWBGXHO.js → research-helpers-synthesize-F4PV4B4B.js} +4 -4
  61. package/dist/{routing-memory-XHZKEPUH.js → routing-memory-G6YBK4WI.js} +2 -2
  62. package/dist/{session-memory-5QVKDE4U.js → session-memory-DAJHLPOY.js} +3 -3
  63. package/dist/{setup-command-G7OB4QQG.js → setup-command-NUNIRAFN.js} +14 -11
  64. package/dist/{setup-config-MMBOL5CW.js → setup-config-HKUWFV5N.js} +3 -3
  65. package/dist/{setup-custom-api-RQ3BUMJC.js → setup-custom-api-XRUPWEPF.js} +3 -3
  66. package/dist/{tool-memory-VK4IZLPN.js → tool-memory-XJ5VRMNQ.js} +5 -5
  67. package/dist/{unified-registry-ZOTGM4EY.js → unified-registry-ETKPTZBU.js} +10 -9
  68. package/dist/{weather-report-MPD66LKP.js → weather-report-TWBLIHPZ.js} +2 -2
  69. package/package.json +1 -1
  70. package/dist/chunk-FZV4YAYT.js.map +0 -1
  71. package/dist/chunk-OI6H3DL6.js +0 -197
  72. package/dist/chunk-OI6H3DL6.js.map +0 -1
  73. package/dist/chunk-PXTZ6RPP.js.map +0 -1
  74. package/dist/chunk-WOY6TQCH.js.map +0 -1
  75. package/dist/chunk-ZI4PO2A3.js.map +0 -1
  76. package/dist/factory-JYAUOFEN.js +0 -22
  77. /package/dist/{child-mcp-config-AUA4TFBG.js.map → child-mcp-config-X4YLQKGK.js.map} +0 -0
  78. /package/dist/{chunk-P54BDACX.js.map → chunk-2NU774CB.js.map} +0 -0
  79. /package/dist/{chunk-JBH4CU46.js.map → chunk-2S7T66IQ.js.map} +0 -0
  80. /package/dist/{chunk-UO6C5J5D.js.map → chunk-3T6KLPGT.js.map} +0 -0
  81. /package/dist/{chunk-ORRKK563.js.map → chunk-7K5LSUEU.js.map} +0 -0
  82. /package/dist/{chunk-GS3UPAUE.js.map → chunk-7USEQLMS.js.map} +0 -0
  83. /package/dist/{chunk-K2IX6BEK.js.map → chunk-7YD3TRDX.js.map} +0 -0
  84. /package/dist/{chunk-IF46G2LM.js.map → chunk-BB7KSLNA.js.map} +0 -0
  85. /package/dist/{chunk-NEQJSYJH.js.map → chunk-COIZLMGV.js.map} +0 -0
  86. /package/dist/{chunk-Z66EEQ4A.js.map → chunk-CURHM4TH.js.map} +0 -0
  87. /package/dist/{chunk-BZFF3YWU.js.map → chunk-GGYQTV2Y.js.map} +0 -0
  88. /package/dist/{chunk-HNAFWKJG.js.map → chunk-GRWHPG72.js.map} +0 -0
  89. /package/dist/{chunk-AWPSFL5C.js.map → chunk-GVNY4ZB6.js.map} +0 -0
  90. /package/dist/{chunk-YKTVN2TF.js.map → chunk-IFSIKGHI.js.map} +0 -0
  91. /package/dist/{chunk-LRBEUBZ3.js.map → chunk-JKUX73VD.js.map} +0 -0
  92. /package/dist/{chunk-I7OZP6FS.js.map → chunk-KM3YEIEN.js.map} +0 -0
  93. /package/dist/{chunk-THI3VWHO.js.map → chunk-O6VL6LA4.js.map} +0 -0
  94. /package/dist/{chunk-6LXTT6AK.js.map → chunk-PC4Y4VPX.js.map} +0 -0
  95. /package/dist/{chunk-DMFMJFRY.js.map → chunk-QPSYBHK6.js.map} +0 -0
  96. /package/dist/{chunk-BFDVV3Q3.js.map → chunk-QV52AXTF.js.map} +0 -0
  97. /package/dist/{chunk-JYVPM37A.js.map → chunk-RKIPSMCN.js.map} +0 -0
  98. /package/dist/{chunk-F2YZ3U6O.js.map → chunk-SRNAXDOT.js.map} +0 -0
  99. /package/dist/{chunk-V5RPW2ZX.js.map → chunk-STMW5BSR.js.map} +0 -0
  100. /package/dist/{chunk-FQNG6ZIW.js.map → chunk-TGAVZ2ZL.js.map} +0 -0
  101. /package/dist/{chunk-UWRDWX6L.js.map → chunk-UNIDAVVR.js.map} +0 -0
  102. /package/dist/{chunk-76Q6GTPU.js.map → chunk-VNVGGM73.js.map} +0 -0
  103. /package/dist/{chunk-FKHQWC2L.js.map → chunk-XUMLVCFL.js.map} +0 -0
  104. /package/dist/{chunk-WL4SGKAW.js.map → chunk-ZAPCPHGZ.js.map} +0 -0
  105. /package/dist/{chunk-PRSGZQNB.js.map → chunk-ZIC6ZZFU.js.map} +0 -0
  106. /package/dist/{chunk-3LVB5OE2.js.map → chunk-ZTTUXPBQ.js.map} +0 -0
  107. /package/dist/{cli-circuit-breaker-FSUDU7BV.js.map → cli-circuit-breaker-2AAHSCHR.js.map} +0 -0
  108. /package/dist/{composite-router-HC4YLG5W.js.map → composite-router-WOVGICBS.js.map} +0 -0
  109. /package/dist/{consensus-vote-KWPS6WNH.js.map → consensus-vote-322S65GQ.js.map} +0 -0
  110. /package/dist/{context-retriever-YCKTCDGM.js.map → context-retriever-YMJY6YBJ.js.map} +0 -0
  111. /package/dist/{doctor-deep-4UARVVSD.js.map → doctor-deep-DALT3OXC.js.map} +0 -0
  112. /package/dist/{expert-bridge-EAR6XZJA.js.map → expert-bridge-WNV3ST2T.js.map} +0 -0
  113. /package/dist/{factory-7SVW7XMV.js.map → factory-33HQYVCK.js.map} +0 -0
  114. /package/dist/{factory-JYAUOFEN.js.map → factory-TLSTFONW.js.map} +0 -0
  115. /package/dist/{improvement-review-AHSY5ZXD.js.map → improvement-review-2W6LKP74.js.map} +0 -0
  116. /package/dist/{issue-triage-TNV4R33I.js.map → issue-triage-CVMVZ3IV.js.map} +0 -0
  117. /package/dist/{pr-reviewer-helpers-ZC2I5ZYD.js.map → pr-reviewer-helpers-SAMOVLNJ.js.map} +0 -0
  118. /package/dist/{registry-command-O2GLHG3G.js.map → registry-command-5D2DJT53.js.map} +0 -0
  119. /package/dist/{repo-security-plan-CFRLHIMY.js.map → repo-security-plan-F7V5SHAQ.js.map} +0 -0
  120. /package/dist/{research-helpers-synthesize-ONWBGXHO.js.map → research-helpers-synthesize-F4PV4B4B.js.map} +0 -0
  121. /package/dist/{routing-memory-XHZKEPUH.js.map → routing-memory-G6YBK4WI.js.map} +0 -0
  122. /package/dist/{session-memory-5QVKDE4U.js.map → session-memory-DAJHLPOY.js.map} +0 -0
  123. /package/dist/{setup-command-G7OB4QQG.js.map → setup-command-NUNIRAFN.js.map} +0 -0
  124. /package/dist/{setup-config-MMBOL5CW.js.map → setup-config-HKUWFV5N.js.map} +0 -0
  125. /package/dist/{setup-custom-api-RQ3BUMJC.js.map → setup-custom-api-XRUPWEPF.js.map} +0 -0
  126. /package/dist/{tool-memory-VK4IZLPN.js.map → tool-memory-XJ5VRMNQ.js.map} +0 -0
  127. /package/dist/{unified-registry-ZOTGM4EY.js.map → unified-registry-ETKPTZBU.js.map} +0 -0
  128. /package/dist/{weather-report-MPD66LKP.js.map → weather-report-TWBLIHPZ.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createLogger
3
- } from "./chunk-Z66EEQ4A.js";
3
+ } from "./chunk-CURHM4TH.js";
4
4
  import "./chunk-AXTD4TFK.js";
5
5
  import "./chunk-DHVMSIT5.js";
6
6
  import "./chunk-ZPWHCABL.js";
@@ -60,4 +60,4 @@ export {
60
60
  generateMcpConfig,
61
61
  getDefaultAllowedTools
62
62
  };
63
- //# sourceMappingURL=child-mcp-config-AUA4TFBG.js.map
63
+ //# sourceMappingURL=child-mcp-config-X4YLQKGK.js.map
@@ -15,7 +15,7 @@ import {
15
15
  createLogger,
16
16
  err,
17
17
  ok
18
- } from "./chunk-Z66EEQ4A.js";
18
+ } from "./chunk-CURHM4TH.js";
19
19
 
20
20
  // src/adapters/sdk/types.ts
21
21
  var PROVIDER_ENV_KEYS = {
@@ -396,4 +396,4 @@ export {
396
396
  CUSTOM_API_DEFAULT_MODEL,
397
397
  DEFAULTS
398
398
  };
399
- //# sourceMappingURL=chunk-P54BDACX.js.map
399
+ //# sourceMappingURL=chunk-2NU774CB.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  generateSecurityPlan
3
- } from "./chunk-76Q6GTPU.js";
3
+ } from "./chunk-VNVGGM73.js";
4
4
  import {
5
5
  analyzeGitHubRepo
6
6
  } from "./chunk-HFOQKCD2.js";
@@ -20,10 +20,10 @@ import {
20
20
  DEFAULT_TASK_TTL_MS,
21
21
  DEFAULT_TOOL_RATE_LIMITS,
22
22
  clampTaskTtl
23
- } from "./chunk-PXTZ6RPP.js";
23
+ } from "./chunk-EUQNHT7O.js";
24
24
  import {
25
25
  executeExpert
26
- } from "./chunk-HNAFWKJG.js";
26
+ } from "./chunk-GRWHPG72.js";
27
27
  import {
28
28
  JobStatusSchema,
29
29
  abortJob,
@@ -44,21 +44,21 @@ import {
44
44
  simulationDeniedResult,
45
45
  toJobSummary,
46
46
  writeJobCancelled
47
- } from "./chunk-FQNG6ZIW.js";
47
+ } from "./chunk-TGAVZ2ZL.js";
48
48
  import {
49
49
  normalizeTopicToCanonical,
50
50
  synthesizeResearch
51
- } from "./chunk-ORRKK563.js";
51
+ } from "./chunk-7K5LSUEU.js";
52
52
  import {
53
53
  IssueTriage
54
- } from "./chunk-JYVPM37A.js";
54
+ } from "./chunk-RKIPSMCN.js";
55
55
  import {
56
56
  resolveEnvMode,
57
57
  sanitizeInput
58
- } from "./chunk-F2YZ3U6O.js";
58
+ } from "./chunk-SRNAXDOT.js";
59
59
  import {
60
60
  withPrerequisite
61
- } from "./chunk-PRSGZQNB.js";
61
+ } from "./chunk-ZIC6ZZFU.js";
62
62
  import {
63
63
  NOOP_NOTIFIER,
64
64
  RateLimiter,
@@ -81,12 +81,12 @@ import {
81
81
  withAuditTrail,
82
82
  withProgressHeartbeat,
83
83
  wrapToolWithTimeout
84
- } from "./chunk-V5RPW2ZX.js";
84
+ } from "./chunk-STMW5BSR.js";
85
85
  import {
86
86
  createAuditTrail,
87
87
  createGraphAuditBridge,
88
88
  emitPipelinePolicyEvent
89
- } from "./chunk-BFDVV3Q3.js";
89
+ } from "./chunk-QV52AXTF.js";
90
90
  import {
91
91
  addResearchPaper,
92
92
  addSourceToRegistry,
@@ -114,15 +114,15 @@ import {
114
114
  parseRegistry,
115
115
  sourceExistsInRegistry,
116
116
  summarizeContextForPrompt
117
- } from "./chunk-WOY6TQCH.js";
117
+ } from "./chunk-ZSUN7BHE.js";
118
118
  import {
119
119
  getTokenEnvVars,
120
120
  resolveToken
121
- } from "./chunk-UWRDWX6L.js";
121
+ } from "./chunk-UNIDAVVR.js";
122
122
  import {
123
123
  loadPapersRegistry,
124
124
  loadTechniquesRegistry
125
- } from "./chunk-6LXTT6AK.js";
125
+ } from "./chunk-PC4Y4VPX.js";
126
126
  import {
127
127
  resolveInsideRoot
128
128
  } from "./chunk-NUBSJGQZ.js";
@@ -131,14 +131,14 @@ import {
131
131
  MemoryImportance,
132
132
  calculateTextJaccardSimilarity,
133
133
  getToolMemory
134
- } from "./chunk-I7OZP6FS.js";
134
+ } from "./chunk-KM3YEIEN.js";
135
135
  import {
136
136
  STOPWORDS,
137
137
  truncateWithInfo
138
138
  } from "./chunk-6T3EPABN.js";
139
139
  import {
140
140
  createSessionMemory
141
- } from "./chunk-DMFMJFRY.js";
141
+ } from "./chunk-QPSYBHK6.js";
142
142
  import {
143
143
  BUILT_IN_EXPERTS,
144
144
  BuiltInExpertTypeSchema,
@@ -153,7 +153,7 @@ import {
153
153
  createEvent,
154
154
  getGlobalEventBus,
155
155
  getGlobalRegistry
156
- } from "./chunk-BZFF3YWU.js";
156
+ } from "./chunk-GGYQTV2Y.js";
157
157
  import {
158
158
  CliDetectionCache,
159
159
  asRecord,
@@ -161,19 +161,19 @@ import {
161
161
  getAvailableClis,
162
162
  sleep,
163
163
  withTimeout
164
- } from "./chunk-ZI4PO2A3.js";
164
+ } from "./chunk-S6HCREYY.js";
165
165
  import {
166
166
  DEFAULTS
167
- } from "./chunk-P54BDACX.js";
167
+ } from "./chunk-2NU774CB.js";
168
168
  import {
169
169
  getAvailabilityCache,
170
170
  getCliForModelId,
171
171
  resolveFallback
172
- } from "./chunk-3LVB5OE2.js";
172
+ } from "./chunk-ZTTUXPBQ.js";
173
173
  import {
174
174
  generateHyphenId,
175
175
  generateUUID
176
- } from "./chunk-GS3UPAUE.js";
176
+ } from "./chunk-7USEQLMS.js";
177
177
  import {
178
178
  AGENT_ROUTER_TIMEOUTS,
179
179
  API_TIMEOUTS,
@@ -265,7 +265,7 @@ import {
265
265
  selectStrategyByManifest,
266
266
  toExpertTaskAnalysisResult,
267
267
  withStep
268
- } from "./chunk-Z66EEQ4A.js";
268
+ } from "./chunk-CURHM4TH.js";
269
269
  import {
270
270
  ensureLearningDir,
271
271
  getMetaOutcomesFile,
@@ -26300,7 +26300,7 @@ function execIdFields(executionId) {
26300
26300
  async function populateUnifiedContextOnState(state, options) {
26301
26301
  const taskCandidate = state["task"];
26302
26302
  if (typeof taskCandidate !== "string" || taskCandidate === "") return;
26303
- const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-YCKTCDGM.js");
26303
+ const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-YMJY6YBJ.js");
26304
26304
  const category = inferTaskCategory2(taskCandidate);
26305
26305
  const executionId = options?.executionId;
26306
26306
  const execFields = execIdFields(executionId);
@@ -41674,7 +41674,7 @@ async function tryIssueTriage(task) {
41674
41674
  try {
41675
41675
  const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
41676
41676
  if (issueMatch === null) return null;
41677
- const { createIssueTriage } = await import("./issue-triage-TNV4R33I.js");
41677
+ const { createIssueTriage } = await import("./issue-triage-CVMVZ3IV.js");
41678
41678
  const triage = createIssueTriage();
41679
41679
  const owner = issueMatch[1] ?? "";
41680
41680
  const num = issueMatch[2] ?? "";
@@ -41702,7 +41702,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
41702
41702
  ]);
41703
41703
  async function classifyWithLLM(task) {
41704
41704
  try {
41705
- const { executeExpert: executeExpert2 } = await import("./expert-bridge-EAR6XZJA.js");
41705
+ const { executeExpert: executeExpert2 } = await import("./expert-bridge-WNV3ST2T.js");
41706
41706
  const prompt = [
41707
41707
  "Classify this task into exactly one pipeline template.",
41708
41708
  "Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
@@ -43343,7 +43343,7 @@ var memoryInitPromise = null;
43343
43343
  async function initPipelineMemory() {
43344
43344
  if (cachedMemory !== null) return cachedMemory;
43345
43345
  try {
43346
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-5QVKDE4U.js");
43346
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-DAJHLPOY.js");
43347
43347
  const { getLearningDir } = await import("./learning-persistence-6D5GGT7D.js");
43348
43348
  const mem = createSessionMemory2(getLearningDir());
43349
43349
  mem.startSession(`pipeline-${String(getTimeProvider().now())}`);
@@ -43405,7 +43405,7 @@ function recordRoutingExperience(category, success, durationMs, tokensUsed = 0,
43405
43405
  callRecord(routingMemoryCache);
43406
43406
  return;
43407
43407
  }
43408
- routingMemoryInitPromise ??= import("./routing-memory-XHZKEPUH.js").then(({ createRoutingMemory }) => {
43408
+ routingMemoryInitPromise ??= import("./routing-memory-G6YBK4WI.js").then(({ createRoutingMemory }) => {
43409
43409
  routingMemoryCache ??= createRoutingMemory();
43410
43410
  return routingMemoryCache;
43411
43411
  }).catch((error) => {
@@ -43439,7 +43439,7 @@ ${text}` : "";
43439
43439
  }
43440
43440
  async function getWeatherContext() {
43441
43441
  try {
43442
- const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-MPD66LKP.js");
43442
+ const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-TWBLIHPZ.js");
43443
43443
  const report = generateWeatherReport2({ includeAdaptive: true });
43444
43444
  const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
43445
43445
  if (!Array.isArray(mappings) || mappings.length === 0) return "";
@@ -43457,7 +43457,7 @@ ${lines}
43457
43457
  }
43458
43458
  async function getMemoryContext(task) {
43459
43459
  try {
43460
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-5QVKDE4U.js");
43460
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-DAJHLPOY.js");
43461
43461
  const { getLearningDir } = await import("./learning-persistence-6D5GGT7D.js");
43462
43462
  const memory = createSessionMemory2(getLearningDir(), { maxLearningsInContext: 10 });
43463
43463
  const learnings = memory.searchLearnings(task.slice(0, 200));
@@ -43572,7 +43572,7 @@ ${contextBlock}`;
43572
43572
  const strategy = config.votingStrategy ?? "higher_order";
43573
43573
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
43574
43574
  try {
43575
- const { executeVoting } = await import("./consensus-vote-KWPS6WNH.js");
43575
+ const { executeVoting } = await import("./consensus-vote-322S65GQ.js");
43576
43576
  const votingResult = await executeVoting(
43577
43577
  {
43578
43578
  proposal: buildVoteProposal(plan, research),
@@ -44013,7 +44013,7 @@ async function searchCodebaseForTask(task) {
44013
44013
  }
44014
44014
  async function queryResearchRegistry(task) {
44015
44015
  try {
44016
- const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-ONWBGXHO.js");
44016
+ const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-F4PV4B4B.js");
44017
44017
  const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
44018
44018
  if (topic === void 0) return null;
44019
44019
  const result = await synthesizeResearch2(topic.slice(0, 50));
@@ -44084,7 +44084,7 @@ function createScanStageWrapper() {
44084
44084
  try {
44085
44085
  const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
44086
44086
  if (slug !== void 0) {
44087
- const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-CFRLHIMY.js");
44087
+ const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-F7V5SHAQ.js");
44088
44088
  const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
44089
44089
  const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
44090
44090
  return output(PIPELINE_STATE_KEYS.FINDINGS, recs, getTimeProvider().now() - start, true);
@@ -47044,7 +47044,7 @@ var GitHubTaskTracker = class {
47044
47044
  cachedProvider = null;
47045
47045
  async getProvider() {
47046
47046
  if (this.cachedProvider !== null) return this.cachedProvider;
47047
- const { createScmProvider } = await import("./factory-7SVW7XMV.js");
47047
+ const { createScmProvider } = await import("./factory-TLSTFONW.js");
47048
47048
  const result = await createScmProvider({ repo: this.config.repo ?? "" });
47049
47049
  if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
47050
47050
  this.cachedProvider = result.value;
@@ -47851,7 +47851,7 @@ async function probeSource(source, includeModelIds) {
47851
47851
  }
47852
47852
  }
47853
47853
  async function defaultSources(includeOpenRouter) {
47854
- const { createAllAdapters: createAllAdapters2 } = await import("./factory-JYAUOFEN.js");
47854
+ const { createAllAdapters: createAllAdapters2 } = await import("./factory-33HQYVCK.js");
47855
47855
  const adapters = createAllAdapters2();
47856
47856
  return buildDefaultModelSources(adapters, { includeOpenRouter });
47857
47857
  }
@@ -51920,4 +51920,4 @@ export {
51920
51920
  shutdownFeedbackSubscriber,
51921
51921
  createEventBusBridge
51922
51922
  };
51923
- //# sourceMappingURL=chunk-JBH4CU46.js.map
51923
+ //# sourceMappingURL=chunk-2S7T66IQ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runConfigInitSync
3
- } from "./chunk-FKHQWC2L.js";
3
+ } from "./chunk-XUMLVCFL.js";
4
4
  import {
5
5
  VERSION,
6
6
  checkApiKeys,
@@ -8,13 +8,13 @@ import {
8
8
  checkSqlite,
9
9
  defaultConfig,
10
10
  initDataDirectories
11
- } from "./chunk-PXTZ6RPP.js";
11
+ } from "./chunk-EUQNHT7O.js";
12
12
  import {
13
13
  BUILT_IN_EXPERTS
14
14
  } from "./chunk-ZM4O442V.js";
15
15
  import {
16
16
  probeAllClis
17
- } from "./chunk-ZI4PO2A3.js";
17
+ } from "./chunk-S6HCREYY.js";
18
18
  import {
19
19
  CLI_SUBPROCESS_TIMEOUTS,
20
20
  colors,
@@ -25,7 +25,7 @@ import {
25
25
  getErrorMessage,
26
26
  getTimeProvider,
27
27
  symbols
28
- } from "./chunk-Z66EEQ4A.js";
28
+ } from "./chunk-CURHM4TH.js";
29
29
  import {
30
30
  ensureGitignored,
31
31
  findRepoRoot
@@ -2001,4 +2001,4 @@ export {
2001
2001
  setupCommand,
2002
2002
  setupCommandAsync
2003
2003
  };
2004
- //# sourceMappingURL=chunk-UO6C5J5D.js.map
2004
+ //# sourceMappingURL=chunk-3T6KLPGT.js.map
@@ -1,17 +1,25 @@
1
+ import {
2
+ computeCostDetail,
3
+ recordUsageEvent
4
+ } from "./chunk-ZAPCPHGZ.js";
1
5
  import {
2
6
  BaseAdapter,
3
7
  createStream,
4
8
  planOptionalParams,
5
9
  requireApiKey,
6
10
  validateApiKeyPresence
7
- } from "./chunk-YKTVN2TF.js";
11
+ } from "./chunk-IFSIKGHI.js";
8
12
  import {
13
+ ConfigError,
9
14
  ModelCapability,
15
+ createLogger,
10
16
  err,
11
17
  getCliModelName,
18
+ getErrorMessage,
19
+ getTimeProvider,
12
20
  getTokenEstimator,
13
21
  ok
14
- } from "./chunk-Z66EEQ4A.js";
22
+ } from "./chunk-CURHM4TH.js";
15
23
 
16
24
  // src/adapters/openai-types.ts
17
25
  var OPENAI_MODELS = {
@@ -603,10 +611,188 @@ function createOpenAIAdapter(config) {
603
611
  return new OpenAIAdapter(config);
604
612
  }
605
613
 
614
+ // src/config/opencode-bridge.ts
615
+ import { readFileSync } from "fs";
616
+ var logger = createLogger({ component: "opencode-bridge" });
617
+ function readOpencodeGateway(path) {
618
+ const raw = readFileOrNull(path);
619
+ if (raw === null) return null;
620
+ const parsed = parseJsonOrNull(raw, path);
621
+ if (parsed === null) return null;
622
+ const options = extractOpenAICompatOptions(parsed);
623
+ if (options === null) {
624
+ logger.debug("opencode.json has no providers.openai-compat.options block", { path });
625
+ return null;
626
+ }
627
+ const baseURL = typeof options.baseURL === "string" ? options.baseURL.trim() : "";
628
+ const apiKeyRaw = typeof options.apiKey === "string" ? options.apiKey.trim() : "";
629
+ if (baseURL === "" || apiKeyRaw === "") {
630
+ logger.warn("opencode.json providers.openai-compat missing baseURL or apiKey", { path });
631
+ return null;
632
+ }
633
+ const apiKey = resolveEnvInterpolation(apiKeyRaw);
634
+ if (apiKey === null) {
635
+ logger.warn(
636
+ "opencode.json apiKey references an env var that is not set; gateway not configured",
637
+ { path }
638
+ );
639
+ return null;
640
+ }
641
+ logger.info("Gateway config sourced from opencode.json", { baseURL, path });
642
+ return { baseURL, apiKey };
643
+ }
644
+ function readFileOrNull(path) {
645
+ try {
646
+ return readFileSync(path, "utf8");
647
+ } catch (err2) {
648
+ const msg = err2 instanceof Error ? err2.message : String(err2);
649
+ logger.debug("Could not read opencode.json", { path, error: msg });
650
+ return null;
651
+ }
652
+ }
653
+ function parseJsonOrNull(raw, path) {
654
+ try {
655
+ return JSON.parse(raw);
656
+ } catch (err2) {
657
+ const msg = err2 instanceof Error ? err2.message : String(err2);
658
+ logger.warn("opencode.json is not valid JSON; ignoring", { path, error: msg });
659
+ return null;
660
+ }
661
+ }
662
+ function extractOpenAICompatOptions(parsed) {
663
+ if (typeof parsed !== "object" || parsed === null) return null;
664
+ const root = parsed;
665
+ const providers = root.providers;
666
+ if (typeof providers !== "object" || providers === null) return null;
667
+ const provider = providers["openai-compat"];
668
+ if (typeof provider !== "object" || provider === null) return null;
669
+ const options = provider.options;
670
+ if (typeof options !== "object" || options === null) return null;
671
+ return options;
672
+ }
673
+ function resolveEnvInterpolation(value) {
674
+ const match = /^\{env:([A-Z0-9_]+)\}$/.exec(value);
675
+ if (match === null) return value;
676
+ const envName = match[1];
677
+ if (envName === void 0) return null;
678
+ const resolved = process.env[envName];
679
+ if (resolved === void 0 || resolved === "") return null;
680
+ return resolved;
681
+ }
682
+
683
+ // src/adapters/openai-compat-adapter.ts
684
+ import OpenAI2 from "openai";
685
+ function readOpenAICompatEnv() {
686
+ const fromEnv = readGatewayFromEnv();
687
+ if (fromEnv !== null) return fromEnv;
688
+ return readGatewayFromOpencode();
689
+ }
690
+ function readGatewayFromEnv() {
691
+ const envUrl = process.env["NEXUS_OPENAI_COMPAT_URL"]?.trim();
692
+ const envKey = process.env["NEXUS_OPENAI_COMPAT_KEY"]?.trim();
693
+ if (envUrl === void 0 || envUrl === "") return null;
694
+ if (envKey === void 0 || envKey === "") return null;
695
+ return { baseUrl: envUrl, apiKey: envKey };
696
+ }
697
+ function readGatewayFromOpencode() {
698
+ const opencodePath = process.env["NEXUS_OPENCODE_CONFIG"]?.trim();
699
+ if (opencodePath === void 0 || opencodePath === "") return null;
700
+ const fromFile = readOpencodeGateway(opencodePath);
701
+ if (fromFile === null) return null;
702
+ return { baseUrl: fromFile.baseURL, apiKey: fromFile.apiKey };
703
+ }
704
+ async function discoverModels(config) {
705
+ try {
706
+ const client = new OpenAI2({ baseURL: config.baseUrl, apiKey: config.apiKey });
707
+ const list = await client.models.list();
708
+ const models = list.data.map((m) => ({
709
+ id: m.id,
710
+ created: m.created,
711
+ ownedBy: m.owned_by
712
+ }));
713
+ return ok(models);
714
+ } catch (e) {
715
+ return err(
716
+ new ConfigError(
717
+ `Failed to discover models from ${config.baseUrl}: ${getErrorMessage(e)}. Verify NEXUS_OPENAI_COMPAT_URL and NEXUS_OPENAI_COMPAT_KEY, then retry.`
718
+ )
719
+ );
720
+ }
721
+ }
722
+ function createOpenAICompatAdapter(modelId, config) {
723
+ const inner = new OpenAIAdapter({ modelId, apiKey: config.apiKey, baseUrl: config.baseUrl });
724
+ return withUsageRecording(inner);
725
+ }
726
+ function withUsageRecording(inner) {
727
+ const wrapped = {
728
+ providerId: inner.providerId,
729
+ modelId: inner.modelId,
730
+ capabilities: inner.capabilities,
731
+ countTokens: (text) => inner.countTokens(text),
732
+ validateConfig: () => inner.validateConfig(),
733
+ stream: (request) => inner.stream(request),
734
+ async complete(request) {
735
+ const start = getTimeProvider().now();
736
+ const result = await inner.complete(request);
737
+ const latencyMs = getTimeProvider().now() - start;
738
+ try {
739
+ if (result.ok) {
740
+ const u = result.value.usage;
741
+ const cost = computeCostDetail(inner.modelId, u.inputTokens, u.outputTokens);
742
+ recordUsageEvent({
743
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
744
+ modelId: inner.modelId,
745
+ providerId: inner.providerId,
746
+ inputTokens: u.inputTokens,
747
+ outputTokens: u.outputTokens,
748
+ usdCost: cost.costUsd,
749
+ latencyMs,
750
+ success: true,
751
+ priced: cost.priced,
752
+ ...cost.priced ? { priceSource: cost.resolvedId } : {}
753
+ });
754
+ } else {
755
+ recordUsageEvent({
756
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
757
+ modelId: inner.modelId,
758
+ providerId: inner.providerId,
759
+ inputTokens: 0,
760
+ outputTokens: 0,
761
+ usdCost: 0,
762
+ latencyMs,
763
+ success: false,
764
+ errorCode: result.error.code
765
+ });
766
+ }
767
+ } catch {
768
+ }
769
+ return result;
770
+ }
771
+ };
772
+ attachListModels(wrapped, inner);
773
+ return wrapped;
774
+ }
775
+ function attachListModels(wrapped, inner) {
776
+ const list = inner.listModels?.bind(inner);
777
+ if (list === void 0) return;
778
+ wrapped.listModels = () => list();
779
+ }
780
+ async function buildOpenAICompatAdapters() {
781
+ const config = readOpenAICompatEnv();
782
+ if (config === null) return null;
783
+ const discovered = await discoverModels(config);
784
+ if (!discovered.ok) return discovered;
785
+ return ok(discovered.value.map((m) => createOpenAICompatAdapter(m.id, config)));
786
+ }
787
+
606
788
  export {
607
789
  OPENAI_MODELS,
608
790
  OPENAI_MODEL_ALIASES,
609
791
  OpenAIAdapter,
610
- createOpenAIAdapter
792
+ createOpenAIAdapter,
793
+ readOpencodeGateway,
794
+ readOpenAICompatEnv,
795
+ discoverModels,
796
+ buildOpenAICompatAdapters
611
797
  };
612
- //# sourceMappingURL=chunk-FZV4YAYT.js.map
798
+ //# sourceMappingURL=chunk-6KCZA3IO.js.map