nexus-agents 2.176.2 → 2.178.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 (127) hide show
  1. package/dist/{child-mcp-config-HPWYQFLG.js → child-mcp-config-PACKMI72.js} +2 -2
  2. package/dist/{chunk-YU2JCUM7.js → chunk-27RVYUCU.js} +2 -2
  3. package/dist/{chunk-CNHPSIHY.js → chunk-2UH5MVYS.js} +14 -6
  4. package/dist/chunk-2UH5MVYS.js.map +1 -0
  5. package/dist/{chunk-JRKF4FYO.js → chunk-47UPLZWW.js} +2 -2
  6. package/dist/{chunk-J55NMZ7R.js → chunk-4AF6VYQ7.js} +2 -2
  7. package/dist/{chunk-4S6S6S2S.js → chunk-4IOIURV4.js} +2 -2
  8. package/dist/{chunk-5LTRHNOI.js → chunk-4JIVEF5J.js} +3 -3
  9. package/dist/{chunk-2DE5L734.js → chunk-4NESLVOU.js} +2 -2
  10. package/dist/{chunk-ZOOSSM7D.js → chunk-AIBM5TJS.js} +5 -5
  11. package/dist/{chunk-J4BGV5VE.js → chunk-BP662TCH.js} +2 -2
  12. package/dist/{chunk-XES5DPHV.js → chunk-BPGEBBMI.js} +3 -3
  13. package/dist/{chunk-QI5U2YUL.js → chunk-CCOPA2YX.js} +5 -5
  14. package/dist/chunk-CCOPA2YX.js.map +1 -0
  15. package/dist/{chunk-JGL5HYZL.js → chunk-E4PCF6Q5.js} +3 -3
  16. package/dist/{chunk-XZJU6WLL.js → chunk-E5YASO4I.js} +4 -4
  17. package/dist/{chunk-46XEDJRB.js → chunk-E7BIMTCD.js} +2 -2
  18. package/dist/{chunk-Z55WHIRU.js → chunk-ELH4PIFM.js} +2 -2
  19. package/dist/{chunk-NQU4LNN7.js → chunk-H2PV2ZOM.js} +4 -4
  20. package/dist/{chunk-6HBMN6GZ.js → chunk-HEYVV4XQ.js} +57 -55
  21. package/dist/chunk-HEYVV4XQ.js.map +1 -0
  22. package/dist/{chunk-5YXHHEAG.js → chunk-JZDD7Z2Z.js} +5 -5
  23. package/dist/{chunk-G42V4A5Q.js → chunk-KFEHSYLI.js} +2 -2
  24. package/dist/{chunk-WMV2CXBB.js → chunk-KVQD7Z3R.js} +2 -2
  25. package/dist/{chunk-G5URP3V7.js → chunk-LJ36QD7F.js} +7 -7
  26. package/dist/{chunk-WT4BJODZ.js → chunk-LYDBCTT4.js} +16 -10
  27. package/dist/chunk-LYDBCTT4.js.map +1 -0
  28. package/dist/{chunk-ECBV4JNL.js → chunk-RTGLOWR6.js} +2 -2
  29. package/dist/{chunk-7TXEBDRM.js → chunk-SKVPP327.js} +2 -2
  30. package/dist/{chunk-QQ3CUUBU.js → chunk-SMP4NQ6T.js} +4 -4
  31. package/dist/{chunk-XAWRBQB7.js → chunk-SOZYAAFS.js} +3 -3
  32. package/dist/{chunk-4OPEUDHY.js → chunk-U5ODY6VK.js} +25 -12
  33. package/dist/chunk-U5ODY6VK.js.map +1 -0
  34. package/dist/{chunk-U5CV76ZW.js → chunk-UTWNUG3M.js} +2 -2
  35. package/dist/{chunk-LGBCHTC6.js → chunk-VDYFOQXY.js} +8 -8
  36. package/dist/{chunk-YB4QE7MD.js → chunk-VWKOCFOQ.js} +2 -2
  37. package/dist/{chunk-CGD63GSC.js → chunk-XXTMXJWZ.js} +5 -5
  38. package/dist/{chunk-5ALUADB6.js → chunk-ZH5B2BIL.js} +2 -2
  39. package/dist/{chunk-N3XDPW64.js → chunk-ZQGTPRIM.js} +48 -65
  40. package/dist/chunk-ZQGTPRIM.js.map +1 -0
  41. package/dist/{cli-circuit-breaker-PJOQTGFZ.js → cli-circuit-breaker-OWSE7HFZ.js} +3 -3
  42. package/dist/cli.d.ts +1 -1
  43. package/dist/cli.js +40 -40
  44. package/dist/{composite-router-IRXFQSB6.js → composite-router-ZTARSEYG.js} +2 -2
  45. package/dist/{consensus-vote-O6Q266QE.js → consensus-vote-BEU24RCT.js} +16 -16
  46. package/dist/{consensus-vote-types-BlbNhK1n.d.ts → consensus-vote-types-DusDu6pM.d.ts} +31 -4
  47. package/dist/{context-retriever-GO6ET3MF.js → context-retriever-ZX3CBXIC.js} +8 -8
  48. package/dist/{doctor-deep-6HCHHMRP.js → doctor-deep-U52LMY2R.js} +3 -3
  49. package/dist/{expert-bridge-6OLG6THF.js → expert-bridge-GY5GGOJW.js} +4 -4
  50. package/dist/{factory-MJFGYMNE.js → factory-PBHDVNU2.js} +5 -5
  51. package/dist/{factory-7OM526WB.js → factory-XR2UQOEH.js} +9 -9
  52. package/dist/{improvement-review-PALAAG7V.js → improvement-review-FPZ23HIJ.js} +5 -5
  53. package/dist/index.d.ts +61 -23
  54. package/dist/index.js +30 -30
  55. package/dist/index.js.map +1 -1
  56. package/dist/{init-opencode-NUMHNVIF.js → init-opencode-LLNCIUUF.js} +6 -6
  57. package/dist/{issue-triage-N7GFXNPY.js → issue-triage-PSHCE7RU.js} +6 -6
  58. package/dist/{pr-reviewer-helpers-6EIUJPXS.js → pr-reviewer-helpers-3WVNJRCK.js} +4 -4
  59. package/dist/{registry-command-SVTX7FKB.js → registry-command-JNSSDYGB.js} +2 -2
  60. package/dist/{repo-security-plan-AT7LOXLG.js → repo-security-plan-7QYZJCGT.js} +3 -3
  61. package/dist/{research-helpers-synthesize-R722YWRS.js → research-helpers-synthesize-TSIH4U7M.js} +4 -4
  62. package/dist/{routing-memory-4FXQT5H6.js → routing-memory-PHOZF4L2.js} +2 -2
  63. package/dist/{session-memory-ZQJ6AUSQ.js → session-memory-T5NHGNC5.js} +3 -3
  64. package/dist/{setup-command-IYBRT734.js → setup-command-MJP66PED.js} +14 -14
  65. package/dist/{setup-config-MYLZ2UHR.js → setup-config-2GJZNH7Z.js} +3 -3
  66. package/dist/{setup-custom-api-WZPLTGRQ.js → setup-custom-api-F6FEC2HD.js} +4 -4
  67. package/dist/{tool-memory-5REJXBCB.js → tool-memory-UIWAECRB.js} +5 -5
  68. package/dist/{unified-registry-FM3QB2VN.js → unified-registry-J7NOHQ44.js} +10 -10
  69. package/dist/{weather-report-Y2GYJA6I.js → weather-report-DQANKBJK.js} +2 -2
  70. package/package.json +1 -1
  71. package/dist/chunk-4OPEUDHY.js.map +0 -1
  72. package/dist/chunk-6HBMN6GZ.js.map +0 -1
  73. package/dist/chunk-CNHPSIHY.js.map +0 -1
  74. package/dist/chunk-N3XDPW64.js.map +0 -1
  75. package/dist/chunk-QI5U2YUL.js.map +0 -1
  76. package/dist/chunk-WT4BJODZ.js.map +0 -1
  77. /package/dist/{child-mcp-config-HPWYQFLG.js.map → child-mcp-config-PACKMI72.js.map} +0 -0
  78. /package/dist/{chunk-YU2JCUM7.js.map → chunk-27RVYUCU.js.map} +0 -0
  79. /package/dist/{chunk-JRKF4FYO.js.map → chunk-47UPLZWW.js.map} +0 -0
  80. /package/dist/{chunk-J55NMZ7R.js.map → chunk-4AF6VYQ7.js.map} +0 -0
  81. /package/dist/{chunk-4S6S6S2S.js.map → chunk-4IOIURV4.js.map} +0 -0
  82. /package/dist/{chunk-5LTRHNOI.js.map → chunk-4JIVEF5J.js.map} +0 -0
  83. /package/dist/{chunk-2DE5L734.js.map → chunk-4NESLVOU.js.map} +0 -0
  84. /package/dist/{chunk-ZOOSSM7D.js.map → chunk-AIBM5TJS.js.map} +0 -0
  85. /package/dist/{chunk-J4BGV5VE.js.map → chunk-BP662TCH.js.map} +0 -0
  86. /package/dist/{chunk-XES5DPHV.js.map → chunk-BPGEBBMI.js.map} +0 -0
  87. /package/dist/{chunk-JGL5HYZL.js.map → chunk-E4PCF6Q5.js.map} +0 -0
  88. /package/dist/{chunk-XZJU6WLL.js.map → chunk-E5YASO4I.js.map} +0 -0
  89. /package/dist/{chunk-46XEDJRB.js.map → chunk-E7BIMTCD.js.map} +0 -0
  90. /package/dist/{chunk-Z55WHIRU.js.map → chunk-ELH4PIFM.js.map} +0 -0
  91. /package/dist/{chunk-NQU4LNN7.js.map → chunk-H2PV2ZOM.js.map} +0 -0
  92. /package/dist/{chunk-5YXHHEAG.js.map → chunk-JZDD7Z2Z.js.map} +0 -0
  93. /package/dist/{chunk-G42V4A5Q.js.map → chunk-KFEHSYLI.js.map} +0 -0
  94. /package/dist/{chunk-WMV2CXBB.js.map → chunk-KVQD7Z3R.js.map} +0 -0
  95. /package/dist/{chunk-G5URP3V7.js.map → chunk-LJ36QD7F.js.map} +0 -0
  96. /package/dist/{chunk-ECBV4JNL.js.map → chunk-RTGLOWR6.js.map} +0 -0
  97. /package/dist/{chunk-7TXEBDRM.js.map → chunk-SKVPP327.js.map} +0 -0
  98. /package/dist/{chunk-QQ3CUUBU.js.map → chunk-SMP4NQ6T.js.map} +0 -0
  99. /package/dist/{chunk-XAWRBQB7.js.map → chunk-SOZYAAFS.js.map} +0 -0
  100. /package/dist/{chunk-U5CV76ZW.js.map → chunk-UTWNUG3M.js.map} +0 -0
  101. /package/dist/{chunk-LGBCHTC6.js.map → chunk-VDYFOQXY.js.map} +0 -0
  102. /package/dist/{chunk-YB4QE7MD.js.map → chunk-VWKOCFOQ.js.map} +0 -0
  103. /package/dist/{chunk-CGD63GSC.js.map → chunk-XXTMXJWZ.js.map} +0 -0
  104. /package/dist/{chunk-5ALUADB6.js.map → chunk-ZH5B2BIL.js.map} +0 -0
  105. /package/dist/{cli-circuit-breaker-PJOQTGFZ.js.map → cli-circuit-breaker-OWSE7HFZ.js.map} +0 -0
  106. /package/dist/{composite-router-IRXFQSB6.js.map → composite-router-ZTARSEYG.js.map} +0 -0
  107. /package/dist/{consensus-vote-O6Q266QE.js.map → consensus-vote-BEU24RCT.js.map} +0 -0
  108. /package/dist/{context-retriever-GO6ET3MF.js.map → context-retriever-ZX3CBXIC.js.map} +0 -0
  109. /package/dist/{doctor-deep-6HCHHMRP.js.map → doctor-deep-U52LMY2R.js.map} +0 -0
  110. /package/dist/{expert-bridge-6OLG6THF.js.map → expert-bridge-GY5GGOJW.js.map} +0 -0
  111. /package/dist/{factory-7OM526WB.js.map → factory-PBHDVNU2.js.map} +0 -0
  112. /package/dist/{factory-MJFGYMNE.js.map → factory-XR2UQOEH.js.map} +0 -0
  113. /package/dist/{improvement-review-PALAAG7V.js.map → improvement-review-FPZ23HIJ.js.map} +0 -0
  114. /package/dist/{init-opencode-NUMHNVIF.js.map → init-opencode-LLNCIUUF.js.map} +0 -0
  115. /package/dist/{issue-triage-N7GFXNPY.js.map → issue-triage-PSHCE7RU.js.map} +0 -0
  116. /package/dist/{pr-reviewer-helpers-6EIUJPXS.js.map → pr-reviewer-helpers-3WVNJRCK.js.map} +0 -0
  117. /package/dist/{registry-command-SVTX7FKB.js.map → registry-command-JNSSDYGB.js.map} +0 -0
  118. /package/dist/{repo-security-plan-AT7LOXLG.js.map → repo-security-plan-7QYZJCGT.js.map} +0 -0
  119. /package/dist/{research-helpers-synthesize-R722YWRS.js.map → research-helpers-synthesize-TSIH4U7M.js.map} +0 -0
  120. /package/dist/{routing-memory-4FXQT5H6.js.map → routing-memory-PHOZF4L2.js.map} +0 -0
  121. /package/dist/{session-memory-ZQJ6AUSQ.js.map → session-memory-T5NHGNC5.js.map} +0 -0
  122. /package/dist/{setup-command-IYBRT734.js.map → setup-command-MJP66PED.js.map} +0 -0
  123. /package/dist/{setup-config-MYLZ2UHR.js.map → setup-config-2GJZNH7Z.js.map} +0 -0
  124. /package/dist/{setup-custom-api-WZPLTGRQ.js.map → setup-custom-api-F6FEC2HD.js.map} +0 -0
  125. /package/dist/{tool-memory-5REJXBCB.js.map → tool-memory-UIWAECRB.js.map} +0 -0
  126. /package/dist/{unified-registry-FM3QB2VN.js.map → unified-registry-J7NOHQ44.js.map} +0 -0
  127. /package/dist/{weather-report-Y2GYJA6I.js.map → weather-report-DQANKBJK.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  getErrorMessage,
5
5
  getTimeProvider,
6
6
  ok
7
- } from "./chunk-CNHPSIHY.js";
7
+ } from "./chunk-2UH5MVYS.js";
8
8
 
