@eddyskywalker/dsh-chatgpt-subscription 0.17.1 → 0.19.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 (68) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +103 -1
  3. package/lib/client.js +1543 -269
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +9112 -2459
  6. package/lib/types/client/glm-coding-plan/GlmCodingPlanComposerQuota.d.ts +27 -0
  7. package/lib/types/client/glm-coding-plan/GlmCodingPlanComposerQuota.d.ts.map +1 -0
  8. package/lib/types/client/glm-coding-plan/GlmCodingPlanSection.d.ts +22 -0
  9. package/lib/types/client/glm-coding-plan/GlmCodingPlanSection.d.ts.map +1 -0
  10. package/lib/types/client/glm-coding-plan/api.d.ts +4 -0
  11. package/lib/types/client/glm-coding-plan/api.d.ts.map +1 -0
  12. package/lib/types/client/glm-coding-plan/locales.d.ts +412 -0
  13. package/lib/types/client/glm-coding-plan/locales.d.ts.map +1 -0
  14. package/lib/types/client/glm-coding-plan/styles.d.ts +15 -0
  15. package/lib/types/client/glm-coding-plan/styles.d.ts.map +1 -0
  16. package/lib/types/client/glm-coding-plan/useGlmCodingPlanSection.d.ts +65 -0
  17. package/lib/types/client/glm-coding-plan/useGlmCodingPlanSection.d.ts.map +1 -0
  18. package/lib/types/client/hub/brand-icons.d.ts +7 -5
  19. package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
  20. package/lib/types/client/hub/providers.d.ts.map +1 -1
  21. package/lib/types/client/index.d.ts +2 -0
  22. package/lib/types/client/index.d.ts.map +1 -1
  23. package/lib/types/client/kimi-code/locales.d.ts +2 -2
  24. package/lib/types/client/minimax-code/locales.d.ts +2 -2
  25. package/lib/types/host/antigravity/oauth.d.ts +11 -1
  26. package/lib/types/host/antigravity/oauth.d.ts.map +1 -1
  27. package/lib/types/host/common/model-request-control.d.ts +1 -1
  28. package/lib/types/host/common/model-request-control.d.ts.map +1 -1
  29. package/lib/types/host/common/request-diagnostics.d.ts +1 -1
  30. package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
  31. package/lib/types/host/glm-coding-plan/account-pool.d.ts +152 -0
  32. package/lib/types/host/glm-coding-plan/account-pool.d.ts.map +1 -0
  33. package/lib/types/host/glm-coding-plan/adapter.d.ts +169 -0
  34. package/lib/types/host/glm-coding-plan/adapter.d.ts.map +1 -0
  35. package/lib/types/host/glm-coding-plan/adopt.d.ts +354 -0
  36. package/lib/types/host/glm-coding-plan/adopt.d.ts.map +1 -0
  37. package/lib/types/host/glm-coding-plan/biz-token-cache.d.ts +99 -0
  38. package/lib/types/host/glm-coding-plan/biz-token-cache.d.ts.map +1 -0
  39. package/lib/types/host/glm-coding-plan/client.d.ts +218 -0
  40. package/lib/types/host/glm-coding-plan/client.d.ts.map +1 -0
  41. package/lib/types/host/glm-coding-plan/exchange.d.ts +223 -0
  42. package/lib/types/host/glm-coding-plan/exchange.d.ts.map +1 -0
  43. package/lib/types/host/glm-coding-plan/mapper-anthropic.d.ts +308 -0
  44. package/lib/types/host/glm-coding-plan/mapper-anthropic.d.ts.map +1 -0
  45. package/lib/types/host/glm-coding-plan/mapper-openai.d.ts +213 -0
  46. package/lib/types/host/glm-coding-plan/mapper-openai.d.ts.map +1 -0
  47. package/lib/types/host/glm-coding-plan/model-catalog.d.ts +232 -0
  48. package/lib/types/host/glm-coding-plan/model-catalog.d.ts.map +1 -0
  49. package/lib/types/host/glm-coding-plan/oauth.d.ts +211 -0
  50. package/lib/types/host/glm-coding-plan/oauth.d.ts.map +1 -0
  51. package/lib/types/host/glm-coding-plan/routes.d.ts +93 -0
  52. package/lib/types/host/glm-coding-plan/routes.d.ts.map +1 -0
  53. package/lib/types/host/glm-coding-plan/signing.d.ts +323 -0
  54. package/lib/types/host/glm-coding-plan/signing.d.ts.map +1 -0
  55. package/lib/types/host/glm-coding-plan/token-store.d.ts +202 -0
  56. package/lib/types/host/glm-coding-plan/token-store.d.ts.map +1 -0
  57. package/lib/types/host/glm-coding-plan/types.d.ts +413 -0
  58. package/lib/types/host/glm-coding-plan/types.d.ts.map +1 -0
  59. package/lib/types/host/kimi-code/routes.d.ts +10 -0
  60. package/lib/types/host/kimi-code/routes.d.ts.map +1 -1
  61. package/lib/types/host/minimax-code/adapter.d.ts +11 -0
  62. package/lib/types/host/minimax-code/adapter.d.ts.map +1 -1
  63. package/lib/types/host/minimax-code/client.d.ts.map +1 -1
  64. package/lib/types/index.d.ts +9 -0
  65. package/lib/types/index.d.ts.map +1 -1
  66. package/lib/types/shared/glm-coding-plan-contracts.d.ts +315 -0
  67. package/lib/types/shared/glm-coding-plan-contracts.d.ts.map +1 -0
  68. package/package.json +1 -1
