@eddyskywalker/dsh-chatgpt-subscription 0.36.1 → 0.37.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 (54) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +23 -3
  3. package/lib/client.js +340 -47
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +3088 -54
  6. package/lib/types/client/common/ComposerQuotaBadge.d.ts +7 -0
  7. package/lib/types/client/common/ComposerQuotaBadge.d.ts.map +1 -1
  8. package/lib/types/client/locales-ru/opendesign.d.ts.map +1 -1
  9. package/lib/types/client/locales-ru/progress-updates.d.ts.map +1 -1
  10. package/lib/types/client/locales.d.ts +4 -4
  11. package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts +6 -0
  12. package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts.map +1 -1
  13. package/lib/types/client/opendesign/OpenDesignSection.d.ts.map +1 -1
  14. package/lib/types/client/opendesign/locales.d.ts +54 -0
  15. package/lib/types/client/opendesign/locales.d.ts.map +1 -1
  16. package/lib/types/client/opendesign/styles.d.ts +5 -0
  17. package/lib/types/client/opendesign/styles.d.ts.map +1 -1
  18. package/lib/types/client/progress-updates/locales.d.ts +17 -2
  19. package/lib/types/client/progress-updates/locales.d.ts.map +1 -1
  20. package/lib/types/client/progress-updates/settings-binding.d.ts +13 -3
  21. package/lib/types/client/progress-updates/settings-binding.d.ts.map +1 -1
  22. package/lib/types/client/progress-updates/settings-section.d.ts +5 -5
  23. package/lib/types/client/progress-updates/settings-section.d.ts.map +1 -1
  24. package/lib/types/client/progress-updates/styles.d.ts.map +1 -1
  25. package/lib/types/host/claude/routes.d.ts.map +1 -1
  26. package/lib/types/host/opendesign/client.d.ts +103 -0
  27. package/lib/types/host/opendesign/client.d.ts.map +1 -1
  28. package/lib/types/host/opendesign/routes.d.ts.map +1 -1
  29. package/lib/types/host/opendesign/types.d.ts +31 -0
  30. package/lib/types/host/opendesign/types.d.ts.map +1 -1
  31. package/lib/types/host/progress-updates/index.d.ts +5 -0
  32. package/lib/types/host/progress-updates/index.d.ts.map +1 -1
  33. package/lib/types/host/progress-updates/prompt.d.ts +37 -3
  34. package/lib/types/host/progress-updates/prompt.d.ts.map +1 -1
  35. package/lib/types/host/progress-updates/tool.d.ts.map +1 -1
  36. package/lib/types/host/proxy-manager.d.ts +63 -1
  37. package/lib/types/host/proxy-manager.d.ts.map +1 -1
  38. package/lib/types/host/widget-board/line-contracts.d.ts +192 -0
  39. package/lib/types/host/widget-board/line-contracts.d.ts.map +1 -0
  40. package/lib/types/host/widget-board/line-quota.d.ts +284 -0
  41. package/lib/types/host/widget-board/line-quota.d.ts.map +1 -0
  42. package/lib/types/host/widget-board/line-registry.d.ts +402 -0
  43. package/lib/types/host/widget-board/line-registry.d.ts.map +1 -0
  44. package/lib/types/host/widget-board/provider.d.ts +140 -0
  45. package/lib/types/host/widget-board/provider.d.ts.map +1 -0
  46. package/lib/types/index.d.ts +10 -0
  47. package/lib/types/index.d.ts.map +1 -1
  48. package/lib/types/shared/opendesign-contracts.d.ts +47 -0
  49. package/lib/types/shared/opendesign-contracts.d.ts.map +1 -1
  50. package/package.json +2 -1
  51. package/widgets/line-flip/index.html +58 -0
  52. package/widgets/line-flip/main.js +1102 -0
  53. package/widgets/line-flip/style.css +729 -0
  54. package/widgets/line-flip/widget.json +555 -0