9
9
  // src/context/session-memory.ts
10
10
  import * as fs from "fs";
@@ -352,4 +352,4 @@ export {
352
352
  SessionMemory,
353
353
  createSessionMemory
354
354
  };
355
- //# sourceMappingURL=chunk-U5CV76ZW.js.map
355
+ //# sourceMappingURL=chunk-UTWNUG3M.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readOpenAICompatEnv
3
- } from "./chunk-WT4BJODZ.js";
3
+ } from "./chunk-LYDBCTT4.js";
4
4
  import {
5
5
  resolveInsideRoot
6
6
  } from "./chunk-NUBSJGQZ.js";
@@ -10,10 +10,10 @@ import {
10
10
  import {
11
11
  createAllAdapters,
12
12
  probeCli
13
- } from "./chunk-N3XDPW64.js";
13
+ } from "./chunk-ZQGTPRIM.js";
14
14
  import {
15
15
  DEFAULTS
16
- } from "./chunk-WMV2CXBB.js";
16
+ } from "./chunk-KVQD7Z3R.js";
17
17
  import {
18
18
  CliNameSchema,
19
19
  DEFAULT_CAPABILITIES,
@@ -30,7 +30,7 @@ import {
30
30
  ok,
31
31
  symbols,
32
32
  writeLine
33
- } from "./chunk-CNHPSIHY.js";
33
+ } from "./chunk-2UH5MVYS.js";
34
34
  import {
35
35
  getLearningDir,
36
36
  getOutcomesFile,
@@ -46,7 +46,7 @@ import {
46
46
  } from "./chunk-OQLFRJCW.js";
47
47
 
48
48
  // src/version.ts
49
- var VERSION = true ? "2.176.2" : "dev";
49
+ var VERSION = true ? "2.178.0" : "dev";
50
50
 
51
51
  // src/config/schemas-core.ts
52
52
  import { z } from "zod";
@@ -2188,7 +2188,7 @@ async function runDoctorFix(result) {
2188
2188
  writeLine2("\u2500".repeat(40));
2189
2189
  let fixCount = 0;
2190
2190
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
2191
- const { runSetup } = await import("./setup-command-IYBRT734.js");
2191
+ const { runSetup } = await import("./setup-command-MJP66PED.js");
2192
2192
  const setupResult = runSetup({
2193
2193
  skipMcp: true,
2194
2194
  skipRules: true,
@@ -2202,7 +2202,7 @@ async function runDoctorFix(result) {
2202
2202
  }
2203
2203
  }
2204
2204
  if (!result.configFile.found) {
2205
- const { runConfigInitSync } = await import("./setup-config-MYLZ2UHR.js");
2205
+ const { runConfigInitSync } = await import("./setup-config-2GJZNH7Z.js");
2206
2206
  const configResult = runConfigInitSync(process.cwd(), false, false);
2207
2207
  if (configResult.success && configResult.created) {
2208
2208
  writeLine2(`\u2713 Generated config: ${configResult.path}`);
@@ -2301,4 +2301,4 @@ export {
2301
2301
  startStdioServer,
2302
2302
  closeServer
2303
2303
  };
2304
- //# sourceMappingURL=chunk-LGBCHTC6.js.map
2304
+ //# sourceMappingURL=chunk-VDYFOQXY.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getRandomProvider,
3
3
  getTimeProvider
4
- } from "./chunk-CNHPSIHY.js";
4
+ } from "./chunk-2UH5MVYS.js";
5
5
 
6
6
  // src/utils/id-utils.ts
7
7
  import { randomUUID } from "crypto";
@@ -24,4 +24,4 @@ export {
24
24
  generateHyphenId,
25
25
  generateUUID
26
26
  };
27
- //# sourceMappingURL=chunk-YB4QE7MD.js.map
27
+ //# sourceMappingURL=chunk-VWKOCFOQ.js.map
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  resolveToken
3
- } from "./chunk-JRKF4FYO.js";
3
+ } from "./chunk-47UPLZWW.js";
4
4
  import {
5
5
  REGISTRY_PATH,
6
6
  getProjectRoot,
7
7
  loadPapersRegistry,
8
8
  loadTechniquesRegistry,
9
9
  savePapersRegistry
10
- } from "./chunk-46XEDJRB.js";
10
+ } from "./chunk-E7BIMTCD.js";
11
11
  import {
12
12
  resolveInsideRoot
13
13
  } from "./chunk-NUBSJGQZ.js";
