@eddyskywalker/dsh-chatgpt-subscription 0.33.0 → 0.35.0

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 (184) hide show
  1. package/CHANGELOG.md +96 -110
  2. package/README.md +51 -110
  3. package/lib/client.js +5301 -5413
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +30296 -32529
  6. package/lib/types/client/CodexSubscriptionSection.d.ts.map +1 -1
  7. package/lib/types/client/ProviderHubSection.d.ts.map +1 -1
  8. package/lib/types/client/antigravity/locales.d.ts +2 -5
  9. package/lib/types/client/antigravity/locales.d.ts.map +1 -1
  10. package/lib/types/client/claude/locales.d.ts +2 -5
  11. package/lib/types/client/claude/locales.d.ts.map +1 -1
  12. package/lib/types/client/claude/styles.d.ts +2 -2
  13. package/lib/types/client/cline-pass/locales.d.ts +0 -6
  14. package/lib/types/client/cline-pass/locales.d.ts.map +1 -1
  15. package/lib/types/client/command-code/locales.d.ts +2 -5
  16. package/lib/types/client/command-code/locales.d.ts.map +1 -1
  17. package/lib/types/client/common/AccountPoolSection.d.ts +3 -2
  18. package/lib/types/client/common/AccountPoolSection.d.ts.map +1 -1
  19. package/lib/types/client/common/account-pool-labels.d.ts +0 -2
  20. package/lib/types/client/common/account-pool-labels.d.ts.map +1 -1
  21. package/lib/types/client/common/format.d.ts +12 -2
  22. package/lib/types/client/common/format.d.ts.map +1 -1
  23. package/lib/types/client/common/styles.d.ts.map +1 -1
  24. package/lib/types/client/glm-coding-plan/GlmCodingPlanSection.d.ts +1 -1
  25. package/lib/types/client/glm-coding-plan/locales.d.ts +2 -5
  26. package/lib/types/client/glm-coding-plan/locales.d.ts.map +1 -1
  27. package/lib/types/client/glm-coding-plan/styles.d.ts +3 -2
  28. package/lib/types/client/glm-coding-plan/styles.d.ts.map +1 -1
  29. package/lib/types/client/glm-coding-plan/useGlmCodingPlanSection.d.ts.map +1 -1
  30. package/lib/types/client/hub/UpdateCheck.d.ts +9 -0
  31. package/lib/types/client/hub/UpdateCheck.d.ts.map +1 -0
  32. package/lib/types/client/hub/brand-icons.d.ts +2 -2
  33. package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
  34. package/lib/types/client/hub/brand-svg.d.ts +0 -4
  35. package/lib/types/client/hub/brand-svg.d.ts.map +1 -1
  36. package/lib/types/client/hub/hub-styles.d.ts.map +1 -1
  37. package/lib/types/client/hub/providers.d.ts.map +1 -1
  38. package/lib/types/client/index.d.ts +2 -2
  39. package/lib/types/client/index.d.ts.map +1 -1
  40. package/lib/types/client/kimi-code/locales.d.ts +2 -5
  41. package/lib/types/client/kimi-code/locales.d.ts.map +1 -1
  42. package/lib/types/client/locales.d.ts +39 -3
  43. package/lib/types/client/locales.d.ts.map +1 -1
  44. package/lib/types/client/minimax-code/locales.d.ts +2 -5
  45. package/lib/types/client/minimax-code/locales.d.ts.map +1 -1
  46. package/lib/types/client/minimax-code/useMinimaxCodeSection.d.ts +2 -2
  47. package/lib/types/client/minimax-code/useMinimaxCodeSection.d.ts.map +1 -1
  48. package/lib/types/client/ollama/locales.d.ts +0 -6
  49. package/lib/types/client/ollama/locales.d.ts.map +1 -1
  50. package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts +20 -0
  51. package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts.map +1 -0
  52. package/lib/types/client/opendesign/OpenDesignSection.d.ts +18 -0
  53. package/lib/types/client/opendesign/OpenDesignSection.d.ts.map +1 -0
  54. package/lib/types/client/opendesign/api.d.ts +45 -0
  55. package/lib/types/client/opendesign/api.d.ts.map +1 -0
  56. package/lib/types/client/opendesign/locales.d.ts +683 -0
  57. package/lib/types/client/{workbuddy → opendesign}/locales.d.ts.map +1 -1
  58. package/lib/types/client/opendesign/styles.d.ts +11 -0
  59. package/lib/types/client/opendesign/styles.d.ts.map +1 -0
  60. package/lib/types/client/qoder/QoderSection.d.ts +13 -3
  61. package/lib/types/client/qoder/QoderSection.d.ts.map +1 -1
  62. package/lib/types/client/qoder/locales.d.ts +7 -3
  63. package/lib/types/client/qoder/locales.d.ts.map +1 -1
  64. package/lib/types/client/qoder/useQoderSection.d.ts.map +1 -1
  65. package/lib/types/client/step-code/StepCodeComposerQuota.d.ts +2 -2
  66. package/lib/types/client/step-code/StepCodeSection.d.ts +1 -1
  67. package/lib/types/client/step-code/locales.d.ts +2 -5
  68. package/lib/types/client/step-code/locales.d.ts.map +1 -1
  69. package/lib/types/client/step-code/styles.d.ts +1 -1
  70. package/lib/types/client/step-code/useStepCodeSection.d.ts.map +1 -1
  71. package/lib/types/host/claude/account-pool.d.ts +2 -2
  72. package/lib/types/host/claude/account-pool.d.ts.map +1 -1
  73. package/lib/types/host/claude/routes.d.ts +1 -1
  74. package/lib/types/host/common/capabilities.d.ts.map +1 -1
  75. package/lib/types/host/common/credential-read-cache.d.ts +2 -3
  76. package/lib/types/host/common/credential-read-cache.d.ts.map +1 -1
  77. package/lib/types/host/common/model-request-control.d.ts +1 -1
  78. package/lib/types/host/common/model-request-control.d.ts.map +1 -1
  79. package/lib/types/host/common/request-diagnostics.d.ts +2 -2
  80. package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
  81. package/lib/types/host/glm-coding-plan/mapper-openai.d.ts +1 -1
  82. package/lib/types/host/glm-coding-plan/model-catalog.d.ts +4 -4
  83. package/lib/types/host/kimi-code/adapter.d.ts +31 -0
  84. package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
  85. package/lib/types/host/kimi-code/mapper.d.ts +8 -0
  86. package/lib/types/host/kimi-code/mapper.d.ts.map +1 -1
  87. package/lib/types/host/kimi-code/types.d.ts +92 -0
  88. package/lib/types/host/kimi-code/types.d.ts.map +1 -1
  89. package/lib/types/host/minimax-code/account-pool.d.ts +6 -7
  90. package/lib/types/host/minimax-code/account-pool.d.ts.map +1 -1
  91. package/lib/types/host/minimax-code/checkin.d.ts +7 -8
  92. package/lib/types/host/minimax-code/checkin.d.ts.map +1 -1
  93. package/lib/types/host/minimax-code/routes.d.ts +1 -1
  94. package/lib/types/host/opendesign/account-pool.d.ts +54 -0
  95. package/lib/types/host/opendesign/account-pool.d.ts.map +1 -0
  96. package/lib/types/host/opendesign/adapter.d.ts +69 -0
  97. package/lib/types/host/opendesign/adapter.d.ts.map +1 -0
  98. package/lib/types/host/opendesign/catalog.d.ts +44 -0
  99. package/lib/types/host/opendesign/catalog.d.ts.map +1 -0
  100. package/lib/types/host/opendesign/client.d.ts +148 -0
  101. package/lib/types/host/opendesign/client.d.ts.map +1 -0
  102. package/lib/types/host/opendesign/line.d.ts +49 -0
  103. package/lib/types/host/opendesign/line.d.ts.map +1 -0
  104. package/lib/types/host/opendesign/mapper.d.ts +128 -0
  105. package/lib/types/host/opendesign/mapper.d.ts.map +1 -0
  106. package/lib/types/host/opendesign/oauth.d.ts +105 -0
  107. package/lib/types/host/opendesign/oauth.d.ts.map +1 -0
  108. package/lib/types/host/opendesign/routes.d.ts +74 -0
  109. package/lib/types/host/opendesign/routes.d.ts.map +1 -0
  110. package/lib/types/host/opendesign/token-store.d.ts +154 -0
  111. package/lib/types/host/opendesign/token-store.d.ts.map +1 -0
  112. package/lib/types/host/opendesign/types.d.ts +180 -0
  113. package/lib/types/host/opendesign/types.d.ts.map +1 -0
  114. package/lib/types/host/qoder/adapter.d.ts +26 -2
  115. package/lib/types/host/qoder/adapter.d.ts.map +1 -1
  116. package/lib/types/host/qoder/client.d.ts +112 -0
  117. package/lib/types/host/qoder/client.d.ts.map +1 -1
  118. package/lib/types/host/qoder/model-catalog.d.ts +52 -6
  119. package/lib/types/host/qoder/model-catalog.d.ts.map +1 -1
  120. package/lib/types/host/qoder/routes.d.ts +23 -0
  121. package/lib/types/host/qoder/routes.d.ts.map +1 -1
  122. package/lib/types/host/qoder/token-store.d.ts +56 -7
  123. package/lib/types/host/qoder/token-store.d.ts.map +1 -1
  124. package/lib/types/host/step-code/adapter.d.ts +1 -1
  125. package/lib/types/host/step-code/client.d.ts +1 -1
  126. package/lib/types/host/step-code/mapper.d.ts +3 -3
  127. package/lib/types/host/step-code/oauth.d.ts +1 -1
  128. package/lib/types/host/update-check.d.ts +118 -0
  129. package/lib/types/host/update-check.d.ts.map +1 -0
  130. package/lib/types/index.d.ts +11 -7
  131. package/lib/types/index.d.ts.map +1 -1
  132. package/lib/types/shared/account-pool-contracts.d.ts +0 -24
  133. package/lib/types/shared/account-pool-contracts.d.ts.map +1 -1
  134. package/lib/types/shared/hub-contracts.d.ts +1 -1
  135. package/lib/types/shared/hub-contracts.d.ts.map +1 -1
  136. package/lib/types/shared/minimax-code-contracts.d.ts +2 -2
  137. package/lib/types/shared/opendesign-contracts.d.ts +159 -0
  138. package/lib/types/shared/opendesign-contracts.d.ts.map +1 -0
  139. package/lib/types/shared/qoder-contracts.d.ts +40 -1
  140. package/lib/types/shared/qoder-contracts.d.ts.map +1 -1
  141. package/lib/types/shared/update-contracts.d.ts +124 -0
  142. package/lib/types/shared/update-contracts.d.ts.map +1 -0
  143. package/package.json +1 -1
  144. package/lib/types/client/workbuddy/WorkBuddyComposerQuota.d.ts +0 -22
  145. package/lib/types/client/workbuddy/WorkBuddyComposerQuota.d.ts.map +0 -1
  146. package/lib/types/client/workbuddy/WorkBuddySection.d.ts +0 -50
  147. package/lib/types/client/workbuddy/WorkBuddySection.d.ts.map +0 -1
  148. package/lib/types/client/workbuddy/locales.d.ts +0 -635
  149. package/lib/types/client/workbuddy/styles.d.ts +0 -15
  150. package/lib/types/client/workbuddy/styles.d.ts.map +0 -1
  151. package/lib/types/client/workbuddy/useWorkBuddySection.d.ts +0 -149
  152. package/lib/types/client/workbuddy/useWorkBuddySection.d.ts.map +0 -1
  153. package/lib/types/host/workbuddy/account-pool.d.ts +0 -235
  154. package/lib/types/host/workbuddy/account-pool.d.ts.map +0 -1
  155. package/lib/types/host/workbuddy/adapter.d.ts +0 -129
  156. package/lib/types/host/workbuddy/adapter.d.ts.map +0 -1
  157. package/lib/types/host/workbuddy/atrest.d.ts +0 -98
  158. package/lib/types/host/workbuddy/atrest.d.ts.map +0 -1
  159. package/lib/types/host/workbuddy/checkin.d.ts +0 -150
  160. package/lib/types/host/workbuddy/checkin.d.ts.map +0 -1
  161. package/lib/types/host/workbuddy/client.d.ts +0 -169
  162. package/lib/types/host/workbuddy/client.d.ts.map +0 -1
  163. package/lib/types/host/workbuddy/dsml.d.ts +0 -55
  164. package/lib/types/host/workbuddy/dsml.d.ts.map +0 -1
  165. package/lib/types/host/workbuddy/guardrails.d.ts +0 -111
  166. package/lib/types/host/workbuddy/guardrails.d.ts.map +0 -1
  167. package/lib/types/host/workbuddy/identity.d.ts +0 -71
  168. package/lib/types/host/workbuddy/identity.d.ts.map +0 -1
  169. package/lib/types/host/workbuddy/mapper.d.ts +0 -131
  170. package/lib/types/host/workbuddy/mapper.d.ts.map +0 -1
  171. package/lib/types/host/workbuddy/model-catalog.d.ts +0 -217
  172. package/lib/types/host/workbuddy/model-catalog.d.ts.map +0 -1
  173. package/lib/types/host/workbuddy/oauth.d.ts +0 -47
  174. package/lib/types/host/workbuddy/oauth.d.ts.map +0 -1
  175. package/lib/types/host/workbuddy/outbound-identity.d.ts +0 -66
  176. package/lib/types/host/workbuddy/outbound-identity.d.ts.map +0 -1
  177. package/lib/types/host/workbuddy/routes.d.ts +0 -56
  178. package/lib/types/host/workbuddy/routes.d.ts.map +0 -1
  179. package/lib/types/host/workbuddy/token-store.d.ts +0 -360
  180. package/lib/types/host/workbuddy/token-store.d.ts.map +0 -1
  181. package/lib/types/host/workbuddy/types.d.ts +0 -161
  182. package/lib/types/host/workbuddy/types.d.ts.map +0 -1
  183. package/lib/types/shared/workbuddy-contracts.d.ts +0 -353
  184. package/lib/types/shared/workbuddy-contracts.d.ts.map +0 -1
