@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,136 @@
1
+ /**
2
+ * The MiniMax Code reset-card ("额度重置卡") surfaces.
3
+ *
4
+ * Three upstream calls, all on the API hosts this line already reads usage from
5
+ * (`QUOTA_HOST_CANDIDATES` in ./types.ts), all authenticated the same way the
6
+ * usage read is:
7
+ *
8
+ * - `GET /backend/account/reset_card/list?page=1&size=20`
9
+ * - `GET /backend/account/reset_card/flows?create_time=<ms>&page=1&size=20`
10
+ * - `POST /backend/account/reset_card/use` with `{ source_type, out_biz_no }`
11
+ *
12
+ * Two facts below are load-bearing and were measured, not inferred:
13
+ *
14
+ * 1. `flows` REQUIRES `create_time`. Without it the service answers HTTP 200
15
+ * with `base_resp.status_code: 2013` ("invalid params"), so the window start
16
+ * is always sent — 30 days back, which is the window the panel shows.
17
+ *
18
+ * 2. The use call is idempotent on `out_biz_no`, which is a field OF THE CARD.
19
+ * The client therefore sends the card's own `source_type` and `out_biz_no`
20
+ * verbatim and generates no request id of its own: a self-minted id would
21
+ * defeat the de-duplication the service performs and turn one user click into
22
+ * several cards spent.
23
+ *
24
+ * The desktop client sends these calls with a literal `token:` header; measured,
25
+ * that answers 401. The bearer form used here works, and no `yy` /
26
+ * `x-timestamp` / `x-signature` attribution headers are sent — this package
27
+ * does not forge the official client's identity (see ./types.ts).
28
+ *
29
+ * Parsing is deliberately forgiving: a row with a missing or mistyped field is
30
+ * SKIPPED rather than thrown, because one malformed card must not blank the whole
31
+ * panel. A business failure (`base_resp.status_code !== 0`) is a different thing
32
+ * and is reported, using the same classification the usage read uses.
33
+ */
34
+ import type { MinimaxCodeResetCardDto, MinimaxCodeResetCardFlowDto, MinimaxCodeResetCardsDto, MinimaxCodeResetOutcome } from '../../shared/minimax-code-contracts.ts';
35
+ import type { MinimaxCodeCredentials } from './token-store.ts';
36
+ /** Path of the available-cards read. */
37
+ export declare const RESET_CARD_LIST_PATH = "/backend/account/reset_card/list";
38
+ /** Path of the flow history read. REQUIRES `create_time`; see the header note. */
39
+ export declare const RESET_CARD_FLOWS_PATH = "/backend/account/reset_card/flows";
40
+ /** Path that spends a card. */
41
+ export declare const RESET_CARD_USE_PATH = "/backend/account/reset_card/use";
42
+ /** Page size every read asks for. */
43
+ export declare const RESET_CARD_PAGE_SIZE = 20;
44
+ /** The flow window the panel shows, and the start `flows` is asked from. */
45
+ export declare const RESET_CARD_FLOW_WINDOW_MS: number;
46
+ /** Local timeout for one reset-card call. */
47
+ export declare const RESET_CARD_TIMEOUT_MS = 15000;
48
+ /** Business codes this surface is known to answer with. */
49
+ export declare const RESET_CARD_RATE_LIMIT = 1002;
50
+ export declare const RESET_CARD_UNAUTHORIZED = 1004;
51
+ export declare const RESET_CARD_INVALID_PARAMS = 2013;
52
+ /**
53
+ * A reset-card call that failed.
54
+ *
55
+ * `statusCode` is the envelope's `base_resp.status_code` (the platform answers
56
+ * HTTP 200 for a refusal), `httpStatus` the status line when the transport
57
+ * itself refused. Both are kept so the route can answer 401 for an expired token
58
+ * rather than the generic 502 it would otherwise send for an upstream refusal.
59
+ */
60
+ export declare class MinimaxCodeResetCardError extends Error {
61
+ readonly httpStatus: number | null;
62
+ readonly statusCode: number | null;
63
+ constructor(message: string, httpStatus: number | null, statusCode: number | null);
64
+ }
65
+ /**
66
+ * Status line one failure should be reported to the browser with.
67
+ *
68
+ * The envelope codes are mapped rather than flattened, because "rate limited"
69
+ * and "your sign-in expired" ask the user for opposite things: one is a
70
+ * "try in a minute", the other is a refresh this line performs on its own.
71
+ */
72
+ export declare function resetCardHttpStatus(error: unknown): number;
73
+ /**
74
+ * Headers for one reset-card call.
75
+ *
76
+ * The bearer is the only credential field: measured, the desktop client's
77
+ * literal `token:` header is refused with 401 by these routes. Nothing derived
78
+ * from the token is ever logged, so a failure sentence can name the surface
79
+ * without naming the credential.
80
+ */
81
+ export declare function resetCardRequestHeaders(accessToken: string): Record<string, string>;
82
+ /** Forget the remembered host (a sign-out, or a test). */
83
+ export declare function clearResetCardHost(): void;
84
+ /** The remembered winning host, if one has answered. */
85
+ export declare function resetCardHost(): string | null;
86
+ export interface ResetCardRequestOptions {
87
+ fetchFn?: typeof fetch;
88
+ signal?: AbortSignal;
89
+ /** Clock injection for tests; also decides the flow window start. */
90
+ nowMs?: () => number;
91
+ }
92
+ /** One card, or undefined when a required field is missing or mistyped. */
93
+ export declare function parseResetCard(raw: unknown): MinimaxCodeResetCardDto | undefined;
94
+ /**
95
+ * One flow row.
96
+ *
97
+ * `event_type` is a closed vocabulary, and an unknown value is dropped rather
98
+ * than passed through: the contract says GRANT | USE, and a card rendered with a
99
+ * third value would be showing this plugin an assumption it cannot back.
100
+ */
101
+ export declare function parseResetCardFlow(raw: unknown): MinimaxCodeResetCardFlowDto | undefined;
102
+ /** The available cards from one `list` document. */
103
+ export declare function parseResetCardList(payload: unknown): MinimaxCodeResetCardDto[];
104
+ /** The flow rows from one `flows` document. */
105
+ export declare function parseResetCardFlows(payload: unknown): MinimaxCodeResetCardFlowDto[];
106
+ /** The query the flow read is sent with. `create_time` is mandatory. */
107
+ export declare function resetCardFlowsQuery(sinceMs: number, page?: number, size?: number): string;
108
+ /** The query the list read is sent with. */
109
+ export declare function resetCardListQuery(page?: number, size?: number): string;
110
+ /**
111
+ * The reset-card panel: the cards still held, plus the recent flow.
112
+ *
113
+ * Two requests, and the asymmetry between them is the point: the LIST is the
114
+ * panel's substance, so a failure of it is reported; the FLOW is context, so its
115
+ * failure degrades to an empty list and the cards still render. A user whose
116
+ * flow read is refused loses a history row, not the button they came to press.
117
+ */
118
+ export declare function fetchResetCards(credentials: MinimaxCodeCredentials, options?: ResetCardRequestOptions): Promise<MinimaxCodeResetCardsDto>;
119
+ /**
120
+ * Spend one card.
121
+ *
122
+ * The body is exactly two fields, both copied off the card. There is deliberately
123
+ * no request id here: de-duplication is the service's, keyed on `out_biz_no`,
124
+ * and a self-minted id would make a second click spend a second card — the exact
125
+ * harm this line's contract warns about.
126
+ *
127
+ * The returned outcome is passed through rather than collapsed into a boolean,
128
+ * because three of the six values mean "possibly spent, confirm with THIS card"
129
+ * (REPLAYED, LOCK_BUSY, RETRYABLE_FAIL) and the caller has to be able to tell the
130
+ * user to retry the same card instead of another one.
131
+ */
132
+ export declare function useResetCard(credentials: MinimaxCodeCredentials, card: {
133
+ sourceType: string;
134
+ outBizNo: string;
135
+ }, options?: ResetCardRequestOptions): Promise<MinimaxCodeResetOutcome>;
136
+ //# sourceMappingURL=reset-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset-card.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/reset-card.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EACV,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAG9D,wCAAwC;AACxC,eAAO,MAAM,oBAAoB,qCAAqC,CAAA;AACtE,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,sCAAsC,CAAA;AACxE,+BAA+B;AAC/B,eAAO,MAAM,mBAAmB,oCAAoC,CAAA;AAEpE,qCAAqC;AACrC,eAAO,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,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,uBAAuB,EAAE,CAS9E;AAED,+CAA+C;AAC/C,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,2BAA2B,EAAE,CASnF;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAU,EAAE,IAAI,GAAE,MAA6B,GAAG,MAAM,CAMlH;AAED,4CAA4C;AAC5C,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,MAAU,EAAE,IAAI,GAAE,MAA6B,GAAG,MAAM,CAEhG;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,WAAW,EAAE,sBAAsB,EACnC,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,wBAAwB,CAAC,CAgBnC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAChC,WAAW,EAAE,sBAAsB,EACnC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EAC9C,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,uBAAuB,CAAC,CAsBlC"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Web routes for the MiniMax Code line.
3
+ *
4
+ * The six routes below are the frozen contract the client half consumes (brief
5
+ * section 3). Their paths, request bodies and verdicts are therefore not free:
6
+ * this file implements them as specified rather than as this line might prefer.
7
+ *
8
+ * Response envelope: every route answers \`{ ok: true, value: <payload> }\`, which is
9
+ * what the sibling lines in this package use. The three routes whose contract names
10
+ * a top-level key as well (\`/login/start\` -> \`login\`, \`/login/poll\` -> \`status\` and
11
+ * \`account\`, \`/test\` -> \`ok\`/\`model\`/\`error\`) carry that key at the top level too,
12
+ * so a client written against either reading resolves. \`/test\` is the one route
13
+ * where the envelope's \`ok\` cannot double as the payload's: its contract defines
14
+ * \`ok\` as the probe verdict, so the envelope there is the verdict itself and the
15
+ * duplicate lives under \`value\`.
16
+ *
17
+ * Mounting: the routes are registered under BOTH the contract prefix and the
18
+ * sibling-line convention, because the two disagree in this repository and the
19
+ * client half must not be able to miss them for that reason alone.
20
+ *
21
+ * \`/models\` and \`/settings\` are the model-settings half every sibling line has and
22
+ * this one shipped without. They are two names for one route because the sibling
23
+ * cards disagree about which to call: kimi-code and claude call it \`/models\`,
24
+ * command-code calls it \`/settings\`. Serving both costs one string
25
+ * comparison and removes a client-side special case.
26
+ */
27
+ import type { Context } from '@deepseek-ai/cordis';
28
+ import { MINIMAX_CODE_PROVIDER_ID, type MinimaxCodeWebStatus } from '../../shared/minimax-code-contracts.ts';
29
+ import { type MinimaxCodeAccountPool } from './account-pool.ts';
30
+ import { MinimaxCodeCredentialStore, MinimaxCodeModelSettingsStore, type MinimaxCodeModelSettings, type MinimaxCodePreferenceStore, type MinimaxCodeSettingsPatch } from './token-store.ts';
31
+ import { ensureAccessToken, getWebLogin } from './oauth.ts';
32
+ import type { MinimaxCodeCheckinService } from './checkin.ts';
33
+ /** The sub-path one request addresses, whichever prefix it arrived under. */
34
+ export declare function subPathOf(requestUrl: string): string;
35
+ /**
36
+ * The stored selection, however this deployment persists it.
37
+ *
38
+ * The routes accept either shape so a composition that still has the register
39
+ * settings seam and one that only has the file both work: the caller passes
40
+ * whichever it wired, and nothing in this file needs to know which it got. The
41
+ * patch type is the store's own, deliberately, so a field added to the settings
42
+ * document cannot become one this route accepts but the stores silently drop.
43
+ */
44
+ export interface MinimaxCodeSettingsSource {
45
+ /** Current selection: a value on the register seam, a read on the file store. */
46
+ status(): Promise<MinimaxCodeModelSettings> | MinimaxCodeModelSettings;
47
+ update(patch: MinimaxCodeSettingsPatch): Promise<MinimaxCodeModelSettings>;
48
+ }
49
+ export interface MinimaxCodeStatusOptions {
50
+ fetchFn?: typeof fetch;
51
+ /** Whether this plugin currently owns the provider route; re-read on every status. */
52
+ serving?: boolean | (() => boolean);
53
+ /** Diagnostic when another plugin owns the provider route; re-read on every status. */
54
+ conflict?: string | null | (() => string | null);
55
+ /**
56
+ * Where the model selection lives.
57
+ *
58
+ * Omitted, the routes read the default settings file, which is what a caller
59
+ * that only wants the connection half of the card gets. The plugin entry
60
+ * supplies the same store the adapter was built with, so the card and the
61
+ * request path can never read two different selections.
62
+ */
63
+ settings?: MinimaxCodeSettingsSource;
64
+ /**
65
+ * The account pool, when this process installed one.
66
+ *
67
+ * Omitting it is a supported posture: the line then behaves as the
68
+ * single-credential route it was before the pool existed, and the status
69
+ * reports `poolInstalled: false` so the card can say so rather than render an
70
+ * empty account list that looks like a bug.
71
+ */
72
+ accountPool?: MinimaxCodeAccountPool;
73
+ /** Daily check-in scheduler; absent leaves the card's check-in row empty. */
74
+ checkin?: Pick<MinimaxCodeCheckinService, 'tick' | 'summary'>;
75
+ }
76
+ /** Everything the settings card renders. */
77
+ export declare function getMinimaxCodeWebStatus(store: MinimaxCodeCredentialStore, options?: MinimaxCodeStatusOptions, settingsSource?: MinimaxCodeSettingsSource): Promise<MinimaxCodeWebStatus>;
78
+ export declare function registerMinimaxCodeRoutes(ctx: Context, store?: MinimaxCodeCredentialStore, options?: MinimaxCodeStatusOptions, modelSettings?: MinimaxCodeModelSettingsStore, preferences?: MinimaxCodePreferenceStore): () => void;
79
+ /** Test seam: forget which sign-in the status route reports. */
80
+ export declare function resetLatestLogin(): void;
81
+ export { MINIMAX_CODE_PROVIDER_ID, getWebLogin, ensureAccessToken };
82
+ //# sourceMappingURL=routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EACL,wBAAwB,EAMxB,KAAK,oBAAoB,EAC1B,MAAM,wCAAwC,CAAA;AAG/C,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,mBAA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AE,OAAO,EACZ,KAAK,GAAE,0BAA6D,EACpE,OAAO,GAAE,wBAA6B,EACtC,aAAa,GAAE,6BAAmE,EAClF,WAAW,CAAC,EAAE,0BAA0B,GACvC,MAAM,IAAI,CAsYZ;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAA"}
@@ -0,0 +1,328 @@
1
+ /**
2
+ * Credential storage for the MiniMax Code line.
3
+ *
4
+ * Unlike every other line in this package, this one does not own its credential
5
+ * format: MiniMax Code itself keeps the signed-in session in
6
+ * `~/.minimax/auth/<buildEnv>/<region>/mcode-public/auth.json`, and the whole
7
+ * point of reusing it is that a user who is already signed in to the desktop app
8
+ * does not sign in again here.
9
+ *
10
+ * That sharing is the design constraint:
11
+ *
12
+ * 1. READ-ONLY FIRST. Every call reads the file and uses the stored token when it
13
+ * is still valid; the plugin never rotates a credential it does not have to.
14
+ * 2. WRITE-BACK IS ATOMIC. A rotated token replaces the file through a temporary
15
+ * file plus `rename`, so a failed or interrupted refresh leaves the previous
16
+ * `auth.json` byte-for-byte intact — the requirement the brief states at
17
+ * section 2.6.4.
18
+ * 3. NO LOCK IS TAKEN. MiniMax Code holds `auth.lock` while it refreshes, and a
19
+ * second process must not create, delete or wait on that file: doing so could
20
+ * break the app's own refresh. Atomic replacement is what makes lock-free
21
+ * sharing safe instead — a reader sees either the whole old file or the whole
22
+ * new one, never a half-written one, and the record's key is preserved so the
23
+ * app finds its own entry where it left it.
24
+ * 4. THE SHAPE IS PRESERVED. `schemaVersion` and every other record in
25
+ * `records` survive a write untouched; only the `mcode-public` record and the
26
+ * matching `auth-state.json` fields change.
27
+ *
28
+ * A credential this plugin obtained itself (device-code login with no native file
29
+ * present) is kept in the plugin's own store under `$DSH_HOME/storages`, so the
30
+ * two provenances never overwrite each other.
31
+ */
32
+ import { type ContextWindowOverridePatch } from '../common/context-window-overrides.ts';
33
+ import type { MinimaxCodeReasoningEffort, MinimaxCodeRegion } from '../../shared/minimax-code-contracts.ts';
34
+ /** Where the credential and the token came from. */
35
+ export type MinimaxCodeCredentialSource = 'minimax-native' | 'file';
36
+ /**
37
+ * One MiniMax Code subscription credential.
38
+ *
39
+ * Field names follow `auth.json` exactly; nothing is renamed on the way in or
40
+ * out, so a round trip cannot lose a field the desktop app depends on.
41
+ */
42
+ export interface MinimaxCodeCredentials {
43
+ /** Bearer access token for the agent API. Host-only; never sent to a browser. */
44
+ accessToken: string;
45
+ /** Rotating refresh token. Host-only. */
46
+ refreshToken: string;
47
+ /** Always "Bearer" in the measured file; kept verbatim. */
48
+ tokenType: string;
49
+ /** Public client the record belongs to. */
50
+ clientId: string;
51
+ /** Scopes the token was issued for. */
52
+ scopes: string[];
53
+ /** Audience the token was issued for. */
54
+ audience: string;
55
+ /** Unix milliseconds the access token stops being valid. */
56
+ expiresAtMs: number;
57
+ /** Rotations the credential has been through; incremented on every refresh. */
58
+ generation: number;
59
+ /** Identity of the sign-in that produced the credential. */
60
+ loginEpoch: string;
61
+ /** Build environment segment of the path the credential lives under. */
62
+ buildEnv: string;
63
+ /** Region the credential was issued in. */
64
+ region: MinimaxCodeRegion;
65
+ /** Record key inside `auth.json`, preserved verbatim so a write lands in place. */
66
+ recordKey: string | null;
67
+ /** Whether this credential is the desktop app's file or the plugin's own. */
68
+ source: MinimaxCodeCredentialSource;
69
+ /** Unix milliseconds this plugin read or wrote the credential. */
70
+ seenAt?: number;
71
+ }
72
+ /** The MiniMax home directory: the desktop app's data root. */
73
+ export declare function minimaxHomeDir(env?: NodeJS.ProcessEnv): string;
74
+ /** Directory holding one region's auth files. */
75
+ export declare function authDirFor(region: MinimaxCodeRegion, buildEnv?: string): string;
76
+ /** Path of the desktop app's credential file for one region. */
77
+ export declare function authJsonPath(region: MinimaxCodeRegion, buildEnv?: string): string;
78
+ /** Path of the desktop app's non-secret state file for one region. */
79
+ export declare function authStateJsonPath(region: MinimaxCodeRegion, buildEnv?: string): string;
80
+ /** Path of the plugin's own credential file, used when no native file exists. */
81
+ export declare function pluginCredentialPath(): string;
82
+ /**
83
+ * Validate and normalize one stored credential.
84
+ *
85
+ * A payload that is missing a token or an expiry is rejected rather than
86
+ * defaulted: a credential with an invented expiry would be presented to the
87
+ * service as valid when it is not, which is exactly the failure the refresh path
88
+ * exists to prevent.
89
+ */
90
+ export declare function parseMinimaxCodeCredentials(value: unknown, fallback: {
91
+ region: MinimaxCodeRegion;
92
+ buildEnv?: string;
93
+ recordKey?: string | null;
94
+ source?: MinimaxCodeCredentialSource;
95
+ }): MinimaxCodeCredentials;
96
+ /** Whether a credential is valid for long enough to use as-is. */
97
+ export declare function credentialIsFresh(credentials: MinimaxCodeCredentials, now?: number): boolean;
98
+ /**
99
+ * Whether a credential should be renewed BEFORE it can be refused.
100
+ *
101
+ * {@link credentialIsFresh} answers "can this token be presented right now"; this
102
+ * answers "is it worth rotating on this plugin's own schedule instead of waiting
103
+ * for the service to say no". The two questions need different answers: the whole
104
+ * one-hour sign-out was the second question being answered with the first, so the
105
+ * line only ever rotated inside the last sixty seconds of a sixty-minute token —
106
+ * exactly the window in which concurrent callers spend the same rotating refresh
107
+ * token, and exactly the window in which a request can already be refused.
108
+ *
109
+ * The desktop app reads the same file and remains the first authority for it: this
110
+ * plugin renews a few minutes early, writes the rotation back atomically, and
111
+ * never touches the app's own `auth.lock`.
112
+ */
113
+ export declare function credentialNeedsRefresh(credentials: MinimaxCodeCredentials, now?: number): boolean;
114
+ /** Test seam: forget the snapshot, so one case cannot observe another's read. */
115
+ export declare function resetMinimaxCodeCredentialReads(): void;
116
+ /**
117
+ * Whether two credentials are two generations of ONE session.
118
+ *
119
+ * The file this line reads holds a single record, but the plugin's own file is a
120
+ * mirror that the pool writes for whichever account is primary — so a credential
121
+ * read from storage may belong to a completely different account than the one a
122
+ * caller is working on. Adopting a stranger's token would present one account's
123
+ * session as another's, which is the one mistake this whole line must never make.
124
+ *
125
+ * The identity is therefore the same one {@link rotationKey} uses: a native record
126
+ * slot, or the sign-in that produced a plugin-owned credential.
127
+ */
128
+ export declare function minimaxCodeSameCredentialSession(a: MinimaxCodeCredentials | null, b: MinimaxCodeCredentials | null): boolean;
129
+ /**
130
+ * Whether one credential is a LATER state of another.
131
+ *
132
+ * The generation is the desktop app's own rotation counter and the expiry moves
133
+ * forward with every rotation, so either being greater means the candidate is the
134
+ * result of a rotation the baseline predates. This is also what stops a stale copy
135
+ * from rolling a newer state back: a pool row the mirror could not write must never
136
+ * overwrite a fresh file.
137
+ */
138
+ export declare function minimaxCodeCredentialAdvancedPast(candidate: MinimaxCodeCredentials | null, baseline: MinimaxCodeCredentials): boolean;
139
+ /**
140
+ * Rotate one credential, or adopt the rotation somebody else is doing.
141
+ *
142
+ * The distinction matters: a caller that ADOPTED a result must use the credential
143
+ * that comes back, because the winner replaced the whole record.
144
+ */
145
+ export declare function rotateMinimaxCodeCredential(store: MinimaxCodeCredentialStore, credentials: MinimaxCodeCredentials, perform: () => Promise<MinimaxCodeCredentials>, options?: {
146
+ signal?: AbortSignal;
147
+ }): Promise<{
148
+ credentials: MinimaxCodeCredentials;
149
+ adopted: boolean;
150
+ }>;
151
+ /** Test seam: forget every rotation, so one test cannot leak into the next. */
152
+ export declare function resetMinimaxCodeRotations(): void;
153
+ /**
154
+ * The credential store for this line.
155
+ *
156
+ * `read()` prefers the desktop app's file and falls back to the plugin's own, so
157
+ * a user who signed in through either path is served. `write()` returns the
158
+ * credential to the file it came from, which is what keeps the two provenances
159
+ * from clobbering each other.
160
+ */
161
+ export declare class MinimaxCodeCredentialStore {
162
+ private readonly region;
163
+ constructor(region?: MinimaxCodeRegion);
164
+ /** Path of the file the next read or write targets. */
165
+ path(): string;
166
+ private readNative;
167
+ private readPluginFile;
168
+ read(): Promise<MinimaxCodeCredentials | null>;
169
+ /** Resolve once every operation already queued for this store's file settled. */
170
+ private drain;
171
+ /**
172
+ * Read storage, ignoring the snapshot.
173
+ *
174
+ * Used by the rotation path, where the whole question is whether somebody else
175
+ * has already replaced the credential: a cached answer would report the very
176
+ * state the caller is trying to move past. This is also what makes a rotation
177
+ * observable at all - the desktop app's write is only visible by reading the
178
+ * file again.
179
+ */
180
+ readFresh(): Promise<MinimaxCodeCredentials | null>;
181
+ /**
182
+ * The credential in force plus where it came from, in one pass.
183
+ *
184
+ * A status response needs all three facts, and each of the targeted accessors
185
+ * re-reads and re-parses the native document (a file read plus a JSON parse per
186
+ * region probed). Reading once here keeps one /status call from doing that work
187
+ * three times, which matters because the settings card polls this route.
188
+ */
189
+ readWithProvenance(): Promise<{
190
+ credentials: MinimaxCodeCredentials | null;
191
+ source: MinimaxCodeCredentialSource;
192
+ path: string;
193
+ }>;
194
+ /** Which file the credential currently in force lives in. */
195
+ activeSource(): Promise<MinimaxCodeCredentialSource>;
196
+ /**
197
+ * Persist a credential back where it came from.
198
+ *
199
+ * A native credential is written into the existing record, preserving the
200
+ * document's `schemaVersion` and every other record; a plugin credential is
201
+ * written to the plugin's own file. Either way the write is atomic.
202
+ */
203
+ write(credentials: MinimaxCodeCredentials): Promise<void>;
204
+ /**
205
+ * One write, to whichever file the credential came from.
206
+ *
207
+ * Called with the destination already held by {@link write}'s `serialize`; it
208
+ * must NOT claim the same chain again, or the outer frame would be waiting on the
209
+ * inner one while the inner one waits on the outer.
210
+ */
211
+ private writeOnce;
212
+ /**
213
+ * Forget the credential this plugin owns.
214
+ *
215
+ * The desktop app's `auth.json` is deliberately left alone: it is not this
216
+ * plugin's to delete, and removing it would sign the user out of MiniMax Code
217
+ * itself. A credential this store is only *reading* from the app therefore
218
+ * remains in force after a sign-out, which the status route reports so the
219
+ * user is not told a session ended when it did not.
220
+ */
221
+ delete(): Promise<void>;
222
+ }
223
+ /** Namespace the model selection is registered under on a register-capable harness. */
224
+ export declare const MINIMAX_CODE_PREFERENCES_NAMESPACE = "dsh-minimax-code";
225
+ /**
226
+ * The model-selection half of this line's settings.
227
+ *
228
+ * The catalog (`MINIMAX_CODE_MODELS`) is deliberately not stored here. A shipped
229
+ * catalog changes with the code, so persisting a copy of it would leave a user
230
+ * whose file is a release behind reading a model list the build no longer serves;
231
+ * only the user's own choices live in this document.
232
+ */
233
+ export interface MinimaxCodeModelSettings {
234
+ /** Line-wide switch. Absent means enabled: this line shipped enabled. */
235
+ enabled?: boolean;
236
+ /** Catalog ids DSH offers in the conversation model picker. */
237
+ enabledModelIds: string[];
238
+ /** Per-model context window, replacing the catalog's own number. */
239
+ contextWindowOverrides: Record<string, number>;
240
+ /** Level used when a conversation picks none; null means the model's own. */
241
+ defaultReasoningEffort: MinimaxCodeReasoningEffort | null;
242
+ /** Daily check-in scheduler switch. Absent means enabled. */
243
+ checkin?: {
244
+ enabled: boolean;
245
+ };
246
+ }
247
+ /**
248
+ * One settings patch.
249
+ *
250
+ * `contextWindowOverrides` is a patch rather than the whole map because `null`
251
+ * has to survive as a value: it is the settings card's "restore the catalog
252
+ * default" and deletes exactly one key. A full replacement could not express
253
+ * that without the caller first reading the document it wants to edit.
254
+ */
255
+ export interface MinimaxCodeSettingsPatch {
256
+ enabled?: boolean;
257
+ enabledModelIds?: string[];
258
+ contextWindowOverrides?: ContextWindowOverridePatch;
259
+ defaultReasoningEffort?: MinimaxCodeReasoningEffort | null;
260
+ checkin?: {
261
+ enabled: boolean;
262
+ };
263
+ }
264
+ /**
265
+ * The seam the routes and the adapter share.
266
+ *
267
+ * `status()` is synchronous on purpose: it is read on every model-picker query
268
+ * and on every settings-card poll, and both callers only need a snapshot. A
269
+ * promise-shaped reader here would make each of them await a file read on a hot
270
+ * path for a value that changes at human speed.
271
+ */
272
+ export interface MinimaxCodePreferenceStore {
273
+ /**
274
+ * The file-backed store warms up asynchronously, so `status()` answers from
275
+ * shipped defaults until that read settles. A caller that acts on a
276
+ * preference at startup — the check-in scheduler signing in on boot — must
277
+ * await this first, or it acts on the default instead of the user's choice.
278
+ * A register-backed store reads synchronously and resolves immediately.
279
+ */
280
+ ready(): Promise<void>;
281
+ status(): MinimaxCodeModelSettings;
282
+ update(patch: MinimaxCodeSettingsPatch): Promise<MinimaxCodeModelSettings>;
283
+ }
284
+ /** Path of the settings file used when no settings service is present. */
285
+ export declare function modelSettingsPath(): string;
286
+ /**
287
+ * Apply one patch to one settings document.
288
+ *
289
+ * The merge lives outside both stores because the register-backed store has to
290
+ * normalize the scope's value through the same rules the file store applies; two
291
+ * copies of this logic is how the two storage paths drift apart the first time
292
+ * one of them learns a new field.
293
+ */
294
+ export declare function mergeMinimaxCodeSettings(current: MinimaxCodeModelSettings, patch: MinimaxCodeSettingsPatch): MinimaxCodeModelSettings;
295
+ /**
296
+ * The settings file beside the credentials.
297
+ *
298
+ * This is what a harness without the register seam (0.1.7, and a headless host)
299
+ * reads back on boot, so it is the store that has to survive a crash: the write
300
+ * is a temporary sibling plus `rename`, and the document just written is read
301
+ * back and compared before the write is reported as done. Without the read-back
302
+ * a partial write, or a filesystem that dropped the rename, would report a
303
+ * selection the next boot does not agree with — the card would show a model
304
+ * grid the adapter never applies.
305
+ */
306
+ export declare class MinimaxCodeModelSettingsStore {
307
+ private readonly filePath;
308
+ constructor(filePath?: string);
309
+ path(): string;
310
+ read(): Promise<MinimaxCodeModelSettings>;
311
+ write(settings: MinimaxCodeModelSettings): Promise<void>;
312
+ /**
313
+ * Read-modify-write under the same per-path lock the credential writes use.
314
+ *
315
+ * Without it two patches landing together each read the same document and the
316
+ * second write silently discards the first — a lost model selection, with no
317
+ * error anywhere. The lock is shared with the credential paths because it is
318
+ * keyed by resolved path, and the two never name the same file.
319
+ */
320
+ updateSettings(patch: MinimaxCodeSettingsPatch): Promise<MinimaxCodeModelSettings>;
321
+ }
322
+ /**
323
+ * Bind the model selection to the DSH settings document when the harness still
324
+ * offers one, and to the JSON file beside it otherwise: a harness without the
325
+ * register seam (0.1.7, and a headless host) reads that file back on boot.
326
+ */
327
+ export declare function registerMinimaxCodePreferenceStore(settings?: unknown, fallbackStore?: MinimaxCodeModelSettingsStore): MinimaxCodePreferenceStore;
328
+ //# sourceMappingURL=token-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-store.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/token-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAgBH,OAAO,EAA+B,KAAK,0BAA0B,EAAE,MAAM,uCAAuC,CAAA;AAEpH,OAAO,KAAK,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAG3G,oDAAoD;AACpD,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,GAAG,MAAM,CAAA;AAEnE;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,iFAAiF;IACjF,WAAW,EAAE,MAAM,CAAA;IACnB,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAA;IACpB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAA;IACjB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAA;IAChB,uCAAuC;IACvC,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAA;IAChB,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAA;IACnB,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAA;IAClB,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAA;IAClB,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAA;IAChB,2CAA2C;IAC3C,MAAM,EAAE,iBAAiB,CAAA;IACzB,mFAAmF;IACnF,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,6EAA6E;IAC7E,MAAM,EAAE,2BAA2B,CAAA;IACnC,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAI3E;AAED,iDAAiD;AACjD,wBAAgB,UAAU,CAAC,MAAM,E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Ac,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAOnF;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,QAAQ,CAAC,EAAE,OAAO,EAClB,aAAa,GAAE,6BAAmE,GACjF,0BAA0B,CAkF5B"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * MiniMax Code 线路的工具参数修复,移植自官方 `edit-prepare-arguments.ts` 与
3
+ * `input-validation.ts`。
4
+ *
5
+ * 模型把工具参数写成 schema 不接受的形状:数字字段写成字符串、`edits` 数组写成
6
+ * JSON 字符串、数组包成 `{"item": [...]}`。DSH 的工具守卫随后按形状拒绝这次
7
+ * 调用,而模型没有任何线索知道自己写错了。这里把它们改回本来的形状。
8
+ *
9
+ * 修复是**无损**的,而且只在真的改动过时才返回修复项:
10
+ *
11
+ * - 数字字符串只在能无损还原成数字时才转,`"2.5"` 遇到 `integer` 不转;
12
+ * - 布尔字符串只在字面是 `"true"` / `"false"` 时才转,`"1"`、`"yes"` 有歧义,不动;
13
+ * - `edits` 解析失败就原样留着,让 schema 校验照常报错——在这里猜一个数组比不猜更糟;
14
+ * - 没有 schema 时只按字段名强转**顶层**,嵌套结构没有依据,猜不得。
15
+ *
16
+ * 入参不被修改:返回值是一份新对象。
17
+ *
18
+ * @module dsh-multi-provider/host/minimax-code/tool-argument-repair
19
+ */
20
+ /**
21
+ * 顶层已知的数字字段(没有 schema 时按字段名强转)。
22
+ *
23
+ * 这些是本宿主工具面里**本来就该是数字**的字段:模型把它们写成字符串时,
24
+ * schema 校验会直接失败,而它们强转回来是**无损**的。
25
+ */
26
+ export declare const NUMERIC_TOOL_FIELDS: readonly string[];
27
+ /**
28
+ * 顶层已知的布尔字段(没有 schema 时按字段名强转)。
29
+ *
30
+ * 只有字面 `"true"` / `"false"` 才转:别的写法(`"1"`、`"yes"`)在布尔
31
+ * 字段上是**有歧义**的,转过去等于替模型猜了一个开关的状态。
32
+ */
33
+ export declare const BOOLEAN_TOOL_FIELDS: readonly string[];
34
+ /** 一次参数修复的结果。 */
35
+ export interface MinimaxArgumentRepair {
36
+ /** 修复后的参数;没有修复时与传入值等价。 */
37
+ readonly value: unknown;
38
+ /** 修复项的名字,按发生顺序。 */
39
+ readonly fixes: string[];
40
+ }
41
+ /**
42
+ * 修复一次工具调用的参数。
43
+ *
44
+ * 三步,顺序固定:
45
+ *
46
+ * 1. **`edits` 字符串解析**:`edits` 是 JSON 字符串时解析回数组。解析失败就
47
+ * **原样留着**,让 schema 校验照常报错。
48
+ * 2. **按 schema 强转**:`item_wrapper` 拆包、数字字符串转数字、布尔字符串转布尔,
49
+ * 并递归进 `properties` 与 `items`。
50
+ * 3. **按字段名强转**:**没有传 schema** 时才做,因为那时唯一的依据就是字段名。
51
+ *
52
+ * 入参**不被修改**:返回值是一份新对象。
53
+ *
54
+ * @param toolName - 工具名(只用于将来按工具定制规则)。
55
+ * @param args - 原始参数。
56
+ * @param schema - 该工具的 JSON Schema(参数面),可选。
57
+ * @returns 修复后的参数与修复项列表。
58
+ */
59
+ export declare function repairMinimaxToolArguments(toolName: string, args: unknown, schema?: unknown): MinimaxArgumentRepair;
60
+ /**
61
+ * 把一段流式累积出来的参数串修复成可直接上线的形状。
62
+ *
63
+ * 空串是线上允许、宿主拒绝的唯一形状,变成 `{}`;解析不出对象、或修复项为空时
64
+ * 原样返回——需要修复的才改写,不需要的保持字节不变,好让上游缓存看见同一份前缀。
65
+ *
66
+ * @param name - 工具名。
67
+ * @param rawArguments - 流式拼起来的原始参数字符串。
68
+ * @param schema - 该工具的 JSON Schema,可选。
69
+ * @returns 可上线的参数串。
70
+ */
71
+ export declare function repairStreamedToolArguments(name: string, rawArguments: string, schema?: unknown): string;
72
+ //# sourceMappingURL=tool-argument-repair.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-argument-repair.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/tool-argument-repair.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAyBH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAY/C,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAM/C,CAAA;AAEF,iBAAiB;AACjB,MAAM,WAAW,qBAAqB;IACpC,0BAA0B;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,oBAAoB;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CACzB;AAiID;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,EACb,MAAM,CAAC,EAAE,OAAO,GACf,qBAAqB,CA0BvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAOxG"}