@eddyskywalker/dsh-chatgpt-subscription 0.31.0 → 0.33.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 (131) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/README.md +112 -1
  3. package/lib/client.js +34731 -3832
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +12922 -2851
  6. package/lib/types/client/cline-pass/ClinePassComposerQuota.d.ts +20 -0
  7. package/lib/types/client/cline-pass/ClinePassComposerQuota.d.ts.map +1 -0
  8. package/lib/types/client/cline-pass/ClinePassSection.d.ts +17 -0
  9. package/lib/types/client/cline-pass/ClinePassSection.d.ts.map +1 -0
  10. package/lib/types/client/cline-pass/api.d.ts +84 -0
  11. package/lib/types/client/cline-pass/api.d.ts.map +1 -0
  12. package/lib/types/client/cline-pass/locales.d.ts +1025 -0
  13. package/lib/types/client/cline-pass/locales.d.ts.map +1 -0
  14. package/lib/types/client/cline-pass/styles.d.ts +7 -0
  15. package/lib/types/client/cline-pass/styles.d.ts.map +1 -0
  16. package/lib/types/client/hub/brand-icons.d.ts +18 -2
  17. package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
  18. package/lib/types/client/hub/hub-styles.d.ts.map +1 -1
  19. package/lib/types/client/hub/providers.d.ts.map +1 -1
  20. package/lib/types/client/index.d.ts +4 -0
  21. package/lib/types/client/index.d.ts.map +1 -1
  22. package/lib/types/client/mermaid/renderer.d.ts +23 -0
  23. package/lib/types/client/mermaid/renderer.d.ts.map +1 -1
  24. package/lib/types/client/minimax-code/MinimaxVideoDocumentBody.d.ts +31 -14
  25. package/lib/types/client/minimax-code/MinimaxVideoDocumentBody.d.ts.map +1 -1
  26. package/lib/types/client/minimax-code/MinimaxVideoToolView.d.ts.map +1 -1
  27. package/lib/types/client/minimax-code/VideoFormDialog.d.ts +46 -50
  28. package/lib/types/client/minimax-code/VideoFormDialog.d.ts.map +1 -1
  29. package/lib/types/client/minimax-code/locales.d.ts +80 -20
  30. package/lib/types/client/minimax-code/locales.d.ts.map +1 -1
  31. package/lib/types/client/minimax-code/styles.d.ts.map +1 -1
  32. package/lib/types/client/minimax-code/video-command-host.d.ts +17 -11
  33. package/lib/types/client/minimax-code/video-command-host.d.ts.map +1 -1
  34. package/lib/types/client/minimax-code/video-command-icon.d.ts +38 -0
  35. package/lib/types/client/minimax-code/video-command-icon.d.ts.map +1 -0
  36. package/lib/types/client/minimax-code/video-command.d.ts +53 -59
  37. package/lib/types/client/minimax-code/video-command.d.ts.map +1 -1
  38. package/lib/types/client/minimax-code/video-contract.d.ts +36 -0
  39. package/lib/types/client/minimax-code/video-contract.d.ts.map +1 -1
  40. package/lib/types/client/minimax-code/video-media-dropzone.d.ts +57 -0
  41. package/lib/types/client/minimax-code/video-media-dropzone.d.ts.map +1 -0
  42. package/lib/types/client/minimax-code/video-media-input.d.ts +173 -0
  43. package/lib/types/client/minimax-code/video-media-input.d.ts.map +1 -0
  44. package/lib/types/client/minimax-code/video-presets.d.ts +67 -0
  45. package/lib/types/client/minimax-code/video-presets.d.ts.map +1 -0
  46. package/lib/types/client/minimax-code/video-slots.d.ts +58 -5
  47. package/lib/types/client/minimax-code/video-slots.d.ts.map +1 -1
  48. package/lib/types/client/minimax-code/video-workspace.d.ts +41 -0
  49. package/lib/types/client/minimax-code/video-workspace.d.ts.map +1 -0
  50. package/lib/types/client/progress-updates/markdown-lite.d.ts +19 -6
  51. package/lib/types/client/progress-updates/markdown-lite.d.ts.map +1 -1
  52. package/lib/types/client/qoder/QoderComposerQuota.d.ts +41 -0
  53. package/lib/types/client/qoder/QoderComposerQuota.d.ts.map +1 -0
  54. package/lib/types/client/qoder/QoderSection.d.ts +26 -0
  55. package/lib/types/client/qoder/QoderSection.d.ts.map +1 -0
  56. package/lib/types/client/qoder/api.d.ts +4 -0
  57. package/lib/types/client/qoder/api.d.ts.map +1 -0
  58. package/lib/types/client/qoder/locales.d.ts +310 -0
  59. package/lib/types/client/qoder/locales.d.ts.map +1 -0
  60. package/lib/types/client/qoder/styles.d.ts +16 -0
  61. package/lib/types/client/qoder/styles.d.ts.map +1 -0
  62. package/lib/types/client/qoder/useQoderSection.d.ts +97 -0
  63. package/lib/types/client/qoder/useQoderSection.d.ts.map +1 -0
  64. package/lib/types/host/antigravity/adapter.d.ts.map +1 -1
  65. package/lib/types/host/cline-pass/account-pool.d.ts +63 -0
  66. package/lib/types/host/cline-pass/account-pool.d.ts.map +1 -0
  67. package/lib/types/host/cline-pass/adapter.d.ts +49 -0
  68. package/lib/types/host/cline-pass/adapter.d.ts.map +1 -0
  69. package/lib/types/host/cline-pass/catalog.d.ts +49 -0
  70. package/lib/types/host/cline-pass/catalog.d.ts.map +1 -0
  71. package/lib/types/host/cline-pass/client.d.ts +118 -0
  72. package/lib/types/host/cline-pass/client.d.ts.map +1 -0
  73. package/lib/types/host/cline-pass/engine.d.ts +223 -0
  74. package/lib/types/host/cline-pass/engine.d.ts.map +1 -0
  75. package/lib/types/host/cline-pass/line.d.ts +55 -0
  76. package/lib/types/host/cline-pass/line.d.ts.map +1 -0
  77. package/lib/types/host/cline-pass/mapper.d.ts +112 -0
  78. package/lib/types/host/cline-pass/mapper.d.ts.map +1 -0
  79. package/lib/types/host/cline-pass/oauth.d.ts +134 -0
  80. package/lib/types/host/cline-pass/oauth.d.ts.map +1 -0
  81. package/lib/types/host/cline-pass/protocol.d.ts +186 -0
  82. package/lib/types/host/cline-pass/protocol.d.ts.map +1 -0
  83. package/lib/types/host/cline-pass/routes.d.ts +71 -0
  84. package/lib/types/host/cline-pass/routes.d.ts.map +1 -0
  85. package/lib/types/host/cline-pass/store.d.ts +97 -0
  86. package/lib/types/host/cline-pass/store.d.ts.map +1 -0
  87. package/lib/types/host/cline-pass/token-store.d.ts +168 -0
  88. package/lib/types/host/cline-pass/token-store.d.ts.map +1 -0
  89. package/lib/types/host/cline-pass/tools.d.ts +21 -0
  90. package/lib/types/host/cline-pass/tools.d.ts.map +1 -0
  91. package/lib/types/host/cline-pass/types.d.ts +168 -0
  92. package/lib/types/host/cline-pass/types.d.ts.map +1 -0
  93. package/lib/types/host/common/model-request-control.d.ts +1 -1
  94. package/lib/types/host/common/model-request-control.d.ts.map +1 -1
  95. package/lib/types/host/common/request-diagnostics.d.ts +1 -1
  96. package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
  97. package/lib/types/host/kimi-code/adapter.d.ts +3 -1
  98. package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
  99. package/lib/types/host/kimi-code/mapper.d.ts.map +1 -1
  100. package/lib/types/host/qoder/account-pool.d.ts +137 -0
  101. package/lib/types/host/qoder/account-pool.d.ts.map +1 -0
  102. package/lib/types/host/qoder/adapter.d.ts +134 -0
  103. package/lib/types/host/qoder/adapter.d.ts.map +1 -0
  104. package/lib/types/host/qoder/adopt.d.ts +146 -0
  105. package/lib/types/host/qoder/adopt.d.ts.map +1 -0
  106. package/lib/types/host/qoder/client.d.ts +189 -0
  107. package/lib/types/host/qoder/client.d.ts.map +1 -0
  108. package/lib/types/host/qoder/cosy.d.ts +173 -0
  109. package/lib/types/host/qoder/cosy.d.ts.map +1 -0
  110. package/lib/types/host/qoder/mapper.d.ts +235 -0
  111. package/lib/types/host/qoder/mapper.d.ts.map +1 -0
  112. package/lib/types/host/qoder/model-catalog.d.ts +185 -0
  113. package/lib/types/host/qoder/model-catalog.d.ts.map +1 -0
  114. package/lib/types/host/qoder/oauth.d.ts +134 -0
  115. package/lib/types/host/qoder/oauth.d.ts.map +1 -0
  116. package/lib/types/host/qoder/routes.d.ts +96 -0
  117. package/lib/types/host/qoder/routes.d.ts.map +1 -0
  118. package/lib/types/host/qoder/token-store.d.ts +231 -0
  119. package/lib/types/host/qoder/token-store.d.ts.map +1 -0
  120. package/lib/types/host/qoder/types.d.ts +257 -0
  121. package/lib/types/host/qoder/types.d.ts.map +1 -0
  122. package/lib/types/host/workbuddy/adapter.d.ts.map +1 -1
  123. package/lib/types/host/workbuddy/mapper.d.ts +1 -0
  124. package/lib/types/host/workbuddy/mapper.d.ts.map +1 -1
  125. package/lib/types/index.d.ts +17 -0
  126. package/lib/types/index.d.ts.map +1 -1
  127. package/lib/types/shared/cline-pass-contracts.d.ts +267 -0
  128. package/lib/types/shared/cline-pass-contracts.d.ts.map +1 -0
  129. package/lib/types/shared/qoder-contracts.d.ts +293 -0
  130. package/lib/types/shared/qoder-contracts.d.ts.map +1 -0
  131. package/package.json +2 -1