@@ -0,0 +1,555 @@
1
+ {
2
+ "id": "line-flip",
3
+ "title": {
4
+ "zh": "线路额度",
5
+ "en": "Line quota"
6
+ },
7
+ "description": {
8
+ "zh": "一张自己会翻面的线路卡:正面是这条订阅线路的额度窗口、进度条与重置倒计时,背面是它的账号池、当前账号与三档轮换策略。",
9
+ "en": "A self-flipping line card: the front shows this subscription line's quota windows, meters and reset countdowns; the back shows its account pool, the active account and the three rotation strategies."
10
+ },
11
+ "author": "dsh-chatgpt-subscription",
12
+ "version": "0.1.0",
13
+ "sizes": [
14
+ "s",
15
+ "m",
16
+ "l"
17
+ ],
18
+ "source": "dsh-chatgpt-subscription:line-card",
19
+ "capabilities": [
20
+ "dsh-chatgpt-subscription:line-refresh",
21
+ "dsh-chatgpt-subscription:line-account-switch",
22
+ "dsh-chatgpt-subscription:line-account-strategy"
23
+ ],
24
+ "refresh": {
25
+ "mode": "interval",
26
+ "everyMs": 60000
27
+ },
28
+ "minBox": {
29
+ "w": 1,
30
+ "h": 14
31
+ },
32
+ "defaultBox": {
33
+ "w": 2,
34
+ "h": 20
35
+ },
36
+ "props": {
37
+ "type": "object",
38
+ "required": [
39
+ "line"
40
+ ],
41
+ "properties": {
42
+ "line": {
43
+ "type": "string",
44
+ "enum": [
45
+ "codex",
46
+ "kimi-code",
47
+ "minimax-code",
48
+ "antigravity",
49
+ "command-code",
50
+ "claude",
51
+ "glm-coding-plan",
52
+ "step-code",
53
+ "qoder",
54
+ "cline-pass",
55
+ "opendesign"
56
+ ]
57
+ }
58
+ }
59
+ },
60
+ "data": {
61
+ "type": "object",
62
+ "properties": {
63
+ "line": {
64
+ "type": "string"
65
+ },
66
+ "label": {
67
+ "type": [
68
+ "string",
69
+ "null"
70
+ ]
71
+ },
72
+ "signedIn": {
73
+ "type": "boolean"
74
+ },
75
+ "installed": {
76
+ "type": "boolean"
77
+ },
78
+ "planLabel": {
79
+ "type": [
80
+ "string",
81
+ "null"
82
+ ]
83
+ },
84
+ "accountLabel": {
85
+ "type": [
86
+ "string",
87
+ "null"
88
+ ]
89
+ },
90
+ "accounts": {
91
+ "type": "array",
92
+ "items": {
93
+ "type": "object",
94
+ "properties": {
95
+ "id": {
96
+ "type": "string"
97
+ },
98
+ "label": {
99
+ "type": [
100
+ "string",
101
+ "null"
102
+ ]
103
+ },
104
+ "email": {
105
+ "type": [
106
+ "string",
107
+ "null"
108
+ ]
109
+ },
110
+ "primary": {
111
+ "type": "boolean"
112
+ },
113
+ "plan": {
114
+ "type": [
115
+ "string",
116
+ "null"
117
+ ]
118
+ },
119
+ "cooldownUntil": {
120
+ "type": [
121
+ "number",
122
+ "null"
123
+ ]
124
+ },
125
+ "authStatus": {
126
+ "type": [
127
+ "string",
128
+ "null"
129
+ ]
130
+ },
131
+ "usedPercent": {
132
+ "type": [
133
+ "number",
134
+ "null"
135
+ ]
136
+ },
137
+ "resetsAt": {
138
+ "type": [
139
+ "number",
140
+ "null"
141
+ ]
142
+ },
143
+ "windows": {
144
+ "type": "array",
145
+ "description": "Every window this account's own reading stated, shortest first. Absent on a line with no per-account read; [] means the read was made and measured nothing.",
146
+ "items": {
147
+ "type": "object",
148
+ "properties": {
149
+ "label": {
150
+ "type": [
151
+ "string",
152
+ "null"
153
+ ]
154
+ },
155
+ "usedPercent": {
156
+ "type": [
157
+ "number",
158
+ "null"
159
+ ]
160
+ },
161
+ "windowMinutes": {
162
+ "type": [
163
+ "number",
164
+ "null"
165
+ ]
166
+ },
167
+ "resetsAt": {
168
+ "type": [
169
+ "number",
170
+ "null"
171
+ ]
172
+ }
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ },
179
+ "activeAccountId": {
180
+ "type": [
181
+ "string",
182
+ "null"
183
+ ]
184
+ },
185
+ "strategy": {
186
+ "type": "string"
187
+ },
188
+ "quota": {
189
+ "anyOf": [
190
+ {
191
+ "type": "object",
192
+ "properties": {
193
+ "windows": {
194
+ "type": "array",
195
+ "items": {
196
+ "type": "object",
197
+ "properties": {
198
+ "label": {
199
+ "type": [
200
+ "string",
201
+ "null"
202
+ ]
203
+ },
204
+ "usedPercent": {
205
+ "type": [
206
+ "number",
207
+ "null"
208
+ ]
209
+ },
210
+ "windowMinutes": {
211
+ "type": [
212
+ "number",
213
+ "null"
214
+ ]
215
+ },
216
+ "resetsAt": {
217
+ "type": [
218
+ "number",
219
+ "null"
220
+ ]
221
+ }
222
+ }
223
+ }
224
+ },
225
+ "credits": {
226
+ "anyOf": [
227
+ {
228
+ "type": "object",
229
+ "properties": {
230
+ "unlimited": {
231
+ "type": "boolean"
232
+ },
233
+ "balance": {
234
+ "type": [
235
+ "string",
236
+ "number",
237
+ "null"
238
+ ]
239
+ }
240
+ }
241
+ },
242
+ {
243
+ "type": "null"
244
+ }
245
+ ]
246
+ },
247
+ "resetCredits": {
248
+ "anyOf": [
249
+ {
250
+ "type": "object",
251
+ "properties": {
252
+ "available": {
253
+ "type": [
254
+ "number",
255
+ "null"
256
+ ]
257
+ },
258
+ "expiresAt": {
259
+ "type": [
260
+ "number",
261
+ "null"
262
+ ]
263
+ }
264
+ }
265
+ },
266
+ {
267
+ "type": "null"
268
+ }
269
+ ]
270
+ },
271
+ "fetchedAt": {
272
+ "type": [
273
+ "number",
274
+ "null"
275
+ ]
276
+ },
277
+ "refreshing": {
278
+ "type": "boolean"
279
+ },
280
+ "error": {
281
+ "type": [
282
+ "string",
283
+ "null"
284
+ ]
285
+ }
286
+ }
287
+ },
288
+ {
289
+ "type": "null"
290
+ }
291
+ ]
292
+ },
293
+ "error": {
294
+ "type": [
295
+ "string",
296
+ "null"
297
+ ]
298
+ }
299
+ }
300
+ },
301
+ "text": {
302
+ "title": {
303
+ "zh": "线路额度",
304
+ "en": "Line quota"
305
+ },
306
+ "props.line.label": {
307
+ "zh": "线路",
308
+ "en": "Line"
309
+ },
310
+ "props.line.hint": {
311
+ "zh": "这张卡显示哪条订阅线路:codex=ChatGPT · kimi-code=Kimi 会员 · minimax-code=MiniMax Code · antigravity=Antigravity · command-code=Command Code · claude=Claude · glm-coding-plan=GLM 编程套餐 · step-code=Step Code · qoder=Qoder · cline-pass=Cline Pass · opendesign=OpenDesign",
312
+ "en": "Which subscription line this card shows: codex=ChatGPT · kimi-code=Kimi · minimax-code=MiniMax Code · antigravity=Antigravity · command-code=Command Code · claude=Claude · glm-coding-plan=GLM coding plan · step-code=Step Code · qoder=Qoder · cline-pass=Cline Pass · opendesign=OpenDesign"
313
+ },
314
+ "line.codex": {
315
+ "zh": "ChatGPT",
316
+ "en": "ChatGPT"
317
+ },
318
+ "line.kimi-code": {
319
+ "zh": "Kimi Code",
320
+ "en": "Kimi Code"
321
+ },
322
+ "line.minimax-code": {
323
+ "zh": "MiniMax Code",
324
+ "en": "MiniMax Code"
325
+ },
326
+ "line.antigravity": {
327
+ "zh": "Antigravity",
328
+ "en": "Antigravity"
329
+ },
330
+ "line.command-code": {
331
+ "zh": "Command Code",
332
+ "en": "Command Code"
333
+ },
334
+ "line.claude": {
335
+ "zh": "Claude",
336
+ "en": "Claude"
337
+ },
338
+ "line.glm-coding-plan": {
339
+ "zh": "GLM 编程套餐",
340
+ "en": "GLM coding plan"
341
+ },
342
+ "line.step-code": {
343
+ "zh": "Step Code",
344
+ "en": "Step Code"
345
+ },
346
+ "line.qoder": {
347
+ "zh": "Qoder",
348
+ "en": "Qoder"
349
+ },
350
+ "line.cline-pass": {
351
+ "zh": "Cline Pass",
352
+ "en": "Cline Pass"
353
+ },
354
+ "line.opendesign": {
355
+ "zh": "OpenDesign",
356
+ "en": "OpenDesign"
357
+ },
358
+ "refresh": {
359
+ "zh": "刷新额度",
360
+ "en": "Refresh quota"
361
+ },
362
+ "flipToBack": {
363
+ "zh": "翻到背面看账号",
364
+ "en": "Show the accounts"
365
+ },
366
+ "flipToFront": {
367
+ "zh": "翻回正面看额度",
368
+ "en": "Show the quota"
369
+ },
370
+ "loading": {
371
+ "zh": "正在读取额度…",
372
+ "en": "Reading quota…"
373
+ },
374
+ "signedOut": {
375
+ "zh": "未登录",
376
+ "en": "Not signed in"
377
+ },
378
+ "notInstalled": {
379
+ "zh": "这条线路的插件还没装",
380
+ "en": "This line's plugin is not installed"
381
+ },
382
+ "noQuota": {
383
+ "zh": "这条线路还没有额度记录,点刷新或去设置页打开一次",
384
+ "en": "This line has no quota recorded yet — refresh, or open it once on the settings page"
385
+ },
386
+ "empty": {
387
+ "zh": "这条线路没有额度窗口",
388
+ "en": "This line has no quota windows"
389
+ },
390
+ "refreshing": {
391
+ "zh": "正在刷新额度…",
392
+ "en": "Refreshing quota…"
393
+ },
394
+ "failed": {
395
+ "zh": "读不到额度",
396
+ "en": "Quota unavailable"
397
+ },
398
+ "accountsFailed": {
399
+ "zh": "读不到账号",
400
+ "en": "Accounts unavailable"
401
+ },
402
+ "updatedAt": {
403
+ "zh": "更新于 {time}",
404
+ "en": "Updated {time}"
405
+ },
406
+ "quota": {
407
+ "zh": "额度",
408
+ "en": "Quota"
409
+ },
410
+ "accountQuota": {
411
+ "zh": "{name} 的额度",
412
+ "en": "Quota for {name}"
413
+ },
414
+ "minutes": {
415
+ "zh": "{n} 分钟",
416
+ "en": "{n} min"
417
+ },
418
+ "hours": {
419
+ "zh": "{n} 小时",
420
+ "en": "{n} h"
421
+ },
422
+ "days": {
423
+ "zh": "{n} 天",
424
+ "en": "{n} d"
425
+ },
426
+ "resetMinutes": {
427
+ "zh": "{n} 分钟后重置",
428
+ "en": "Resets in {n} min"
429
+ },
430
+ "resetHours": {
431
+ "zh": "{a} 小时 {b} 分后重置",
432
+ "en": "Resets in {a} h {b} min"
433
+ },
434
+ "resetHoursExact": {
435
+ "zh": "{a} 小时后重置",
436
+ "en": "Resets in {a} h"
437
+ },
438
+ "resetDays": {
439
+ "zh": "{a} 天 {b} 小时后重置",
440
+ "en": "Resets in {a} d {b} h"
441
+ },
442
+ "resetDaysExact": {
443
+ "zh": "{a} 天后重置",
444
+ "en": "Resets in {a} d"
445
+ },
446
+ "resetting": {
447
+ "zh": "即将重置",
448
+ "en": "Resetting soon"
449
+ },
450
+ "credits": {
451
+ "zh": "赠额",
452
+ "en": "Credits"
453
+ },
454
+ "balanceAvailable": {
455
+ "zh": "可用余额 {v}",
456
+ "en": "Available {v}"
457
+ },
458
+ "creditsOnlyHint": {
459
+ "zh": "这条线路按额度计量,没有百分比窗口",
460
+ "en": "Metered by credits, no % windows"
461
+ },
462
+ "unlimited": {
463
+ "zh": "无限",
464
+ "en": "Unlimited"
465
+ },
466
+ "resetsAvailable": {
467
+ "zh": "{n} 次可用重置",
468
+ "en": "{n} resets available"
469
+ },
470
+ "resetsOne": {
471
+ "zh": "1 次可用重置",
472
+ "en": "1 reset available"
473
+ },
474
+ "resetsExpires": {
475
+ "zh": "{date} 到期",
476
+ "en": "expires {date}"
477
+ },
478
+ "noAccount": {
479
+ "zh": "还没有当前账号",
480
+ "en": "No current account yet"
481
+ },
482
+ "metaAccountOne": {
483
+ "zh": "1 个账号",
484
+ "en": "1 account"
485
+ },
486
+ "metaAccounts": {
487
+ "zh": "{n} 个账号",
488
+ "en": "{n} accounts"
489
+ },
490
+ "rotation": {
491
+ "zh": "轮换策略",
492
+ "en": "Rotation strategy"
493
+ },
494
+ "strategySequential": {
495
+ "zh": "顺序使用",
496
+ "en": "one at a time"
497
+ },
498
+ "strategyRoundRobin": {
499
+ "zh": "轮流使用",
500
+ "en": "take turns"
501
+ },
502
+ "strategySticky": {
503
+ "zh": "固定当前",
504
+ "en": "stay put"
505
+ },
506
+ "quotaUnread": {
507
+ "zh": "额度未读",
508
+ "en": "quota unread"
509
+ },
510
+ "emptyAccounts": {
511
+ "zh": "账号池是空的",
512
+ "en": "The account pool is empty"
513
+ },
514
+ "emptyAccountsHint": {
515
+ "zh": "添加账号后可以在这里切换",
516
+ "en": "Add an account to switch between them here"
517
+ },
518
+ "switching": {
519
+ "zh": "切换中…",
520
+ "en": "Switching…"
521
+ },
522
+ "current": {
523
+ "zh": "当前",
524
+ "en": "Current"
525
+ },
526
+ "switchTo": {
527
+ "zh": "切换到 {name}",
528
+ "en": "Switch to {name}"
529
+ },
530
+ "srPrimary": {
531
+ "zh": "主账号",
532
+ "en": "primary account"
533
+ },
534
+ "srCooling": {
535
+ "zh": "冷却中",
536
+ "en": "cooling down"
537
+ },
538
+ "srExpired": {
539
+ "zh": "登录已失效",
540
+ "en": "sign-in expired"
541
+ },
542
+ "srInvalid": {
543
+ "zh": "登录无效",
544
+ "en": "sign-in invalid"
545
+ },
546
+ "srBlocked": {
547
+ "zh": "登录需要处理",
548
+ "en": "sign-in needs attention"
549
+ },
550
+ "srReady": {
551
+ "zh": "可用",
552
+ "en": "available"
553
+ }
554
+ }
555
+ }