@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,124 @@
1
+ import { AccountPoolCore, type AccountPoolRefreshOptions, type AccountSelectionHint, type PoolAccountShape, type PoolData } from '../common/account-pool.ts';
2
+ import type { CredentialStore } from '../token-store.ts';
3
+ import { FileCredentialStore, type KimiCodeCredentials } from './token-store.ts';
4
+ import type { PoolAccountQuotaDto } from '../../shared/account-pool-contracts.ts';
5
+ import type { KimiCodeAccount, KimiCodeAccountQuota, KimiCodeAccountSummaryDto, KimiCodeRegion } from '../../shared/kimi-code-contracts.ts';
6
+ /** One pooled Kimi Code account: the token pair plus the facts the card renders. */
7
+ export interface KimiCodePoolAccount extends PoolAccountShape<KimiCodeCredentials> {
8
+ email?: string;
9
+ nickname?: string;
10
+ userId?: string;
11
+ planName?: string;
12
+ region?: KimiCodeRegion;
13
+ }
14
+ /** Encrypted pool file this line owns; the pre-pool credential file stays the mirror. */
15
+ export declare function kimiCodePoolPath(): string;
16
+ /**
17
+ * Whether an alias is still the placeholder a sign-in mints, rather than a name
18
+ * somebody recognises.
19
+ *
20
+ * Exported because the routes decide whether one more profile read is worth it:
21
+ * a row still titled `账号 N` is exactly the row whose name nobody has learned.
22
+ */
23
+ export declare function isPlaceholderAlias(alias: string): boolean;
24
+ /**
25
+ * Pool identity of a pasted API key.
26
+ *
27
+ * A key names no account by itself, and the identity `/me` may later report is
28
+ * deliberately NOT used: an OAuth row and an API-key row of the same member are
29
+ * two different credentials, and keying both on the user id would let pasting a
30
+ * key silently overwrite the device-code sign-in (or the reverse). A digest of
31
+ * the key keeps pasting the same key twice idempotent without storing the key a
32
+ * second time in clear.
33
+ */
34
+ export declare function kimiCodeApiKeyIdentity(apiKey: string): string;
35
+ /** Validate and normalize one whole pool document. */
36
+ export declare function parseKimiCodePoolData(value: unknown): PoolData<KimiCodePoolAccount>;
37
+ export interface KimiCodeAccountPoolOptions {
38
+ /** Pre-pool credential file the pool mirrors its primary account into. */
39
+ store?: FileCredentialStore;
40
+ /** Test seam; production builds the platform backend from the pool path. */
41
+ backend?: CredentialStore<PoolData<KimiCodePoolAccount>>;
42
+ /** Accounts this pool accepts; defaults to the core's limit. */
43
+ maxAccounts?: number;
44
+ }
45
+ /**
46
+ * One account's own newest quota snapshot, in the shape the account card draws.
47
+ *
48
+ * The snapshot comes from 'client.ts''s per-account cache keyed by the pool
49
+ * account id, and this is where this line's own numbers are translated into the
50
+ * shared shape. Every judgement below trades a possibly-nice-looking bar for an
51
+ * honest one:
52
+ *
53
+ * - a window whose consumed share nobody measured is DROPPED (`quotaWindow`
54
+ * returns null), because "0% used" and "not stated" are different claims. This
55
+ * parser only mints a window once it has a ratio, so a window that states none
56
+ * never reaches here at all — the drop is the second line of defence;
57
+ * - `resetsAt` is already Unix MILLISECONDS on this line, so it is passed
58
+ * through and normalized rather than multiplied;
59
+ * - the read time is the snapshot's own `fetchedAt`, which this line always
60
+ * sets. A snapshot with no read time is not a snapshot, and `poolQuota`
61
+ * reports that as undefined.
62
+ *
63
+ * A null snapshot means "this account was never read", which the card renders as
64
+ * exactly that instead of drawing a zero.
65
+ */
66
+ export declare function kimiCodePoolQuota(snapshot: KimiCodeAccountQuota | null): PoolAccountQuotaDto | undefined;
67
+ /**
68
+ * Kimi Code's account pool.
69
+ *
70
+ * The credential is an OAuth pair whose refresh token rotates, so the pool owns
71
+ * both the refresh and the write-back: two accounts must never be refreshed
72
+ * through the same single-credential file.
73
+ */
74
+ export declare class KimiCodeAccountPool extends AccountPoolCore<KimiCodeCredentials, KimiCodePoolAccount, KimiCodeAccountSummaryDto> {
75
+ private readonly store;
76
+ constructor(options?: KimiCodeAccountPoolOptions);
77
+ /**
78
+ * Pick the account for the next request.
79
+ *
80
+ * The returned credential carries its own region, OAuth host and base URL, so
81
+ * the caller must use those rather than the process-wide defaults.
82
+ *
83
+ * @param selection - this request's own preference, used by the cache-affinity
84
+ * routing to put an account whose prefix cache is still warm first. Absent
85
+ * means the rotation strategy decides alone.
86
+ */
87
+ getEffectiveCredential(excludeIds?: ReadonlySet<string>, fetchFn?: typeof fetch, options?: AccountPoolRefreshOptions, selection?: AccountSelectionHint): Promise<{
88
+ account: KimiCodePoolAccount;
89
+ credentials: KimiCodeCredentials;
90
+ }>;
91
+ /**
92
+ * Every pooled account's id with the region that decides its prefix group.
93
+ *
94
+ * The cache-affinity routing needs exactly two facts per account — which one
95
+ * it is, and which regional service answers it, because each region keeps its
96
+ * own prefix cache — and nothing else. Deliberately a narrow projection over
97
+ * the pool document rather than a credential read: tokens never leave the
98
+ * pool, and nothing here can be mistaken for a credential accessor.
99
+ */
100
+ accountScopes(): Promise<Array<{
101
+ id: string;
102
+ region: KimiCodeRegion | null;
103
+ }>>;
104
+ /** The pre-pool credential file this pool mirrors its primary account into. */
105
+ mirrorStore(): FileCredentialStore;
106
+ /**
107
+ * Remember who the service says one pooled account is.
108
+ *
109
+ * Sign-in can only name an account through its token, which carries an id and
110
+ * — for an account with a mailbox — an address. That is why a phone-signed-in
111
+ * row is titled `账号 N` and never changes on its own: the nickname lives on
112
+ * `/me`, which only the quota read asks, and nothing used to carry the answer
113
+ * back to the row. Every reading now calls this with what the profile said, so
114
+ * the card can name its own account without a re-sign-in.
115
+ *
116
+ * Only the placeholder yields: a name someone chose stays, because silently
117
+ * renaming a row a user named is worse than leaving a default in place. The
118
+ * learned facts also go into the mirrored credential, so a later re-sign-in
119
+ * (which mints the alias from the credential) keeps the name, and so do the
120
+ * single-account fallbacks that read that copy.
121
+ */
122
+ learnAccount(accountId: string, account: KimiCodeAccount): Promise<void>;
123
+ }
124
+ //# sourceMappingURL=account-pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-pool.d.ts","sourceRoot":"","sources":["../../../../src/host/kimi-code/account-pool.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EAGf,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EACL,mBAAmB,EAGnB,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAA;AAKzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AACjF,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,cAAc,EACf,MAAM,qCAAqC,CAAA;AAE5C,oFAAoF;AACpF,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB,CAAC,mBAAmB,CAAC;IAChF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB;AAED,yFAAyF;AACzF,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAaD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE7D;AA+BD,sDAAsD;AACtD,wBAAgB,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+ import { type ProviderFailureClassification } from '../common/failure-classification.ts';
2
+ import { LlmAdapter, ReasoningEffortId, type GenerateOptions, type LlmModelInfo, type LlmProviderInfo, type LlmResolvedModelInfo, type PreparedAdapterCall, type ResolvedRetryPolicy, type StreamChunk } from '@deepseek-ai/dsh-llm';
3
+ import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
4
+ import { PROVIDER_ID, reasoningEffortsFor } from './types.ts';
5
+ import { FileCredentialStore, FileModelSettingsStore, type KimiCodeCatalogModel, type KimiCodePreferenceStore } from './token-store.ts';
6
+ import { buildModelOptions, clearCachedCatalog } from './client.ts';
7
+ import { type AttachmentImageReader, type AttachmentVideoReader } from './mapper.ts';
8
+ import { type KimiMediaFilesUploader } from './media-files.ts';
9
+ import { type ResolvedRequestImages } from '../common/request-images.ts';
10
+ import type { ResolvedRequestVideos } from '../common/video-request.ts';
11
+ import { type GenerateOptions as NormalizedGenerateOptions } from '../common/llm-compat.ts';
12
+ import { KimiCodeAccountPool } from './account-pool.ts';
13
+ import type { KimiCodeWire } from '../../shared/kimi-code-contracts.ts';
14
+ /**
15
+ * Transient-failure retry policy for the `kimi-code` route.
16
+ *
17
+ * Kimi Code fronts the model providers, so a call can fail with a 502/503/504
18
+ * while the subscription and the credential stay perfectly usable. The service
19
+ * publishes exactly this case, and the body is usually
20
+ * `{"error":{"message":"Upstream model provider is temporarily unavailable.
21
+ * Please try again in a moment.","type":"server_error"}}` — which is precisely a
22
+ * message telling the client to try again.
23
+ *
24
+ * The retryable set is therefore:
25
+ *
26
+ * - `SERVER` — any 5xx, including that upstream-unavailable 502, and the
27
+ * overloaded 429 (`UPSTREAM_OVERLOAD_PATTERNS`). Overload shares the 429
28
+ * status with real back-pressure but not its meaning: it describes the state
29
+ * of the upstream engine, which every account behind this endpoint shares, so
30
+ * it is filed as the server condition it is and the pool is left alone;
31
+ * - `RATE_LIMIT` — a 429 that is genuine back-pressure ("too many requests"),
32
+ * which the documentation describes as transient and which does belong to the
33
+ * account that hit it, so rotation on it still earns its keep;
34
+ * - `TRANSPORT` — a connection that failed to carry the response: none at all,
35
+ * a body severed mid-stream (`streamFailure`), or a stream that ended without
36
+ * its terminal event (`assertStreamComplete`).
37
+ *
38
+ * Deliberately outside the set:
39
+ *
40
+ * - `TIMEOUT` — the idle watchdog can expire after upstream has accepted the
41
+ * long prompt even when no response headers came back. Automatically sending
42
+ * that prefix again would repeat cache writes and spend allowance without
43
+ * evidence that another attempt can answer, so this verdict ends the attempt.
44
+ *
45
+ * - `INVALID_CREDENTIAL` — a rejected access token fails identically on every
46
+ * attempt;
47
+ * - `PROVIDER_ERROR` — a 400, a 401 that is really a plan-entitlement refusal,
48
+ * or a 403 quota limit. Retrying a quota that resets in hours against the
49
+ * SAME account only burns requests and delays the message the user needs to
50
+ * see, so none of it is retried; a 403 limit still rotates to another account
51
+ * when the pool holds one, which is a routing decision rather than a retry;
52
+ * - `ABORTED` — the caller already cancelled.
53
+ *
54
+ * The DSH normal defaults would apply anyway; stating the values here pins them
55
+ * so this route never retries less than the rest of the plugin.
56
+ */
57
+ export declare const KIMI_CODE_RETRY_POLICY_CONFIG: {
58
+ mode: 'normal';
59
+ maxRetries: number;
60
+ retryableCodes: string[];
61
+ backoff: {
62
+ initialDelayMs: number;
63
+ maxDelayMs: number;
64
+ jitterRatio: number;
65
+ };
66
+ };
67
+ /** Configured effort when the model supports it, else the adapter's preference order. */
68
+ export declare function resolveDefaultReasoningEffort(efforts: readonly string[], configuredEffort?: string | null): ReasoningEffortId | undefined;
69
+ /**
70
+ * What one failed response means for the retry policy.
71
+ *
72
+ * The service overloads a single status for unrelated problems — a 401 covers
73
+ * both "your token is bad" and "your plan does not include k3", and a 429
74
+ * covers both ordinary back-pressure and a spent quota that must not be
75
+ * retried. The body text is what separates them, so the classification reads
76
+ * it rather than trusting the status alone.
77
+ */
78
+ /** What the account pool may do with one failed attempt. */
79
+ export type KimiPoolAction = 'retry-same-account' | 'cooldown-and-rotate' | 'mark-auth-failed' | 'none';
80
+ export interface KimiFailureClassification extends ProviderFailureClassification {
81
+ /** Account-pool side effect, kept separate from the retry code. */
82
+ poolAction: KimiPoolAction;
83
+ /** DSH error code; decides whether the route retries. */
84
+ code: string;
85
+ /** Message shown to the user, with the provider's own text appended. */
86
+ message: string;
87
+ /** True only when the failure is worth retrying. */
88
+ retryable: boolean;
89
+ /**
90
+ * 本次失败是不是上游引擎过载(正文命中 `UPSTREAM_OVERLOAD_PATTERNS`)。
91
+ *
92
+ * 单列成一个字段,是因为「过载」这条信息号池需要、而 code 本身已经不够用了:
93
+ * 过载要可重试(harness 的退避重试正是为它准备的),所以它必须留在
94
+ * retryable 集合里;但过载不是任何账号的错,所以它绝不能被当成账号级限流
95
+ * 写进冷却。code 只有一个,说不了这两件事;`accountScoped` 也只回答「能不能
96
+ * 换号」,不回答「要不要冷却」——真正限流时答案是「能换号、也要冷却」,
97
+ * 过载时是「不必换号、更不必冷却」。两条路都可重试却必须分开处理,所以这里
98
+ * 把归属显式带出来,而不是让调用方拿状态码去猜:同一个 429 状态码同时承载
99
+ * 这两种含义,而这正是本缺陷的成因。
100
+ */
101
+ upstreamOverload: boolean;
102
+ /**
103
+ * True when the refusal belongs to THIS account alone, so another pooled
104
+ * account may still serve the same request.
105
+ *
106
+ * A spent usage window is the case that matters, and this service reports it
107
+ * as a 403 — neither a bad credential nor retryable back-pressure, so nothing
108
+ * in the code or the message says "rotate". Asking the same account again
109
+ * cannot help; taking it out of rotation until its window resets lets the next
110
+ * account answer, and each account in the pool carries its own quota.
111
+ *
112
+ * False for every verdict that belongs to the request or to the plan: an
113
+ * entitlement refusal, a malformed body, ordinary overload. Rotating on one of
114
+ * those would spend every account in the pool to learn the same answer from
115
+ * each of them.
116
+ */
117
+ accountScoped: boolean;
118
+ }
119
+ /** Short, single-line excerpt of one error body, safe to show a user. */
120
+ export declare function summarizeFailureBody(raw: string): string;
121
+ /**
122
+ * Whether one failure detail is the gateway refusing a body for its SIZE.
123
+ *
124
+ * The managed gateway answers an oversized request with
125
+ * `total message size 5943865 exceeds limit 2097152` and no status beyond 400:
126
+ * the figures are bytes, and the wording matches nothing the shared overflow
127
+ * detector looks for. It is recognized HERE rather than in
128
+ * `common/context-overflow.ts` on purpose — that detector is shared by every
129
+ * route in this plugin, so a Kimi-specific sentence added there would
130
+ * reclassify other lines' failures on wording they never send.
131
+ */
132
+ export declare function isKimiBodySizeRefusal(detail: string): boolean;
133
+ /** Whether one 404 body is the service refusing a cited file rather than the model. */
134
+ export declare function isMissingResourceBody(bodyText: string): boolean;
135
+ /** One readable media occurrence this request intends to upload. */
136
+ export interface PlannedMediaReference {
137
+ /** Durable attachment id the block cites; the key the mapper looks it up by. */
138
+ readonly attachmentId: string;
139
+ /** Which wire field cites it afterwards. */
140
+ readonly kind: 'image' | 'video';
141
+ /** Media type the upload states as its purpose-carrying type. */
142
+ readonly mediaType: string;
143
+ /** Decoded bytes, ready to upload. */
144
+ readonly data: Uint8Array;
145
+ }
146
+ /**
147
+ * Which occurrences of one request would be uploaded, if any.
148
+ *
149
+ * Nothing is uploaded here and no network is touched: this only decides WHICH
150
+ * readable occurrences the reference path would cover, so the body-fit guard can
151
+ * measure the body that will actually be sent instead of measuring an inline
152
+ * body the reference path would never produce.
153
+ *
154
+ * An occurrence is eligible when all four hold, and each exclusion is load
155
+ * bearing:
156
+ *
157
+ * - the wire is OpenAI-compatible — the Anthropic surface documents no hosted
158
+ * media and must upload nothing at all;
159
+ * - the selected model declares the matching modality — sending a purpose the
160
+ * model cannot read uploads bytes nobody will look at;
161
+ * - the occurrence resolved to `inline`, i.e. its bytes were actually read —
162
+ * an unreadable media has nothing to upload and keeps its placeholder;
163
+ * - the occurrence cites a durable attachment, because only that is what a
164
+ * reference can be keyed by.
165
+ */
166
+ export declare function planMediaReferences(input: {
167
+ wire: KimiCodeWire;
168
+ imageAccepted: boolean;
169
+ videoAccepted: boolean;
170
+ images: ResolvedRequestImages;
171
+ videos: ResolvedRequestVideos;
172
+ }): PlannedMediaReference[];
173
+ /**
174
+ * Attachment ids one built request STILL sends as media occurrences.
175
+ *
176
+ * Two stages can take an occurrence away, and both run before a reference could
177
+ * be cited:
178
+ *
179
+ * - the image/video budget pass replaces the oldest occurrences with a text
180
+ * placeholder, and
181
+ * - the body-fit loop replaces more of them when the real serialized body is over
182
+ * the ceiling.
183
+ *
184
+ * An occurrence either stage removed is no longer part of the request, so
185
+ * uploading it would pay for bytes nobody reads and mint a reference nothing
186
+ * cites. The upload set is therefore read off the FINAL build rather than off
187
+ * what was merely readable when the request was planned.
188
+ *
189
+ * Tool results nest their own content, and a `read_image` result carries its
190
+ * pixels there, so the traversal recurses exactly the way the budget does.
191
+ */
192
+ export declare function mediaAttachmentIdsIn(options: NormalizedGenerateOptions): Set<string>;
193
+ /**
194
+ * The placeholder reference maps one planned set measures the body with.
195
+ *
196
+ * Returned separately for images and videos because the mapper keys them by
197
+ * field, not by kind.
198
+ */
199
+ export declare function plannedReferenceMaps(planned: readonly PlannedMediaReference[]): {
200
+ imageReferences: Map<string, string>;
201
+ videoReferences: Map<string, string>;
202
+ };
203
+ /**
204
+ * Classify one non-2xx response for the retry policy.
205
+ *
206
+ * @param status - HTTP status the service answered with.
207
+ * @param bodyText - raw response body, used to separate overloaded statuses.
208
+ */
209
+ export declare function classifyKimiFailure(status: number, bodyText: string): KimiFailureClassification;
210
+ /**
211
+ * How long one account stays out of rotation after it reports a spent limit.
212
+ *
213
+ * The reset instant is read from the body whenever the service states one — as a
214
+ * numeric field, or as an instant carrying its own zone — and the length of the
215
+ * window the service names is used otherwise. The zone is required for that
216
+ * instant because an unqualified one is ambiguous, and a cooldown computed from
217
+ * the wrong zone is either hours too long or already over; where the body is
218
+ * ambiguous the window length is the honest answer.
219
+ *
220
+ * Both ends of the range are load-bearing. A reset instant barely in the future
221
+ * would otherwise read as no cooldown at all and put the account straight back
222
+ * into rotation to be refused again; and a reset instant already in the past
223
+ * (a stale cache, a clock skew) falls back to the window length above rather
224
+ * than to no cooldown at all.
225
+ */
226
+ export declare function accountLimitCooldownMs(bodyText: string, now?: number): number;
227
+ export interface KimiCodeAdapterOptions {
228
+ fetchFn?: typeof fetch;
229
+ attachments?: AttachmentImageReader;
230
+ /**
231
+ * Video reader seam.
232
+ *
233
+ * DSH's attachment service stores images only, so a deployment that produces
234
+ * video references injects the reader here. Absent, video occurrences degrade
235
+ * to an explicit text placeholder rather than silently vanishing.
236
+ */
237
+ videos?: AttachmentVideoReader;
238
+ /** Live catalog loader seam; defaults to the managed `/models` call. */
239
+ loadCatalog?: () => Promise<KimiCodeCatalogModel[]>;
240
+ /**
241
+ * Hosted-file uploader seam.
242
+ *
243
+ * Production builds one through {@link createMediaFilesUploader} with THIS
244
+ * adapter's transport, so an upload and the chat request that cites it travel
245
+ * the same fetchFn — a test or a deployment that swaps the transport must not
246
+ * be bypassed by a module-level singleton holding its own.
247
+ *
248
+ * The cache is the point of the seam being shared across requests: one
249
+ * instance lives for the adapter's lifetime, so the same clip is uploaded once
250
+ * per account rather than once per turn.
251
+ */
252
+ mediaFiles?: KimiMediaFilesUploader;
253
+ /**
254
+ * Whether a request may state an account preference from the prefix cache.
255
+ *
256
+ * A live getter rather than a captured boolean: the switch is volatile in
257
+ * settings, and a captured value would keep routing by an answer the user has
258
+ * already changed. Absent means enabled — the behaviour the routing has when
259
+ * nothing turns it off.
260
+ */
261
+ cacheAffinity?: () => boolean;
262
+ }
263
+ /**
264
+ * Longest edge of the request version this route asks the attachment store for.
265
+ *
266
+ * Kimi's own CLI downscales an oversized image to a 2000 px long edge by default,
267
+ * so a screenshot its client would send at 2000 px must not be handed to this
268
+ * route at the shared 1024 px ceiling: that kept a screenshot the model could
269
+ * read at 2000 px legible-sized only by dropping and re-reading it. The
270
+ * encoded-byte target is deliberately NOT raised with it — 256 KiB per request
271
+ * version still fits four images inside the shared 1.5 MB budget — and an image
272
+ * already inside this edge is still sent as stored, so small images, references
273
+ * without dimensions and the body-fit ceiling all behave exactly as before.
274
+ */
275
+ export declare const KIMI_CODE_REQUEST_IMAGE_MAX_EDGE = 2000;
276
+ /**
277
+ * Persist the cache facts a status card needs to survive a restart.
278
+ *
279
+ * Written at the end of every request, from the same numbers the in-memory
280
+ * totals just recorded. The process forgets them at exit, and the expiry hint
281
+ * depends on knowing how long a conversation sat idle before it was resumed —
282
+ * the moment the hint matters is the moment memory no longer has the answer.
283
+ *
284
+ * The prompt size is this request's own (cache read + fresh input), not the
285
+ * rolling sum: the hint describes what the NEXT turn would have to reprocess.
286
+ */
287
+ /**
288
+ * How this route carries a mid-conversation tool change, or undefined for none.
289
+ *
290
+ * Three gates decide whether the route gets one at all: the model accepts
291
+ * message-level declarations, the request travels the OpenAI-compatible surface
292
+ * (the Anthropic one documents no such field), and no operator opted out. A
293
+ * model that fails any gate keeps the old shape, in which every request carries
294
+ * the complete tool list.
295
+ *
296
+ * The mode is `in-history`, not `addition-only`: both append an addition, but
297
+ * only `in-history` also expresses a removal by appending a note. Under
298
+ * `addition-only` a revoked tool is deleted from the declaration list, the
299
+ * top-level `tools` array shrinks, and the prefix cache is thrown away.
300
+ * @param modelId - exact model id.
301
+ * @param catalog - live catalog, possibly empty when offline.
302
+ * @returns the tool-update mode, or undefined when this route must resend everything.
303
+ */
304
+ export declare function toolUpdateMode(modelId: string, catalog: readonly KimiCodeCatalogModel[]): 'in-history' | undefined;
305
+ /** How long a cold-start follower waits for the leader warming the same prefix. */
306
+ export declare const COLD_START_WARMUP_WAIT_MS = 2500;
307
+ /** Forget every remembered prefix and release every waiting follower. */
308
+ export declare function resetColdStartSingleflightForTests(): void;
309
+ /** The prefix identity shared by requests on one region/model. */
310
+ export declare function prefixGroupKey(region: string, options: NormalizedGenerateOptions): string | undefined;
311
+ /** The cache group on one account; cross-account warmth is never inferred. */
312
+ export declare function coldStartGroupKey(region: string, options: NormalizedGenerateOptions, accountScope: string): string | undefined;
313
+ /** Whether this account's prefix is still warm under the measured Kimi TTL. */
314
+ export declare function isWarmPrefixGroup(region: string, options: NormalizedGenerateOptions, accountScope: string, now?: number): boolean;
315
+ export declare class KimiCodeAdapter extends LlmAdapter {
316
+ private readonly store;
317
+ private readonly modelSettings;
318
+ private readonly preferences?;
319
+ private readonly options;
320
+ /**
321
+ * Rotation pool, or null for the single stored credential.
322
+ *
323
+ * Only the plugin entry installs one, because it owns the pool's storage; an
324
+ * adapter built without one must keep working off the one credential file and
325
+ * must not create pool state of its own.
326
+ */
327
+ private readonly accountPool;
328
+ /**
329
+ * An unnamed compaction would otherwise take the settings default and differ
330
+ * from the session's level, turning a fully cached ~900K-token prompt cold; the
331
+ * service refuses that as an overloaded engine (429) instead of summarizing it.
332
+ */
333
+ private readonly effortMemory;
334
+ constructor(store?: FileCredentialStore, modelSettings?: FileModelSettingsStore, preferences?: KimiCodePreferenceStore | undefined, options?: KimiCodeAdapterOptions, accountPool?: KimiCodeAccountPool);
335
+ /**
336
+ * The uploader this adapter cites files through, built on first use.
337
+ *
338
+ * Built lazily for two reasons: a turn with no media pays nothing, and a test
339
+ * that stubs the global transport before the first request still reaches the
340
+ * default uploader, because the transport is read at construction rather than
341
+ * at module load.
342
+ *
343
+ * Deliberately NOT {@link kimiMediaFiles}, the module-level singleton: that one
344
+ * captured the global `fetch` when this module was imported, so an adapter
345
+ * given its own transport would upload through a different one than it chats
346
+ * through — the one thing this route must not do, since the reference it gets
347
+ * back is only meaningful to the endpoint the chat request goes to.
348
+ */
349
+ private mediaUploader;
350
+ /** The shared uploader, created on first use with THIS adapter's transport. */
351
+ private mediaFiles;
352
+ /**
353
+ * Upload every planned occurrence under ONE account and collect its references.
354
+ *
355
+ * The credential, base URL and scope are the ones the chat request about to be
356
+ * sent will use, which is what makes a reference citable at all: an id minted
357
+ * for another account or another deployment is not assumed to be readable.
358
+ *
359
+ * A failure is contained per occurrence. Uploading is an optimisation — the
360
+ * inline path always works — so a refused, overloaded or unreachable upload
361
+ * endpoint leaves THAT media inline and the turn runs. What is never
362
+ * contained is a cancellation: `signal` aborted, or an AbortError out of the
363
+ * transport, is a turn the caller deliberately stopped, and continuing to send
364
+ * the chat request would answer it anyway.
365
+ *
366
+ * This deliberately touches no account state: a 401/403/404/405/413/5xx or a
367
+ * network failure of the UPLOAD is a fact about the hosted-file endpoint, not
368
+ * a verdict on this account's quota, so it neither cools nor retires the
369
+ * account. The chat request's own classification owns that decision.
370
+ */
371
+ private uploadPlannedReferences;
372
+ providerInfo(provider: string): LlmProviderInfo;
373
+ providerRetryPolicy(): ResolvedRetryPolicy;
374
+ imageRequestPricing(): undefined;
375
+ imageRequestTarget(_provider: string, _model: string, image: ImageAttachmentRef): import("../common/request-images.ts").CompatImageRequestTarget;
376
+ private settings;
377
+ /** Whether this deployment routes by warm prefix cache; on unless switched off. */
378
+ private cacheAffinityEnabled;
379
+ /**
380
+ * Which accounts this request would rather be served by, when the prefix cache
381
+ * can say something useful about it.
382
+ *
383
+ * The service keeps one prefix cache per account, so rotation — which knows
384
+ * cooldowns, tokens and last use, never prompt content — can spend a request on
385
+ * an account that has never seen this prompt while another one has it hot. Both
386
+ * facts needed to do better are already in this process: the cold-start gate
387
+ * records which (prefix, account) pairs are warm, and the quota cache says how
388
+ * much each account has left.
389
+ *
390
+ * Returns undefined — no preference at all — wherever a preference would be a
391
+ * guess: the switch is off, there is no pool or only one account, the pool
392
+ * document cannot be read, a region cannot be resolved, or no account has this
393
+ * prefix warm. The pool then applies its rotation strategy exactly as it would
394
+ * have without this method.
395
+ *
396
+ * @param pool - The account pool serving this route, or null when none is installed.
397
+ * @param options - The request about to be sent; its system prompt, tools and
398
+ * static bootstrap are what decide the prefix identity.
399
+ * @returns a preference for the pool, or undefined for "strategy decides".
400
+ */
401
+ private cacheAffinityHint;
402
+ /**
403
+ * Catalog for the picker: the live managed listing when reachable, the
404
+ * shipped fallback otherwise, narrowed by the user's enabled selection.
405
+ */
406
+ private catalog;
407
+ /**
408
+ * The single window this line reports AND budgets against.
409
+ *
410
+ * The resolution lives here, in the one place both readers go through, rather
411
+ * than at each call site: `resolveModel` publishes this number to DSH (which
412
+ * computes its compaction threshold from it) and `requestStream` sizes the
413
+ * completion budget with it, so two independent resolutions would let the
414
+ * promise and the budget drift apart.
415
+ *
416
+ * By default the window is published exactly as declared, and a user override
417
+ * is an ordinary declared window: an explicit 1M is the model's advertised
418
+ * capacity as this user chose it, and silently shrinking it would take away
419
+ * the context they asked for. A session that outgrows the byte ceiling is
420
+ * recovered at the wall (CONTEXT_OVERFLOW_CODE), not pre-emptively summarized.
421
+ *
422
+ * A deployment that would rather compact BEFORE the wall sets
423
+ * DSH_KIMI_CODE_BYTES_PER_TOKEN, and then the override is bounded like every
424
+ * other window — see {@link effectiveContextWindow}.
425
+ */
426
+ private contextWindowFor;
427
+ listModels(provider?: string): Promise<readonly LlmModelInfo[]>;
428
+ resolveModel(provider: string, modelId: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
429
+ prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;
430
+ stream(options: GenerateOptions): AsyncIterable<StreamChunk>;
431
+ private requestStream;
432
+ /**
433
+ * What one in-band failure becomes once the pool has been told what the
434
+ * verdict means for it.
435
+ *
436
+ * Reclassification and the pool reaction are separate because they answer
437
+ * different questions about the same classification: the code decides whether
438
+ * the harness retries, `accountScoped` decides whether a retry could land
439
+ * somewhere that can answer. The mapper can supply only the first, which is
440
+ * why the wire object is recorded there and read here.
441
+ *
442
+ * The body is the one a non-2xx response would have carried, so every pattern
443
+ * below reads exactly what the HTTP branch reads and a limit cannot mean one
444
+ * thing as a status and another as an event. The request itself is NOT
445
+ * re-issued: its body is already open and part-read, and the harness retry
446
+ * policy owns the repeat.
447
+ */
448
+ private inBandStreamFailure;
449
+ }
450
+ export { clearCachedCatalog, buildModelOptions, reasoningEffortsFor, PROVIDER_ID };
451
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/host/kimi-code/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,6B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C,aAAa,CAAoC;IAEzD,+EAA+E;IAC/E,OAAO,CAAC,UAAU;IAQlB;;;;;;;;;;;;;;;;;;OAkBG;YACW,uBAAuB;IAuCrC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe;IAI/C,mBAAmB,IAAI,mBAAmB;IAI1C,mBAAmB,IAAI,SAAS;IAIhC,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;IAO/E,OAAO,CAAC,QAAQ;IAIhB,mFAAmF;IACnF,OAAO,CAAC,oBAAoB;IAQ5B;;;;;;;;;;;;;;;;;;;;;OAqBG;YACW,iBAAiB;IA0D/B;;;OAGG;YACW,OAAO;IA0BrB;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,gBAAgB;IAYlB,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;IAmB/D,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA6CpG,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAO/F,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,WAAW,CAAC;YAmBpD,aAAa;IAkzB5B;;;;;;;;;;;;;;;OAeG;YACW,mBAAmB;CA8ClC;AAqFD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,WAAW,EAAE,CAAA"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Kimi Code membership API key sign-in.
3
+ *
4
+ * Besides the OAuth device code, a Kimi Code member can create an API key in the
5
+ * Kimi Code console (https://www.kimi.com/code) for third-party tools. That key
6
+ * authenticates against the SAME coding endpoint and the same membership quota
7
+ * as the device-code token (`https://api.kimi.com/coding/v1`, bearer on the
8
+ * OpenAI-compatible surface, `x-api-key` on the Anthropic-compatible one — see
9
+ * the facts in `types.ts`), so it is stored as an ordinary credential whose
10
+ * access token is the key itself and whose `authKind` is `api-key`.
11
+ *
12
+ * It is NOT a Moonshot Open Platform key: those are billed per token on a
13
+ * different host and the coding endpoint refuses them with a 401, which is why
14
+ * a pasted key is verified before anything is stored.
15
+ *
16
+ * Left unverified (no live key was exercised for this change): that `/usages`
17
+ * and `/me` answer for an API key the way they answer for an OAuth token. Both
18
+ * are therefore treated as enrichment — a refusal there never rejects the key
19
+ * nor takes the account out of rotation; only the model listing decides.
20
+ */
21
+ import type { KimiCodeRegion } from '../../shared/kimi-code-contracts.ts';
22
+ import type { KimiCodeCredentials } from './token-store.ts';
23
+ /** Longest key accepted; a real key is far shorter, this only bounds garbage. */
24
+ export declare const KIMI_CODE_API_KEY_MAX_LENGTH = 512;
25
+ /** A key the route refuses, with the HTTP status the refusal is answered with. */
26
+ export declare class KimiCodeApiKeyError extends Error {
27
+ readonly status: number;
28
+ constructor(message: string, status: number);
29
+ }
30
+ /**
31
+ * Clean up what a user pasted into the key field.
32
+ *
33
+ * Copying from a console or a shell snippet often brings surrounding blanks,
34
+ * quotes or a `Bearer ` prefix with it; those are removed. Anything that still
35
+ * contains blanks or non-printable characters is not a key, and is refused here
36
+ * rather than sent to the service as a header value.
37
+ */
38
+ export declare function normalizeKimiCodeApiKey(raw: unknown): string;
39
+ /** The credential one verified API key is stored as. */
40
+ export declare function kimiCodeApiKeyCredentials(apiKey: string, region: KimiCodeRegion, now?: number): KimiCodeCredentials;
41
+ /**
42
+ * Prove a key authenticates, and name the region that accepted it.
43
+ *
44
+ * The probe is the model listing: it is what every OpenAI-compatible client asks
45
+ * first, it costs no quota, and a 401 there is the service's own verdict on the
46
+ * key. The preferred region is asked first; only when it refuses the key is the
47
+ * other regional host asked, because a key belongs to the deployment it was
48
+ * created on. A pinned base URL (`KIMI_CODE_BASE_URL`) leaves a single host, so
49
+ * nothing else is tried.
50
+ */
51
+ export declare function verifyKimiCodeApiKey(apiKey: string, options: {
52
+ region: KimiCodeRegion;
53
+ fetchFn?: typeof fetch;
54
+ }): Promise<KimiCodeRegion>;
55
+ //# sourceMappingURL=api-key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-key.d.ts","sourceRoot":"","sources":["../../../../src/host/kimi-code/api-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AAEzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAG3D,iFAAiF;AACjF,eAAO,MAAM,4BAA4B,MAAM,CAAA;AAE/C,kFAAkF;AAClF,qBAAa,mBAAoB,SAAQ,KAAK;IACf,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAxC,OAAO,EAAE,MAAM,EAAW,MAAM,EAAE,MAAM;CAIrD;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAY5D;AAED,wDAAwD;AACxD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,cAAc,EACtB,GAAG,GAAE,MAAmB,GACvB,mBAAmB,CAYrB;AAMD;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;CAAE,GAC1D,OAAO,CAAC,cAAc,CAAC,CA4BzB"}