@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,127 @@
1
+ /**
2
+ * Static facts about the Cline Pass subscription and its gateway.
3
+ *
4
+ * The upstream is an OpenAI-compatible `chat/completions` endpoint
5
+ * (`https://api.cline.bot/api/v1`). Routing is always decided by that gateway;
6
+ * this plugin does not send client-side provider selection fields.
7
+ *
8
+ * The model table below is transcribed from the Cline Pass subscription list and
9
+ * the public `models.dev` catalog. It is a fallback, not a ceiling: a model the
10
+ * live catalog scan discovers is described by what that scan published, and a
11
+ * model this release has never heard of is adopted with conservative metadata
12
+ * rather than hidden.
13
+ */
14
+ export declare const PROVIDER_ID = "cline-pass";
15
+ export declare const PROVIDER_NAME = "Cline Pass";
16
+ /** Default gateway. Overridable per deployment and per account. */
17
+ export declare const DEFAULT_BASE_URL = "https://api.cline.bot/api/v1";
18
+ /** Public endpoint that lists subscription models without auth. */
19
+ export declare const RECOMMENDED_MODELS_URL = "https://api.cline.bot/api/v1/ai/cline/recommended-models";
20
+ /** The upstream gateway's own catalog: the only source naming reasoning levels. */
21
+ export declare const VERCEL_MODELS_URL = "https://ai-gateway.vercel.sh/v1/models";
22
+ /** The community model registry, a metadata backstop. */
23
+ export declare const MODELS_DEV_URL = "https://models.dev/api.json";
24
+ /** Authenticated sub-paths on the gateway. */
25
+ export declare const USAGE_LIMITS_PATH = "/users/me/plan/usage-limits";
26
+ export declare const PROFILE_PATH = "/users/me";
27
+ export declare const USAGE_PAGE_SIZE = 200;
28
+ export declare const USAGE_MAX_PAGES = 12;
29
+ /** Conservative context capacity for a model no catalog describes. */
30
+ export declare const DEFAULT_CONTEXT_WINDOW = 128000;
31
+ /** Per-request output budget when the caller states none. */
32
+ export declare const DEFAULT_MAX_TOKENS = 64000;
33
+ /** Streams one account may keep open at once; `0` lifts the cap. */
34
+ export declare const DEFAULT_MAX_CONCURRENT_REQUESTS = 16;
35
+ /** Idle budget for one Cline Pass stream, overridable per account. */
36
+ export declare const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 120000;
37
+ /** Request-history rows retained in memory. */
38
+ export declare const DEFAULT_HISTORY_LIMIT = 100;
39
+ /** How long one account-level refusal keeps an account out of the pool. */
40
+ export declare const POOL_COOLDOWN_MS: number;
41
+ export declare const AUTH_COOLDOWN_MS: number;
42
+ /** Reasoning levels the gateway accepts for every reasoning-capable model. */
43
+ export declare const REASONING_EFFORTS: readonly [{
44
+ readonly id: "none";
45
+ readonly name: "None";
46
+ readonly description: "No extra thinking; fastest and cheapest.";
47
+ }, {
48
+ readonly id: "minimal";
49
+ readonly name: "Minimal";
50
+ readonly description: "A bare minimum of reasoning.";
51
+ }, {
52
+ readonly id: "low";
53
+ readonly name: "Low";
54
+ readonly description: "Prefer for routine or latency-sensitive work.";
55
+ }, {
56
+ readonly id: "medium";
57
+ readonly name: "Medium";
58
+ readonly description: "A balanced amount of reasoning.";
59
+ }, {
60
+ readonly id: "high";
61
+ readonly name: "High";
62
+ readonly description: "More thorough reasoning for multi-step work.";
63
+ }, {
64
+ readonly id: "xhigh";
65
+ readonly name: "Extra high";
66
+ readonly description: "For difficult work that rewards more thinking.";
67
+ }, {
68
+ readonly id: "max";
69
+ readonly name: "Max";
70
+ readonly description: "Reserve for the hardest quality-first tasks.";
71
+ }];
72
+ export type ClinePassReasoningEffort = typeof REASONING_EFFORTS[number]['id'];
73
+ /** One published model entry. */
74
+ export interface ClinePassModelMeta {
75
+ name: string;
76
+ contextWindow: number;
77
+ maxTokens: number;
78
+ reasoning: boolean;
79
+ /** Levels this model offers; absent keeps the whole vocabulary. */
80
+ efforts?: readonly string[];
81
+ input: readonly string[];
82
+ }
83
+ /** Published metadata for the shipped Cline Pass models. */
84
+ export declare const MODEL_CATALOG: Readonly<Record<string, ClinePassModelMeta>>;
85
+ /** Subscriptions models current at release time; refreshed on demand. */
86
+ export declare const DEFAULT_MODELS: readonly string[];
87
+ /** Published entry for one model id, if the shipped table knows it. */
88
+ export declare function catalogEntry(model: string): ClinePassModelMeta | undefined;
89
+ /** One model as the live catalog describes it, after merging all known metadata. */
90
+ export interface ClinePassModelInfo {
91
+ id: string;
92
+ displayName: string;
93
+ contextWindow: number;
94
+ maxTokens: number;
95
+ reasoning: boolean;
96
+ efforts: readonly string[];
97
+ input: readonly string[];
98
+ }
99
+ /** Connection facts one request is built from. */
100
+ export interface ClinePassConnection {
101
+ baseURL: string;
102
+ displayName: string;
103
+ models: ClinePassModelInfo[];
104
+ defaultContextWindow: number;
105
+ maxTokens: number;
106
+ streamIdleTimeoutMs: number;
107
+ maxConcurrentRequests: number;
108
+ }
109
+ /** One model's metadata as the last official scan published it. */
110
+ export interface ClinePassDiscoveredModel {
111
+ name?: string;
112
+ contextWindow?: number;
113
+ maxTokens?: number;
114
+ /** The seam vocabulary spelling (`models.dev`). */
115
+ input?: string[];
116
+ /** The upstream gateway's spelling. */
117
+ inputModalities?: string[];
118
+ reasoning?: boolean;
119
+ efforts?: string[];
120
+ }
121
+ /** The whole official scan: ids, per-model metadata, and the sources that answered. */
122
+ export interface ClinePassCatalogScan {
123
+ models: string[];
124
+ catalog: Record<string, ClinePassDiscoveredModel>;
125
+ sources: string[];
126
+ }
127
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/host/cline-pass/types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,223 @@
1
+ /**
2
+ * The ChatGPT account pool.
3
+ *
4
+ * TWO KINDS OF ACCOUNT, AND ONLY ONE OF THEM MAY BE REFRESHED.
5
+ *
6
+ * - managed — signed in through this plugin. Its credential lives in the pool's
7
+ * encrypted storage AND in the pre-pool credential document beside it, it is
8
+ * refreshable, and deleting it is this plugin's business.
9
+ * - adopted — a SNAPSHOT read out of a local Codex CLI sign-in by 'codex-adopt.ts'
10
+ * (marker 'adopted: true', source 'codex'). It is used only while its own access
11
+ * token is still valid.
12
+ *
13
+ * An adopted snapshot is NEVER refreshed, and the reason is not an optimisation:
14
+ * the ChatGPT refresh token the CLI stores rotates, and the CLI refreshes its own
15
+ * file in place. Two processes spending one grant invalidate each other, and
16
+ * whoever loses the race holds a token the server has already retired — which
17
+ * leaves the user signed OUT of the Codex CLI by this plugin's good intentions. An
18
+ * in-process single-flight cannot fix that, because the race is across PROCESSES
19
+ * and the only state they share is a file 'codex-adopt.ts' must never write. Once
20
+ * such a snapshot has expired the pool takes it out of rotation and surfaces
21
+ * ADOPTED_CODEX_CREDENTIAL_EXPIRED_HINT — sign in again in the CODEX CLI and
22
+ * re-import, not here.
23
+ *
24
+ * The rule is enforced twice on purpose: the needsRefresh hook answers false for
25
+ * an adopted credential no matter what its expiry says, and the refresh hook
26
+ * itself refuses one, so a future caller that forgets the first fails loudly
27
+ * instead of silently spending a grant that is not ours to spend.
28
+ *
29
+ * MANAGED BEATS ADOPTED on a conflict, and the marker is therefore written on
30
+ * EVERY account this file creates, including the explicit false case: the core
31
+ * merges a re-authorization as { ...existing, ...created }, so an omitted key
32
+ * would leave a stored 'adopted: true' — and its never-refresh consequence — on a
33
+ * record that is now plugin-owned.
34
+ */
35
+ import { AccountPoolCore, type PoolAccountShape, type PoolData } from './common/account-pool.ts';
36
+ import type { ProbeableKeyringStore } from './common/pool-storage.ts';
37
+ import { type CredentialStore, type StoredOAuthCredentials, type TokenStore } from './token-store.ts';
38
+ import { ConcurrencyGate } from './common/concurrency-gate.ts';
39
+ import type { AccountRotationStrategy, PoolAccountQuotaDto, PoolAccountSummaryDto } from '../shared/account-pool-contracts.ts';
40
+ import type { QuotaUsageDto } from '../shared/contracts.ts';
41
+ import { CODEX_CLI_CREDENTIAL_SOURCE } from './codex-adopt.ts';
42
+ /** Where a pooled account's credential came from. */
43
+ export type CodexPoolAccountSource = 'managed' | typeof CODEX_CLI_CREDENTIAL_SOURCE;
44
+ /** One pooled ChatGPT account: the credential plus the facts the card renders. */
45
+ export interface CodexPoolAccount extends PoolAccountShape<StoredOAuthCredentials> {
46
+ /**
47
+ * Which store owns the credential. Only managed rows may be refreshed.
48
+ *
49
+ * Derived from the credential rather than trusted from the row, so the two
50
+ * spellings of the marker can never disagree about one account.
51
+ */
52
+ source: CodexPoolAccountSource;
53
+ /**
54
+ * Whether this row is a borrowed snapshot.
55
+ *
56
+ * Required rather than optional: every construction site has to state it, which
57
+ * is what keeps a stale true from surviving an in-place re-authorization.
58
+ */
59
+ adopted: boolean;
60
+ /** The Codex CLI file an adopted snapshot was read from; absent for managed rows. */
61
+ sourcePath?: string;
62
+ email?: string;
63
+ planType?: string;
64
+ accountId?: string;
65
+ }
66
+ /**
67
+ * Whether a pooled credential is an adopted snapshot.
68
+ *
69
+ * The two fields, and only those two: a plain credential carries no 'adopted'
70
+ * field and must never be mistaken for a snapshot, because treating a
71
+ * plugin-owned account as a disposable one would freeze it out of refreshing and
72
+ * make deleteAccount refuse to remove an account the user signed in here.
73
+ */
74
+ export declare function isAdoptedCodexPoolCredential(credentials: StoredOAuthCredentials): boolean;
75
+ /**
76
+ * Whether a credential must be refreshed before the next request.
77
+ *
78
+ * FALSE for every adopted snapshot, valid or expired. That is this pool's core
79
+ * rule: an adopted credential is borrowed for exactly as long as the Codex CLI
80
+ * vouched for it, and this pool has no business rotating a token another process
81
+ * is rotating too. See the module comment.
82
+ */
83
+ export declare function codexNeedsRefresh(credentials: StoredOAuthCredentials, now: number): boolean;
84
+ /**
85
+ * Why a stored credential is already known to be unusable, or nothing.
86
+ *
87
+ * Reported purely — nothing is written here — and consulted by the core for both
88
+ * routing eligibility and credential usability, which is what makes an expired
89
+ * snapshot non-routable WITHOUT a write on every read. The hint names the remedy
90
+ * in the Codex CLI, because that is where the user has to go: re-adopting here is
91
+ * only possible after the CLI itself signed in again.
92
+ */
93
+ export declare function codexAuthRejectedReason(credentials: StoredOAuthCredentials): string | undefined;
94
+ /**
95
+ * Message raised if a refresh of a still-valid adopted snapshot were attempted.
96
+ *
97
+ * Unreachable through this pool's own paths (see the module comment); it exists
98
+ * because 'unreachable' is a claim the guard has to be able to make good on.
99
+ */
100
+ export declare const ADOPTED_NEVER_REFRESHED_MESSAGE: string;
101
+ /** Raised when a refresh of an adopted snapshot is attempted. Never a 401. */
102
+ export declare class CodexAdoptedCredentialError extends Error {
103
+ constructor(message: string);
104
+ }
105
+ /**
106
+ * One account as the ChatGPT settings card renders it.
107
+ *
108
+ * Declared here rather than under 'src/shared/', for the same reason the Claude
109
+ * line declares its own: source and provenance are this pool's vocabulary, and a
110
+ * second copy in the shared contracts module is one that can drift. The base is
111
+ * the shared summary, so every existing consumer of listAccounts() keeps working
112
+ * unchanged — the extra fields are additive.
113
+ */
114
+ export interface CodexAccountSummaryDto extends PoolAccountSummaryDto {
115
+ /** Where the credential came from; a card offers different actions per source. */
116
+ source?: CodexPoolAccountSource;
117
+ /** Whether this row is a snapshot borrowed from a local Codex CLI sign-in. */
118
+ adopted?: boolean;
119
+ /** The Codex CLI file an adopted snapshot was read from. */
120
+ sourcePath?: string;
121
+ }
122
+ /** Encrypted pool file the ChatGPT line owns; the single-credential store stays the mirror. */
123
+ export declare function codexPoolPath(): string;
124
+ /** Validate and normalize one whole pool document. */
125
+ export declare function parseCodexPoolData(value: unknown): PoolData<CodexPoolAccount>;
126
+ /** Token refresh the OAuth service lends the pool; refresh tokens rotate, so this must be the only writer. */
127
+ export interface CodexTokenRefresher {
128
+ /** Refresh one account with the service's own token-endpoint fetch. */
129
+ refreshAccount(credentials: StoredOAuthCredentials): Promise<StoredOAuthCredentials>;
130
+ }
131
+ export interface CodexAccountPoolOptions {
132
+ /** Single-credential store the pool mirrors its primary account into. */
133
+ store?: TokenStore;
134
+ /** Test seam; production builds the platform backend from the pool path. */
135
+ backend?: CredentialStore<PoolData<CodexPoolAccount>>;
136
+ /** Test seam: the keyring the resolver probes, instead of the real `secret-tool`. */
137
+ keyring?: ProbeableKeyringStore<PoolData<CodexPoolAccount>>;
138
+ /** Accounts this pool accepts; defaults to the core's limit. */
139
+ maxAccounts?: number;
140
+ }
141
+ export declare function chatGPTConcurrency(): ConcurrencyGate;
142
+ /**
143
+ * One ChatGPT usage snapshot as the account card's per-account quota.
144
+ *
145
+ * A bucket lists its windows either in `windows` or, on older payloads, only as
146
+ * the `primary`/`secondary` pair — the same fallback the quota card itself
147
+ * applies, so the account row cannot show fewer windows than the card does. The
148
+ * label stays empty on purpose: a ChatGPT window is named by its length, and
149
+ * the card localizes that length in the reader's own language.
150
+ */
151
+ export declare function codexAccountQuota(snapshot: {
152
+ usage: QuotaUsageDto;
153
+ fetchedAt: number;
154
+ }): PoolAccountQuotaDto | undefined;
155
+ export declare class CodexAccountPool extends AccountPoolCore<StoredOAuthCredentials, CodexPoolAccount, CodexAccountSummaryDto> {
156
+ private readonly refresherRef;
157
+ private readonly store;
158
+ private readonly quotaSnapshotRef;
159
+ private quotaBlockedUntil?;
160
+ constructor(options?: CodexAccountPoolOptions);
161
+ /** Hand the pool the OAuth service's per-account refresh implementation. */
162
+ setRefresher(refresher: CodexTokenRefresher): void;
163
+ /**
164
+ * Wire in a cached-quota verdict.
165
+ *
166
+ * The return value is the time the account's Codex window reopens; a lookup
167
+ * returning undefined (or a past time) leaves the account routable. This is
168
+ * how an exhausted window is skipped before a request is even attempted,
169
+ * instead of discovering it from a 429.
170
+ */
171
+ setQuotaBlockedUntil(lookup: (account: CodexPoolAccount, now: number) => number | undefined): void;
172
+ /**
173
+ * Wire in the account's own newest quota snapshot, for display only.
174
+ *
175
+ * The same map that already spares an exhausted account a wasted request also
176
+ * answers "what did this account's window look like last time we read it".
177
+ * The lookup must be a memory read: it runs while the settings card builds
178
+ * its account list, and that page must never fan out an upstream request per
179
+ * pooled account.
180
+ */
181
+ setQuotaSnapshot(lookup: (account: CodexPoolAccount) => PoolAccountQuotaDto | undefined): void;
182
+ protected isEligible(account: CodexPoolAccount, now: number, triedAccountIds?: ReadonlySet<string>): boolean;
183
+ /**
184
+ * Add or update a file's accounts in one storage transaction.
185
+ *
186
+ * One transaction rather than a loop over {@link addAccount}, because a batch
187
+ * that runs out of capacity half way must land NOTHING: the caller reports
188
+ * "the pool is full" and the pool is left exactly as it was, instead of
189
+ * holding an arbitrary prefix of the backup.
190
+ */
191
+ importAccounts(credentials: readonly StoredOAuthCredentials[]): Promise<void>;
192
+ /**
193
+ * Force one account's token refresh and persist the rotated pair.
194
+ *
195
+ * Used after a 401: the core refreshes proactively when a token is close to
196
+ * expiry, but a server-side revocation is only discovered by the request.
197
+ */
198
+ refreshAccountNow(accountId: string): Promise<StoredOAuthCredentials>;
199
+ /**
200
+ * Remove one account inside a transaction, refusing a borrowed snapshot.
201
+ *
202
+ * The check lives HERE rather than in the public delete method so it cannot be
203
+ * separated from the removal by a concurrent change, and so every caller of the
204
+ * core's own deletion inherits it. The remedy is a separate action
205
+ * ({@link removeImportedAccount}): a card must not destroy an account this plugin
206
+ * did not create with the same button that deletes its own.
207
+ */
208
+ protected deleteAccountFromPool(data: PoolData<CodexPoolAccount>, accountId: string): void;
209
+ /**
210
+ * Drop an imported snapshot from the pool — the card's 'remove import' action.
211
+ *
212
+ * Separate from {@link deleteAccount} because that refuses one, and because the
213
+ * user is asking to stop borrowing a sign-in, not to sign out of an account. The
214
+ * Codex CLI's own file is touched by neither path: not deleted, not rewritten,
215
+ * not moved. This only forgets the copy.
216
+ */
217
+ removeImportedAccount(accountId: string): Promise<void>;
218
+ /** The single-credential store this pool mirrors its primary account into. */
219
+ mirrorStore(): TokenStore;
220
+ /** Rotation strategy currently configured. */
221
+ strategy(): Promise<AccountRotationStrategy>;
222
+ }
223
+ //# sourceMappingURL=codex-account-pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-account-pool.d.ts","sourceRoot":"","sources":["../../../src/host/codex-account-pool.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,255 @@
1
+ /**
2
+ * OPT-IN adoption of a pre-existing Codex CLI sign-in.
3
+ *
4
+ * WHAT THIS IS FOR. A user who already runs the unmodified Codex CLI is already
5
+ * signed in to the very subscription this provider serves. Asking them to sign in
6
+ * a second time is pure friction, so this module offers the one thing that
7
+ * removes it: reading back the credential the CLI itself stored in
8
+ * `$CODEX_HOME/auth.json` (`~/.codex/auth.json` when the variable is unset). It
9
+ * is opt-in — nothing here runs until the user asks for it.
10
+ *
11
+ * ---------------------------------------------------------------------------
12
+ * RULE 1 — THIS MODULE NEVER WRITES. IT IS A READER, AND ONLY A READER.
13
+ * ---------------------------------------------------------------------------
14
+ * It must not create, modify, move or delete any file belonging to the Codex CLI.
15
+ * No file this module touches is ever opened for writing, no directory is
16
+ * created, nothing is renamed and nothing is unlinked. The guarantee is
17
+ * structural rather than a promise in prose: the module imports exactly two
18
+ * functions BY NAME from 'node:fs/promises' — readFile and stat — instead of the
19
+ * whole namespace, so introducing a write would require a visible change to the
20
+ * import list, which is the line a reviewer reads first. Nothing exported here
21
+ * writes. The tests assert the stronger, observable form of the rule: a
22
+ * credential file's bytes, size and mtime are identical before and after both
23
+ * entry points run, and its directory gains no entries.
24
+ *
25
+ * ---------------------------------------------------------------------------
26
+ * RULE 2 — PRESENCE AND CONTENT ARE TWO SEPARATE FUNCTIONS
27
+ * ---------------------------------------------------------------------------
28
+ * codexCliCredentialPresence() is cheap enough to call on plugin startup and
29
+ * answers only yes/no: it stats the candidate and never opens it for reading. It
30
+ * exists so the settings card can offer the import before the user has agreed to
31
+ * it, and so a user who never opts in never has their token read at all.
32
+ *
33
+ * readCodexCliCredentials() is the full read, and it is called only AFTER the
34
+ * user explicitly opts in. Keeping the two apart is the whole point: a startup
35
+ * path that slurped the file "just in case" would make the opt-in decorative.
36
+ *
37
+ * ---------------------------------------------------------------------------
38
+ * RULE 3 — AN ADOPTED CREDENTIAL IS A SNAPSHOT, AND THIS PLUGIN NEVER REFRESHES IT
39
+ * ---------------------------------------------------------------------------
40
+ * An adopted credential is used only while its own accessToken is still valid.
41
+ * Once it is expired the pool reports it as expired and tells the user to sign in
42
+ * again in the Codex CLI and re-adopt. That is deliberate, not a gap: the
43
+ * ChatGPT refresh token the CLI stores ROTATES, and the CLI refreshes its own
44
+ * file in place. Two processes refreshing the same grant therefore invalidate
45
+ * each other — whoever loses the race holds a token the server has already
46
+ * retired, and the user ends up signed OUT of the Codex CLI by this plugin's good
47
+ * intentions. An in-process single-flight cannot fix that, because the race is
48
+ * across PROCESSES: this plugin and the CLI are separate programs with separate
49
+ * memories, and the only shared state between them is the file — which this
50
+ * module must not write back into (Rule 1).
51
+ *
52
+ * So the honest contract is: borrow the access token for as long as the CLI itself
53
+ * vouched for it, and never touch the refresh token. Expiry is therefore part of
54
+ * the adoption decision rather than a detail — see
55
+ * {@link isAdoptedCodexCredentialExpired}.
56
+ *
57
+ * The marker the pool chunk must honour is the literal 'adopted: true' plus
58
+ * {@link isAdoptedCodexCredential}; an account carrying it must be treated as
59
+ * read-only, non-refreshable and disposable. There is deliberately no refresh
60
+ * function in this module to find in the first place.
61
+ *
62
+ * ---------------------------------------------------------------------------
63
+ * RULE 4 — AN UNRECOGNISED SHAPE YIELDS undefined, NEVER AN EXCEPTION
64
+ * ---------------------------------------------------------------------------
65
+ * The card shows 'unrecognised local sign-in format' for undefined, which is a far
66
+ * better outcome than a thrown error escaping into the settings route. Nothing is
67
+ * guessed: a document in another auth_mode, a missing or non-object tokens
68
+ * block, a missing access or refresh token, an access token that is not a JWT
69
+ * with a usable 'exp', an unreadable or unparsable file — all of them are
70
+ * undefined. Extra and unknown fields are ignored rather than rejected, so a
71
+ * future CLI that adds one does not break adoption.
72
+ *
73
+ * THE TRAP THIS PARSER EXISTS TO AVOID. A Codex auth.json is NOT a flat bag of
74
+ * tokens. It is a document that may carry an API key alongside the OAuth tokens,
75
+ * and a "find the first accessToken anywhere in the JSON" scan would pick
76
+ * whichever one the serializer happened to emit first — which is how an API key
77
+ * or an unrelated token ends up presented to the Responses API as the user's
78
+ * subscription credential. The read is therefore a direct, specific lookup of
79
+ * tokens.access_token and its siblings — never a tree walk — and the test suite
80
+ * holds a fixture carrying an unrelated token beside the real one and asserts
81
+ * which comes back.
82
+ *
83
+ * ---------------------------------------------------------------------------
84
+ * THE CLAIMS ARE DERIVED LOCALLY, NEVER ASKED OF ANYBODY
85
+ * ---------------------------------------------------------------------------
86
+ * expiresAt comes from the access token's own 'exp' claim, email and planType
87
+ * from the id token's claims. The JWT payload is decoded in process; no token is
88
+ * ever sent anywhere to be inspected, and no token value is logged or returned
89
+ * from anything but the credential object the caller asked for.
90
+ *
91
+ * WHY EXPIRY IS REFUSED RATHER THAN DEFAULTED. A snapshot whose validity cannot
92
+ * be established must not be used. Rather than stamping "now" or "never" and
93
+ * hoping, this module yields undefined: the card then says the local sign-in
94
+ * format is unrecognised, which is true, instead of importing a credential that
95
+ * would 401 on the first request.
96
+ */
97
+ import type { StoredOAuthCredentials } from './token-store.ts';
98
+ /**
99
+ * Environment variable that relocates the Codex CLI's home directory.
100
+ *
101
+ * Highest precedence, and honoured exactly as the CLI honours it: when it is set
102
+ * to a non-blank value it names the home that holds auth.json, whatever the
103
+ * platform's conventional location happens to be. This is also what makes the
104
+ * whole module testable without touching a developer's real profile.
105
+ */
106
+ export declare const CODEX_HOME_ENV = "CODEX_HOME";
107
+ /** File name of the credential document inside the Codex home. */
108
+ export declare const CODEX_CLI_CREDENTIAL_FILE = "auth.json";
109
+ /**
110
+ * Top-level key holding the OAuth tokens.
111
+ *
112
+ * Named as a constant because the specificity of this key IS the defence
113
+ * described in the module comment: the read addresses this key, not the first
114
+ * token it can find anywhere in the document.
115
+ */
116
+ export declare const CODEX_CLI_TOKENS_KEY = "tokens";
117
+ /**
118
+ * The one auth_mode this provider can adopt.
119
+ *
120
+ * A Codex home may also hold an API-key sign-in, which is a different kind of
121
+ * credential for a different billing arrangement. Adopting it as a subscription
122
+ * sign-in would present the wrong credential to the Responses API, so the mode is
123
+ * checked rather than assumed: an unrecognised mode is an unrecognised document.
124
+ */
125
+ export declare const CODEX_CLI_CHATGPT_AUTH_MODE = "chatgpt";
126
+ /** Where an adopted snapshot came from, for the card and for the pool record. */
127
+ export declare const CODEX_CLI_CREDENTIAL_SOURCE = "codex";
128
+ /**
129
+ * What the user is told when an adopted credential has aged out.
130
+ *
131
+ * Exported so the pool report and the settings card say the same sentence, and
132
+ * so the instruction is stated once: the re-sign-in happens in the CODEX CLI, not
133
+ * here, and the import has to be repeated afterwards.
134
+ */
135
+ export declare const ADOPTED_CODEX_CREDENTIAL_EXPIRED_HINT: string;
136
+ /** One adopted credential: the store's own credential shape plus its provenance. */
137
+ export interface CodexCliAdoptedCredential {
138
+ /**
139
+ * The pool marker. Literal true on every snapshot this module returns.
140
+ *
141
+ * A discriminant rather than a description: a pool chunk that stores this record
142
+ * must refuse to refresh it, and a boolean it can test is harder to overlook
143
+ * than a comment it can read past.
144
+ */
145
+ readonly adopted: true;
146
+ /** Which local sign-in this was taken from. */
147
+ readonly source: typeof CODEX_CLI_CREDENTIAL_SOURCE;
148
+ /** The exact file it was read from, so the card can name it. */
149
+ readonly sourcePath: string;
150
+ /** The credential in the store's own shape, ready to be persisted by the caller. */
151
+ readonly credentials: StoredOAuthCredentials;
152
+ }
153
+ /**
154
+ * The Codex CLI's home directory.
155
+ *
156
+ * The environment override wins whenever it is set to a non-blank value — a blank
157
+ * or whitespace-only variable is treated as unset rather than as "the directory
158
+ * whose name is empty", which on Windows would resolve to a drive-relative path.
159
+ * Otherwise the conventional home/.codex directory is used, os.homedir() being
160
+ * the same %USERPROFILE% on Windows and ~ on POSIX that the CLI itself uses.
161
+ *
162
+ * Read at CALL time rather than captured in a module constant: a test (or an
163
+ * embedder) that sets the variable after import must see the change.
164
+ */
165
+ export declare function codexHomeDir(): string;
166
+ /**
167
+ * Every path this module will look at, most authoritative first.
168
+ *
169
+ * A single candidate, which is a judgement call stated plainly. The Claude reader
170
+ * in this package also falls back to the conventional home when the environment
171
+ * override points somewhere else; here the override IS the user's own statement of
172
+ * where this CLI keeps its sign-in, and honouring a stale scratch directory is
173
+ * more dangerous than reporting nothing: a snapshot belonging to a profile the CLI
174
+ * is not currently using would be adopted silently. The path actually consulted is
175
+ * returned and printed by the caller, so "not found" is always accompanied by the
176
+ * exact place that was looked at.
177
+ *
178
+ * A pure function — no filesystem access at all — so it is safe to call just to
179
+ * render the card, and so its precedence is testable without touching a disk.
180
+ */
181
+ export declare function codexCliCredentialPaths(): readonly string[];
182
+ /**
183
+ * Is there a local Codex CLI sign-in to offer?
184
+ *
185
+ * Safe on plugin startup: this NEVER opens a candidate for reading, so a user who
186
+ * never opts in never has the credential's contents touched — not by this
187
+ * function, not by the route that renders the card. Only stat runs, which reveals
188
+ * existence and timestamps and nothing else.
189
+ *
190
+ * Deliberately NOT reported here: whether the file is valid, expired, or even
191
+ * JSON. Answering that would require the read this function exists to avoid, and
192
+ * the card does not need it — validity is answered by the read, after opt-in, and
193
+ * lands on the card as either a credential or 'unrecognised local sign-in
194
+ * format'.
195
+ *
196
+ * A boolean, rather than the record the Claude reader returns, because the two
197
+ * callers want different things and neither needs the other's shape: the status
198
+ * route wants a flag, and reports the path it consulted beside it. paths
199
+ * is injectable so tests drive it against fixtures instead of a real profile;
200
+ * production callers take the default.
201
+ */
202
+ export declare function codexCliCredentialPresence(paths?: readonly string[]): Promise<boolean>;
203
+ /**
204
+ * Map one parsed credential document onto the store's credential shape.
205
+ *
206
+ * Pure and exported so the format rules can be tested without a filesystem, and
207
+ * so a later chunk that reads the document from somewhere else (a backup, a pasted
208
+ * blob) reuses the one set of rules instead of growing a second, drifting copy.
209
+ *
210
+ * Returns undefined for every shape it does not recognise, and never throws — see
211
+ * Rule 4 in the module comment. The gate is deliberately narrow: the document must
212
+ * be a JSON object in the ChatGPT auth mode, its tokens block must be an object,
213
+ * and it must carry BOTH a non-empty access token and a non-empty refresh token.
214
+ * An access token alone is not adopted because the store's record is a sign-in,
215
+ * not a bare token, and a record with an empty one could never be re-recognised.
216
+ *
217
+ * The unrelated-token trap is handled by construction: value.tokens is addressed
218
+ * directly and no other key of the document is ever traversed, so whatever else
219
+ * the file carries cannot reach the result.
220
+ */
221
+ export declare function parseAdoptedCodexCredential(value: unknown, sourcePath: string): CodexCliAdoptedCredential | undefined;
222
+ /**
223
+ * Read the local Codex CLI sign-in; the first usable candidate wins.
224
+ *
225
+ * ONLY call this after the user has explicitly opted in — see the module comment.
226
+ *
227
+ * Never throws and never rejects: an absent file, an unreadable file, a file that
228
+ * is not JSON, and a JSON document of an unrecognised shape all produce undefined,
229
+ * which the card renders as 'unrecognised local sign-in format'. A settings route
230
+ * must not be able to fail because a user's file was mid-write.
231
+ */
232
+ export declare function readCodexCliCredentials(paths?: readonly string[]): Promise<CodexCliAdoptedCredential | undefined>;
233
+ /**
234
+ * Whether a value carries the adopted marker.
235
+ *
236
+ * The predicate the pool chunk tests a stored credential with before deciding
237
+ * whether it may ever be refreshed. It recognises this module's snapshot and
238
+ * nothing else: a plain store credential has no 'adopted' field and must NOT be
239
+ * mistaken for one, because treating a plugin-owned account as a disposable
240
+ * snapshot would freeze an account the user signed in here.
241
+ */
242
+ export declare function isAdoptedCodexCredential(value: unknown): value is CodexCliAdoptedCredential;
243
+ /**
244
+ * Whether an adopted credential's access token is already unusable.
245
+ *
246
+ * A structural mirror of the expiry test the OAuth module applies to its own
247
+ * credentials (expiresAt - Date.now() > 0), asked of a pooled credential so the
248
+ * pool can refuse it WITHOUT ever reaching for a refresh this module deliberately
249
+ * does not perform. A non-finite expiresAt counts as expired, matching the
250
+ * refusal in the reader: no established validity, no use.
251
+ *
252
+ * now is injectable so a test can reason about a fixed clock.
253
+ */
254
+ export declare function isAdoptedCodexCredentialExpired(credential: Pick<StoredOAuthCredentials, 'expiresAt'>, now?: number): boolean;
255
+ //# sourceMappingURL=codex-adopt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-adopt.d.ts","sourceRoot":"","sources":["../../../src/host/codex-adopt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+FG;AAWH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAE9D;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,eAAe,CAAA;AAE1C,kEAAkE;AAClE,eAAO,MAAM,yBAAyB,cAAc,CAAA;AAEpD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,WAAW,CAAA;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,YAAY,CAAA;AAEpD,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,UAAU,CAAA;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,qCAAqC,QAEM,CAAA;AAExD,oFAAoF;AACpF,MAAM,WAAW,yBAAyB;IACxC;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAA;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,OAAO,2BAA2B,CAAA;IACnD,gEAAgE;IAChE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,oFAAoF;IACpF,QAAQ,CAAC,WAAW,EAAE,sBAAsB,CAAA;CAC7C;AAaD;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAIrC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,IAAI,SAAS,MAAM,EAAE,CAE3D;AAqBD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,0BAA0B,CAC9C,KAAK,GAAE,SAAS,MAAM,EAA8B,GACnD,OAAO,CAAC,OAAO,CAAC,CAKlB;AA8CD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,EACd,UAAU,EAAE,MAAM,GACjB,yBAAyB,GAAG,SAAS,CA4CvC;AAED;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,GAAE,SAAS,MAAM,EAA8B,GACnD,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC,CAchD;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,yBAAyB,CAK3F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE,IAAI,CAAC,sBAAsB,EAAE,WAAW,CAAC,EACrD,GAAG,GAAE,MAAmB,GACvB,OAAO,CAGT"}