@eddyskywalker/dsh-chatgpt-subscription 0.2.20 → 0.3.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 (78) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +116 -1
  3. package/lib/client.js +2825 -512
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +8758 -352
  6. package/lib/types/client/ProviderHubSection.d.ts +15 -0
  7. package/lib/types/client/ProviderHubSection.d.ts.map +1 -0
  8. package/lib/types/client/command-code/CommandCodeComposerQuota.d.ts +24 -0
  9. package/lib/types/client/command-code/CommandCodeComposerQuota.d.ts.map +1 -0
  10. package/lib/types/client/command-code/CommandCodeSection.d.ts +11 -0
  11. package/lib/types/client/command-code/CommandCodeSection.d.ts.map +1 -0
  12. package/lib/types/client/command-code/locales.d.ts +401 -0
  13. package/lib/types/client/command-code/locales.d.ts.map +1 -0
  14. package/lib/types/client/index.d.ts +2 -0
  15. package/lib/types/client/index.d.ts.map +1 -1
  16. package/lib/types/client/kimi-code/KimiCodeComposerQuota.d.ts +25 -0
  17. package/lib/types/client/kimi-code/KimiCodeComposerQuota.d.ts.map +1 -0
  18. package/lib/types/client/kimi-code/KimiCodeSection.d.ts +11 -0
  19. package/lib/types/client/kimi-code/KimiCodeSection.d.ts.map +1 -0
  20. package/lib/types/client/kimi-code/KimiModelCapabilities.d.ts +16 -0
  21. package/lib/types/client/kimi-code/KimiModelCapabilities.d.ts.map +1 -0
  22. package/lib/types/client/kimi-code/locales.d.ts +665 -0
  23. package/lib/types/client/kimi-code/locales.d.ts.map +1 -0
  24. package/lib/types/client/kimi-code/styles.d.ts +4 -0
  25. package/lib/types/client/kimi-code/styles.d.ts.map +1 -0
  26. package/lib/types/client/locales.d.ts +3 -1
  27. package/lib/types/client/locales.d.ts.map +1 -1
  28. package/lib/types/client/styles.d.ts.map +1 -1
  29. package/lib/types/host/antigravity/adapter.d.ts +2 -0
  30. package/lib/types/host/antigravity/adapter.d.ts.map +1 -1
  31. package/lib/types/host/antigravity/mapper.d.ts +51 -2
  32. package/lib/types/host/antigravity/mapper.d.ts.map +1 -1
  33. package/lib/types/host/command-code/adapter.d.ts +34 -0
  34. package/lib/types/host/command-code/adapter.d.ts.map +1 -0
  35. package/lib/types/host/command-code/client.d.ts +99 -0
  36. package/lib/types/host/command-code/client.d.ts.map +1 -0
  37. package/lib/types/host/command-code/mapper.d.ts +102 -0
  38. package/lib/types/host/command-code/mapper.d.ts.map +1 -0
  39. package/lib/types/host/command-code/model-catalog.d.ts +31 -0
  40. package/lib/types/host/command-code/model-catalog.d.ts.map +1 -0
  41. package/lib/types/host/command-code/oauth.d.ts +89 -0
  42. package/lib/types/host/command-code/oauth.d.ts.map +1 -0
  43. package/lib/types/host/command-code/plans.d.ts +40 -0
  44. package/lib/types/host/command-code/plans.d.ts.map +1 -0
  45. package/lib/types/host/command-code/routes.d.ts +27 -0
  46. package/lib/types/host/command-code/routes.d.ts.map +1 -0
  47. package/lib/types/host/command-code/token-store.d.ts +88 -0
  48. package/lib/types/host/command-code/token-store.d.ts.map +1 -0
  49. package/lib/types/host/command-code/types.d.ts +138 -0
  50. package/lib/types/host/command-code/types.d.ts.map +1 -0
  51. package/lib/types/host/kimi-code/adapter.d.ts +112 -0
  52. package/lib/types/host/kimi-code/adapter.d.ts.map +1 -0
  53. package/lib/types/host/kimi-code/client.d.ts +161 -0
  54. package/lib/types/host/kimi-code/client.d.ts.map +1 -0
  55. package/lib/types/host/kimi-code/mapper.d.ts +334 -0
  56. package/lib/types/host/kimi-code/mapper.d.ts.map +1 -0
  57. package/lib/types/host/kimi-code/modalities.d.ts +94 -0
  58. package/lib/types/host/kimi-code/modalities.d.ts.map +1 -0
  59. package/lib/types/host/kimi-code/model-catalog.d.ts +77 -0
  60. package/lib/types/host/kimi-code/model-catalog.d.ts.map +1 -0
  61. package/lib/types/host/kimi-code/oauth.d.ts +133 -0
  62. package/lib/types/host/kimi-code/oauth.d.ts.map +1 -0
  63. package/lib/types/host/kimi-code/routes.d.ts +26 -0
  64. package/lib/types/host/kimi-code/routes.d.ts.map +1 -0
  65. package/lib/types/host/kimi-code/token-store.d.ts +135 -0
  66. package/lib/types/host/kimi-code/token-store.d.ts.map +1 -0
  67. package/lib/types/host/kimi-code/types.d.ts +174 -0
  68. package/lib/types/host/kimi-code/types.d.ts.map +1 -0
  69. package/lib/types/host/relay-probe.d.ts +161 -0
  70. package/lib/types/host/relay-probe.d.ts.map +1 -0
  71. package/lib/types/host/responses-client.d.ts.map +1 -1
  72. package/lib/types/index.d.ts +13 -0
  73. package/lib/types/index.d.ts.map +1 -1
  74. package/lib/types/shared/command-code-contracts.d.ts +119 -0
  75. package/lib/types/shared/command-code-contracts.d.ts.map +1 -0
  76. package/lib/types/shared/kimi-code-contracts.d.ts +203 -0
  77. package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -0
  78. package/package.json +1 -1
