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 +4 -4
- package/README_en.md +5 -5
- package/lib/bin.js +8 -7
- package/lib/client.js +616 -355
- package/lib/{variants-3SmUZ0e_.js → heartbeat-DihKwwFX.js} +137 -104
- package/lib/index.d.ts +12 -3
- package/lib/index.js +4 -5
- package/package.json +1 -1
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="
|
|
56
|
+
<img src="assets/composer-row.png" alt="输入区那一行:币图标与余额、推理档位灯泡、模型名,从左到右一行" width="560">
|
|
57
57
|
<br>
|
|
58
|
-
<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="
|
|
103
|
+
<img src="assets/credits-tab.png" alt="积分标签:总余额与各套餐余量条" width="300">
|
|
104
104
|
<br>
|
|
105
|
-
<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:
|
|
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:
|
|
65
|
-
|
|
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
|
|
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 {
|
|
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
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
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. */
|