14
14
  import {
15
15
  getToolMemory
16
- } from "./chunk-NQU4LNN7.js";
16
+ } from "./chunk-H2PV2ZOM.js";
17
17
  import {
18
18
  capitalizeWords,
19
19
  truncateSentence
@@ -38,7 +38,7 @@ import {
38
38
  getTimeProvider,
39
39
  ok,
40
40
  registerPersistentDistillerFactory
41
- } from "./chunk-CNHPSIHY.js";
41
+ } from "./chunk-2UH5MVYS.js";
42
42
  import {
43
43
  ensureLearningDir,
44
44
  getRulesFile
@@ -4090,4 +4090,4 @@ export {
4090
4090
  DEFAULT_CONTEXT_BUDGET_TOKENS,
4091
4091
  getContextPromptPrefix
4092
4092
  };
4093
- //# sourceMappingURL=chunk-CGD63GSC.js.map
4093
+ //# sourceMappingURL=chunk-XXTMXJWZ.js.map
@@ -8,7 +8,7 @@ import {
8
8
  getTimeProvider,
9
9
  isRateLimitText,
10
10
  ok
11
- } from "./chunk-CNHPSIHY.js";
11
+ } from "./chunk-2UH5MVYS.js";
12
12
 
13
13
  // src/cli-adapters/circuit-breaker-types.ts
