paseo-dsh-direct 0.2.1 → 0.2.2
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 +2 -2
- package/README.zh.md +2 -2
- package/dsh.png +0 -0
- package/index.server.ts +4 -2
- package/package.json +7 -6
- package/paseo-plugin.json +3 -1
- package/server/bridge-client.ts +6 -1
- package/server/provider.ts +30 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ English | [中文](README.zh.md)
|
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
|
-
You need `dsh` on the machine that runs the Paseo daemon, with the same `major.minor` as the plugin line you install.
|
|
9
|
+
You need Paseo 0.11 or later and `dsh` on the machine that runs the Paseo daemon, with the same `major.minor` as the plugin line you install. On Paseo 0.8 to 0.10, install `npm:paseo-dsh-direct@0.2.1`.
|
|
10
10
|
|
|
11
11
|
In Paseo, open **Settings → Plugins → Install Plugin** and paste either the npm or the Git source:
|
|
12
12
|
|
|
@@ -57,7 +57,7 @@ paseo provider models dsh-pi
|
|
|
57
57
|
The same local source can be installed directly with `paseo plugin install /absolute/path/to/paseo-dsh-direct` after building. The CLI also accepts a Git ref that the Settings UI cannot:
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
paseo plugin install
|
|
60
|
+
paseo plugin install github:Jecvay/paseo-dsh-direct --ref <tag-or-commit>
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
## Development
|
package/README.zh.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
## 安装
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
需要 Paseo 0.11 及以上,并在运行 Paseo daemon 的机器上装好 `dsh`,它的 `major.minor` 要和你装的插件线一致。Paseo 0.8 至 0.10 请安装 `npm:paseo-dsh-direct@0.2.1`。
|
|
10
10
|
|
|
11
11
|
在 Paseo 里打开 **Settings → Plugins → Install Plugin**,npm 和 Git 两种来源任填一个:
|
|
12
12
|
|
|
@@ -57,7 +57,7 @@ paseo provider models dsh-pi
|
|
|
57
57
|
构建后也可以直接安装本地源码:`paseo plugin install /absolute/path/to/paseo-dsh-direct`。命令行还能指定 Settings 界面给不了的 Git ref:
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
paseo plugin install
|
|
60
|
+
paseo plugin install github:Jecvay/paseo-dsh-direct --ref <tag-or-commit>
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
## 开发
|
package/dsh.png
ADDED
|
Binary file
|
package/index.server.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import type { PluginServerContext } from "@getpaseo/plugin/server";
|
|
2
|
-
import { launchDshBridge } from "./server/bridge-client.js";
|
|
2
|
+
import { launchDshBridge, resolveDshExecutable } from "./server/bridge-client.js";
|
|
3
3
|
import { DSH_BRIDGE_SOURCE } from "./server/generated-bridge.js";
|
|
4
4
|
import { createDshProvider } from "./server/provider.js";
|
|
5
5
|
|
|
6
6
|
export default function contribute(server: PluginServerContext) {
|
|
7
|
+
const executable = resolveDshExecutable(process.env.PASEO_DSH_EXECUTABLE);
|
|
7
8
|
server.registerProvider(
|
|
8
9
|
createDshProvider({
|
|
10
|
+
executable,
|
|
9
11
|
createBridge: (launch) =>
|
|
10
12
|
launchDshBridge({
|
|
11
13
|
...launch,
|
|
12
14
|
bridgeSource: DSH_BRIDGE_SOURCE,
|
|
13
|
-
executable
|
|
15
|
+
executable,
|
|
14
16
|
profile: process.env.PASEO_DSH_PROFILE,
|
|
15
17
|
}),
|
|
16
18
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paseo-dsh-direct",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "DeepSeek Harness Direct Provider Plugin for Paseo",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,13 +24,14 @@
|
|
|
24
24
|
"scripts/install-lefthook.mjs",
|
|
25
25
|
"paseo-plugin.json",
|
|
26
26
|
"dsh.svg",
|
|
27
|
+
"dsh.png",
|
|
27
28
|
"!server/**/*.test.ts",
|
|
28
29
|
"!server/generated-bridge.ts",
|
|
29
30
|
"!server/generated-version.ts"
|
|
30
31
|
],
|
|
31
32
|
"peerDependencies": {
|
|
32
|
-
"@getpaseo/client": "0.
|
|
33
|
-
"@getpaseo/protocol": "0.
|
|
33
|
+
"@getpaseo/client": "0.11.2",
|
|
34
|
+
"@getpaseo/protocol": "0.11.2",
|
|
34
35
|
"react": "~19.1.0",
|
|
35
36
|
"react-native": ">=0.81.5"
|
|
36
37
|
},
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
}
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
|
-
"@getpaseo/plugin": "0.
|
|
53
|
+
"@getpaseo/plugin": "0.11.2",
|
|
53
54
|
"@types/mdast": "^4.0.4",
|
|
54
55
|
"@types/node": "^24.0.0",
|
|
55
56
|
"esbuild": "^0.25.0",
|
|
@@ -65,13 +66,13 @@
|
|
|
65
66
|
"build": "node scripts/build.mjs",
|
|
66
67
|
"smoke:bridge": "npm run build && tsx scripts/smoke-bridge.ts",
|
|
67
68
|
"board": "tsx scripts/board.ts",
|
|
68
|
-
"
|
|
69
|
+
"agent-loop": "tsx scripts/agent-loop/main.ts",
|
|
69
70
|
"typecheck": "npm run typecheck:shared && npm run typecheck:server && npm run typecheck:client && npm run typecheck:scripts",
|
|
70
71
|
"typecheck:shared": "tsc -p tsconfig.shared.json",
|
|
71
72
|
"typecheck:server": "tsc -p tsconfig.server.json",
|
|
72
73
|
"typecheck:client": "tsc -p tsconfig.client.json",
|
|
73
74
|
"typecheck:scripts": "tsc -p tsconfig.scripts.json",
|
|
74
|
-
"test": "tsx --test \"server/**/*.test.ts\"",
|
|
75
|
+
"test": "tsx --test \"server/**/*.test.ts\" \"scripts/**/*.test.ts\"",
|
|
75
76
|
"postinstall": "node scripts/install-lefthook.mjs",
|
|
76
77
|
"verify:notes": "tsx scripts/verify-agent-note-classification.ts && tsx scripts/verify-agent-note-format.ts && tsx scripts/verify-archived-agent-notes.ts",
|
|
77
78
|
"verify:docs": "tsx scripts/verify-md-links.ts && tsx scripts/verify-doc-refs.ts",
|
package/paseo-plugin.json
CHANGED
package/server/bridge-client.ts
CHANGED
|
@@ -199,9 +199,14 @@ function runProfileInit(
|
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
+
/** The `dsh` executable for a configured `PASEO_DSH_EXECUTABLE` value: the trimmed value, or `dsh` from `PATH` when it is blank or unset. */
|
|
203
|
+
export function resolveDshExecutable(configured: string | undefined): string {
|
|
204
|
+
return configured?.trim() || "dsh";
|
|
205
|
+
}
|
|
206
|
+
|
|
202
207
|
export async function launchDshBridge(options: LaunchBridgeOptions): Promise<DshBridge> {
|
|
203
208
|
const profile = options.profile?.trim() || DEFAULT_PROFILE;
|
|
204
|
-
const executable = options.executable
|
|
209
|
+
const executable = resolveDshExecutable(options.executable);
|
|
205
210
|
const env = { ...process.env, ...options.env };
|
|
206
211
|
await ensureDshProfile({ executable, profile, env });
|
|
207
212
|
const directory = await mkdtemp(path.join(tmpdir(), "paseo-dsh-direct-"));
|
package/server/provider.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
type ProviderPermissionResponse,
|
|
12
12
|
type ProviderRegistration,
|
|
13
13
|
type ProviderSessionConfig,
|
|
14
|
+
type ProviderStatus,
|
|
14
15
|
} from "@getpaseo/plugin/server/provider";
|
|
15
16
|
import type {
|
|
16
17
|
BridgeCatalog,
|
|
@@ -48,6 +49,8 @@ const PLAN_MODE_SETTING = "planMode";
|
|
|
48
49
|
|
|
49
50
|
interface DshProviderOptions {
|
|
50
51
|
createBridge(launch?: SessionLaunch): Promise<DshBridge>;
|
|
52
|
+
/** The dsh executable `createBridge` launches; `status()` probes this same path. */
|
|
53
|
+
executable: string;
|
|
51
54
|
/** Detects the local dsh version for the startup compatibility check; defaults to spawning `<exe> --version`. */
|
|
52
55
|
detectDshVersion?: (executable: string) => Promise<string>;
|
|
53
56
|
}
|
|
@@ -88,6 +91,9 @@ export function createDshProvider(options: DshProviderOptions): ProviderRegistra
|
|
|
88
91
|
icon: "dsh.svg",
|
|
89
92
|
getCatalogCacheKey: async (options) =>
|
|
90
93
|
options.scope === "workspace" ? `dsh-pi:${options.cwd}` : "dsh-pi:global",
|
|
94
|
+
async status() {
|
|
95
|
+
return dshStatus(options.executable, options.detectDshVersion ?? detectDshVersion);
|
|
96
|
+
},
|
|
91
97
|
async connect(request) {
|
|
92
98
|
if (!request.versions.includes(1)) throw new Error("Provider protocol version 1 is required");
|
|
93
99
|
const bridge = await options.createBridge();
|
|
@@ -107,6 +113,30 @@ export function createDshProvider(options: DshProviderOptions): ProviderRegistra
|
|
|
107
113
|
};
|
|
108
114
|
}
|
|
109
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Availability of the local dsh for Paseo 0.11+ provider listings. A dsh that
|
|
118
|
+
* does not answer `--version` is unavailable; a version outside the plugin's
|
|
119
|
+
* major.minor line stays available with the same warning the session timeline
|
|
120
|
+
* shows, since only DSH's own handshake can reject a session.
|
|
121
|
+
*/
|
|
122
|
+
async function dshStatus(
|
|
123
|
+
executable: string,
|
|
124
|
+
detectVersion: (executable: string) => Promise<string>,
|
|
125
|
+
): Promise<ProviderStatus> {
|
|
126
|
+
const dshVersion = await detectVersion(executable).catch(() => "");
|
|
127
|
+
if (!dshVersion) {
|
|
128
|
+
return {
|
|
129
|
+
available: false,
|
|
130
|
+
diagnostic:
|
|
131
|
+
`Could not run "${executable} --version". Install dsh or set PASEO_DSH_EXECUTABLE to its path, ` +
|
|
132
|
+
`then restart the Paseo daemon.`,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const match = matchVersionLine(PLUGIN_VERSION, dshVersion);
|
|
136
|
+
if (match === "match") return { available: true };
|
|
137
|
+
return { available: true, diagnostic: versionWarningMessage(match, PLUGIN_VERSION, dshVersion) };
|
|
138
|
+
}
|
|
139
|
+
|
|
110
140
|
function createConnection(
|
|
111
141
|
discoveryBridge: DshBridge,
|
|
112
142
|
createBridge: DshProviderOptions["createBridge"],
|