@alm-allen/dsh-multi-provider 0.0.0-stage → 0.90.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 (857) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/LICENSE +21 -0
  3. package/README.md +229 -2
  4. package/cordis.patch.yml +6 -0
  5. package/icon.svg +28 -0
  6. package/lib/client.js +25708 -0
  7. package/lib/client.js.map +1 -0
  8. package/lib/index.js +93587 -0
  9. package/lib/types/client/CodexComposerQuota.d.ts +13 -0
  10. package/lib/types/client/CodexComposerQuota.d.ts.map +1 -0
  11. package/lib/types/client/CodexSubscriptionSection.d.ts +42 -0
  12. package/lib/types/client/CodexSubscriptionSection.d.ts.map +1 -0
  13. package/lib/types/client/ProviderHubSection.d.ts +21 -0
  14. package/lib/types/client/ProviderHubSection.d.ts.map +1 -0
  15. package/lib/types/client/api.d.ts +66 -0
  16. package/lib/types/client/api.d.ts.map +1 -0
  17. package/lib/types/client/claude/ClaudeComposerQuota.d.ts +29 -0
  18. package/lib/types/client/claude/ClaudeComposerQuota.d.ts.map +1 -0
  19. package/lib/types/client/claude/ClaudeSection.d.ts +12 -0
  20. package/lib/types/client/claude/ClaudeSection.d.ts.map +1 -0
  21. package/lib/types/client/claude/locales.d.ts +489 -0
  22. package/lib/types/client/claude/locales.d.ts.map +1 -0
  23. package/lib/types/client/claude/styles.d.ts +15 -0
  24. package/lib/types/client/claude/styles.d.ts.map +1 -0
  25. package/lib/types/client/claude/useClaudeSection.d.ts +106 -0
  26. package/lib/types/client/claude/useClaudeSection.d.ts.map +1 -0
  27. package/lib/types/client/claude-api/ClaudeApiSection.d.ts +5 -0
  28. package/lib/types/client/claude-api/ClaudeApiSection.d.ts.map +1 -0
  29. package/lib/types/client/claude-api/api.d.ts +23 -0
  30. package/lib/types/client/claude-api/api.d.ts.map +1 -0
  31. package/lib/types/client/claude-api/locales.d.ts +161 -0
  32. package/lib/types/client/claude-api/locales.d.ts.map +1 -0
  33. package/lib/types/client/claude-api/styles.d.ts +4 -0
  34. package/lib/types/client/claude-api/styles.d.ts.map +1 -0
  35. package/lib/types/client/claude-api/useClaudeApiSection.d.ts +37 -0
  36. package/lib/types/client/claude-api/useClaudeApiSection.d.ts.map +1 -0
  37. package/lib/types/client/cline-pass/ClinePassComposerQuota.d.ts +23 -0
  38. package/lib/types/client/cline-pass/ClinePassComposerQuota.d.ts.map +1 -0
  39. package/lib/types/client/cline-pass/ClinePassSection.d.ts +17 -0
  40. package/lib/types/client/cline-pass/ClinePassSection.d.ts.map +1 -0
  41. package/lib/types/client/cline-pass/api.d.ts +85 -0
  42. package/lib/types/client/cline-pass/api.d.ts.map +1 -0
  43. package/lib/types/client/cline-pass/locales.d.ts +911 -0
  44. package/lib/types/client/cline-pass/locales.d.ts.map +1 -0
  45. package/lib/types/client/cline-pass/styles.d.ts +7 -0
  46. package/lib/types/client/cline-pass/styles.d.ts.map +1 -0
  47. package/lib/types/client/command-code/CommandCodeComposerQuota.d.ts +20 -0
  48. package/lib/types/client/command-code/CommandCodeComposerQuota.d.ts.map +1 -0
  49. package/lib/types/client/command-code/CommandCodeSection.d.ts +8 -0
  50. package/lib/types/client/command-code/CommandCodeSection.d.ts.map +1 -0
  51. package/lib/types/client/command-code/locales.d.ts +305 -0
  52. package/lib/types/client/command-code/locales.d.ts.map +1 -0
  53. package/lib/types/client/common/AccountPoolSection.d.ts +104 -0
  54. package/lib/types/client/common/AccountPoolSection.d.ts.map +1 -0
  55. package/lib/types/client/common/ComposerQuotaBadge.d.ts +63 -0
  56. package/lib/types/client/common/ComposerQuotaBadge.d.ts.map +1 -0
  57. package/lib/types/client/common/ContextWindowEditor.d.ts +71 -0
  58. package/lib/types/client/common/ContextWindowEditor.d.ts.map +1 -0
  59. package/lib/types/client/common/LineProxySection.d.ts +78 -0
  60. package/lib/types/client/common/LineProxySection.d.ts.map +1 -0
  61. package/lib/types/client/common/ModelChecklist.d.ts +29 -0
  62. package/lib/types/client/common/ModelChecklist.d.ts.map +1 -0
  63. package/lib/types/client/common/account-pool-labels.d.ts +74 -0
  64. package/lib/types/client/common/account-pool-labels.d.ts.map +1 -0
  65. package/lib/types/client/common/account-quota.d.ts +60 -0
  66. package/lib/types/client/common/account-quota.d.ts.map +1 -0
  67. package/lib/types/client/common/format.d.ts +70 -0
  68. package/lib/types/client/common/format.d.ts.map +1 -0
  69. package/lib/types/client/common/host-locale-mirror.d.ts +24 -0
  70. package/lib/types/client/common/host-locale-mirror.d.ts.map +1 -0
  71. package/lib/types/client/common/line-api.d.ts +8 -0
  72. package/lib/types/client/common/line-api.d.ts.map +1 -0
  73. package/lib/types/client/common/line-locale.d.ts +21 -0
  74. package/lib/types/client/common/line-locale.d.ts.map +1 -0
  75. package/lib/types/client/common/model-checklist-styles.d.ts +2 -0
  76. package/lib/types/client/common/model-checklist-styles.d.ts.map +1 -0
  77. package/lib/types/client/common/plugin-style.d.ts +23 -0
  78. package/lib/types/client/common/plugin-style.d.ts.map +1 -0
  79. package/lib/types/client/common/quota-follow-up.d.ts +30 -0
  80. package/lib/types/client/common/quota-follow-up.d.ts.map +1 -0
  81. package/lib/types/client/common/styles.d.ts +11 -0
  82. package/lib/types/client/common/styles.d.ts.map +1 -0
  83. package/lib/types/client/common/use-store.d.ts +3 -0
  84. package/lib/types/client/common/use-store.d.ts.map +1 -0
  85. package/lib/types/client/glm-coding-plan/GlmCodingPlanComposerQuota.d.ts +27 -0
  86. package/lib/types/client/glm-coding-plan/GlmCodingPlanComposerQuota.d.ts.map +1 -0
  87. package/lib/types/client/glm-coding-plan/GlmCodingPlanSection.d.ts +22 -0
  88. package/lib/types/client/glm-coding-plan/GlmCodingPlanSection.d.ts.map +1 -0
  89. package/lib/types/client/glm-coding-plan/api.d.ts +4 -0
  90. package/lib/types/client/glm-coding-plan/api.d.ts.map +1 -0
  91. package/lib/types/client/glm-coding-plan/locales.d.ts +409 -0
  92. package/lib/types/client/glm-coding-plan/locales.d.ts.map +1 -0
  93. package/lib/types/client/glm-coding-plan/styles.d.ts +16 -0
  94. package/lib/types/client/glm-coding-plan/styles.d.ts.map +1 -0
  95. package/lib/types/client/glm-coding-plan/useGlmCodingPlanSection.d.ts +65 -0
  96. package/lib/types/client/glm-coding-plan/useGlmCodingPlanSection.d.ts.map +1 -0
  97. package/lib/types/client/hub/HubOverview.d.ts +16 -0
  98. package/lib/types/client/hub/HubOverview.d.ts.map +1 -0
  99. package/lib/types/client/hub/brand-icons.d.ts +64 -0
  100. package/lib/types/client/hub/brand-icons.d.ts.map +1 -0
  101. package/lib/types/client/hub/brand-svg.d.ts +51 -0
  102. package/lib/types/client/hub/brand-svg.d.ts.map +1 -0
  103. package/lib/types/client/hub/hub-styles.d.ts +2 -0
  104. package/lib/types/client/hub/hub-styles.d.ts.map +1 -0
  105. package/lib/types/client/hub/providers.d.ts +55 -0
  106. package/lib/types/client/hub/providers.d.ts.map +1 -0
  107. package/lib/types/client/index.d.ts +67 -0
  108. package/lib/types/client/index.d.ts.map +1 -0
  109. package/lib/types/client/kimi-code/KimiCodeComposerQuota.d.ts +21 -0
  110. package/lib/types/client/kimi-code/KimiCodeComposerQuota.d.ts.map +1 -0
  111. package/lib/types/client/kimi-code/KimiCodeSection.d.ts +8 -0
  112. package/lib/types/client/kimi-code/KimiCodeSection.d.ts.map +1 -0
  113. package/lib/types/client/kimi-code/KimiModelCapabilities.d.ts +16 -0
  114. package/lib/types/client/kimi-code/KimiModelCapabilities.d.ts.map +1 -0
  115. package/lib/types/client/kimi-code/KimiQuotaCard.d.ts +31 -0
  116. package/lib/types/client/kimi-code/KimiQuotaCard.d.ts.map +1 -0
  117. package/lib/types/client/kimi-code/labels.d.ts +66 -0
  118. package/lib/types/client/kimi-code/labels.d.ts.map +1 -0
  119. package/lib/types/client/kimi-code/locales.d.ts +640 -0
  120. package/lib/types/client/kimi-code/locales.d.ts.map +1 -0
  121. package/lib/types/client/kimi-code/staff-art.d.ts +19 -0
  122. package/lib/types/client/kimi-code/staff-art.d.ts.map +1 -0
  123. package/lib/types/client/kimi-code/styles.d.ts +4 -0
  124. package/lib/types/client/kimi-code/styles.d.ts.map +1 -0
  125. package/lib/types/client/locales-ru/account-pool.d.ts +11 -0
  126. package/lib/types/client/locales-ru/account-pool.d.ts.map +1 -0
  127. package/lib/types/client/locales-ru/claude-api.d.ts +3 -0
  128. package/lib/types/client/locales-ru/claude-api.d.ts.map +1 -0
  129. package/lib/types/client/locales-ru/claude.d.ts +3 -0
  130. package/lib/types/client/locales-ru/claude.d.ts.map +1 -0
  131. package/lib/types/client/locales-ru/cline-pass.d.ts +11 -0
  132. package/lib/types/client/locales-ru/cline-pass.d.ts.map +1 -0
  133. package/lib/types/client/locales-ru/command-code.d.ts +9 -0
  134. package/lib/types/client/locales-ru/command-code.d.ts.map +1 -0
  135. package/lib/types/client/locales-ru/glm-coding-plan.d.ts +10 -0
  136. package/lib/types/client/locales-ru/glm-coding-plan.d.ts.map +1 -0
  137. package/lib/types/client/locales-ru/hub.d.ts +3 -0
  138. package/lib/types/client/locales-ru/hub.d.ts.map +1 -0
  139. package/lib/types/client/locales-ru/index.d.ts +26 -0
  140. package/lib/types/client/locales-ru/index.d.ts.map +1 -0
  141. package/lib/types/client/locales-ru/kimi-code.d.ts +10 -0
  142. package/lib/types/client/locales-ru/kimi-code.d.ts.map +1 -0
  143. package/lib/types/client/locales-ru/minimax-code.d.ts +9 -0
  144. package/lib/types/client/locales-ru/minimax-code.d.ts.map +1 -0
  145. package/lib/types/client/locales-ru/ollama.d.ts +10 -0
  146. package/lib/types/client/locales-ru/ollama.d.ts.map +1 -0
  147. package/lib/types/client/locales-ru/opencode-go.d.ts +3 -0
  148. package/lib/types/client/locales-ru/opencode-go.d.ts.map +1 -0
  149. package/lib/types/client/locales-ru/opendesign.d.ts +10 -0
  150. package/lib/types/client/locales-ru/opendesign.d.ts.map +1 -0
  151. package/lib/types/client/locales-ru/qianwen-token-plan.d.ts +3 -0
  152. package/lib/types/client/locales-ru/qianwen-token-plan.d.ts.map +1 -0
  153. package/lib/types/client/locales-ru/qoder.d.ts +11 -0
  154. package/lib/types/client/locales-ru/qoder.d.ts.map +1 -0
  155. package/lib/types/client/locales-ru/relayone.d.ts +3 -0
  156. package/lib/types/client/locales-ru/relayone.d.ts.map +1 -0
  157. package/lib/types/client/locales-ru/step-code.d.ts +9 -0
  158. package/lib/types/client/locales-ru/step-code.d.ts.map +1 -0
  159. package/lib/types/client/locales-ru/workbuddy.d.ts +10 -0
  160. package/lib/types/client/locales-ru/workbuddy.d.ts.map +1 -0
  161. package/lib/types/client/locales.d.ts +497 -0
  162. package/lib/types/client/locales.d.ts.map +1 -0
  163. package/lib/types/client/minimax-code/MinimaxCodeComposerQuota.d.ts +23 -0
  164. package/lib/types/client/minimax-code/MinimaxCodeComposerQuota.d.ts.map +1 -0
  165. package/lib/types/client/minimax-code/MinimaxCodeSection.d.ts +23 -0
  166. package/lib/types/client/minimax-code/MinimaxCodeSection.d.ts.map +1 -0
  167. package/lib/types/client/minimax-code/api.d.ts +35 -0
  168. package/lib/types/client/minimax-code/api.d.ts.map +1 -0
  169. package/lib/types/client/minimax-code/commands-contract.d.ts +46 -0
  170. package/lib/types/client/minimax-code/commands-contract.d.ts.map +1 -0
  171. package/lib/types/client/minimax-code/locales.d.ts +422 -0
  172. package/lib/types/client/minimax-code/locales.d.ts.map +1 -0
  173. package/lib/types/client/minimax-code/styles.d.ts +12 -0
  174. package/lib/types/client/minimax-code/styles.d.ts.map +1 -0
  175. package/lib/types/client/minimax-code/useMinimaxCodeSection.d.ts +164 -0
  176. package/lib/types/client/minimax-code/useMinimaxCodeSection.d.ts.map +1 -0
  177. package/lib/types/client/ollama/OllamaSection.d.ts +25 -0
  178. package/lib/types/client/ollama/OllamaSection.d.ts.map +1 -0
  179. package/lib/types/client/ollama/api.d.ts +49 -0
  180. package/lib/types/client/ollama/api.d.ts.map +1 -0
  181. package/lib/types/client/ollama/locales.d.ts +479 -0
  182. package/lib/types/client/ollama/locales.d.ts.map +1 -0
  183. package/lib/types/client/opencode-go/OpenCodeGoQuotaCard.d.ts +20 -0
  184. package/lib/types/client/opencode-go/OpenCodeGoQuotaCard.d.ts.map +1 -0
  185. package/lib/types/client/opencode-go/OpenCodeGoSection.d.ts +8 -0
  186. package/lib/types/client/opencode-go/OpenCodeGoSection.d.ts.map +1 -0
  187. package/lib/types/client/opencode-go/locales.d.ts +210 -0
  188. package/lib/types/client/opencode-go/locales.d.ts.map +1 -0
  189. package/lib/types/client/opencode-go/styles.d.ts +10 -0
  190. package/lib/types/client/opencode-go/styles.d.ts.map +1 -0
  191. package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts +26 -0
  192. package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts.map +1 -0
  193. package/lib/types/client/opendesign/OpenDesignSection.d.ts +19 -0
  194. package/lib/types/client/opendesign/OpenDesignSection.d.ts.map +1 -0
  195. package/lib/types/client/opendesign/api.d.ts +45 -0
  196. package/lib/types/client/opendesign/api.d.ts.map +1 -0
  197. package/lib/types/client/opendesign/locales.d.ts +815 -0
  198. package/lib/types/client/opendesign/locales.d.ts.map +1 -0
  199. package/lib/types/client/opendesign/styles.d.ts +16 -0
  200. package/lib/types/client/opendesign/styles.d.ts.map +1 -0
  201. package/lib/types/client/qianwen-token-plan/QianwenComposerQuota.d.ts +14 -0
  202. package/lib/types/client/qianwen-token-plan/QianwenComposerQuota.d.ts.map +1 -0
  203. package/lib/types/client/qianwen-token-plan/QianwenTokenPlanSection.d.ts +4 -0
  204. package/lib/types/client/qianwen-token-plan/QianwenTokenPlanSection.d.ts.map +1 -0
  205. package/lib/types/client/qianwen-token-plan/api.d.ts +5 -0
  206. package/lib/types/client/qianwen-token-plan/api.d.ts.map +1 -0
  207. package/lib/types/client/qianwen-token-plan/locales.d.ts +158 -0
  208. package/lib/types/client/qianwen-token-plan/locales.d.ts.map +1 -0
  209. package/lib/types/client/qianwen-token-plan/styles.d.ts +3 -0
  210. package/lib/types/client/qianwen-token-plan/styles.d.ts.map +1 -0
  211. package/lib/types/client/qianwen-token-plan/useQianwenSection.d.ts +32 -0
  212. package/lib/types/client/qianwen-token-plan/useQianwenSection.d.ts.map +1 -0
  213. package/lib/types/client/qoder/QoderComposerQuota.d.ts +41 -0
  214. package/lib/types/client/qoder/QoderComposerQuota.d.ts.map +1 -0
  215. package/lib/types/client/qoder/QoderSection.d.ts +37 -0
  216. package/lib/types/client/qoder/QoderSection.d.ts.map +1 -0
  217. package/lib/types/client/qoder/api.d.ts +4 -0
  218. package/lib/types/client/qoder/api.d.ts.map +1 -0
  219. package/lib/types/client/qoder/locales.d.ts +322 -0
  220. package/lib/types/client/qoder/locales.d.ts.map +1 -0
  221. package/lib/types/client/qoder/styles.d.ts +16 -0
  222. package/lib/types/client/qoder/styles.d.ts.map +1 -0
  223. package/lib/types/client/qoder/useQoderSection.d.ts +97 -0
  224. package/lib/types/client/qoder/useQoderSection.d.ts.map +1 -0
  225. package/lib/types/client/quota.d.ts +9 -0
  226. package/lib/types/client/quota.d.ts.map +1 -0
  227. package/lib/types/client/relayone/RelayOneComposerQuota.d.ts +14 -0
  228. package/lib/types/client/relayone/RelayOneComposerQuota.d.ts.map +1 -0
  229. package/lib/types/client/relayone/RelayOneSection.d.ts +4 -0
  230. package/lib/types/client/relayone/RelayOneSection.d.ts.map +1 -0
  231. package/lib/types/client/relayone/api.d.ts +5 -0
  232. package/lib/types/client/relayone/api.d.ts.map +1 -0
  233. package/lib/types/client/relayone/locales.d.ts +221 -0
  234. package/lib/types/client/relayone/locales.d.ts.map +1 -0
  235. package/lib/types/client/relayone/quota-format.d.ts +6 -0
  236. package/lib/types/client/relayone/quota-format.d.ts.map +1 -0
  237. package/lib/types/client/relayone/styles.d.ts +3 -0
  238. package/lib/types/client/relayone/styles.d.ts.map +1 -0
  239. package/lib/types/client/relayone/useRelayOneSection.d.ts +32 -0
  240. package/lib/types/client/relayone/useRelayOneSection.d.ts.map +1 -0
  241. package/lib/types/client/step-code/StepCodeComposerQuota.d.ts +50 -0
  242. package/lib/types/client/step-code/StepCodeComposerQuota.d.ts.map +1 -0
  243. package/lib/types/client/step-code/StepCodeSection.d.ts +28 -0
  244. package/lib/types/client/step-code/StepCodeSection.d.ts.map +1 -0
  245. package/lib/types/client/step-code/api.d.ts +4 -0
  246. package/lib/types/client/step-code/api.d.ts.map +1 -0
  247. package/lib/types/client/step-code/locales.d.ts +657 -0
  248. package/lib/types/client/step-code/locales.d.ts.map +1 -0
  249. package/lib/types/client/step-code/styles.d.ts +28 -0
  250. package/lib/types/client/step-code/styles.d.ts.map +1 -0
  251. package/lib/types/client/step-code/useStepCodeSection.d.ts +122 -0
  252. package/lib/types/client/step-code/useStepCodeSection.d.ts.map +1 -0
  253. package/lib/types/client/store.d.ts +19 -0
  254. package/lib/types/client/store.d.ts.map +1 -0
  255. package/lib/types/client/styles.d.ts +26 -0
  256. package/lib/types/client/styles.d.ts.map +1 -0
  257. package/lib/types/client/workbuddy/WorkBuddyComposerQuota.d.ts +34 -0
  258. package/lib/types/client/workbuddy/WorkBuddyComposerQuota.d.ts.map +1 -0
  259. package/lib/types/client/workbuddy/WorkBuddySection.d.ts +91 -0
  260. package/lib/types/client/workbuddy/WorkBuddySection.d.ts.map +1 -0
  261. package/lib/types/client/workbuddy/locales.d.ts +768 -0
  262. package/lib/types/client/workbuddy/locales.d.ts.map +1 -0
  263. package/lib/types/client/workbuddy/styles.d.ts +21 -0
  264. package/lib/types/client/workbuddy/styles.d.ts.map +1 -0
  265. package/lib/types/client/workbuddy/useWorkBuddySection.d.ts +149 -0
  266. package/lib/types/client/workbuddy/useWorkBuddySection.d.ts.map +1 -0
  267. package/lib/types/compat.d.ts +139 -0
  268. package/lib/types/compat.d.ts.map +1 -0
  269. package/lib/types/host/adapter.d.ts +43 -0
  270. package/lib/types/host/adapter.d.ts.map +1 -0
  271. package/lib/types/host/callback-server.d.ts +22 -0
  272. package/lib/types/host/callback-server.d.ts.map +1 -0
  273. package/lib/types/host/claude/account-pool.d.ts +583 -0
  274. package/lib/types/host/claude/account-pool.d.ts.map +1 -0
  275. package/lib/types/host/claude/adapter.d.ts +424 -0
  276. package/lib/types/host/claude/adapter.d.ts.map +1 -0
  277. package/lib/types/host/claude/adopt.d.ts +292 -0
  278. package/lib/types/host/claude/adopt.d.ts.map +1 -0
  279. package/lib/types/host/claude/client.d.ts +579 -0
  280. package/lib/types/host/claude/client.d.ts.map +1 -0
  281. package/lib/types/host/claude/mapper.d.ts +802 -0
  282. package/lib/types/host/claude/mapper.d.ts.map +1 -0
  283. package/lib/types/host/claude/model-catalog.d.ts +560 -0
  284. package/lib/types/host/claude/model-catalog.d.ts.map +1 -0
  285. package/lib/types/host/claude/oauth.d.ts +419 -0
  286. package/lib/types/host/claude/oauth.d.ts.map +1 -0
  287. package/lib/types/host/claude/routes.d.ts +131 -0
  288. package/lib/types/host/claude/routes.d.ts.map +1 -0
  289. package/lib/types/host/claude/token-store.d.ts +347 -0
  290. package/lib/types/host/claude/token-store.d.ts.map +1 -0
  291. package/lib/types/host/claude/types.d.ts +417 -0
  292. package/lib/types/host/claude/types.d.ts.map +1 -0
  293. package/lib/types/host/claude-api/adapter.d.ts +70 -0
  294. package/lib/types/host/claude-api/adapter.d.ts.map +1 -0
  295. package/lib/types/host/claude-api/capability-memory.d.ts +4 -0
  296. package/lib/types/host/claude-api/capability-memory.d.ts.map +1 -0
  297. package/lib/types/host/claude-api/catalog-manager.d.ts +57 -0
  298. package/lib/types/host/claude-api/catalog-manager.d.ts.map +1 -0
  299. package/lib/types/host/claude-api/client-version.d.ts +4 -0
  300. package/lib/types/host/claude-api/client-version.d.ts.map +1 -0
  301. package/lib/types/host/claude-api/client.d.ts +55 -0
  302. package/lib/types/host/claude-api/client.d.ts.map +1 -0
  303. package/lib/types/host/claude-api/compaction-instruction.d.ts +23 -0
  304. package/lib/types/host/claude-api/compaction-instruction.d.ts.map +1 -0
  305. package/lib/types/host/claude-api/compaction-store.d.ts +62 -0
  306. package/lib/types/host/claude-api/compaction-store.d.ts.map +1 -0
  307. package/lib/types/host/claude-api/compaction.d.ts +47 -0
  308. package/lib/types/host/claude-api/compaction.d.ts.map +1 -0
  309. package/lib/types/host/claude-api/mapper.d.ts +61 -0
  310. package/lib/types/host/claude-api/mapper.d.ts.map +1 -0
  311. package/lib/types/host/claude-api/model-catalog.d.ts +76 -0
  312. package/lib/types/host/claude-api/model-catalog.d.ts.map +1 -0
  313. package/lib/types/host/claude-api/routes.d.ts +22 -0
  314. package/lib/types/host/claude-api/routes.d.ts.map +1 -0
  315. package/lib/types/host/claude-api/stream.d.ts +88 -0
  316. package/lib/types/host/claude-api/stream.d.ts.map +1 -0
  317. package/lib/types/host/claude-api/token-store.d.ts +60 -0
  318. package/lib/types/host/claude-api/token-store.d.ts.map +1 -0
  319. package/lib/types/host/claude-api/types.d.ts +68 -0
  320. package/lib/types/host/claude-api/types.d.ts.map +1 -0
  321. package/lib/types/host/cline-pass/account-pool.d.ts +63 -0
  322. package/lib/types/host/cline-pass/account-pool.d.ts.map +1 -0
  323. package/lib/types/host/cline-pass/adapter.d.ts +60 -0
  324. package/lib/types/host/cline-pass/adapter.d.ts.map +1 -0
  325. package/lib/types/host/cline-pass/catalog.d.ts +49 -0
  326. package/lib/types/host/cline-pass/catalog.d.ts.map +1 -0
  327. package/lib/types/host/cline-pass/client.d.ts +109 -0
  328. package/lib/types/host/cline-pass/client.d.ts.map +1 -0
  329. package/lib/types/host/cline-pass/engine.d.ts +93 -0
  330. package/lib/types/host/cline-pass/engine.d.ts.map +1 -0
  331. package/lib/types/host/cline-pass/line.d.ts +55 -0
  332. package/lib/types/host/cline-pass/line.d.ts.map +1 -0
  333. package/lib/types/host/cline-pass/mapper.d.ts +138 -0
  334. package/lib/types/host/cline-pass/mapper.d.ts.map +1 -0
  335. package/lib/types/host/cline-pass/oauth.d.ts +134 -0
  336. package/lib/types/host/cline-pass/oauth.d.ts.map +1 -0
  337. package/lib/types/host/cline-pass/protocol.d.ts +44 -0
  338. package/lib/types/host/cline-pass/protocol.d.ts.map +1 -0
  339. package/lib/types/host/cline-pass/routes.d.ts +92 -0
  340. package/lib/types/host/cline-pass/routes.d.ts.map +1 -0
  341. package/lib/types/host/cline-pass/store.d.ts +75 -0
  342. package/lib/types/host/cline-pass/store.d.ts.map +1 -0
  343. package/lib/types/host/cline-pass/token-store.d.ts +170 -0
  344. package/lib/types/host/cline-pass/token-store.d.ts.map +1 -0
  345. package/lib/types/host/cline-pass/tools.d.ts +21 -0
  346. package/lib/types/host/cline-pass/tools.d.ts.map +1 -0
  347. package/lib/types/host/cline-pass/types.d.ts +127 -0
  348. package/lib/types/host/cline-pass/types.d.ts.map +1 -0
  349. package/lib/types/host/codex-account-pool.d.ts +223 -0
  350. package/lib/types/host/codex-account-pool.d.ts.map +1 -0
  351. package/lib/types/host/codex-adopt.d.ts +255 -0
  352. package/lib/types/host/codex-adopt.d.ts.map +1 -0
  353. package/lib/types/host/codex-catalog.d.ts +69 -0
  354. package/lib/types/host/codex-catalog.d.ts.map +1 -0
  355. package/lib/types/host/codex-fetch.d.ts +17 -0
  356. package/lib/types/host/codex-fetch.d.ts.map +1 -0
  357. package/lib/types/host/codex-file-import.d.ts +35 -0
  358. package/lib/types/host/codex-file-import.d.ts.map +1 -0
  359. package/lib/types/host/codex-identity.d.ts +132 -0
  360. package/lib/types/host/codex-identity.d.ts.map +1 -0
  361. package/lib/types/host/codex-remote-compaction.d.ts +41 -0
  362. package/lib/types/host/codex-remote-compaction.d.ts.map +1 -0
  363. package/lib/types/host/codex-search.d.ts +11 -0
  364. package/lib/types/host/codex-search.d.ts.map +1 -0
  365. package/lib/types/host/command-code/account-pool.d.ts +72 -0
  366. package/lib/types/host/command-code/account-pool.d.ts.map +1 -0
  367. package/lib/types/host/command-code/adapter.d.ts +89 -0
  368. package/lib/types/host/command-code/adapter.d.ts.map +1 -0
  369. package/lib/types/host/command-code/client.d.ts +126 -0
  370. package/lib/types/host/command-code/client.d.ts.map +1 -0
  371. package/lib/types/host/command-code/mapper.d.ts +199 -0
  372. package/lib/types/host/command-code/mapper.d.ts.map +1 -0
  373. package/lib/types/host/command-code/model-catalog.d.ts +90 -0
  374. package/lib/types/host/command-code/model-catalog.d.ts.map +1 -0
  375. package/lib/types/host/command-code/oauth.d.ts +95 -0
  376. package/lib/types/host/command-code/oauth.d.ts.map +1 -0
  377. package/lib/types/host/command-code/plans.d.ts +40 -0
  378. package/lib/types/host/command-code/plans.d.ts.map +1 -0
  379. package/lib/types/host/command-code/routes.d.ts +44 -0
  380. package/lib/types/host/command-code/routes.d.ts.map +1 -0
  381. package/lib/types/host/command-code/token-store.d.ts +100 -0
  382. package/lib/types/host/command-code/token-store.d.ts.map +1 -0
  383. package/lib/types/host/command-code/types.d.ts +222 -0
  384. package/lib/types/host/command-code/types.d.ts.map +1 -0
  385. package/lib/types/host/common/account-pool.d.ts +584 -0
  386. package/lib/types/host/common/account-pool.d.ts.map +1 -0
  387. package/lib/types/host/common/account-quota.d.ts +44 -0
  388. package/lib/types/host/common/account-quota.d.ts.map +1 -0
  389. package/lib/types/host/common/brand-compat.d.ts +4 -0
  390. package/lib/types/host/common/brand-compat.d.ts.map +1 -0
  391. package/lib/types/host/common/cache-activity.d.ts +16 -0
  392. package/lib/types/host/common/cache-activity.d.ts.map +1 -0
  393. package/lib/types/host/common/cache-affinity.d.ts +23 -0
  394. package/lib/types/host/common/cache-affinity.d.ts.map +1 -0
  395. package/lib/types/host/common/cache-hint.d.ts +18 -0
  396. package/lib/types/host/common/cache-hint.d.ts.map +1 -0
  397. package/lib/types/host/common/capabilities.d.ts +100 -0
  398. package/lib/types/host/common/capabilities.d.ts.map +1 -0
  399. package/lib/types/host/common/catalog-snapshot.d.ts +80 -0
  400. package/lib/types/host/common/catalog-snapshot.d.ts.map +1 -0
  401. package/lib/types/host/common/claude-capability-memory.d.ts +51 -0
  402. package/lib/types/host/common/claude-capability-memory.d.ts.map +1 -0
  403. package/lib/types/host/common/claude-code-cch.d.ts +28 -0
  404. package/lib/types/host/common/claude-code-cch.d.ts.map +1 -0
  405. package/lib/types/host/common/claude-code-corrections.d.ts +6 -0
  406. package/lib/types/host/common/claude-code-corrections.d.ts.map +1 -0
  407. package/lib/types/host/common/claude-code-first-party.d.ts +68 -0
  408. package/lib/types/host/common/claude-code-first-party.d.ts.map +1 -0
  409. package/lib/types/host/common/claude-code-version.d.ts +90 -0
  410. package/lib/types/host/common/claude-code-version.d.ts.map +1 -0
  411. package/lib/types/host/common/concurrency-gate.d.ts +46 -0
  412. package/lib/types/host/common/concurrency-gate.d.ts.map +1 -0
  413. package/lib/types/host/common/context-budget-fetch.d.ts +7 -0
  414. package/lib/types/host/common/context-budget-fetch.d.ts.map +1 -0
  415. package/lib/types/host/common/context-overflow.d.ts +7 -0
  416. package/lib/types/host/common/context-overflow.d.ts.map +1 -0
  417. package/lib/types/host/common/context-window-overrides.d.ts +12 -0
  418. package/lib/types/host/common/context-window-overrides.d.ts.map +1 -0
  419. package/lib/types/host/common/credential-read-cache.d.ts +82 -0
  420. package/lib/types/host/common/credential-read-cache.d.ts.map +1 -0
  421. package/lib/types/host/common/credentials-compat.d.ts +73 -0
  422. package/lib/types/host/common/credentials-compat.d.ts.map +1 -0
  423. package/lib/types/host/common/failure-classification.d.ts +21 -0
  424. package/lib/types/host/common/failure-classification.d.ts.map +1 -0
  425. package/lib/types/host/common/file-preferences.d.ts +49 -0
  426. package/lib/types/host/common/file-preferences.d.ts.map +1 -0
  427. package/lib/types/host/common/gpt-engineering-guidance.d.ts +16 -0
  428. package/lib/types/host/common/gpt-engineering-guidance.d.ts.map +1 -0
  429. package/lib/types/host/common/home.d.ts +8 -0
  430. package/lib/types/host/common/home.d.ts.map +1 -0
  431. package/lib/types/host/common/hosted-media.d.ts +36 -0
  432. package/lib/types/host/common/hosted-media.d.ts.map +1 -0
  433. package/lib/types/host/common/i18n/en.d.ts +9 -0
  434. package/lib/types/host/common/i18n/en.d.ts.map +1 -0
  435. package/lib/types/host/common/i18n/index.d.ts +13 -0
  436. package/lib/types/host/common/i18n/index.d.ts.map +1 -0
  437. package/lib/types/host/common/i18n/provider-name.d.ts +10 -0
  438. package/lib/types/host/common/i18n/provider-name.d.ts.map +1 -0
  439. package/lib/types/host/common/i18n/ru.d.ts +10 -0
  440. package/lib/types/host/common/i18n/ru.d.ts.map +1 -0
  441. package/lib/types/host/common/i18n/runtime.d.ts +54 -0
  442. package/lib/types/host/common/i18n/runtime.d.ts.map +1 -0
  443. package/lib/types/host/common/i18n/t.d.ts +38 -0
  444. package/lib/types/host/common/i18n/t.d.ts.map +1 -0
  445. package/lib/types/host/common/i18n/zh.d.ts +172 -0
  446. package/lib/types/host/common/i18n/zh.d.ts.map +1 -0
  447. package/lib/types/host/common/idle-watchdog.d.ts +58 -0
  448. package/lib/types/host/common/idle-watchdog.d.ts.map +1 -0
  449. package/lib/types/host/common/legacy-preferences.d.ts +29 -0
  450. package/lib/types/host/common/legacy-preferences.d.ts.map +1 -0
  451. package/lib/types/host/common/llm-compat.d.ts +157 -0
  452. package/lib/types/host/common/llm-compat.d.ts.map +1 -0
  453. package/lib/types/host/common/model-request-control.d.ts +21 -0
  454. package/lib/types/host/common/model-request-control.d.ts.map +1 -0
  455. package/lib/types/host/common/orphan-tool-calls.d.ts +47 -0
  456. package/lib/types/host/common/orphan-tool-calls.d.ts.map +1 -0
  457. package/lib/types/host/common/output-reservation.d.ts +11 -0
  458. package/lib/types/host/common/output-reservation.d.ts.map +1 -0
  459. package/lib/types/host/common/pool-storage-settings.d.ts +41 -0
  460. package/lib/types/host/common/pool-storage-settings.d.ts.map +1 -0
  461. package/lib/types/host/common/pool-storage.d.ts +143 -0
  462. package/lib/types/host/common/pool-storage.d.ts.map +1 -0
  463. package/lib/types/host/common/prefix-request-coordinator.d.ts +46 -0
  464. package/lib/types/host/common/prefix-request-coordinator.d.ts.map +1 -0
  465. package/lib/types/host/common/prefix-stability.d.ts +24 -0
  466. package/lib/types/host/common/prefix-stability.d.ts.map +1 -0
  467. package/lib/types/host/common/prompt-cache-policy.d.ts +47 -0
  468. package/lib/types/host/common/prompt-cache-policy.d.ts.map +1 -0
  469. package/lib/types/host/common/prompt-estimate.d.ts +22 -0
  470. package/lib/types/host/common/prompt-estimate.d.ts.map +1 -0
  471. package/lib/types/host/common/provider-route.d.ts +56 -0
  472. package/lib/types/host/common/provider-route.d.ts.map +1 -0
  473. package/lib/types/host/common/quota-refresh.d.ts +35 -0
  474. package/lib/types/host/common/quota-refresh.d.ts.map +1 -0
  475. package/lib/types/host/common/reasoning-dialect.d.ts +24 -0
  476. package/lib/types/host/common/reasoning-dialect.d.ts.map +1 -0
  477. package/lib/types/host/common/reasoning-efforts.d.ts +2 -0
  478. package/lib/types/host/common/reasoning-efforts.d.ts.map +1 -0
  479. package/lib/types/host/common/request-diagnostics.d.ts +79 -0
  480. package/lib/types/host/common/request-diagnostics.d.ts.map +1 -0
  481. package/lib/types/host/common/request-images.d.ts +275 -0
  482. package/lib/types/host/common/request-images.d.ts.map +1 -0
  483. package/lib/types/host/common/same-origin.d.ts +30 -0
  484. package/lib/types/host/common/same-origin.d.ts.map +1 -0
  485. package/lib/types/host/common/session-cache-state.d.ts +29 -0
  486. package/lib/types/host/common/session-cache-state.d.ts.map +1 -0
  487. package/lib/types/host/common/session-effort-memory.d.ts +35 -0
  488. package/lib/types/host/common/session-effort-memory.d.ts.map +1 -0
  489. package/lib/types/host/common/settings-compat.d.ts +55 -0
  490. package/lib/types/host/common/settings-compat.d.ts.map +1 -0
  491. package/lib/types/host/common/sticky-image-budget.d.ts +10 -0
  492. package/lib/types/host/common/sticky-image-budget.d.ts.map +1 -0
  493. package/lib/types/host/common/stream-error.d.ts +93 -0
  494. package/lib/types/host/common/stream-error.d.ts.map +1 -0
  495. package/lib/types/host/common/tool-schema.d.ts +27 -0
  496. package/lib/types/host/common/tool-schema.d.ts.map +1 -0
  497. package/lib/types/host/common/video-request.d.ts +81 -0
  498. package/lib/types/host/common/video-request.d.ts.map +1 -0
  499. package/lib/types/host/common/video.d.ts +90 -0
  500. package/lib/types/host/common/video.d.ts.map +1 -0
  501. package/lib/types/host/common/webserver-compat.d.ts +7 -0
  502. package/lib/types/host/common/webserver-compat.d.ts.map +1 -0
  503. package/lib/types/host/credential-store-secret-service.d.ts +66 -0
  504. package/lib/types/host/credential-store-secret-service.d.ts.map +1 -0
  505. package/lib/types/host/fetch-address-policy.d.ts +79 -0
  506. package/lib/types/host/fetch-address-policy.d.ts.map +1 -0
  507. package/lib/types/host/fetch-configuration.d.ts +6 -0
  508. package/lib/types/host/fetch-configuration.d.ts.map +1 -0
  509. package/lib/types/host/glm-coding-plan/account-pool.d.ts +152 -0
  510. package/lib/types/host/glm-coding-plan/account-pool.d.ts.map +1 -0
  511. package/lib/types/host/glm-coding-plan/adapter.d.ts +169 -0
  512. package/lib/types/host/glm-coding-plan/adapter.d.ts.map +1 -0
  513. package/lib/types/host/glm-coding-plan/adopt.d.ts +354 -0
  514. package/lib/types/host/glm-coding-plan/adopt.d.ts.map +1 -0
  515. package/lib/types/host/glm-coding-plan/biz-token-cache.d.ts +99 -0
  516. package/lib/types/host/glm-coding-plan/biz-token-cache.d.ts.map +1 -0
  517. package/lib/types/host/glm-coding-plan/client.d.ts +218 -0
  518. package/lib/types/host/glm-coding-plan/client.d.ts.map +1 -0
  519. package/lib/types/host/glm-coding-plan/exchange.d.ts +223 -0
  520. package/lib/types/host/glm-coding-plan/exchange.d.ts.map +1 -0
  521. package/lib/types/host/glm-coding-plan/mapper-anthropic.d.ts +312 -0
  522. package/lib/types/host/glm-coding-plan/mapper-anthropic.d.ts.map +1 -0
  523. package/lib/types/host/glm-coding-plan/mapper-openai.d.ts +213 -0
  524. package/lib/types/host/glm-coding-plan/mapper-openai.d.ts.map +1 -0
  525. package/lib/types/host/glm-coding-plan/model-catalog.d.ts +241 -0
  526. package/lib/types/host/glm-coding-plan/model-catalog.d.ts.map +1 -0
  527. package/lib/types/host/glm-coding-plan/oauth.d.ts +211 -0
  528. package/lib/types/host/glm-coding-plan/oauth.d.ts.map +1 -0
  529. package/lib/types/host/glm-coding-plan/routes.d.ts +93 -0
  530. package/lib/types/host/glm-coding-plan/routes.d.ts.map +1 -0
  531. package/lib/types/host/glm-coding-plan/token-store.d.ts +202 -0
  532. package/lib/types/host/glm-coding-plan/token-store.d.ts.map +1 -0
  533. package/lib/types/host/glm-coding-plan/types.d.ts +492 -0
  534. package/lib/types/host/glm-coding-plan/types.d.ts.map +1 -0
  535. package/lib/types/host/hub-overview.d.ts +32 -0
  536. package/lib/types/host/hub-overview.d.ts.map +1 -0
  537. package/lib/types/host/kimi-code/account-pool.d.ts +124 -0
  538. package/lib/types/host/kimi-code/account-pool.d.ts.map +1 -0
  539. package/lib/types/host/kimi-code/adapter.d.ts +451 -0
  540. package/lib/types/host/kimi-code/adapter.d.ts.map +1 -0
  541. package/lib/types/host/kimi-code/api-key.d.ts +55 -0
  542. package/lib/types/host/kimi-code/api-key.d.ts.map +1 -0
  543. package/lib/types/host/kimi-code/cache-affinity.d.ts +112 -0
  544. package/lib/types/host/kimi-code/cache-affinity.d.ts.map +1 -0
  545. package/lib/types/host/kimi-code/cache-hint.d.ts +65 -0
  546. package/lib/types/host/kimi-code/cache-hint.d.ts.map +1 -0
  547. package/lib/types/host/kimi-code/client.d.ts +306 -0
  548. package/lib/types/host/kimi-code/client.d.ts.map +1 -0
  549. package/lib/types/host/kimi-code/mapper.d.ts +913 -0
  550. package/lib/types/host/kimi-code/mapper.d.ts.map +1 -0
  551. package/lib/types/host/kimi-code/media-files.d.ts +206 -0
  552. package/lib/types/host/kimi-code/media-files.d.ts.map +1 -0
  553. package/lib/types/host/kimi-code/modalities.d.ts +23 -0
  554. package/lib/types/host/kimi-code/modalities.d.ts.map +1 -0
  555. package/lib/types/host/kimi-code/model-catalog.d.ts +125 -0
  556. package/lib/types/host/kimi-code/model-catalog.d.ts.map +1 -0
  557. package/lib/types/host/kimi-code/oauth.d.ts +213 -0
  558. package/lib/types/host/kimi-code/oauth.d.ts.map +1 -0
  559. package/lib/types/host/kimi-code/routes.d.ts +52 -0
  560. package/lib/types/host/kimi-code/routes.d.ts.map +1 -0
  561. package/lib/types/host/kimi-code/session-cache-state.d.ts +156 -0
  562. package/lib/types/host/kimi-code/session-cache-state.d.ts.map +1 -0
  563. package/lib/types/host/kimi-code/token-store.d.ts +182 -0
  564. package/lib/types/host/kimi-code/token-store.d.ts.map +1 -0
  565. package/lib/types/host/kimi-code/tool-argument-guard.d.ts +43 -0
  566. package/lib/types/host/kimi-code/tool-argument-guard.d.ts.map +1 -0
  567. package/lib/types/host/kimi-code/types.d.ts +458 -0
  568. package/lib/types/host/kimi-code/types.d.ts.map +1 -0
  569. package/lib/types/host/kimi-code/warmup-streak.d.ts +66 -0
  570. package/lib/types/host/kimi-code/warmup-streak.d.ts.map +1 -0
  571. package/lib/types/host/minimax-code/account-pool.d.ts +309 -0
  572. package/lib/types/host/minimax-code/account-pool.d.ts.map +1 -0
  573. package/lib/types/host/minimax-code/adapter.d.ts +207 -0
  574. package/lib/types/host/minimax-code/adapter.d.ts.map +1 -0
  575. package/lib/types/host/minimax-code/checkin-gateway.d.ts +145 -0
  576. package/lib/types/host/minimax-code/checkin-gateway.d.ts.map +1 -0
  577. package/lib/types/host/minimax-code/checkin.d.ts +207 -0
  578. package/lib/types/host/minimax-code/checkin.d.ts.map +1 -0
  579. package/lib/types/host/minimax-code/client.d.ts +242 -0
  580. package/lib/types/host/minimax-code/client.d.ts.map +1 -0
  581. package/lib/types/host/minimax-code/files-api.d.ts +117 -0
  582. package/lib/types/host/minimax-code/files-api.d.ts.map +1 -0
  583. package/lib/types/host/minimax-code/iso-bmff-duration.d.ts +84 -0
  584. package/lib/types/host/minimax-code/iso-bmff-duration.d.ts.map +1 -0
  585. package/lib/types/host/minimax-code/mapper.d.ts +351 -0
  586. package/lib/types/host/minimax-code/mapper.d.ts.map +1 -0
  587. package/lib/types/host/minimax-code/matrix-client.d.ts +168 -0
  588. package/lib/types/host/minimax-code/matrix-client.d.ts.map +1 -0
  589. package/lib/types/host/minimax-code/modalities.d.ts +20 -0
  590. package/lib/types/host/minimax-code/modalities.d.ts.map +1 -0
  591. package/lib/types/host/minimax-code/model-catalog.d.ts +227 -0
  592. package/lib/types/host/minimax-code/model-catalog.d.ts.map +1 -0
  593. package/lib/types/host/minimax-code/oauth.d.ts +220 -0
  594. package/lib/types/host/minimax-code/oauth.d.ts.map +1 -0
  595. package/lib/types/host/minimax-code/reset-card.d.ts +136 -0
  596. package/lib/types/host/minimax-code/reset-card.d.ts.map +1 -0
  597. package/lib/types/host/minimax-code/routes.d.ts +82 -0
  598. package/lib/types/host/minimax-code/routes.d.ts.map +1 -0
  599. package/lib/types/host/minimax-code/token-store.d.ts +328 -0
  600. package/lib/types/host/minimax-code/token-store.d.ts.map +1 -0
  601. package/lib/types/host/minimax-code/tool-argument-repair.d.ts +72 -0
  602. package/lib/types/host/minimax-code/tool-argument-repair.d.ts.map +1 -0
  603. package/lib/types/host/minimax-code/types.d.ts +378 -0
  604. package/lib/types/host/minimax-code/types.d.ts.map +1 -0
  605. package/lib/types/host/model-catalog.d.ts +43 -0
  606. package/lib/types/host/model-catalog.d.ts.map +1 -0
  607. package/lib/types/host/oauth-service.d.ts +242 -0
  608. package/lib/types/host/oauth-service.d.ts.map +1 -0
  609. package/lib/types/host/ollama/account-pool.d.ts +65 -0
  610. package/lib/types/host/ollama/account-pool.d.ts.map +1 -0
  611. package/lib/types/host/ollama/adapter.d.ts +90 -0
  612. package/lib/types/host/ollama/adapter.d.ts.map +1 -0
  613. package/lib/types/host/ollama/client.d.ts +166 -0
  614. package/lib/types/host/ollama/client.d.ts.map +1 -0
  615. package/lib/types/host/ollama/mapper.d.ts +49 -0
  616. package/lib/types/host/ollama/mapper.d.ts.map +1 -0
  617. package/lib/types/host/ollama/routes.d.ts +22 -0
  618. package/lib/types/host/ollama/routes.d.ts.map +1 -0
  619. package/lib/types/host/ollama/token-store.d.ts +78 -0
  620. package/lib/types/host/ollama/token-store.d.ts.map +1 -0
  621. package/lib/types/host/ollama/types.d.ts +247 -0
  622. package/lib/types/host/ollama/types.d.ts.map +1 -0
  623. package/lib/types/host/opencode-go/account-pool.d.ts +50 -0
  624. package/lib/types/host/opencode-go/account-pool.d.ts.map +1 -0
  625. package/lib/types/host/opencode-go/adapter.d.ts +38 -0
  626. package/lib/types/host/opencode-go/adapter.d.ts.map +1 -0
  627. package/lib/types/host/opencode-go/client.d.ts +13 -0
  628. package/lib/types/host/opencode-go/client.d.ts.map +1 -0
  629. package/lib/types/host/opencode-go/mapper-gemini.d.ts +13 -0
  630. package/lib/types/host/opencode-go/mapper-gemini.d.ts.map +1 -0
  631. package/lib/types/host/opencode-go/mapper-messages.d.ts +8 -0
  632. package/lib/types/host/opencode-go/mapper-messages.d.ts.map +1 -0
  633. package/lib/types/host/opencode-go/mapper-responses.d.ts +9 -0
  634. package/lib/types/host/opencode-go/mapper-responses.d.ts.map +1 -0
  635. package/lib/types/host/opencode-go/mapper.d.ts +38 -0
  636. package/lib/types/host/opencode-go/mapper.d.ts.map +1 -0
  637. package/lib/types/host/opencode-go/model-catalog.d.ts +57 -0
  638. package/lib/types/host/opencode-go/model-catalog.d.ts.map +1 -0
  639. package/lib/types/host/opencode-go/native-shared.d.ts +31 -0
  640. package/lib/types/host/opencode-go/native-shared.d.ts.map +1 -0
  641. package/lib/types/host/opencode-go/protocol.d.ts +13 -0
  642. package/lib/types/host/opencode-go/protocol.d.ts.map +1 -0
  643. package/lib/types/host/opencode-go/routes.d.ts +13 -0
  644. package/lib/types/host/opencode-go/routes.d.ts.map +1 -0
  645. package/lib/types/host/opencode-go/token-store.d.ts +29 -0
  646. package/lib/types/host/opencode-go/token-store.d.ts.map +1 -0
  647. package/lib/types/host/opencode-go/types.d.ts +20 -0
  648. package/lib/types/host/opencode-go/types.d.ts.map +1 -0
  649. package/lib/types/host/opendesign/account-pool.d.ts +54 -0
  650. package/lib/types/host/opendesign/account-pool.d.ts.map +1 -0
  651. package/lib/types/host/opendesign/adapter.d.ts +88 -0
  652. package/lib/types/host/opendesign/adapter.d.ts.map +1 -0
  653. package/lib/types/host/opendesign/catalog.d.ts +58 -0
  654. package/lib/types/host/opendesign/catalog.d.ts.map +1 -0
  655. package/lib/types/host/opendesign/client.d.ts +304 -0
  656. package/lib/types/host/opendesign/client.d.ts.map +1 -0
  657. package/lib/types/host/opendesign/line.d.ts +60 -0
  658. package/lib/types/host/opendesign/line.d.ts.map +1 -0
  659. package/lib/types/host/opendesign/mapper.d.ts +218 -0
  660. package/lib/types/host/opendesign/mapper.d.ts.map +1 -0
  661. package/lib/types/host/opendesign/oauth.d.ts +105 -0
  662. package/lib/types/host/opendesign/oauth.d.ts.map +1 -0
  663. package/lib/types/host/opendesign/routes.d.ts +75 -0
  664. package/lib/types/host/opendesign/routes.d.ts.map +1 -0
  665. package/lib/types/host/opendesign/token-store.d.ts +241 -0
  666. package/lib/types/host/opendesign/token-store.d.ts.map +1 -0
  667. package/lib/types/host/opendesign/types.d.ts +235 -0
  668. package/lib/types/host/opendesign/types.d.ts.map +1 -0
  669. package/lib/types/host/platform-token-store.d.ts +3 -0
  670. package/lib/types/host/platform-token-store.d.ts.map +1 -0
  671. package/lib/types/host/preferences.d.ts +26 -0
  672. package/lib/types/host/preferences.d.ts.map +1 -0
  673. package/lib/types/host/proxy-manager.d.ts +261 -0
  674. package/lib/types/host/proxy-manager.d.ts.map +1 -0
  675. package/lib/types/host/qianwen-token-plan/adapter.d.ts +37 -0
  676. package/lib/types/host/qianwen-token-plan/adapter.d.ts.map +1 -0
  677. package/lib/types/host/qianwen-token-plan/cache-stats.d.ts +17 -0
  678. package/lib/types/host/qianwen-token-plan/cache-stats.d.ts.map +1 -0
  679. package/lib/types/host/qianwen-token-plan/client.d.ts +5 -0
  680. package/lib/types/host/qianwen-token-plan/client.d.ts.map +1 -0
  681. package/lib/types/host/qianwen-token-plan/mapper.d.ts +71 -0
  682. package/lib/types/host/qianwen-token-plan/mapper.d.ts.map +1 -0
  683. package/lib/types/host/qianwen-token-plan/model-catalog.d.ts +28 -0
  684. package/lib/types/host/qianwen-token-plan/model-catalog.d.ts.map +1 -0
  685. package/lib/types/host/qianwen-token-plan/routes.d.ts +12 -0
  686. package/lib/types/host/qianwen-token-plan/routes.d.ts.map +1 -0
  687. package/lib/types/host/qianwen-token-plan/token-store.d.ts +56 -0
  688. package/lib/types/host/qianwen-token-plan/token-store.d.ts.map +1 -0
  689. package/lib/types/host/qianwen-token-plan/types.d.ts +13 -0
  690. package/lib/types/host/qianwen-token-plan/types.d.ts.map +1 -0
  691. package/lib/types/host/qoder/account-pool.d.ts +141 -0
  692. package/lib/types/host/qoder/account-pool.d.ts.map +1 -0
  693. package/lib/types/host/qoder/adapter.d.ts +167 -0
  694. package/lib/types/host/qoder/adapter.d.ts.map +1 -0
  695. package/lib/types/host/qoder/adopt.d.ts +146 -0
  696. package/lib/types/host/qoder/adopt.d.ts.map +1 -0
  697. package/lib/types/host/qoder/client.d.ts +323 -0
  698. package/lib/types/host/qoder/client.d.ts.map +1 -0
  699. package/lib/types/host/qoder/cosy.d.ts +173 -0
  700. package/lib/types/host/qoder/cosy.d.ts.map +1 -0
  701. package/lib/types/host/qoder/mapper.d.ts +332 -0
  702. package/lib/types/host/qoder/mapper.d.ts.map +1 -0
  703. package/lib/types/host/qoder/model-catalog.d.ts +231 -0
  704. package/lib/types/host/qoder/model-catalog.d.ts.map +1 -0
  705. package/lib/types/host/qoder/oauth.d.ts +151 -0
  706. package/lib/types/host/qoder/oauth.d.ts.map +1 -0
  707. package/lib/types/host/qoder/routes.d.ts +119 -0
  708. package/lib/types/host/qoder/routes.d.ts.map +1 -0
  709. package/lib/types/host/qoder/token-store.d.ts +280 -0
  710. package/lib/types/host/qoder/token-store.d.ts.map +1 -0
  711. package/lib/types/host/qoder/types.d.ts +262 -0
  712. package/lib/types/host/qoder/types.d.ts.map +1 -0
  713. package/lib/types/host/relayone/account-pool.d.ts +129 -0
  714. package/lib/types/host/relayone/account-pool.d.ts.map +1 -0
  715. package/lib/types/host/relayone/adapter.d.ts +87 -0
  716. package/lib/types/host/relayone/adapter.d.ts.map +1 -0
  717. package/lib/types/host/relayone/catalog-manager.d.ts +45 -0
  718. package/lib/types/host/relayone/catalog-manager.d.ts.map +1 -0
  719. package/lib/types/host/relayone/client.d.ts +5 -0
  720. package/lib/types/host/relayone/client.d.ts.map +1 -0
  721. package/lib/types/host/relayone/mapper-anthropic.d.ts +49 -0
  722. package/lib/types/host/relayone/mapper-anthropic.d.ts.map +1 -0
  723. package/lib/types/host/relayone/mapper-openai.d.ts +36 -0
  724. package/lib/types/host/relayone/mapper-openai.d.ts.map +1 -0
  725. package/lib/types/host/relayone/mapper-shared.d.ts +25 -0
  726. package/lib/types/host/relayone/mapper-shared.d.ts.map +1 -0
  727. package/lib/types/host/relayone/model-catalog.d.ts +70 -0
  728. package/lib/types/host/relayone/model-catalog.d.ts.map +1 -0
  729. package/lib/types/host/relayone/quota.d.ts +29 -0
  730. package/lib/types/host/relayone/quota.d.ts.map +1 -0
  731. package/lib/types/host/relayone/routes.d.ts +33 -0
  732. package/lib/types/host/relayone/routes.d.ts.map +1 -0
  733. package/lib/types/host/relayone/token-store.d.ts +49 -0
  734. package/lib/types/host/relayone/token-store.d.ts.map +1 -0
  735. package/lib/types/host/relayone/types.d.ts +22 -0
  736. package/lib/types/host/relayone/types.d.ts.map +1 -0
  737. package/lib/types/host/responses-client.d.ts +125 -0
  738. package/lib/types/host/responses-client.d.ts.map +1 -0
  739. package/lib/types/host/responses-mapper.d.ts +133 -0
  740. package/lib/types/host/responses-mapper.d.ts.map +1 -0
  741. package/lib/types/host/routes.d.ts +30 -0
  742. package/lib/types/host/routes.d.ts.map +1 -0
  743. package/lib/types/host/search-provider-switcher.d.ts +45 -0
  744. package/lib/types/host/search-provider-switcher.d.ts.map +1 -0
  745. package/lib/types/host/session-title-guard/index.d.ts +80 -0
  746. package/lib/types/host/session-title-guard/index.d.ts.map +1 -0
  747. package/lib/types/host/step-code/account-pool.d.ts +187 -0
  748. package/lib/types/host/step-code/account-pool.d.ts.map +1 -0
  749. package/lib/types/host/step-code/adapter.d.ts +156 -0
  750. package/lib/types/host/step-code/adapter.d.ts.map +1 -0
  751. package/lib/types/host/step-code/adopt.d.ts +201 -0
  752. package/lib/types/host/step-code/adopt.d.ts.map +1 -0
  753. package/lib/types/host/step-code/cache-stats.d.ts +181 -0
  754. package/lib/types/host/step-code/cache-stats.d.ts.map +1 -0
  755. package/lib/types/host/step-code/client.d.ts +339 -0
  756. package/lib/types/host/step-code/client.d.ts.map +1 -0
  757. package/lib/types/host/step-code/mapper.d.ts +305 -0
  758. package/lib/types/host/step-code/mapper.d.ts.map +1 -0
  759. package/lib/types/host/step-code/model-catalog.d.ts +247 -0
  760. package/lib/types/host/step-code/model-catalog.d.ts.map +1 -0
  761. package/lib/types/host/step-code/oauth.d.ts +265 -0
  762. package/lib/types/host/step-code/oauth.d.ts.map +1 -0
  763. package/lib/types/host/step-code/routes.d.ts +129 -0
  764. package/lib/types/host/step-code/routes.d.ts.map +1 -0
  765. package/lib/types/host/step-code/token-store.d.ts +325 -0
  766. package/lib/types/host/step-code/token-store.d.ts.map +1 -0
  767. package/lib/types/host/step-code/types.d.ts +492 -0
  768. package/lib/types/host/step-code/types.d.ts.map +1 -0
  769. package/lib/types/host/token-store-linux.d.ts +20 -0
  770. package/lib/types/host/token-store-linux.d.ts.map +1 -0
  771. package/lib/types/host/token-store-macos.d.ts +39 -0
  772. package/lib/types/host/token-store-macos.d.ts.map +1 -0
  773. package/lib/types/host/token-store-windows.d.ts +26 -0
  774. package/lib/types/host/token-store-windows.d.ts.map +1 -0
  775. package/lib/types/host/token-store.d.ts +81 -0
  776. package/lib/types/host/token-store.d.ts.map +1 -0
  777. package/lib/types/host/usage-service.d.ts +109 -0
  778. package/lib/types/host/usage-service.d.ts.map +1 -0
  779. package/lib/types/host/web-provider-reconciler.d.ts +34 -0
  780. package/lib/types/host/web-provider-reconciler.d.ts.map +1 -0
  781. package/lib/types/host/wire-auth.d.ts +63 -0
  782. package/lib/types/host/wire-auth.d.ts.map +1 -0
  783. package/lib/types/host/workbuddy/account-pool.d.ts +389 -0
  784. package/lib/types/host/workbuddy/account-pool.d.ts.map +1 -0
  785. package/lib/types/host/workbuddy/adapter.d.ts +248 -0
  786. package/lib/types/host/workbuddy/adapter.d.ts.map +1 -0
  787. package/lib/types/host/workbuddy/atrest.d.ts +98 -0
  788. package/lib/types/host/workbuddy/atrest.d.ts.map +1 -0
  789. package/lib/types/host/workbuddy/checkin.d.ts +150 -0
  790. package/lib/types/host/workbuddy/checkin.d.ts.map +1 -0
  791. package/lib/types/host/workbuddy/client.d.ts +214 -0
  792. package/lib/types/host/workbuddy/client.d.ts.map +1 -0
  793. package/lib/types/host/workbuddy/dsml.d.ts +55 -0
  794. package/lib/types/host/workbuddy/dsml.d.ts.map +1 -0
  795. package/lib/types/host/workbuddy/guardrails.d.ts +111 -0
  796. package/lib/types/host/workbuddy/guardrails.d.ts.map +1 -0
  797. package/lib/types/host/workbuddy/identity.d.ts +71 -0
  798. package/lib/types/host/workbuddy/identity.d.ts.map +1 -0
  799. package/lib/types/host/workbuddy/mapper.d.ts +238 -0
  800. package/lib/types/host/workbuddy/mapper.d.ts.map +1 -0
  801. package/lib/types/host/workbuddy/model-catalog.d.ts +239 -0
  802. package/lib/types/host/workbuddy/model-catalog.d.ts.map +1 -0
  803. package/lib/types/host/workbuddy/oauth.d.ts +47 -0
  804. package/lib/types/host/workbuddy/oauth.d.ts.map +1 -0
  805. package/lib/types/host/workbuddy/outbound-identity.d.ts +139 -0
  806. package/lib/types/host/workbuddy/outbound-identity.d.ts.map +1 -0
  807. package/lib/types/host/workbuddy/routes.d.ts +56 -0
  808. package/lib/types/host/workbuddy/routes.d.ts.map +1 -0
  809. package/lib/types/host/workbuddy/token-store.d.ts +370 -0
  810. package/lib/types/host/workbuddy/token-store.d.ts.map +1 -0
  811. package/lib/types/host/workbuddy/types.d.ts +185 -0
  812. package/lib/types/host/workbuddy/types.d.ts.map +1 -0
  813. package/lib/types/index.d.ts +248 -0
  814. package/lib/types/index.d.ts.map +1 -0
  815. package/lib/types/shared/account-pool-contracts.d.ts +99 -0
  816. package/lib/types/shared/account-pool-contracts.d.ts.map +1 -0
  817. package/lib/types/shared/claude-api-contracts.d.ts +98 -0
  818. package/lib/types/shared/claude-api-contracts.d.ts.map +1 -0
  819. package/lib/types/shared/claude-contracts.d.ts +370 -0
  820. package/lib/types/shared/claude-contracts.d.ts.map +1 -0
  821. package/lib/types/shared/cline-pass-contracts.d.ts +234 -0
  822. package/lib/types/shared/cline-pass-contracts.d.ts.map +1 -0
  823. package/lib/types/shared/command-code-contracts.d.ts +163 -0
  824. package/lib/types/shared/command-code-contracts.d.ts.map +1 -0
  825. package/lib/types/shared/contracts.d.ts +343 -0
  826. package/lib/types/shared/contracts.d.ts.map +1 -0
  827. package/lib/types/shared/glm-coding-plan-contracts.d.ts +315 -0
  828. package/lib/types/shared/glm-coding-plan-contracts.d.ts.map +1 -0
  829. package/lib/types/shared/hub-contracts.d.ts +37 -0
  830. package/lib/types/shared/hub-contracts.d.ts.map +1 -0
  831. package/lib/types/shared/i18n-contracts.d.ts +35 -0
  832. package/lib/types/shared/i18n-contracts.d.ts.map +1 -0
  833. package/lib/types/shared/kimi-code-contracts.d.ts +435 -0
  834. package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -0
  835. package/lib/types/shared/minimax-code-contracts.d.ts +263 -0
  836. package/lib/types/shared/minimax-code-contracts.d.ts.map +1 -0
  837. package/lib/types/shared/model-catalog.d.ts +302 -0
  838. package/lib/types/shared/model-catalog.d.ts.map +1 -0
  839. package/lib/types/shared/ollama-contracts.d.ts +73 -0
  840. package/lib/types/shared/ollama-contracts.d.ts.map +1 -0
  841. package/lib/types/shared/opencode-go-contracts.d.ts +80 -0
  842. package/lib/types/shared/opencode-go-contracts.d.ts.map +1 -0
  843. package/lib/types/shared/opendesign-contracts.d.ts +262 -0
  844. package/lib/types/shared/opendesign-contracts.d.ts.map +1 -0
  845. package/lib/types/shared/preferences.d.ts +60 -0
  846. package/lib/types/shared/preferences.d.ts.map +1 -0
  847. package/lib/types/shared/qianwen-token-plan-contracts.d.ts +94 -0
  848. package/lib/types/shared/qianwen-token-plan-contracts.d.ts.map +1 -0
  849. package/lib/types/shared/qoder-contracts.d.ts +342 -0
  850. package/lib/types/shared/qoder-contracts.d.ts.map +1 -0
  851. package/lib/types/shared/relayone-contracts.d.ts +95 -0
  852. package/lib/types/shared/relayone-contracts.d.ts.map +1 -0
  853. package/lib/types/shared/step-code-contracts.d.ts +443 -0
  854. package/lib/types/shared/step-code-contracts.d.ts.map +1 -0
  855. package/lib/types/shared/workbuddy-contracts.d.ts +531 -0
  856. package/lib/types/shared/workbuddy-contracts.d.ts.map +1 -0
  857. package/package.json +147 -4
