@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,419 @@
1
+ /**
2
+ * Claude subscription OAuth sign-in.
3
+ *
4
+ * WHO THIS FILE IS FOR, AND WHAT IT ASSUMES ABOUT UPSTREAM.
5
+ *
6
+ * This module drives the browser sign-in that turns a Claude Pro/Max account
7
+ * into a credential this provider can call /v1/messages with. The wire facts it
8
+ * relies on — authorization endpoint, token endpoint, client id, scope set, the
9
+ * manual-paste redirect URI, the default callback port, the login timeout — all
10
+ * live in the frozen sibling 'types.ts' and are imported from there rather than
11
+ * restated here: one fact, one home.
12
+ *
13
+ * Everything this module could NOT verify is called out inline and collected
14
+ * again in the ASSUMPTIONS block at the bottom of this comment. Treat each one
15
+ * as a claim a later reviewer may need to re-check against the live
16
+ * authorization host: a locally installed reference implementation is an
17
+ * artifact, not a specification.
18
+ *
19
+ * ---------------------------------------------------------------------------
20
+ * WHY THIS IS NOT A COPY OF THE REFERENCE
21
+ * ---------------------------------------------------------------------------
22
+ *
23
+ * The locally installed reference ('@earendil-works/pi-ai',
24
+ * dist/auth/oauth/anthropic.js line 209) sets 'state: verifier' — it reuses the
25
+ * PKCE code verifier AS the OAuth state. That puts the verifier in a URL (the
26
+ * authorize URL, the address bar, browser history, and in the manual flow the
27
+ * clipboard) while the verifier is the one value that is supposed to stay
28
+ * inside this process: PKCE's whole security argument is that an attacker who
29
+ * can READ the authorization request still cannot redeem the code without the
30
+ * verifier. A leaked verifier plus a leaked code is a complete exchange, so
31
+ * this module draws the two values independently and never encodes the
32
+ * verifier anywhere a URL can carry it. 'test/claude-oauth.test.ts' asserts
33
+ * that property directly on the produced URL.
34
+ *
35
+ * ---------------------------------------------------------------------------
36
+ * WHY THE TWO MODES ARE TWO FLOWS
37
+ * ---------------------------------------------------------------------------
38
+ *
39
+ * An authorization code is bound to the redirect_uri of the request that issued
40
+ * it: the token endpoint compares the redirect_uri sent with the exchange
41
+ * against the one recorded with the code and rejects the request when they
42
+ * differ. "Which redirect URI is in the UI right now" is therefore not a value
43
+ * the exchange may read — it has to be the value recorded on the flow that
44
+ * produced the code. So each sign-in is a LoginFlow carrying its own
45
+ * { flowId, mode, redirectUri, verifier, state }, the mode is immutable for
46
+ * that flow's lifetime, and switching mode abandons the flow and starts a new
47
+ * one with fresh secrets. The exchange reads flow.redirectUri and nothing else,
48
+ * which is also what lets a test prove the two modes never share one request.
49
+ *
50
+ * ---------------------------------------------------------------------------
51
+ * ASSUMPTIONS (each one unverifiable from here)
52
+ * ---------------------------------------------------------------------------
53
+ *
54
+ * - A1. "The client registration permits arbitrary ports." The loopback flow
55
+ * hands the authorization host a redirect URI built from whatever port the
56
+ * probe resolves, on the theory that a public client registered for a
57
+ * loopback redirect accepts any port (RFC 8252 section 7.3 says it should,
58
+ * which is why the port of a loopback redirect is normally ignored). THIS IS
59
+ * AN ASSUMPTION, NOT A VERIFIED FACT: the registration belongs to Anthropic
60
+ * and nothing in this repository can read it. If it is false, the browser
61
+ * callback fails for every port except an exactly registered one — and the
62
+ * failure is recoverable, because the manual flow exists, the probe already
63
+ * degrades to it, and the card tells the user why.
64
+ * - A2. The token endpoint accepts the two JSON bodies written below, including
65
+ * 'state' in the authorization_code exchange. Both shapes are transcribed
66
+ * from the reference implementation; neither was exercised against a live
67
+ * account from here.
68
+ * - A3. A token response that omits 'refresh_token' means "keep the one you
69
+ * have" rather than "there is no refresh token". The reference stores the
70
+ * field unconditionally, which would overwrite a working refresh token with
71
+ * undefined; this module prefers the stored value. The two readings differ
72
+ * only in the case where one of them destroys the credential, and losing a
73
+ * rotating credential is unrecoverable without a fresh sign-in.
74
+ * - A4. 'expires_in' is seconds and the server keeps it inside
75
+ * [300, 31536000]. That clamp is the reference's own guard, transcribed; a
76
+ * response outside it is treated as malformed rather than trusted. The
77
+ * observable consequence of a grant narrower than reported is exactly what
78
+ * this module already handles: a 401 that forces a refresh, or a final
79
+ * verdict that forces a new sign-in.
80
+ * - A5. The account endpoint shape for 'account' ({uuid, email_address}) is the
81
+ * reference's; the fields are parsed defensively and are purely cosmetic.
82
+ * - A6. A browser that resolves 'localhost' to ::1 first will still reach a
83
+ * listener bound only to 127.0.0.1, because every mainstream browser falls
84
+ * back across address families (Happy Eyeballs, RFC 8305) when the first
85
+ * attempt is refused. The redirect URI comes from types.ts's
86
+ * loopbackRedirectUri(), which spells the authority 'localhost', while the
87
+ * listener is bound to the 127.0.0.1 literal — binding the wildcard address
88
+ * instead would expose a one-time authorization code to every interface on
89
+ * the machine, which is the worse failure.
90
+ *
91
+ * Corroborated rather than merely assumed: the reference implementation ships
92
+ * exactly this pairing — `CALLBACK_HOST = "127.0.0.1"` (anthropic.js:16) with
93
+ * `REDIRECT_URI = \`http://localhost:\${CALLBACK_PORT}\${CALLBACK_PATH}\`` (line 19).
94
+ * So 'localhost' in the advertised URI with a v4-literal bind is the combination
95
+ * a working client actually uses, and that is why this module keeps it instead
96
+ * of "fixing" the spelling to 127.0.0.1: the authority is also what the client
97
+ * is registered for, so changing it is the riskier edit, not the safer one.
98
+ * If a browser without the cross-family fallback ever matters, the fix belongs
99
+ * in types.ts and must be weighed against that registration.
100
+ *
101
+ * ---------------------------------------------------------------------------
102
+ * SECRET HYGIENE
103
+ * ---------------------------------------------------------------------------
104
+ *
105
+ * The authorization code, both tokens and the PKCE verifier never enter a
106
+ * status object, an error message, or a log line. Every error raised here names
107
+ * the CLASS of failure (and at most the HTTP status); none interpolates a
108
+ * credential. Tests assert this by searching the serialized status payload and
109
+ * the thrown messages for the secret material.
110
+ */
111
+ import { type Server } from 'node:http';
112
+ /**
113
+ * The stored credential is OWNED by the sibling token-store module.
114
+ *
115
+ * Imported as a type and never re-declared here. That direction of dependency is
116
+ * the point: a second structural copy of this shape would drift, and the drift
117
+ * would be silent in the worst direction — the store refuses (or, worse,
118
+ * narrows) a credential this module wrote, so the sign-in succeeds and the very
119
+ * next call reports "not signed in". The concrete trap this avoids:
120
+ * 'token-store.ts' records the granted scopes as a 'scopes' ARRAY and requires
121
+ * 'user:inference' in it, so a credential written with a space-delimited
122
+ * 'scope' string would parse to zero scopes and be refused as "not a
123
+ * subscription credential".
124
+ */
125
+ import type { ClaudeAccountInfo, ClaudeCredentials } from './token-store.ts';
126
+ export type { ClaudeCredentials };
127
+ /**
128
+ * The only store interface this module needs.
129
+ *
130
+ * Deliberately two methods and no class: 'read' returning null means "not
131
+ * signed in", which is a state rather than an error. This module never learns
132
+ * how the bytes reach the disk, so the real store's document layout, its
133
+ * account records and its preference settings are all outside its concern —
134
+ * the caller passes a two-method adapter over whichever of those it holds.
135
+ */
136
+ export interface ClaudeTokenStore {
137
+ read(): Promise<ClaudeCredentials | null>;
138
+ write(credentials: ClaudeCredentials): Promise<void>;
139
+ }
140
+ /** The one interface the loopback listener is ever bound to. */
141
+ export declare const LOOPBACK_HOST = "127.0.0.1";
142
+ /** Raised when the credential is dead and only a new sign-in can fix it. */
143
+ export declare class ClaudeUnauthorizedError extends Error {
144
+ constructor(message: string);
145
+ }
146
+ /** Raised when a transient failure outlived its retry budget. */
147
+ export declare class ClaudeRetryableError extends Error {
148
+ readonly cause?: unknown | undefined;
149
+ constructor(message: string, cause?: unknown | undefined);
150
+ }
151
+ /** The secrets one authorize request is built from. */
152
+ export interface PkceMaterial {
153
+ /** SECRET. Never placed in a URL, a log, or an error. */
154
+ verifier: string;
155
+ /** The only half of the pair that belongs in the authorize URL. */
156
+ challenge: string;
157
+ /** Independent anti-forgery value; NOT derived from the verifier. */
158
+ state: string;
159
+ }
160
+ /**
161
+ * Generate one flow's PKCE material and state.
162
+ *
163
+ * The verifier is 32 random bytes — the RFC 7636 ceiling for entropy — encoded
164
+ * as base64url, and the challenge is its SHA-256 in the same encoding. The
165
+ * state is a SEPARATE 24-byte draw. Deriving it from the verifier, or reusing
166
+ * the verifier as the reference does, would make the two values one secret and
167
+ * put the verifier in the URL. 24 bytes is comfortably above the 16-byte floor
168
+ * this line requires, and the two are the same length so nothing about their
169
+ * shapes can be used to tell them apart.
170
+ */
171
+ export declare function generatePkceMaterial(): PkceMaterial;
172
+ /** Account facts a token response may name, in the sibling store's own spelling. */
173
+ export type TokenAccount = ClaudeAccountInfo;
174
+ /** One parsed token response, in the shape the credential store consumes. */
175
+ export interface OAuthTokenResult {
176
+ accessToken: string;
177
+ /** Empty string when the endpoint did not report one; see A3. */
178
+ refreshToken: string;
179
+ expiresAt: number;
180
+ expiresIn: number;
181
+ /** Empty when the endpoint reported no scope at all. */
182
+ scopes: string[];
183
+ account: TokenAccount;
184
+ }
185
+ interface TokenRequestOptions {
186
+ fetchFn?: typeof fetch;
187
+ signal?: AbortSignal;
188
+ }
189
+ /**
190
+ * Exchange an authorization code for a token pair (RFC 6749 section 4.1.3).
191
+ *
192
+ * 'redirectUri' is passed in rather than resolved here: it must be the value
193
+ * recorded on the flow that issued the code, never a "current UI" value, or the
194
+ * endpoint rejects the exchange.
195
+ */
196
+ export declare function exchangeAuthorizationCode(params: {
197
+ code: string;
198
+ state: string;
199
+ verifier: string;
200
+ redirectUri: string;
201
+ }, options?: TokenRequestOptions): Promise<OAuthTokenResult>;
202
+ /**
203
+ * The 'scope' a refresh sends: never more than the grant holds.
204
+ *
205
+ * RFC 6749 section 6 forbids a refresh from asking for a scope the resource
206
+ * owner did not originally grant. The authorize request asks for OAUTH_SCOPES,
207
+ * but the authorization host strips 'org:create_api_key' from a subscription
208
+ * grant without failing the sign-in. Re-asking for the full authorize set
209
+ * therefore made EVERY refresh an 'invalid_scope' - a final verdict that took
210
+ * the account out of rotation each time the access token aged out, so the line
211
+ * demanded a new sign-in roughly once per token lifetime.
212
+ *
213
+ * The scopes the credential records are the ones the token endpoint reported
214
+ * for this grant, so they are sent back as they are (trimmed, de-duplicated,
215
+ * order kept). A credential that records none falls back to the claude.ai set
216
+ * the official client sends, which also leaves 'org:create_api_key' out.
217
+ */
218
+ export declare function refreshScopeFor(grantedScopes: readonly string[] | undefined): string;
219
+ /**
220
+ * Refresh an access token, with a bounded retry over transient failures.
221
+ *
222
+ * Only a transient status or a transport failure is retried. A final verdict —
223
+ * ClaudeUnauthorizedError — stops immediately and propagates, because every
224
+ * further attempt would be a guaranteed rejection and, on a rotation endpoint,
225
+ * one more chance to spend the refresh token.
226
+ *
227
+ * 'grantedScopes' is the scope list stored with the credential being refreshed;
228
+ * see {@link refreshScopeFor} for why the request must not ask for more.
229
+ *
230
+ * The returned 'refreshToken' is empty when the endpoint named none; the caller
231
+ * merges that case by keeping the stored value (A3).
232
+ */
233
+ export declare function refreshAccessToken(refreshToken: string, options?: TokenRequestOptions & {
234
+ grantedScopes?: readonly string[];
235
+ }): Promise<OAuthTokenResult>;
236
+ export interface EnsureTokenOptions {
237
+ fetchFn?: typeof fetch;
238
+ signal?: AbortSignal;
239
+ /** Refresh even when the stored token still looks valid. */
240
+ force?: boolean;
241
+ }
242
+ /**
243
+ * Return a usable credential, refreshing and persisting it first when needed.
244
+ *
245
+ * SINGLE-FLIGHT, and that is a correctness property rather than an
246
+ * optimisation. The refresh token rotates: the first refresh spends the token
247
+ * that was sent, so a burst of callers arriving at expiry must NOT each send
248
+ * it. Under the naive implementation the second request carries a token the
249
+ * first already spent, the endpoint answers with a final verdict, and the user
250
+ * is signed out by their own concurrency. One shared promise means exactly one
251
+ * rotation per expiry, and it is cleared in a 'finally' so a FAILED refresh
252
+ * does not wedge the account: the next call retries instead of forever joining
253
+ * a rejected promise.
254
+ */
255
+ export declare function ensureAccessToken(store: ClaudeTokenStore, options?: EnsureTokenOptions): Promise<ClaudeCredentials>;
256
+ /**
257
+ * Open a URL in the user's default browser, best effort.
258
+ *
259
+ * The caller ALWAYS renders the URL as well, so a machine with no browser, no
260
+ * xdg-open, or a blocked spawn stays usable. The failure is swallowed rather
261
+ * than surfaced because there is no action a user could take on it that they
262
+ * cannot take by copying the URL themselves.
263
+ */
264
+ export declare function openBrowser(url: string): void;
265
+ /** Which redirect URI an authorization request was issued for. */
266
+ export type LoginMode = 'manual' | 'loopback';
267
+ /** Where a flow currently stands. */
268
+ export type LoginStatus = 'idle' | 'pending' | 'exchanging' | 'complete' | 'error';
269
+ /**
270
+ * One sign-in attempt.
271
+ *
272
+ * mode, redirectUri, verifier and state are fixed at creation and never
273
+ * rewritten: an authorization request already in flight is bound to all four,
274
+ * so mutating any of them would silently invalidate the code it returns.
275
+ * 'exchanging' is the compare-and-set word that makes the exchange exactly-once
276
+ * (see beginExchange).
277
+ */
278
+ export interface LoginFlow {
279
+ flowId: string;
280
+ /** Immutable for this flow's lifetime; switching mode starts a new flow. */
281
+ readonly mode: LoginMode;
282
+ /** The URI the authorize request carried; the ONLY one the exchange may send. */
283
+ readonly redirectUri: string;
284
+ /** SECRET. */
285
+ readonly verifier: string;
286
+ /** A one-time forgery token, not a credential — but still never logged. */
287
+ readonly state: string;
288
+ readonly createdAt: number;
289
+ /** Where the exchange is in its single-flight lifecycle. */
290
+ exchanging: 'idle' | 'in-progress' | 'done';
291
+ }
292
+ /**
293
+ * The pollable status of the sign-in surface.
294
+ *
295
+ * NO SECRET EVER APPEARS HERE, and tests enforce that rather than trusting the
296
+ * convention: this object is serialized straight into an HTTP response, so the
297
+ * verifier, the state, the authorization code and both tokens have no field to
298
+ * live in. There is no SSE anywhere in this plugin — the client polls.
299
+ */
300
+ export interface LoginFlowStatus {
301
+ status: LoginStatus;
302
+ /** Correlates a status reading with the flow the user started. */
303
+ flowId?: string;
304
+ /** Not a secret: it is the value that goes INTO the browser. */
305
+ authUrl?: string;
306
+ mode?: LoginMode;
307
+ /** Which redirect URI is armed, for the card to display. */
308
+ redirectUri?: string;
309
+ hint?: string;
310
+ error?: string;
311
+ /** Why a loopback attempt degraded to manual. */
312
+ fallbackReason?: string;
313
+ createdAt?: number;
314
+ completedAt?: number;
315
+ }
316
+ /** Everything a caller may override, so tests never touch the network or a browser. */
317
+ export interface BeginLoginOptions {
318
+ /** Not a credential: it decides which redirect URI the flow is issued for. */
319
+ mode?: LoginMode;
320
+ /** Injected so tests do not depend on machine state or on a real browser. */
321
+ fetchFn?: typeof fetch;
322
+ openBrowser?: (url: string) => void;
323
+ /** Injected so a test can drive a callback against a listener it controls. */
324
+ listen?: (port: number, host: string) => Promise<Server>;
325
+ /** Injected so a test can make a port look unavailable. */
326
+ probe?: (port: number) => Promise<boolean>;
327
+ /** Ceiling for this attempt; defaults to LOGIN_TIMEOUT_MS from types.ts. */
328
+ timeoutMs?: number;
329
+ }
330
+ /**
331
+ * Status of the current (or last) sign-in, for the client to poll.
332
+ *
333
+ * A copy, not the live object: a caller that mutated what it received would
334
+ * otherwise desynchronize the surface from the flow.
335
+ */
336
+ export declare function getLoginStatus(): LoginFlowStatus;
337
+ /**
338
+ * First usable loopback port, or null when the probe finds none.
339
+ *
340
+ * null rather than a throw is deliberate (see beginLogin): a failed probe is
341
+ * NOT a hard error, it is the signal to fall back to the manual flow. That is
342
+ * exactly why the window has to be wide rather than merely generous: a run of
343
+ * excluded ports wider than CALLBACK_PORT_ATTEMPTS ends this walk early and drops
344
+ * the user into a paste-a-code flow for a reason nothing on screen explains,
345
+ * while the ports immediately behind that run sit free. Windows
346
+ * (Hyper-V/WinNAT) reserves ranges of no fixed width that move on every reboot,
347
+ * so the width of this window, not any assumed block size, is what keeps the
348
+ * sign-in in loopback.
349
+ */
350
+ export declare function resolveCallbackPort(probe?: (port: number) => Promise<boolean>, attempts?: number): Promise<number | null>;
351
+ /** A value a user pasted into the manual sign-in box, or why it was rejected. */
352
+ export type LoginInputResult = {
353
+ ok: true;
354
+ code: string;
355
+ state: string;
356
+ } | {
357
+ ok: false;
358
+ error: string;
359
+ };
360
+ /**
361
+ * Parse the string a user pastes back from the browser.
362
+ *
363
+ * Three shapes are accepted, because the page the manual flow lands on offers
364
+ * the user more than one thing to copy: a full redirect URL, the shortened
365
+ * <code>#<state> pair the page displays, and a bare 'code=..&state=..' query
366
+ * fragment.
367
+ *
368
+ * A BARE CODE IS REJECTED. It cannot be bound to this flow — there is no state
369
+ * to compare against — and forcing the flow's own state into the exchange would
370
+ * defeat the state parameter entirely, turning the manual box into a login-CSRF
371
+ * oracle: anyone who talks a user into pasting a code they supplied would get
372
+ * that user's session bound to the attacker's account. The error says exactly
373
+ * what to copy instead.
374
+ */
375
+ export declare function resolveLoginInput(text: string): LoginInputResult;
376
+ /**
377
+ * Exchange a manually pasted value.
378
+ *
379
+ * The state is checked against the armed flow BEFORE anything is claimed or
380
+ * sent, so a mistyped paste costs a 400 and leaves the flow usable — the user
381
+ * can simply paste again. Only a value carrying the flow's own state can
382
+ * consume the exactly-once slot, and the CAS result is mapped onto the same
383
+ * 409/410 semantics the callback uses.
384
+ */
385
+ export declare function submitLoginInput(text: string, options?: {
386
+ fetchFn?: typeof fetch;
387
+ }): Promise<{
388
+ ok: true;
389
+ } | {
390
+ ok: false;
391
+ error: string;
392
+ httpStatus: number;
393
+ }>;
394
+ /** Build the authorize URL for one flow. The VERIFIER IS NOT IN IT. */
395
+ export declare function buildAuthorizeUrl(flow: Pick<LoginFlow, 'redirectUri' | 'state'>, challenge: string): string;
396
+ /**
397
+ * Start a sign-in and return IMMEDIATELY.
398
+ *
399
+ * The returned status is what the settings card polls; nothing here awaits the
400
+ * exchange, the listener, or the browser, because the HTTP request behind the
401
+ * button must not stay open for the whole authorization.
402
+ *
403
+ * A loopback probe that finds no usable port is NOT a hard error: the flow
404
+ * degrades to manual and the caller is told why, since the manual flow needs no
405
+ * port at all and a user whose Windows excluded range covers the default should
406
+ * not be blocked from signing in.
407
+ */
408
+ export declare function beginLogin(store: ClaudeTokenStore, options?: BeginLoginOptions): Promise<LoginFlowStatus>;
409
+ /**
410
+ * Abandon the current sign-in and return to idle.
411
+ *
412
+ * Aborts the flow's controller (so an in-flight exchange or timer stops),
413
+ * closes the listener AND its connections (a closed listener with a live
414
+ * keep-alive socket still holds the port), and clears the flow so the next
415
+ * beginLogin starts from a clean slate instead of inheriting a spent
416
+ * exactly-once slot.
417
+ */
418
+ export declare function cancelLogin(): void;
419
+ //# sourceMappingURL=oauth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../../src/host/claude/oauth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6GG;AAGH,OAAa,EAAwB,KAAK,MAAM,EAAuB,MAAM,WAAW,CAAA;AAoBxF;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAE5E,YAAY,EAAE,iBAAiB,EAAE,CAAA;AAEjC;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,IAAI,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IACzC,KAAK,CAAC,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACrD;AAMD,gEAAgE;AAChE,eAAO,MAAM,aAAa,cAAc,CAAA;AAgCxC,4EAA4E;AAC5E,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM;CAI5B;AAED,iEAAiE;AACjE,qBAAa,oBAAqB,SAAQ,KAAK;IAChB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;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,EAAE,MAAM,CAAA;CAAE,CAAA;AAahC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAoChE;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;CAAO,GACvC,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAwB1E;AAMD,uEAAuE;AACvE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,aAAa,GAAG,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAY3G;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,UAAU,CAC9B,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,eAAe,CAAC,CAsH1B;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAMlC"}
@@ -0,0 +1,131 @@
1
+ /**
2
+ * The '/claude/api' surface: the settings card for the Claude subscription line.
3
+ *
4
+ * The route set, the '{ok,value}' / '{ok,error}' envelope, the 64 KiB body cap,
5
+ * the 405/404/500 conventions and the same-origin requirement on every mutation
6
+ * are all mirrors of the sibling lines' route modules ('src/host/kimi-code/routes.ts',
7
+ * 'src/host/command-code/routes.ts') — deliberately,
8
+ * because the card that renders this line is the same card whose shape those lines
9
+ * established, and a further dialect would be another bug surface for no gain.
10
+ *
11
+ * ---------------------------------------------------------------------------
12
+ * WHAT THIS FILE IS
13
+ * ---------------------------------------------------------------------------
14
+ *
15
+ * It is the whole settings surface for the line and nothing more: the sign-in
16
+ * flow (loopback and the manual paste), adoption of a local Claude Code sign-in,
17
+ * the quota reads, the model catalog and selection, the account pool, and the
18
+ * status payload the card renders. No route is gated on an acknowledgement, a
19
+ * feature flag or any other prior state of the card: each one works from the
20
+ * credentials and the preferences it is handed, and refuses only what it cannot
21
+ * do (not signed in, unsupported action, oversized body, cross-origin caller).
22
+ *
23
+ * Two properties here are structural rather than conventional, and both are load
24
+ * bearing:
25
+ *
26
+ * - 'GET ""' and 'GET "status"' are the card's single source of truth. They
27
+ * report the account, the catalog, the quota, and whether this plugin owns the
28
+ * provider route ({@link ClaudeStatusOptions.serving} /
29
+ * {@link ClaudeStatusOptions.conflict}), so an id already held by another
30
+ * adapter family shows up as a banner on the card instead of as a model list
31
+ * that is mysteriously empty.
32
+ * - 'adopt' is the ONLY route that reads the local Claude Code credential file.
33
+ * The status route asks {@link ClaudeStatusOptions.adoptPaths} whether such a
34
+ * file EXISTS and never opens it, which is what keeps a status poll from
35
+ * turning into a scan of the user's disk (see 'adopt.ts' Rule 2).
36
+ *
37
+ * ---------------------------------------------------------------------------
38
+ * WHAT THIS FILE DOES NOT DECIDE
39
+ * ---------------------------------------------------------------------------
40
+ *
41
+ * Whether the adapter is REGISTERED is the plugin entry's call, not this
42
+ * module's: the entry claims the provider route and reports the outcome back
43
+ * through {@link ClaudeStatusOptions.serving} and
44
+ * {@link ClaudeStatusOptions.conflict}, which is what the card's route banner
45
+ * renders. The route surface itself is registered unconditionally, because the
46
+ * card needs it in every state — including the state where another adapter
47
+ * family owns the provider id and the only thing to show is that fact.
48
+ */
49
+ import type { Context } from '@deepseek-ai/cordis';
50
+ import { FileCredentialStore, FileModelSettingsStore, type ClaudeCredentials, type ClaudePreferenceStore } from './token-store.ts';
51
+ import { type ClaudeModelEntry } from './model-catalog.ts';
52
+ import { clearCachedCatalog, clearCachedQuota, getCachedQuota } from './client.ts';
53
+ import { type BeginLoginOptions } from './oauth.ts';
54
+ import { claudeCodeCredentialPaths, claudeCodeCredentialPresence } from './adopt.ts';
55
+ import { DEFAULT_CONTEXT_WINDOW, PROVIDER_ID, PROVIDER_NAME } from './types.ts';
56
+ import type { ClaudeAccountPool } from './account-pool.ts';
57
+ import type { ClaudeCodeVersionResolver } from '../common/claude-code-version.ts';
58
+ import { type ClaudeModelOption, type ClaudeWebStatus,
59
+ /** The shared declaration, imported under its own name so it can be re-exported below. */
60
+ type ClaudeAccountSummaryDto } from '../../shared/claude-contracts.ts';
61
+ /** Prefix this line's routes are registered under. */
62
+ export declare const ROUTE_PREFIX = "/claude/api";
63
+ /**
64
+ * The selection the card should show.
65
+ *
66
+ * A stored list that still equals the shipped default has never been edited, so
67
+ * it cannot know about models the live listing has since added; treating it as
68
+ * "everything this account can call" keeps a first run from hiding models behind
69
+ * an unedited default. Any explicit edit is honoured exactly. The rule is the
70
+ * same one every sibling line states, and it is stated locally because the
71
+ * helper is not shared.
72
+ */
73
+ export declare function resolveEnabledModelIds(stored: readonly string[], available: readonly string[], enabled?: boolean): string[];
74
+ /** Build the model options the settings card renders, in catalog order. */
75
+ export declare function buildClaudeModelOptions(catalog: readonly ClaudeModelEntry[], available: readonly string[], enabledModelIds: readonly string[], overrides: Record<string, number>): ClaudeModelOption[];
76
+ export interface ClaudeStatusOptions {
77
+ fetchFn?: typeof fetch;
78
+ /** Shared Claude Code version used by the Messages connectivity probe. */
79
+ version?: ClaudeCodeVersionResolver;
80
+ /** Whether this plugin currently owns the provider route; re-read on every status. */
81
+ serving?: boolean | (() => boolean);
82
+ /** Diagnostic when another plugin owns the provider route; re-read on every status. */
83
+ conflict?: string | null | (() => string | null);
84
+ /** Multi-account pool this line schedules through; absent keeps the single-account card. */
85
+ accountPool?: ClaudeAccountPool;
86
+ /**
87
+ * Test seam for the model listing.
88
+ *
89
+ * Defaults to 'client.ts''s loader against the resolved credential; injected so
90
+ * a test drives the card without a network round trip.
91
+ */
92
+ loadCatalog?: (credentials: ClaudeCredentials) => Promise<readonly ClaudeModelEntry[]>;
93
+ /** Test seam for adoption: the paths the reader consults. */
94
+ adoptPaths?: readonly string[];
95
+ /**
96
+ * Test seam for the sign-in flow.
97
+ *
98
+ * Mirrors 'oauth.ts''s own BeginLoginOptions so a test never opens a browser
99
+ * and never binds a loopback port. The route always overrides fetchFn with the
100
+ * one it was registered with, so the flow and the rest of the surface share a
101
+ * single fetch.
102
+ */
103
+ login?: Omit<BeginLoginOptions, 'fetchFn'>;
104
+ }
105
+ /**
106
+ * Everything the settings card renders: the account, the catalog, the quota.
107
+ *
108
+ * Exported so a caller (and a test) can render the same payload the route
109
+ * returns without going through the HTTP surface.
110
+ */
111
+ export declare function getClaudeWebStatus(store: FileCredentialStore, modelSettings: FileModelSettingsStore, preferences: ClaudePreferenceStore | undefined, options?: ClaudeStatusOptions, quotaError?: string | null,
112
+ /** Credential and id the route already resolved for this request. */
113
+ active?: {
114
+ id: string | undefined;
115
+ credentials: ClaudeCredentials | undefined;
116
+ }): Promise<ClaudeWebStatus>;
117
+ /**
118
+ * Register the Claude subscription settings routes under '/claude/api'.
119
+ *
120
+ * Returns the disposer. Registration is UNCONDITIONAL: the card's status poll is
121
+ * how the user learns whether this plugin owns the provider route, so the
122
+ * surface has to answer even when another adapter family holds the id.
123
+ */
124
+ export declare function registerClaudeRoutes(ctx: Context, store: FileCredentialStore, modelSettings: FileModelSettingsStore, preferences?: ClaudePreferenceStore, options?: ClaudeStatusOptions): () => void;
125
+ /** The same check, exposed so the test suite can assert it without importing order games. */
126
+ export declare function claudeReasoningEffortDrift(): {
127
+ missing: string[];
128
+ extra: string[];
129
+ };
130
+ export { DEFAULT_CONTEXT_WINDOW, PROVIDER_ID, PROVIDER_NAME, getCachedQuota, clearCachedQuota, clearCachedCatalog, claudeCodeCredentialPaths, claudeCodeCredentialPresence, type ClaudeAccountSummaryDto, };
131
+ //# sourceMappingURL=routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../src/host/claude/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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