@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,168 @@
1
+ /**
2
+ * The Matrix media gateway client for the MiniMax Code subscription.
3
+ *
4
+ * The Messages route (`{agentBase}/mavis/api/v1/llm/v1/messages`) carries the
5
+ * chat surface only. Everything else the subscription can do — video generation,
6
+ * video understanding, image and audio tools — lives behind a SECOND prefix on
7
+ * the SAME origin: `{agentBase}/mavis/api/v1/mcp/<tool>`. Nothing in
8
+ * ./client.ts reaches it, and this module is that missing half.
9
+ *
10
+ * Why the endpoint set is what it is (docs/minimax-video-design-spec.md section
11
+ * 3, and the live probe in scripts/probe-minimax-matrix-gateway.probe.ts):
12
+ *
13
+ * - the host is the AGENT host, not the API host. cn is `https://agent.minimax.cn`
14
+ * and global is `https://agent.minimax.io`, both already named by
15
+ * ./types.ts's REGION_HOSTS. `agent.minimaxi.com` is the CHECK-IN surface's
16
+ * host — the upstream tree spells it LEGACY (matrix-env.ts:28) — and pointing
17
+ * a media call at it would miss.
18
+ * - authentication is the subscription bearer and nothing else. The measured
19
+ * request carried exactly accept / authorization / content-type / user-agent
20
+ * and was answered HTTP 200 `base_resp.status_code: 0`. The `yy` /
21
+ * `x-timestamp` / `x-signature` triple belongs to the check-in surface, and
22
+ * `user_id` / `biz_id` / `request_sk` are gated on a non-prod build env and
23
+ * resolve to {} in prod, so none of them is sent here either.
24
+ *
25
+ * TWO FAILURE KINDS, and they are not the same verdict:
26
+ *
27
+ * - a BUSINESS failure is HTTP 200 with `base_resp.status_code !== 0` OR with a
28
+ * non-zero TOP-LEVEL `code`. Both are the service accepting the request,
29
+ * understanding it, and refusing it: retrying the same body asks the same
30
+ * question again and gets the same answer, so it is terminal. Upstream proves
31
+ * the same pair (packages/agent-tools/src/cloud/matrix-tools/client.ts:140-158)
32
+ * and a client that only reads the first one reports a refusal as a success.
33
+ * - a REQUEST failure is a non-2xx status. Which one it is (a refused
34
+ * credential, back-pressure, an overloaded gateway, a malformed body) is
35
+ * decided by {@link classifyMinimaxFailure}, which this line already uses for
36
+ * every other refusal it reports.
37
+ *
38
+ * The classification SHAPE is reused rather than reinvented: `code`,
39
+ * `message`, `retryable`, `accountScoped`. A caller that reads a verdict from
40
+ * the Messages route and a caller that reads one from here must not have to
41
+ * know which surface produced it.
42
+ *
43
+ * @module dsh-multi-provider/minimax-code/matrix-client
44
+ */
45
+ import { HarnessError } from '@deepseek-ai/dsh-llm';
46
+ import type { MinimaxCodeRegion } from '../../shared/minimax-code-contracts.ts';
47
+ import { type MinimaxFailureClassification } from './adapter.ts';
48
+ /** Prefix every Matrix media tool hangs off. */
49
+ export declare const MATRIX_API_PREFIX = "/mavis/api/v1/mcp";
50
+ /**
51
+ * User agent the gateway was measured to accept.
52
+ *
53
+ * NOT the package's own product token (./types.ts USER_AGENT). A media call is
54
+ * a first-party-client surface rather than an LLM endpoint, and the measured
55
+ * shape sent this literal; the note in ./types.ts about not impersonating the
56
+ * official app is about the TELEMETRY headers (`yy` and friends), which are
57
+ * still never sent.
58
+ */
59
+ export declare const MATRIX_USER_AGENT = "MiniMaxAgent";
60
+ /** Default per-call time budget, matching the upstream media-tool timeout table. */
61
+ export declare const MATRIX_DEFAULT_TIMEOUT_MS = 120000;
62
+ /** Path segment of the video-understanding tool. */
63
+ export declare const MATRIX_TOOL_VIDEOS_UNDERSTAND = "videos_understand";
64
+ /** Path segment of the async video-generation submit tool. */
65
+ export declare const MATRIX_TOOL_SUBMIT_VIDEO = "submit_video_generation";
66
+ /** Path segment of the async video-generation query tool. */
67
+ export declare const MATRIX_TOOL_QUERY_VIDEO = "query_video_generation";
68
+ /** Path segment of the presigned-upload broker. */
69
+ export declare const MATRIX_TOOL_GET_UPLOAD_URL = "get_upload_url";
70
+ type FetchLike = typeof fetch;
71
+ /**
72
+ * The Matrix media route for one region and tool.
73
+ *
74
+ * @param region - subscription region (`cn` or `global`).
75
+ * @param tool - tool path segment, e.g. `videos_understand`.
76
+ * @returns the absolute endpoint URL.
77
+ */
78
+ export declare function matrixToolUrl(region: MinimaxCodeRegion, tool: string): string;
79
+ /**
80
+ * The complete header set of one Matrix request: exactly four entries.
81
+ *
82
+ * Kept as a function of the token alone so a test can assert the absence of the
83
+ * check-in surface's signature headers and the routing headers by name, rather
84
+ * than trusting that nobody added one later.
85
+ *
86
+ * @param accessToken - subscription access token.
87
+ * @returns the four headers, in the measured spelling.
88
+ */
89
+ export declare function matrixRequestHeaders(accessToken: string): Record<string, string>;
90
+ /**
91
+ * One settled Matrix call.
92
+ *
93
+ * `body` is the parsed JSON envelope with `base_resp` still on it, so a caller
94
+ * can read `status_msg` when it needs the service's own wording. Payload fields
95
+ * sit at the TOP level of that envelope on every tool this line has read.
96
+ *
97
+ * The one top-level key that is NOT a payload field is `code`: it is the
98
+ * envelope's second status code, already proven zero by the time a response is
99
+ * returned (see {@link businessStatusOf}).
100
+ */
101
+ export interface MatrixToolResponse {
102
+ /** The tool the call named. */
103
+ readonly tool: string;
104
+ /** HTTP status of the answer. */
105
+ readonly status: number;
106
+ /** Parsed JSON object body. */
107
+ readonly body: Record<string, unknown>;
108
+ }
109
+ /** One Matrix failure, carrying the verdict the rest of the line speaks. */
110
+ export declare class MatrixToolError extends HarnessError {
111
+ /** The reused classification: `code`/`message`/`retryable`/`accountScoped`. */
112
+ readonly classification: MinimaxFailureClassification;
113
+ /** HTTP status when there was one; undefined for a transport failure. */
114
+ readonly status: number | undefined;
115
+ /** The tool the failing call named. */
116
+ readonly tool: string;
117
+ constructor(message: string, code: string, classification: MinimaxFailureClassification, tool: string, status?: number);
118
+ }
119
+ /** Error code for a business refusal (HTTP 200, `base_resp.status_code !== 0`). */
120
+ export declare const MATRIX_BUSINESS_ERROR_CODE = "MINIMAX_MATRIX_BUSINESS_ERROR";
121
+ /** Error code for a non-2xx answer. */
122
+ export declare const MATRIX_HTTP_ERROR_CODE = "MINIMAX_MATRIX_HTTP_ERROR";
123
+ /** Error code for a request that never produced a response. */
124
+ export declare const MATRIX_TRANSPORT_ERROR_CODE = "MINIMAX_MATRIX_TRANSPORT_ERROR";
125
+ /** Error code for a call that outlived its budget. */
126
+ export declare const MATRIX_TIMEOUT_ERROR_CODE = "MINIMAX_MATRIX_TIMEOUT";
127
+ /** Options for {@link callMatrixTool}. */
128
+ export interface CallMatrixToolOptions {
129
+ /** Subscription region; decides which agent host is used. */
130
+ readonly region: MinimaxCodeRegion;
131
+ /** Subscription access token (bearer). */
132
+ readonly accessToken: string;
133
+ /** Tool path segment, e.g. `videos_understand`. */
134
+ readonly tool: string;
135
+ /** JSON request body. */
136
+ readonly body: Record<string, unknown>;
137
+ /** Injected fetch, so tests never touch the network. */
138
+ readonly fetchFn?: FetchLike;
139
+ /** Caller cancellation. */
140
+ readonly signal?: AbortSignal;
141
+ /** Per-call budget; defaults to {@link MATRIX_DEFAULT_TIMEOUT_MS}. */
142
+ readonly timeoutMs?: number;
143
+ }
144
+ /**
145
+ * Call one Matrix media tool and return its parsed envelope.
146
+ *
147
+ * @param options - region, credential, tool, body and the injectable transport.
148
+ * @returns the parsed envelope, with the business status already proven zero.
149
+ * @throws MatrixToolError for a business refusal, a non-2xx answer, a transport
150
+ * failure, or a timeout. Every one carries a reused classification.
151
+ */
152
+ export declare function callMatrixTool(options: CallMatrixToolOptions): Promise<MatrixToolResponse>;
153
+ /**
154
+ * Read one payload field out of an envelope, trying the shapes this gateway
155
+ * has been observed to use.
156
+ *
157
+ * Top level first — that is where every measured tool puts its payload — then
158
+ * `data` and `result` for a tool that nests it. Undefined when none of them
159
+ * carries the key, so the caller refuses rather than reading a missing field as
160
+ * an empty string.
161
+ *
162
+ * @param body - the parsed envelope.
163
+ * @param key - the field name the tool documents.
164
+ * @returns the value, whatever it is, or undefined.
165
+ */
166
+ export declare function matrixPayloadField(body: Record<string, unknown>, key: string): unknown;
167
+ export {};
168
+ //# sourceMappingURL=matrix-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrix-client.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/matrix-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC/E,OAAO,EAA0B,KAAK,4BAA4B,EAAE,MAAM,cAAc,CAAA;AAIxF,gDAAgD;AAChD,eAAO,MAAM,iBAAiB,sBAAsB,CAAA;AAEpD;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,iBAAiB,CAAA;AAE/C,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,SAAU,CAAA;AAEhD,oDAAoD;AACpD,eAAO,MAAM,6BAA6B,sBAAsB,CAAA;AAChE,8DAA8D;AAC9D,eAAO,MAAM,wBAAwB,4BAA4B,CAAA;AACjE,6DAA6D;AAC7D,eAAO,MAAM,uBAAuB,2BAA2B,CAAA;AAC/D,mDAAmD;AACnD,eAAO,MAAM,0BAA0B,mBAAmB,CAAA;AAE1D,KAAK,SAAS,GAAG,OAAO,KAAK,CAAA;AAE7B;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7E;AAED;;;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E,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,wDAAwD;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAA;IAC5B,2BAA2B;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AA8DD;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA8GhG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAOtF"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * MiniMax Code's video vocabulary.
3
+ *
4
+ * The block type, the module augmentation and the media-type list are shared
5
+ * with the Kimi Code line in `../common/video.ts`; only the wording is this
6
+ * line's, because the models that accept video, and the byte budget the endpoint
7
+ * tolerates, are MiniMax's facts.
8
+ */
9
+ import { VIDEO_MEDIA_TYPES, type VideoOmissionReason } from '../common/video.ts';
10
+ export { VIDEO_MEDIA_TYPES, type VideoOmissionReason };
11
+ /**
12
+ * Deterministic text standing in for a video the request cannot carry.
13
+ *
14
+ * The model is told the video existed and why it is absent, so it asks for a
15
+ * description instead of answering as though the message were empty.
16
+ * @param reason - why the occurrence was omitted.
17
+ * @param label - display name or attachment id, when known.
18
+ */
19
+ export declare function videoOmissionText(reason: VideoOmissionReason, label?: string): string;
20
+ //# sourceMappingURL=modalities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modalities.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/modalities.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAEhF,OAAO,EAAE,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,CAAA;AAEtD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,mBAAmB,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAYrF"}
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Hardcoded catalog of the models the MiniMax Code subscription serves.
3
+ *
4
+ * This catalog is hardcoded on purpose. The endpoint documents a
5
+ * `GET /v1/models` route, but it is not configured for subscription traffic and
6
+ * answers 503 `{"errorCode":50115,"errorReason":"direct_route_not_configured"}`
7
+ * (and 401 when queried with `x-api-key`). Nothing in this package may probe it,
8
+ * at startup or otherwise.
9
+ *
10
+ * The first three entries and every number in them are transcribed verbatim
11
+ * from the model table in `~/.minimax/config.yaml` (brief section 2.3). The
12
+ * fourth (M3.1 Flash) no longer is: MiniMax published the GA model on its own
13
+ * Model Invocation page and dropped the `-Preview` suffix there, so it is
14
+ * transcribed from that page's Supported Models table and measured on this
15
+ * subscription endpoint on 2026-10-19. No value here is inferred from another
16
+ * provider's catalog.
17
+ */
18
+ import type { MinimaxCodeModelOption, MinimaxCodeReasoningEffort } from '../../shared/minimax-code-contracts.ts';
19
+ /**
20
+ * How one model's thinking behaves.
21
+ *
22
+ * - `always-on` — thinking cannot be turned off and has no selectable level;
23
+ * - `toggle` — thinking is on by default and can be disabled;
24
+ * - `forced-effort` — thinking is forced on and a level can be selected.
25
+ */
26
+ export type MinimaxCodeThinkingMode = 'always-on' | 'toggle' | 'forced-effort';
27
+ /** One model the MiniMax Code subscription serves. */
28
+ export interface MinimaxCodeCatalogModel {
29
+ /** Exact model id to put on the wire. */
30
+ id: string;
31
+ /** Display name shown in the picker. */
32
+ name: string;
33
+ /** Context window the account is entitled to by default. */
34
+ contextWindow: number;
35
+ /** Larger window the model can reach, when one is offered as an option. */
36
+ optionalContextWindow: number | null;
37
+ /** Output cap the model accepts. */
38
+ maxTokens: number;
39
+ /**
40
+ * Input the model accepts.
41
+ *
42
+ * Declared as the wire accepts it, which is also what this line can put on that
43
+ * wire — a capability listed here is a claim DSH's capability pipeline acts on
44
+ * (prompt admission, the model picker, subagent delegation), so listing
45
+ * something the mapper cannot encode would be a promise the route breaks.
46
+ *
47
+ * Video is now listed for the models that take it. It was not, because the
48
+ * route had no video byte reader; the reader arrived with the shared video
49
+ * request layer (see `../common/video-request.ts` and the Kimi Code line's
50
+ * `video-store.ts`), and a live probe confirmed this endpoint decodes a
51
+ * `{ type: 'video', source: { type: 'base64', ... } }` block.
52
+ *
53
+ * The inline path still tops out well below the documented 50 MB per clip,
54
+ * because base64 grows bytes by 4/3 against a 64 MB request body; the budget is
55
+ * `MAX_REQUEST_VIDEO_BYTES` in ./types.ts. Media above that inline ceiling is
56
+ * not refused — it is uploaded: this line implements the Files API
57
+ * (./files-api.ts), and the adapter posts the bytes to
58
+ * `{messagesBase}/files/upload` and rewrites the block as an
59
+ * `mm_file://<file_id>` reference before the request goes out.
60
+ */
61
+ inputModalities: readonly ('text' | 'image' | 'video')[];
62
+ /** How thinking behaves on this model. */
63
+ thinking: MinimaxCodeThinkingMode;
64
+ /**
65
+ * Levels the model accepts, in escalating order.
66
+ *
67
+ * A single `default` entry means the model has no selectable level: the picker
68
+ * shows one always-on option rather than inventing a gradient the model does
69
+ * not document.
70
+ */
71
+ reasoningEfforts: readonly MinimaxCodeReasoningEffort[];
72
+ /**
73
+ * Level used when the conversation does not pick one.
74
+ *
75
+ * Null for a model with no selectable level (an always-on one): there is
76
+ * nothing to put on the wire, and a value here would be a promise the route
77
+ * cannot keep.
78
+ */
79
+ defaultReasoningEffort: MinimaxCodeReasoningEffort | null;
80
+ /**
81
+ * Attachments the model's FILES API accepts, when it states a bound.
82
+ *
83
+ * This is the max_attachments_count that ships with the model's file-API
84
+ * capability block, and it describes the UPLOAD path's attachment ceiling,
85
+ * NOT a limit on the inline images this line sends: a live probe of the
86
+ * subscription endpoint served 4, 5, 8, 9, 10, 12, 20 and 48 inline images on
87
+ * M3 with HTTP 200, so enforcing this number inline would drop images the
88
+ * service accepts. The inline bound is the request-body budget instead.
89
+ *
90
+ * The value is also not settled. The model's current file-API capability
91
+ * block states `max_attachments_count: 4` for BOTH M3 and M3.1-Flash, while
92
+ * the M3 entry below still carries 9, inherited from the earlier snapshot it
93
+ * was transcribed from. One of the two is a stale number and which one needs a
94
+ * probe against the upload path, not another reading of the docs — so the
95
+ * figure is left as is, on purpose, rather than quietly rounded to the
96
+ * documented one. See the M3 entry's own note.
97
+ */
98
+ maxAttachments: number | null;
99
+ /** Largest single image the model accepts, in bytes. */
100
+ maxImageBytes: number | null;
101
+ /** Largest single video the model accepts, in bytes. */
102
+ maxVideoBytes: number | null;
103
+ /**
104
+ * Whether this line actually serves a files API for this model.
105
+ *
106
+ * Not documentation only. ./files-api.ts implements the upload (the adapter
107
+ * posts to `{messagesBase}/files/upload` and sends an `mm_file://<file_id>`
108
+ * reference back), a 12-hour assumed TTL on every stored id, isolation of
109
+ * those ids per uploading account, and a cache that reuses an id for bytes
110
+ * already uploaded. The adapter calls it wherever media outgrows the inline
111
+ * ceiling.
112
+ *
113
+ * The one capability it lacks is deletion, and the service gives it no way to
114
+ * have one: there is no list or delete route on this surface (`GET /files`
115
+ * answers 503 `direct_route_not_configured`), so an expired id is inferred
116
+ * locally from the TTL and can never be confirmed or reclaimed server-side.
117
+ */
118
+ filesApiDocumented: boolean;
119
+ /** One-line description, from the model table. */
120
+ description: string;
121
+ }
122
+ /**
123
+ * The four ids the subscription serves today.
124
+ *
125
+ * `MiniMax-M3` is the durable default: it is the flagship the measured request
126
+ * used, and it is the one model whose wire behaviour is directly attested.
127
+ *
128
+ * The fourth id used to be `MiniMax-M3.1-Flash-Preview`. MiniMax published
129
+ * `MiniMax-M3.1-Flash` (no suffix) and the preview id was measured answering
130
+ * 200 on the same day, so the catalog carries the GA name only. Anything still
131
+ * naming the preview id in a stored selection, a `provider/model` route string
132
+ * or a doc must be rewritten, or it resolves to a model this build has no entry
133
+ * for.
134
+ */
135
+ export declare const MINIMAX_CODE_MODELS: readonly MinimaxCodeCatalogModel[];
136
+ /**
137
+ * The id a model name resolves to now.
138
+ *
139
+ * The WIRE still carries whatever id the caller asked for, so a session
140
+ * recorded under the old id keeps talking to the id it was recorded with - and
141
+ * keeps its replayed thinking blocks, whose signatures belong to that model.
142
+ * Only the LOOKUP is renamed: a retired id now finds the same catalog entry
143
+ * the new id finds, so its capabilities, its context window and its thinking
144
+ * shape stay exactly what they were.
145
+ */
146
+ export declare function resolveMinimaxCodeModelId(modelId: string): string;
147
+ /** Registry entry for one model id, or undefined when the id is unknown. */
148
+ export declare function minimaxCodeModelDef(modelId: string): MinimaxCodeCatalogModel | undefined;
149
+ /**
150
+ * Membership test for one known model id.
151
+ *
152
+ * A retired id counts: it still names a model this line serves, so a caller
153
+ * asking whether an id is known gets the honest answer instead of a denial
154
+ * that would only be true of the spelling.
155
+ */
156
+ export declare function isMinimaxCodeModelId(value: unknown): boolean;
157
+ /** Display name for one model id, falling back to the raw id so nothing is hidden. */
158
+ export declare function minimaxCodeModelName(modelId: string): string;
159
+ /** Every model id the picker offers, in catalog order. */
160
+ export declare function minimaxCodeModelIds(): string[];
161
+ /**
162
+ * Whether one effort id means "thinking off".
163
+ *
164
+ * The subscription table spells the disabled state "none-thinking" while the
165
+ * shared contract's effort vocabulary has no such member, so a caller that
166
+ * nevertheless asks for an off state (an older preference file, a hand-built
167
+ * request) is recognized here rather than silently treated as "on".
168
+ */
169
+ export declare function isThinkingDisabledEffort(value: unknown): boolean;
170
+ /**
171
+ * The effort level to put on the wire for one model.
172
+ *
173
+ * NULL means "this request carries no `output_config.effort`", which is what
174
+ * the official agent sends when the conversation picked no level. Every model in
175
+ * this catalog states null as its default, so a request that names no effort
176
+ * states no effort.
177
+ *
178
+ * An unknown value falls back to the model's documented default, so a caller
179
+ * cannot talk this route into a level the model does not list - and with that
180
+ * default being null, an unknown level now means no level rather than the most
181
+ * expensive one.
182
+ */
183
+ export declare function effortForModel(modelId: string, requested: string | undefined | null): MinimaxCodeReasoningEffort | null;
184
+ /**
185
+ * Smallest context window an override may name.
186
+ *
187
+ * Exported because the settings route validates POSTed overrides against the
188
+ * same number this reader uses: if they drifted, the route would accept a value
189
+ * the reader then treats as absent, and the card would show a saved override
190
+ * that silently does nothing.
191
+ */
192
+ export declare const MIN_CONTEXT_WINDOW = 1000;
193
+ /**
194
+ * The effective context window for one model.
195
+ *
196
+ * One reader for both the status card and the request path, because the two
197
+ * disagreeing is the exact failure this override can cause: the card would show
198
+ * a window the request builder then ignored, and the user would see a request
199
+ * clamped to the catalog's number with nothing on screen explaining why.
200
+ *
201
+ * A non-positive or sub-minimum override is treated as absent rather than
202
+ * clamped: the route never stores one (it validates them), so seeing one means
203
+ * the document was hand-edited, and inventing a window from it would size every
204
+ * request on that model against a number the user never chose.
205
+ */
206
+ export declare function contextWindowForModel(modelId: string, contextWindowOverrides: Record<string, number> | undefined): number;
207
+ /**
208
+ * The catalog ids the user's stored selection actually resolves to.
209
+ *
210
+ * A stored list that still equals the shipped default has never been edited, so
211
+ * it cannot know about models a later release added; treating it as "everything
212
+ * the catalog currently offers" is what keeps a first run from hiding a new
213
+ * model behind an unedited default. Any explicit edit is honoured exactly, and
214
+ * an id the catalog no longer serves is dropped so the picker cannot offer a
215
+ * model this build has no entry for.
216
+ */
217
+ export declare function resolveMinimaxCodeEnabledModelIds(stored: readonly string[], enabled?: boolean): string[];
218
+ /**
219
+ * The settings-card rows for the whole shipped catalog.
220
+ *
221
+ * Every model is present, enabled or not: the card toggles rows, so a disabled
222
+ * model has to be rendered to be re-enabled. `contextWindow` is the effective
223
+ * window and `defaultContextWindow` the catalog's own number, which is what lets
224
+ * the card show a modified row as modified.
225
+ */
226
+ export declare function buildMinimaxCodeModelOptions(storedEnabledModelIds: readonly string[], contextWindowOverrides: Record<string, number>, enabled?: boolean): MinimaxCodeModelOption[];
227
+ //# sourceMappingURL=model-catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model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with PKCE(S256) against a public
5
+ * client (`mcode-public`, no secret) — the shape the desktop app uses, and the
6
+ * only one that fits a plugin with no browser callback to receive.
7
+ *
8
+ * Measured facts that shape this file (brief section 2.5):
9
+ *
10
+ * - device authorization: POST `account.minimax.cn/oauth2/device/code`
11
+ * - token (device grant AND refresh): POST `account.minimax.cn/oauth2/token`
12
+ * - revocation: POST `account.minimax.cn/oauth2/revoke`
13
+ * - every call is `application/x-www-form-urlencoded` with `Accept: application/json`
14
+ * - the device grant carries `code_challenge`/`code_challenge_method=S256` and the
15
+ * poll carries the matching `code_verifier`
16
+ * - the refresh carries `grant_type=refresh_token`, `refresh_token`, `client_id`,
17
+ * `scope` and `audience`
18
+ *
19
+ * The refresh policy is the one the brief fixes at section 2.6: read the stored
20
+ * credential first and use it while it is valid, refresh only when it is not (or
21
+ * when the service has just rejected it), write the rotation back atomically, and
22
+ * never let a failed refresh damage the file MiniMax Code itself depends on.
23
+ */
24
+ import type { MinimaxCodeAccount, MinimaxCodeRegion, MinimaxCodeWebLogin } from '../../shared/minimax-code-contracts.ts';
25
+ import { accountHost } from './types.ts';
26
+ import { type MinimaxCodeCredentialStore, type MinimaxCodeCredentials } from './token-store.ts';
27
+ /** Raised when the stored credential was rejected and a new sign-in is required. */
28
+ export declare class MinimaxCodeUnauthorizedError extends Error {
29
+ constructor(message: string);
30
+ }
31
+ /** Raised when a transient failure outlived its retry budget. */
32
+ export declare class MinimaxCodeRetryableError extends Error {
33
+ constructor(message: string, cause?: unknown);
34
+ }
35
+ /** Raised when the user denied the device authorization request. */
36
+ export declare class MinimaxCodeAccessDeniedError extends Error {
37
+ constructor(message: string);
38
+ }
39
+ /**
40
+ * One PKCE pair (RFC 7636).
41
+ *
42
+ * The verifier is a fresh random string per authorization; the challenge is its
43
+ * SHA-256 digest, both base64url encoded with no padding, which is what S256
44
+ * means on the wire.
45
+ */
46
+ export declare function createPkcePair(): {
47
+ verifier: string;
48
+ challenge: string;
49
+ };
50
+ /** Parsed device authorization response. */
51
+ export interface DeviceAuthorization {
52
+ userCode: string;
53
+ deviceCode: string;
54
+ verificationUri: string;
55
+ verificationUriComplete: string;
56
+ expiresIn: number;
57
+ interval: number;
58
+ /** PKCE verifier the matching poll must present. */
59
+ codeVerifier: string;
60
+ /** Region the authorization was requested in; decides every later host. */
61
+ region: MinimaxCodeRegion;
62
+ }
63
+ /**
64
+ * Start a device authorization (RFC 8628 section 3.1).
65
+ *
66
+ * A public client sends its `client_id`, the scope and audience it wants, and the
67
+ * PKCE challenge — no secret, which is the whole point of the device profile.
68
+ */
69
+ export declare function requestDeviceAuthorization(options?: {
70
+ fetchFn?: typeof fetch;
71
+ signal?: AbortSignal;
72
+ region?: MinimaxCodeRegion;
73
+ }): Promise<DeviceAuthorization>;
74
+ /** One token response, in the shape the store persists. */
75
+ export interface MinimaxToken {
76
+ accessToken: string;
77
+ refreshToken: string;
78
+ tokenType: string;
79
+ expiresInSec: number;
80
+ expiresAtMs: number;
81
+ scope: string;
82
+ }
83
+ /** Outcome of one device-token poll. */
84
+ export type DevicePollOutcome = {
85
+ kind: 'success';
86
+ token: MinimaxToken;
87
+ } | {
88
+ kind: 'pending';
89
+ slowDown: boolean;
90
+ } | {
91
+ kind: 'expired';
92
+ };
93
+ /**
94
+ * Poll the token endpoint once for one device code (RFC 8628 section 3.4).
95
+ *
96
+ * A 5xx is a transport-class failure rather than a verdict on the device code, so
97
+ * it is raised for the caller's retry loop instead of being read as "still
98
+ * pending" — treating it as pending would spin against a broken endpoint until the
99
+ * device code expired.
100
+ */
101
+ export declare function pollDeviceToken(authorization: Pick<DeviceAuthorization, 'deviceCode' | 'codeVerifier' | 'region'>, options?: {
102
+ fetchFn?: typeof fetch;
103
+ signal?: AbortSignal;
104
+ }): Promise<DevicePollOutcome>;
105
+ /**
106
+ * Refresh an access token, with a bounded retry.
107
+ *
108
+ * Only a transient status or a transport failure is retried. A 400/401/403, or an
109
+ * `invalid_grant` body, is a verdict that the refresh token is dead and stops
110
+ * immediately: retrying it can never succeed, and every attempt is a request the
111
+ * subscription pays for.
112
+ */
113
+ export declare function refreshAccessToken(refreshToken: string, options: {
114
+ fetchFn?: typeof fetch;
115
+ signal?: AbortSignal;
116
+ region: MinimaxCodeRegion;
117
+ }): Promise<MinimaxToken>;
118
+ /**
119
+ * Revoke one token at the service.
120
+ *
121
+ * Best effort by design: a revocation that cannot reach the service must not stop
122
+ * a local sign-out, because the credential is already gone from this machine.
123
+ */
124
+ export declare function revokeToken(token: string, options: {
125
+ fetchFn?: typeof fetch;
126
+ signal?: AbortSignal;
127
+ region: MinimaxCodeRegion;
128
+ }): Promise<boolean>;
129
+ /** Start a device-code sign-in and hand the card what it must display. */
130
+ export declare function beginWebLogin(options?: {
131
+ fetchFn?: typeof fetch;
132
+ region?: MinimaxCodeRegion;
133
+ signal?: AbortSignal;
134
+ }): Promise<MinimaxCodeWebLogin>;
135
+ /** The public projection of one live sign-in, for the status route. */
136
+ export declare function getWebLogin(loginId: string): MinimaxCodeWebLogin | null;
137
+ /** Cancel one sign-in, dropping the session so a later poll cannot resume it. */
138
+ export declare function cancelWebLogin(loginId: string): boolean;
139
+ /** Forget every session; used by the test seam and by a full sign-out. */
140
+ export declare function resetWebLogins(): void;
141
+ /** Build the account projection one credential yields. */
142
+ export declare function accountFromCredentials(credentials: {
143
+ loginEpoch: string;
144
+ generation: number;
145
+ expiresAtMs: number;
146
+ region: MinimaxCodeRegion;
147
+ }): MinimaxCodeAccount;
148
+ export { accountHost };
149
+ /** Whether the given refresh token was rejected recently. */
150
+ export declare function isRefreshTokenRejected(refreshToken: string): boolean;
151
+ /** Test seam: forget every remembered rejection. */
152
+ export declare function resetRefreshRejections(): void;
153
+ /** Test seam: forget every in-flight rotation. */
154
+ export declare function resetInFlightRefreshes(): void;
155
+ export interface EnsureTokenOptions {
156
+ fetchFn?: typeof fetch;
157
+ signal?: AbortSignal;
158
+ /** Refresh even when the stored token is not near expiry (used after a 401). */
159
+ force?: boolean;
160
+ }
161
+ /**
162
+ * Return a usable access token, refreshing and writing back only when needed.
163
+ *
164
+ * This is the whole of the contention discipline in one function:
165
+ *
166
+ * 1. read the stored credential and use it as-is while it is comfortably valid —
167
+ * the common case, and the one that never touches the file or the network;
168
+ * 2. renew EARLY (PRE_EXPIRY_REFRESH_MS before expiry) rather than at the boundary
169
+ * the service refuses at, or when `force` reports a 401 the service has already
170
+ * issued;
171
+ * 3. share one rotation between concurrent callers of the SAME credential, and go
172
+ * through the store's rotation registry so a rotation the desktop app is doing
173
+ * to the same file is waited for rather than raced;
174
+ * 4. write the result back through the store's atomic replacement, and remember a
175
+ * rejection only when the credential on disk is still the rejected one.
176
+ *
177
+ * Step 4 is the one the every-hour sign-out hung on. `invalid_grant` used to be
178
+ * recorded unconditionally, but that verdict has two possible meanings and only
179
+ * one of them is "this sign-in is dead":
180
+ *
181
+ * - the token really is revoked (`invalid_grant` / `invalid_client`), which is a
182
+ * sign-in problem;
183
+ * - another holder of the very same session rotated first, so the token this call
184
+ * presented was already spent. The service cannot tell the two apart, and the
185
+ * plugin must not either — so it looks at the file. A credential newer than the
186
+ * one it presented means somebody else rotated successfully, and that credential
187
+ * is adopted instead of being buried under a tombstone.
188
+ */
189
+ export declare function ensureAccessToken(store: MinimaxCodeCredentialStore, options?: EnsureTokenOptions): Promise<MinimaxCodeCredentials>;
190
+ /**
191
+ * Poll one live sign-in once and, on success, persist what it produced.
192
+ *
193
+ * The persisted credential is plugin-owned: a device-code sign-in started here
194
+ * has no record in the desktop app's `auth.json` (its record key embeds a hash
195
+ * this plugin cannot reproduce), so writing a fabricated entry there would leave
196
+ * the app with an entry it never reads.
197
+ */
198
+ export declare function pollWebLogin(store: MinimaxCodeCredentialStore, loginId: string, options?: {
199
+ fetchFn?: typeof fetch;
200
+ signal?: AbortSignal;
201
+ /**
202
+ * Called with the credential a completed sign-in produced, after it has been
203
+ * persisted.
204
+ *
205
+ * The single-credential store cannot express a second account, so without this
206
+ * a sign-in started from the card would never join the pool: the pool would
207
+ * keep serving its existing accounts, and the user's new sign-in would exist
208
+ * only as the mirror file. The pool installs this hook and adds the credential
209
+ * as its own account.
210
+ *
211
+ * A failure here must not fail the sign-in: the credential is already durable,
212
+ * and the pool is a routing convenience on top of it. The caller receives the
213
+ * authenticated verdict either way.
214
+ */
215
+ onSave?: (credentials: MinimaxCodeCredentials) => Promise<void>;
216
+ }): Promise<{
217
+ status: 'pending' | 'authenticated' | 'expired' | 'denied';
218
+ account?: MinimaxCodeAccount;
219
+ }>;
220
+ //# sourceMappingURL=oauth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/oauth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AACxH,OAAO,EAgBL,WAAW,EAIZ,MAAM,YAAY,CAAA;AACnB,OAAO,EAGL,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAA;AAEzB,oFAAoF;AACpF,qBAAa,4BAA6B,SAAQ,KAAK;gBACzC,OAAO,EAAE,MAAM;CAI5B;AAED,iEAAiE;AACjE,qBAAa,yBAA0B,SAAQ,KAAK;gBAGtC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAI7C;AAED,oEAAoE;AACpE,qBAAa,4BAA6B,SAAQ,KAAK;gBACzC,OAAO,EAAE,MAAM;CAI5B;AAuDD;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAIxE;AAMD,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;IACvB,uBAAuB,EAAE,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