14
14
  var CircuitErrorCode = {
@@ -540,4 +540,4 @@ export {
540
540
  CliCircuitBreakerIntegration,
541
541
  createCliCircuitBreakerIntegration
542
542
  };
543
- //# sourceMappingURL=chunk-5ALUADB6.js.map
543
+ //# sourceMappingURL=chunk-ZH5B2BIL.js.map
@@ -5,34 +5,34 @@ import {
5
5
  planOptionalParams,
6
6
  requireApiKey,
7
7
  validateApiKeyPresence
8
- } from "./chunk-QI5U2YUL.js";
8
+ } from "./chunk-CCOPA2YX.js";
9
9
  import {
10
10
  CUSTOM_API_DEFAULT_MODEL
11
- } from "./chunk-WMV2CXBB.js";
11
+ } from "./chunk-KVQD7Z3R.js";
12
12
  import {
13
13
  CUSTOM_API_BASE_URL_ENV,
14
14
  PROVIDER_ENV_KEYS,
15
15
  assertCustomApiHostResolvesPublic,
16
16
  validateCustomApiBaseUrl
17
- } from "./chunk-ECBV4JNL.js";
17
+ } from "./chunk-RTGLOWR6.js";
18
18
  import {
19
19
  nexusMkdtempSync
20
20
  } from "./chunk-YAF73ZMR.js";
