dsh-ds-balance 2.3.0 → 3.0.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 (48) hide show
  1. package/README.md +84 -177
  2. package/README_zh.md +140 -0
  3. package/lib/adapters/domain-core-store.d.ts +1 -1
  4. package/lib/adapters/domain-core-store.js +1 -1
  5. package/lib/adapters/host-account.d.ts +22 -1
  6. package/lib/adapters/host-account.js +13 -0
  7. package/lib/adapters/salt-file.d.ts +1 -1
  8. package/lib/adapters/salt-file.js +1 -1
  9. package/lib/client.js +619 -461
  10. package/lib/config.d.ts +28 -19
  11. package/lib/config.js +27 -19
  12. package/lib/domain/credential.d.ts +41 -0
  13. package/lib/domain/credential.js +52 -0
  14. package/lib/http/handlers.d.ts +34 -3
  15. package/lib/http/handlers.js +125 -32
  16. package/lib/http/routes.d.ts +6 -2
  17. package/lib/http/routes.js +3 -2
  18. package/lib/http/wire.d.ts +59 -2
  19. package/lib/http/wire.js +4 -2
  20. package/lib/index.d.ts +1 -1
  21. package/lib/index.js +35 -6
  22. package/lib/ports/account.d.ts +25 -0
  23. package/lib/ports/core-store.d.ts +1 -1
  24. package/lib/ports/core-store.js +1 -1
  25. package/lib/services/key-resolver.d.ts +33 -3
  26. package/lib/services/key-resolver.js +41 -12
  27. package/lib/services/source-readers.js +3 -3
  28. package/lib/services/source-selector.d.ts +10 -0
  29. package/lib/services/source-selector.js +14 -4
  30. package/lib/services/sources-service.d.ts +148 -0
  31. package/lib/services/sources-service.js +209 -0
  32. package/lib/types/client/api-types.d.ts +8 -0
  33. package/lib/types/client/data.d.ts +72 -0
  34. package/lib/types/client/icons/currency.d.ts +26 -0
  35. package/lib/types/client/icons.d.ts +92 -0
  36. package/lib/types/client/locales.d.ts +15 -13
  37. package/lib/types/client/model.d.ts +10 -0
  38. package/lib/types/client/settings/AccountAvatar.d.ts +27 -0
  39. package/lib/types/client/settings/BalanceSettingsCard.d.ts +8 -1
  40. package/lib/types/client/settings/fields.d.ts +70 -39
  41. package/lib/types/client/settings/source-status.d.ts +43 -0
  42. package/lib/types/client/settings/use-config-form.d.ts +1 -27
  43. package/lib/types/client/settings/use-sources.d.ts +38 -0
  44. package/lib/version.d.ts +1 -1
  45. package/lib/version.js +1 -1
  46. package/package.json +32 -32
  47. package/README_en.md +0 -237
  48. package/lib/types/client/settings/use-credential-state.d.ts +0 -36