@@ -134,6 +134,98 @@ export declare const ANTHROPIC_MESSAGES_PATH = "/v1/messages?beta=true";
134
134
  export declare const DEFAULT_MAX_MESSAGE_BODY_BYTES = 2097152;
135
135
  /** Ceiling this process enforces, honouring the deployment override. */
136
136
  export declare function maxMessageBodyBytes(env?: NodeJS.ProcessEnv): number;
137
+ /**
138
+ * Bytes one METERED token is assumed to occupy when a deployment asks this route
139
+ * to fold its published window against the byte ceiling.
140
+ *
141
+ * The unit is not "bytes per real token" but "bytes per token as the host COUNTS
142
+ * it": DSH prices text at a fixed four characters per token
143
+ * (`@deepseek-ai/dsh-token-meter`'s estimate.ts, CHARS_PER_TOKEN = 4) whatever
144
+ * those characters weigh on the wire. So the figure is four characters per token
145
+ * times the bytes of one character, and each density lands somewhere different:
146
+ *
147
+ * | density | bytes/metered token | 2 MB wall |
148
+ * | ------------------------------------------ | ------------------- | --------- |
149
+ * | ASCII: code, patches, JSON tool results | 4 | 524_288 |
150
+ * | CJK prose mixed with English code and JSON | 8 | 262_144 |
151
+ * | dense CJK | 12 | 174_763 |
152
+ *
153
+ * These are the values DSH_KIMI_CODE_BYTES_PER_TOKEN accepts, and what each buys.
154
+ * Folding is a choice about WHERE compaction fires, never about safety: with a
155
+ * wall at N metered tokens the host's threshold is
156
+ * `floor(min(0.8 x window, window - 65_536))` (this route declares no
157
+ * `defaultMaxTokens`, so nothing is reserved), and the table says which densities
158
+ * sit above it.
159
+ *
160
+ * - unset: no folding at all. The window the model declares — or the one the user
161
+ * explicitly overrode — is published exactly as it is. A long session reaches
162
+ * the 2 MB wall and recovers there, because the refusal carries
163
+ * CONTEXT_OVERFLOW_CODE; nothing is silently given up up front;
164
+ * - 4: publish 524_288, threshold 419_430. Code-dominated sessions compact
165
+ * BEFORE the wall with 104_858 metered tokens of slack, which is the point of
166
+ * the setting; mixed and CJK traffic still meets the wall first;
167
+ * - 5: publish 419_430, threshold 335_544. Same shape, a little less slack;
168
+ * - 8: publish 262_144, threshold 196_608. ASCII and mixed text both compact in
169
+ * time; dense CJK does not;
170
+ * - 12: publish 174_762, threshold 109_226. All three densities compact in time,
171
+ * at the cost of publishing a small window (a CJK-first deployment's choice).
172
+ *
173
+ * Anything smaller than 4 makes the published window larger than the byte ceiling
174
+ * can ever fill (2 -> 1_048_576 against a 524_288-token ASCII wall), so the
175
+ * threshold sits above even the ASCII wall and the setting buys nothing but a
176
+ * window every session is refused before filling.
177
+ *
178
+ * Bytes per metered token in this process, or undefined when folding is off.
179
+ *
180
+ * DSH_KIMI_CODE_BYTES_PER_TOKEN is an OPTIONAL early-compaction switch, not a
181
+ * safety guard, and the distinction decides what a bad value must do. A typo
182
+ * cannot weaken anything here — the recovery code on an oversized refusal is the
183
+ * safety net and it is always armed — so an empty, unparsable, zero or negative
184
+ * value simply means "no folding", the same as leaving the variable out. (The
185
+ * byte CEILING keeps the opposite rule, because THAT is a guard:
186
+ * `maxMessageBodyBytes` falls back to the real limit rather than to no limit.)
187
+ *
188
+ * Undefined rather than a sentinel number on purpose: every caller has to decide
189
+ * what "no ceiling" means for it, and a magic value like Infinity would silently
190
+ * flow into arithmetic instead of forcing that decision.
191
+ */
192
+ export declare function wireBytesPerToken(env?: NodeJS.ProcessEnv): number | undefined;
193
+ /**
194
+ * Token ceiling the body limit implies at the configured density, or undefined
195
+ * when folding is off.
196
+ *
197
+ * The gateway in front of this route counts BYTES while DSH's compaction
198
+ * thresholds count metered tokens taken from the window an adapter declares, and
199
+ * the two never meet on their own. Expressing the byte ceiling in the unit the
200
+ * host acts on is the same budget-first rule the official kimi-cli applies in
201
+ * `soul/compaction.py::should_auto_compact` — it compacts at 85% of the window or
202
+ * with 50K tokens left and never special-cases 2097152. This route applies that
203
+ * rule only when a deployment asks for it, because "smaller window" is a
204
+ * behaviour change to the model's advertised capacity, not a bug fix.
205
+ */
206
+ export declare function byteDerivedTokenCap(env?: NodeJS.ProcessEnv): number | undefined;
207
+ /**
208
+ * Context window this route will actually honour for one model.
209
+ *
210
+ * Both what `resolveModel` reports to DSH — which is where the compaction
211
+ * threshold is computed — and what the request builder budgets against, so the
212
+ * promise and the budget cannot drift apart.
213
+ *
214
+ * With folding OFF, which is the default, this is the declared window itself,
215
+ * including a window the user overrode by hand: the vendor's figure and the
216
+ * user's explicit choice are both respected, and a session that outgrows them is
217
+ * recovered at the byte wall rather than pre-emptively summarized.
218
+ *
219
+ * With folding ON it is the smaller of the declared window and
220
+ * {@link byteDerivedTokenCap}: one number for both readers, so what the host
221
+ * believes the model can hold is what the guard lets it send.
222
+ *
223
+ * A window that is missing, zero, negative or not finite is not trusted. It falls
224
+ * back to {@link DEFAULT_CONTEXT_WINDOW} (or to the byte-derived cap when that is
225
+ * smaller), and the result never drops below 1 so no caller ends up with an empty
226
+ * window.
227
+ */
228
+ export declare function effectiveContextWindow(tokenWindow: number, env?: NodeJS.ProcessEnv): number;
137
229
  /**
138
230
  * Base64 image payload one request on this route may carry.
139
231
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/host/kimi-code/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAIhH,eAAO,MAAM,WAAW,cAAc,CAAA;AACtC,eAAO,MAAM,aAAa,cAAc,CAAA;AAExC;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,yCAAyC,CAAA;AAEzE,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB,0BAA0B,CAAA;AAEzD,4DAA4D;AAC5D,eAAO,MAAM,yBAAyB,oCAAoC,CAAA;AAC1E,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,iDAAiD,CAAA;AAEpF,6EAA6E;AAC7E,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,cAAc,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CASlF,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,QAAQ,CAAA;AAEtC,eAAO,MAAM,UAAU,qFAAqF,CAAA;AAE5G;;;;;;GAMG;AACH,eAAO,MAAM,Y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,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,CAKrF;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,OAAQ,CAAA;AAE5C;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAKlF;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,CAAA;AAEtC,mEAAmE;AACnE,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,oBAAoB,CAAC,EAAE,MAAM,GAC5B,MAAM,CAKR;AAED,gFAAgF;AAChF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,uBAAuB,CAE1F;AAED,gEAAgE;AAChE,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CACY,CAAA"}
@@ -1,22 +1,21 @@
1
1
  /**
2
2
  * MiniMax Code 号池:the account pool for the MiniMax Code (编程订阅) line.
3
3
  *
4
- * This is the second line in this package that pools a credential it does not
5
- * own (WorkBuddy was the first), and that one fact decides every shape below:
4
+ * This line pools a credential it does not own, and that one fact decides every
5
+ * shape below:
6
6
  *
7
7
  * 1. MiniMax Code's normal credential is the desktop application's own
8
8
  * \`~/.minimax/auth/<buildEnv>/<region>/mcode-public/auth.json\`. The plugin
9
- * reads it so a user already signed in to the app never signs in twice, which
10
- * is exactly the WorkBuddy precedent for the CodeBuddy client's \`*.info\`
11
- * files.
9
+ * reads it so a user already signed in to the app never signs in twice,
10
+ * instead of asking for a second sign-in of its own.
12
11
  * 2. ADOPTED MEANS NEVER DESTROYED. That file belongs to an application the
13
12
  * user is running. The pool may read it, may adopt it into its own account
14
13
  * list, and may write a rotated token back through the store's atomic
15
14
  * replacement — but no path in this file may revoke it or delete it. A
16
15
  * deleted \`auth.json\` signs the user out of MiniMax Code itself, so such an
17
16
  * account is reported as \`removable: false\` and deletion is refused
18
- * ({@link MinimaxCodeAccountPool.deleteAccount}), mirroring WorkBuddy's
19
- * desktop accounts.
17
+ * ({@link MinimaxCodeAccountPool.deleteAccount}), like every other adopted
18
+ * desktop account.
20
19
  * 3. What the pool adds on top of the single-credential line is rotation: more
21
20
  * than one sign-in can serve requests, a 429 cools one account down instead
22
21
  * of taking the line offline, and the settings card can list, alias, promote
@@ -1 +1 @@
1
- {"version":3,"file":"account-pool.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/account-pool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAGhE,OAAO,EACL,eAAe,EAGf,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EACL,0BAA0B,EAO1B,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAA;AASzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAA0B,MAAM,wCAAwC,CAAA;AACzH,OAAO,KAAK,EAEV,uBAAuB,EACvB,mBAAmB,EAEnB,qBAAqB,EACtB,MAAM,wCAAwC,CAAA;AAE/C;;;;;;GAMG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB,CAAC,sBAAsB,CAAC;IACtF,iFAAiF;IACjF,MAAM,EAAE,iBAAiB,CAAA;IACzB;;;;;;OAMG;IACH,MAAM,EAAE,2BAA2B,CAAA;IAC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CAAC,OAAO,CAAC,CAAA;IACnC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAA;CAC/B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,sBAAsB,GAAG,SAAS,EACxC,OAAO,GAAE,+BAAoC,GAC5C,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAwDvE"}
@@ -1,13 +1,12 @@
1
1
  /**
2
2
  * Daily check-in scheduler for the MiniMax Code line.
3
3
  *
4
- * Modeled on the sibling WorkBuddy scheduler and kept semantically identical
5
- * where the two services face the same problem; the wire half lives in
6
- * ./checkin-gateway.ts (official-client recipe, verified live).
4
+ * The wire half lives in ./checkin-gateway.ts (official-client recipe,
5
+ * verified live); this module is the host-owned daily pass around it.
7
6
  *
8
7
  * - **Both regions.** The official client's public gateway has an origin per
9
8
  * region, so an account signs in against its own region's origin. There is
10
- * no CN-only carve-out like WorkBuddy's: the CLI ships the same surface
9
+ * no CN-only carve-out: the CLI ships the same surface
11
10
  * worldwide.
12
11
  * - **Idempotent.** The panel is read first; an account whose today is already
13
12
  * claimed (by anyone) is only recorded. A duplicate claim answers
@@ -18,8 +17,8 @@
18
17
  * usually boots before it does.
19
18
  * - **Bounded.** A failing account is retried at most {@link CHECKIN_ATTEMPT_CAP}
20
19
  * times a day, so a broken account cannot turn the ten-minute tick into a
21
- * request loop. A manual run ignores the cap and the toggle, like the
22
- * workbuddy card's "check in now", and is queued behind an in-flight run.
20
+ * request loop. A manual run ignores the cap and the toggle, like the card's
21
+ * "check in now", and is queued behind an in-flight run.
23
22
  *
24
23
  * Credentials stay host-side: the only write beyond the state file is the
25
24
  * account pool's own refresh write-back, reused here unchanged through
@@ -37,8 +36,8 @@ export declare const CHECKIN_TICK_MS: number;
37
36
  export declare const CHECKIN_ATTEMPT_CAP = 3;
38
37
  /**
39
38
  * How long a not-yet-claimable today waits before the panel is polled again.
40
- * Same reasoning as the workbuddy scheduler: the activity opens on its own
41
- * schedule, and the first answer of the day is frequently "not open yet".
39
+ * The activity opens on its own schedule, and the first answer of the day is
40
+ * frequently "not open yet".
42
41
  */