21
21
  import {
22
22
  getAvailabilityCache
23
- } from "./chunk-J55NMZ7R.js";
23
+ } from "./chunk-4AF6VYQ7.js";
24
24
  import {
25
25
  extractSystemPrompt
26
26
  } from "./chunk-QZUG667L.js";
27
27
  import {
28
28
  generateHyphenId
29
- } from "./chunk-YB4QE7MD.js";
29
+ } from "./chunk-VWKOCFOQ.js";
30
30
  import {
31
31
  CliCircuitBreaker,
32
32
  DEFAULT_CIRCUIT_BREAKER_CONFIG,
33
33
  getCliCircuitBreakerSnapshot,
34
34
  getDefaultCliCircuitBreakerRegistry
35
- } from "./chunk-5ALUADB6.js";
35
+ } from "./chunk-ZH5B2BIL.js";
36
36
  import {
37
37
  CLI_SUBPROCESS_TIMEOUTS,
38
38
  CLI_TIMEOUTS,
@@ -69,7 +69,7 @@ import {
69
69
  ok,
70
70
  parseRetryAfterMs,
71
71
  resolveCliAlias
72
- } from "./chunk-CNHPSIHY.js";
72
+ } from "./chunk-2UH5MVYS.js";
73
73
 
74
74
  // src/cli-adapters/cli-to-model-adapter.ts
