dsh-workbuddy-bridge 0.3.0 → 0.3.1

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/README.md CHANGED
@@ -53,9 +53,9 @@
53
53
  - **三种界面** —— Web / Desktop / TUI;仅 TUI 无手动检测。
54
54
 
55
55
  <p align="center">
56
- <img src="assets/composer-row.png" alt="输入区那一行:剩余积分与推理档位灯泡并排" width="560">
56
+ <img src="assets/composer-row.png" alt="输入区那一行:币图标与余额、推理档位灯泡、模型名,从左到右一行" width="560">
57
57
  <br>
58
- <em>对话窗口里每天看到的样子:左边是剩余积分,右边是推理档位灯泡——都在模型选择器旁。</em>
58
+ <em>对话窗口里每天看到的样子:币图标与余额、推理档位灯泡,再往右是模型名——都排在同一行。</em>
59
59
  </p>
60
60
 
61
61
  <p align="center">
@@ -100,9 +100,9 @@ dsh plugin --profile web add "$PWD"
100
100
 
101
101
  <p align="center">
102
102
  <img src="assets/detection-tab.png" alt="检测标签:每个推理模型一行" width="300">
103
- <img src="assets/credits-tab.png" alt="积分标签:合计与套餐余量" width="300">
103
+ <img src="assets/credits-tab.png" alt="积分标签:总余额与各套餐余量条" width="300">
104
104
  <br>
105
- <em>左「检测」:每个推理模型一行,点按钮确认它接受哪些推理档位;右「积分」:合计一行,下面是各套餐余量条。</em>
105
+ <em>左「检测」:每个推理模型一行,点按钮确认它接受哪些推理档位;右「积分」:总余额,下面是各套餐的余量条。</em>
106
106
  </p>
107
107
 
108
108
  ## 为什么是手动检测
package/README_en.md CHANGED
@@ -59,10 +59,10 @@ models appear directly in the DSH model picker — no separate provider to confi
59
59
  - **Three surfaces** — Web, Desktop and TUI; only the TUI lacks manual detection.
60
60
 
61
61
  <p align="center">
62
- <img src="assets/composer-row.png" alt="The composer row: remaining credit beside the reasoning-level bulb" width="560">
62
+ <img src="assets/composer-row.png" alt="The composer row: the coin and balance, the reasoning-level bulb and the model name in one line" width="560">
63
63
  <br>
64
- <em>The everyday view in the conversation window: remaining credit on the left, the reasoning-level bulb on
65
- the right — both beside the model picker.</em>
64
+ <em>The everyday view in the conversation window: the coin and its balance, the reasoning-level bulb, then the
65
+ model name — one row, left to right.</em>
66
66
  </p>
67
67
 
68
68
  <p align="center">
@@ -109,10 +109,10 @@ the description and takes effect on save:
109
109
 
110
110
  <p align="center">
111
111
  <img src="assets/detection-tab.png" alt="Detection tab: one row per reasoning model" width="300">
112
- <img src="assets/credits-tab.png" alt="Credits tab: total and per-package allowances" width="300">
112
+ <img src="assets/credits-tab.png" alt="Credits tab: the total balance and per-package allowances" width="300">
113
113
  <br>
114
114
  <em>Left, "Detection": one row per reasoning model — press the button to confirm which reasoning levels it
115
- accepts. Right, "Credits": the total on one line, each package's allowance as a bar below.</em>
115
+ accepts. Right, "Credits": the total balance, each package's allowance as a row below.</em>
116
116
  </p>
117
117
 
118
118
  ## Why detection is manual
package/lib/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { D as WorkBuddyAtRestKeyProvider, O as cnAppDiscovery, Z as resolveAppVersion, _ as FALLBACK_WORKBUDDY_MODELS, f as WORKBUDDY_BRIDGE_VERSION, g as FALLBACK_WORKBUDDY_AI_MODELS, i as variantFor, k as WorkBuddyUpstreamClient, l as readHostHeartbeat, n as CN_VARIANT, r as WORKBUDDY_VARIANTS, s as isHeartbeatProcessAlive, u as workbuddyHostHeartbeatPath, x as WorkBuddyCredentialStore } from "./variants-3SmUZ0e_.js";
2
+ import { C as variantFor, D as WorkBuddyUpstreamClient, S as WORKBUDDY_VARIANTS, Y as resolveAppVersion, a as readHostHeartbeat, c as WORKBUDDY_BRIDGE_VERSION, l as FALLBACK_WORKBUDDY_AI_MODELS, m as WorkBuddyCredentialStore, o as workbuddyHostHeartbeatPath, r as isHeartbeatProcessAlive, u as FALLBACK_WORKBUDDY_MODELS, x as CN_VARIANT } from "./heartbeat-DihKwwFX.js";
3
3
  import { realpathSync } from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
5
5
  //#region src/cli/bin.ts
@@ -29,17 +29,18 @@ function printJson(value) {
29
29
  /**
30
30
  * One variant's store plus the client that performs its refreshes.
31
31
  *
32
- * The key provider is injected explicitly, and per variant, for the same
33
- * reason the plugin host does it: the provider must not be left to its no-arg
34
- * default — that default is deliberately `discovery: 'none'`, and relying on it
35
- * here would quietly strip the CN CLI of the decryption it has always had.
32
+ * No key provider is injected, and that is now correct rather than a trap: the
33
+ * store's own default runs the discovery its variant may use
34
+ * (`atRestDiscoveryFor`, see `src/credential/store.ts`). This file used to spell
35
+ * that choice out per call site because the provider's no-arg default is
36
+ * `discovery: 'none'` — which left every caller that forgot it, including
37
+ * `scripts/live-e2e.mjs`, unable to open an encrypted credential at all.
36
38
  */
37
39
  function makeStore(variant) {
38
40
  const client = new WorkBuddyUpstreamClient();
39
41
  return new WorkBuddyCredentialStore({
40
42
  variant,
41
- refresh: (credential) => client.refreshToken(credential),
42
- keyProvider: new WorkBuddyAtRestKeyProvider({ discovery: variant.id === CN_VARIANT.id ? cnAppDiscovery() : "none" })
43
+ refresh: (credential) => client.refreshToken(credential)
43
44
  });
44
45
  }
45
46
  /** The plugin-owned credential copy for one variant, for display. */