@@ -0,0 +1,802 @@
1
+ /**
2
+ * Wire mapping for the Anthropic Messages API behind a SUBSCRIPTION credential.
3
+ *
4
+ * WHAT THIS MODULE OWNS. Everything between DSH's GenerateOptions and the bytes
5
+ * of POST <API_BASE><MESSAGES_PATH>: the request body, and the SSE state machine
6
+ * that turns Anthropic's line-oriented event stream back into DSH StreamChunks.
7
+ * It holds no credential, performs no I/O, and never touches the network - the
8
+ * adapter owns transport and it owns the line splitting. Every function here is
9
+ * pure with respect to the wire: same options in, same body out.
10
+ *
11
+ * The module doc of the sibling model-catalog.ts is the authority for the
12
+ * per-model facts used below, and every claim marked TRANSCRIBED below was read
13
+ * out of that catalog's transcription of a locally installed reference
14
+ * implementation rather than recalled. Claims marked CHOICE are this module's
15
+ * own judgement and are flagged as such so a reviewer can disagree with one
16
+ * without having to re-derive the whole file.
17
+ *
18
+ * ---------------------------------------------------------------------------
19
+ * 1. THE SYSTEM ARRAY IS TWO BLOCKS AND THE FIRST ONE IS NOT OPTIONAL
20
+ * ---------------------------------------------------------------------------
21
+ *
22
+ * On the subscription route the system prompt is an ARRAY of text blocks whose
23
+ * FIRST entry must be the Claude Code identity line verbatim. This is not
24
+ * cosmetic and not a preference: a subscription request without that identity
25
+ * block is rejected, and the failure is a whole-turn failure rather than a
26
+ * degraded answer. It is therefore emitted unconditionally - even when the
27
+ * caller states no system prompt at all - and the caller's own prompt, when
28
+ * there is one, becomes the SECOND block. See CLAUDE_CODE_IDENTITY_TEXT.
29
+ *
30
+ * A role: 'system' entry in options.messages is FOLDED into that same second
31
+ * block — UNLESS the model accepts a mid-conversation system message AND the
32
+ * message sits where the vendor allows one. The fold is order-stable (header
33
+ * first, then history order) because the system array is the head of the prefix
34
+ * the server caches.
35
+ *
36
+ * THE WIRE DOES HAVE A SYSTEM ROLE, but only on the models the vendor lists,
37
+ * and only in a narrow position. A mid-conversation system message that
38
+ * carries content must immediately follow a user turn and must either be the
39
+ * last entry in `messages` or be immediately followed by an assistant turn; any
40
+ * other position is a 400 for the whole request. The rule and its
41
+ * transcription are on {@link claudeSystemMessagesInPlace}, which is the ONE
42
+ * predicate that both the builder keeping a message in place and the builder
43
+ * folding it back read — so the two can never disagree about one message.
44
+ *
45
+ * ---------------------------------------------------------------------------
46
+ * 2. THINKING - FOUR CASES, DISPATCHED IN THE CATALOG'S ORDER
47
+ * ---------------------------------------------------------------------------
48
+ *
49
+ * claudeThinkingMode(model) decides the form, and the order of the guards is
50
+ * the whole point:
51
+ *
52
+ * mid-convo -> { type: 'adaptive', display: 'summarized',
53
+ * block_binding: { prefix_mismatch_behavior: 'drop_block' } }
54
+ * PLUS output_config = { effort }. This case outranks
55
+ * everything, including a caller asking for thinking off: the
56
+ * block_binding exists so a prefix mismatch is dropped instead of
57
+ * surfacing as a persistent 400, and suppressing it is exactly
58
+ * how that 400 comes back. The field is itself a 400 unless the
59
+ * request carries the thinking-binding-controls beta, so the
60
+ * adapter reads claudeBodyBindsThinking(body) to add it.
61
+ * adaptive -> { type: 'adaptive', display: 'summarized' }, plus
62
+ * output_config = { effort } when an effort was named. The budget
63
+ * form is rejected by these models.
64
+ * budget -> { type: 'enabled', budget_tokens: <clamped>, display:
65
+ * 'summarized' }.
66
+ * none -> NO thinking field at all.
67
+ *
68
+ * Thinking OFF is a separate decision layered on top: when the caller asked for
69
+ * it and claudeModelCanDisableThinking(model) is true, { type: 'disabled' } is
70
+ * sent; when that predicate is false the disable request is NOT sent (the model
71
+ * forbids it) and the model's own form is used instead - a model that always
72
+ * thinks cannot be talked out of it, and the only honest request left is the
73
+ * normal one. CHOICE: nothing above the predicate is this module's invention,
74
+ * but "fall back to the model's own form" is, because the catalog only states
75
+ * that the disable request must not be sent.
76
+ *
77
+ * ---------------------------------------------------------------------------
78
+ * 3. THE BUDGET ARITHMETIC IS TRANSCRIBED, NOT RE-DERIVED
79
+ * ---------------------------------------------------------------------------
80
+ *
81
+ * RULE 4 of model-catalog.ts carries the reference arithmetic with line cites.
82
+ * adjustMaxTokensForThinking, thinkingBudgetForLevel, clampReasoning and
83
+ * clampThinkingBudgetToAnswerRoom below reproduce it statement for statement.
84
+ * Two traps that transcription exists to prevent:
85
+ *
86
+ * 1. an UNDEFINED caller cap must not be coerced to 0. Under the helper's own
87
+ * branch Math.min(0 + budget, modelMax) makes the thinking budget the
88
+ * entire response ceiling and leaves no room for an answer;
89
+ * 2. the value passed in as baseMax is the ALREADY-RESOLVED cap
90
+ * (buildBaseOptions resolves options.maxTokens ?? model.maxTokens before
91
+ * calling the helper), so feeding an unresolved value in changes which
92
+ * branch runs. resolveMaxTokens below is what resolves it, and the builder
93
+ * passes the result - never options.maxTokens directly.
94
+ *
95
+ * The one deviation from the transcription is that the reference's
96
+ * thinkingBudgetForLevel can yield undefined for a level its table does not
97
+ * name; the reference never hits that (its level always comes from the model's
98
+ * own ladder) while a caller here could. Every use below either substitutes the
99
+ * middle level or treats the result as "no thinking field", and never does
100
+ * arithmetic with undefined.
101
+ *
102
+ * ---------------------------------------------------------------------------
103
+ * 4. TOOL NAMES ARE CASE-NORMALIZED, AND MAPPED BACK
104
+ * ---------------------------------------------------------------------------
105
+ *
106
+ * A subscription token is served Claude Code's own tool vocabulary, and the
107
+ * reference case-normalizes the tool names it sends to that vocabulary. So a
108
+ * tool offered as 'bash' or 'WEBSEARCH' goes out as 'Bash' / 'WebSearch', and a
109
+ * returned canonical name is mapped BACK to the caller's spelling, because DSH
110
+ * dispatches on the name it declared. A name the vocabulary does not know is
111
+ * sent unchanged: inventing a spelling for an unknown tool would rename a tool
112
+ * the harness can no longer dispatch.
113
+ *
114
+ * The back-map is per request and case-insensitive, which is only sound while
115
+ * it is unambiguous. Two offered tools that would collapse onto one wire name
116
+ * (or onto one case-insensitive wire name) disable normalization for that
117
+ * request entirely and send the real names, so the model's reply can never be
118
+ * attributed to the wrong tool.
119
+ *
120
+ * ---------------------------------------------------------------------------
121
+ * 5. THINKING BLOCKS ARE REPLAYED VERBATIM OR NOT AT ALL
122
+ * ---------------------------------------------------------------------------
123
+ *
124
+ * A replayed thinking block must carry the signature the model produced beside
125
+ * it: a signed block without its signature is a 400, and dropping signed
126
+ * thinking blocks breaks multi-turn tool use under extended thinking because
127
+ * the assistant turn that made a tool call loses the reasoning the server
128
+ * expects to see again. redacted_thinking blocks are replayed too - they are
129
+ * opaque to us, which is precisely why only the payload that came off the wire
130
+ * can be sent back. A thinking block with NO signature cannot be replayed at
131
+ * all and is dropped rather than sent unsigned.
132
+ *
133
+ * For that to be possible across turns, the text and the signature are carried
134
+ * through the turn: each emitted reasoning block gets a matching entry in the
135
+ * finish chunk's replayState envelope, and the request builder reads it back on
136
+ * the next turn. CHOICE: the envelope shape is DSH's (the harness's
137
+ * ReplayEnvelope), but that this line needs one at all is a consequence of the
138
+ * rule above rather than something the catalog states.
139
+ *
140
+ * ---------------------------------------------------------------------------
141
+ * 6. THE STREAM IS LINE-ORIENTED, NOT data:-ONLY
142
+ * ---------------------------------------------------------------------------
143
+ *
144
+ * Anthropic sends 'event: <name>' and 'data: <json>' as separate lines, and the
145
+ * primitive below is fed ONE line at a time. It deliberately ignores the
146
+ * 'event:' line and dispatches on the payload's own 'type' field instead: the
147
+ * two must agree, and if they ever disagree the JSON is the copy that carries
148
+ * everything else. Unknown event types are ignored rather than rejected - a
149
+ * beta this plugin does not know about must not fail a working turn - while an
150
+ * 'error' event THROWS, because a severed reply flushed as a clean stop is a
151
+ * wrong answer rather than a visible failure.
152
+ *
153
+ * Reasoning deltas are STREAMED as they arrive (see openThinkingBlock); only the
154
+ * replay entry waits for content_block_stop, because the signature that decides
155
+ * whether the block may be replayed arrives at the END of the block. They used
156
+ * to be buffered until the stop, which made DSH start the step's first-token
157
+ * clock after all thinking was done - so TPS divided every thinking token by the
158
+ * answer's time alone, and TTFT absorbed the whole thinking phase.
159
+ *
160
+ * ---------------------------------------------------------------------------
161
+ * 7. PROMPT CACHING IS ON BY DEFAULT, AND IT IS THE REQUEST THAT TURNS IT ON
162
+ * ---------------------------------------------------------------------------
163
+ *
164
+ * Anthropic's prompt cache is REQUEST-DRIVEN: the server caches a prefix only
165
+ * where the request puts an explicit cache_control breakpoint, and a request
166
+ * with no breakpoint gets no cache_read_input_tokens back no matter how
167
+ * identical its bytes are turn over turn. Emitting the breakpoints is therefore
168
+ * this module's job, and it is the DEFAULT: ClaudeRequestOptions.cacheControl
169
+ * is true unless a caller explicitly states false. The reference implementation
170
+ * this line is transcribed from resolves the same way (its resolveCacheRetention
171
+ * defaults to 'short'; only an explicit 'none' skips caching), and the
172
+ * asymmetry is deliberate - a caller that says NOTHING must still get caching,
173
+ * because an opt-in flag that one call site forgets to pass is exactly how this
174
+ * request stopped carrying breakpoints in the first place.
175
+ *
176
+ * Three sites are marked, which is three of the four breakpoints the wire
177
+ * accepts (see MAX_CACHE_BREAKPOINTS): the LAST system block, the last block of
178
+ * the LAST user message, and the last tool. The first covers the identity block
179
+ * and the caller's prompt; the second is what actually caches CONVERSATION
180
+ * HISTORY across turns, since it sits at the end of everything the next turn
181
+ * will resend; the third keeps the tool table inside the cached prefix instead
182
+ * of behind the first message breakpoint.
183
+ *
184
+ * Where the marking happens matters as much as that it happens: the message
185
+ * breakpoint goes on the FINAL merged list, after mergeClaudeMessages has
186
+ * folded consecutive same-role turns together. Marking the pre-merge list can
187
+ * land the breakpoint on a block the merge then moves back, which leaves a
188
+ * marker in the request that caches nothing the next turn can reuse.
189
+ */
190
+ import { type ClaudeCodeFirstPartyContext } from '../common/claude-code-first-party.ts';
191
+ import { type ContentBlock, type GenerateOptions, type StreamChunk, type TokenUsage } from '../common/llm-compat.ts';
192
+ import type { AttachmentStore, ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
193
+ import { type ClaudeModelEntry } from './model-catalog.ts';
194
+ import { type ClaudeCacheTtl } from './types.ts';
195
+ /**
196
+ * The Claude Code identity block's exact text.
197
+ *
198
+ * MUST be system[0] on every subscription request (see the module doc). It is a
199
+ * single literal rather than a template so a test can compare it byte for byte.
200
+ */
201
+ export declare const CLAUDE_CODE_IDENTITY_TEXT = "You are Claude Code, Anthropic's official CLI for Claude.";
202
+ /** Answer room the budget clamp always leaves below the response ceiling. */
203
+ export declare const MIN_ANSWER_TOKENS = 1024;
204
+ /**
205
+ * Cache breakpoints one Messages request may carry.
206
+ *
207
+ * TRANSCRIBED from the wire's own limit and the reference implementation's
208
+ * reading of it. This module marks at most three (see the module doc), so the
209
+ * budget is never the binding constraint - the constant exists so a test can
210
+ * assert that against the REAL number rather than a magic three.
211
+ */
212
+ export declare const MAX_CACHE_BREAKPOINTS = 4;
213
+ /**
214
+ * Thinking budget one level asks for, before any clamp.
215
+ *
216
+ * TRANSCRIBED from simple-options.js lines 38-43. The values are the
217
+ * reference's, not a preference: a different table would silently change how
218
+ * much of the response ceiling a level spends.
219
+ */
220
+ export declare const DEFAULT_THINKING_BUDGETS: Readonly<Record<string, number>>;
221
+ /**
222
+ * Level used when a caller names none, or names one the table does not know.
223
+ *
224
+ * CHOICE. The reference always has a level because the adapter picks one off
225
+ * the model's own ladder; this mapper has to answer for a caller that named
226
+ * nothing or named a level from another provider's vocabulary. The middle of
227
+ * the table is the least surprising answer and, unlike 'high', it cannot turn a
228
+ * modest request into one whose budget eats the whole ceiling.
229
+ */
230
+ export declare const DEFAULT_THINKING_LEVEL = "medium";
231
+ /** Caller-supplied overrides for {@link DEFAULT_THINKING_BUDGETS}. */
232
+ export type ThinkingBudgets = Readonly<Record<string, number | undefined>>;
233
+ /**
234
+ * Collapse an effort onto the levels the budget table names.
235
+ *
236
+ * TRANSCRIBED from simple-options.js lines 44-46: xhigh and max are the two
237
+ * rungs the table has no entry for, and both resolve to high rather than to a
238
+ * budget invented here.
239
+ */
240
+ export declare function clampReasoning(effort: string | undefined | null): string | undefined;
241
+ /**
242
+ * Budget one level asks for, with the caller's overrides applied.
243
+ *
244
+ * TRANSCRIBED from simple-options.js lines 47-51. An unknown level yields
245
+ * undefined - the reference's spread-and-index does the same - and every caller
246
+ * below answers for that case explicitly instead of doing arithmetic with it.
247
+ */
248
+ export declare function thinkingBudgetForLevel(level: string | undefined | null, customBudgets?: ThinkingBudgets): number | undefined;
249
+ /**
250
+ * Shrink a budget until an answer still fits under the ceiling.
251
+ *
252
+ * TRANSCRIBED from simple-options.js lines 52-55, and reused verbatim as the
253
+ * wire clamp below, which the catalog writes out inline as exactly this
254
+ * expression.
255
+ */
256
+ export declare function clampThinkingBudgetToAnswerRoom(budget: number, ceiling: number): number;
257
+ /**
258
+ * Level {@link thinkingBudgetForLevel} should be asked about.
259
+ *
260
+ * A caller who named no level, or named one of the off-tokens, gets the middle
261
+ * level rather than an undefined lookup: the budget table names no 'off' rung,
262
+ * and a request that is going to think needs a budget fitted for it. A level
263
+ * the table does not know at all is passed through so the arithmetic, and not
264
+ * this function, is what reports it as unavailable.
265
+ */
266
+ export declare function thinkingBudgetLevel(effort: string | undefined | null): string;
267
+ /**
268
+ * Fit a thinking budget inside a response ceiling.
269
+ *
270
+ * TRANSCRIBED from simple-options.js lines 56-65. Read the two traps in the
271
+ * module doc before changing a branch here:
272
+ *
273
+ * - baseMaxTokens === undefined means NO EXPLICIT CALLER CAP and selects the
274
+ * model cap; coercing it to 0 would make maxTokens equal the budget and
275
+ * leaving nothing for an answer;
276
+ * - baseMaxTokens is the ALREADY-RESOLVED cap, so the caller resolves
277
+ * options.maxTokens ?? model.maxTokens first.
278
+ *
279
+ * The '?? 0' beside the budget is the deviation the module doc describes: the
280
+ * reference would compute NaN for a level its table does not name, and an
281
+ * unknown level is ordinary input here.
282
+ */
283
+ export declare function adjustMaxTokensForThinking(baseMaxTokens: number | undefined, modelMaxTokens: number, reasoningLevel: string | undefined | null, customBudgets?: ThinkingBudgets): {
284
+ maxTokens: number;
285
+ thinkingBudget: number | undefined;
286
+ };
287
+ /**
288
+ * The response ceiling one request asks for.
289
+ *
290
+ * options.maxTokens ?? the model's own cap. This is the resolution step the
291
+ * second trap refers to: an undefined caller cap becomes the MODEL cap, never
292
+ * zero, so the thinking branch fits inside a real ceiling.
293
+ */
294
+ export declare function resolveMaxTokens(options: GenerateOptions): number;
295
+ /** Whether one caller effort means 'thinking off'. */
296
+ export declare function thinkingRequestedOff(effort: string | undefined | null): boolean;
297
+ /** The thinking and output_config fields one request carries. */
298
+ export interface ClaudeThinkingFields {
299
+ thinking?: Record<string, unknown>;
300
+ outputConfig?: Record<string, unknown>;
301
+ }
302
+ /**
303
+ * Whether one request will actually think.
304
+ *
305
+ * This is what decides whether the response ceiling is inflated by the level's
306
+ * budget, and getting it wrong in the generous direction is not harmless: a
307
+ * non-thinking model whose ceiling was raised by a budget it never had would
308
+ * ask the server for tokens it cannot produce. Every form thinks unless the
309
+ * caller asked for thinking off on a model that accepts a disabled request.
310
+ */
311
+ export declare function claudeRequestThinks(model: string, effort: string | undefined | null, catalog?: readonly ClaudeModelEntry[]): boolean;
312
+ /**
313
+ * Dispatch the four thinking cases for one model and effort.
314
+ *
315
+ * The disable request is checked first. A mid-convo model that cannot disable
316
+ * still gets the adaptive form with its block_binding; one that can disable
317
+ * takes that form without an effort override. See the module doc for the cases.
318
+ *
319
+ * @param model - exact model id, resolved through the frozen catalog.
320
+ * @param effort - the caller's raw effort, passed through as-is.
321
+ * @param level - the level whose budget the budget form spends.
322
+ * @param maxTokens - the ALREADY-RESOLVED response ceiling. The budget form
323
+ * spends part of it, so it is the ceiling and not the budget that this
324
+ * function is told about.
325
+ */
326
+ export declare function claudeThinking(model: string, effort: string | undefined, level: string, maxTokens: number, customBudgets?: ThinkingBudgets, catalog?: readonly ClaudeModelEntry[]): ClaudeThinkingFields;
327
+ /**
328
+ * Claude Code's canonical tool spellings.
329
+ *
330
+ * TRANSCRIBED from the reference implementation's own tool vocabulary. The
331
+ * order is the reference's; membership is what matters.
332
+ */
333
+ export declare const CLAUDE_CODE_TOOL_NAMES: readonly string[];
334
+ /**
335
+ * The canonical spelling of one tool name, or undefined when it has none.
336
+ *
337
+ * This is the single-name rule: case-insensitive membership, canonical output.
338
+ */
339
+ export declare function canonicalClaudeToolName(name: string): string | undefined;
340
+ /** The per-request tool-name translation both directions of the wire share. */
341
+ export interface ClaudeToolNames {
342
+ /** False when a collision disabled normalization; both maps are then identity. */
343
+ enabled: boolean;
344
+ /** Caller spelling -> the name to send. */
345
+ toWire: ReadonlyMap<string, string>;
346
+ /** Exact wire name -> caller spelling. */
347
+ byExact: ReadonlyMap<string, string>;
348
+ /** Lower-cased wire name -> caller spelling; consulted only after byExact. */
349
+ byLower: ReadonlyMap<string, string>;
350
+ }
351
+ /**
352
+ * Build the translation for one request's offered tools.
353
+ *
354
+ * Collisions disable normalization (see the module doc): the check is on the
355
+ * WIRE name, compared exactly and case-insensitively, because both are ways for
356
+ * one reply to be attributed to the wrong tool. Case-insensitivity is the
357
+ * stricter half and is CHOICE: two tools spelled 'read' and 'Read' send two
358
+ * distinct names and are therefore unambiguous on the request, but a reply of
359
+ * 'READ' could not be attributed, and refusing to guess costs only the
360
+ * canonical spelling.
361
+ */
362
+ export declare function claudeToolNames(tools?: readonly {
363
+ name: string;
364
+ }[]): ClaudeToolNames;
365
+ /** The wire name for one caller tool name under a request's translation. */
366
+ export declare function claudeWireToolName(name: string, names?: ClaudeToolNames): string;
367
+ /**
368
+ * The caller's tool name for one name the model returned.
369
+ *
370
+ * Exact match first, then case-insensitive: a model that relabels the case of a
371
+ * name it was given is still talking about the tool it was given, while a
372
+ * request that offered two names differing only by case must resolve the exact
373
+ * one. An unknown name is returned unchanged - it is not this layer's job to
374
+ * invent a tool.
375
+ */
376
+ export declare function claudeOriginalToolName(name: string, names?: ClaudeToolNames): string;
377
+ /**
378
+ * Attachment seam this route needs: verified bytes for one durable image, and a
379
+ * downscaled request version of one that is too large for this request. Every
380
+ * harness generation in the peer range declares readImageRequest; a backend
381
+ * that cannot derive request versions rejects the call, and that rejection is
382
+ * handled like any other unreadable image.
383
+ */
384
+ export type AttachmentImageReader = Pick<AttachmentStore, 'readImage' | 'readImageRequest'>;
385
+ /** One durable image resolved for an in-flight request, or proven unreadable. */
386
+ export type ResolvedRequestImage = {
387
+ readonly kind: 'inline';
388
+ readonly mediaType: string;
389
+ readonly data: string;
390
+ } | {
391
+ readonly kind: 'unavailable';
392
+ }
393
+ /**
394
+ * The image WAS readable but could not be brought under the per-image
395
+ * ceiling, so it is not sent at all.
396
+ *
397
+ * DISTINCT FROM 'unavailable' ON PURPOSE: the two are different failures and
398
+ * the user is told which one happened. 'unavailable' means the bytes could
399
+ * not be read; 'oversized' means they were read and no request version of
400
+ * them fitted under the ceiling.
401
+ */
402
+ | {
403
+ readonly kind: 'oversized';
404
+ };
405
+ /** Resolved images keyed by durable attachment id; consumed by one request build. */
406
+ export type ResolvedRequestImages = ReadonlyMap<string, ResolvedRequestImage>;
407
+ /**
408
+ * Base64 image payload ONE request may carry in total.
409
+ *
410
+ * CHOICE, bounded on both sides. Anthropic's documented request ceiling is
411
+ * 32 MB, and its per-image ceiling is 5 MB of RAW bytes; 5 MB of raw bytes
412
+ * expands to about 6.8 MB of base64, so a bound below that would offload a
413
+ * single image the endpoint would have accepted. 8 MB leaves the conversation
414
+ * text, tool schemas and system prompt room inside the 32 MB envelope while
415
+ * still catching the runaway case locally rather than as a 413.
416
+ */
417
+ export declare const MAX_REQUEST_IMAGE_BYTES: number;
418
+ /**
419
+ * Base64 image payload ONE image may carry.
420
+ *
421
+ * A SEPARATE budget from {@link MAX_REQUEST_IMAGE_BYTES}, and enforced by a
422
+ * separate pass. The two answer different questions: the per-image ceiling
423
+ * asks whether THIS picture is acceptable to the endpoint, while the
424
+ * per-request ceiling asks whether the conversation is still a reasonable
425
+ * size. A single budget cannot answer both — one image can be over the
426
+ * per-image ceiling while the request as a whole is small, and that request
427
+ * is refused by the endpoint however small it is.
428
+ *
429
+ * 5 MB of base64 is the per-image figure the vendor publishes for the
430
+ * narrower platforms, and it is the figure this line already targeted
431
+ * indirectly: the request-version byte target below
432
+ * ({@link REQUEST_IMAGE_VERSION_MAX_BYTES}) produces a payload of about
433
+ * 4.7 MB of base64, which is under it. What was missing was the check
434
+ * itself — an image that fitted the edge limit but not the byte limit was
435
+ * sent as stored.
436
+ */
437
+ export declare const MAX_SINGLE_REQUEST_IMAGE_BYTES: number;
438
+ /**
439
+ * Replace the oldest inline images with a text placeholder once one request
440
+ * would carry more than {@link MAX_REQUEST_IMAGE_BYTES} of base64 image data.
441
+ * Durable history is untouched; only the request about to be sent changes, and
442
+ * the placeholder names the omission so the model asks for the picture again
443
+ * instead of answering about a blank.
444
+ *
445
+ * @param images - the resolution the images were read with. Passing it makes
446
+ * the budget measure the payload that will ACTUALLY be sent rather than an
447
+ * estimate derived from the stored size, so a scaled-down image is not
448
+ * dropped for a size it no longer has. The same map must be the one the
449
+ * request body is built with, or the count is spent on the wrong images.
450
+ */
451
+ export declare function offloadOldestRequestImages(options: GenerateOptions, images?: ResolvedRequestImages): GenerateOptions;
452
+ /**
453
+ * Longest side, in pixels, the wire accepts for one image in any request.
454
+ * TRANSCRIBED from the API's vision limits. The harness normalizes stored
455
+ * images to an 8192 px long edge, so a stored image can still exceed this.
456
+ */
457
+ export declare const MAX_IMAGE_EDGE = 8000;
458
+ /**
459
+ * Longest side, in pixels, the wire accepts for every image once one request
460
+ * carries more than {@link MANY_IMAGE_THRESHOLD} images. TRANSCRIBED: past that
461
+ * count the request is rejected with "At least one of the image dimensions
462
+ * exceed max allowed size for many-image requests: 2000 pixels".
463
+ *
464
+ * Rejection is a 400 for the whole request. History keeps every image, so a
465
+ * long session can only add images. Once it holds more than twenty and one is
466
+ * wider than 2000 px, which is common for side-by-side screenshots, every later
467
+ * turn fails. The session cannot recover by itself.
468
+ */
469
+ export declare const MANY_IMAGE_EDGE = 2000;
470
+ /** Image count above which {@link MANY_IMAGE_EDGE} applies. TRANSCRIBED. */
471
+ export declare const MANY_IMAGE_THRESHOLD = 20;
472
+ /**
473
+ * Long-edge ceiling every image of this request must meet.
474
+ *
475
+ * The API counts image blocks, so a repeated attachment counts every time it
476
+ * appears. The count is taken before images are resolved: a block that later
477
+ * degrades to placeholder text still counts. Overcounting can only lower the
478
+ * ceiling, and a lower ceiling never causes a rejection.
479
+ */
480
+ export declare function requestImageEdgeLimit(options: GenerateOptions): number;
481
+ /**
482
+ * Request-version target for one stored image whose long edge is over the
483
+ * ceiling, or undefined when it fits. The short edge rounds to the nearest
484
+ * pixel, matching the harness's long-edge resize. A reference without usable
485
+ * dimensions is sent as stored.
486
+ */
487
+ export declare function requestImageEdgeTarget(ref: ImageAttachmentRef, edge: number): {
488
+ width: number;
489
+ height: number;
490
+ maxPixels: number;
491
+ maxBytes: number;
492
+ maxImageBytes: number;
493
+ imageTargetBytes: number;
494
+ } | undefined;
495
+ /**
496
+ * Read every durable { type: 'image', attachment } block one request carries.
497
+ * An unreadable image resolves to 'unavailable' rather than disappearing, so
498
+ * the model is told the picture is missing instead of answering about a blank.
499
+ *
500
+ * An image whose long edge is over this request's ceiling is sent as the
501
+ * harness's downscaled request version (see {@link requestImageEdgeLimit}). The
502
+ * stored image and durable history do not change, and an image that already
503
+ * fits is sent byte-for-byte as stored. If a downscaled version cannot be
504
+ * produced, the image resolves to 'unavailable'. A visible placeholder is better
505
+ * than sending the original, which would make the whole request fail.
506
+ */
507
+ export declare function resolveRequestImages(options: GenerateOptions, attachments: AttachmentImageReader | undefined, signal?: AbortSignal): Promise<ResolvedRequestImages>;
508
+ type AnthropicBlock = Record<string, unknown>;
509
+ /**
510
+ * The indices of the system messages that KEEP their place inside `messages`.
511
+ *
512
+ * ONE PREDICATE, so the two places that must agree cannot drift: the builder
513
+ * that keeps a message in the list and the builder that folds it back into the
514
+ * top-level `system` field both read this answer.
515
+ *
516
+ * THE RULE, TRANSCRIBED from the vendor's "Mid-conversation system messages
517
+ * and tool changes" page:
518
+ *
519
+ * > A mid-conversation system message that carries content (`text`,
520
+ * > `tool_addition`, or `tool_removal` blocks) must immediately follow a
521
+ * > `user` turn (or an `assistant` turn ending in a server tool result), and
522
+ * > must either be the last entry in `messages` or be immediately followed by
523
+ * > an `assistant` turn. [...] Any other position for a message that carries
524
+ * > content [...] returns a 400 error.
525
+ *
526
+ * So a system message keeps its place only when BOTH hold:
527
+ *
528
+ * 1. the turn before it is a user turn. This line has no assistant turn that
529
+ * ends in a server tool result, so the alternative the vendor allows does
530
+ * not arise here.
531
+ * 2. it is the last entry, or the turn after it is an assistant turn.
532
+ *
533
+ * Everything else is FOLDED back into the top-level `system` field, which is
534
+ * always legal. That includes the system prompt a DSH loop puts at the very
535
+ * START of the history: it precedes the first user turn, so it is not a
536
+ * mid-conversation message at all.
537
+ *
538
+ * EVERY SYSTEM MESSAGE IS JUDGED INDEPENDENTLY. In a consecutive run, the
539
+ * second message follows another system message rather than a user turn, so it
540
+ * folds back; grouping the run would smuggle a forbidden position past the rule.
541
+ *
542
+ * A model that does not accept mid-conversation system messages folds them
543
+ * all: there, the top-level `system` field is the only place an instruction
544
+ * can live.
545
+ */
546
+ export declare function claudeSystemMessagesInPlace(options: GenerateOptions, catalog?: readonly ClaudeModelEntry[]): ReadonlySet<number>;
547
+ export declare function leadingSystemText(options: GenerateOptions, catalog?: readonly ClaudeModelEntry[]): string | undefined;
548
+ export interface ClaudeFirstPartyRequest {
549
+ version: string;
550
+ deviceId: string;
551
+ accountUuid: string;
552
+ context: ClaudeCodeFirstPartyContext;
553
+ entrypoint?: string;
554
+ }
555
+ /**
556
+ * The system array for one request: identity first, always.
557
+ *
558
+ * The identity block is not conditional on anything (see the module doc). The
559
+ * ephemeral cache marker goes on the LAST block and is ON BY DEFAULT, which is
560
+ * the Anthropic-recommended shape: a breakpoint at the end of the prompt caches
561
+ * everything above it, so marking the user block also covers the identity
562
+ * block, while marking the identity block alone would cache nothing that
563
+ * changes.
564
+ *
565
+ * @param cacheControl - false is the opt-OUT; the default requests caching.
566
+ */
567
+ export declare function buildClaudeSystemBlocks(options: GenerateOptions, cacheControl?: boolean, ttl?: ClaudeCacheTtl, firstParty?: ClaudeFirstPartyRequest, catalog?: readonly ClaudeModelEntry[]): AnthropicBlock[];
568
+ /**
569
+ * How many cache_control markers one built body carries.
570
+ *
571
+ * Walks the finished body rather than counting calls to the marker: the number
572
+ * the wire enforces is the number of markers IN THE BYTES, so a test that
573
+ * counts its own marking calls could pass while the body carried a fourth
574
+ * breakpoint from somewhere else. Used by the tests only.
575
+ */
576
+ export declare function countClaudeCacheBreakpoints(body: unknown): number;
577
+ /** Whether any message states a tool change that this wire can carry. */
578
+ export declare function claudeHasToolChanges(options: GenerateOptions): boolean;
579
+ /**
580
+ * Whether a BUILT payload carries a `tool_addition` / `tool_removal` block.
581
+ *
582
+ * Read off the body rather than from the request, so the beta header and the
583
+ * blocks it licenses cannot disagree about one request.
584
+ */
585
+ export declare function claudeBodyHasToolChanges(payload: Record<string, unknown>): boolean;
586
+ /** Options this builder reads beyond GenerateOptions. */
587
+ export interface ClaudeRequestOptions {
588
+ /**
589
+ * `options.maxTokens` is already the final ceiling, thinking included, as the
590
+ * official client's CLAUDE_CODE_MAX_OUTPUT_TOKENS: not widened for a budget.
591
+ */
592
+ maxTokensFinal?: boolean;
593
+ /** A ceiling for a caller's own max_tokens, thinking included; it only lowers. */
594
+ maxOutputLimit?: number;
595
+ /**
596
+ * Emit prompt-cache breakpoints. Default TRUE: caching is what a caller that
597
+ * states nothing gets (see the module doc). Pass false only to opt out.
598
+ *
599
+ * When on, breakpoints go on the last system block, the last block of the
600
+ * last user message, and the last tool - at most
601
+ * {@link MAX_CACHE_BREAKPOINTS} in total.
602
+ */
603
+ cacheControl?: boolean;
604
+ /**
605
+ * Prompt-cache tier for the breakpoints this request writes.
606
+ *
607
+ * Defaults to the five-minute tier so a caller that states nothing keeps the
608
+ * plain marker. The subscription line passes the one-hour tier, which is what
609
+ * the official CLI requests while a plan is drawing on included usage — and
610
+ * the `1h` value REQUIRES the extended-cache-ttl beta header, so a caller
611
+ * asking for it must also make sure that header is sent
612
+ * (`claudeBetas({ cacheTtl })`).
613
+ */
614
+ cacheTtl?: ClaudeCacheTtl;
615
+ /** First-party context; production passes this on every Messages request. */
616
+ firstParty?: ClaudeFirstPartyRequest;
617
+ /** Per-line opt-in; the catalog still decides whether speed is legal. */
618
+ fastMode?: boolean;
619
+ /**
620
+ * Tool-name translation to use. Pass the same value to createStreamState so
621
+ * the response side maps back through the identical table.
622
+ */
623
+ toolNames?: ClaudeToolNames;
624
+ /** Caller overrides for the thinking budget table. */
625
+ thinkingBudgets?: ThinkingBudgets;
626
+ /**
627
+ * The capability table this request is built against.
628
+ *
629
+ * Omitted means the shipped table, which is what every production caller
630
+ * wants. It is a parameter so that a table which says a model does NOT
631
+ * reason can be exercised: no shipped row claims that today, because an id
632
+ * this line has never heard of inherits the current-model template, and
633
+ * every current-generation model reasons. The 'no thinking field at all'
634
+ * branch is still a real one, so it is still reachable — through here.
635
+ */
636
+ catalog?: readonly ClaudeModelEntry[];
637
+ }
638
+ /**
639
+ * Build one Messages request body.
640
+ *
641
+ * Field order is fixed to the first-party capture. The server treats JSON as an
642
+ * object, but cch signs the final serialized string, so incidental reordering is forbidden.
643
+ *
644
+ * @param options - request options carrying the normalized conversation.
645
+ * @param images - images read for this request by resolveRequestImages.
646
+ * @param request - cache and translation options. Caching is the DEFAULT and
647
+ * is skipped only when request.cacheControl is explicitly false.
648
+ */
649
+ export declare function buildClaudeRequestBody(options: GenerateOptions, images?: ResolvedRequestImages, request?: ClaudeRequestOptions): Record<string, unknown>;
650
+ /**
651
+ * Whether one built body carries `thinking.block_binding`.
652
+ *
653
+ * Read off the BODY rather than re-derived from the catalog, because the header
654
+ * this answers for (THINKING_BINDING_CONTROLS_BETA) exists to license that one
655
+ * field: sent without it the field is a 400 on every request, so the header must
656
+ * follow the bytes, not a second copy of the rule that produced them.
657
+ */
658
+ export declare function claudeBodyBindsThinking(body: Record<string, unknown>): boolean;
659
+ /** One tool_use block accumulating across input_json_delta fragments. */
660
+ interface PendingToolCall {
661
+ /** Index of the DSH block this call occupies. */
662
+ index: number;
663
+ /** Wire id, kept beside the DSH-block id so a replay is byte-exact. */
664
+ id: string;
665
+ /** The name the CALLER declared, which is what DSH dispatches on. */
666
+ name: string;
667
+ /** The name the WIRE carried, which is what a replay must send back. */
668
+ wireName: string;
669
+ /** Concatenated partial_json fragments, verbatim. */
670
+ arguments: string;
671
+ }
672
+ /** One text block currently receiving deltas. */
673
+ interface OpenTextBlock {
674
+ index: number;
675
+ text: string;
676
+ }
677
+ /**
678
+ * One open thinking or redacted_thinking block.
679
+ *
680
+ * Its text streams to the caller as it arrives; this record accumulates the
681
+ * same text, the signature (which arrives at the END of the block) and a
682
+ * redacted block's payload, for the replay entry written when it closes. A
683
+ * redacted block's payload is never paraphrased into visible reasoning text.
684
+ */
685
+ interface PendingThinking {
686
+ index: number;
687
+ kind: 'thinking' | 'redacted_thinking';
688
+ text: string;
689
+ signature: string;
690
+ data: string;
691
+ }
692
+ /** Accumulated state of one Anthropic SSE stream. */
693
+ export interface ClaudeStreamState {
694
+ /** Emitted blocks by DSH index; a slot exists from the moment its block opens. */
695
+ blocks: ContentBlock[];
696
+ /** Anthropic content index -> the DSH index of the open text block. */
697
+ openText: Map<number, OpenTextBlock>;
698
+ /** Anthropic content index -> the accumulating tool call. */
699
+ toolCalls: Map<number, PendingToolCall>;
700
+ /** Anthropic content index -> an open thinking block. */
701
+ pending: Map<number, PendingThinking>;
702
+ /**
703
+ * Anthropic content index -> the wire block that produced the emitted block.
704
+ *
705
+ * A slot is `null` - never `undefined` - when a block has no verbatim wire
706
+ * form to replay. That is not cosmetic: this array goes into the finish
707
+ * chunk's replayState, DSH validates every stream chunk as lossless JSON, and
708
+ * `undefined` is not a JSON value, so a hole here costs the caller the WHOLE
709
+ * turn ("Assistant stream chunk must be losslessly JSON-serializable") rather
710
+ * than one replay entry. See {@link jsonSafeValue}.
711
+ */
712
+ replayBlocks: (Record<string, unknown> | null)[];
713
+ /** Tool-name translation the response side maps back through. */
714
+ toolNames: ClaudeToolNames | undefined;
715
+ sawMessageStart: boolean;
716
+ sawMessageStop: boolean;
717
+ hasContent: boolean;
718
+ hasToolCall: boolean;
719
+ /** Anthropic stop_reason, verbatim. */
720
+ finishReason: string | null;
721
+ /** `stop_details.explanation` from the final message_delta, when stated. */
722
+ stopExplanation?: string;
723
+ /**
724
+ * The wire `error` object of an in-band `error` event, recorded just before
725
+ * the mapper throws on it. The mapper cannot tell whether anything has reached
726
+ * the caller yet; the adapter can, and reads this to decide whether the failure
727
+ * is still safe to retry (see the adapter's `inBandStreamVerdict`).
728
+ */
729
+ streamError?: Record<string, unknown>;
730
+ inputTokens: number;
731
+ outputTokens: number;
732
+ cacheReadTokens: number;
733
+ cacheWriteTokens: number;
734
+ /** Estimate from the streamed (possibly summarized) thinking text. */
735
+ reasoningTokens: number;
736
+ /**
737
+ * The server's own `usage.output_tokens_details.thinking_tokens`, when stated.
738
+ * It counts the RAW reasoning, which the summarized text returned on Claude 4+
739
+ * models understates, so it outranks the estimate above.
740
+ */
741
+ reportedReasoningTokens: number | undefined;
742
+ speed?: 'standard' | 'fast';
743
+ serviceTier?: string;
744
+ inferenceGeo?: string;
745
+ sawUsage: boolean;
746
+ finished: boolean;
747
+ }
748
+ /**
749
+ * Fresh stream state.
750
+ *
751
+ * @param toolNames - the SAME ClaudeToolNames the request was built with, so a
752
+ * returned canonical tool name maps back to the spelling the caller declared.
753
+ * Omitted means names pass through unchanged.
754
+ */
755
+ export declare function createStreamState(toolNames?: ClaudeToolNames): ClaudeStreamState;
756
+ /**
757
+ * Map Anthropic's usage counters onto DSH's.
758
+ *
759
+ * The counts are DISJOINT in the same way DSH documents: input_tokens EXCLUDES
760
+ * the cache counters, which arrive separately as cache_read_input_tokens and
761
+ * cache_creation_input_tokens. Nothing is summed into inputTokens here - doing
762
+ * so would double-count every cached turn - and the three are simply reported
763
+ * side by side, which is also why cacheWriteTokens is mapped even though the
764
+ * brief only named the read side: dropping a number the wire sent would make
765
+ * the billed-input total unaccountable.
766
+ */
767
+ export type ClaudeTokenUsage = TokenUsage & {
768
+ speed?: 'standard' | 'fast';
769
+ service_tier?: string;
770
+ inference_geo?: string;
771
+ };
772
+ /**
773
+ * Flush every open block, then emit usage and the terminal finish.
774
+ *
775
+ * Idempotent: message_stop already closes the stream, so the adapter's own call
776
+ * after the body ends is a no-op rather than a duplicate finish. This function
777
+ * deliberately does NOT judge whether the stream was complete - that is
778
+ * assertStreamComplete's job, kept separate so the flush and the verdict can be
779
+ * reasoned about independently.
780
+ */
781
+ export declare function closeStream(state: ClaudeStreamState): StreamChunk[];
782
+ /**
783
+ * Assert the stream reached its terminal event.
784
+ *
785
+ * A stream that ended without message_stop is a severed reply, not a completed
786
+ * answer: everything already emitted is a prefix of something the model never
787
+ * finished saying, and flushing it as a clean stop is precisely the failure
788
+ * this check exists to prevent.
789
+ */
790
+ export declare function assertStreamComplete(state: ClaudeStreamState): void;
791
+ /**
792
+ * Feed one SSE line of a Messages response into the state.
793
+ *
794
+ * Emits DSH chunks for the events that carry content and ignores everything
795
+ * else, including the 'event:' line (the payload's own type is authoritative)
796
+ * and any event type this build does not know. An 'error' event THROWS: the
797
+ * reply is over, and continuing to flush it as a clean stop would report a
798
+ * wrong answer as a successful one.
799
+ */
800
+ export declare function processStreamLine(line: string, state: ClaudeStreamState): StreamChunk[];
801
+ export {};
802
+ //# sourceMappingURL=mapper.d.ts.map