@@ -0,0 +1,310 @@
1
+ import type { QoderAdoptResultDto, QoderQuotaBucketKind, QoderRegion } from '../../shared/qoder-contracts.ts';
2
+ /**
3
+ * Qoder(订阅)线路的客户端命名空间。
4
+ *
5
+ * 与其余每条线路一个命名空间:卡片渲染自己的字典,不复用 hub 挂在
6
+ * 'settings.section' 上的那张座位(那张座绑定的是 ChatGPT 的键集)。
7
+ */
8
+ export declare const NS_QODER = "dsh-qoder";
9
+ export declare const zh: {
10
+ title: string;
11
+ pageDesc: string;
12
+ loading: string;
13
+ /** 折叠区的标题:标题下只留一句,其余原句收在这里(折叠不是删除)。 */
14
+ moreNotes: string;
15
+ region: string;
16
+ regionGlobal: string;
17
+ regionCn: string;
18
+ regionHint: string;
19
+ regionHintExtra: string;
20
+ authorizing: string;
21
+ loginIdle: string;
22
+ /** idle 不是「你没登录」:host 的流程状态是进程内变量,重启后回到 idle 而号池里的账号还在。 */
23
+ loginHaveAccounts: string;
24
+ loginPending: string;
25
+ loginComplete: string;
26
+ loginCompletedAt: string;
27
+ loginCompleteNoAccount: string;
28
+ loginError: string;
29
+ loginRetryable: string;
30
+ loginNotRetryable: string;
31
+ authorizeUrl: string;
32
+ openAuthorizeUrl: string;
33
+ pollEvery: string;
34
+ loginExpiresAt: string;
35
+ progress: string;
36
+ cancelLogin: string;
37
+ cancelLoginBusy: string;
38
+ adopt: string;
39
+ adopting: string;
40
+ adoptAdopted: string;
41
+ adoptNoAttempt: string;
42
+ adoptFallback: string;
43
+ adoptNoCredentialsFile: string;
44
+ adoptInvalidCredentials: string;
45
+ adoptUnsupportedShape: string;
46
+ adoptNotAQoderLogin: string;
47
+ adoptRegionUnresolved: string;
48
+ dismiss: string;
49
+ manualPasteSection: string;
50
+ manualPasteHint: string;
51
+ manualPastePlaceholder: string;
52
+ manualPasteSubmit: string;
53
+ manualPasteSubmitting: string;
54
+ manualPasteEmpty: string;
55
+ connection: string;
56
+ routeOwned: string;
57
+ routeConflict: string;
58
+ testConnection: string;
59
+ testingConnection: string;
60
+ testSuccess: string;
61
+ testLatency: string;
62
+ testFailedDetail: string;
63
+ modelsSection: string;
64
+ modelsHint: string;
65
+ modelsHintExtra: string;
66
+ modelsUnavailable: string;
67
+ refreshCatalog: string;
68
+ refreshingCatalog: string;
69
+ selectAll: string;
70
+ unselectAll: string;
71
+ modelChecklistCount: string;
72
+ enabledModelIdsSemantics: string;
73
+ defaultEffort: string;
74
+ defaultEffortHint: string;
75
+ defaultEffortHintExtra: string;
76
+ defaultEffortModel: string;
77
+ effortMinimal: string;
78
+ effortLow: string;
79
+ effortMedium: string;
80
+ effortHigh: string;
81
+ effortXHigh: string;
82
+ effortMax: string;
83
+ contextWindowSection: string;
84
+ contextWindowHint: string;
85
+ contextWindowHintExtra: string;
86
+ contextWindowReset: string;
87
+ contextWindowResetAll: string;
88
+ contextWindowNoneEnabled: string;
89
+ tokens: string;
90
+ save: string;
91
+ saving: string;
92
+ invalidCapacity: string;
93
+ quotaSection: string;
94
+ quotaDesc: string;
95
+ quotaBucketPersonal: string;
96
+ quotaBucketAddOn: string;
97
+ quotaBucketOrg: string;
98
+ quotaRemaining: string;
99
+ quotaUsed: string;
100
+ quotaTotal: string;
101
+ quotaExpiresAt: string;
102
+ quotaReadAt: string;
103
+ quotaRegion: string;
104
+ quotaRefresh: string;
105
+ quotaRefreshing: string;
106
+ quotaRefreshingNote: string;
107
+ quotaEmpty: string;
108
+ quotaSignedOut: string;
109
+ quotaErrorLabel: string;
110
+ quotaNoUnit: string;
111
+ cacheSection: string;
112
+ cacheStatScope: string;
113
+ cacheDesc: string;
114
+ cacheEmpty: string;
115
+ cacheHitRatio: string;
116
+ cacheHitRatioUnavailable: string;
117
+ cacheReadTokens: string;
118
+ cacheMissedTokens: string;
119
+ cacheWriteTokens: string;
120
+ cacheRequests: string;
121
+ composerLabel: string;
122
+ quotaWindow: string;
123
+ accountPool: string;
124
+ addAccount: string;
125
+ accountCount: string;
126
+ primaryAccount: string;
127
+ activeAccount: string;
128
+ setPrimary: string;
129
+ deleteAccount: string;
130
+ cooling: string;
131
+ cooldownLeft: string;
132
+ cooldownRemaining: string;
133
+ cooldownRemainingSeconds: string;
134
+ modelCooldown: string;
135
+ clearCooldown: string;
136
+ needsRelogin: string;
137
+ relogin: string;
138
+ rotationStrategy: string;
139
+ strategySequential: string;
140
+ strategyRoundRobin: string;
141
+ strategySticky: string;
142
+ noAccounts: string;
143
+ email: string;
144
+ expires: string;
145
+ lastUsed: string;
146
+ accountId: string;
147
+ accountQuota: string;
148
+ quotaNone: string;
149
+ quotaSnapshot: string;
150
+ quotaResets: string;
151
+ quotaExhausted: string;
152
+ quotaFactsScope: string;
153
+ };
154
+ export type QoderLocaleKey = keyof typeof zh;
155
+ export declare const en: Record<QoderLocaleKey, string>;
156
+ /** 两套字典。 */
157
+ export declare const dictionaries: {
158
+ zh: {
159
+ title: string;
160
+ pageDesc: string;
161
+ loading: string;
162
+ /** 折叠区的标题:标题下只留一句,其余原句收在这里(折叠不是删除)。 */
163
+ moreNotes: string;
164
+ region: string;
165
+ regionGlobal: string;
166
+ regionCn: string;
167
+ regionHint: string;
168
+ regionHintExtra: string;
169
+ authorizing: string;
170
+ loginIdle: string;
171
+ /** idle 不是「你没登录」:host 的流程状态是进程内变量,重启后回到 idle 而号池里的账号还在。 */
172
+ loginHaveAccounts: string;
173
+ loginPending: string;
174
+ loginComplete: string;
175
+ loginCompletedAt: string;
176
+ loginCompleteNoAccount: string;
177
+ loginError: string;
178
+ loginRetryable: string;
179
+ loginNotRetryable: string;
180
+ authorizeUrl: string;
181
+ openAuthorizeUrl: string;
182
+ pollEvery: string;
183
+ loginExpiresAt: string;
184
+ progress: string;
185
+ cancelLogin: string;
186
+ cancelLoginBusy: string;
187
+ adopt: string;
188
+ adopting: string;
189
+ adoptAdopted: string;
190
+ adoptNoAttempt: string;
191
+ adoptFallback: string;
192
+ adoptNoCredentialsFile: string;
193
+ adoptInvalidCredentials: string;
194
+ adoptUnsupportedShape: string;
195
+ adoptNotAQoderLogin: string;
196
+ adoptRegionUnresolved: string;
197
+ dismiss: string;
198
+ manualPasteSection: string;
199
+ manualPasteHint: string;
200
+ manualPastePlaceholder: string;
201
+ manualPasteSubmit: string;
202
+ manualPasteSubmitting: string;
203
+ manualPasteEmpty: string;
204
+ connection: string;
205
+ routeOwned: string;
206
+ routeConflict: string;
207
+ testConnection: string;
208
+ testingConnection: string;
209
+ testSuccess: string;
210
+ testLatency: string;
211
+ testFailedDetail: string;
212
+ modelsSection: string;
213
+ modelsHint: string;
214
+ modelsHintExtra: string;
215
+ modelsUnavailable: string;
216
+ refreshCatalog: string;
217
+ refreshingCatalog: string;
218
+ selectAll: string;
219
+ unselectAll: string;
220
+ modelChecklistCount: string;
221
+ enabledModelIdsSemantics: string;
222
+ defaultEffort: string;
223
+ defaultEffortHint: string;
224
+ defaultEffortHintExtra: string;
225
+ defaultEffortModel: string;
226
+ effortMinimal: string;
227
+ effortLow: string;
228
+ effortMedium: string;
229
+ effortHigh: string;
230
+ effortXHigh: string;
231
+ effortMax: string;
232
+ contextWindowSection: string;
233
+ contextWindowHint: string;
234
+ contextWindowHintExtra: string;
235
+ contextWindowReset: string;
236
+ contextWindowResetAll: string;
237
+ contextWindowNoneEnabled: string;
238
+ tokens: string;
239
+ save: string;
240
+ saving: string;
241
+ invalidCapacity: string;
242
+ quotaSection: string;
243
+ quotaDesc: string;
244
+ quotaBucketPersonal: string;
245
+ quotaBucketAddOn: string;
246
+ quotaBucketOrg: string;
247
+ quotaRemaining: string;
248
+ quotaUsed: string;
249
+ quotaTotal: string;
250
+ quotaExpiresAt: string;
251
+ quotaReadAt: string;
252
+ quotaRegion: string;
253
+ quotaRefresh: string;
254
+ quotaRefreshing: string;
255
+ quotaRefreshingNote: string;
256
+ quotaEmpty: string;
257
+ quotaSignedOut: string;
258
+ quotaErrorLabel: string;
259
+ quotaNoUnit: string;
260
+ cacheSection: string;
261
+ cacheStatScope: string;
262
+ cacheDesc: string;
263
+ cacheEmpty: string;
264
+ cacheHitRatio: string;
265
+ cacheHitRatioUnavailable: string;
266
+ cacheReadTokens: string;
267
+ cacheMissedTokens: string;
268
+ cacheWriteTokens: string;
269
+ cacheRequests: string;
270
+ composerLabel: string;
271
+ quotaWindow: string;
272
+ accountPool: string;
273
+ addAccount: string;
274
+ accountCount: string;
275
+ primaryAccount: string;
276
+ activeAccount: string;
277
+ setPrimary: string;
278
+ deleteAccount: string;
279
+ cooling: string;
280
+ cooldownLeft: string;
281
+ cooldownRemaining: string;
282
+ cooldownRemainingSeconds: string;
283
+ modelCooldown: string;
284
+ clearCooldown: string;
285
+ needsRelogin: string;
286
+ relogin: string;
287
+ rotationStrategy: string;
288
+ strategySequential: string;
289
+ strategyRoundRobin: string;
290
+ strategySticky: string;
291
+ noAccounts: string;
292
+ email: string;
293
+ expires: string;
294
+ lastUsed: string;
295
+ accountId: string;
296
+ accountQuota: string;
297
+ quotaNone: string;
298
+ quotaSnapshot: string;
299
+ quotaResets: string;
300
+ quotaExhausted: string;
301
+ quotaFactsScope: string;
302
+ };
303
+ en: Record<"quotaRefreshing" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "expires" | "loading" | "connection" | "testConnection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "save" | "quotaSignedOut" | "modelChecklistCount" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "cooldownRemaining" | "cooldownRemainingSeconds" | "modelCooldown" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "progress" | "pageDesc" | "modelsSection" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saving" | "cacheSection" | "cacheDesc" | "cacheEmpty" | "cacheHitRatio" | "cacheRequests" | "quotaSection" | "quotaDesc" | "quotaEmpty" | "openAuthorizeUrl" | "authorizeUrl" | "loginComplete" | "manualPasteSection" | "manualPasteHint" | "manualPastePlaceholder" | "manualPasteSubmit" | "manualPasteSubmitting" | "testingConnection" | "testSuccess" | "testLatency" | "routeOwned" | "routeConflict" | "refreshCatalog" | "refreshingCatalog" | "effortLow" | "effortMedium" | "effortHigh" | "effortXHigh" | "effortMax" | "adopt" | "region" | "regionCn" | "regionHint" | "authorizing" | "loginIdle" | "loginHaveAccounts" | "loginPending" | "loginCompletedAt" | "loginCompleteNoAccount" | "loginError" | "loginRetryable" | "loginNotRetryable" | "pollEvery" | "loginExpiresAt" | "cancelLogin" | "cancelLoginBusy" | "manualPasteEmpty" | "adopting" | "adoptAdopted" | "adoptNoAttempt" | "adoptNoCredentialsFile" | "adoptFallback" | "testFailedDetail" | "modelsUnavailable" | "dismiss" | "invalidCapacity" | "quotaRefresh" | "quotaReadAt" | "quotaRefreshingNote" | "quotaErrorLabel" | "regionGlobal" | "moreNotes" | "adoptInvalidCredentials" | "adoptUnsupportedShape" | "modelsHintExtra" | "enabledModelIdsSemantics" | "defaultEffort" | "defaultEffortHint" | "defaultEffortHintExtra" | "defaultEffortModel" | "effortMinimal" | "contextWindowHintExtra" | "quotaRegion" | "cacheStatScope" | "cacheReadTokens" | "cacheMissedTokens" | "cacheHitRatioUnavailable" | "quotaRemaining" | "regionHintExtra" | "adoptNotAQoderLogin" | "adoptRegionUnresolved" | "quotaBucketPersonal" | "quotaBucketAddOn" | "quotaBucketOrg" | "quotaTotal" | "quotaExpiresAt" | "quotaNoUnit" | "cacheWriteTokens", string>;
304
+ };
305
+ /** adopt 的失败原因(冻结契约的联合)。 */
306
+ export type AdoptReason = NonNullable<QoderAdoptResultDto['reason']>;
307
+ export declare function adoptReasonText(reason: AdoptReason, dictionary: Record<QoderLocaleKey, string>): string;
308
+ export declare function regionText(region: QoderRegion, dictionary: Record<QoderLocaleKey, string>): string;
309
+ export declare function quotaBucketText(kind: QoderQuotaBucketKind, dictionary: Record<QoderLocaleKey, string>): string;
310
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/qoder/locales.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACZ,MAAM,iCAAiC,CAAA;AAExC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,cAAc,CAAA;AAEnC,eAAO,MAAM,EAAE;;;;IAMb,uCAAuC;;;;;;;;;IAYvC,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8G5D,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,EAAE,CAAA;AAE5C,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CA6H7C,CAAA;AAED,YAAY;AACZ,eAAO,MAAM,YAAY;;;;;QA9PvB,uCAAuC;;;;;;;;;QAYvC,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkPvB,CAAA;AAEtC,4BAA4B;AAC5B,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAA;AAWpE,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,GACzC,MAAM,CAER;AAQD,wBAAgB,UAAU,CACxB,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,GACzC,MAAM,CAER;AASD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,oBAAoB,EAC1B,UAAU,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,GACzC,MAAM,CAER"}
@@ -0,0 +1,16 @@
1
+ export declare const STYLE_ID = "dsh-qoder-settings-style";
2
+ /**
3
+ * Qoder(订阅)卡片独有的样式。
4
+ *
5
+ * 共享样式一律不重复声明:模型清单(.dsh-mcl-*)由 common/model-checklist-styles.ts
6
+ * 负责,账号卡与其配额条(.dsha-account-*)由 common/styles.ts 负责,基础控件
7
+ * (.dsha-page / .dsha-group / .dsha-row / 计量条 .dsha-meter-* 等)由兄弟线路的安装器
8
+ * 负责;本卡直接用它们,不在这里再写一遍。
9
+ *
10
+ * 本文件只声明别处没有的三样:登录流程块(临时内容)、兜底入口行与 PAT 粘贴面板、
11
+ * 等宽文本与额度桶列表。
12
+ *
13
+ * 前缀统一 .dshq-(Qoder),不与任何兄弟线路的选择器相撞。
14
+ */
15
+ export declare function installQoderStyles(): void;
16
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/client/qoder/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,6BAA6B,CAAA;AAElD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAoCzC"}
@@ -0,0 +1,97 @@
1
+ import type { AccountRotationStrategy } from '../../shared/account-pool-contracts.ts';
2
+ import { type QoderAccountSummaryDto, type QoderAdoptResultDto, type QoderConnectionDto, type QoderLoginFlowStatus, type QoderModelOption, type QoderReasoningEffort, type QoderRegion, type QoderStatusDto } from '../../shared/qoder-contracts.ts';
3
+ import type { AccountPoolLabels } from '../common/AccountPoolSection.tsx';
4
+ import { zh } from './locales.ts';
5
+ /** 卡片渲染的键。与兄弟卡片一样用自己的字典。 */
6
+ export type Translate = (key: keyof typeof zh) => string;
7
+ /** 本卡片的字典;身份稳定,依赖它的 effect 才不会每次渲染重建。 */
8
+ export declare const fallbackTranslate: Translate;
9
+ /**
10
+ * 本线路的缓存统计(本机自报,token 维度)。
11
+ *
12
+ * 三个数都是 token,没有金额:Qoder 订阅没有公开的 token 单价(计划 §5),
13
+ * 拿编的费率算出「省了 N 元」是撒谎。
14
+ */
15
+ export interface QoderCacheStats {
16
+ cacheReadTokens: number;
17
+ missedInputTokens: number;
18
+ cacheWriteTokens: number;
19
+ /** 这些数字覆盖了几次请求;没有它就不知道样本有多大。 */
20
+ requests: number | null;
21
+ }
22
+ /**
23
+ * 从一份 status 里取缓存统计;取不到返回 null。
24
+ *
25
+ * 返回 null 而不是零值对象,是因为「上游没报」与「报了个 0」在卡片上必须长得不一样:
26
+ * 前者显示占位符,后者显示真实的 0%。
27
+ */
28
+ export declare function readCacheStats(status: QoderStatusDto | null): QoderCacheStats | null;
29
+ /**
30
+ * 缓存命中率 = 缓存读入 /(缓存读入 + 未命中输入)。
31
+ *
32
+ * 分母为 0 时返回 **null**,卡片据此画占位符:把「没有样本」写成 0% 是谎报。
33
+ */
34
+ export declare function cacheHitRatio(stats: QoderCacheStats | null): number | null;
35
+ export interface QoderSectionProps {
36
+ onModelChange?: () => void;
37
+ }
38
+ /** 账号卡片上的一个动作。 */
39
+ export type QoderAccountAction = 'set-primary' | 'delete' | 'clear-cooldown' | 'relogin';
40
+ /** 视图可以消费的全部内容,按「会变的事实 / 从答案派生的 / 能触发的」分组。 */
41
+ export interface QoderSectionView {
42
+ state: {
43
+ status: QoderStatusDto | null;
44
+ loading: boolean;
45
+ busy: string | null;
46
+ error: string | null;
47
+ connection: QoderConnectionDto | null;
48
+ adoptResult: QoderAdoptResultDto | null;
49
+ /** 手工粘贴的 PAT;提交后立即清空,只在这一行的受控输入里存在。 */
50
+ pasteValue: string;
51
+ /** 下一次浏览器登录 / PAT 粘贴按哪个区域发起。 */
52
+ region: QoderRegion;
53
+ /** 手工粘贴兜底是否展开(没有进行中的流程时默认收起)。 */
54
+ pasteOpen: boolean;
55
+ contextDrafts: Record<string, string>;
56
+ savingModel: string | null;
57
+ };
58
+ derived: {
59
+ accounts: QoderAccountSummaryDto[];
60
+ models: QoderModelOption[];
61
+ /** 上下文窗口编辑器的行:只有勾选了的模型才有可覆盖的窗口。 */
62
+ contextModels: QoderModelOption[];
63
+ overrideCount: number;
64
+ login: QoderLoginFlowStatus | null;
65
+ quota: QoderStatusDto['quota'];
66
+ authenticated: boolean;
67
+ poolLabels: AccountPoolLabels;
68
+ /** 缓存统计;host 未下发时为 null(卡片显示占位而不是 0%)。 */
69
+ cache: QoderCacheStats | null;
70
+ /** 缓存命中率;没有样本时为 null。 */
71
+ cacheHitRatio: number | null;
72
+ };
73
+ actions: {
74
+ setRegion(region: QoderRegion): void;
75
+ login(region: QoderRegion): Promise<void>;
76
+ cancelLogin(): Promise<void>;
77
+ submitPaste(): Promise<void>;
78
+ setPasteValue(value: string): void;
79
+ togglePaste(): void;
80
+ adopt(): Promise<void>;
81
+ clearAdoptResult(): void;
82
+ accountAction(action: QoderAccountAction, accountId: string): Promise<void>;
83
+ setStrategy(strategy: AccountRotationStrategy): Promise<void>;
84
+ toggleModel(modelId: string, enabled: boolean): void;
85
+ setAllModels(enabled: boolean): void;
86
+ saveContextWindow(modelId: string): Promise<void>;
87
+ resetContextWindow(modelId: string): Promise<void>;
88
+ resetAllContextWindows(): Promise<void>;
89
+ updateContextDraft(modelId: string, draft: string): void;
90
+ setDefaultReasoningEffort(effort: QoderReasoningEffort | null): Promise<void>;
91
+ refreshQuota(): Promise<void>;
92
+ refreshCatalog(): Promise<void>;
93
+ testConnection(): Promise<void>;
94
+ };
95
+ }
96
+ export declare function useQoderSection({ onModelChange }?: QoderSectionProps): QoderSectionView;
97
+ //# sourceMappingURL=useQoderSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useQoderSection.d.ts","sourceRoot":"","sources":["../../../../src/client/qoder/useQoderSection.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAA;AACrF,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAKzE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAKjC,4BAA4B;AAC5B,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,OAAO,EAAE,KAAK,MAAM,CAAA;AAExD,yCAAyC;AACzC,eAAO,MAAM,iBAAiB,EAAE,SAA4B,CAAA;AAqE5D;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,MAAM,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;IACxB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAOD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,eAAe,GAAG,IAAI,CAYpF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAK1E;AAED,M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sBAA4B,EACjC,aAAa,yBAA+B,EAC5C,WAAW,CAAC,EAAE,0BAA0B,YAAA,EACxC,OAAO,GAAE;QAAE,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;QAAC,WAAW,CAAC,EAAE,qBAAqB,CAAA;KAAO,EAC9F,WAAW,CAAC,EAAE,gBAAgB;IAMhC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe;IAI/C,mBAAmB,IAAI,SAAS;IAIhC,mBAAmB,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS;IAInE,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;;;;;;;;;;IAIzE,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;IAsB/D,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAyCpG,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,eAAe,GAAG,aAAa,CAAC,WAAW,CAAC;YA0BpD,aAAa;CAiR7B"}
@@ -0,0 +1,63 @@
1
+ import { AccountPoolCore, type PoolAccountShape, type PoolData } from '../common/account-pool.ts';
2
+ import type { CredentialStore } from '../token-store.ts';
3
+ import { FileCredentialStore, type ClinePassCredentials } from './token-store.ts';
4
+ import type { AccountPoolStatusDto, AccountRotationStrategy } from '../../shared/account-pool-contracts.ts';
5
+ import type { ClinePassAccountSummaryDto } from '../../shared/cline-pass-contracts.ts';
6
+ /** One pooled Cline Pass key: the bearer key plus the display facts the card renders. */
7
+ export interface ClinePassPoolAccount extends PoolAccountShape<ClinePassCredentials> {
8
+ /** Model id this account last served, for the card's detail line. */
9
+ lastModelId?: string;
10
+ }
11
+ export type ClinePassPoolStatusDto = AccountPoolStatusDto;
12
+ /** Encrypted pool file this line owns. */
13
+ export declare function clinePassPoolPath(): string;
14
+ /** The credential name the standalone plugin reads when no key was pasted. */
15
+ export declare const CLINE_PASS_API_KEY_ENV = "CLINE_PASS_API_KEY";
16
+ /**
17
+ * Stable identity of one key.
18
+ *
19
+ * Cline hands the user a bare key and nothing else — no account id, no email —
20
+ * so the key's own digest is the only identity available. It is never written
21
+ * anywhere: it exists to tell two pasted keys apart inside the pool document,
22
+ * and it is not a credential and cannot be used as one.
23
+ */
24
+ export declare function clinePassAccountKey(credentials: ClinePassCredentials): string;
25
+ /** Validate and normalize one whole pool document. */
26
+ export declare function parseClinePassPoolData(value: unknown): PoolData<ClinePassPoolAccount>;
27
+ export interface ClinePassAccountPoolOptions {
28
+ /** Pre-pool credential file the pool mirrors its primary account into. */
29
+ store?: FileCredentialStore;
30
+ /** Test seam; production builds the platform backend from the pool path. */
31
+ backend?: CredentialStore<PoolData<ClinePassPoolAccount>>;
32
+ maxAccounts?: number;
33
+ /** The line's current chat base URL, used when an account names none. */
34
+ baseURL?: () => string;
35
+ }
36
+ /**
37
+ * Cline Pass's account pool.
38
+ *
39
+ * Two credential kinds share one pool: an OAuth session (WorkOS device sign-in,
40
+ * rotating refresh token, expiry) and a legacy static API key. The kernel's
41
+ * refresh hooks are wired for the first and are no-ops for the second.
42
+ */
43
+ export declare class ClinePassAccountPool extends AccountPoolCore<ClinePassCredentials, ClinePassPoolAccount, ClinePassAccountSummaryDto> {
44
+ private readonly store;
45
+ constructor(options?: ClinePassAccountPoolOptions);
46
+ /**
47
+ * Pick the key for the next request, skipping accounts already tried.
48
+ *
49
+ * The credential carries its own base-URL override, so the account and the key
50
+ * are returned together.
51
+ */
52
+ getEffectiveCredential(excludeIds?: ReadonlySet<string>, fetchFn?: typeof fetch): Promise<{
53
+ account: ClinePassPoolAccount;
54
+ credentials: ClinePassCredentials;
55
+ }>;
56
+ /** The pre-pool credential file this pool mirrors its primary account into. */
57
+ mirrorStore(): FileCredentialStore;
58
+ /** The rotation strategy as the settings card renders it. */
59
+ strategy(): Promise<AccountRotationStrategy>;
60
+ /** Remember which model an account last served, best-effort. */
61
+ recordModel(accountId: string, model: string): Promise<void>;
62
+ }
63
+ //# sourceMappingURL=account-pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-pool.d.ts","sourceRoot":"","sources":["../../../../src/host/cline-pass/account-pool.ts"],"names":[],"mappings":"AAGA,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,EAMnB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AAGzB,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAA;AAEtF,yFAAyF;AACzF,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB,CAAC,oBAAoB,CAAC;IAClF,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,CAAA;AAEzD,0CAA0C;AAC1C,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,8EAA8E;AAC9E,eAAO,MAAM,sBAAsB,uBAAuB,CAAA;AAQ1D;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,CAE7E;AASD,sDAAsD;AACtD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAkCrF;AAED,MAAM,WAAW,2BAA2B;IAC1C,0EAA0E;IAC1E,KAAK,CAAC,EAAE,mBAAmB,CAAA;IAC3B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAA;IACzD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,MAAM,CAAA;CACvB;AAED;;;;;;GAMG;AACH,qBAAa,oBAAqB,SAAQ,eAAe,CACvD,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,CAC3B;IACC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;gBAE/B,OAAO,GAAE,2BAAgC;IAoGrD;;;;;OAKG;IACG,sBAAsB,CAC1B,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAChC,OAAO,GAAE,OAAO,KAAa,GAC5B,OAAO,CAAC;QAAE,OAAO,EAAE,oBAAoB,CAAC;QAAC,WAAW,EAAE,oBAAoB,CAAA;KAAE,CAAC;IAIhF,+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,49 @@
1
+ /**
2
+ * The Cline Pass LLM adapter: an OpenAI-compatible `chat/completions` stream
3
+ * with upstream pinning, per-account rotation, and pre-first-token failover.
4
+ *
5
+ * Transport and mapping live in `client.ts` / `mapper.ts`; account selection and
6
+ * probing live in `engine.ts`. This module owns the request loop: which account,
7
+ * which channel, and when an attempt is abandoned.
8
+ *
9
+ * @module dsh-chatgpt-subscription/cline-pass-adapter
10
+ */
11
+ import { LlmAdapter, type GenerateOptions as HarnessGenerateOptions, type LlmModelInfo, type LlmProviderInfo, type LlmResolvedModelInfo, type PreparedAdapterCall, type ResolvedRetryPolicy, type StreamChunk } from '@deepseek-ai/dsh-llm';
12
+ import type { ClinePassEngine } from './engine.ts';
13
+ import type { ClinePassStore } from './store.ts';
14
+ import type { ClinePassModelSettingsStore } from './token-store.ts';
15
+ import type { ClinePassAccountPool } from './account-pool.ts';
16
+ import { type AttachmentImageReader } from '../common/request-images.ts';
17
+ export interface ClinePassAdapterOptions {
18
+ /** Durable attachment service, for request images. */
19
+ attachments?: AttachmentImageReader;
20
+ }
21
+ export declare class ClinePassAdapter extends LlmAdapter {
22
+ private readonly engine;
23
+ private readonly store;
24
+ private readonly modelSettings;
25
+ private readonly accountPool;
26
+ private readonly options;
27
+ private readonly gate;
28
+ constructor(engine: ClinePassEngine, store: ClinePassStore, modelSettings: ClinePassModelSettingsStore, accountPool: ClinePassAccountPool, options?: ClinePassAdapterOptions);
29
+ providerInfo(provider: string): LlmProviderInfo;
30
+ providerRetryPolicy(): ResolvedRetryPolicy;
31
+ imageRequestPricing(): undefined;
32
+ private settings;
33
+ /**
34
+ * The ids the route advertises: the shipped table, models a live scan adopted,
35
+ * and (when asked) the gateway's own catalog — narrowed by the user's selection
36
+ * and hidden list.
37
+ */
38
+ private availableModelIds;
39
+ /** One model's resolved descriptor, from the shipped catalog plus live data. */
40
+ private modelInfo;
41
+ listModels(provider?: string): Promise<readonly LlmModelInfo[]>;
42
+ resolveModel(provider: string, modelId: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
43
+ prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;
44
+ stream(options: HarnessGenerateOptions): AsyncIterable<StreamChunk>;
45
+ private requestStream;
46
+ /** Park an account that refused a request, for the reason it refused. */
47
+ private standDown;
48
+ }
49
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/host/cline-pass/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,UAAU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,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;YAW3D,aAAa;IA6P5B,yEAAyE;YAC3D,SAAS;CAOxB"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Merge the shipped catalog, the live scan and the user's per-model override into
3
+ * 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.
8
+ *
9
+ * @module dsh-chatgpt-subscription/cline-pass-catalog
10
+ */
11
+ import { type ClinePassDiscoveredModel, type ClinePassModelInfo } from './types.ts';
12
+ import type { ClinePassCatalogModel } from './token-store.ts';
13
+ /**
14
+ * The output budget to advertise for one model.
15
+ *
16
+ * `defaultMaxTokens` is what a request asks for, not what the model can emit, and
17
+ * the harness spends it twice: it fills a request's `max_tokens` from it and
18
+ * reserves the same number as completion room before deciding to compact. So the
19
+ * published output ceiling clamps the configured budget rather than becoming it,
20
+ * and a budget is never taken past half the window.
21
+ */
22
+ export declare function resolveOutputBudget(budget: number | undefined, ceiling: number | undefined, contextWindow: number): number | undefined;
23
+ /**
24
+ * Resolve the metadata one model is advertised with.
25
+ *
26
+ * Precedence per field: the user's override, then the shipped table, then what
27
+ * the last official scan published, then the entry the last gateway catalog sync
28
+ * stored, then the route-wide fallback.
29
+ *
30
+ * The live scan sits below the shipped table because the shipped entry is
31
+ * curated: a community catalog reports extra modalities and underscore-free
32
+ * spellings the seam or the provider's label does not want. It exists to cover
33
+ * what the table cannot know — a model published after this release.
34
+ */
35
+ export declare function resolveModelInfo(model: string, options: {
36
+ /** Display name for the bare id. */
37
+ displayName: string;
38
+ /** Entries persisted by the last catalog sync. */
39
+ synced: readonly ClinePassCatalogModel[];
40
+ /** What the last official scan published for this id. */
41
+ discovered?: ClinePassDiscoveredModel;
42
+ /** Stored context-window override. */
43
+ contextWindowOverride?: number;
44
+ /** Route-wide fallback window. */
45
+ defaultContextWindow?: number;
46
+ /** Route-wide output budget. */
47
+ defaultMaxTokens?: number;
48
+ }): ClinePassModelInfo;
49
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/cline-pass/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAKL,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACxB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAsB7D;;;;;;;;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;AAOD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;IACP,oCAAoC;IACpC,WAAW,EAAE,MAAM,CAAA;IACnB,kDAAkD;IAClD,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACxC,yDAAyD;IACzD,UAAU,CAAC,EAAE,wBAAwB,CAAA;IACrC,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,kBAAkB,CAsCpB"}