75
75
  var CliToModelAdapter = class {
@@ -122,13 +122,23 @@ var CliToModelAdapter = class {
122
122
  * Converts CliResponse to CompletionResponse.
123
123
  */
124
124
  toCompletionResponse(response) {
125
+ const u = response.usage;
125
126
  return {
126
127
  content: [{ type: "text", text: response.text }],
127
- usage: {
128
- inputTokens: response.usage?.inputTokens ?? 0,
129
- outputTokens: response.usage?.outputTokens ?? 0,
130
- totalTokens: response.usage?.totalTokens ?? 0
131
- },
128
+ // #4439: this used to be `response.usage?.x ?? 0`, which turned "the CLI
129
+ // reported nothing" into a present 0/0/0 — indistinguishable downstream
130
+ // from a real zero-token call. That single coercion defeated the
131
+ // measured-voter gate (#4436) on every live vote and dropped the cache
132
+ // fields (#4438) that #4435 needs. Absence stays absent.
133
+ ...u !== void 0 ? {
134
+ usage: {
135
+ inputTokens: u.inputTokens,
136
+ outputTokens: u.outputTokens,
137
+ totalTokens: u.totalTokens ?? u.inputTokens + u.outputTokens,
138
+ ...u.cachedInputTokens !== void 0 ? { cachedInputTokens: u.cachedInputTokens } : {},
139
+ ...u.cacheCreationInputTokens !== void 0 ? { cacheCreationInputTokens: u.cacheCreationInputTokens } : {}
140
+ }
141
+ } : {},
132
142
  stopReason: "end_turn",
133
143
  model: response.model ?? this.modelId
134
144
  };
@@ -176,7 +186,9 @@ var CliToModelAdapter = class {
176
186
  yield {
177
187
  type: "message_delta",
178
188
  delta: { stop_reason: response.stopReason },
179
- usage: response.usage
189
+ // exactOptionalPropertyTypes: omit the key entirely when unknown rather
190
+ // than passing an explicit undefined (#4439).
191
+ ...response.usage !== void 0 ? { usage: response.usage } : {}
180
192
  };
181
193
  yield { type: "message_stop" };
182
194
  }
@@ -251,13 +263,20 @@ var ModelToCliAdapter = class {
251
263
  }
252
264
  /** Convert a CompletionResponse to a CliResponse. */
253
265
  toCliResponse(response) {
266
+ const usage = response.usage;
254
267
  return {
255
268
  text: this.toText(response),
256
- usage: {
257
- inputTokens: response.usage.inputTokens,
258
- outputTokens: response.usage.outputTokens,
259
- totalTokens: response.usage.totalTokens
260
- },
269
+ // Omit rather than zero-fill (#4439): a synthesised 0/0/0 is
270
+ // indistinguishable from a real zero-token call downstream.
271
+ ...usage !== void 0 ? {
272
+ usage: {
273
+ inputTokens: usage.inputTokens,
274
+ outputTokens: usage.outputTokens,
275
+ totalTokens: usage.totalTokens,
276
+ ...usage.cachedInputTokens !== void 0 ? { cachedInputTokens: usage.cachedInputTokens } : {},
277
+ ...usage.cacheCreationInputTokens !== void 0 ? { cacheCreationInputTokens: usage.cacheCreationInputTokens } : {}
278
+ }
279
+ } : {},
261
280
  model: response.model
262
281
  };
263
282
  }
@@ -2894,11 +2913,19 @@ var ClaudeResponseParser = class {
2894
2913
  return null;
2895
2914
  }
2896
2915
  const cachedInputTokens = extractNumberField(usageRecord, "cache_read_input_tokens");
2916
+ const cacheCreationInputTokens = extractNumberField(
2917
+ usageRecord,
2918
+ "cache_creation_input_tokens"
2919
+ );
2897
2920
  return {
2898
2921
  inputTokens,
2899
2922
  outputTokens,
2923
+ // NOTE: still uncached input + output. Folding the cache figures in
2924
+ // here is a semantics change for every consumer of totalTokens and
2925
+ // belongs with the threading increment on #4435, not this extraction.
2900
2926
  totalTokens: inputTokens + outputTokens,
2901
- ...cachedInputTokens !== null && { cachedInputTokens }
2927
+ ...cachedInputTokens !== null && { cachedInputTokens },
2928
+ ...cacheCreationInputTokens !== null && { cacheCreationInputTokens }
2902
2929
  };
2903
2930
  } catch {
2904
2931
  logger.debug("Skipped malformed output line", { snippet: raw.slice(0, 100) });
@@ -4198,39 +4225,6 @@ var OpenCodeResponseParser = class {
4198
4225
  }
4199
4226
  };
4200
4227
 
4201
- // src/config/resolve-live-model.ts
4202
- function splitTier(id) {
4203
- const colon = id.indexOf(":");
4204
- return colon >= 0 ? { base: id.slice(0, colon), tier: id.slice(colon) } : { base: id, tier: "" };
4205
- }
4206
- function isTokenBoundaryPrefix(prefix, full) {
4207
- if (prefix.length > full.length || !full.startsWith(prefix)) return false;
4208
- if (full.length === prefix.length) return true;
4209
- const next = full[prefix.length];
4210
- return next === "-" || next === "/";
4211
- }
4212
- function resolveLiveModelId(configured, available) {
4213
- const set = available instanceof Set ? available : new Set(available);
4214
- if (set.size === 0 || set.has(configured)) return configured;
4215
- const slash = configured.indexOf("/");
4216
- const providerPrefix = slash > 0 ? configured.slice(0, slash + 1) : "";
4217
- const cfg = splitTier(configured);
4218
- const candidates = [...set].filter((c) => providerPrefix === "" || c.startsWith(providerPrefix)).map((c) => splitTier(c)).filter((cand) => isTokenBoundaryPrefix(cand.base, cfg.base)).map((cand) => ({
4219
- id: cand.base + cand.tier,
4220
- baseLen: cand.base.length,
4221
- tierMatch: cand.tier === cfg.tier
4222
- }));
4223
- if (candidates.length === 0) return configured;
4224
- candidates.sort(
4225
- (a, b) => b.baseLen - a.baseLen || // most-specific simplification (closest to configured)
4226
- Number(b.tierMatch) - Number(a.tierMatch) || // matching :free / paid tier
4227
- a.id.length - b.id.length || // shorter overall
4228
- (a.id < b.id ? -1 : a.id > b.id ? 1 : 0)
4229
- // lexicographic — fully deterministic
4230
- );
4231
- return candidates[0]?.id ?? configured;
4232
- }
4233
-
4234
4228
  // src/cli-adapters/adapters/opencode-adapter.ts
4235
4229
  var logger5 = createLogger({ component: "opencode-adapter" });
4236
4230
  var ALLOWED_VARIANTS = ["high", "max", "minimal"];
@@ -4342,18 +4336,7 @@ var OpenCodeCliAdapter = class extends SubprocessCliAdapter {
4342
4336
  /** Appends --model if the resolved model is usable (#1402, #3407, #3408). */
4343
4337
  appendModelArg(args, task) {
4344
4338
  const internalModel = task.model ?? this.model;
4345
- let cliModel = resolveOpenCodeModel(internalModel);
4346
- if (!this.isModelUsable(cliModel) && isDynamicModelsEnabled() && this.availableModels !== void 0) {
4347
- const usable = new Set([...this.availableModels].filter((m) => !this.isCooled(m)));
4348
- const resolved = resolveLiveModelId(cliModel, usable);
4349
- if (resolved !== cliModel) {
4350
- logger5.debug("Resolved to live/non-cooled model (#3407/#3408)", {
4351
- from: cliModel,
4352
- to: resolved
4353
- });
4354
- cliModel = resolved;
4355
- }
4356
- }
4339
+ const cliModel = resolveOpenCodeModel(internalModel);
4357
4340
  if (this.isModelUsable(cliModel)) {
4358
4341
  args.push("--model", cliModel);
4359
4342
  } else {
@@ -4741,4 +4724,4 @@ export {
4741
4724
  SdkAdapter,
4742
4725
  createAutoAdapter
4743
4726
  };
4744
- //# sourceMappingURL=chunk-N3XDPW64.js.map
4727
+ //# sourceMappingURL=chunk-ZQGTPRIM.js.map