@@ -0,0 +1,15 @@
1
+ import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import { NS } from './locales.ts';
3
+ type Props = PropsRuntime<'settings.section'> & PropsLocale<typeof NS> & {
4
+ onModelChange?: () => void;
5
+ };
6
+ /**
7
+ * Single settings page that hosts every subscription provider behind tabs,
8
+ * so the settings sidebar shows one entry instead of one per provider. Only
9
+ * the active tab is mounted, mirroring the shell's previous behavior of
10
+ * mounting just the selected settings page (each provider section refetches
11
+ * its status on mount).
12
+ */
13
+ export declare function ProviderHubSection({ t, onModelChange, ...runtime }: Props): React.JSX.Element;
14
+ export {};
15
+ //# sourceMappingURL=ProviderHubSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProviderHubSection.d.ts","sourceRoot":"","sources":["../../../src/client/ProviderHubSection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAKjF,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAEjC,KAAK,KAAK,GAAG,YAAY,CAAC,kBAAkB,CAAC,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC,GAAG;IACvE,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;CAC3B,CAAA;AAcD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsC7F"}
@@ -0,0 +1,24 @@
1
+ import type { SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client';
2
+ import type { ModelDirectoryState } from '@deepseek-ai/dsh-client-ui-model-selection/client';
3
+ import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
4
+ import type { CommandCodeWebStatus } from '../../shared/command-code-contracts.ts';
5
+ import { NS_COMMAND_CODE } from './locales.ts';
6
+ type Props = PropsRuntime<'conversation.input.right'> & PropsLocale<typeof NS_COMMAND_CODE> & {
7
+ directory: SnapshotStore<ModelDirectoryState>;
8
+ loadModelDirectory: () => void;
9
+ };
10
+ interface BadgeFacts {
11
+ text: string;
12
+ tooltip: string;
13
+ level: 'normal' | 'warning' | 'danger';
14
+ }
15
+ /**
16
+ * Pick the most meaningful number for the badge.
17
+ *
18
+ * A bounded usage window is the number a user actually spends down, so it wins
19
+ * over a credit balance; the balance shows only when no window is reported.
20
+ */
21
+ export declare function selectBadgeFacts(status: CommandCodeWebStatus | null): BadgeFacts | null;
22
+ export declare function CommandCodeComposerQuota({ directory, loadModelDirectory }: Props): React.JSX.Element | null;
23
+ export {};
24
+ //# sourceMappingURL=CommandCodeComposerQuota.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandCodeComposerQuota.d.ts","sourceRoot":"","sources":["../../../../src/client/command-code/CommandCodeComposerQuota.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAA;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAmB9C,KAAK,KAAK,GAAG,YAAY,CAAC,0BAA0B,CAAC,GACnD,WAAW,CAAC,OAAO,eAAe,CAAC,GAAG;IACpC,SAAS,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAA;IAC7C,kBAAkB,EAAE,MAAM,IAAI,CAAA;CAC/B,CAAA;AAEH,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAA;CACvC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,GAAG,UAAU,GAAG,IAAI,CAiCvF;AAED,wBAAgB,wBAAwB,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAgE3G"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ onModelChange?: () => void;
4
+ loadModelDirectory?: () => void;
5
+ }
6
+ /** Parse "1M", "512K", "200000" into a positive integer token count. */
7
+ export declare function parsePositiveCapacity(value: string): number | null;
8
+ export declare function formatCapacity(value: number): string;
9
+ export declare function CommandCodeSection({ onModelChange, loadModelDirectory }: Props): React.ReactElement;
10
+ export {};
11
+ //# sourceMappingURL=CommandCodeSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandCodeSection.d.ts","sourceRoot":"","sources":["../../../../src/client/command-code/CommandCodeSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAwB/D,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;CAChC;AAiBD,wEAAwE;AACxE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOlE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIpD;AA8BD,wBAAgB,kBAAkB,CAAC,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CA+hBnG"}
@@ -0,0 +1,401 @@
1
+ export declare const NS_COMMAND_CODE = "dsh-command-code";
2
+ export declare const zh: {
3
+ readonly title: "Command Code";
4
+ readonly pageDesc: "登录 Command Code,管理可用模型、上下文窗口与额度。";
5
+ readonly account: "账号";
6
+ readonly signedIn: "已登录";
7
+ readonly signedOut: "未登录";
8
+ readonly keyName: "密钥名称";
9
+ readonly organization: "组织";
10
+ readonly plan: "套餐";
11
+ readonly planUnknown: "—";
12
+ readonly subscription: "订阅状态";
13
+ readonly renews: "续费于";
14
+ readonly authenticatedAt: "登录时间";
15
+ readonly storage: "凭据存储";
16
+ readonly storageNotice: "API Key 由 Host 保存于本地安全存储 ($DSH_HOME/storages/command-code-credentials.json),不会进入浏览器。";
17
+ readonly signIn: "浏览器登录";
18
+ readonly signInAgain: "重新登录";
19
+ readonly signingIn: "登录中...";
20
+ readonly signOut: "注销";
21
+ readonly cancelSignIn: "取消登录";
22
+ readonly openSignInPage: "打开登录页面";
23
+ readonly apiKeySection: "手动填写 API Key";
24
+ readonly apiKeyHint: "在 Command Code Studio 创建 API Key 后粘贴到此处;浏览器登录不可用时使用。";
25
+ readonly apiKeyPlaceholder: "粘贴 Command Code API Key";
26
+ readonly apiKeySave: "保存并验证";
27
+ readonly apiKeySaving: "验证中...";
28
+ readonly apiKeySaved: "已保存";
29
+ readonly connection: "连接";
30
+ readonly provider: "Provider";
31
+ readonly providerValue: "Command Code · command-code";
32
+ readonly connectionState: "连接状态";
33
+ readonly connected: "已连接";
34
+ readonly untested: "未测试";
35
+ readonly testConnection: "测试连接";
36
+ readonly testingConnection: "测试中...";
37
+ readonly routeOwned: "模型路由由本插件提供";
38
+ readonly routeConflict: "模型路由已被其他 Provider 占用:{detail}。请在 DSH 设置中移除重复的 Provider 配置后重试。";
39
+ readonly modelsSection: "模型";
40
+ readonly modelsHint: "勾选后模型才会出现在对话页的模型选择列表中;至少保留一个。";
41
+ readonly refreshCatalog: "刷新模型目录";
42
+ readonly refreshingCatalog: "刷新中...";
43
+ readonly selectAll: "全选";
44
+ readonly unselectAll: "全不选";
45
+ readonly wireAnthropic: "Anthropic";
46
+ readonly wireOpenai: "OpenAI";
47
+ readonly enhanced: "增强功能";
48
+ readonly defaultReasoningEffort: "默认思考深度";
49
+ readonly defaultReasoningEffortHint: "控制支持推理的模型在未单独指定时的思考强度。Anthropic 模型会映射为 thinking 预算。";
50
+ readonly defaultEffortAuto: "使用 Provider 默认值";
51
+ readonly contextWindowSection: "模型上下文窗口";
52
+ readonly contextWindowHint: "默认取 Command Code 模型目录的 context length;可覆盖为自定义容量,该值用于 DSH 的压缩与溢出判断,可输入 1M、512K、200K 等容量。";
53
+ readonly save: "保存";
54
+ readonly saved: "已保存";
55
+ readonly saving: "保存中...";
56
+ readonly quotaSection: "用量与配额";
57
+ readonly quotaDesc: "数据来自 Command Code 账户接口,页面可见时最多每 60 秒刷新一次。";
58
+ readonly refreshQuota: "刷新用量";
59
+ readonly refreshingQuota: "刷新中...";
60
+ readonly quotaEmpty: "暂无配额数据,点击「刷新用量」重试。";
61
+ readonly quotaCredits: "剩余额度";
62
+ readonly quotaUnlimited: "不限量";
63
+ readonly updatedAt: "更新时间:{time}";
64
+ readonly loading: "加载中...";
65
+ readonly loginFailed: "登录失败";
66
+ readonly tokens: "tokens";
67
+ };
68
+ export declare const en: {
69
+ readonly title: "Command Code";
70
+ readonly pageDesc: "Sign in to Command Code and manage models, context windows, and quota.";
71
+ readonly account: "Account";
72
+ readonly signedIn: "Signed in";
73
+ readonly signedOut: "Not signed in";
74
+ readonly keyName: "Key name";
75
+ readonly organization: "Organization";
76
+ readonly plan: "Plan";
77
+ readonly planUnknown: "—";
78
+ readonly subscription: "Subscription";
79
+ readonly renews: "renews";
80
+ readonly authenticatedAt: "Signed in at";
81
+ readonly storage: "Credential storage";
82
+ readonly storageNotice: "The API key is stored locally by the Host ($DSH_HOME/storages/command-code-credentials.json) and never reaches the browser.";
83
+ readonly signIn: "Sign in with browser";
84
+ readonly signInAgain: "Sign in again";
85
+ readonly signingIn: "Signing in...";
86
+ readonly signOut: "Sign out";
87
+ readonly cancelSignIn: "Cancel";
88
+ readonly openSignInPage: "Open the sign-in page";
89
+ readonly apiKeySection: "Paste an API key";
90
+ readonly apiKeyHint: "Create a key in Command Code Studio and paste it here; use this when the browser flow is unavailable.";
91
+ readonly apiKeyPlaceholder: "Command Code API key";
92
+ readonly apiKeySave: "Save and verify";
93
+ readonly apiKeySaving: "Verifying...";
94
+ readonly apiKeySaved: "Saved";
95
+ readonly connection: "Connection";
96
+ readonly provider: "Provider";
97
+ readonly providerValue: "Command Code · command-code";
98
+ readonly connectionState: "Connection state";
99
+ readonly connected: "Connected";
100
+ readonly untested: "Untested";
101
+ readonly testConnection: "Test connection";
102
+ readonly testingConnection: "Testing...";
103
+ readonly routeOwned: "This plugin serves the model route";
104
+ readonly routeConflict: "Another provider already owns the model route: {detail}. Remove the duplicate provider configuration in DSH settings and reload.";
105
+ readonly modelsSection: "Models";
106
+ readonly modelsHint: "Checked models appear in the DSH conversation model list; keep at least one.";
107
+ readonly refreshCatalog: "Refresh catalog";
108
+ readonly refreshingCatalog: "Refreshing...";
109
+ readonly selectAll: "Select all";
110
+ readonly unselectAll: "Deselect all";
111
+ readonly wireAnthropic: "Anthropic";
112
+ readonly wireOpenai: "OpenAI";
113
+ readonly enhanced: "Enhanced features";
114
+ readonly defaultReasoningEffort: "Default reasoning effort";
115
+ readonly defaultReasoningEffortHint: "Reasoning effort for models that support it when the conversation does not specify one. Anthropic models map it to a thinking budget.";
116
+ readonly defaultEffortAuto: "Use provider default";
117
+ readonly contextWindowSection: "Model context window";
118
+ readonly contextWindowHint: "Defaults to the context length in the Command Code catalog; override it with the capacity DSH should use for compaction and overflow decisions (e.g., 1M, 512K, 200K).";
119
+ readonly save: "Save";
120
+ readonly saved: "Saved";
121
+ readonly saving: "Saving...";
122
+ readonly quotaSection: "Usage & quota";
123
+ readonly quotaDesc: "Read from the Command Code account endpoints; refreshes at most once every 60 seconds while visible.";
124
+ readonly refreshQuota: "Refresh quota";
125
+ readonly refreshingQuota: "Refreshing...";
126
+ readonly quotaEmpty: "No quota data yet — use “Refresh quota” to retry.";
127
+ readonly quotaCredits: "Remaining credits";
128
+ readonly quotaUnlimited: "Unlimited";
129
+ readonly updatedAt: "Updated at: {time}";
130
+ readonly loading: "Loading...";
131
+ readonly loginFailed: "Sign-in failed";
132
+ readonly tokens: "tokens";
133
+ };
134
+ export declare const dictionaries: {
135
+ zh: {
136
+ readonly title: "Command Code";
137
+ readonly pageDesc: "登录 Command Code,管理可用模型、上下文窗口与额度。";
138
+ readonly account: "账号";
139
+ readonly signedIn: "已登录";
140
+ readonly signedOut: "未登录";
141
+ readonly keyName: "密钥名称";
142
+ readonly organization: "组织";
143
+ readonly plan: "套餐";
144
+ readonly planUnknown: "—";
145
+ readonly subscription: "订阅状态";
146
+ readonly renews: "续费于";
147
+ readonly authenticatedAt: "登录时间";
148
+ readonly storage: "凭据存储";
149
+ readonly storageNotice: "API Key 由 Host 保存于本地安全存储 ($DSH_HOME/storages/command-code-credentials.json),不会进入浏览器。";
150
+ readonly signIn: "浏览器登录";
151
+ readonly signInAgain: "重新登录";
152
+ readonly signingIn: "登录中...";
153
+ readonly signOut: "注销";
154
+ readonly cancelSignIn: "取消登录";
155
+ readonly openSignInPage: "打开登录页面";
156
+ readonly apiKeySection: "手动填写 API Key";
157
+ readonly apiKeyHint: "在 Command Code Studio 创建 API Key 后粘贴到此处;浏览器登录不可用时使用。";
158
+ readonly apiKeyPlaceholder: "粘贴 Command Code API Key";
159
+ readonly apiKeySave: "保存并验证";
160
+ readonly apiKeySaving: "验证中...";
161
+ readonly apiKeySaved: "已保存";
162
+ readonly connection: "连接";
163
+ readonly provider: "Provider";
164
+ readonly providerValue: "Command Code · command-code";
165
+ readonly connectionState: "连接状态";
166
+ readonly connected: "已连接";
167
+ readonly untested: "未测试";
168
+ readonly testConnection: "测试连接";
169
+ readonly testingConnection: "测试中...";
170
+ readonly routeOwned: "模型路由由本插件提供";
171
+ readonly routeConflict: "模型路由已被其他 Provider 占用:{detail}。请在 DSH 设置中移除重复的 Provider 配置后重试。";
172
+ readonly modelsSection: "模型";
173
+ readonly modelsHint: "勾选后模型才会出现在对话页的模型选择列表中;至少保留一个。";
174
+ readonly refreshCatalog: "刷新模型目录";
175
+ readonly refreshingCatalog: "刷新中...";
176
+ readonly selectAll: "全选";
177
+ readonly unselectAll: "全不选";
178
+ readonly wireAnthropic: "Anthropic";
179
+ readonly wireOpenai: "OpenAI";
180
+ readonly enhanced: "增强功能";
181
+ readonly defaultReasoningEffort: "默认思考深度";
182
+ readonly defaultReasoningEffortHint: "控制支持推理的模型在未单独指定时的思考强度。Anthropic 模型会映射为 thinking 预算。";
183
+ readonly defaultEffortAuto: "使用 Provider 默认值";
184
+ readonly contextWindowSection: "模型上下文窗口";
185
+ readonly contextWindowHint: "默认取 Command Code 模型目录的 context length;可覆盖为自定义容量,该值用于 DSH 的压缩与溢出判断,可输入 1M、512K、200K 等容量。";
186
+ readonly save: "保存";
187
+ readonly saved: "已保存";
188
+ readonly saving: "保存中...";
189
+ readonly quotaSection: "用量与配额";
190
+ readonly quotaDesc: "数据来自 Command Code 账户接口,页面可见时最多每 60 秒刷新一次。";
191
+ readonly refreshQuota: "刷新用量";
192
+ readonly refreshingQuota: "刷新中...";
193
+ readonly quotaEmpty: "暂无配额数据,点击「刷新用量」重试。";
194
+ readonly quotaCredits: "剩余额度";
195
+ readonly quotaUnlimited: "不限量";
196
+ readonly updatedAt: "更新时间:{time}";
197
+ readonly loading: "加载中...";
198
+ readonly loginFailed: "登录失败";
199
+ readonly tokens: "tokens";
200
+ };
201
+ 'zh-CN': {
202
+ readonly title: "Command Code";
203
+ readonly pageDesc: "登录 Command Code,管理可用模型、上下文窗口与额度。";
204
+ readonly account: "账号";
205
+ readonly signedIn: "已登录";
206
+ readonly signedOut: "未登录";
207
+ readonly keyName: "密钥名称";
208
+ readonly organization: "组织";
209
+ readonly plan: "套餐";
210
+ readonly planUnknown: "—";
211
+ readonly subscription: "订阅状态";
212
+ readonly renews: "续费于";
213
+ readonly authenticatedAt: "登录时间";
214
+ readonly storage: "凭据存储";
215
+ readonly storageNotice: "API Key 由 Host 保存于本地安全存储 ($DSH_HOME/storages/command-code-credentials.json),不会进入浏览器。";
216
+ readonly signIn: "浏览器登录";
217
+ readonly signInAgain: "重新登录";
218
+ readonly signingIn: "登录中...";
219
+ readonly signOut: "注销";
220
+ readonly cancelSignIn: "取消登录";
221
+ readonly openSignInPage: "打开登录页面";
222
+ readonly apiKeySection: "手动填写 API Key";
223
+ readonly apiKeyHint: "在 Command Code Studio 创建 API Key 后粘贴到此处;浏览器登录不可用时使用。";
224
+ readonly apiKeyPlaceholder: "粘贴 Command Code API Key";
225
+ readonly apiKeySave: "保存并验证";
226
+ readonly apiKeySaving: "验证中...";
227
+ readonly apiKeySaved: "已保存";
228
+ readonly connection: "连接";
229
+ readonly provider: "Provider";
230
+ readonly providerValue: "Command Code · command-code";
231
+ readonly connectionState: "连接状态";
232
+ readonly connected: "已连接";
233
+ readonly untested: "未测试";
234
+ readonly testConnection: "测试连接";
235
+ readonly testingConnection: "测试中...";
236
+ readonly routeOwned: "模型路由由本插件提供";
237
+ readonly routeConflict: "模型路由已被其他 Provider 占用:{detail}。请在 DSH 设置中移除重复的 Provider 配置后重试。";
238
+ readonly modelsSection: "模型";
239
+ readonly modelsHint: "勾选后模型才会出现在对话页的模型选择列表中;至少保留一个。";
240
+ readonly refreshCatalog: "刷新模型目录";
241
+ readonly refreshingCatalog: "刷新中...";
242
+ readonly selectAll: "全选";
243
+ readonly unselectAll: "全不选";
244
+ readonly wireAnthropic: "Anthropic";
245
+ readonly wireOpenai: "OpenAI";
246
+ readonly enhanced: "增强功能";
247
+ readonly defaultReasoningEffort: "默认思考深度";
248
+ readonly defaultReasoningEffortHint: "控制支持推理的模型在未单独指定时的思考强度。Anthropic 模型会映射为 thinking 预算。";
249
+ readonly defaultEffortAuto: "使用 Provider 默认值";
250
+ readonly contextWindowSection: "模型上下文窗口";
251
+ readonly contextWindowHint: "默认取 Command Code 模型目录的 context length;可覆盖为自定义容量,该值用于 DSH 的压缩与溢出判断,可输入 1M、512K、200K 等容量。";
252
+ readonly save: "保存";
253
+ readonly saved: "已保存";
254
+ readonly saving: "保存中...";
255
+ readonly quotaSection: "用量与配额";
256
+ readonly quotaDesc: "数据来自 Command Code 账户接口,页面可见时最多每 60 秒刷新一次。";
257
+ readonly refreshQuota: "刷新用量";
258
+ readonly refreshingQuota: "刷新中...";
259
+ readonly quotaEmpty: "暂无配额数据,点击「刷新用量」重试。";
260
+ readonly quotaCredits: "剩余额度";
261
+ readonly quotaUnlimited: "不限量";
262
+ readonly updatedAt: "更新时间:{time}";
263
+ readonly loading: "加载中...";
264
+ readonly loginFailed: "登录失败";
265
+ readonly tokens: "tokens";
266
+ };
267
+ en: {
268
+ readonly title: "Command Code";
269
+ readonly pageDesc: "Sign in to Command Code and manage models, context windows, and quota.";
270
+ readonly account: "Account";
271
+ readonly signedIn: "Signed in";
272
+ readonly signedOut: "Not signed in";
273
+ readonly keyName: "Key name";
274
+ readonly organization: "Organization";
275
+ readonly plan: "Plan";
276
+ readonly planUnknown: "—";
277
+ readonly subscription: "Subscription";
278
+ readonly renews: "renews";
279
+ readonly authenticatedAt: "Signed in at";
280
+ readonly storage: "Credential storage";
281
+ readonly storageNotice: "The API key is stored locally by the Host ($DSH_HOME/storages/command-code-credentials.json) and never reaches the browser.";
282
+ readonly signIn: "Sign in with browser";
283
+ readonly signInAgain: "Sign in again";
284
+ readonly signingIn: "Signing in...";
285
+ readonly signOut: "Sign out";
286
+ readonly cancelSignIn: "Cancel";
287
+ readonly openSignInPage: "Open the sign-in page";
288
+ readonly apiKeySection: "Paste an API key";
289
+ readonly apiKeyHint: "Create a key in Command Code Studio and paste it here; use this when the browser flow is unavailable.";
290
+ readonly apiKeyPlaceholder: "Command Code API key";
291
+ readonly apiKeySave: "Save and verify";
292
+ readonly apiKeySaving: "Verifying...";
293
+ readonly apiKeySaved: "Saved";
294
+ readonly connection: "Connection";
295
+ readonly provider: "Provider";
296
+ readonly providerValue: "Command Code · command-code";
297
+ readonly connectionState: "Connection state";
298
+ readonly connected: "Connected";
299
+ readonly untested: "Untested";
300
+ readonly testConnection: "Test connection";
301
+ readonly testingConnection: "Testing...";
302
+ readonly routeOwned: "This plugin serves the model route";
303
+ readonly routeConflict: "Another provider already owns the model route: {detail}. Remove the duplicate provider configuration in DSH settings and reload.";
304
+ readonly modelsSection: "Models";
305
+ readonly modelsHint: "Checked models appear in the DSH conversation model list; keep at least one.";
306
+ readonly refreshCatalog: "Refresh catalog";
307
+ readonly refreshingCatalog: "Refreshing...";
308
+ readonly selectAll: "Select all";
309
+ readonly unselectAll: "Deselect all";
310
+ readonly wireAnthropic: "Anthropic";
311
+ readonly wireOpenai: "OpenAI";
312
+ readonly enhanced: "Enhanced features";
313
+ readonly defaultReasoningEffort: "Default reasoning effort";
314
+ readonly defaultReasoningEffortHint: "Reasoning effort for models that support it when the conversation does not specify one. Anthropic models map it to a thinking budget.";
315
+ readonly defaultEffortAuto: "Use provider default";
316
+ readonly contextWindowSection: "Model context window";
317
+ readonly contextWindowHint: "Defaults to the context length in the Command Code catalog; override it with the capacity DSH should use for compaction and overflow decisions (e.g., 1M, 512K, 200K).";
318
+ readonly save: "Save";
319
+ readonly saved: "Saved";
320
+ readonly saving: "Saving...";
321
+ readonly quotaSection: "Usage & quota";
322
+ readonly quotaDesc: "Read from the Command Code account endpoints; refreshes at most once every 60 seconds while visible.";
323
+ readonly refreshQuota: "Refresh quota";
324
+ readonly refreshingQuota: "Refreshing...";
325
+ readonly quotaEmpty: "No quota data yet — use “Refresh quota” to retry.";
326
+ readonly quotaCredits: "Remaining credits";
327
+ readonly quotaUnlimited: "Unlimited";
328
+ readonly updatedAt: "Updated at: {time}";
329
+ readonly loading: "Loading...";
330
+ readonly loginFailed: "Sign-in failed";
331
+ readonly tokens: "tokens";
332
+ };
333
+ 'en-US': {
334
+ readonly title: "Command Code";
335
+ readonly pageDesc: "Sign in to Command Code and manage models, context windows, and quota.";
336
+ readonly account: "Account";
337
+ readonly signedIn: "Signed in";
338
+ readonly signedOut: "Not signed in";
339
+ readonly keyName: "Key name";
340
+ readonly organization: "Organization";
341
+ readonly plan: "Plan";
342
+ readonly planUnknown: "—";
343
+ readonly subscription: "Subscription";
344
+ readonly renews: "renews";
345
+ readonly authenticatedAt: "Signed in at";
346
+ readonly storage: "Credential storage";
347
+ readonly storageNotice: "The API key is stored locally by the Host ($DSH_HOME/storages/command-code-credentials.json) and never reaches the browser.";
348
+ readonly signIn: "Sign in with browser";
349
+ readonly signInAgain: "Sign in again";
350
+ readonly signingIn: "Signing in...";
351
+ readonly signOut: "Sign out";
352
+ readonly cancelSignIn: "Cancel";
353
+ readonly openSignInPage: "Open the sign-in page";
354
+ readonly apiKeySection: "Paste an API key";
355
+ readonly apiKeyHint: "Create a key in Command Code Studio and paste it here; use this when the browser flow is unavailable.";
356
+ readonly apiKeyPlaceholder: "Command Code API key";
357
+ readonly apiKeySave: "Save and verify";
358
+ readonly apiKeySaving: "Verifying...";
359
+ readonly apiKeySaved: "Saved";
360
+ readonly connection: "Connection";
361
+ readonly provider: "Provider";
362
+ readonly providerValue: "Command Code · command-code";
363
+ readonly connectionState: "Connection state";
364
+ readonly connected: "Connected";
365
+ readonly untested: "Untested";
366
+ readonly testConnection: "Test connection";
367
+ readonly testingConnection: "Testing...";
368
+ readonly routeOwned: "This plugin serves the model route";
369
+ readonly routeConflict: "Another provider already owns the model route: {detail}. Remove the duplicate provider configuration in DSH settings and reload.";
370
+ readonly modelsSection: "Models";
371
+ readonly modelsHint: "Checked models appear in the DSH conversation model list; keep at least one.";
372
+ readonly refreshCatalog: "Refresh catalog";
373
+ readonly refreshingCatalog: "Refreshing...";
374
+ readonly selectAll: "Select all";
375
+ readonly unselectAll: "Deselect all";
376
+ readonly wireAnthropic: "Anthropic";
377
+ readonly wireOpenai: "OpenAI";
378
+ readonly enhanced: "Enhanced features";
379
+ readonly defaultReasoningEffort: "Default reasoning effort";
380
+ readonly defaultReasoningEffortHint: "Reasoning effort for models that support it when the conversation does not specify one. Anthropic models map it to a thinking budget.";
381
+ readonly defaultEffortAuto: "Use provider default";
382
+ readonly contextWindowSection: "Model context window";
383
+ readonly contextWindowHint: "Defaults to the context length in the Command Code catalog; override it with the capacity DSH should use for compaction and overflow decisions (e.g., 1M, 512K, 200K).";
384
+ readonly save: "Save";
385
+ readonly saved: "Saved";
386
+ readonly saving: "Saving...";
387
+ readonly quotaSection: "Usage & quota";
388
+ readonly quotaDesc: "Read from the Command Code account endpoints; refreshes at most once every 60 seconds while visible.";
389
+ readonly refreshQuota: "Refresh quota";
390
+ readonly refreshingQuota: "Refreshing...";
391
+ readonly quotaEmpty: "No quota data yet — use “Refresh quota” to retry.";
392
+ readonly quotaCredits: "Remaining credits";
393
+ readonly quotaUnlimited: "Unlimited";
394
+ readonly updatedAt: "Updated at: {time}";
395
+ readonly loading: "Loading...";
396
+ readonly loginFailed: "Sign-in failed";
397
+ readonly tokens: "tokens";
398
+ };
399
+ };
400
+ export type CommandCodeLocaleKey = keyof typeof zh;
401
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/command-code/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,qBAAqB,CAAA;AAEjD,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEL,CAAA;AAEV,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEL,CAAA;AAEV,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKxB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,EAAE,CAAA"}
@@ -4,6 +4,8 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
4
4
  interface LocaleNamespaceMap {
5
5
  'dsh-chatgpt-subscription': LocaleKey;
6
6
  'dsh-antigravity': any;
7
+ 'dsh-command-code': any;
8
+ 'dsh-kimi-code': any;
7
9
  }
