@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
@@ -0,0 +1,159 @@
1
+ import type { AccountPoolStatusDto, AccountRotationStrategy, PoolAccountSummaryDto } from './account-pool-contracts.ts';
2
+ /**
3
+ * Wire contracts for the OpenDesign line's settings API.
4
+ *
5
+ * OpenDesign (open-design.ai, nexu-io/open-design) sells subscription plans whose
6
+ * model credits third-party tools spend through the "OpenDesign API": a static
7
+ * API key created in the Cloud console, sent as `Authorization: Bearer` to the
8
+ * link gateway. The gateway speaks the OpenAI Chat Completions protocol — the
9
+ * console's own quick-setup recommends exactly that format for DeepSeek Harness.
10
+ *
11
+ * Two sign-in paths share the pool:
12
+ *
13
+ * - **Browser device authorization** (the official `vela login` flow,
14
+ * reimplemented over the public AMR API): the host creates a device
15
+ * authorization, the user approves it in the Cloud console, and the poll
16
+ * returns a `vela_ctrl_…` control key, an `sk-amr-…` runtime key, and the
17
+ * account's identity. The runtime key serves chat; the control key reads the
18
+ * wallet balance. Neither expires (no expiry is published or observed).
19
+ * - **A pasted API key** created in the console — the path the pricing FAQ
20
+ * documents for Codex / Claude Code / DSH. Chat only: the gateway answers a
21
+ * bare key with no profile fields, and the console's wallet surface refuses it.
22
+ */
23
+ export declare const OPENDESIGN_PROVIDER_ID = "opendesign";
24
+ export declare const OPENDESIGN_PROVIDER_NAME = "OpenDesign";
25
+ export declare const OPENDESIGN_ROUTE_PREFIX = "/opendesign/api";
26
+ /**
27
+ * Where a user creates and revokes a key: the Cloud console's workspace area.
28
+ * The console is a SPA; the keys screen is the workspace's API-keys view, so the
29
+ * card links to the workspace root and says "API Keys" in words.
30
+ */
31
+ export declare const OPENDESIGN_CONSOLE_URL = "https://open-design.ai/cloud";
32
+ /** One published price, as the card renders it (USD per 1M tokens). */
33
+ export interface OpenDesignModelPricingDto {
34
+ input: number;
35
+ output: number;
36
+ }
37
+ /** One model as the card renders it: published facts plus the user's overrides. */
38
+ export interface OpenDesignModelDto {
39
+ id: string;
40
+ name: string;
41
+ /** One-line capability summary built on the host for ModelChecklist. */
42
+ hint?: string;
43
+ contextWindow: number;
44
+ /** The published/default window, before the user's override. */
45
+ defaultContextWindow: number;
46
+ maxTokens: number;
47
+ reasoning: boolean;
48
+ input: string[];
49
+ /** Whether the route advertises this model to the picker. */
50
+ enabled: boolean;
51
+ /** The model's published price, when the public price list carries one. */
52
+ pricing?: OpenDesignModelPricingDto;
53
+ /** Stored context-window override, absent when the default applies. */
54
+ contextWindowOverride?: number;
55
+ }
56
+ /** One pooled account as the shared card renders it. Never carries a secret. */
57
+ export interface OpenDesignAccountSummaryDto extends PoolAccountSummaryDto {
58
+ /** How this account signed in; absent on a legacy row. */
59
+ authKind?: 'oauth' | 'api-key';
60
+ /** The plan the upstream named for this account at sign-in (OAuth only). */
61
+ plan?: string;
62
+ }
63
+ /** State of the device-authorization sign-in flow, as the card renders it. */
64
+ export interface OpenDesignLoginFlowDto {
65
+ id: string;
66
+ status: 'idle' | 'pending' | 'complete' | 'failed' | 'cancelled';
67
+ /** Short code the user confirms at the activation URL. */
68
+ userCode: string;
69
+ /** The console's activation page, opened by the card itself. */
70
+ verificationUri: string;
71
+ /** Unix milliseconds the device authorization expires. */
72
+ expiresAt: number;
73
+ /** Seconds between polls, as the service asked. */
74
+ intervalSeconds: number;
75
+ error: string;
76
+ /** Account label once the flow completes. */
77
+ accountAlias: string;
78
+ }
79
+ /** One account's latest wallet reading (OAuth accounts only have one to read). */
80
+ export interface OpenDesignUsageAccountDto {
81
+ accountId: string;
82
+ alias: string;
83
+ ok: boolean;
84
+ /**
85
+ * Current wallet balance in USD, exactly as the service strings it. Null when
86
+ * unread or unreadable — a failed read is not a zero balance.
87
+ */
88
+ balanceUsd: string | null;
89
+ /** ISO instant the service stamped on the reading, when it sent one. */
90
+ updatedAt: string | null;
91
+ error: string;
92
+ fetchedAt: number;
93
+ }
94
+ /** Latest wallet snapshot, one entry per account read. Never a live call. */
95
+ export interface OpenDesignUsageDto {
96
+ accounts: OpenDesignUsageAccountDto[];
97
+ fetchedAt: number;
98
+ }
99
+ export interface OpenDesignPoolStatusDto {
100
+ accounts: OpenDesignAccountSummaryDto[];
101
+ activeAccountId?: string;
102
+ rotationStrategy: AccountRotationStrategy;
103
+ }
104
+ /** The line-level knobs the advanced block edits. */
105
+ export interface OpenDesignSettingsDto {
106
+ baseURL: string;
107
+ defaultContextWindow: number;
108
+ defaultMaxTokens: number;
109
+ maxConcurrentRequests: number;
110
+ streamIdleTimeoutMs: number;
111
+ }
112
+ /** A settings patch; only the keys present change. */
113
+ export interface OpenDesignSettingsUpdateDto {
114
+ enabled?: boolean;
115
+ baseURL?: string;
116
+ defaultContextWindow?: number;
117
+ defaultMaxTokens?: number;
118
+ maxConcurrentRequests?: number;
119
+ streamIdleTimeoutMs?: number;
120
+ }
121
+ /** Everything the settings card renders for the OpenDesign tab. */
122
+ export interface OpenDesignWebStatus {
123
+ /** Whether the line serves its route and appears in the picker at all. */
124
+ enabled: boolean;
125
+ providerId: string;
126
+ baseURL: string;
127
+ /** Whether this plugin currently owns the route. */
128
+ serving: boolean;
129
+ /** Why another adapter owns the route, or null while this plugin owns it. */
130
+ conflict: string | null;
131
+ /** Whether at least one account can currently serve a request. */
132
+ usable: boolean;
133
+ /** Alias of `usable`, named for the shared composer/badge contract. */
134
+ authenticated: boolean;
135
+ pool: OpenDesignPoolStatusDto;
136
+ models: OpenDesignModelDto[];
137
+ /** Distinct from an empty catalog: 'never synced' and 'synced, empty' differ. */
138
+ catalogSynced: boolean;
139
+ catalogCount: number;
140
+ /** Latest wallet readings, one per account read; null before the first read. */
141
+ usage: OpenDesignUsageDto | null;
142
+ /** Latest device-authorization flow in this process, or null when none ran. */
143
+ login: OpenDesignLoginFlowDto | null;
144
+ settings: OpenDesignSettingsDto;
145
+ }
146
+ /** Outcome of checking one API key against the gateway's catalog endpoint. */
147
+ export interface OpenDesignAuthResult {
148
+ ok: boolean;
149
+ authorized: boolean;
150
+ ms: number;
151
+ error: string;
152
+ /** How many models the key may list; the proof that it works. */
153
+ modelCount: number;
154
+ }
155
+ /** Actions the accounts endpoint accepts. */
156
+ export type OpenDesignAccountAction = 'add' | 'test' | 'set-primary' | 'set-alias' | 'delete' | 'clear-cooldown' | 'strategy';
157
+ /** Re-export so the line's consumers read one module. */
158
+ export type { AccountPoolStatusDto };
159
+ //# sourceMappingURL=opendesign-contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opendesign-contracts.d.ts","sourceRoot":"","sources":["../../../src/shared/opendesign-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,6BAA6B,CAAA;AAEpC;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,eAAO,MAAM,sBAAsB,eAAe,CAAA;AAClD,eAAO,MAAM,wBAAwB,eAAe,CAAA;AACpD,eAAO,MAAM,uBAAuB,oBAAoB,CAAA;AAExD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,iCAAiC,CAAA;AAEpE,uEAAuE;AACvE,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED,mFAAmF;AACnF,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,gEAAgE;IAChE,oBAAoB,EAAE,MAAM,CAAA;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,6DAA6D;IAC7D,OAAO,EAAE,OAAO,CAAA;IAChB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,yBAAyB,CAAA;IACnC,uEAAuE;IACvE,qBAAqB,CAAC,EAAE,MAAM,CAAA;CAC/B;AAED,gFAAgF;AAChF,MAAM,WAAW,2BAA4B,SAAQ,qBAAqB;IACxE,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,8EAA8E;AAC9E,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MA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ginFlowStatus {
186
186
  /** 设置面接受的补丁。 */