@@ -0,0 +1,27 @@
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 GlmStatusDto } from '../../shared/glm-coding-plan-contracts.ts';
4
+ import { type ComposerQuotaFacts } from '../common/ComposerQuotaBadge.tsx';
5
+ import type { SnapshotStore } from '../store.ts';
6
+ import { NS_GLM_CODING_PLAN, type GlmCodingPlanLocaleKey } from './locales.ts';
7
+ type Props = PropsRuntime<'conversation.input.right'> & PropsLocale<typeof NS_GLM_CODING_PLAN> & {
8
+ directory: SnapshotStore<ModelDirectoryState>;
9
+ loadModelDirectory: () => void;
10
+ };
11
+ /**
12
+ * 胶囊显示「最紧的那个窗口」的剩余百分比。
13
+ *
14
+ * 三个窗口(5 小时 / 1 周 / 1 月)互相独立地重置,用户当下真正被卡住的是**已用比例
15
+ * 最高**的那一个:另外两个可能还剩一大半。所以这里不平均、不取最小剩余,而是取最大
16
+ * 已用;已用相等时取更短的窗口——重置更早的那个才是当下的瓶颈。
17
+ *
18
+ * 窗口名不硬编码:键映射成窗口长度后交给共享的 quotaWindowLabel 本地化
19
+ * (5 小时 / 1 周 / 1 月 / 5 hours / 1 week / 1 month)。
20
+ *
21
+ * 没有快照、没有窗口、或全部窗口都没有百分比时返回 null,即**不渲染胶囊**:
22
+ * 契约允许 quota 为 null,装一个占位数字比不显示更像坏了。
23
+ */
24
+ export declare function selectBadgeFacts(status: GlmStatusDto | null, lookup?: (key: GlmCodingPlanLocaleKey) => string): ComposerQuotaFacts | null;
25
+ export declare function GlmCodingPlanComposerQuota({ directory, loadModelDirectory, t }: Props): React.JSX.Element | null;
26
+ export {};
27
+ //# sourceMappingURL=GlmCodingPlanComposerQuota.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlmCodingPlanComposerQuota.d.ts","sourceRoot":"","sources":["../../../../src/client/glm-coding-plan/GlmCodingPlanComposerQuota.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,EAEL,KAAK,YAAY,EAClB,MAAM,2CAA2C,CAAA;AAClD,OAAO,EAAkC,KAAK,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAG1G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,EAAE,kBAAkB,EAA4B,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAExG,KAAK,KAAK,GAAG,YAAY,CAAC,0BAA0B,CAAC,GAAG,WAAW,CAAC,OAAO,kBAAkB,CAAC,GAAG;IAC/F,SAAS,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAA;IAC7C,kBAAkB,EAAE,MAAM,IAAI,CAAA;CAC/B,CAAA;AAKD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,YAAY,GAAG,IAAI,EAC3B,MAAM,GAAE,CAAC,GAAG,EAAE,sBAAsB,KAAK,MAAyB,GACjE,kBAAkB,GAAG,IAAI,CAwB3B;AAED,wBAAgB,0BAA0B,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAYhH"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * GLM(ZCode 账号)设置卡片。
3
+ *
4
+ * 纯渲染:状态、副作用与请求都在 'useGlmCodingPlanSection.ts',两者之间只通过
5
+ * 一个具名结构交接(WorkBuddySection / MinimaxCodeSection 同款分工)。
6
+ *
7
+ * 三条需求方的 UI 硬要求由现成共享组件承担,本文件没有新建任何 UI 组件:
8
+ *
9
+ * 1. 进入入口(hub 卡片:图标 + 名称 + 「N 个账号 / M/N 个模型可用」+ 开关 + chevron)
10
+ * —— hub/providers.tsx 的 descriptor + hub/HubOverview.tsx,点进来就是本卡片;
11
+ * 2. 配额显示额度(标签 + 进度条 + 百分比 + 「N 天后重置」)
12
+ * —— AccountPoolSection 的 showQuota + common/account-quota.tsx,
13
+ * 窗口名由共享组件按 windowDurationMins 本地化(5 小时 / 1 周 / 1 月),
14
+ * 所以本页的配额区只画「没有账号卡进度条可画」的那些事实;
15
+ * 3. 模型选择(品牌图标 + 模型名 + 一句话描述 + 行尾勾)
16
+ * —— common/ModelChecklist.tsx,hint 直接用契约里的 GlmModelOption.hint
17
+ * (host 由随包目录生成,客户端不从模型名推断任何能力)。
18
+ */
19
+ import React from 'react';
20
+ import { type GlmCodingPlanSectionProps } from './useGlmCodingPlanSection.ts';
21
+ export declare function GlmCodingPlanSection({ onModelChange }?: GlmCodingPlanSectionProps): React.JSX.Element;
22
+ //# sourceMappingURL=GlmCodingPlanSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlmCodingPlanSection.d.ts","sourceRoot":"","sources":["../../../../src/client/glm-coding-plan/GlmCodingPlanSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,EAA2B,KAAK,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AAOtG,wBAAgB,oBAAoB,CAAC,EAAE,aAAa,EAAE,GAAE,yBAA8B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2YzG"}
@@ -0,0 +1,4 @@
1
+ export declare const get: <T>(path: string) => Promise<T>;
2
+ export declare const post: <T>(path: string, body?: object) => Promise<T>;
3
+ export declare function messageOf(cause: unknown): string;
4
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/client/glm-coding-plan/api.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,GAAG,iCAAU,CAAA;AAC1B,eAAO,MAAM,IAAI,gDAAW,CAAA;AAE5B,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEhD"}
@@ -0,0 +1,412 @@
1
+ import type { GlmAdoptResultDto, GlmAllowanceKind, GlmQuotaWindowKey } from '../../shared/glm-coding-plan-contracts.ts';
2
+ /**
3
+ * GLM(ZCode 账号)线路的客户端命名空间。
4
+ *
5
+ * 与其余每条线路一个命名空间:卡片渲染自己的字典,不复用 hub 挂在
6
+ * `settings.section` 上的那张座位(那张座绑定的是 ChatGPT 的键集,
7
+ * 键名重合的会被渲染成 ChatGPT 的措辞,不重合的会把键名本身打印出来)。
8
+ */
9
+ export declare const NS_GLM_CODING_PLAN = "dsh-glm-coding-plan";
10
+ export declare const zh: {
11
+ readonly title: "GLM(ZCode 账号)";
12
+ readonly pageDesc: "用 ZCode 账号授权接入 GLM Coding Plan(国区 bigmodel.cn / 国际区 z.ai),管理账号池、套餐额度与模型勾选。两个区域的凭据各自独立,池内可以同时存在两区账号。";
13
+ readonly loading: "加载中...";
14
+ readonly region: "区域";
15
+ readonly regionCn: "国区(bigmodel.cn)";
16
+ readonly regionIntl: "国际区(z.ai)";
17
+ readonly regionHint: "「导入本机登录态」与「手工粘贴授权码」按这里选定的区域发起;上方两个登录按钮各自固定一个区域。区域是凭据的属性,一区铸造的 Key 会被另一区拒绝,所以两区账号互不串用。";
18
+ readonly addCnAccount: "添加国区账号";
19
+ readonly addIntlAccount: "添加国际区账号";
20
+ readonly authorizing: "授权中…";
21
+ readonly loginSection: "登录授权";
22
+ readonly loginIdle: "尚未开始登录。";
23
+ readonly loginPending: "等待浏览器完成登录与授权,然后本卡片会自动继续。";
24
+ readonly loginComplete: "登录完成,账号已加入号池。";
25
+ readonly loginCompletedAt: "完成时间:{time}";
26
+ readonly loginCompleteNoAccount: "这次登录完成了,但号池里已经没有这个账号(可能已被删除)。";
27
+ readonly loginError: "登录失败。";
28
+ readonly loginRetryable: "这是可重试的失败,可以直接重新发起一次登录。";
29
+ readonly loginNotRetryable: "这次失败不会自己好:请检查区域是否选对、网络是否可达,然后重新发起登录。";
30
+ readonly authorizeUrl: "授权页面";
31
+ readonly openAuthorizeUrl: "打开授权页面";
32
+ readonly pollEvery: "每 {seconds} 秒查询一次登录结果。";
33
+ readonly loginExpiresAt: "本次授权最长可用到 {time},过期后需要重新发起。";
34
+ readonly progress: "进度";
35
+ readonly restartLogin: "重新发起登录";
36
+ readonly cancelLogin: "取消登录";
37
+ readonly cancelLoginBusy: "取消中…";
38
+ readonly manualPasteSection: "手工粘贴授权码";
39
+ readonly manualPasteHint: "浏览器回调被拦截、或授权页拿不到 code 时,把 ZCode 回调里的授权码粘贴到下面即可完成兑换——这条兜底通道是回调走不通时唯一能完成登录的地方,所以它一直在,只是没有进行中的流程时默认收起,流程一开始(进行中或失败)就自动展开。";
40
+ readonly manualPastePlaceholder: "粘贴授权码(code=… 或整段回调地址)";
41
+ readonly manualPasteSubmit: "提交授权码";
42
+ readonly manualPasteSubmitting: "兑换中…";
43
+ readonly manualPasteEmpty: "请先粘贴授权码。";
44
+ readonly adopt: "导入本机 ZCode 登录态";
45
+ readonly adopting: "导入中…";
46
+ readonly adoptAdopted: "已导入本机 ZCode 的登录态({region}),无需重新登录。";
47
+ readonly adoptNoAttempt: "本机没有可导入的 ZCode 登录态。";
48
+ readonly adoptNoCredentialsFile: "没有找到 ZCode 的凭据文件(默认 ~/.zcode/v2/credentials.json)。装过 ZCode 客户端并登录过一次才会有这个文件。";
49
+ readonly adoptSecretUnavailable: "找到了凭据文件,但本机设置了 ZCODE_CREDENTIAL_SECRET,本插件无法推导解密密钥,因此读不出里面的登录态。";
50
+ readonly adoptDecryptFailed: "凭据解密失败,文件可能已被改动或损坏。";
51
+ readonly adoptTokenExpired: "ZCode 的登录态已经过期,回 ZCode 客户端重新登录后再导入。";
52
+ readonly adoptExchangeFailed: "兑换 Coding Plan Key 失败:这个账号可能没有 Coding Plan 套餐,或没有建 Key 的权限。";
53
+ readonly adoptNotAZcodeLogin: "凭据文件里没有本线路认识的 ZCode 登录态(该文件也可能属于别的工具)。";
54
+ readonly adoptFallback: "导入只是省一次登录的快捷路径,失败不影响使用——请改用上方的浏览器登录。";
55
+ readonly adoptedBadge: "导入的登录态";
56
+ readonly connection: "连接";
57
+ readonly testConnection: "测试连接";
58
+ readonly testingConnection: "测试中...";
59
+ readonly testSuccess: "连通正常";
60
+ readonly testSuccessAccount: "连通正常(账号 {account})";
61
+ readonly testSuccessModel: "连通正常({model})";
62
+ readonly testFailed: "连接测试失败";
63
+ readonly testFailedDetail: "连接测试失败:{detail}";
64
+ readonly testLatency: "往返 {ms} 毫秒";
65
+ readonly routeOwned: "本插件正在服务该模型路由。";
66
+ readonly routeConflict: "模型路由已被其他 Provider 占用:{detail}。请在 DSH 设置中移除重复的 Provider 配置后重新加载。";
67
+ readonly modelsSection: "模型";
68
+ readonly modelsHint: "勾选后模型才会出现在对话页的模型选择列表中;目录与能力说明来自本线路的随包目录,**不从模型名推断**(glm-5.3 与 glm-5.3-flash 的图片输入、glm-5.2 与 glm-5.3 的思考档位都不同)。目录按账号所在区域过滤,跨区调用会被上游拒绝。";
69
+ readonly modelsUnavailable: "暂无可显示的模型。";
70
+ readonly refreshCatalog: "刷新模型目录";
71
+ readonly refreshingCatalog: "刷新中...";
72
+ readonly dismiss: "知道了";
73
+ readonly selectAll: "全选";
74
+ readonly unselectAll: "全不选";
75
+ readonly modelChecklistCount: "{count}/{total}";
76
+ readonly contextWindowSection: "模型上下文窗口";
77
+ readonly contextWindowHint: "默认值来自随包目录(每个模型的真实上下文上限);可覆盖为自定义容量,该值用于 DSH 的压缩与溢出判断,可输入 1M、512K、200K 等容量。";
78
+ readonly contextWindowNoneEnabled: "还没有勾选任何模型。在上方勾选后,这里会出现该模型的上下文窗口设置。";
79
+ readonly contextWindowReset: "恢复默认";
80
+ readonly contextWindowResetAll: "全部恢复默认";
81
+ readonly tokens: "tokens";
82
+ readonly save: "保存";
83
+ readonly saving: "保存中...";
84
+ readonly saved: "已保存";
85
+ readonly invalidCapacity: "容量格式无效:{value}";
86
+ readonly quotaSection: "用量与配额";
87
+ readonly quotaDesc: "数据来自 Coding Plan 的配额接口(该接口用裸 Key 鉴权,不加 Bearer)。";
88
+ readonly quotaRefresh: "刷新用量";
89
+ readonly quotaRefreshing: "刷新中...";
90
+ readonly quotaSignedOut: "未登录,先在上方完成登录授权。";
91
+ readonly quotaEmpty: "暂无配额数据,点击「刷新用量」重试。";
92
+ readonly quotaPlan: "套餐";
93
+ readonly quotaPlanLevel: "档位";
94
+ readonly quotaRenews: "续费时间";
95
+ readonly quotaReadAt: "读取时间";
96
+ readonly quotaSources: "数据源";
97
+ readonly quotaWindowNames: "窗口名按窗口长度本地化(5 小时 / 1 周 / 1 月),不在本页硬编码;每个账号自己的进度条画在它的账号卡片里。";
98
+ readonly quotaRefreshingNote: "正在后台刷新配额,下方是上一次读到的数字。";
99
+ readonly quotaErrorLabel: "配额读取失败";
100
+ readonly quotaAllowance: "额度类型";
101
+ readonly quotaAllowancePlan: "付费套餐";
102
+ readonly quotaAllowanceFreeTrial: "免费体验额度";
103
+ readonly quotaAllowanceUnknown: "未判定";
104
+ readonly quotaAllowanceHint: "登录时探活认定的额度来源。「免费体验额度」按官方文档指新用户注册即自动获得、首次使用起 5 天内每天 800 万 token 的体验额度;额度耗尽时由上游返回 429,本线路不预判。";
105
+ readonly accountPool: string;
106
+ readonly addAccount: string;
107
+ readonly accountCount: string;
108
+ readonly primaryAccount: string;
109
+ readonly activeAccount: string;
110
+ readonly setPrimary: string;
111
+ readonly deleteAccount: string;
112
+ readonly cooling: string;
113
+ readonly cooldownLeft: string;
114
+ readonly clearCooldown: string;
115
+ readonly needsRelogin: string;
116
+ readonly relogin: string;
117
+ readonly rotationStrategy: string;
118
+ readonly strategySequential: string;
119
+ readonly strategyRoundRobin: string;
120
+ readonly strategySticky: string;
121
+ readonly noAccounts: string;
122
+ readonly email: string;
123
+ readonly expires: string;
124
+ readonly lastUsed: string;
125
+ readonly accountId: string;
126
+ readonly accountQuota: string;
127
+ readonly quotaNone: string;
128
+ readonly quotaSnapshot: string;
129
+ readonly quotaResets: string;
130
+ readonly quotaExhausted: string;
131
+ readonly quotaWindow: string;
132
+ readonly quotaUsed: string;
133
+ readonly quotaFactsScope: string;
134
+ readonly composerLabel: string;
135
+ };
136
+ export declare const en: Record<keyof typeof zh, string>;
137
+ export declare const dictionaries: {
138
+ zh: {
139
+ readonly title: "GLM(ZCode 账号)";
140
+ readonly pageDesc: "用 ZCode 账号授权接入 GLM Coding Plan(国区 bigmodel.cn / 国际区 z.ai),管理账号池、套餐额度与模型勾选。两个区域的凭据各自独立,池内可以同时存在两区账号。";
141
+ readonly loading: "加载中...";
142
+ readonly region: "区域";
143
+ readonly regionCn: "国区(bigmodel.cn)";
144
+ readonly regionIntl: "国际区(z.ai)";
145
+ readonly regionHint: "「导入本机登录态」与「手工粘贴授权码」按这里选定的区域发起;上方两个登录按钮各自固定一个区域。区域是凭据的属性,一区铸造的 Key 会被另一区拒绝,所以两区账号互不串用。";
146
+ readonly addCnAccount: "添加国区账号";
147
+ readonly addIntlAccount: "添加国际区账号";
148
+ readonly authorizing: "授权中…";
149
+ readonly loginSection: "登录授权";
150
+ readonly loginIdle: "尚未开始登录。";
151
+ readonly loginPending: "等待浏览器完成登录与授权,然后本卡片会自动继续。";
152
+ readonly loginComplete: "登录完成,账号已加入号池。";
153
+ readonly loginCompletedAt: "完成时间:{time}";
154
+ readonly loginCompleteNoAccount: "这次登录完成了,但号池里已经没有这个账号(可能已被删除)。";
155
+ readonly loginError: "登录失败。";
156
+ readonly loginRetryable: "这是可重试的失败,可以直接重新发起一次登录。";
157
+ readonly loginNotRetryable: "这次失败不会自己好:请检查区域是否选对、网络是否可达,然后重新发起登录。";
158
+ readonly authorizeUrl: "授权页面";
159
+ readonly openAuthorizeUrl: "打开授权页面";
160
+ readonly pollEvery: "每 {seconds} 秒查询一次登录结果。";
161
+ readonly loginExpiresAt: "本次授权最长可用到 {time},过期后需要重新发起。";
162
+ readonly progress: "进度";
163
+ readonly restartLogin: "重新发起登录";
164
+ readonly cancelLogin: "取消登录";
165
+ readonly cancelLoginBusy: "取消中…";
166
+ readonly manualPasteSection: "手工粘贴授权码";
167
+ readonly manualPasteHint: "浏览器回调被拦截、或授权页拿不到 code 时,把 ZCode 回调里的授权码粘贴到下面即可完成兑换——这条兜底通道是回调走不通时唯一能完成登录的地方,所以它一直在,只是没有进行中的流程时默认收起,流程一开始(进行中或失败)就自动展开。";
168
+ readonly manualPastePlaceholder: "粘贴授权码(code=… 或整段回调地址)";
169
+ readonly manualPasteSubmit: "提交授权码";
170
+ readonly manualPasteSubmitting: "兑换中…";
171
+ readonly manualPasteEmpty: "请先粘贴授权码。";
172
+ readonly adopt: "导入本机 ZCode 登录态";
173
+ readonly adopting: "导入中…";
174
+ readonly adoptAdopted: "已导入本机 ZCode 的登录态({region}),无需重新登录。";
175
+ readonly adoptNoAttempt: "本机没有可导入的 ZCode 登录态。";
176
+ readonly adoptNoCredentialsFile: "没有找到 ZCode 的凭据文件(默认 ~/.zcode/v2/credentials.json)。装过 ZCode 客户端并登录过一次才会有这个文件。";
177
+ readonly adoptSecretUnavailable: "找到了凭据文件,但本机设置了 ZCODE_CREDENTIAL_SECRET,本插件无法推导解密密钥,因此读不出里面的登录态。";
178
+ readonly adoptDecryptFailed: "凭据解密失败,文件可能已被改动或损坏。";
179
+ readonly adoptTokenExpired: "ZCode 的登录态已经过期,回 ZCode 客户端重新登录后再导入。";
180
+ readonly adoptExchangeFailed: "兑换 Coding Plan Key 失败:这个账号可能没有 Coding Plan 套餐,或没有建 Key 的权限。";
181
+ readonly adoptNotAZcodeLogin: "凭据文件里没有本线路认识的 ZCode 登录态(该文件也可能属于别的工具)。";
182
+ readonly adoptFallback: "导入只是省一次登录的快捷路径,失败不影响使用——请改用上方的浏览器登录。";
183
+ readonly adoptedBadge: "导入的登录态";
184
+ readonly connection: "连接";
185
+ readonly testConnection: "测试连接";
186
+ readonly testingConnection: "测试中...";
187
+ readonly testSuccess: "连通正常";
188
+ readonly testSuccessAccount: "连通正常(账号 {account})";
189
+ readonly testSuccessModel: "连通正常({model})";
190
+ readonly testFailed: "连接测试失败";
191
+ readonly testFailedDetail: "连接测试失败:{detail}";
192
+ readonly testLatency: "往返 {ms} 毫秒";
193
+ readonly routeOwned: "本插件正在服务该模型路由。";
194
+ readonly routeConflict: "模型路由已被其他 Provider 占用:{detail}。请在 DSH 设置中移除重复的 Provider 配置后重新加载。";
195
+ readonly modelsSection: "模型";
196
+ readonly modelsHint: "勾选后模型才会出现在对话页的模型选择列表中;目录与能力说明来自本线路的随包目录,**不从模型名推断**(glm-5.3 与 glm-5.3-flash 的图片输入、glm-5.2 与 glm-5.3 的思考档位都不同)。目录按账号所在区域过滤,跨区调用会被上游拒绝。";
197
+ readonly modelsUnavailable: "暂无可显示的模型。";
198
+ readonly refreshCatalog: "刷新模型目录";
199
+ readonly refreshingCatalog: "刷新中...";
200
+ readonly dismiss: "知道了";
201
+ readonly selectAll: "全选";
202
+ readonly unselectAll: "全不选";
203
+ readonly modelChecklistCount: "{count}/{total}";
204
+ readonly contextWindowSection: "模型上下文窗口";
205
+ readonly contextWindowHint: "默认值来自随包目录(每个模型的真实上下文上限);可覆盖为自定义容量,该值用于 DSH 的压缩与溢出判断,可输入 1M、512K、200K 等容量。";
206
+ readonly contextWindowNoneEnabled: "还没有勾选任何模型。在上方勾选后,这里会出现该模型的上下文窗口设置。";
207
+ readonly contextWindowReset: "恢复默认";
208
+ readonly contextWindowResetAll: "全部恢复默认";
209
+ readonly tokens: "tokens";
210
+ readonly save: "保存";
211
+ readonly saving: "保存中...";
212
+ readonly saved: "已保存";
213
+ readonly invalidCapacity: "容量格式无效:{value}";
214
+ readonly quotaSection: "用量与配额";
215
+ readonly quotaDesc: "数据来自 Coding Plan 的配额接口(该接口用裸 Key 鉴权,不加 Bearer)。";
216
+ readonly quotaRefresh: "刷新用量";
217
+ readonly quotaRefreshing: "刷新中...";
218
+ readonly quotaSignedOut: "未登录,先在上方完成登录授权。";
219
+ readonly quotaEmpty: "暂无配额数据,点击「刷新用量」重试。";
220
+ readonly quotaPlan: "套餐";
221
+ readonly quotaPlanLevel: "档位";
222
+ readonly quotaRenews: "续费时间";
223
+ readonly quotaReadAt: "读取时间";
224
+ readonly quotaSources: "数据源";
225
+ readonly quotaWindowNames: "窗口名按窗口长度本地化(5 小时 / 1 周 / 1 月),不在本页硬编码;每个账号自己的进度条画在它的账号卡片里。";
226
+ readonly quotaRefreshingNote: "正在后台刷新配额,下方是上一次读到的数字。";
227
+ readonly quotaErrorLabel: "配额读取失败";
228
+ readonly quotaAllowance: "额度类型";
229
+ readonly quotaAllowancePlan: "付费套餐";
230
+ readonly quotaAllowanceFreeTrial: "免费体验额度";
231
+ readonly quotaAllowanceUnknown: "未判定";
232
+ readonly quotaAllowanceHint: "登录时探活认定的额度来源。「免费体验额度」按官方文档指新用户注册即自动获得、首次使用起 5 天内每天 800 万 token 的体验额度;额度耗尽时由上游返回 429,本线路不预判。";
233
+ readonly accountPool: string;
234
+ readonly addAccount: string;
235
+ readonly accountCount: string;
236
+ readonly primaryAccount: string;
237
+ readonly activeAccount: string;
238
+ readonly setPrimary: string;
239
+ readonly deleteAccount: string;
240
+ readonly cooling: string;
241
+ readonly cooldownLeft: string;
242
+ readonly clearCooldown: string;
243
+ readonly needsRelogin: string;
244
+ readonly relogin: string;
245
+ readonly rotationStrategy: string;
246
+ readonly strategySequential: string;
247
+ readonly strategyRoundRobin: string;
248
+ readonly strategySticky: string;
249
+ readonly noAccounts: string;
250
+ readonly email: string;
251
+ readonly expires: string;
252
+ readonly lastUsed: string;
253
+ readonly accountId: string;
254
+ readonly accountQuota: string;
255
+ readonly quotaNone: string;
256
+ readonly quotaSnapshot: string;
257
+ readonly quotaResets: string;
258
+ readonly quotaExhausted: string;
259
+ readonly quotaWindow: string;
260
+ readonly quotaUsed: string;
261
+ readonly quotaFactsScope: string;
262
+ readonly composerLabel: string;
263
+ };
264
+ 'zh-CN': {
265
+ readonly title: "GLM(ZCode 账号)";
266
+ readonly pageDesc: "用 ZCode 账号授权接入 GLM Coding Plan(国区 bigmodel.cn / 国际区 z.ai),管理账号池、套餐额度与模型勾选。两个区域的凭据各自独立,池内可以同时存在两区账号。";
267
+ readonly loading: "加载中...";
268
+ readonly region: "区域";
269
+ readonly regionCn: "国区(bigmodel.cn)";
270
+ readonly regionIntl: "国际区(z.ai)";
271
+ readonly regionHint: "「导入本机登录态」与「手工粘贴授权码」按这里选定的区域发起;上方两个登录按钮各自固定一个区域。区域是凭据的属性,一区铸造的 Key 会被另一区拒绝,所以两区账号互不串用。";
272
+ readonly addCnAccount: "添加国区账号";
273
+ readonly addIntlAccount: "添加国际区账号";
274
+ readonly authorizing: "授权中…";
275
+ readonly loginSection: "登录授权";
276
+ readonly loginIdle: "尚未开始登录。";
277
+ readonly loginPending: "等待浏览器完成登录与授权,然后本卡片会自动继续。";
278
+ readonly loginComplete: "登录完成,账号已加入号池。";
279
+ readonly loginCompletedAt: "完成时间:{time}";
280
+ readonly loginCompleteNoAccount: "这次登录完成了,但号池里已经没有这个账号(可能已被删除)。";
281
+ readonly loginError: "登录失败。";
282
+ readonly loginRetryable: "这是可重试的失败,可以直接重新发起一次登录。";
283
+ readonly loginNotRetryable: "这次失败不会自己好:请检查区域是否选对、网络是否可达,然后重新发起登录。";
284
+ readonly authorizeUrl: "授权页面";
285
+ readonly openAuthorizeUrl: "打开授权页面";
286
+ readonly pollEvery: "每 {seconds} 秒查询一次登录结果。";
287
+ readonly loginExpiresAt: "本次授权最长可用到 {time},过期后需要重新发起。";
288
+ readonly progress: "进度";
289
+ readonly restartLogin: "重新发起登录";
290
+ readonly cancelLogin: "取消登录";
291
+ readonly cancelLoginBusy: "取消中…";
292
+ readonly manualPasteSection: "手工粘贴授权码";
293
+ readonly manualPasteHint: "浏览器回调被拦截、或授权页拿不到 code 时,把 ZCode 回调里的授权码粘贴到下面即可完成兑换——这条兜底通道是回调走不通时唯一能完成登录的地方,所以它一直在,只是没有进行中的流程时默认收起,流程一开始(进行中或失败)就自动展开。";
294
+ readonly manualPastePlaceholder: "粘贴授权码(code=… 或整段回调地址)";
295
+ readonly manualPasteSubmit: "提交授权码";
296
+ readonly manualPasteSubmitting: "兑换中…";
297
+ readonly manualPasteEmpty: "请先粘贴授权码。";
298
+ readonly adopt: "导入本机 ZCode 登录态";
299
+ readonly adopting: "导入中…";
300
+ readonly adoptAdopted: "已导入本机 ZCode 的登录态({region}),无需重新登录。";
301
+ readonly adoptNoAttempt: "本机没有可导入的 ZCode 登录态。";
302
+ readonly adoptNoCredentialsFile: "没有找到 ZCode 的凭据文件(默认 ~/.zcode/v2/credentials.json)。装过 ZCode 客户端并登录过一次才会有这个文件。";
303
+ readonly adoptSecretUnavailable: "找到了凭据文件,但本机设置了 ZCODE_CREDENTIAL_SECRET,本插件无法推导解密密钥,因此读不出里面的登录态。";
304
+ readonly adoptDecryptFailed: "凭据解密失败,文件可能已被改动或损坏。";
305
+ readonly adoptTokenExpired: "ZCode 的登录态已经过期,回 ZCode 客户端重新登录后再导入。";
306
+ readonly adoptExchangeFailed: "兑换 Coding Plan Key 失败:这个账号可能没有 Coding Plan 套餐,或没有建 Key 的权限。";
307
+ readonly adoptNotAZcodeLogin: "凭据文件里没有本线路认识的 ZCode 登录态(该文件也可能属于别的工具)。";
308
+ readonly adoptFallback: "导入只是省一次登录的快捷路径,失败不影响使用——请改用上方的浏览器登录。";
309
+ readonly adoptedBadge: "导入的登录态";
310
+ readonly connection: "连接";
311
+ readonly testConnection: "测试连接";
312
+ readonly testingConnection: "测试中...";
313
+ readonly testSuccess: "连通正常";
314
+ readonly testSuccessAccount: "连通正常(账号 {account})";
315
+ readonly testSuccessModel: "连通正常({model})";
316
+ readonly testFailed: "连接测试失败";
317
+ readonly testFailedDetail: "连接测试失败:{detail}";
318
+ readonly testLatency: "往返 {ms} 毫秒";
319
+ readonly routeOwned: "本插件正在服务该模型路由。";
320
+ readonly routeConflict: "模型路由已被其他 Provider 占用:{detail}。请在 DSH 设置中移除重复的 Provider 配置后重新加载。";
321
+ readonly modelsSection: "模型";
322
+ readonly modelsHint: "勾选后模型才会出现在对话页的模型选择列表中;目录与能力说明来自本线路的随包目录,**不从模型名推断**(glm-5.3 与 glm-5.3-flash 的图片输入、glm-5.2 与 glm-5.3 的思考档位都不同)。目录按账号所在区域过滤,跨区调用会被上游拒绝。";
323
+ readonly modelsUnavailable: "暂无可显示的模型。";
324
+ readonly refreshCatalog: "刷新模型目录";
325
+ readonly refreshingCatalog: "刷新中...";
326
+ readonly dismiss: "知道了";
327
+ readonly selectAll: "全选";
328
+ readonly unselectAll: "全不选";
329
+ readonly modelChecklistCount: "{count}/{total}";
330
+ readonly contextWindowSection: "模型上下文窗口";
331
+ readonly contextWindowHint: "默认值来自随包目录(每个模型的真实上下文上限);可覆盖为自定义容量,该值用于 DSH 的压缩与溢出判断,可输入 1M、512K、200K 等容量。";
332
+ readonly contextWindowNoneEnabled: "还没有勾选任何模型。在上方勾选后,这里会出现该模型的上下文窗口设置。";
333
+ readonly contextWindowReset: "恢复默认";
334
+ readonly contextWindowResetAll: "全部恢复默认";
335
+ readonly tokens: "tokens";
336
+ readonly save: "保存";
337
+ readonly saving: "保存中...";
338
+ readonly saved: "已保存";
339
+ readonly invalidCapacity: "容量格式无效:{value}";
340
+ readonly quotaSection: "用量与配额";
341
+ readonly quotaDesc: "数据来自 Coding Plan 的配额接口(该接口用裸 Key 鉴权,不加 Bearer)。";
342
+ readonly quotaRefresh: "刷新用量";
343
+ readonly quotaRefreshing: "刷新中...";
344
+ readonly quotaSignedOut: "未登录,先在上方完成登录授权。";
345
+ readonly quotaEmpty: "暂无配额数据,点击「刷新用量」重试。";
346
+ readonly quotaPlan: "套餐";
347
+ readonly quotaPlanLevel: "档位";
348
+ readonly quotaRenews: "续费时间";
349
+ readonly quotaReadAt: "读取时间";
350
+ readonly quotaSources: "数据源";
351
+ readonly quotaWindowNames: "窗口名按窗口长度本地化(5 小时 / 1 周 / 1 月),不在本页硬编码;每个账号自己的进度条画在它的账号卡片里。";
352
+ readonly quotaRefreshingNote: "正在后台刷新配额,下方是上一次读到的数字。";
353
+ readonly quotaErrorLabel: "配额读取失败";
354
+ readonly quotaAllowance: "额度类型";
355
+ readonly quotaAllowancePlan: "付费套餐";
356
+ readonly quotaAllowanceFreeTrial: "免费体验额度";
357
+ readonly quotaAllowanceUnknown: "未判定";
358
+ readonly quotaAllowanceHint: "登录时探活认定的额度来源。「免费体验额度」按官方文档指新用户注册即自动获得、首次使用起 5 天内每天 800 万 token 的体验额度;额度耗尽时由上游返回 429,本线路不预判。";
359
+ readonly accountPool: string;
360
+ readonly addAccount: string;
361
+ readonly accountCount: string;
362
+ readonly primaryAccount: string;
363
+ readonly activeAccount: string;
364
+ readonly setPrimary: string;
365
+ readonly deleteAccount: string;
366
+ readonly cooling: string;
367
+ readonly cooldownLeft: string;
368
+ readonly clearCooldown: string;
369
+ readonly needsRelogin: string;
370
+ readonly relogin: string;
371
+ readonly rotationStrategy: string;
372
+ readonly strategySequential: string;
373
+ readonly strategyRoundRobin: string;
374
+ readonly strategySticky: string;
375
+ readonly noAccounts: string;
376
+ readonly email: string;
377
+ readonly expires: string;
378
+ readonly lastUsed: string;
379
+ readonly accountId: string;
380
+ readonly accountQuota: string;
381
+ readonly quotaNone: string;
382
+ readonly quotaSnapshot: string;
383
+ readonly quotaResets: string;
384
+ readonly quotaExhausted: string;
385
+ readonly quotaWindow: string;
386
+ readonly quotaUsed: string;
387
+ readonly quotaFactsScope: string;
388
+ readonly composerLabel: string;
389
+ };
390
+ 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" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "progress" | "pageDesc" | "modelsSection" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "quotaSection" | "quotaDesc" | "quotaEmpty" | "adoptedBadge" | "openAuthorizeUrl" | "authorizeUrl" | "loginComplete" | "manualPasteSection" | "manualPasteHint" | "manualPastePlaceholder" | "manualPasteSubmit" | "manualPasteSubmitting" | "testingConnection" | "testSuccess" | "testLatency" | "testFailed" | "routeOwned" | "routeConflict" | "refreshCatalog" | "refreshingCatalog" | "adopt" | "region" | "regionCn" | "regionIntl" | "regionHint" | "addCnAccount" | "addIntlAccount" | "authorizing" | "loginSection" | "loginIdle" | "loginPending" | "loginCompletedAt" | "loginCompleteNoAccount" | "loginError" | "loginRetryable" | "loginNotRetryable" | "pollEvery" | "loginExpiresAt" | "restartLogin" | "cancelLogin" | "cancelLoginBusy" | "manualPasteEmpty" | "adopting" | "adoptAdopted" | "adoptNoAttempt" | "adoptNoCredentialsFile" | "adoptSecretUnavailable" | "adoptDecryptFailed" | "adoptTokenExpired" | "adoptExchangeFailed" | "adoptNotAZcodeLogin" | "adoptFallback" | "testSuccessAccount" | "testSuccessModel" | "testFailedDetail" | "modelsUnavailable" | "dismiss" | "invalidCapacity" | "quotaRefresh" | "quotaPlan" | "quotaPlanLevel" | "quotaRenews" | "quotaReadAt" | "quotaSources" | "quotaWindowNames" | "quotaRefreshingNote" | "quotaErrorLabel" | "quotaAllowance" | "quotaAllowancePlan" | "quotaAllowanceFreeTrial" | "quotaAllowanceUnknown" | "quotaAllowanceHint", string>;
391
+ 'en-US': 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" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "progress" | "pageDesc" | "modelsSection" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "quotaSection" | "quotaDesc" | "quotaEmpty" | "adoptedBadge" | "openAuthorizeUrl" | "authorizeUrl" | "loginComplete" | "manualPasteSection" | "manualPasteHint" | "manualPastePlaceholder" | "manualPasteSubmit" | "manualPasteSubmitting" | "testingConnection" | "testSuccess" | "testLatency" | "testFailed" | "routeOwned" | "routeConflict" | "refreshCatalog" | "refreshingCatalog" | "adopt" | "region" | "regionCn" | "regionIntl" | "regionHint" | "addCnAccount" | "addIntlAccount" | "authorizing" | "loginSection" | "loginIdle" | "loginPending" | "loginCompletedAt" | "loginCompleteNoAccount" | "loginError" | "loginRetryable" | "loginNotRetryable" | "pollEvery" | "loginExpiresAt" | "restartLogin" | "cancelLogin" | "cancelLoginBusy" | "manualPasteEmpty" | "adopting" | "adoptAdopted" | "adoptNoAttempt" | "adoptNoCredentialsFile" | "adoptSecretUnavailable" | "adoptDecryptFailed" | "adoptTokenExpired" | "adoptExchangeFailed" | "adoptNotAZcodeLogin" | "adoptFallback" | "testSuccessAccount" | "testSuccessModel" | "testFailedDetail" | "modelsUnavailable" | "dismiss" | "invalidCapacity" | "quotaRefresh" | "quotaPlan" | "quotaPlanLevel" | "quotaRenews" | "quotaReadAt" | "quotaSources" | "quotaWindowNames" | "quotaRefreshingNote" | "quotaErrorLabel" | "quotaAllowance" | "quotaAllowancePlan" | "quotaAllowanceFreeTrial" | "quotaAllowanceUnknown" | "quotaAllowanceHint", string>;
392
+ };
393
+ export type GlmCodingPlanLocaleKey = keyof typeof zh;
394
+ /** 一个配额窗口的键到「窗口长度(分钟)」的映射。 */
395
+ export declare const QUOTA_WINDOW_MINUTES: Record<GlmQuotaWindowKey, number>;
396
+ /**
397
+ * adopt 的每种 reason 对应一句不同的说明。
398
+ *
399
+ * 契约把「没找到文件」「解不开密钥」「登录态过期」「没有套餐」分成四个 reason,
400
+ * 就是为了让卡片能给出不同的下一步——把四种失败合成一句「导入失败」会把用户
401
+ * 引到错误的操作上(计划 D6、R6:adopt 失败永不阻断,一律回落浏览器登录)。
402
+ */
403
+ export type AdoptReason = NonNullable<GlmAdoptResultDto['reason']>;
404
+ export declare function adoptReasonText(reason: AdoptReason, dictionary: Record<GlmCodingPlanLocaleKey, string>): string;
405
+ /**
406
+ * 额度类型的本地化文案。
407
+ *
408
+ * `undefined`(旧 host 没下发这个字段)与 `'unknown'` 都渲染成「未判定」:
409
+ * 读不到就等于不知道,而「不知道」不能被渲染成付费套餐。
410
+ */
411
+ export declare function allowanceKindText(allowance: GlmAllowanceKind | undefined, dictionary: Record<GlmCodingPlanLocaleKey, string>): string;
412
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/glm-coding-plan/locales.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAEvH;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,wBAAwB,CAAA;AAEvD,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmHL,CAAA;AAEV,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,OAAO,EAAE,EAAE,MAAM,CA+G9C,CAAA;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKxB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,EAAE,CAAA;AAEpD,8BAA8B;AAC9B,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAIlE,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAA;AAYlE,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAAC,GACjD,MAAM,CAER;AASD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,gBAAgB,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAAC,GACjD,MAAM,CAER"}
@@ -0,0 +1,15 @@
1
+ export declare const STYLE_ID = "dsh-glm-coding-plan-settings-style";
2
+ /**
3
+ * GLM(ZCode 账号)卡片独有的样式。
4
+ *
5
+ * 共享样式一律不重复声明:模型清单(.dsh-mcl-*)由 common/model-checklist-styles.ts
6
+ * 负责,账号卡与配额条(.dsha-account-*)由 common/styles.ts 负责,基础控件
7
+ * (.dsha-page / .dsha-group / .dsha-row / 胶囊等)由兄弟线路的安装器负责。
8
+ * 本文件只声明没有兄弟线路共用过的东西:登录流程块、手工粘贴行、等宽文本、
9
+ * 模型行右侧的窗口数字,以及「导入的登录态」徽标。
10
+ *
11
+ * 两区登录入口复用的 .dsha-account-add-actions 由 workbuddy/styles.ts 声明;
12
+ * Claude 卡片同样直接用它而不在自己文件里重复声明,本卡沿用同一做法。
13
+ */
14
+ export declare function installGlmCodingPlanStyles(): void;
15
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/client/glm-coding-plan/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,uCAAuC,CAAA;AAE5D;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAWjD"}
@@ -0,0 +1,65 @@
1
+ import type { AccountRotationStrategy } from '../../shared/account-pool-contracts.ts';
2
+ import { type GlmAccountSummaryDto, type GlmAdoptResultDto, type GlmConnectionDto, type GlmLoginFlowStatus, type GlmModelOption, type GlmQuotaSnapshotDto, type GlmRegion, type GlmStatusDto } from '../../shared/glm-coding-plan-contracts.ts';
3
+ import type { AccountPoolLabels } from '../common/AccountPoolSection.tsx';
4
+ import { zh } from './locales.ts';
5
+ /** 卡片渲染的键。与兄弟卡片一样用自己的字典,不复用 hub 挂在 settings.section 上的座位。 */
6
+ export type Translate = (key: keyof typeof zh) => string;
7
+ /** 本卡片的字典;身份稳定,依赖它的 effect 才不会每次渲染重建。 */
8
+ export declare const fallbackTranslate: Translate;
9
+ export interface GlmCodingPlanSectionProps {
10
+ onModelChange?: () => void;
11
+ }
12
+ /** 账号卡片上的一个动作。 */
13
+ export type GlmAccountAction = 'set-primary' | 'delete' | 'clear-cooldown' | 'relogin';
14
+ /** 视图可以消费的全部内容,按「会变的事实 / 从答案派生的 / 能触发的」分组。 */
15
+ export interface GlmCodingPlanSectionView {
16
+ state: {
17
+ status: GlmStatusDto | null;
18
+ loading: boolean;
19
+ busy: string | null;
20
+ error: string | null;
21
+ connection: GlmConnectionDto | null;
22
+ adoptResult: GlmAdoptResultDto | null;
23
+ pasteValue: string;
24
+ /** 「导入」与「手工粘贴」按哪个区域发起;两个登录按钮各自固定区域,不读它。 */
25
+ region: GlmRegion;
26
+ /** 手工粘贴兜底是否展开(没有进行中的流程时默认收起)。 */
27
+ pasteOpen: boolean;
28
+ contextDrafts: Record<string, string>;
29
+ savingModel: string | null;
30
+ };
31
+ derived: {
32
+ accounts: GlmAccountSummaryDto[];
33
+ models: GlmModelOption[];
34
+ /** 上下文窗口编辑器的行:只有勾选了的模型才有可覆盖的窗口。 */
35
+ contextModels: GlmModelOption[];
36
+ overrideCount: number;
37
+ login: GlmLoginFlowStatus | null;
38
+ quota: GlmQuotaSnapshotDto | null;
39
+ authenticated: boolean;
40
+ poolLabels: AccountPoolLabels;
41
+ };
42
+ actions: {
43
+ setRegion(region: GlmRegion): void;
44
+ login(region: GlmRegion): Promise<void>;
45
+ cancelLogin(): Promise<void>;
46
+ submitPaste(): Promise<void>;
47
+ setPasteValue(value: string): void;
48
+ togglePaste(): void;
49
+ adopt(): Promise<void>;
50
+ clearAdoptResult(): void;
51
+ accountAction(action: GlmAccountAction, accountId: string): Promise<void>;
52
+ setStrategy(strategy: AccountRotationStrategy): Promise<void>;
53
+ toggleModel(modelId: string, enabled: boolean): void;
54
+ setAllModels(enabled: boolean): void;
55
+ saveContextWindow(modelId: string): Promise<void>;
56
+ resetContextWindow(modelId: string): Promise<void>;
57
+ resetAllContextWindows(): Promise<void>;
58
+ updateContextDraft(modelId: string, draft: string): void;
59
+ refreshQuota(): Promise<void>;
60
+ refreshCatalog(): Promise<void>;
61
+ testConnection(): Promise<void>;
62
+ };
63
+ }
64
+ export declare function useGlmCodingPlanSection({ onModelChange }?: GlmCodingPlanSectionProps): GlmCodingPlanSectionView;
65
+ //# sourceMappingURL=useGlmCodingPlanSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGlmCodingPlanSection.d.ts","sourceRoot":"","sources":["../../../../src/client/glm-coding-plan/useGlmCodingPlanSection.ts"],"names":[],"mappings":"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"}
@@ -10,10 +10,12 @@
10
10
  * (the same principle claude-style's brand.js documents).
11
11
  */
12
12
  import { type BrandMarkKey } from './brand-svg.ts';
13
- export type HubProviderId = 'chatgpt' | 'antigravity' | 'command-code' | 'kimi-code' | 'workbuddy' | 'minimax-code' | 'claude' | 'ollama';
13
+ export type HubProviderId = 'chatgpt' | 'antigravity' | 'command-code' | 'kimi-code' | 'workbuddy' | 'minimax-code' | 'glm-coding-plan' | 'claude' | 'ollama';
14
+ /** 一张标记的键:BRAND_MARKS 的全部键,加上本文件自带的键。 */
15
+ export type ProviderMarkKey = BrandMarkKey | 'glm';
14
16
  interface ProviderBrand {
15
- /** Key into BRAND_MARKS; absent for monogram-only providers. */
16
- mark?: BrandMarkKey;
17
+ /** Key into BRAND_MARKS (or LOCAL_MARKS); absent for monogram-only providers. */
18
+ mark?: ProviderMarkKey;
17
19
  /**
18
20
  * Text color for artwork that draws in currentColor (OpenAI's knot, Kimi's
19
21
  * K, Claude's mark). Self-colored artwork (gradients, multi-fill marks)
@@ -28,7 +30,7 @@ interface ProviderBrand {
28
30
  export declare const PROVIDER_BRANDS: Record<HubProviderId, ProviderBrand>;
29
31
  /** One brand mark at a given box size; the artwork is decorative. */
30
32
  export declare function BrandMark({ mark, color, size }: {
31
- mark: BrandMarkKey;
33
+ mark: ProviderMarkKey;
32
34
  color?: string;
33
35
  size?: number;
34
36
  }): React.JSX.Element;
@@ -41,6 +43,6 @@ export declare function BrandTile({ id, size }: {
41
43
  id: HubProviderId;
42
44
  size?: number;
43
45
  }): React.JSX.Element;
44
- export declare function modelBrandMark(modelId: string): BrandMarkKey | null;
46
+ export declare function modelBrandMark(modelId: string): ProviderMarkKey | null;
45
47
  export {};
46
48
  //# sourceMappingURL=brand-icons.d.ts.map