dsh-workbuddy-connect 0.2.2 → 0.2.4
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.en.md +23 -5
- package/README.md +23 -5
- package/lib/bin.js +1 -1
- package/lib/{host-heartbeat-CYxNM1p2.js → host-heartbeat-okrdovCF.js} +39 -6
- package/lib/index.d.ts +3 -2
- package/lib/index.js +1 -1
- package/package.json +3 -2
package/README.en.md
CHANGED
|
@@ -22,23 +22,41 @@ Expand the card to see the account, token validity, and remaining credit.
|
|
|
22
22
|
|
|
23
23
|
Prerequisite: the WorkBuddy desktop app is installed and signed in (the plugin reuses the app's sign-in state and follows account switches automatically).
|
|
24
24
|
|
|
25
|
+
The plugin runs under all three DSH interfaces: **Web**, **Desktop**, and **TUI**. Pick the install command that matches the profile you use.
|
|
26
|
+
|
|
25
27
|
```sh
|
|
26
|
-
#
|
|
28
|
+
# Web (recommended; ships prebuilt artifacts)
|
|
27
29
|
dsh plugin --profile web add dsh-workbuddy-connect
|
|
30
|
+
dsh web
|
|
28
31
|
|
|
29
|
-
# or install from the GitHub source
|
|
32
|
+
# or install the Web version from the GitHub source
|
|
30
33
|
dsh plugin --profile web add github:corrinehu/dsh-workbuddy-connect
|
|
31
|
-
|
|
32
34
|
dsh web
|
|
33
35
|
```
|
|
34
36
|
|
|
37
|
+
```sh
|
|
38
|
+
# Desktop (the DSH Desktop app)
|
|
39
|
+
dsh plugin --profile desktop add dsh-workbuddy-connect
|
|
40
|
+
dsh --profile desktop
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
# TUI (terminal UI)
|
|
45
|
+
dsh plugin --profile dsh-tui add dsh-workbuddy-connect
|
|
46
|
+
dsh --profile dsh-tui
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
> Note: the `dsh-tui` profile requires pnpm 11 to install packages (a different pnpm on PATH fails with `ERR_PNPM_UNEXPECTED_STORE` — use `npx pnpm@11`); verified on dsh `0.1.1-rc.2`.
|
|
50
|
+
|
|
51
|
+
After installing, switch to a WorkBuddy model in the model picker of the interface you chose. On Web, the settings card (Settings → Plugins → DSH WorkBuddy Connect) shows the account, token validity, and remaining credit; on TUI, configure `authFile` in `/settings`.
|
|
52
|
+
|
|
35
53
|
## CLI
|
|
36
54
|
|
|
37
|
-
`dsh plugin --profile web exec dsh-workbuddy-connect status`: sign-in state and remaining credit (`--json` for machine-readable output; `doctor` for diagnostics and `logout` for credential cleanup are also available).
|
|
55
|
+
`dsh plugin --profile <web|desktop|dsh-tui> exec dsh-workbuddy-connect status`: sign-in state and remaining credit (`--json` for machine-readable output; `doctor` for diagnostics and `logout` for credential cleanup are also available).
|
|
38
56
|
|
|
39
57
|
## Known limitations
|
|
40
58
|
|
|
41
|
-
- Verified on macOS with the DSH Web profile (`0.1.1-rc.2`+, Node 22+).
|
|
59
|
+
- Verified on macOS with the DSH Web / Desktop / TUI profile (`0.1.1-rc.2`+, Node 22+). Windows probes Local and Roaming AppData in order; WSL first reads credentials from the mounted Windows user profile. If the Windows and Linux user names differ and Windows environment variables are not forwarded into WSL, point `WORKBUDDY_AUTH_FILE` at the actual file.
|
|
42
60
|
- Relies on WorkBuddy client interfaces (not a public API); the plugin may need updates as WorkBuddy changes.
|
|
43
61
|
|
|
44
62
|
## Disclaimer
|
package/README.md
CHANGED
|
@@ -28,23 +28,41 @@
|
|
|
28
28
|
|
|
29
29
|
前置:已安装并登录 WorkBuddy 桌面 App(插件复用 App 的登录状态,账号切换自动跟随)。
|
|
30
30
|
|
|
31
|
+
插件在三种 DSH 界面下均可运行:**Web**、**Desktop**、**TUI**。根据你使用的 profile 选对应命令安装。
|
|
32
|
+
|
|
31
33
|
```sh
|
|
32
|
-
#
|
|
34
|
+
# Web(推荐,自带预构建产物)
|
|
33
35
|
dsh plugin --profile web add dsh-workbuddy-connect
|
|
36
|
+
dsh web
|
|
34
37
|
|
|
35
|
-
# 或从 GitHub 源码安装
|
|
38
|
+
# 或从 GitHub 源码安装 Web 版
|
|
36
39
|
dsh plugin --profile web add github:corrinehu/dsh-workbuddy-connect
|
|
37
|
-
|
|
38
40
|
dsh web
|
|
39
41
|
```
|
|
40
42
|
|
|
43
|
+
```sh
|
|
44
|
+
# Desktop(DSH Desktop 桌面版)
|
|
45
|
+
dsh plugin --profile desktop add dsh-workbuddy-connect
|
|
46
|
+
dsh --profile desktop
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
# TUI(终端界面)
|
|
51
|
+
dsh plugin --profile dsh-tui add dsh-workbuddy-connect
|
|
52
|
+
dsh --profile dsh-tui
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
> 提示:`dsh-tui` profile 需用 pnpm 11 安装(PATH 里是其他版本会报 `ERR_PNPM_UNEXPECTED_STORE`,用 `npx pnpm@11` 即可);已验证 dsh `0.1.1-rc.2`。
|
|
56
|
+
|
|
57
|
+
安装后,在对应界面的模型选择器里切换到 WorkBuddy 模型即可使用;Web 下设置卡片(设置 → 插件 → DSH WorkBuddy Connect)可查看账号信息、令牌有效期与剩余积分,TUI 下可在 `/settings` 里配置 `authFile`。
|
|
58
|
+
|
|
41
59
|
## 命令行
|
|
42
60
|
|
|
43
|
-
`dsh plugin --profile web exec dsh-workbuddy-connect status`:登录状态与剩余积分(`--json` 输出机器可读格式;另有 `doctor` 诊断、`logout` 清理凭据)。
|
|
61
|
+
`dsh plugin --profile <web|desktop|dsh-tui> exec dsh-workbuddy-connect status`:登录状态与剩余积分(`--json` 输出机器可读格式;另有 `doctor` 诊断、`logout` 清理凭据)。
|
|
44
62
|
|
|
45
63
|
## 已知限制
|
|
46
64
|
|
|
47
|
-
- 在 macOS
|
|
65
|
+
- 在 macOS 的 DSH Web / Desktop / TUI profile(`0.1.1-rc.2`+、Node 22+)下验证通过。Windows 会依次探测 Local 与 Roaming AppData;WSL 会优先从挂载的 Windows 用户目录读取登录凭据。若 Windows 与 Linux 用户名不同且 Windows 环境变量未传入 WSL,请通过 `WORKBUDDY_AUTH_FILE` 指定实际位置。
|
|
48
66
|
- 依赖 WorkBuddy 客户端接口(非官方开放 API),WorkBuddy 更新后插件可能需要随之调整。
|
|
49
67
|
|
|
50
68
|
## 免责声明
|
package/lib/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { _ as WorkBuddyCredentialStore, a as readHostHeartbeat, c as WORKBUDDY_CONNECT_VERSION, l as WorkBuddyUpstreamClient, o as workbuddyHostHeartbeatPath, p as FALLBACK_WORKBUDDY_MODELS, r as isHeartbeatProcessAlive, x as workbuddyOwnAuthPath } from "./host-heartbeat-
|
|
2
|
+
import { _ as WorkBuddyCredentialStore, a as readHostHeartbeat, c as WORKBUDDY_CONNECT_VERSION, l as WorkBuddyUpstreamClient, o as workbuddyHostHeartbeatPath, p as FALLBACK_WORKBUDDY_MODELS, r as isHeartbeatProcessAlive, x as workbuddyOwnAuthPath } from "./host-heartbeat-okrdovCF.js";
|
|
3
3
|
import { realpathSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
//#region src/bin.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
2
|
+
import { homedir, release } from "node:os";
|
|
3
|
+
import { basename, join } from "node:path";
|
|
4
4
|
import { withFileLock, writeFileAtomic } from "@deepseek-ai/dsh-atomic-write";
|
|
5
5
|
import { resolveDshHome } from "@deepseek-ai/dsh-home-paths";
|
|
6
6
|
import { execFileSync } from "node:child_process";
|
|
@@ -24,17 +24,50 @@ const OWN_FORMAT_VERSION = 1;
|
|
|
24
24
|
function workbuddyOwnAuthPath() {
|
|
25
25
|
return join(resolveDshHome(), WORKBUDDY_AUTH_FILENAME);
|
|
26
26
|
}
|
|
27
|
+
const DESKTOP_AUTH_RELATIVE_PATH = [
|
|
28
|
+
"CodeBuddyExtension",
|
|
29
|
+
"Data",
|
|
30
|
+
"Public",
|
|
31
|
+
"auth",
|
|
32
|
+
"workbuddy-desktop.info"
|
|
33
|
+
];
|
|
34
|
+
/** Whether this Linux process is running inside Windows Subsystem for Linux. */
|
|
35
|
+
function isWsl() {
|
|
36
|
+
if (process.platform !== "linux") return false;
|
|
37
|
+
if (process.env["WSL_DISTRO_NAME"] !== void 0 || process.env["WSL_INTEROP"] !== void 0) return true;
|
|
38
|
+
return release().toLowerCase().includes("microsoft");
|
|
39
|
+
}
|
|
40
|
+
/** Convert a Windows drive path to WSL's conventional `/mnt/<drive>` form. */
|
|
41
|
+
function windowsPathForWsl(value) {
|
|
42
|
+
const path = value?.trim();
|
|
43
|
+
if (!path) return void 0;
|
|
44
|
+
if (path.startsWith("/")) return path;
|
|
45
|
+
const drivePath = /^([a-z]):[\\/](.*)$/iu.exec(path);
|
|
46
|
+
if (drivePath === null) return void 0;
|
|
47
|
+
return join("/mnt", drivePath[1].toLowerCase(), ...drivePath[2].split(/[\\/]+/u));
|
|
48
|
+
}
|
|
49
|
+
/** Windows desktop credential candidates visible from a WSL process. */
|
|
50
|
+
function wslDesktopAuthCandidates(home) {
|
|
51
|
+
const profile = windowsPathForWsl(process.env["USERPROFILE"]) ?? join("/mnt/c/Users", basename(home));
|
|
52
|
+
const localAppData = windowsPathForWsl(process.env["LOCALAPPDATA"]) ?? join(profile, "AppData", "Local");
|
|
53
|
+
const roamingAppData = windowsPathForWsl(process.env["APPDATA"]) ?? join(profile, "AppData", "Roaming");
|
|
54
|
+
return [join(localAppData, ...DESKTOP_AUTH_RELATIVE_PATH), join(roamingAppData, ...DESKTOP_AUTH_RELATIVE_PATH)];
|
|
55
|
+
}
|
|
27
56
|
/**
|
|
28
57
|
* Platform-default candidates for the WorkBuddy desktop app's auth file, in
|
|
29
58
|
* probe order. Windows probes both AppData roots: current builds write under
|
|
30
|
-
* `%LOCALAPPDATA%` (Local), older ones under `%APPDATA%` (Roaming).
|
|
31
|
-
*
|
|
59
|
+
* `%LOCALAPPDATA%` (Local), older ones under `%APPDATA%` (Roaming). WSL probes
|
|
60
|
+
* those same Windows locations through its mounted Windows profile before the
|
|
61
|
+
* native Linux location.
|
|
32
62
|
*/
|
|
33
63
|
function defaultDesktopAuthCandidates() {
|
|
34
64
|
const home = homedir();
|
|
35
65
|
if (process.platform === "darwin") return [join(home, "Library", "Application Support", "CodeBuddyExtension", "Data", "Public", "auth", "workbuddy-desktop.info")];
|
|
36
66
|
if (process.platform === "win32") return [join(home, "AppData", "Local", "CodeBuddyExtension", "Data", "Public", "auth", "workbuddy-desktop.info"), join(home, "AppData", "Roaming", "CodeBuddyExtension", "Data", "Public", "auth", "workbuddy-desktop.info")];
|
|
37
|
-
if (process.platform === "linux")
|
|
67
|
+
if (process.platform === "linux") {
|
|
68
|
+
const linux = join(home, ".config", ...DESKTOP_AUTH_RELATIVE_PATH);
|
|
69
|
+
return isWsl() ? [...wslDesktopAuthCandidates(home), linux] : [linux];
|
|
70
|
+
}
|
|
38
71
|
return [];
|
|
39
72
|
}
|
|
40
73
|
/** First platform-default candidate; see {@link defaultDesktopAuthCandidates}. */
|
|
@@ -701,7 +734,7 @@ var WorkBuddyUpstreamClient = class {
|
|
|
701
734
|
};
|
|
702
735
|
//#endregion
|
|
703
736
|
//#region src/version.ts
|
|
704
|
-
const WORKBUDDY_CONNECT_VERSION = "0.2.
|
|
737
|
+
const WORKBUDDY_CONNECT_VERSION = "0.2.4";
|
|
705
738
|
//#endregion
|
|
706
739
|
//#region src/host-heartbeat.ts
|
|
707
740
|
/**
|
package/lib/index.d.ts
CHANGED
|
@@ -110,8 +110,9 @@ declare function workbuddyOwnAuthPath(): string;
|
|
|
110
110
|
/**
|
|
111
111
|
* Platform-default candidates for the WorkBuddy desktop app's auth file, in
|
|
112
112
|
* probe order. Windows probes both AppData roots: current builds write under
|
|
113
|
-
* `%LOCALAPPDATA%` (Local), older ones under `%APPDATA%` (Roaming).
|
|
114
|
-
*
|
|
113
|
+
* `%LOCALAPPDATA%` (Local), older ones under `%APPDATA%` (Roaming). WSL probes
|
|
114
|
+
* those same Windows locations through its mounted Windows profile before the
|
|
115
|
+
* native Linux location.
|
|
115
116
|
*/
|
|
116
117
|
declare function defaultDesktopAuthCandidates(): string[];
|
|
117
118
|
/** First platform-default candidate; see {@link defaultDesktopAuthCandidates}. */
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as WorkBuddyCredentialStore, a as readHostHeartbeat, b as parseWorkBuddyAuth, d as prepareChatBody, f as regionOf, g as WORKBUDDY_AUTH_FILE_ENV, h as WORKBUDDY_AUTH_FILENAME, i as processStartTimeMs, l as WorkBuddyUpstreamClient, m as WorkBuddyCatalog, n as clearHostHeartbeat, o as workbuddyHostHeartbeatPath, p as FALLBACK_WORKBUDDY_MODELS, r as isHeartbeatProcessAlive, s as writeHostHeartbeat, t as WORKBUDDY_HOST_HEARTBEAT_FILENAME, u as classifyUpstreamError, v as defaultDesktopAuthCandidates, x as workbuddyOwnAuthPath, y as defaultDesktopAuthPath } from "./host-heartbeat-
|
|
1
|
+
import { _ as WorkBuddyCredentialStore, a as readHostHeartbeat, b as parseWorkBuddyAuth, d as prepareChatBody, f as regionOf, g as WORKBUDDY_AUTH_FILE_ENV, h as WORKBUDDY_AUTH_FILENAME, i as processStartTimeMs, l as WorkBuddyUpstreamClient, m as WorkBuddyCatalog, n as clearHostHeartbeat, o as workbuddyHostHeartbeatPath, p as FALLBACK_WORKBUDDY_MODELS, r as isHeartbeatProcessAlive, s as writeHostHeartbeat, t as WORKBUDDY_HOST_HEARTBEAT_FILENAME, u as classifyUpstreamError, v as defaultDesktopAuthCandidates, x as workbuddyOwnAuthPath, y as defaultDesktopAuthPath } from "./host-heartbeat-okrdovCF.js";
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
3
|
import { installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-settings";
|
|
4
4
|
import { createProvider } from "@earendil-works/pi-ai";
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dsh-workbuddy-connect",
|
|
3
3
|
"displayName": "DSH WorkBuddy Connect",
|
|
4
4
|
"description": "将 WorkBuddy 桌面 App 包含的模型自动接入 DeepSeek Harness — bring WorkBuddy desktop app models into DeepSeek Harness with zero configuration.",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.4",
|
|
6
6
|
"author": "corrinehu",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"dsh-plugin",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"dsh-workbuddy-connect": "lib/bin.js"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
+
"prepack": "npm run build",
|
|
24
25
|
"build": "tsdown",
|
|
25
26
|
"test": "vitest run",
|
|
26
27
|
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.client.json",
|
|
@@ -99,4 +100,4 @@
|
|
|
99
100
|
"typescript": "^5.9.3",
|
|
100
101
|
"vitest": "^4.1.8"
|
|
101
102
|
}
|
|
102
|
-
}
|
|
103
|
+
}
|