relay-dsh-plugin-claude 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 +17 -15
- package/README.zh.md +17 -15
- package/dsh-compat.mjs +11 -0
- package/lib/host-plugin.js +19 -10
- package/lib/host-plugin.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# Claude Code Conversations for DeepSeek Harness
|
|
2
2
|
|
|
3
|
-
> **Now supports
|
|
3
|
+
> **Now supports DSH `0.1.2-rc.1` while retaining `0.1.2-alpha.3` compatibility.** Plugin `0.2.2` is verified on both releases. [Install it from npm](https://www.npmjs.com/package/relay-dsh-plugin-claude) · [Compatibility evidence](https://github.com/yangbobo2021/Relay/tree/codex/relay-foundation/dsh-lab/dsh-0.1.2-rc.1-20260903).
|
|
4
|
+
|
|
5
|
+
> **Release channels:** `latest` → `0.2.2`; `next` → `0.2.1-rc.1`.
|
|
4
6
|
|
|
5
7
|
```bash
|
|
6
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
7
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
8
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@0.2.2
|
|
9
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 web
|
|
8
10
|
```
|
|
9
11
|
|
|
10
12
|
[](https://www.npmjs.com/package/relay-dsh-plugin-claude)
|
|
@@ -37,8 +39,8 @@ Session. The install requires Node.js 22.13 or newer and `pnpm` on `PATH`. Then
|
|
|
37
39
|
stop DSH Web, install the tested stable release, and restart DSH:
|
|
38
40
|
|
|
39
41
|
```bash
|
|
40
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
41
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
42
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@latest
|
|
43
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 web
|
|
42
44
|
```
|
|
43
45
|
|
|
44
46
|
Open **New Session**, select a workspace, choose **Claude Code** from the mode
|
|
@@ -113,7 +115,7 @@ The published npm package name is
|
|
|
113
115
|
Use `@latest` to install the current stable release:
|
|
114
116
|
|
|
115
117
|
```bash
|
|
116
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
118
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@latest
|
|
117
119
|
```
|
|
118
120
|
|
|
119
121
|
At the time of writing, `latest` resolves to stable version `0.2.1`. The linked
|
|
@@ -126,24 +128,24 @@ CI publishing and official DSH compatibility checks. The current candidate also
|
|
|
126
128
|
contains the latest model-selection synchronization fix:
|
|
127
129
|
|
|
128
130
|
```bash
|
|
129
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
131
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@next
|
|
130
132
|
```
|
|
131
133
|
|
|
132
|
-
At the time of writing, `next` resolves to `0.2.
|
|
134
|
+
At the time of writing, `next` resolves to `0.2.1-rc.1`.
|
|
133
135
|
|
|
134
136
|
#### GitHub development build
|
|
135
137
|
|
|
136
138
|
Install the current `main` branch when testing an unreleased change:
|
|
137
139
|
|
|
138
140
|
```bash
|
|
139
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
141
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#main
|
|
140
142
|
```
|
|
141
143
|
|
|
142
144
|
`main` can change at any time. For a reproducible GitHub install, pin a Tag or
|
|
143
145
|
full Commit SHA instead. For example:
|
|
144
146
|
|
|
145
147
|
```bash
|
|
146
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
148
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#v0.2.2
|
|
147
149
|
```
|
|
148
150
|
|
|
149
151
|
The official DSH CLI initializes the `web` Profile if it does not exist, asks
|
|
@@ -152,12 +154,12 @@ adds the plugin's bundle layer. No Relay checkout is required. The first
|
|
|
152
154
|
installation can take longer while platform-specific Claude Agent SDK packages
|
|
153
155
|
are downloaded; wait for pnpm's final `Done` message or an explicit error. If
|
|
154
156
|
you already installed the `dsh` command, replace the
|
|
155
|
-
`npx @deepseek-ai/dsh@0.1.2-
|
|
157
|
+
`npx @deepseek-ai/dsh@0.1.2-rc.1` prefix with `dsh` in any command above.
|
|
156
158
|
|
|
157
159
|
### 3. Start or restart DSH Web
|
|
158
160
|
|
|
159
161
|
```bash
|
|
160
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
162
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 web
|
|
161
163
|
```
|
|
162
164
|
|
|
163
165
|
If you use an installed command, run `dsh web` instead. Bundle membership is read
|
|
@@ -307,7 +309,7 @@ dsh plugin --profile web update relay-dsh-plugin-claude
|
|
|
307
309
|
dsh plugin --profile web remove relay-dsh-plugin-claude
|
|
308
310
|
```
|
|
309
311
|
|
|
310
|
-
Use the `npx @deepseek-ai/dsh@0.1.2-
|
|
312
|
+
Use the `npx @deepseek-ai/dsh@0.1.2-rc.1` prefix instead of `dsh` when you do not
|
|
311
313
|
have a persistent DSH command.
|
|
312
314
|
|
|
313
315
|
## Troubleshooting
|
|
@@ -362,7 +364,7 @@ Report bugs and feature requests in this repository's
|
|
|
362
364
|
Stable `0.2.1` targets DSH `0.1.1-rc.2`, `0.1.2-alpha.2`, and `0.1.2-alpha.3`; install it from npm `latest` or Git tag `v0.2.1`.
|
|
363
365
|
|
|
364
366
|
```sh
|
|
365
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
367
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@latest
|
|
366
368
|
# Git tag alternative, after publication:
|
|
367
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
369
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#v0.2.2
|
|
368
370
|
```
|
package/README.zh.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# 在 DeepSeek Harness 中使用 Claude Code 对话
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> **现已支持 DSH `0.1.2-rc.1`,并保留对 `0.1.2-alpha.3` 的兼容。** 插件 `0.2.2` 已在两个版本上完成验证。[从 npm 安装](https://www.npmjs.com/package/relay-dsh-plugin-claude) · [兼容性证据](https://github.com/yangbobo2021/Relay/tree/codex/relay-foundation/dsh-lab/dsh-0.1.2-rc.1-20260903)。
|
|
4
|
+
|
|
5
|
+
> **发布通道:** `latest` → `0.2.2`;`next` → `0.2.1-rc.1`。
|
|
4
6
|
|
|
5
7
|
```bash
|
|
6
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
7
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
8
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@0.2.2
|
|
9
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 web
|
|
8
10
|
```
|
|
9
11
|
|
|
10
12
|
[](https://www.npmjs.com/package/relay-dsh-plugin-claude)
|
|
@@ -36,8 +38,8 @@ Agent SDK Session。本插件可独立安装,不需要下载 Relay 仓库。
|
|
|
36
38
|
安装经过测试的稳定版本并重新启动:
|
|
37
39
|
|
|
38
40
|
```bash
|
|
39
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
40
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
41
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@latest
|
|
42
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 web
|
|
41
43
|
```
|
|
42
44
|
|
|
43
45
|
打开 **New Session**,选择工作区,再从模式菜单中选择 **Claude Code** 并发送
|
|
@@ -108,7 +110,7 @@ claude
|
|
|
108
110
|
使用 `@latest` 安装当前稳定版本:
|
|
109
111
|
|
|
110
112
|
```bash
|
|
111
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
113
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@latest
|
|
112
114
|
```
|
|
113
115
|
|
|
114
116
|
本文更新时,`latest` 指向稳定版 `0.2.1`。最新版本请以链接中的 npm 页面
|
|
@@ -120,24 +122,24 @@ npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add relay-dsh-plugin-cla
|
|
|
120
122
|
候选版本。当前候选版本还包含最新的模型选择同步修复:
|
|
121
123
|
|
|
122
124
|
```bash
|
|
123
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
125
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@next
|
|
124
126
|
```
|
|
125
127
|
|
|
126
|
-
本文更新时,`next` 指向 `0.2.
|
|
128
|
+
本文更新时,`next` 指向 `0.2.1-rc.1`。
|
|
127
129
|
|
|
128
130
|
#### GitHub 开发版
|
|
129
131
|
|
|
130
132
|
如需测试尚未发布的修改,可以直接安装当前 `main` 分支:
|
|
131
133
|
|
|
132
134
|
```bash
|
|
133
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
135
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#main
|
|
134
136
|
```
|
|
135
137
|
|
|
136
138
|
`main` 会持续变化。如需可复现的 GitHub 安装,请固定 Tag 或完整 Commit
|
|
137
139
|
SHA。例如:
|
|
138
140
|
|
|
139
141
|
```bash
|
|
140
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
142
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#v0.2.2
|
|
141
143
|
```
|
|
142
144
|
|
|
143
145
|
官方 DSH CLI 会在需要时初始化 `web` Profile,通过 `pnpm` 安装所选软件包和
|
|
@@ -145,12 +147,12 @@ Claude Agent SDK 依赖,并将插件加入 Bundle 配置。用户不需要下
|
|
|
145
147
|
仓库。首次安装还会下载 Claude Agent SDK 的平台相关软件包,可能需要更长
|
|
146
148
|
时间;请等待 pnpm 最终显示 `Done` 或明确错误。如果已经安装了持久可用的
|
|
147
149
|
`dsh` 命令,可以将上述任一命令开头的
|
|
148
|
-
`npx @deepseek-ai/dsh@0.1.2-
|
|
150
|
+
`npx @deepseek-ai/dsh@0.1.2-rc.1` 替换为 `dsh`。
|
|
149
151
|
|
|
150
152
|
### 3. 启动或重启 DSH Web
|
|
151
153
|
|
|
152
154
|
```bash
|
|
153
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
155
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 web
|
|
154
156
|
```
|
|
155
157
|
|
|
156
158
|
如果使用已经安装的命令,则执行 `dsh web`。DSH 只在启动时读取 Bundle
|
|
@@ -277,7 +279,7 @@ dsh plugin --profile web remove relay-dsh-plugin-claude
|
|
|
277
279
|
```
|
|
278
280
|
|
|
279
281
|
如果没有持久安装 `dsh` 命令,请将命令开头的 `dsh` 替换为
|
|
280
|
-
`npx @deepseek-ai/dsh@0.1.2-
|
|
282
|
+
`npx @deepseek-ai/dsh@0.1.2-rc.1`。
|
|
281
283
|
|
|
282
284
|
## 常见问题
|
|
283
285
|
|
|
@@ -332,7 +334,7 @@ npm pack
|
|
|
332
334
|
稳定版 `0.2.1` 面向 DSH `0.1.1-rc.2`、`0.1.2-alpha.2` 和 `0.1.2-alpha.3`;可通过 npm `latest` 或 Git Tag `v0.2.1` 安装。
|
|
333
335
|
|
|
334
336
|
```sh
|
|
335
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
337
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@latest
|
|
336
338
|
# Git tag alternative, after publication:
|
|
337
|
-
npx @deepseek-ai/dsh@0.1.2-
|
|
339
|
+
npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#v0.2.2
|
|
338
340
|
```
|
package/dsh-compat.mjs
CHANGED
|
@@ -7,3 +7,14 @@ export function toolCallId(value) {
|
|
|
7
7
|
if (typeof create !== 'function') throw new Error('DSH does not provide a tool call ID constructor');
|
|
8
8
|
return create(value);
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
export function sessionEvents(session, from = 0) {
|
|
12
|
+
if (!Number.isSafeInteger(from) || from < 0) throw new RangeError('session event offset must be a non-negative integer');
|
|
13
|
+
const snapshot = Reflect.get(session, 'snapshotEvents');
|
|
14
|
+
if (typeof snapshot === 'function') {
|
|
15
|
+
return from === 0 ? Reflect.apply(snapshot, session, []) : Reflect.apply(snapshot, session, [from]);
|
|
16
|
+
}
|
|
17
|
+
const events = Reflect.get(session, 'events');
|
|
18
|
+
if (!Array.isArray(events)) throw new TypeError('DSH Session exposes neither snapshotEvents() nor events');
|
|
19
|
+
return from === 0 ? events : events.slice(from);
|
|
20
|
+
}
|
package/lib/host-plugin.js
CHANGED
|
@@ -1677,6 +1677,21 @@ function positiveInteger(value, fallback) {
|
|
|
1677
1677
|
return Number.isSafeInteger(value) && value > 0 ? value : fallback;
|
|
1678
1678
|
}
|
|
1679
1679
|
//#endregion
|
|
1680
|
+
//#region dsh-compat.mjs
|
|
1681
|
+
function toolCallId(value) {
|
|
1682
|
+
const create = Reflect.get(llm, "ToolCallId") ?? Reflect.get(llm, "CallId");
|
|
1683
|
+
if (typeof create !== "function") throw new Error("DSH does not provide a tool call ID constructor");
|
|
1684
|
+
return create(value);
|
|
1685
|
+
}
|
|
1686
|
+
function sessionEvents(session, from = 0) {
|
|
1687
|
+
if (!Number.isSafeInteger(from) || from < 0) throw new RangeError("session event offset must be a non-negative integer");
|
|
1688
|
+
const snapshot = Reflect.get(session, "snapshotEvents");
|
|
1689
|
+
if (typeof snapshot === "function") return from === 0 ? Reflect.apply(snapshot, session, []) : Reflect.apply(snapshot, session, [from]);
|
|
1690
|
+
const events = Reflect.get(session, "events");
|
|
1691
|
+
if (!Array.isArray(events)) throw new TypeError("DSH Session exposes neither snapshotEvents() nor events");
|
|
1692
|
+
return from === 0 ? events : events.slice(from);
|
|
1693
|
+
}
|
|
1694
|
+
//#endregion
|
|
1680
1695
|
//#region claude-image-output.js
|
|
1681
1696
|
const MEDIA_TYPES = /* @__PURE__ */ new Map([
|
|
1682
1697
|
[".gif", "image/gif"],
|
|
@@ -2199,7 +2214,7 @@ var ClaudeDshAdapter = class extends LlmAdapter {
|
|
|
2199
2214
|
const text = content.filter((block) => block.type === "text").map((block) => block.text).join("\n").trim();
|
|
2200
2215
|
const agent = this.agents.get(sessionId);
|
|
2201
2216
|
if (!agent) throw new Error(`Relay Claude adapter has no attached agent for ${sessionId}`);
|
|
2202
|
-
const nativePermissions = permissionConfiguration(agent.session
|
|
2217
|
+
const nativePermissions = permissionConfiguration(sessionEvents(agent.session));
|
|
2203
2218
|
const config = this.configure(sessionId, {
|
|
2204
2219
|
...options.provider === "relay-claude" ? { model: options.model } : {},
|
|
2205
2220
|
...options.provider === "relay-claude" ? { effort: options.reasoningEffort } : {},
|
|
@@ -2773,8 +2788,9 @@ function subscribeRuntimeActivity(runtime, listener) {
|
|
|
2773
2788
|
return () => runtime.off("activity", listener);
|
|
2774
2789
|
}
|
|
2775
2790
|
function effectivePreset(session) {
|
|
2776
|
-
|
|
2777
|
-
|
|
2791
|
+
const events = sessionEvents(session);
|
|
2792
|
+
for (let index = events.length - 1; index >= 0; index -= 1) {
|
|
2793
|
+
const event = events[index];
|
|
2778
2794
|
if (event.type === "agent-preset/selected") return event.data.agentPreset;
|
|
2779
2795
|
}
|
|
2780
2796
|
return session.header.agentPreset;
|
|
@@ -3288,13 +3304,6 @@ function plainObject(value) {
|
|
|
3288
3304
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
|
|
3289
3305
|
}
|
|
3290
3306
|
//#endregion
|
|
3291
|
-
//#region dsh-compat.mjs
|
|
3292
|
-
function toolCallId(value) {
|
|
3293
|
-
const create = Reflect.get(llm, "ToolCallId") ?? Reflect.get(llm, "CallId");
|
|
3294
|
-
if (typeof create !== "function") throw new Error("DSH does not provide a tool call ID constructor");
|
|
3295
|
-
return create(value);
|
|
3296
|
-
}
|
|
3297
|
-
//#endregion
|
|
3298
3307
|
//#region dsh-import-target.js
|
|
3299
3308
|
var DshClaudeImportTarget = class {
|
|
3300
3309
|
constructor({ ctx, logger = console }) {
|