dsh-deepseek-account 0.1.7 → 0.1.9

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.9 - 2026-09-13
4
+
5
+ - Wait for both Connection and its HTTP server before registering the balance RPC, fixing missing routes after upgrading Harness; restore the route when the server restarts.
6
+ - Add real Host lifecycle regression coverage for Harness 0.1.5-rc.2.
7
+ - Declare compatibility with Harness 0.1.5-rc.2 and Cordis 4.0.2 alongside the existing versions.
8
+
9
+ ## 0.1.8 - 2026-08-31
10
+
11
+ - Override the Harness list-slot anchor's inline `display: contents` before stacking full-width sidebar footer actions, so the Cordis and account entries actually share a vertical flex container.
12
+
3
13
  ## 0.1.7 - 2026-08-31
4
14
 
5
15
  - Stack sidebar footer actions vertically when official full-width actions such as Cordis Plugin are present, preventing the account entry from overflowing beyond the sidebar edge.
package/README.en.md CHANGED
@@ -28,13 +28,13 @@ Only DeepSeek has a top-up entry. Grok uses the remaining percentage supplied by
28
28
  Requirements:
29
29
 
30
30
  - Node.js `>=22.19.0 <25`
31
- - DeepSeek Harness in the `0.1.1-rc.2` line
31
+ - DeepSeek Harness `0.1.1-rc.2` or `0.1.5-rc.2` (live balance acceptance for this release used `0.1.5-rc.2`)
32
32
  - `DEEPSEEK_API_KEY` configured in Harness model settings when reading a DeepSeek balance
33
33
 
34
34
  Install the current stable version:
35
35
 
36
36
  ```sh
37
- dsh plugin --profile web add dsh-deepseek-account@0.1.7
37
+ dsh plugin --profile web add dsh-deepseek-account@0.1.9
38
38
  dsh web
39
39
  ```
40
40
 
package/README.md CHANGED
@@ -28,13 +28,13 @@ DeepSeek Harness 的独立账户插件:在一个侧栏入口中展示当前对
28
28
  运行环境:
29
29
 
30
30
  - Node.js `>=22.19.0 <25`
31
- - DeepSeek Harness `0.1.1-rc.2` 系列
31
+ - DeepSeek Harness `0.1.1-rc.2` 或 `0.1.5-rc.2`(本次在 `0.1.5-rc.2` 完成真实余额验收)
32
32
  - 已在 Harness 模型设置中配置 `DEEPSEEK_API_KEY`(仅查看 DeepSeek 余额时需要)
33
33
 
34
34
  安装当前稳定版本:
35
35
 
36
36
  ```sh
37
- dsh plugin --profile web add dsh-deepseek-account@0.1.7
37
+ dsh plugin --profile web add dsh-deepseek-account@0.1.9
38
38
  dsh web
39
39
  ```
40
40
 
