@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,312 @@
1
+ import { LlmError, type ContentBlock, type GenerateOptions, type OutboundContentBlock, type StreamChunk } from '../common/llm-compat.ts';
2
+ import { type ResolvedRequestImages } from '../common/request-images.ts';
3
+ import type { GlmReasoningEffort, GlmRegion } from '../../shared/glm-coding-plan-contracts.ts';
4
+ /**
5
+ * Anthropic Messages 协议版本头。
6
+ *
7
+ * 取值来自 Anthropic 公开协议常量,兄弟线路同值(`../kimi-code/client.ts:129` 的
8
+ * `'anthropic-version': '2023-06-01'`)。本线路网关是否**强制**要求这个头没有任何实测
9
+ * 样本(**未验证**,缺一条缺头的 4xx 样本),但发一个正确版本号的成本是零,所以照发。
10
+ */
11
+ export declare const GLM_ANTHROPIC_VERSION = "2023-06-01";
12
+ /**
13
+ * 本线路「这个选项在 Anthropic 面上送不出去」的稳定错误码。
14
+ *
15
+ * 语义与 harness 的 `HarnessError.code` 一致:稳定的机器可路由码,不要去解析 message。
16
+ * 存在的理由是**不许静默忽略**——一个送不出去的选项如果被悄悄丢掉,用户看到的是一个
17
+ * 「按默认设置跑」的回合,而不是一次能指认到具体选项的失败。
18
+ * 这条码不在任何线路的重试集合里(各线路 `retryableCodes` 只含 RATE_LIMIT / SERVER /
19
+ * TIMEOUT / TRANSPORT 等),所以抛出后不会被重试策略放大。
20
+ */
21
+ export declare const UNSUPPORTED_OPTION_CODE = "UNSUPPORTED_OPTION";
22
+ /** Anthropic 内容块在线上是普通 JSON 对象。 */
23
+ export type AnthropicBlock = Record<string, unknown>;
24
+ /**
25
+ * Anthropic 面的完整 URL:`{模型面 base}{CHAT_PATH_ANTHROPIC}/v1/messages`。
26
+ *
27
+ * base 取 `./types.ts` 的 `apiBaseForRegion`(国际区 `https://api.z.ai`、
28
+ * 国区 `https://open.bigmodel.cn`,都受 `DSH_GLM_*_API_HOST` 覆盖),路径前缀取同文件
29
+ * 的 `CHAT_PATH_ANTHROPIC`。区域是**凭据的属性**(计划 `1、`3.3),所以调用方必须把
30
+ * 账号的区域传进来,而不是让这里去猜——猜错的代价是拿另一区的主机去验一把本区 Key,
31
+ * 得到的是明确鉴权失败。
32
+ *
33
+ * @param region - 账号所属部署。
34
+ * @param env - 环境变量表,默认 `process.env`(覆盖值在调用时读取,便于测试注入)。
35
+ */
36
+ export declare function glmAnthropicUrl(region: GlmRegion, env?: NodeJS.ProcessEnv): string;
37
+ /**
38
+ * Anthropic 面请求头,认证是**双头**且同值。
39
+ *
40
+ * `x-api-key` 与 `Authorization: Bearer <key>` 各发一份:官方源码逐字写明这个兼容网关
41
+ * 同时读取两者(`model/model-execution.ts:425-437`,计划 `3.3)。只发一个的后果是
42
+ * 401 `AUTH_MISSING`(1001),而那一条正文说的是「凭据没出现在头部里」,会把排查引向
43
+ * 凭据存储而不是认证头。
44
+ *
45
+ * `extra` 覆盖不了认证三件套(两个认证头 + 协议版本头):它们不是「调用方想改就改」的
46
+ * 普通头,而是本面必须成对出现的协议事实,让一个 `extra` 把双头拆成不同值或只留一个,
47
+ * 造出来的故障比不带 extra 更难查。
48
+ *
49
+ * @param apiKey - Coding Plan Key(兑换链拼出的 `{apiKey}.{secretKey}`)。空白即抛 AUTH。
50
+ * @param extra - 追加请求头(调试、代理)。不能改写认证三件套。
51
+ */
52
+ export declare function glmAnthropicHeaders(apiKey: string, extra?: Record<string, string>): Record<string, string>;
53
+ /**
54
+ * 把 DSH 的档位收敛到该模型真实接受的梯子上。
55
+ *
56
+ * 跨两套词汇表排名(`none`/`minimal`/`low`/`medium`/`high`/`xhigh`/`max` 与上游的三档
57
+ * 一起排)之后取最近一档,平手向上取——与本仓库其余各线路的收敛一致,宁可多想一点,
58
+ * 也不要少想。排名表在 `./types.ts` 的 `convergeGlmEffort()` 内,本文件不复制一份。
59
+ *
60
+ * 三个返回值含义不同,都不是「猜」:
61
+ *
62
+ * - `ladder` 为空 → `null`:该模型不接受思考档位,调用方据此**不发**任何档位字段,
63
+ * 而不是发一个模型不认的值。
64
+ * - 调用方没指定档位 → `null`:模型的服务端默认生效,映射层不代它选。
65
+ * - 其余 → 模型梯子上真实存在的那一档。
66
+ *
67
+ * @param ladder - 模型目录为该模型声明的真实梯子(`GlmModelOption.reasoningEfforts`)。
68
+ * @param requested - 调用方给的档位(DSH 的 `ReasoningEffortId`,可为空)。
69
+ */
70
+ export declare function glmEffortForLadder(ladder: readonly string[], requested: string | undefined | null): GlmReasoningEffort | null;
71
+ /** 一次请求的思考控制。 */
72
+ export interface GlmThinkingControl {
73
+ /** 要写进请求体的字段;为空表示这条请求不带任何思考控制。 */
74
+ fields: Record<string, unknown>;
75
+ /** 模型这次会不会思考。用于判断与思考互斥的选项(例如 temperature)。 */
76
+ thinking: boolean;
77
+ }
78
+ /**
79
+ * 请求体里的思考控制字段:**开/关**由 `thinking.type` 说,**深度**由 `output_config.effort` 说。
80
+ *
81
+ * 形状逐字照官方开源客户端 `zai-org/ZCode` 的 `config/provider/zcode-builtin.json`
82
+ * (`modelConfigRules.modelApiRules` 里 `apiTypeMatch: "anthropic-messages"` 的逐模型 map):
83
+ *
84
+ * - `.*glm-5\.3.*`(GLM-5.3 / GLM-5.3-Flash):
85
+ * `{"thinking":{"type":"enabled"},"output_config":{"effort": reasoningLevel}}`
86
+ * ——这一族**没有** `disabled` 分支,所以官方也没给 `disabled` 这个档位值。
87
+ * - `.*GLM-5\.2.*`:`reasoningLevel == "disabled" ? {"thinking":{"type":"disabled"}} :
88
+ * {"thinking":{"type":"enabled"},"output_config":{"effort": reasoningLevel}}`
89
+ * - `.*GLM-5-Turbo.*`:`{"thinking":{"type": reasoningLevel == "enabled" ? "enabled" : "disabled"}}`
90
+ * ——它没有档位梯子,所以官方那条 map **不带** `output_config`。
91
+ *
92
+ * 顶层 `reasoning_effort` **不发**:官方全仓 `reasoning_effort` 零命中,
93
+ * 顶层那个字段只出现在 OpenAI 面的 map 里。
94
+ *
95
+ * 「调用方要不要关思考」用 DSH 的档位词汇 `none` 表达(与 `../qoder/mapper.ts` 的
96
+ * `resolveQoderThinking` 同一词汇),并且**只在该模型声明可关时**才生效:
97
+ * 声明可关 = 目录的 `thinkingDisableable`(逐模型事实,见 `./model-catalog.ts`)。
98
+ * 不声明可关的模型收到 `none` 时仍按梯子收敛到最低档(GLM-5.3 家族会落 `low`),
99
+ * 因为官方规则集里那一族的 `values` 就没有 `disabled`。
100
+ *
101
+ * @param ladder - 模型真实梯子。
102
+ * @param requested - 调用方给的档位(`none` 表示不要思考)。
103
+ * @param sendReasoningEffort - 是否把收敛后的档位发进 `output_config`,默认 true。
104
+ * @param thinkingDisableable - 该模型是否接受关闭思考,默认 false(不声明就不发关闭值)。
105
+ */
106
+ export declare function glmThinkingControl(ladder: readonly string[], requested: string | undefined | null, sendReasoningEffort?: boolean, thinkingDisableable?: boolean): GlmThinkingControl;
107
+ /** 签名思考块回放的来源绑定范围。 */
108
+ export interface GlmAnthropicReplayScope {
109
+ readonly provider?: string;
110
+ readonly route?: string;
111
+ readonly model: string;
112
+ }
113
+ /**
114
+ * 给最后一个可缓存块挂上缓存断点;一个可缓存块都没有就**不动**。
115
+ *
116
+ * 「最后一个」而不是「最后一个块」:一条消息的末尾可能是不可缓存的空块,
117
+ * 断点要落在它前面那个真正有内容的块上,否则这一轮的前缀缓存等于没开。
118
+ *
119
+ * 导出是为了让这条边界能被直接断言(空块不带断点、不可缓存块不带断点)。
120
+ */
121
+ export declare function glmAnthropicMarkCacheBreakpoint(content: AnthropicBlock[]): AnthropicBlock[];
122
+ /**
123
+ * 全部 system 贡献 → 开头的一段 `system` **块数组**。
124
+ *
125
+ * 形状对齐官方客户端(AI SDK 的 Anthropic 转换:每条 system 消息一块文本块),
126
+ * 而不是把全部 system 拼成一条字符串——块数组才能让缓存断点落在 system 上。
127
+ *
128
+ * 折叠顺序与内容都不变:`options.system` 在前、历史里的 system 消息按序在后,
129
+ * 是一个与轮次无关的稳定折叠(提示词是服务端要缓存的前缀,任何一处每轮变化
130
+ * 都会让整个缓存前缀失效)。
131
+ *
132
+ * **只换形状,不换内容**:块的切分点就是旧实现里 `\n\n` 的位置——分隔符留在前一块的
133
+ * 末尾,所以把各块文字拼起来与旧的「拼成一条」**逐字相同**。改动的是请求体的形状
134
+ * (字符串 → 块数组),不是模型看到的提示词。
135
+ *
136
+ * 空贡献**不产块**:空文本块既不承载内容也不该占断点。
137
+ *
138
+ * 末块带 `cache_control: {type:'ephemeral'}`:长 system 提示词是前缀缓存里最值钱
139
+ * 的一段(每次都要重发),而 Anthropic 允许一次请求最多 4 个断点。
140
+ */
141
+ export declare function glmAnthropicSystemBlocks(options: GenerateOptions): AnthropicBlock[];
142
+ /** 本面这一次请求的构建选项。 */
143
+ export interface GlmAnthropicRequestOptions {
144
+ /** 模型目录为该模型声明的真实思考梯子。空数组 = 该模型不接受思考档位。 */
145
+ ladder?: readonly string[];
146
+ /** 这次请求读到的图片(`resolveRequestImages` 的产物)。 */
147
+ images?: ResolvedRequestImages;
148
+ /** 是否把收敛后的档位发进 `output_config.effort`,默认 true。见 {@link glmThinkingControl}。 */
149
+ sendReasoningEffort?: boolean;
150
+ /**
151
+ * 该模型是否接受关闭思考,默认 false。
152
+ *
153
+ * 取目录的 `thinkingDisableable`(逐模型事实,见 `./model-catalog.ts`):
154
+ * 官方规则集里 GLM-5.2 / GLM-5-Turbo 的 `reasoningLevel.values` 含 `disabled`,
155
+ * GLM-5.3 家族不含。**不声明就不发关闭值**——发一个模型不认的值会被上游当错误拒绝。
156
+ */
157
+ thinkingDisableable?: boolean;
158
+ /** 调用方不指定输出上限时用的值,默认 `./types.ts` 的 `DEFAULT_MAX_TOKENS`。 */
159
+ defaultMaxTokens?: number;
160
+ /** 已签名思考块回放校验范围(可选;缺省时自动按当前 `PROVIDER_ID` + `options.model` 匹配)。 */
161
+ replayScope?: GlmAnthropicReplayScope;
162
+ }
163
+ /**
164
+ * 构造一个 Anthropic Messages 请求体。
165
+ *
166
+ * 字段顺序对服务端无意义,只是读起来顺。
167
+ *
168
+ * @param options - harness 归一化后的会话(`normalizeGenerateOptions` 的产物)。
169
+ * @param request - 该模型的档位梯子与已读图片。
170
+ */
171
+ export declare function buildGlmAnthropicRequest(options: GenerateOptions, request?: GlmAnthropicRequestOptions): Record<string, unknown>;
172
+ /** 一个跨多个 content-block 增量累积的工具调用。 */
173
+ interface PendingToolCall {
174
+ /** 这个调用占的 DSH 块下标。 */
175
+ index: number;
176
+ id: string;
177
+ name: string;
178
+ /** 逐字拼接的 partial_json 片段。 */
179
+ arguments: string;
180
+ }
181
+ /** 一个正在接收增量的思考块。 */
182
+ interface PendingThinking {
183
+ index: number;
184
+ kind: 'thinking' | 'redacted_thinking';
185
+ text: string;
186
+ signature: string;
187
+ data: string;
188
+ }
189
+ /** 一个 Messages 响应的累积状态。 */
190
+ export interface GlmAnthropicStreamState {
191
+ /** 按 DSH 下标排列的已发块;块一开就占位。 */
192
+ blocks: OutboundContentBlock[];
193
+ /** 与 `blocks` 下标对齐的原生已签名思考块(无签名块为 null)。 */
194
+ replayBlocks: Array<AnthropicBlock | null>;
195
+ /** 本次响应的来源绑定(用于写出可验证的 replayState)。 */
196
+ provenance?: GlmAnthropicReplayScope;
197
+ /** wire content index -> 正在接收文本的那个块。 */
198
+ openText: Map<number, {
199
+ index: number;
200
+ text: string;
201
+ }>;
202
+ /** wire content index -> 累积中的工具调用。 */
203
+ toolCalls: Map<number, PendingToolCall>;
204
+ /** wire content index -> 打开着的思考块。 */
205
+ pending: Map<number, PendingThinking>;
206
+ hasContent: boolean;
207
+ hasToolCall: boolean;
208
+ /** wire 的 `stop_reason`,逐字保留。 */
209
+ finishReason: string | null;
210
+ /** 带内 `error` 事件的原始对象,记下来供适配层判断此刻还能不能安全重试。 */
211
+ streamError?: Record<string, unknown>;
212
+ sawMessageStart: boolean;
213
+ sawMessageStop: boolean;
214
+ inputTokens: number;
215
+ outputTokens: number;
216
+ cacheReadTokens: number;
217
+ cacheWriteTokens: number;
218
+ /** 结束之前是否真的见过 usage;没见过就不发 usage 块(零值 usage 是谎报)。 */
219
+ sawUsage: boolean;
220
+ finished: boolean;
221
+ }
222
+ /** 新的一次响应的流状态。 */
223
+ export declare function createGlmAnthropicStreamState(provenance?: GlmAnthropicReplayScope): GlmAnthropicStreamState;
224
+ /**
225
+ * 冲掉所有打开的块,然后发 usage,最后发终止的 finish。
226
+ *
227
+ * 顺序是协议义务:**usage 必须在 finish 之前,finish 之后不得再有任何块**
228
+ * (DSH 的 `StreamChunk` 文档逐字这么写)。所以本函数把 usage 排在 finish 前一行,
229
+ * 而 {@link processGlmAnthropicStreamLine} 一旦 `finished` 为真就返回空数组——
230
+ * 迟到的增量不会变成 finish 之后的块。
231
+ *
232
+ * 幂等:`message_stop` 已经关过流,适配层在响应体结束后再调一次是空操作而不是第二个 finish。
233
+ * 本函数**不**判断流是否完整,那是 {@link assertGlmStreamComplete} 的事。
234
+ */
235
+ export declare function closeGlmAnthropicStream(state: GlmAnthropicStreamState): StreamChunk[];
236
+ /**
237
+ * 流没有走到终止事件 = 被截断的回复,不是完整答案。
238
+ *
239
+ * 已经发出的内容只是模型没说完那句话的前缀,把它冲成一个干净 stop 就是把一次截断
240
+ * 报成一次成功——这正是这条检查存在的理由。
241
+ */
242
+ export declare function assertGlmStreamComplete(state: GlmAnthropicStreamState): void;
243
+ /** 这一路流有没有带出任何内容。 */
244
+ export declare function glmStreamHasContent(state: GlmAnthropicStreamState): boolean;
245
+ /**
246
+ * 把一条 Messages SSE 行喂进状态,返回这一行该发出的 DSH 块。
247
+ *
248
+ * 忽略不携带内容的行:SSE 注释(心跳)、`event:` 名字行(载荷自带的 `type` 才是权威)、
249
+ * 空行与本构建不认识的事件类型。`error` 事件**抛错**:回复已经结束,
250
+ * 继续把它冲成一个干净 stop 等于把错误答案报成成功答案。
251
+ *
252
+ * @param line - 一行 SSE 文本(不要求带换行)。
253
+ * @param state - 本次响应的累积状态。
254
+ */
255
+ export declare function processGlmAnthropicStreamLine(line: string, state: GlmAnthropicStreamState): StreamChunk[];
256
+ /** 一次上游失败的机器可读判读结果。 */
257
+ export interface GlmUpstreamErrorVerdict {
258
+ /** 该转成哪一个 `LlmError.code`(重试策略按它判读)。 */
259
+ llmCode: string;
260
+ /**
261
+ * 这一类失败值不值得重试。
262
+ *
263
+ * 判据来自 `./types.ts` 的 `ERROR_CODE` 注释与官方客户端的业务码表
264
+ * (`zai-org/ZCode` 的 `failure-provider-business-codes.ts`):官方把 1303 / 1312 /
265
+ * 1305 / 1302 与两条 500 恢复类判成可恢复,其余全部不可重试——重试一次确定的失败
266
+ * 只会把它拖成多次,并在额度类错误上多烧一次额度。
267
+ * `USAGE_LIMIT` / `PLAN_LIMIT` 带重置时刻,正确处置是等窗口重置而不是立刻重试。
268
+ *
269
+ * **这个字段与 `llmCode` 必须同时成立**:宿主按 `LlmError.code` 判可重试
270
+ * (重试集合见 `./adapter.ts`),所以不可重试的一律落在 `QUOTA` / `PROVIDER_ERROR` /
271
+ * `AUTH` / `INVALID_ARGS` / `NOT_FOUND` 这些**不在**重试集合里的码上。
272
+ */
273
+ retryable: boolean;
274
+ /** 正文给出的业务码;没有则是 null。 */
275
+ businessCode: number | null;
276
+ /** HTTP 状态;调用方没给则是 null。 */
277
+ status: number | null;
278
+ /** 面向人的处置说明。 */
279
+ disposition: string;
280
+ }
281
+ /**
282
+ * 把一次上游失败判读成机器可路由的结论。
283
+ *
284
+ * 分类**不能停在状态行**:多个真实条件共用同一个 HTTP 状态(表里 429 有十几条,
285
+ * 401 有四条),所以正文里的业务码才是判据,状态行只在本面没给出业务码时兜底。
286
+ *
287
+ * 两个兜底方向都是有意选的:
288
+ *
289
+ * - 未知 5xx → 可重试(传输面故障,语义上与 OVERLOADED 同族)。
290
+ * - 未知 429 → **不可重试**。本表里绝大多数 429 是额度类或终局的限流类,立即重试只会
291
+ * 继续失败,还会多烧一次额度;宁可让调用方等一下也不要把它变成重试风暴。
292
+ *
293
+ * @param input - HTTP 状态(可选)与上游正文(可选)。
294
+ */
295
+ export declare function classifyGlmUpstreamError(input: {
296
+ status?: number | undefined;
297
+ body?: unknown;
298
+ }): GlmUpstreamErrorVerdict;
299
+ /**
300
+ * 构造一次上游失败(不抛,交给调用方决定抛点)。
301
+ *
302
+ * 让调用方(适配层)既拿到 `LlmError` 的稳定 code,又拿到「这次到底该不该重试」的
303
+ * 判读结果——两者不是一回事:code 决定路由,retryable 决定重试策略。
304
+ *
305
+ * @param input - HTTP 状态(可选)与上游正文(可选)。
306
+ */
307
+ export declare function glmUpstreamError(input: {
308
+ status?: number | undefined;
309
+ body?: unknown;
310
+ }): LlmError;
311
+ export type { ContentBlock };
312
+ //# sourceMappingURL=mapper-anthropic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapper-anthropic.d.ts","sourceRoot":"","sources":["../../../../src/host/glm-coding-plan/mapper-anthropic.ts"],"names":[],"mappings":"AAyFA,OAAO,EAIL,QAAQ,EACR,KAAK,YAAY,EAEjB,KAAK,eAAe,EAEpB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAA;AAKhC,OAAO,EAKL,KAAK,qBAAqB,EAC3B,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAA;AAY9F;;;;;;GAMG;AACH,eAAO,M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GASG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,uBAAuB,GAC7B,WAAW,EAAE,CA8Kf;AAMD,uBAAuB;AACvB,MAAM,WAAW,uBAAuB;IACtC,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAA;IACf;;;;;;;;;;;;OAYG;IACH,SAAS,EAAE,OAAO,CAAA;IAClB,0BAA0B;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,4BAA4B;IAC5B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,gBAAgB;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAgED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GACrD,uBAAuB,CA6BzB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,QAAQ,CAcjG;AAED,YAAY,EAAE,YAAY,EAAE,CAAA"}
@@ -0,0 +1,213 @@
1
+ /**
2
+ * GLM(ZCode 账号)线路的 **OpenAI 兼容面**(协议 B)线映射。
3
+ *
4
+ * 上游面是 Coding Plan 专用的 OpenAI Chat Completions 形状,地址为
5
+ * `{apiBaseForRegion(region)}` + `CHAT_PATH_OPENAI`(= `/api/coding/paas/v4`),
6
+ * 实际调用 `/api/coding/paas/v4/chat/completions` 与 `/api/coding/paas/v4/models`。
7
+ *
8
+ * **刻意不是 `/api/paas/v4`**:那是通用开放平台面,官方文档的 Common mistakes 段写明
9
+ * 走那个面套餐额度不会正确生效(计划 §3.3,证据等级 A)。也就是说发错前缀不会报错,
10
+ * 用户只会看到「明明买了套餐却在扣余额」,所以前缀由 `./types.ts` 的常量固定,不在此处拼。
11
+ *
12
+ * 本文件吸收的四处与 OpenAI 默认形状不同的地方,每一处都有来源:
13
+ *
14
+ * 1. **思考在 `delta.reasoning_content`**,不是 OpenAI 的 `reasoning_summary`,
15
+ * 落到 DSH 的 reasoning block。逐字来源:本仓库历史提交 `9ad8a53` 的
16
+ * `src/host/zhipu/mapper.ts` 实测转录。
17
+ * 2. **`reasoning_effort` 只接受模型自己的梯子**(GLM-5.x 为 `low`/`high`/`max`),
18
+ * 别的取值上游直接报错(业务码 1214 INVALID_PARAM,见 `ERROR_CODE` 表)。
19
+ * DSH 的档位词汇更宽(`minimal`/`medium`/`xhigh` 在别的线路上都存在),
20
+ * 因此每个取值先经 `convergeGlmEffort()` 落到梯子上再发。该函数跨两套词汇表排名,
21
+ * `none`/`minimal` 也有位置可落——只排三档会把 `minimal` 误升成 `high`,
22
+ * 那正是本仓库历史记录过的 bug(见 `./types.ts` 的 `convergeGlmEffort` 注释)。
23
+ * 3. **不发 `thinking.type`**。`thinking` 的默认是 enabled,而 GLM-5.3 /
24
+ * GLM-5.3-FLASH / GLM-4.7 把 `thinking.type: "disabled"` 当**错误**,
25
+ * 所以本线路任何模型都不发关闭值,直接省略该字段(同上,历史 mapper 注释)。
26
+ * 4. **不发 `stream_options`**。上游的流式文档里 usage 对象是随末帧到的,
27
+ * 该字段也不在文档化的请求 schema 里;给这个 API 发一个未文档化的字段,
28
+ * 代价可能只是一个毫无收益的 400(同上,历史 mapper 注释)。
29
+ *
30
+ * **未验证**:以上第 1-4 条全部来自 `9ad8a53` 的历史实测转录,本轮**没有实机账号**
31
+ * (计划 D9、R1),因此没有一次 live 复核。缺的是一份真实 SSE 帧样本与一份真实 400 响应样本。
32
+ * 结构性的部分(字段名、认证头形状)证据等级 A;行为性的部分(哪些取值会被拒)
33
+ * 只到「历史实测记录」这一层。
34
+ */
35
+ import { LlmError, type GenerateOptions, type OutboundContentBlock, type StreamChunk } from '../common/llm-compat.ts';
36
+ import type { GlmRegion } from '../../shared/glm-coding-plan-contracts.ts';
37
+ import type { AttachmentStore } from '@deepseek-ai/dsh-attachment';
38
+ /**
39
+ * 本文件自己用的失败码:调用方要求了一件这个面做不到的事。
40
+ *
41
+ * 与上游那张业务码表不是一回事——`ERROR_CODE` 说的是上游说了什么,
42
+ * 这一个说的是本线路在发请求之前就知道做不到。处置因此不同:后者不该重试,
43
+ * 也不该让用户以为「上游出问题了」,而是换模型或换调用方式。
44
+ *
45
+ * 取值是 harness 的**通用码** `UNSUPPORTED_OPTION`,不是本线路自造的:harness 自己的
46
+ * provider 就在用同一个串(`packages/llm/llm-pi-ai/src/adapter.ts:335` 抛的是
47
+ * `new LlmError('llm-pi-ai does not support GenerateOptions.stop', 'UNSUPPORTED_OPTION')`),
48
+ * 本线路的 Anthropic 面(`mapper-anthropic.ts`)也用同一个串。
49
+ *
50
+ * 所以两个面共用一个码:装配层要判断「这个面做不到这件事」时,只有一个词要认,
51
+ * 而不是先问是哪个面。自造一个带线路前缀的码会让调用方多学一个词,
52
+ * 也会让同一个线路的两面出现两个说法。
53
+ */
54
+ export declare const UNSUPPORTED_OPTION_CODE = "UNSUPPORTED_OPTION";
55
+ /** 上游 Chat Completions 路径,接在 `CHAT_PATH_OPENAI` 之后。 */
56
+ export declare const CHAT_COMPLETIONS_SEGMENT = "/chat/completions";
57
+ /** 上游模型清单路径,接在同一个 `CHAT_PATH_OPENAI` 之后。 */
58
+ export declare const MODELS_SEGMENT = "/models";
59
+ /** 本面一个完整请求的 URL:`{apiBase}{CHAT_PATH_OPENAI}/chat/completions`。 */
60
+ export declare function chatCompletionsUrl(region: GlmRegion, env?: NodeJS.ProcessEnv): string;
61
+ /** 本面模型清单的 URL:`{apiBase}{CHAT_PATH_OPENAI}/models`。 */
62
+ export declare function modelsUrl(region: GlmRegion, env?: NodeJS.ProcessEnv): string;
63
+ /**
64
+ * OpenAI 兼容面的请求头。
65
+ *
66
+ * 认证是 `Authorization: Bearer {credential}`,credential 是兑换链换出来的
67
+ * `{id}.{secret}` Coding Plan Key(计划 §3.2、§3.3)。
68
+ *
69
+ * **刻意不发 `x-api-key`**:双头是 **Anthropic 兼容面**的性质,官方源码注释逐字写着
70
+ * 「Anthropic 兼容网关会同时读取 x-api-key 和 Bearer Authorization」
71
+ * (`model/model-execution.ts:425-437`,计划 §3.3)。本面只读 Bearer,
72
+ * 多发一个头不会更好,只会让日后复审误以为两面共用一套认证。
73
+ *
74
+ * 配额接口则**反过来**用裸 Key、不加 Bearer(见 `./types.ts` 的 `QUOTA_PATH` 注释),
75
+ * 那是另一条路,不归本文件管。
76
+ */
77
+ export declare function glmOpenAiHeaders(credential: string, extra?: Record<string, string>): Record<string, string>;
78
+ /**
79
+ * 调用方(适配器)交给本映射的**逐模型**能力声明。
80
+ *
81
+ * 存在的原因是一条硬规则:**能力不得从模型名推断**(计划 §1、§7)——
82
+ * 历史草案记录过 `glm-5.3-flash` 收图而 `glm-5.3` 不收、`glm-5.2` 两个档位而
83
+ * `glm-5.3` 三个。所以本文件只读声明,绝不看 `options.model` 里的字符串。
84
+ */
85
+ export interface GlmOpenAiModelRoute {
86
+ /**
87
+ * 该模型真实接受的思考档位梯子(目录逐行给出)。
88
+ *
89
+ * 空数组表示它不接受 `reasoning_effort`,此时本文件**不发**该字段:
90
+ * `convergeGlmEffort` 对空梯子返回 null,调用方据此不发,而不是发一个模型不认的值。
91
+ */
92
+ readonly reasoningEfforts: readonly string[];
93
+ /** 是否接受 image 输入。 */
94
+ readonly supportsImages: boolean;
95
+ /**
96
+ * 调用方未给 `maxTokens` 时本线路请求的输出上限。
97
+ *
98
+ * 缺省取 `DEFAULT_MAX_TOKENS`,那个常量在 `./types.ts` 里已标注**未验证**
99
+ * (它不是任何 GLM-5.x 模型的官方上限,只是历史兜底值)。
100
+ */
101
+ readonly defaultMaxTokens?: number;
102
+ }
103
+ /**
104
+ * 目录尚未落地时使用的保守声明。
105
+ *
106
+ * 两项都取「什么都不发」的一侧:梯子为空 → 不发 `reasoning_effort`(让上游用自己的默认),
107
+ * 不认图 → 请求里的图片按「读不出来」明说,而不是发一个上游会拒的 `image_url`。
108
+ * 这不是对能力的判断,是「没有声明就不主张」。
109
+ */
110
+ export declare const UNDECLARED_MODEL_ROUTE: GlmOpenAiModelRoute;
111
+ /** 本面需要的附件接缝:一个持久图片的已验证字节。 */
112
+ export type AttachmentImageReader = Pick<AttachmentStore, 'readImage'>;
113
+ /** 一个请求内已解析的持久图片,或「已证明读不出来」。 */
114
+ export type ResolvedRequestImage = {
115
+ readonly kind: 'inline';
116
+ readonly mediaType: string;
117
+ readonly data: string;
118
+ } | {
119
+ readonly kind: 'unavailable';
120
+ };
121
+ /** 按持久附件 id 索引的图片;由一次请求构建消费。 */
122
+ export type ResolvedRequestImages = ReadonlyMap<string, ResolvedRequestImage>;
123
+ /**
124
+ * 一次请求允许携带的 base64 图片上限:12 MB。
125
+ *
126
+ * 取本仓库其余 OpenAI 形状线路的同一个值(`zhipu` 的同名常量),
127
+ * 理由是让图文与工具 schema 留在同一个 body 里。
128
+ *
129
+ * **未验证**:GLM Coding Plan 这个面对单请求图片字节的真实上限没有实测样本,
130
+ * 缺一份超限请求的真实响应。W5 的客户端一旦拿到真实 413/1214 响应即可调整此值。
131
+ */
132
+ export declare const MAX_REQUEST_IMAGE_BYTES: number;
133
+ /**
134
+ * 一次请求的图片字节超出 {@link MAX_REQUEST_IMAGE_BYTES} 时,把最老的内联图片换成占位文本。
135
+ *
136
+ * 持久历史不动,只改即将发出的那一份请求。
137
+ */
138
+ export declare function offloadOldestRequestImages(options: GenerateOptions): GenerateOptions;
139
+ /**
140
+ * 读出一次请求携带的每一个 `{ type: 'image', attachment }` 块。
141
+ *
142
+ * 读不出来的图片解析成 `unavailable` 而不是凭空消失,这样模型被明确告知图没了,
143
+ * 而不是对着空白作答。
144
+ */
145
+ export declare function resolveRequestImages(options: GenerateOptions, attachments: AttachmentImageReader | undefined, signal?: AbortSignal): Promise<ResolvedRequestImages>;
146
+ /** 去掉上游网关会拒或会忽略的 JSON-Schema 元关键字。 */
147
+ export declare function stripMetaSchema(schema: unknown): Record<string, unknown>;
148
+ /**
149
+ * 构造一份 `/api/coding/paas/v4/chat/completions` 的 body。
150
+ *
151
+ * `reasoning_effort` 先经 `convergeGlmEffort()` 收敛到目录声明的梯子上:
152
+ * DSH 的词汇比上游宽,而上游收到不认识的档位会直接报 1214。
153
+ * 梯子为空时**不发**该字段,而不是发一个模型不认的值。
154
+ *
155
+ * `thinking` 与 `stream_options` 一律**不发**,理由见文件头第 3、4 条。
156
+ */
157
+ export declare function buildChatRequest(options: GenerateOptions, images?: ResolvedRequestImages, route?: GlmOpenAiModelRoute): Record<string, unknown>;
158
+ /**
159
+ * 从一份响应正文里读出平台自己的数字业务码。
160
+ *
161
+ * 分类**不能停在状态行**:同一个 429 覆盖了已用尽的窗口、失效的套餐和
162
+ * 单模型授权缺口(见 `./types.ts` 的 `ERROR_CODE` 表注释),它们要不同的处置。
163
+ */
164
+ export declare function readGlmErrorCode(detail: string): number | null;
165
+ export declare function classifyGlmOpenAiFailure(status: number, detail: string, headers?: Headers): LlmError;
166
+ interface PendingToolCall {
167
+ blockIndex: number;
168
+ id: string;
169
+ name: string;
170
+ arguments: string;
171
+ started: boolean;
172
+ }
173
+ /** 一次流式响应的累积状态。 */
174
+ export interface GlmOpenAiStreamState {
175
+ blocks: OutboundContentBlock[];
176
+ current: {
177
+ index: number;
178
+ type: 'text' | 'reasoning';
179
+ text: string;
180
+ } | null;
181
+ /** 线上工具下标 -> 累积中的调用。 */
182
+ toolCalls: Map<number, PendingToolCall>;
183
+ hasContent: boolean;
184
+ hasToolCall: boolean;
185
+ finishReason: string | null;
186
+ /** `[DONE]` 哨兵到了。 */
187
+ done: boolean;
188
+ /** 终止块已经发出过。 */
189
+ finished: boolean;
190
+ inputTokens: number;
191
+ outputTokens: number;
192
+ cacheReadTokens: number;
193
+ reasoningTokens: number;
194
+ sawUsage: boolean;
195
+ }
196
+ export declare function createStreamState(): GlmOpenAiStreamState;
197
+ /** 喂进来一条 `/chat/completions` 的 SSE 行。 */
198
+ export declare function processStreamLine(line: string, state: GlmOpenAiStreamState): StreamChunk[];
199
+ /**
200
+ * 冲掉所有打开的块,然后**先发 usage、再发 finish**。
201
+ *
202
+ * 顺序是硬要求:DSH 的执行器按 finish 结算一次调用,usage 排在它后面就来不及入账。
203
+ */
204
+ export declare function closeStream(state: GlmOpenAiStreamState): StreamChunk[];
205
+ /**
206
+ * 一条流在没有终局事件的情况下结束,那是**被截断**,不是答完了。
207
+ *
208
+ * 这个端点总是以 `finish_reason` 或 `[DONE]` 收尾,所以两者都没有意味着
209
+ * 连接在答案中途断了,半截文本不能当成完成的回复呈现。
210
+ */
211
+ export declare function assertStreamComplete(state: GlmOpenAiStreamState): void;
212
+ export {};
213
+ //# sourceMappingURL=mapper-openai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapper-openai.d.ts","sourceRoot":"","sources":["../../../../src/host/glm-coding-plan/mapper-openai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAOH,OAAO,EAIL,QAAQ,EAGR,KAAK,eAAe,EAEpB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAA;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,6BAA6B,CAAA;AAatF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,uBAAuB,CAAA;AAE3D,uDAAuD;AACvD,eAAO,MAAM,wBAAwB,sBAAsB,CAAA;AAE3D,4CAA4C;AAC5C,eAAO,MAAM,cAAc,YAAY,CAAA;AAEvC,oEAAoE;AACpE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAElG;AAED,wDAAwD;AACxD,wBAA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