187
187
  export interface QoderSettingsUpdateDto {
188
188
  enabled?: boolean;
189
- enabledModelIds?: string[];
189
+ /**
190
+ * 模型勾选,**三态**(与 host 的 `QoderModelSettings` 同源):
191
+ *
192
+ * - `null` = 不过滤,目录里的每一个模型都可用(出厂状态);
193
+ * - `[]` = 用户明确把每一个模型都关掉;
194
+ * - 非空 = 白名单,只有列出的那些可用。
195
+ *
196
+ * 三态而不是「空数组即不过滤」:后者让「全不选」与「全选」提交同一个值,
197
+ * 卡片上那个按钮就永远点不出效果。
198
+ *
199
+ * 白名单是**对着某一版实时目录**勾出来的 id(上游 `display_name` 去空白),
200
+ * 与随包兜底表不是同一套词汇(`DeepSeek-Flash` 对 `DeepSeek-V4-Flash`)。
201
+ * 所以它只在实时目录上收敛生效;进程里还只有兜底表时不按它过滤,
202
+ * 但 `[]`(全关)仍然照旧生效——那是明确的用户意图,与词汇表无关。
203
+ */
204
+ enabledModelIds?: string[] | null;
190
205
  /** 数字表示为该模型设置覆盖值;`null` 恢复目录默认。 */
191
206
  contextWindowOverrides?: Record<string, number | null>;
192
207
  /** `null` 表示各模型用自己的默认档位。 */
@@ -273,7 +288,31 @@ export interface QoderStatusDto extends Partial<AccountPoolStatusDto> {
273
288
  quotaRefreshing?: boolean;
274
289
  /** 额度读取失败的原因;与快照并列给出,而不是互相取代。 */
275
290
  quotaError?: string | null;
291
+ /**
292
+ * 本次应答背后是否正在刷新**模型目录**。
293
+ *
294
+ * 形状与 {@link quotaRefreshing} 同一条约定:host 先拿缓存(或随包兜底表)把
295
+ * 应答发出去,源头上那次刷新跑在应答背后。客户端据此知道「选择器里的兜底行
296
+ * 马上会被真实目录顶掉」,从而排一次补读——60 秒轮询太慢,用户等不到。
297
+ *
298
+ * 它与「用户有没有点刷新」无关:手动刷新是 POST /catalog/refresh,在应答
299
+ * 之前就完成了,不靠这个字段。
300
+ */
301
+ catalogRefreshing?: boolean;
276
302
  models: QoderModelOption[];
303
+ /**
304
+ * 用户存下来的模型勾选,**三态**:`null` = 不过滤(全部可用)、
305
+ * `[]` = 全关、非空 = 白名单。
306
+ *
307
+ * 如实下发(`null` 也是一个要下发的值):客户端要靠它区分「没挑过」与
308
+ * 「挑完又全清」,两者在 `models[].enabled` 上看起来是一样的。
309
+ *
310
+ * 它是**生效**的选择,不是落盘的原文:进程里还只有随包兜底表(没有实时目录)
311
+ * 时,白名单与那份目录不是同一套 id 词汇,按它筛只会把每一行都筛掉,所以这个
312
+ * 字段此时收敛成 `null`(不过滤、全部可用),勾选标记跟着全部亮起;
313
+ * `[]`(全关)不受影响。实时目录一到,它立刻变回真实的收敛结果。
314
+ */
315
+ enabledModelIds: string[] | null;
277
316
  contextWindowOverrides: Record<string, number>;
278
317
  defaultReasoningEffort: QoderReasoningEffort | null;
279
318
  /** 当前进行中的登录流程;无流程时为 null。 */
@@ -1 +1 @@
1
- {"version":3,"file":"qoder-contracts.d.ts","sourceRoot":"","sources":["../../../src/shared/qoder-contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,6BAA6B,CAAA;AAEpC,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,UAAU,CAAA;AAExC,0BAA0B;AAC1B,eAAO,MAAM,mBAAmB,kCAAc,CAAA;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,eAAe,CAAA;AAE9C;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,IAAI,CAAA;AAEzC,+CAA+C;AAC/C,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAAqB,CAAA;AAErE,sCAAsC;AACtC,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,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C9B,OAAO,EAAE,OAAO,CAAA;IAChB,wBAAwB;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB"}
@@ -0,0 +1,124 @@
1
+ /** The package this build is. Both routes act on this one name only. */
2
+ export declare const UPDATE_PACKAGE_NAME: "@eddyskywalker/dsh-chatgpt-subscription";
3
+ /**
4
+ * The exact spec the one-tap update installs.
5
+ *
6
+ * Written here rather than accepted from the request body: a route that took the
7
+ * package name from its caller would let any same-origin POST install an
8
+ * arbitrary package into the profile.
9
+ */
10
+ export declare const UPDATE_INSTALL_SPEC: "@eddyskywalker/dsh-chatgpt-subscription@latest";
11
+ /** The registry document the version check reads (scoped packages take this slash form). */
12
+ export declare const UPDATE_REGISTRY_URL: "https://registry.npmjs.org/@eddyskywalker/dsh-chatgpt-subscription/latest";
13
+ /**
14
+ * The `dsh plugin add` command for one exact install spec.
15
+ *
16
+ * The manual recovery path after a failed update needs a command pinned to the
17
+ * version that was running, not `@latest`: reinstalling `@latest` right after a
18
+ * failed attempt would repeat the same install. Both commands are built here so
19
+ * the wording of "add this spec by hand" exists once.
20
+ *
21
+ * @param spec - The install spec; defaults to {@link UPDATE_INSTALL_SPEC}.
22
+ * @returns the command line a user can paste into a terminal.
23
+ */
24
+ export declare function updateAddCommand(spec?: string): string;
25
+ /** The command a user runs by hand when the card cannot install for them. */
26
+ export declare const UPDATE_MANUAL_COMMAND: string;
27
+ export declare const UPDATE_CHECK_PATH: "/api/dsh-chatgpt-subscription/update/check";
28
+ export declare const UPDATE_APPLY_PATH: "/api/dsh-chatgpt-subscription/update/apply";
29
+ /** How the running copy of this plugin reached the disk. */
30
+ export type UpdateInstallKind = 'registry' | 'link' | 'file' | 'unknown';
31
+ /**
32
+ * Why one-tap installation is unavailable, when it is.
33
+ *
34
+ * - `development-install`: the running copy is a `link:`/`file:` dependency, so
35
+ * installing over it would replace the very working tree a developer edits.
36
+ * - `plugin-manager-missing`: this Host exposes no `pluginManager` service, so
37
+ * nothing here can run pnpm.
38
+ * - `registry-unreachable`: the version check itself failed, so there is nothing
39
+ * to install yet.
40
+ */
41
+ export type UpdateBlockedReason = 'development-install' | 'plugin-manager-missing' | 'registry-unreachable';
42
+ /**
43
+ * The answer to one version check.
44
+ *
45
+ * The four outcomes the card renders are derivable from these fields alone:
46
+ *
47
+ * | outcome | fields |
48
+ * | --- | --- |
49
+ * | already latest | `latest` set, `updateAvailable: false`, no `reason` |
50
+ * | new version, one tap | `updateAvailable: true`, `canApply: true` |
51
+ * | new version, manual only | `updateAvailable: true`, `canApply: false`, `reason` set |
52
+ * | check failed | `latest: null`, `reason: 'registry-unreachable'` |
53
+ */
54
+ export interface UpdateCheckDto {
55
+ /**
56
+ * The version this process is running, or null when the manifest could not be
57
+ * located (the card then says "unknown" instead of inventing one).
58
+ */
59
+ current: string | null;
60
+ /** The newest published version, or null when the registry did not answer. */
61
+ latest: string | null;
62
+ /** `latest` is strictly newer than `current`. */
63
+ updateAvailable: boolean;
64
+ /** How this copy reached the disk, as the plugin manager or the path shows. */
65
+ installKind: UpdateInstallKind;
66
+ /** Whether `POST` can install it here. */
67
+ canApply: boolean;
68
+ /** Present exactly when `canApply` is false for a reason worth telling. */
69
+ reason?: UpdateBlockedReason;
70
+ /** The command to run by hand; always present so every outcome has an escape hatch. */
71
+ command: string;
72
+ /** When the registry was asked, as Unix milliseconds. */
73
+ checkedAt: number;
74
+ }
75
+ /** What happened when a failed installation tried to put the previous version back. */
76
+ export type UpdateRollback = 'restored' | 'failed' | 'skipped';
77
+ /** The answer to a successful one-tap update. */
78
+ export interface UpdateApplyDto {
79
+ /**
80
+ * The version now on disk.
81
+ *
82
+ * It is the manifest version pnpm actually installed, which a supply-chain
83
+ * policy such as `minimumReleaseAge` can hold below the newest release.
84
+ */
85
+ installed: string;
86
+ /**
87
+ * Whether the running process still holds the previous version's modules.
88
+ *
89
+ * Taken from the install's own `application` field rather than assumed: a Host
90
+ * running an HMR profile reloads the replaced bundle live and answers
91
+ * `applied`, in which case nothing is left to restart.
92
+ */
93
+ restartRequired: boolean;
94
+ /**
95
+ * Whether the update ran the official remove-then-install path.
96
+ *
97
+ * An HMR profile refuses to install over a package it already has, so the
98
+ * update first removes the installed copy. That is visible on the wire instead
99
+ * of hidden, because it is the one update path that leaves the plugin briefly
100
+ * uninstalled.
101
+ */
102
+ removedFirst: boolean;
103
+ }
104
+ /** The failure codes the apply route answers with, so the card can word them. */
105
+ export type UpdateFailureCode = 'development-install' | 'plugin-manager-missing'
106
+ /** The Host will not remove a plugin a running profile has loaded, so it must be stopped first. */
107
+ | 'stop-profile' | 'install-failed' | 'csrf-rejected';
108
+ /** A refused update. An `ApiEnvelope` with `ok: false` and one of these codes. */
109
+ export interface UpdateFailureDto {
110
+ ok: false;
111
+ error: {
112
+ code: UpdateFailureCode;
113
+ message: string;
114
+ /**
115
+ * Present when the failure happened on the remove-then-install path: whether
116
+ * the previous version was put back. A card that stayed silent here would
117
+ * leave a user with a plugin that may no longer be installed.
118
+ */
119
+ rollback?: UpdateRollback;
120
+ /** The version the rollback reinstalled, present exactly when `rollback` is `restored`. */
121
+ restoredVersion?: string;
122
+ };
123
+ }
124
+ //# sourceMappingURL=update-contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-contracts.d.ts","sourceRoot":"","sources":["../../../src/shared/update-contracts.ts"],"names":[],"mappings":"AAaA,wEAAwE;AACxE,eAAO,MAAM,mBAAmB,EAAG,yCAAkD,CAAA;AAErF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,kDAA2C,CAAA;AAE3E,4FAA4F;AAC5F,eAAO,MAAM,mBAAmB,6EAAsE,CAAA;AAEtG;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,MAA4B,GAAG,MAAM,CAE3E;AAED,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB,QAAqB,CAAA;AAEvD,eAAO,MAAM,iBAAiB,8CAA0C,CAAA;AACxE,eAAO,MAAM,iBAAiB,8CAA0C,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AE,cAAc,CAAA;QACzB,2FAA2F;QAC3F,eAAe,CAAC,EAAE,MAAM,CAAA;KACzB,CAAA;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eddyskywalker/dsh-chatgpt-subscription",
3
- "version": "0.33.0",
3
+ "version": "0.35.0",
4
4
  "description": "DSH provider plugin for Codex access through a ChatGPT subscription.",
5
5
  "icon": "./icon.svg",
6
6
  "author": {
@@ -1,22 +0,0 @@
1
- import type { ModelDirectoryState } from '@deepseek-ai/dsh-client-ui-model-selection/client';
2
- import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
3
- import type { WorkBuddyWebStatus } from '../../shared/workbuddy-contracts.ts';
4
- import { type ComposerQuotaFacts } from '../common/ComposerQuotaBadge.tsx';
5
- import type { SnapshotStore } from '../store.ts';
6
- import { NS_WORKBUDDY } from './locales.ts';
7
- type Props = PropsRuntime<'conversation.input.right'> & PropsLocale<typeof NS_WORKBUDDY> & {
8
- directory: SnapshotStore<ModelDirectoryState>;
9
- loadModelDirectory: () => void;
10
- };
11
- /**
12
- * Pick the most meaningful number for the badge.
13
- *
14
- * A bounded allowance is what a user spends down, so it wins over a bare credit
15
- * balance; the balance shows only when no percentage is reported. The billing
16
- * payload reports both a cycle meter and a package meter, and the cycle meter
17
- * is the one that actually resets, so it is preferred when both exist.
18
- */
19
- export declare function selectBadgeFacts(status: WorkBuddyWebStatus | null): ComposerQuotaFacts | null;
20
- export declare function WorkBuddyComposerQuota({ directory, loadModelDirectory, t }: Props): React.JSX.Element | null;
21
- export {};
22
- //# sourceMappingURL=WorkBuddyComposerQuota.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WorkBuddyComposerQuota.d.ts","sourceRoot":"","sources":["../../../../src/client/workbuddy/WorkBuddyComposerQuota.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAA;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AAC7E,OAAO,EAAkC,KAAK,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAE1G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAI3C,KAAK,KAAK,GAAG,YAAY,CAAC,0BAA0B,CAAC,GAAG,WAAW,CAAC,OAAO,YAAY,CAAC,GAAG;IACzF,SAAS,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAA;IAC7C,kBAAkB,EAAE,MAAM,IAAI,CAAA;CAC/B,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,GAAG,kBAAkB,GAAG,IAAI,CAyB7F;AAED,wBAAgB,sBAAsB,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAW5G"}
@@ -1,50 +0,0 @@
1
- /**
2
- * The WorkBuddy subscription settings card.
3
- *
4
- * Markup only: every piece of state, every effect and every request this card
5
- * makes lives in 'useWorkBuddySection.ts', which returns one named shape the JSX
6
- * below reads. The two files are the split of a single 885-line component — the
7
- * behaviour is unchanged, and this one should stay render-shaped.
8
- */
9
- import React from 'react';
10
- import type { WorkBuddyModelCredits, WorkBuddyRegion } from '../../shared/workbuddy-contracts.ts';
11
- import { type WorkBuddySectionProps } from './useWorkBuddySection.ts';
12
- /**
13
- * The consumption rate of one model, as the settings row states it.
14
- *
15
- * The gateway publishes one rate per region and the official CodeBuddy picker
16
- * spells it beside a model as `6.67x`; the row uses the same shape behind the
17
- * section's own label. Which rates reach the row depends on what the card knows
18
- * about the account, and the two cases are deliberately different:
19
- *
20
- * - A KNOWN region shows that region's rate and nothing else. Borrowing the
21
- * sibling region's number would state a price this account never pays —
22
- * measured 2026-10-09, `deepseek-v4.1-flash` is `0.11` on cn against `0.00`
23
- * on intl, and the backends reject a model asked of the wrong region anyway.
24
- * - An UNKNOWN region (no account read back yet) shows both rates when the
25
- * backends disagree, so the row is honest about the range instead of picking
26
- * one of them. When they agree there is nothing to disambiguate.
27
- *
28
- * The two-region form is assembled entirely from the caller's labels: the
29
- * qualifier comes from `labels.region(value, key)` and the join from
30
- * `labels.pair(first, second)`, so the dictionary owns the region nouns, the
31
- * bracket glyphs AND the separator. Nothing about the two-region string is
32
- * spelled in this file, which is the point — the glyphs differ per language
33
- * (`倍率 0.11x(国区) / 0.00x(国际区)` in Chinese,
34
- * `Multiplier 0.11x (China) / 0.00x (International)` in English) and a
35
- * separator chosen here would be right in at most one of them.
36
- *
37
- * `null` means "this row states no rate"; the caller drops it from the hint
38
- * array rather than rendering a placeholder, because a guessed rate on a spend
39
- * figure is worse than a missing one. `'0.00'` is a declaration — this model
40
- * consumes no allowance — so it renders like any other value.
41
- */
42
- export declare function creditMultiplierHint(credits: WorkBuddyModelCredits | undefined, region: WorkBuddyRegion | null, labels: {
43
- multiplier: string;
44
- region: (value: string, key: WorkBuddyRegion) => string;
45
- pair: (first: string, second: string) => string;
46
- }): string | null;
47
- /** Mask a UIN so the card shows identity without publishing the full number. */
48
- export declare function maskUin(uin?: string | null): string;
49
- export declare function WorkBuddySection({ onModelChange, loadModelDirectory }: WorkBuddySectionProps): React.ReactElement;
50
- //# sourceMappingURL=WorkBuddySection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WorkBuddySection.d.ts","sourceRoot":"","sources":["../../../../src/client/workbuddy/WorkBuddySection.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAmB,MAAM,OAAO,CAAA;AACvC,OAAO,KAAK,EAEV,qBAAqB,EAIrB,eAAe,EAChB,MAAM,qCAAqC,CAAA;AAK5C,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAmB1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,qBAAqB,GAAG,SAAS,EAC1C,MAAM,EAAE,eAAe,GAAG,IAAI,EAC9B,MAAM,EAAE;IACN,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,KAAK,MAAM,CAAA;IACvD,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;CAChD,GACA,MAAM,GAAG,IAAI,CA4Bf;AAED,gFAAgF;AAChF,wBAAgB,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAInD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,CAidjH"}