@@ -375,7 +375,7 @@ window.__ModuleLoader__.load({
375
375
  const style = document.createElement("style")
376
376
  style.dataset.dshDeepseekAccount = ""
377
377
  style.textContent = ".dsh-deepseek-account-card{display:grid;width:100%;min-height:48px;margin:3px 0;padding:4px 3px;border:0;border-radius:8px;grid-template-columns:22px minmax(0,1fr) 16px;align-items:center;gap:10px;color:inherit;background:transparent;cursor:pointer;font:inherit;text-align:left}.dsh-deepseek-account-card:hover{background:transparent}.dsh-deepseek-account-rail:hover{background:var(--dsw-alias-interactive-bg-hover)}.dsh-deepseek-account-symbol{font-weight:650;text-align:center}.dsh-deepseek-account-copy{display:flex;min-width:0;flex-direction:column}.dsh-deepseek-account-copy small{overflow:hidden;color:var(--dsw-alias-label-tertiary);font-size:11px;text-overflow:ellipsis;white-space:nowrap}.dsh-deepseek-account-rail{display:grid;width:36px;height:36px;margin:4px auto;border:0;border-radius:8px;place-items:center;color:inherit;background:transparent;cursor:pointer;font-size:10px;font-weight:650}.dsh-deepseek-account-page{box-sizing:border-box;width:min(860px,100%);padding:8px 4px 40px;color:var(--dsw-alias-label-primary)}.dsh-deepseek-account-page h2{margin:0}.dsh-deepseek-account-description{color:var(--dsw-alias-label-secondary)}.dsh-deepseek-account-panel{margin-top:14px;padding:18px;border:1px solid var(--dsw-alias-border-l2);border-radius:16px;background:var(--dsw-alias-bg-layer-1)}.dsh-deepseek-account-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.dsh-deepseek-account-head h3{margin:0}.dsh-deepseek-account-head button,.dsh-deepseek-account-topup{min-height:34px;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;padding:0 13px;color:inherit;background:transparent;font:inherit}.dsh-deepseek-account-balances{display:grid;margin-top:14px;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}.dsh-deepseek-account-balance{display:flex;flex-direction:column;gap:5px;padding:14px;border-radius:12px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-interactive-bg-hover))}.dsh-deepseek-account-balance strong{font-size:22px}.dsh-deepseek-account-balance span,.dsh-deepseek-account-panel p,.dsh-deepseek-account-panel small{color:var(--dsw-alias-label-secondary);font-size:12px}.dsh-deepseek-account-warning{color:var(--dsw-alias-state-warn-label)!important}.dsh-deepseek-account-topup{display:inline-flex;align-items:center;color:#fff;text-decoration:none;background:var(--dsw-alias-state-business-primary)}"
378
- style.textContent += "div:has(>.dsh-deepseek-account-card),div:has(>.dsh-deepseek-account-rail){flex-direction:column}.dsh-deepseek-account-provider-icon{display:block;width:18px;height:18px;margin:auto}.dsh-deepseek-account-copy{gap:2px}.dsh-deepseek-account-copy small{overflow:visible;line-height:1.35;overflow-wrap:anywhere;text-overflow:clip;white-space:normal}.dsh-deepseek-account-quota-windows{display:grid;gap:4px}.dsh-deepseek-account-quota-window{display:grid;min-width:0;padding:1px 0;border-radius:0;grid-template-columns:auto minmax(0,1fr);align-items:baseline;column-gap:6px;background:transparent}.dsh-deepseek-account-quota-period{font-size:11px;font-weight:650}.dsh-deepseek-account-quota-remaining{min-width:0;color:var(--dsw-alias-label-secondary);font-size:11px;font-weight:600}.dsh-deepseek-account-quota-reset{grid-column:1/-1;font-size:10px!important;line-height:1.25!important}"
378
+ style.textContent += "div[data-slot=\"sidebar.footer.action\"]:has(>.dsh-deepseek-account-card),div[data-slot=\"sidebar.footer.action\"]:has(>.dsh-deepseek-account-rail){display:flex!important;width:100%;min-width:0;flex-direction:column}.dsh-deepseek-account-provider-icon{display:block;width:18px;height:18px;margin:auto}.dsh-deepseek-account-copy{gap:2px}.dsh-deepseek-account-copy small{overflow:visible;line-height:1.35;overflow-wrap:anywhere;text-overflow:clip;white-space:normal}.dsh-deepseek-account-quota-windows{display:grid;gap:4px}.dsh-deepseek-account-quota-window{display:grid;min-width:0;padding:1px 0;border-radius:0;grid-template-columns:auto minmax(0,1fr);align-items:baseline;column-gap:6px;background:transparent}.dsh-deepseek-account-quota-period{font-size:11px;font-weight:650}.dsh-deepseek-account-quota-remaining{min-width:0;color:var(--dsw-alias-label-secondary);font-size:11px;font-weight:600}.dsh-deepseek-account-quota-reset{grid-column:1/-1;font-size:10px!important;line-height:1.25!important}"
379
379
  document.head.append(style)
380
380
  return () => style.remove()
381
381
  }
@@ -6,5 +6,10 @@ export const inject = ["credentials"]
6
6
 
7
7
  export function apply(ctx) {
8
8
  const accountBalance = createDeepSeekAccountBalance({ credentials: ctx.credentials })
9
- ctx.inject(["connection"], (connectionCtx) => registerDeepSeekAccountRpc(connectionCtx, accountBalance))
9
+ // Connection can become ready before its HTTP carrier in newer Harness versions.
10
+ // Own the route in both services' lifetime so server reloads register it again.
11
+ ctx.inject(["connection", "webServer"], (connectionCtx) => {
12
+ // Connection already owns the registration effect in this injection fiber.
13
+ registerDeepSeekAccountRpc(connectionCtx, accountBalance)
14
+ })
10
15
  }
@@ -30,6 +30,8 @@ current session list ── running true→false ──> one forced account refr
30
30
 
31
31
  `src/host/index.mjs` 是 npm 包的 Host 入口。它的接口只有 Harness 插件约定的 `name`、`inject` 和 `apply(ctx)`,负责组合 credential adapter、余额模块与 connection adapter,不包含浏览器 UI。
32
32
 
33
+ HTTP RPC 注册必须同时等待 `connection` 和 `webServer`。新版 Harness 可先提供 Connection、后启动 HTTP carrier;仅等待 Connection 会让路由注册失败,客户端收到 HTTP 405。路由归属两项服务的注入生命周期,HTTP 服务重启时自动移除并重新注册。
34
+
33
35
  ### Account balance module
34
36
 
35
37
  `src/internal/account-balance.mjs` 隐藏 DeepSeek 请求、缓存、并发合并、错误分类和响应投影。它的接口是:
@@ -70,7 +72,7 @@ await balance.read({ force? })
70
72
 
71
73
  设置导航图标 adapter 只匹配插件拥有的中英文 label,以内联高优先级样式隐藏 Harness 原图标并挂载唯一鲸鱼图标。它必须在同一按钮被 Harness 原位重绘后重新隐藏新的原图标,重复 DOM 通知不得重复挂载;插件卸载时必须断开观察、移除鲸鱼并恢复接触过的全部原图标及其原始样式。Harness 将来提供正式 section 图标接口后,应删除这个临时 adapter。
72
74
 
73
- `sidebar.footer.action` 是 list slot,但官方 sidebar 容器默认使用单行 flex,官方 Cordis 入口本身又是不可收缩的全宽元素。本插件通过只匹配“直接包含本插件 card/rail 的父容器”将该 footer 改为纵向排列;不得依赖 sidebar 或 Cordis 的构建期哈希类名,也不得覆盖官方入口自身的宽度、定位或弹层样式。
75
+ `sidebar.footer.action` 是 list slot,但官方 sidebar 容器默认使用单行 flex,官方 Cordis 入口本身又是不可收缩的全宽元素。Renderer 的 list-slot anchor 使用内联 `display: contents`,因此只设置 `flex-direction` 不会形成布局容器;本插件必须匹配同时直接包含本插件 card/rail 的 `data-slot="sidebar.footer.action"` anchor,以 `display:flex!important` 覆盖该内联值后再纵向排列。不得依赖 sidebar 或 Cordis 的构建期哈希类名,也不得覆盖官方入口自身的宽度、定位或弹层样式。
74
76
 
75
77
  ### Optional Provider adapters
76
78
 
@@ -18,6 +18,14 @@
18
18
  - Grok/Codex 必须保持可选,它们缺失时 DeepSeek 仍可工作。
19
19
  - 稳定版只承诺最新版本获得安全修复;破坏性变化需要在 README、CHANGELOG 和发布说明中突出。
20
20
 
21
+ Host 生命周期回归使用真实 Cordis/Connection 模块,覆盖 HTTP 服务延迟启动、重启和插件卸载。CI 自动安装隔离的 0.1.5-rc.2 fixture;本地可复用已安装的 Harness:
22
+
23
+ ```sh
24
+ DSH_TEST_NODE_MODULES=/absolute/path/to/harness/node_modules node --test test/host-runtime.test.mjs
25
+ ```
26
+
27
+ 未设置此变量时该项测试跳过,普通 `npm test` 通过不代表已完成 Host 兼容验证。此测试不读取真实凭据或请求官方 API。
28
+
21
29
  ## Pull Request review
22
30
 
23
31
  合并前确认:
@@ -0,0 +1,60 @@
1
+ ## 中文
2
+
3
+ `0.1.8` 修复 `0.1.7` 未实际生效的 Cordis Plugin 侧栏兼容规则,使官方 Cordis 入口与账户入口真正纵向排列。
4
+
5
+ ### 根因与修复
6
+
7
+ - Harness renderer 为 `sidebar.footer.action` list slot 创建了带内联 `display: contents` 的 anchor。
8
+ - `0.1.7` 只在该 anchor 上设置 `flex-direction: column`;因为 `display: contents` 不生成布局盒,所以规则虽然命中,Cordis 与账户入口仍会横向互相挤压。
9
+ - 本版本只匹配直接包含本插件 card/rail 的 `data-slot="sidebar.footer.action"` anchor,用 `display:flex!important` 覆盖其内联值,再建立全宽纵向布局。
10
+ - 不依赖 Cordis 或 sidebar 的构建期私有类名,也不覆盖官方入口自身的宽度、定位或弹层样式。
11
+
12
+ ### 验证
13
+
14
+ - 回归测试实际执行插件样式安装并检查最终注入 CSS,不再只匹配源码字符串。
15
+ - 已在正式安装的 DeepSeek YukiRyou 中,以 Cordis Plugin 运行状态分别验收展开和收起侧栏:Cordis 与 Grok 账户入口均完整位于侧栏内并纵向排列。
16
+ - 11/11 模块测试、构建和 npm 打包预检通过。
17
+
18
+ ### 边界
19
+
20
+ - 只修改当前插件,不修改 DeepSeek YukiRyou 桌面端、官方 Cordis Plugin 或其他插件。
21
+ - DeepSeek、Grok 与 Codex 的账户读取、认证、模型、设置和 RPC 行为不变。
22
+
23
+ 安装:
24
+
25
+ ```sh
26
+ dsh plugin --profile web add dsh-deepseek-account@0.1.8
27
+ dsh web
28
+ ```
29
+
30
+ <details>
31
+ <summary>English release notes</summary>
32
+
33
+ `0.1.8` fixes the ineffective Cordis Plugin sidebar compatibility rule from `0.1.7`, so the official Cordis entry and the account entry are actually stacked vertically.
34
+
35
+ ### Root cause and fix
36
+
37
+ - The Harness renderer creates a `sidebar.footer.action` list-slot anchor with inline `display: contents`.
38
+ - `0.1.7` only set `flex-direction: column` on that anchor. Since `display: contents` creates no layout box, the rule matched but Cordis and account entries still competed in the outer horizontal flex row.
39
+ - This release matches only the `data-slot="sidebar.footer.action"` anchor that directly contains this plugin's card or rail, overrides the inline value with `display:flex!important`, and then establishes a full-width vertical layout.
40
+ - It does not depend on private build-time classes from Cordis or the sidebar, and it does not override the official entry's width, positioning, or panel styles.
41
+
42
+ ### Verification
43
+
44
+ - The regression test executes the plugin style installer and checks the final injected CSS instead of matching source-code text only.
45
+ - Live acceptance passed in the installed DeepSeek YukiRyou application with Cordis Plugin running, in both expanded and collapsed sidebar modes. The Cordis and Grok account entries remained fully inside the sidebar and stacked vertically.
46
+ - All 11 module tests, the build, and npm pack preflight passed.
47
+
48
+ ### Boundaries
49
+
50
+ - This release changes only the current plugin; it does not modify DeepSeek YukiRyou, the official Cordis Plugin, or other plugins.
51
+ - DeepSeek, Grok, and Codex account reads, authentication, models, settings, and RPC behavior are unchanged.
52
+
53
+ Install:
54
+
55
+ ```sh
56
+ dsh plugin --profile web add dsh-deepseek-account@0.1.8
57
+ dsh web
58
+ ```
59
+
60
+ </details>
@@ -0,0 +1,52 @@
1
+ ## 中文
2
+
3
+ `0.1.9` 修复升级 DSH 后 DeepSeek 账户页显示“暂时无法读取余额”、侧栏余额为空的问题。
4
+
5
+ ### 修复
6
+
7
+ - 余额 HTTP RPC 同时等待 `connection` 和 `webServer`,并由 Connection 管理注册效果的生命周期,避免启动期间遗漏路由。
8
+ - HTTP 服务重启时重新注册余额路由;插件卸载时清理路由。
9
+ - peer dependency 声明新增 Harness `0.1.5-rc.2` 和 Cordis `4.0.2`,保留此前声明的版本。
10
+
11
+ ### 验证与范围
12
+
13
+ - 12 项测试与构建通过;新增回归使用真实 Cordis/Connection 模块,覆盖 HTTP 服务晚启动、重启及插件卸载。
14
+ - 独立安装的 Harness `0.1.5-rc.2` Host fixture 通过;CI 增加相同检查。
15
+ - 本机 DeepSeek YukiRyou / DSH `0.1.5-rc.2` 已验证真实账户余额读取:侧栏和设置页均恢复,刷新可用。
16
+ - 本次未重新完成旧版 Harness 的完整验收,也未验证其他账户插件或付款流程。
17
+
18
+ 安装:
19
+
20
+ ```sh
21
+ dsh plugin --profile web add dsh-deepseek-account@0.1.9
22
+ ```
23
+
24
+ 安装后重启使用该 profile 的 DSH。
25
+
26
+ <details>
27
+ <summary>English release notes</summary>
28
+
29
+ `0.1.9` fixes unavailable DeepSeek balances after a DSH upgrade, affecting both the account settings page and sidebar.
30
+
31
+ ### Fix
32
+
33
+ - Wait for both `connection` and `webServer` before registering the balance HTTP RPC, leaving registration effects owned by Connection's lifecycle.
34
+ - Restore the route after an HTTP server restart and remove it when the plugin unloads.
35
+ - Add Harness `0.1.5-rc.2` and Cordis `4.0.2` to the declared peer versions while retaining the existing versions.
36
+
37
+ ### Verification and scope
38
+
39
+ - All 12 tests and the build passed. The new regression uses real Cordis/Connection modules to cover delayed HTTP server startup, server restart, and plugin unload.
40
+ - An independently installed Harness `0.1.5-rc.2` Host fixture passed; CI now runs the same check.
41
+ - Live balance reads and refresh were verified in the installed DeepSeek YukiRyou application running DSH `0.1.5-rc.2`, in both the sidebar and settings page.
42
+ - Full acceptance on older Harness versions, other account plugins, and payment flows was not repeated in this release.
43
+
44
+ Install:
45
+
46
+ ```sh
47
+ dsh plugin --profile web add dsh-deepseek-account@0.1.9
48
+ ```
49
+
50
+ Restart the DSH instance using this profile after installation.
51
+
52
+ </details>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-deepseek-account",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "DeepSeek account balance and official top-up entry for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -59,14 +59,14 @@
59
59
  "prepack": "npm run check"
60
60
  },