@@ -0,0 +1,27 @@
1
+ /**
2
+ * 账号头像。
3
+ *
4
+ * 规格逐值照官方 `ui-settings-account/AccountAvatar.module.css` 与
5
+ * `AccountSection.module.css` 的 `.avatar`:32×32、`border-radius: 50%`、
6
+ * `corner-shape: round`(**必须是真的圆**,不能继承宿主的 superellipse)、
7
+ * `object-fit: cover`、底色 `--dsw-alias-bg-skeleton`。
8
+ *
9
+ * `referrerPolicy="no-referrer"` 与官方一致:头像 URL 由 Platform 给出,
10
+ * 请求它时不该把本页地址带出去。
11
+ *
12
+ * **加载失败回落成空圆底**,不显示碎图 —— 头像缺失是常态(平台可以没配),
13
+ * 而一个破图图标比一个安静的圆底难看得多。失败后**不再重试**(同一个 URL 重试也是失败)。
14
+ * @module dsh-ds-balance/client/settings/AccountAvatar
15
+ */
16
+ import type { ReactNode } from 'react';
17
+ /** 属性。 */
18
+ export interface AccountAvatarProps {
19
+ /** 头像 URL;`null` 表示平台没给头像。 */
20
+ url: string | null;
21
+ }
22
+ /**
23
+ * 渲染账号头像。
24
+ * @param props - 头像 URL。
25
+ * @returns 头像元素;没有 URL 或加载失败时是一个空圆底。
26
+ */
27
+ export declare function AccountAvatar({ url }: AccountAvatarProps): ReactNode;
@@ -1,7 +1,14 @@
1
1
  /**
2
2
  * 「DeepSeek 余额」在 bundle 详情页里的配置卡片:标题与描述由页面画,卡内只有控件与保存。
3
- * 只做配置:连接、展示、阈值、刷新四组;不展示任何额度信息,也不按阈值给任何东西上色。
3
+ * 只做配置与**来源状态**:不展示任何额度信息,也不按阈值给任何东西上色。
4
4
  * 分组按使用频率排序:刷新三项有合理默认值,放最后。
5
+ *
6
+ * **「连接」组在 3.0 重做成只读状态展示**:从前它是一列输入框(一个继承官方的只读
7
+ * 凭据框 + 可编辑的接口地址 + 二级「自定义设置」里的引用名),但那些输入要么是假的
8
+ * (接口地址只服务官方、密钥框根本不能填),要么没有使用场景。现在它只回答一件事:
9
+ * **两条取数途径各自通不通**,以及一个真打上游的测试按钮。
10
+ *
11
+ * 判据住在后端(`GET /api/v1/sources`),本文件只渲染 —— 见 [use-sources.ts](use-sources.ts)。
5
12
  * @module dsh-ds-balance/client/settings/BalanceSettingsCard
6
13
  */
7
14
  import type { LocaleKey } from '../locales.ts';
@@ -5,9 +5,9 @@
5
5
  */
6
6
  import type { ReactNode } from 'react';
7
7
  import type { TagTone } from '@deepseek-ai/dsh-client-ui-primitives';