8
10
  }
9
11
  export declare const inject: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAa3E,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAQ/D,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,0BAA0B,EAAE,SAAS,CAAA;QACrC,iBAAiB,EAAE,GAAG,CAAA;KACvB;CACF;AAED,eAAO,MAAM,MAAM,UAA0D,CAAA;AAE7E,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAiF9C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAa3E,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAY/D,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,0BAA0B,EAAE,SAAS,CAAA;QACrC,iBAAiB,EAAE,GAAG,CAAA;QACtB,kBAAkB,EAAE,GAAG,CAAA;QACvB,eAAe,EAAE,GAAG,CAAA;KACrB;CACF;AAED,eAAO,MAAM,MAAM,UAA0D,CAAA;AAE7E,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAoH9C"}
@@ -0,0 +1,25 @@
1
+ import type { SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client';
2
+ import type { ModelDirectoryState } from '@deepseek-ai/dsh-client-ui-model-selection/client';
3
+ import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
4
+ import type { KimiCodeWebStatus } from '../../shared/kimi-code-contracts.ts';
5
+ import { NS_KIMI_CODE } from './locales.ts';
6
+ type Props = PropsRuntime<'conversation.input.right'> & PropsLocale<typeof NS_KIMI_CODE> & {
7
+ directory: SnapshotStore<ModelDirectoryState>;
8
+ loadModelDirectory: () => void;
9
+ };
10
+ interface BadgeFacts {
11
+ text: string;
12
+ tooltip: string;
13
+ level: 'normal' | 'warning' | 'danger';
14
+ }
15
+ /**
16
+ * Pick the most meaningful number for the badge.
17
+ *
18
+ * The shortest window is the one a user spends down first and the one that
19
+ * blocks work soonest, so it wins over the longer pools; the 7-day allowance
20
+ * shows only when no 5-hour window is reported.
21
+ */
22
+ export declare function selectBadgeFacts(status: KimiCodeWebStatus | null): BadgeFacts | null;
23
+ export declare function KimiCodeComposerQuota({ directory, loadModelDirectory }: Props): React.JSX.Element | null;
24
+ export {};
25
+ //# sourceMappingURL=KimiCodeComposerQuota.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KimiCodeComposerQuota.d.ts","sourceRoot":"","sources":["../../../../src/client/kimi-code/KimiCodeComposerQuota.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAA;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAmB3C,KAAK,KAAK,GAAG,YAAY,CAAC,0BAA0B,CAAC,GACnD,WAAW,CAAC,OAAO,YAAY,CAAC,GAAG;IACjC,SAAS,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAA;IAC7C,kBAAkB,EAAE,MAAM,IAAI,CAAA;CAC/B,CAAA;AAEH,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAA;CACvC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,UAAU,GAAG,IAAI,CA+BpF;AAED,wBAAgB,qBAAqB,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAgExG"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ onModelChange?: () => void;
4
+ loadModelDirectory?: () => void;
5
+ }
6
+ /** Parse "1M", "512K", "200000" into a positive integer token count. */
7
+ export declare function parsePositiveCapacity(value: string): number | null;
8
+ export declare function formatCapacity(value: number): string;
9
+ export declare function KimiCodeSection({ onModelChange, loadModelDirectory }: Props): React.ReactElement;
10
+ export {};
11
+ //# sourceMappingURL=KimiCodeSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KimiCodeSection.d.ts","sourceRoot":"","sources":["../../../../src/client/kimi-code/KimiCodeSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAa/D,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;CAChC;AAiBD,wEAAwE;AACxE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOlE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIpD;AAyCD,wBAAgB,eAAe,CAAC,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CA8lBhG"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Capability table for the Kimi model list.
3
+ *
4
+ * Extracted from the settings card so the layout is testable: an earlier
5
+ * revision inlined each capability as prose beside the model name, which
6
+ * stretched the name column and pushed the descriptions out of alignment.
7
+ * Capabilities are now short tags in their own columns, with the per-model
8
+ * detail kept in a hover title.
9
+ */
10
+ import React from 'react';
11
+ import type { KimiCodeModelOption } from '../../shared/kimi-code-contracts.ts';
12
+ export interface KimiModelCapabilitiesProps {
13
+ models: KimiCodeModelOption[];
14
+ }
15
+ export declare function KimiModelCapabilities({ models }: KimiModelCapabilitiesProps): React.ReactElement;
16
+ //# sourceMappingURL=KimiModelCapabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KimiModelCapabilities.d.ts","sourceRoot":"","sources":["../../../../src/client/kimi-code/KimiModelCapabilities.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAK9E,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,mBAAmB,EAAE,CAAA;CAC9B;AAED,wBAAgB,qBAAqB,CAAC,EAAE,MAAM,EAAE,EAAE,0BAA0B,GAAG,KAAK,CAAC,YAAY,CA2ChG"}