61
61
  "peerDependencies": {
62
- "@deepseek-ai/cordis": "4.0.1",
63
- "@deepseek-ai/dsh-client-connection": "0.1.1-rc.2",
64
- "@deepseek-ai/dsh-client-locale": "0.1.1-rc.2",
65
- "@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
66
- "@deepseek-ai/dsh-client-ui-model-selection": "0.1.1-rc.2",
67
- "@deepseek-ai/dsh-client-ui-settings": "0.1.1-rc.2",
68
- "@deepseek-ai/dsh-client-ui-sidebar": "0.1.1-rc.2",
69
- "@deepseek-ai/dsh-credentials": "0.1.1-rc.2"
62
+ "@deepseek-ai/cordis": "4.0.1 || 4.0.2",
63
+ "@deepseek-ai/dsh-client-connection": "0.1.1-rc.2 || 0.1.5-rc.2",
64
+ "@deepseek-ai/dsh-client-locale": "0.1.1-rc.2 || 0.1.5-rc.2",
65
+ "@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2 || 0.1.5-rc.2",
66
+ "@deepseek-ai/dsh-client-ui-model-selection": "0.1.1-rc.2 || 0.1.5-rc.2",
67
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.1-rc.2 || 0.1.5-rc.2",
68
+ "@deepseek-ai/dsh-client-ui-sidebar": "0.1.1-rc.2 || 0.1.5-rc.2",
69
+ "@deepseek-ai/dsh-credentials": "0.1.1-rc.2 || 0.1.5-rc.2"
70
70
  },
71
71
  "peerDependenciesMeta": {
72
72
  "@deepseek-ai/dsh-client-connection": { "optional": true },