43
42
  export declare const CHECKIN_INACTIVE_RECHECK_MS: number;
44
43
  /** State document the scheduler keeps beside the other plugin stores. */
@@ -1 +1 @@
1
- {"version":3,"file":"checkin.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/checkin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AACvF,OAAO,KAAK,EAAE,sBAAsB,EAAgC,MAAM,mBAAmB,CAAA;AAc7F;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAiB,CAAA;AAC7C,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,IAAI,CAAA;AACpC;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,QAAiB,CAAA;AAEzD,yEAAyE;AACzE,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKrD;AAiCD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,sCAAuC,SAAQ,KAAK;IAE7D,QAAQ,CAAC,SAAS,EAAE,MAAM;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS;IAC7C,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS;gBAFlC,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,cAAc,EAAE,MAAM,GAAG,SAAS;CAQ9C;AAgCD,wDAAwD;AACxD,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,sBAAsB,EACtB,cAAc,GAAG,oBAAoB,GAAG,iBAAiB,CAC1D,CAAA;AAED,MAAM,WAAW,gCAAgC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AQ,CAAC,KAAK,CAAgB;IACtC,0DAA0D;IAC1D,OAAO,CAAC,QAAQ,CAA6B;IAE7C,OAAO,CAAC,SAAS,CAAsB;IACvC,iFAAiF;IACjF,OAAO,CAAC,SAAS,CAA6B;gBAG3B,IAAI,EAAE,sBAAsB,EAC5B,OAAO,EAAE,gCAAgC;IAS5D;;;;;;;;OAQG;IACG,IAAI,CAAC,MAAM,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAUzC,OAAO,CAAC,KAAK;YAQC,QAAQ;YAoBR,GAAG;IAmCjB,yDAAyD;YAC3C,KAAK;IAOnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;YACW,WAAW;IAgCzB,wEAAwE;YAC1D,UAAU;IAiDxB;;;;OAIG;YACW,WAAW;IA2BzB;;;;;OAKG;YACW,KAAK;IAcnB;;;;;;;OAOG;YACW,KAAK;IAcnB;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAsB1B,8EAA8E;IAC9E,OAAO,CAAC,YAAY;IAQpB;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,yBAAyB,CAAC;YAwCrC,IAAI;YAoCJ,IAAI;CAYnB"}
@@ -21,7 +21,7 @@
21
21
  * \`/models\` and \`/settings\` are the model-settings half every sibling line has and
22
22
  * this one shipped without. They are two names for one route because the sibling
23
23
  * cards disagree about which to call: kimi-code and claude call it \`/models\`,
24
- * workbuddy and command-code call it \`/settings\`. Serving both costs one string
24
+ * command-code calls it \`/settings\`. Serving both costs one string
25
25
  * comparison and removes a client-side special case.
26
26
  */
27
27
  import type { Context } from '@deepseek-ai/cordis';
@@ -0,0 +1,54 @@
1
+ import { AccountPoolCore, type PoolAccountShape, type PoolData } from '../common/account-pool.ts';
2
+ import type { CredentialStore } from '../token-store.ts';
3
+ import { FileCredentialStore, type OpenDesignCredentials } from './token-store.ts';
4
+ import type { AccountPoolStatusDto, AccountRotationStrategy } from '../../shared/account-pool-contracts.ts';
5
+ import type { OpenDesignAccountSummaryDto } from '../../shared/opendesign-contracts.ts';
6
+ /** One pooled OpenDesign key: the bearer key plus the display facts the card renders. */
7
+ export interface OpenDesignPoolAccount extends PoolAccountShape<OpenDesignCredentials> {
8
+ /** Model id this account last served, for the card's detail line. */
9
+ lastModelId?: string;
10
+ }
11
+ export type OpenDesignPoolStatusDto = AccountPoolStatusDto;
12
+ /** Encrypted pool file this line owns. */
13
+ export declare function opendesignPoolPath(): string;
14
+ /** The credential name a deployment can export instead of pasting a key. */
15
+ export declare const OPENDESIGN_API_KEY_ENV = "OPENDESIGN_API_KEY";
16
+ /** Stable identity of one key; see token-store for why the digest is safe to hold. */
17
+ export declare function opendesignAccountKey(credentials: OpenDesignCredentials): string;
18
+ /** Validate and normalize one whole pool document. */
19
+ export declare function parseOpenDesignPoolData(value: unknown): PoolData<OpenDesignPoolAccount>;
20
+ export interface OpenDesignAccountPoolOptions {
21
+ /** Pre-pool credential file the pool mirrors its primary account into. */
22
+ store?: FileCredentialStore;
23
+ /** Test seam; production builds the platform backend from the pool path. */
24
+ backend?: CredentialStore<PoolData<OpenDesignPoolAccount>>;
25
+ maxAccounts?: number;
26
+ }
27
+ /**
28
+ * OpenDesign's account pool.
29
+ *
30
+ * One credential kind only: a static API key. None of the kernel's refresh
31
+ * hooks apply, so they are simply not wired — a key has no expiry to refresh
32
+ * against, and a rejected key is replaced, not refreshed.
33
+ */
34
+ export declare class OpenDesignAccountPool extends AccountPoolCore<OpenDesignCredentials, OpenDesignPoolAccount, OpenDesignAccountSummaryDto> {
35
+ private readonly store;
36
+ constructor(options?: OpenDesignAccountPoolOptions);
37
+ /**
38
+ * Pick the key for the next request, skipping accounts already tried.
39
+ *
40
+ * The credential carries its own base-URL override, so the account and the key
41
+ * are returned together.
42
+ */
43
+ getEffectiveCredential(excludeIds?: ReadonlySet<string>, fetchFn?: typeof fetch): Promise<{
44
+ account: OpenDesignPoolAccount;
45
+ credentials: OpenDesignCredentials;
46
+ }>;
47
+ /** The pre-pool credential file this pool mirrors its primary account into. */
48
+ mirrorStore(): FileCredentialStore;
49
+ /** The rotation strategy as the settings card renders it. */
50
+ strategy(): Promise<AccountRotationStrategy>;
51
+ /** Remember which model an account last served, best-effort. */
52
+ recordModel(accountId: string, model: string): Promise<void>;
53
+ }
54
+ //# sourceMappingURL=account-pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-pool.d.ts","sourceRoot":"","sources":["../../../../src/host/opendesign/account-pool.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EAGf,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EACL,mBAAmB,EAKnB,KAAK,qBAAqB,EAC3B,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAA;AAEvF,yFAAyF;AACzF,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB,CAAC,qBAAqB,CAAC;IACpF,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAA;AAE1D,0CAA0C;AAC1C,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,4EAA4E;AAC5E,eAAO,MAAM,sBAAsB,uBAAuB,CAAA;AAQ1D,sFAAsF;AACtF,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,qBAAqB,GAAG,MAAM,CAE/E;AASD,sDAAsD;AACtD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAkCvF;AAED,MAAM,WAAW,4BAA4B;IAC3C,0EAA0E;IAC1E,KAAK,CAAC,EAAE,mBAAmB,CAAA;IAC3B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,CAAA;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;GAMG;AACH,qBAAa,qBAAsB,SAAQ,eAAe,CACxD,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,CAC5B;IACC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;gBAE/B,OAAO,GAAE,4BAAiC;IAsEtD;;;;;OAKG;IACG,sBAAsB,CAC1B,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAChC,OAAO,GAAE,OAAO,KAAa,GAC5B,OAAO,CAAC;QAAE,OAAO,EAAE,qBAAqB,CAAC;QAAC,WAAW,EAAE,qBAAqB,CAAA;KAAE,CAAC;IAIlF,+EAA+E;IAC/E,WAAW,IAAI,mBAAmB;IAIlC,6DAA6D;IACvD,QAAQ,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAIlD,gEAAgE;IAC1D,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAOnE"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * The OpenDesign LLM adapter: an OpenAI-compatible `chat/completions` stream
3
+ * with per-account rotation and pre-first-token account failover.
4
+ *
5
+ * Transport and mapping live in `client.ts` / `mapper.ts`. This module owns the
6
+ * request loop: which account, and when an attempt is abandoned. There is no
7
+ * channel layer: the gateway chooses the upstream, and a request proves nothing
8
+ * beyond the account that served it.
9
+ *
10
+ * @module dsh-chatgpt-subscription/opendesign-adapter
11
+ */
12
+ import { LlmAdapter, type GenerateOptions as HarnessGenerateOptions, type LlmModelInfo, type LlmProviderInfo, type LlmResolvedModelInfo, type PreparedAdapterCall, type ResolvedRetryPolicy, type StreamChunk } from '@deepseek-ai/dsh-llm';
13
+ import type { OpenDesignModelSettingsStore } from './token-store.ts';
14
+ import type { OpenDesignAccountPool } from './account-pool.ts';
15
+ import { type AttachmentImageReader } from '../common/request-images.ts';
16
+ /**
17
+ * Fallback effort ladder for a model no source describes.
18
+ *
19
+ * Per-model ladders come from the shipped table (transcribed from this
20
+ * repository's sibling registries) and from the live catalog; this trio is only
21
+ * what a model with no data at all is offered. The wire carries the id string,
22
+ * so an over-offered level is ignored rather than refused by most gateways —
23
+ * but the ladder still prefers published data for anything the tables know.
24
+ */
25
+ export declare const REASONING_EFFORT_IDS: readonly string[];
26
+ export interface OpenDesignAdapterOptions {
27
+ /** Proxy-aware fetch for live chat streams. */
28
+ fetchFn: typeof fetch;
29
+ /** Durable attachment service, for request images. */
30
+ attachments?: AttachmentImageReader;
31
+ /** The account pool this adapter rotates over. */
32
+ accountPool: OpenDesignAccountPool;
33
+ }
34
+ export declare class OpenDesignAdapter extends LlmAdapter {
35
+ private readonly modelSettings;
36
+ private readonly options;
37
+ private readonly gate;
38
+ constructor(modelSettings: OpenDesignModelSettingsStore, options: OpenDesignAdapterOptions);
39
+ providerInfo(provider: string): LlmProviderInfo;
40
+ providerRetryPolicy(): ResolvedRetryPolicy;
41
+ imageRequestPricing(): undefined;
42
+ private get accountPool();
43
+ private settings;
44
+ /** Every id the line knows: the shipped table plus the synced live catalog. */
45
+ private knownModelIds;
46
+ /**
47
+ * The ids the route advertises, narrowed by the user's selection and hidden
48
+ * list.
49
+ *
50
+ * The selection is captured against this same id vocabulary (the gateway's
51
+ * own wire ids), so a cold start filters the shipped table through it without
52
+ * the empty-intersection trap a foreign-vocabulary whitelist would spring —
53
+ * and an explicit "everything off" (`[]`) still wins, because that intent
54
+ * does not depend on a vocabulary at all.
55
+ */
56
+ private visibleModelIds;
57
+ /** One model's resolved descriptor, from the shipped table plus live data. */
58
+ private modelInfo;
59
+ listModels(provider?: string): Promise<readonly LlmModelInfo[]>;
60
+ resolveModel(provider: string, modelId: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
61
+ prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;
62
+ stream(options: HarnessGenerateOptions): AsyncIterable<StreamChunk>;
63
+ /** The message the pool's empty state should raise, in this line's words. */
64
+ private noAccountError;
65
+ private requestStream;
66
+ /** Park an account that refused a request, for the reason it refused. */
67
+ private standDown;
68
+ }
69
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/host/opendesign/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,UAAU,EAIV,KAAK,eAAe,IAAI,sBAAsB,EAC9C,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAA;AAa7B,OAAO,KAAK,EAA2B,4BAA4B,EAAE,MAAM,kBAAkB,CAAA;AAE7F,OAAO,KAAK,EAAE,qBAAqB,EAAyB,MAAM,mBAAmB,CAAA;AAQrF,OAAO,EAA4C,KAAK,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AA+BlH;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,mBAAkB,CAAA;AAEnD,MAAM,WAAW,wBAAwB;IACvC,+CAA+C;IAC/C,OAAO,EAAE,OAAO,KAAK,CAAA;IACrB,sDAAsD;IACtD,WAAW,CAAC,EAAE,qBAAqB,CAAA;IACnC,kDAAkD;IAClD,WAAW,EAAE,qBAAqB,CAAA;CACnC;AAOD,qBAAa,iBAAkB,SAAQ,UAAU;IAI7C,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJ1B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwB;gBAG1B,aAAa,EAAE,4BAA4B,EAC3C,OAAO,EAAE,wBAAwB;IAKpD,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe;IAI/C,mBAAmB,IAAI,mBAAmB;IAI1C,mBAAmB,IAAI,SAAS;IAIhC,OAAO,KAAK,WAAW,GAEtB;IAED,OAAO,CAAC,QAAQ;IAIhB,+EAA+E;IAC/E,OAAO,CAAC,aAAa;IAMrB;;;;;;;;;OASG;IACH,OAAO,CAAC,eAAe;IAMvB,8EAA8E;YAChE,SAAS;IAUjB,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;IAgB/D,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAoBpG,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAO/F,MAAM,CAAC,OAAO,EAAE,sBAAsB,GAAG,aAAa,CAAC,WAAW,CAAC;IAW1E,6EAA6E;IAC7E,OAAO,CAAC,cAAc;YASP,aAAa;IAoJ5B,yEAAyE;YAC3D,SAAS;CAOxB"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Merge the shipped table, the last gateway listing and the user's per-model
3
+ * override into the descriptor the harness validates.
4
+ *
5
+ * Context window and output cap are provider facts, not preferences: the harness
6
+ * sizes its prompt budget against `context.contextWindow`, so an understated
7
+ * window silently truncates history. This line ships no per-model windows (the
8
+ * gateway publishes none to an API key), so the window is the line default until
9
+ * a live listing or a user override states one.
10
+ *
11
+ * @module dsh-chatgpt-subscription/opendesign-catalog
12
+ */
13
+ import { type OpenDesignModelInfo } from './types.ts';
14
+ import type { OpenDesignCatalogModel } from './token-store.ts';
15
+ /**
16
+ * The output budget to advertise for one model.
17
+ *
18
+ * `defaultMaxTokens` is what a request asks for, not what the model can emit,
19
+ * and the harness spends it twice: it fills a request's `max_tokens` from it
20
+ * and reserves the same number as completion room before deciding to compact.
21
+ * So a published ceiling clamps the configured budget rather than becoming it,
22
+ * and a budget is never taken past half the window.
23
+ */
24
+ export declare function resolveOutputBudget(budget: number | undefined, ceiling: number | undefined, contextWindow: number): number | undefined;
25
+ /**
26
+ * Resolve the metadata one model is advertised with.
27
+ *
28
+ * Precedence per field: the user's override, then the last gateway listing,
29
+ * then the shipped table, then the route-wide fallback. The listing sits above
30
+ * the shipped table for the fields the table cannot carry (window, modalities):
31
+ * the table's windows do not exist to be beaten, and its names/prices are
32
+ * curated, so a listing that states no name keeps the table's.
33
+ */
34
+ export declare function resolveModelInfo(model: string, options: {
35
+ /** Entries persisted by the last catalog sync. */
36
+ synced: readonly OpenDesignCatalogModel[];
37
+ /** Stored context-window override. */
38
+ contextWindowOverride?: number;
39
+ /** Route-wide fallback window. */
40
+ defaultContextWindow?: number;
41
+ /** Route-wide output budget. */
42
+ defaultMaxTokens?: number;
43
+ }): OpenDesignModelInfo;
44
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/opendesign/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAc9D;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOtI;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;IACP,kDAAkD;IAClD,MAAM,EAAE,SAAS,sBAAsB,EAAE,CAAA;IACzC,sCAAsC;IACtC,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,kCAAkC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,gCAAgC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,GACA,mBAAmB,CAoCrB"}
@@ -0,0 +1,148 @@
1
+ /**
2
+ * Transport for the OpenDesign link gateway. Transport only: no account or
3
+ * retry policy lives here (see `adapter.ts`).
4
+ *
5
+ * - `POST {baseURL}/chat/completions` — the chat endpoint this line speaks
6
+ * - `GET {baseURL}/models` — the key's live catalog; also the auth probe,
7
+ * because listing costs no credits while a token of chat does
8
+ *
9
+ * The base URL is the OpenAI spelling and already ends in `/v1`
10
+ * (src/host/opendesign/types.ts records how that was verified), so paths append
11
+ * literally.
12
+ *
13
+ * @module dsh-chatgpt-subscription/opendesign-client
14
+ */
15
+ import { type OpenDesignDiscoveredModel } from './types.ts';
16
+ export interface OpenDesignHttpResult {
17
+ status: number;
18
+ ok: boolean;
19
+ json: unknown;
20
+ text: string;
21
+ }
22
+ /** Combine a caller signal with a timeout signal. */
23
+ export declare function withTimeout(signal: AbortSignal | undefined, timeoutMs: number | undefined): AbortSignal | undefined;
24
+ /** Strip a trailing slash so paths can be appended literally. */
25
+ export declare function trimBase(baseURL: string): string;
26
+ /** The gateway's chat-completions endpoint for one base URL. */
27
+ export declare function chatURL(baseURL: string): string;
28
+ /** The gateway's catalog endpoint for one base URL. */
29
+ export declare function modelsURL(baseURL: string): string;
30
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
31
+ /** Send one JSON request and decode whatever comes back; never throws for HTTP errors. */
32
+ export declare function sendJSON(fetchFn: typeof fetch, url: string, { method, apiKey, body, signal, timeoutMs, headers, }?: {
33
+ method?: string;
34
+ apiKey?: string;
35
+ body?: unknown;
36
+ signal?: AbortSignal;
37
+ timeoutMs?: number;
38
+ headers?: Record<string, string>;
39
+ }): Promise<OpenDesignHttpResult>;
40
+ /** Open a streaming chat completion and hand back the live response. */
41
+ export declare function openChatStream({ fetchFn, baseURL, apiKey, body, signal, headers, }: {
42
+ fetchFn: typeof fetch;
43
+ baseURL: string;
44
+ apiKey: string;
45
+ body: unknown;
46
+ signal?: AbortSignal;
47
+ headers?: Record<string, string>;
48
+ }): Promise<Response>;
49
+ /** The gateway's own one-line explanation, when it sent one. */
50
+ export declare function firstMessage(envelope: unknown): string;
51
+ /**
52
+ * The live catalog one key may list.
53
+ *
54
+ * Returns ids plus whatever metadata the listing published, or null on any
55
+ * failure — a refused or unreachable gateway is a fact the caller reports, not
56
+ * an exception the route drops.
57
+ */
58
+ export declare function fetchGatewayCatalog({ fetchFn, baseURL, apiKey, signal, timeoutMs, }: {
59
+ fetchFn: typeof fetch;
60
+ baseURL: string;
61
+ apiKey: string;
62
+ signal?: AbortSignal;
63
+ timeoutMs?: number;
64
+ }): Promise<{
65
+ ids: string[];
66
+ catalog: Record<string, OpenDesignDiscoveredModel>;
67
+ } | null>;
68
+ /**
69
+ * One id compared without its separators.
70
+ *
71
+ * The AMR control-plane catalog spells ids `public_model_deepseek_v4_1_flash`
72
+ * (the open-source daemon normalizes the same spellings at its boundary), while
73
+ * the link gateway and this line's table use `deepseek-v4.1-flash`. Comparing
74
+ * alphanumerics only maps one onto the other without a per-model translation
75
+ * table that would rot the moment a model is added.
76
+ */
77
+ export declare function canonicalModelKey(id: string): string;
78
+ /**
79
+ * The control-plane catalog: the AMR-side listing, which DOES carry metadata.
80
+ *
81
+ * `GET {amr}/models` with a control key (the open-source daemon reads the same
82
+ * catalog through `vela model list --all --format json`, whose items carry
83
+ * `metadata.contextWindowTokens`). Ids are normalized onto the known wire ids
84
+ * with {@link canonicalModelKey}; an id the line does not know is kept as the
85
+ * slug it arrived as, never dropped.
86
+ *
87
+ * A runtime key is not accepted here (the console's control-plane surfaces
88
+ * reject it), so this is an OAuth-account capability; the gateway listing stays
89
+ * the path for a pasted key.
90
+ */
91
+ export declare function fetchControlPlaneCatalog({ fetchFn, controlKey, apiBase, knownIds, signal, timeoutMs, }: {
92
+ fetchFn: typeof fetch;
93
+ controlKey: string;
94
+ apiBase?: string;
95
+ knownIds?: readonly string[];
96
+ signal?: AbortSignal;
97
+ timeoutMs?: number;
98
+ }): Promise<{
99
+ ids: string[];
100
+ catalog: Record<string, OpenDesignDiscoveredModel>;
101
+ } | null>;
102
+ /**
103
+ * Verify one key with the free catalog read.
104
+ *
105
+ * A chat probe would spend credits to learn the same thing, so the probe is the
106
+ * listing: 200 proves the key works (and how many models it sees), 401/403
107
+ * proves it does not, and anything else is reported as the gateway sent it.
108
+ */
109
+ export declare function testApiKey({ fetchFn, baseURL, apiKey, signal, timeoutMs, }: {
110
+ fetchFn: typeof fetch;
111
+ baseURL: string;
112
+ apiKey: string;
113
+ signal?: AbortSignal;
114
+ timeoutMs?: number;
115
+ }): Promise<{
116
+ authorized: boolean;
117
+ ms: number;
118
+ error: string;
119
+ modelCount: number;
120
+ }>;
121
+ /** One wallet reading: the balance string as served, or the refusal as data. */
122
+ export interface OpenDesignWalletBalance {
123
+ ok: boolean;
124
+ /** USD balance, exactly as the service strings it (e.g. "12.34"). */
125
+ balanceUsd: string | null;
126
+ /** ISO instant the service stamped on the reading, when it sent one. */
127
+ updatedAt: string | null;
128
+ error: string;
129
+ }
130
+ /**
131
+ * Read one OAuth account's wallet balance with its control key.
132
+ *
133
+ * Wire shape from the open-source daemon's reader
134
+ * (apps/daemon/src/integrations/vela-wallet.ts, nexu-io/open-design): the
135
+ * balance is a STRING matching /^\d+(?:\.\d+)?$/ — a number-shaped field of
136
+ * any other type is not a balance. A refusal is reported as data, never thrown:
137
+ * the card shows it beside controls that keep working without it. Billing reads
138
+ * are display-only upstream too (OPEND-3553 in the same repo): a wallet 401/403
139
+ * says nothing about the chat credential, so it must never mark the account.
140
+ */
141
+ export declare function fetchWalletBalance({ fetchFn, controlKey, apiBase, signal, timeoutMs, }: {
142
+ fetchFn: typeof fetch;
143
+ controlKey: string;
144
+ apiBase?: string;
145
+ signal?: AbortSignal;
146
+ timeoutMs?: number;
147
+ }): Promise<OpenDesignWalletBalance>;
148
+ //# sourceMappingURL=client.d.ts.map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C,EAAE,MAAM,CAAA;CACnB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAsBnC"}
@@ -0,0 +1,49 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { AttachmentStore } from '@deepseek-ai/dsh-attachment';
3
+ import { type ProviderRouteClaim } from '../common/provider-route.ts';
4
+ import { OpenDesignAccountPool } from './account-pool.ts';
5
+ import { OpenDesignAdapter } from './adapter.ts';
6
+ import { OpenDesignLoginManager } from './oauth.ts';
7
+ import { OPENDESIGN_ROUTES } from './routes.ts';
8
+ import { OpenDesignModelSettingsStore, type OpenDesignModelSettings } from './token-store.ts';
9
+ import type { HubSummarySource } from '../hub-overview.ts';
10
+ export interface OpenDesignLineOptions {
11
+ /** Proxy-aware fetch that routes and catalog syncs use. */
12
+ fetchFn: typeof fetch;
13
+ /** Controlled/diagnostic fetch that live adapter chat streams use; defaults to fetchFn. */
14
+ modelFetchFn?: typeof fetch;
15
+ /** Durable attachment service, for image input. */
16
+ attachments?: Pick<AttachmentStore, 'readImage' | 'readImageRequest'>;
17
+ }
18
+ export interface OpenDesignLine {
19
+ adapter: OpenDesignAdapter;
20
+ modelSettings: OpenDesignModelSettingsStore;
21
+ accountPool: OpenDesignAccountPool;
22
+ login: OpenDesignLoginManager;
23
+ claim: ProviderRouteClaim;
24
+ disposeRoutes: () => void;
25
+ /** Owner overview card source, read from local snapshots only. */
26
+ hubSource: HubSummarySource;
27
+ /** Release every registration this line made. */
28
+ dispose(): void;
29
+ }
30
+ /** Every id the line knows: the shipped table plus the synced live catalog. */
31
+ export declare function openDesignKnownModelIds(settings: OpenDesignModelSettings): string[];
32
+ /**
33
+ * Every id the line advertises right now.
34
+ *
35
+ * The selection rule is shared by the adapter, the status route and the hub
36
+ * card — they must all read this one function, not three private copies: the
37
+ * user's tick list and the shipped table speak the same id vocabulary here (the
38
+ * gateway's own wire ids), so a cold-start intersection cannot empty the picker,
39
+ * and an explicit "everything off" (`[]`) still wins.
40
+ */
41
+ export declare function openDesignVisibleModelIds(settings: OpenDesignModelSettings): string[];
42
+ /**
43
+ * Build the line.
44
+ * @param ctx - host plugin context (owns `llm` and `webServer`).
45
+ * @param options - the proxy-aware fetch and the attachment reader.
46
+ */
47
+ export declare function createOpenDesignLine(ctx: Context, options: OpenDesignLineOptions): OpenDesignLine;
48
+ export { OPENDESIGN_ROUTES };
49
+ //# sourceMappingURL=line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../../src/host/opendesign/line.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAGzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAoD,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACjG,OAAO,EAAE,4BAA4B,EAAE,KAAK,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAE7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D,MAAM,WAAW,qBAAqB;IACpC,2DAA2D;IAC3D,OAAO,EAAE,OAAO,KAAK,CAAA;IACrB,2FAA2F;IAC3F,YAAY,CAAC,EAAE,OAAO,KAAK,CAAA;IAC3B,mDAAmD;IACnD,WAAW,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,kBAAkB,CAAC,CAAA;CACtE;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,iBAAiB,CAAA;IAC1B,aAAa,EAAE,4BAA4B,CAAA;IAC3C,WAAW,EAAE,qBAAqB,CAAA;IAClC,KAAK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