8
- /** 一个配置分组的属性。展开状态由调用方持有:DisclosureRow 是完全受控组件。 */
8
+ /** 一个配置分组的属性。展开状态由调用方持有。 */
9
9
  export interface FieldGroupProps {
10
- /** 折叠头左侧的图标;展开后会被原语自己的 chevron 取代。 */
10
+ /** 折叠头左侧的图标。**常态一直显示**,只在悬浮(或键盘聚焦)时让位给箭头。 */
11
11
  icon: ReactNode;
12
12
  /** 折叠头标题,收起态也显示。 */
13
13
  title: string;
@@ -21,8 +21,18 @@ export interface FieldGroupProps {
21
21
  }
22
22
  /**
23
23
  * 一个可折叠的配置分组。
24
- * 折叠头用原语 DisclosureRow(不自己画),展开体由原语在 open 时条件渲染、无动画。
25
- * 各组独立展开,不做手风琴:官方 PluginCard 的注释写明多项同时展开是刻意的。
24
+ *
25
+ * **折叠头是自绘的,不是原语 `DisclosureRow`** —— 这一条与本仓规则层原先的写法相反,
26
+ * 所以理由写在这里:原语在**展开**时无条件把图标换成上箭头(`DisclosureRow.tsx` 里是
27
+ * `const leading = open ? <IconChevronUpOutlineRegular/> : collapsedLeading`),
28
+ * 而它那个 `previewChevron` 只作用于**收起**那一支。于是「常态显示组图标、悬浮才换箭头」
29
+ * 在展开态**无法表达**,而组图标正是「这是哪一组」唯一的视觉线索(收起态有、展开态没有,
30
+ * 反而是最需要它的时候丢了)。
31
+ *
32
+ * 取值逐条照抄官方那份 CSS(24px 行高、16px 图标框、6px 间距、13px 标题、
33
+ * tertiary → secondary、100ms 过渡,见 [fields.module.css](fields.module.css) 的注释),
34
+ * 并由 [test/redlines.test.ts](../../../test/redlines.test.ts) 与官方文件**逐值比对**防漂。
35
+ * 无障碍面照原语保留:`role="button"` + `tabIndex` + `aria-expanded` + Enter/Space。
26
36
  * @param props - 图标、标题、可选说明、受控展开状态与字段。
27
37
  * @returns 分组元素。
28
38
  */
@@ -95,42 +105,62 @@ export interface TextControlProps {
95
105
  */
96
106
  export declare function TextControl(props: TextControlProps): import("react").JSX.Element;
97
107
  /**
98
- * 只读输入:字段照常渲染,但不可编辑,**框内不写任何文字**。
108
+ * 一条取数途径的状态。
99
109
  *
100
- * 不从「隐藏字段」也不从「换一块只读文本」走:仍是真输入框,与官方凭据字段同一形态。
101
- * **只给 `readOnly`,不给 `disabled`** —— 官方「网页搜索」卡片里配好的密钥就是一个常态空框
102
- * (不降透明度),置灰只属于整份设置不可写的那种情况。
103
- * 只读的因由由标签行右侧的状态徽章与它下方的说明行承担,那两处的措辞来自词典。
104
- *
105
- * **为什么没有 placeholder**:灰字写在框里读起来像「这里该填但没填」。
106
- * **交互一律不响应**:它看着像输入框,但悬停不换描边、指针不是插入符、点了也没有焦点环
107
- * (`inputStatic` 那条规则,含 `pointer-events: none`)—— 看着像能编辑才是错的。
110
+ * **只有三样东西**,因为它们各自回答一个不同的问题,彼此不重复(这是本轮的设计约束):
111
+ * - `tone` → 左边那盏灯:**这条途径现在能不能用**(绿 / 红);
112
+ * - `identity` → 行右槽:**是哪一份凭据**(掩码 key / 账号名),没有就留空;
113
+ * - `detail` → 第二行:**它是从哪来的**(凭据取自哪一层 / 脱敏联系方式),没有就不渲染这一行。
108
114
  */
109
- export interface ReadOnlyControlProps {
110
- id: string;
115
+ export interface SourceStatus {
116
+ /** 左侧状态灯:`ok` 绿、`missing` 红。 */
117
+ readonly tone: 'ok' | 'missing';
118
+ /** 右槽的凭据身份;空串表示这个槽留空(没有身份可报,灯已经说了状态)。 */
119
+ readonly identity: string;
120
+ /** 第二行的来历;空串表示整个不渲染这一行。 */
121
+ readonly detail: string;
111
122
  }
112
123
  /**
113
- * 渲染只读输入。
114
- * @param props - 控件 id。
115
- * @returns 输入框元素。
124
+ * 右槽的**临时**内容:正在测、或刚测完。
125
+ *
126
+ * 它出现在**凭据身份左侧**,几秒后自己消失 —— 身份**从头到尾都在**,
127
+ * 不会被它顶掉。替换身份会让那一格闪一下,那正是要避免的突兀。
128
+ * 因为与身份同处一行、都不换行,出现与消失也**不改变行高**。
116
129
  */
117
- export declare function ReadOnlyControl(props: ReadOnlyControlProps): import("react").JSX.Element;
118
- /** 二级折叠:卡片里的「自定义设置」。 */
119
- export interface DetailsGroupProps {
120
- title: string;
121
- /** 初始展开状态;省略即收起。 */
122
- defaultOpen?: boolean;
123
- children: ReactNode;
130
+ export type SourceLive = {
131
+ readonly kind: 'busy';
132
+ } | {
133
+ readonly kind: 'result';
134
+ readonly ok: boolean;
135
+ readonly text: string;
136
+ };
137
+ /** 一条取数途径的状态行。 */
138
+ export interface SourceRowProps {
139
+ /** 途径名(「API Key」/「账号登录」)。 */
140
+ label: string;
141
+ status: SourceStatus;
142
+ /** 行首的灯或头像;省略时按 `status.tone` 画灯。 */
143
+ leading?: ReactNode;
144
+ /** 右槽的临时内容;为 null 时显示 `status.identity`。 */
145
+ live?: SourceLive | null;
146
+ /** 右槽是否用等宽字体(掩码 key 是标识符,账号名不是)。 */
147
+ monoIdentity?: boolean;
124
148
  }
125
149
  /**
126
- * 渲染二级折叠「自定义设置」。
150
+ * 渲染一条取数途径的状态行。
151
+ *
152
+ * **这是只读展示,不是表单字段**:它不接 `form`,也没有草稿与撤销。
153
+ * 行首是一盏灯(或账号那行的头像),行名后面**紧跟**凭据身份,第二行才写来历。
154
+ * 灯 8×8 逐值抄官方 `ui-settings-models` 的 `.credentialDot`。
127
155
  *
128
- * **受控但跟手**:`open` 由 state 持有,官方 DisclosureRow 的展开体只在 open 时条件渲染,
129
- * 卡片每次重渲染(每敲一个字都会)不会把用户展开的块弹回去。
130
- * @param props - 标题、初始状态与内容。
131
- * @returns 折叠块元素。
156
+ * **右槽是「临时内容 + 凭据身份」,不是「临时内容或身份」**:身份常驻,
157
+ * 测试的转圈与结果排在它**左边**,几秒后自行消失。替换身份会让那一格闪一下。
158
+ * 整槽**永远不换行**(`nowrap` + 省略号):结果长短不一,一旦换行,行高就会在
159
+ * 按下去的一瞬间跳一下。
160
+ * @param props - 名称、状态、临时内容与可选的行首元素。
161
+ * @returns 状态行元素。
132
162
  */
133
- export declare function DetailsGroup(props: DetailsGroupProps): import("react").JSX.Element;
163
+ export declare function SourceRow(props: SourceRowProps): import("react").JSX.Element;
134
164
  /** 选择器的一个选项。 */
135
165
  export interface SelectorOption {
136
166
  readonly id: string;
@@ -155,20 +185,21 @@ export interface SelectorControlProps {
155
185
  * @returns 选择器元素。
156
186
  */
157
187
  export declare function SelectorControl(props: SelectorControlProps): import("react").JSX.Element;
158
- /** 动作行与它的结果行。 */
188
+ /**
189
+ * 动作行:一个按钮。
190
+ *
191
+ * **它不再带结果行,也不再自己出转圈**(3.0):测试的动画与结果都发生在**每一行的右槽**里
192
+ * (结果在那里停留 `RESULT_TTL_MS` 后自行消失)。按钮这边只换文案(「正在测试…」)——
193
+ * 三处各转一个圈只会让这一小块变吵,而真正要盯的是那两行的右槽。
194
+ */
159
195
  export interface ActionRowProps {
160
196
  label: string;
161
197
  disabled: boolean;
162
- /** 结果文案;无结果时为 null,此时不渲染结果行。 */
163
- result: {
164
- readonly ok: boolean;
165
- readonly text: string;
166
- } | null;
167
198
  onClick: () => void;
168
199
  }
169
200
  /**
170
- * 渲染一个动作按钮与它的状态结果行。
171
- * @param props - 按钮文案、禁用态、结果与回调。
201
+ * 渲染一个动作按钮。
202
+ * @param props - 按钮文案、禁用态与回调。
172
203
  * @returns 动作行元素。
173
204
  */
174
205
  export declare function ActionRow(props: ActionRowProps): import("react").JSX.Element;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * 两条取数途径的**展示判定**:把后端给的状态翻成「这一行画什么」。
3
+ *
4
+ * **为什么单独成一个模块**:这套判定是「连接」组的心脏(哪句话、哪个色调、哪行事实),
5
+ * 而它原先写在卡片组件里 —— 组件引 `ui-primitives`,测试环境渲不出来
6
+ * (见 [vitest.config.ts](../../../vitest.config.ts) 的说明:CSS 解析不了),
7
+ * 于是**这段最容易错的逻辑一行覆盖都没有**。抽成纯函数之后它可以被直接断言。
8
+ *
9
+ * 模块里没有 React、没有 `t` 之外的依赖,也不碰 `ctx`。
10
+ * @module dsh-ds-balance/client/settings/source-status
11
+ */
12
+ import type { LocaleKey } from '../locales.ts';
13
+ import type { AccountSourceInfo, KeySourceInfo } from '../data.ts';
14
+ import type { SourceStatus } from './fields.tsx';
15
+ /** 词典读取器。 */
16
+ export type Translate = (key: LocaleKey) => string;
17
+ /**
18
+ * Key 那条途径的展示状态。
19
+ *
20
+ * **判据只有这一处**:`configured` 来自后端(它已经问过官方 `describe()`,
21
+ * 也在没有 seam 时退到解析链判过),本函数只决定「显示什么」。
22
+ *
23
+ * 右槽给**凭据身份**(首尾片段掩码,与平台控制台同形、不可逆);
24
+ * 第二行给**来历**(这把凭据从哪一层取到的)。
25
+ * 没有凭据时两个都留空 —— 左边的红灯已经说了「这条途径现在没在用」,
26
+ * 再补一句「未配置」只是把同一个事实说两遍,还把行撑高。
27
+ * @param key - 后端给的 Key 状态。
28
+ * @param t - 词典读取器。
29
+ * @returns 灯色、右槽身份与第二行来历。
30
+ */
31
+ export declare function keyStatusOf(key: KeySourceInfo, t: Translate): SourceStatus;
32
+ /**
33
+ * 账号那条途径的展示状态。
34
+ *
35
+ * **三档,与 Key 那条有意不对称**:账号未登录是**正常状态**(很多人只用 API Key),
36
+ * 所以它和「没配 key」一样只留一盏红灯、右槽与第二行都留空;
37
+ * 但**「本部署没有账号服务」必须说出来** —— 那一行整空会读成「这插件坏了」,
38
+ * 而它其实是部署事实,用户做什么都没用。
39
+ * @param account - 后端给的账号状态。
40
+ * @param t - 词典读取器。
41
+ * @returns 灯色、右槽身份(账号名)与第二行(脱敏联系方式)。
42
+ */
43
+ export declare function accountStatusOf(account: AccountSourceInfo, t: Translate): SourceStatus;
@@ -13,7 +13,7 @@
13
13
  * @module dsh-ds-balance/client/settings/use-config-form
14
14
  */
15
15
  import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client';
16
- /** 配置表单的键域:11 个字段都是标量,按普通对象收窄。 */
16
+ /** 配置表单的键域:9 个字段都是标量,按普通对象收窄。 */
17
17
  export type ConfigFormOf = ConfigForm<Record<string, unknown>>;
18
18
  /** 一次字段写入。 */
19
19
  export type FieldWrite = {
@@ -145,15 +145,6 @@ export interface ConfigFormState {
145
145
  /** 上一次保存是否没有落定;下一次编辑或保存会清掉它。 */
146
146
  readonly failed: boolean;
147
147
  }
148
- /** 测试连接的状态。 */
149
- export interface TestState {
150
- /** 是否正在测试。 */
151
- readonly running: boolean;
152
- /** 结果;未出结果时为 null。 */
153
- readonly ok: boolean | null;
154
- /** 失败原因;成功或未出结果时为空串。 */
155
- readonly message: string;
156
- }
157
148
  /** 表单暴露给卡片的面。 */
158
149
  export interface ConfigFormApi {
159
150
  /** 整体状态。 */
@@ -176,24 +167,7 @@ export interface ConfigFormApi {
176
167
  touched(field: string): boolean;
177
168
  /** 记一次失焦。 */
178
169
  touch(field: string): void;
179
- /** 测试连接状态。 */
180
- readonly test: TestState;
181
- /** 跑一次本地模拟的连接测试。 */
182
- runTest(): void;
183
170
  }
184
- /** 本地模拟的连接测试耗时。 */
185
- export declare const TEST_LATENCY_MS = 800;
186
- /**
187
- * 判定一次模拟连接测试是否失败。
188
- * 规则:Base URL **留空合法**(走官方默认地址),非空时必须以 http:// 或 https:// 开头;
189
- * API Key 与引用名不能同时为空。
190
- * 返回的是宿主诊断风格的英文短句,与官方卡片直接展示宿主诊断的做法一致。
191
- * @param baseUrl - 当前草稿或生效的 Base URL。
192
- * @param apiKey - 当前草稿或生效的 API Key。
193
- * @param apiKeyRef - 当前草稿或生效的引用名。
194
- * @returns 失败原因;可通过时为 null。
195
- */
196
- export declare function probeFailure(baseUrl: string, apiKey: string, apiKeyRef: string): string | null;
197
171
  /**
198
172
  * 写一个字段。
199
173
  *
@@ -0,0 +1,38 @@
1
+ /**
2
+ * 「连接」组的状态:**一处读、一处判**。
3
+ *
4
+ * 它替换了从前散在三处的逻辑:
5
+ * - `use-credential-state.ts` 的 `useEffect([ref])`(只在引用名变时重读);
6
+ * - `BalanceSettingsCard.tsx` 的 `CREDENTIAL_BADGE` 四档映射;
7
+ * - `data.ts` 里那份形状守卫。
8
+ *
9
+ * **判据现在住在后端**(`GET /api/v1/sources`):只有后端同时持有 `credentials` 与
10
+ * `deepseekAccount` 两个接缝,也只有它能订阅凭据变更事件。界面这边只做两件事 ——
11
+ * 读、渲染。
12
+ *
13
+ * **读取时机有三个,覆盖全部真实流程**:
14
+ * 1. 挂载(打开 Plugins 页);
15
+ * 2. 窗口重新获得焦点 —— 用户去官方模型页存了 key 再切回来,走的就是这条;
16
+ * 3. 手动 `refresh()`(点 **Test** 按钮时顺带)。
17
+ *
18
+ * 不轮询:凭据是低频变化的东西,而卡片是低频界面,轮询只是白烧请求。
19
+ * @module dsh-ds-balance/client/settings/use-sources
20
+ */
21
+ import { type SourcesResponse } from '../data.ts';
22
+ /** 这个 hook 交出去的面。 */
23
+ export interface SourcesApi {
24
+ /** 当前状态;首帧是保守快照(两条途径都「未确认」)。 */
25
+ readonly sources: SourcesResponse;
26
+ /** 是否正在读。 */
27
+ readonly loading: boolean;
28
+ /** 强制重读一次(绕过后端缓存)。 */
29
+ refresh: () => Promise<void>;
30
+ }
31
+ /**
32
+ * 订阅两条取数途径的状态。
33
+ *
34
+ * @param enabled - 卡片可不可见。宿主没在服务这个命名空间时卡片什么都不渲染,
35
+ * 那时**不该**发请求 —— 所以由调用方把 `available` 传进来。
36
+ * @returns 状态与重读入口。
37
+ */
38
+ export declare function useSources(enabled: boolean): SourcesApi;
package/lib/version.d.ts CHANGED
@@ -8,5 +8,5 @@
8
8
  /** 线上 schema 版本。响应里逐条回传,消费方据此判断兼容性。 */
9
9
  export declare const SCHEMA_VERSION = 1;
10
10
  /** 插件版本。与 `package.json` 的 `version` 一致(有测试兜底)。 */
11
- export declare const PLUGIN_VERSION = "2.3.0";
11
+ export declare const PLUGIN_VERSION = "3.0.0";
12
12
  //# sourceMappingURL=version.d.ts.map
package/lib/version.js CHANGED
@@ -8,5 +8,5 @@
8
8
  /** 线上 schema 版本。响应里逐条回传,消费方据此判断兼容性。 */
9
9
  export const SCHEMA_VERSION = 1;
10
10
  /** 插件版本。与 `package.json` 的 `version` 一致(有测试兜底)。 */
11
- export const PLUGIN_VERSION = '2.3.0';
11
+ export const PLUGIN_VERSION = '3.0.0';
12
12
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ds-balance",
3
- "version": "2.3.0",
3
+ "version": "3.0.0",
4
4
  "icon": "./icon.svg",
5
5
  "description": "DSH plugin: shows the DeepSeek account balance at the bottom of the sidebar, with a configuration card on the Plugins page.",
6
6
  "keywords": [
@@ -15,12 +15,12 @@
15
15
  "author": "zlZayn",
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "git+https://github.com/zlZayn/dsh-ds-balance.git"
18
+ "url": "git+https://github.com/dsh-plugin-lab/dsh-ds-balance.git"
19
19
  },
20
20
  "bugs": {
21
- "url": "https://github.com/zlZayn/dsh-ds-balance/issues"
21
+ "url": "https://github.com/dsh-plugin-lab/dsh-ds-balance/issues"
22
22
  },
23
- "homepage": "https://github.com/zlZayn/dsh-ds-balance#readme",
23
+ "homepage": "https://github.com/dsh-plugin-lab/dsh-ds-balance#readme",
24
24
  "type": "module",
25
25
  "main": "./lib/index.js",
26
26
  "types": "./lib/index.d.ts",
@@ -43,11 +43,11 @@
43
43
  "!lib/**/*.map",
44
44
  "cordis.patch.yml",
45
45
  "README.md",
46
- "README_en.md",
46
+ "README_zh.md",
47
47
  "LICENSE"
48
48
  ],
49
49
  "engines": {
50
- "dsh": ">=0.2.0-rc.1",
50
+ "dsh": "^0.1.7-rc.1 || ^0.2.0-rc.1",
51
51
  "node": ">=20"
52
52
  },
53
53
  "dsh": {
@@ -64,7 +64,7 @@
64
64
  "scripts": {
65
65
  "build": "tsc && tsc -p tsconfig.client.json && node scripts/build-client.mjs",
66
66
  "typecheck": "tsc --noEmit && tsc -p tsconfig.client.json --noEmit && tsc -p tsconfig.test.json",
67
- "test": "npm run build && vitest run",
67
+ "test": "pnpm run build && vitest run",
68
68
  "test:watch": "vitest",
69
69
  "test:contract": "vitest run --config vitest.contract.config.ts",
70
70
  "lint": "eslint .",
@@ -75,16 +75,16 @@
75
75
  },
76
76
  "peerDependencies": {
77
77
  "@deepseek-ai/cordis": "^4.0.3",
78
- "@deepseek-ai/dsh-client-connection": ">=0.2.0-rc.1",
79
- "@deepseek-ai/dsh-client-locale": ">=0.2.0-rc.1",
80
- "@deepseek-ai/dsh-client-ui-primitives": ">=0.2.0-rc.1",
81
- "@deepseek-ai/dsh-client-ui-settings": ">=0.2.0-rc.1",
82
- "@deepseek-ai/dsh-client-ui-slots": ">=0.2.0-rc.1",
83
- "@deepseek-ai/dsh-credentials": ">=0.2.0-rc.1",
84
- "@deepseek-ai/dsh-deepseek-account-platform": ">=0.2.0-rc.1",
85
- "@deepseek-ai/dsh-home-paths": ">=0.2.0-rc.1",
86
- "@deepseek-ai/dsh-settings": ">=0.2.0-rc.1",
87
- "@deepseek-ai/dsh-storage-domain": ">=0.2.0-rc.1",
78
+ "@deepseek-ai/dsh-client-connection": "^0.1.7-rc.1 || ^0.2.0-rc.1",
79
+ "@deepseek-ai/dsh-client-locale": "^0.1.7-rc.1 || ^0.2.0-rc.1",
80
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.1 || ^0.2.0-rc.1",
81
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.7-rc.1 || ^0.2.0-rc.1",
82
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.1 || ^0.2.0-rc.1",
83
+ "@deepseek-ai/dsh-credentials": "^0.1.7-rc.1 || ^0.2.0-rc.1",
84
+ "@deepseek-ai/dsh-deepseek-account-platform": "^0.1.7-rc.1 || ^0.2.0-rc.1",
85
+ "@deepseek-ai/dsh-home-paths": "^0.1.7-rc.1 || ^0.2.0-rc.1",
86
+ "@deepseek-ai/dsh-settings": "^0.1.7-rc.1 || ^0.2.0-rc.1",
87
+ "@deepseek-ai/dsh-storage-domain": "^0.1.7-rc.1 || ^0.2.0-rc.1",
88
88
  "@deepseek-ai/schemastery": "^3.18.3",
89
89
  "react": "^18.3.1",
90
90
  "react-dom": "^18.3.1"
@@ -92,26 +92,26 @@
92
92
  "devDependencies": {
93
93
  "@deepseek-ai/cordis": "^4.0.3",
94
94
  "@deepseek-ai/cordis-plugin-loader": "^1.0.4",
95
- "@deepseek-ai/dsh-client-connection": ">=0.2.0-rc.1",
96
- "@deepseek-ai/dsh-client-locale": ">=0.2.0-rc.1",
97
- "@deepseek-ai/dsh-client-ui-plugin-manager": ">=0.2.0-rc.1",
98
- "@deepseek-ai/dsh-client-ui-primitives": ">=0.2.0-rc.1",
99
- "@deepseek-ai/dsh-client-ui-renderer": ">=0.2.0-rc.1",
100
- "@deepseek-ai/dsh-client-ui-settings": ">=0.2.0-rc.1",
101
- "@deepseek-ai/dsh-client-ui-sidebar": ">=0.2.0-rc.1",
102
- "@deepseek-ai/dsh-client-ui-slots": ">=0.2.0-rc.1",
103
- "@deepseek-ai/dsh-credentials": ">=0.2.0-rc.1",
104
- "@deepseek-ai/dsh-deepseek-account-platform": ">=0.2.0-rc.1",
105
- "@deepseek-ai/dsh-home-paths": ">=0.2.0-rc.1",
106
- "@deepseek-ai/dsh-settings": ">=0.2.0-rc.1",
107
- "@deepseek-ai/dsh-storage-domain": ">=0.2.0-rc.1",
95
+ "@deepseek-ai/dsh-client-connection": "^0.1.7-rc.1 || ^0.2.0-rc.1",
96
+ "@deepseek-ai/dsh-client-locale": "^0.1.7-rc.1 || ^0.2.0-rc.1",
97
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "^0.1.7-rc.1 || ^0.2.0-rc.1",
98
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.1 || ^0.2.0-rc.1",
99
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-rc.1 || ^0.2.0-rc.1",
100
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.7-rc.1 || ^0.2.0-rc.1",
101
+ "@deepseek-ai/dsh-client-ui-sidebar": "^0.1.7-rc.1 || ^0.2.0-rc.1",
102
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.1 || ^0.2.0-rc.1",
103
+ "@deepseek-ai/dsh-credentials": "^0.1.7-rc.1 || ^0.2.0-rc.1",
104
+ "@deepseek-ai/dsh-deepseek-account-platform": "^0.1.7-rc.1 || ^0.2.0-rc.1",
105
+ "@deepseek-ai/dsh-home-paths": "^0.1.7-rc.1 || ^0.2.0-rc.1",
106
+ "@deepseek-ai/dsh-settings": "^0.1.7-rc.1 || ^0.2.0-rc.1",
107
+ "@deepseek-ai/dsh-storage-domain": "^0.1.7-rc.1 || ^0.2.0-rc.1",
108
108
  "@deepseek-ai/schemastery": "^3.18.3",
109
109
  "@eslint/js": "^10.0.1",
110
110
  "@types/node": "^20.0.0",
111
111
  "@types/react": "~18.3.1",
112
112
  "@types/react-dom": "~18.3.1",
113
113
  "clsx": "^2.1.1",
114
- "esbuild": "^0.21.5",
114
+ "esbuild": "^0.28.2",
115
115
  "eslint": "^10.11.0",
116
116
  "eslint-config-prettier": "^10.1.8",
117
117
  "globals": "^17.12.0",
@@ -120,7 +120,7 @@
120
120
  "react-dom": "^18.3.1",
121
121
  "typescript": "^5.4.0",
122
122
  "typescript-eslint": "^8.70.1",
123
- "vitest": "^2.0.0"
123
+ "vitest": "^4.1.11"
124
124
  },
125
125
  "dependencies": {
126
126
  "zod": "^4.6.5"