relay-dsh-plugin-claude 0.2.1-rc.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 CHANGED
@@ -1,12 +1,12 @@
1
1
  # Claude Code Conversations for DeepSeek Harness
2
2
 
3
- > **Now supports the latest DSH `0.1.2-alpha.3`.** Plugin `0.2.1` is verified on DSH `0.1.2-alpha.3`, `0.1.2-alpha.2`, and `0.1.1-rc.2`. [Install it and try the latest DSH](https://www.npmjs.com/package/relay-dsh-plugin-claude) · [Compatibility details](docs/dsh-0.1.2-alpha.3.md).
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
4
 
5
- > **Release channels:** `latest` → `0.2.1`; `next` → `0.2.1-rc.1`.
5
+ > **Release channels:** `latest` → `0.2.2`; `next` → `0.2.1-rc.1`.
6
6
 
7
7
  ```bash
8
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add relay-dsh-plugin-claude@0.2.1
9
- npx @deepseek-ai/dsh@0.1.2-alpha.3 web
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
10
10
  ```
11
11
 
12
12
  [![npm version](https://img.shields.io/npm/v/relay-dsh-plugin-claude?label=npm)](https://www.npmjs.com/package/relay-dsh-plugin-claude)
@@ -39,8 +39,8 @@ Session. The install requires Node.js 22.13 or newer and `pnpm` on `PATH`. Then
39
39
  stop DSH Web, install the tested stable release, and restart DSH:
40
40
 
41
41
  ```bash
42
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add relay-dsh-plugin-claude@latest
43
- npx @deepseek-ai/dsh@0.1.2-alpha.3 web
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
44
44
  ```
45
45
 
46
46
  Open **New Session**, select a workspace, choose **Claude Code** from the mode
@@ -115,7 +115,7 @@ The published npm package name is
115
115
  Use `@latest` to install the current stable release:
116
116
 
117
117
  ```bash
118
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add relay-dsh-plugin-claude@latest
118
+ npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@latest
119
119
  ```
120
120
 
121
121
  At the time of writing, `latest` resolves to stable version `0.2.1`. The linked
@@ -128,7 +128,7 @@ CI publishing and official DSH compatibility checks. The current candidate also
128
128
  contains the latest model-selection synchronization fix:
129
129
 
130
130
  ```bash
131
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add relay-dsh-plugin-claude@next
131
+ npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@next
132
132
  ```
133
133
 
134
134
  At the time of writing, `next` resolves to `0.2.1-rc.1`.
@@ -138,14 +138,14 @@ At the time of writing, `next` resolves to `0.2.1-rc.1`.
138
138
  Install the current `main` branch when testing an unreleased change:
139
139
 
140
140
  ```bash
141
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#main
141
+ npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#main
142
142
  ```
143
143
 
144
144
  `main` can change at any time. For a reproducible GitHub install, pin a Tag or
145
145
  full Commit SHA instead. For example:
146
146
 
147
147
  ```bash
148
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#v0.2.1
148
+ npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#v0.2.2
149
149
  ```
150
150
 
151
151
  The official DSH CLI initializes the `web` Profile if it does not exist, asks
@@ -154,12 +154,12 @@ adds the plugin's bundle layer. No Relay checkout is required. The first
154
154
  installation can take longer while platform-specific Claude Agent SDK packages
155
155
  are downloaded; wait for pnpm's final `Done` message or an explicit error. If
156
156
  you already installed the `dsh` command, replace the
157
- `npx @deepseek-ai/dsh@0.1.2-alpha.3` prefix with `dsh` in any command above.
157
+ `npx @deepseek-ai/dsh@0.1.2-rc.1` prefix with `dsh` in any command above.
158
158
 
159
159
  ### 3. Start or restart DSH Web
160
160
 
161
161
  ```bash
162
- npx @deepseek-ai/dsh@0.1.2-alpha.3 web
162
+ npx @deepseek-ai/dsh@0.1.2-rc.1 web
163
163
  ```
164
164
 
165
165
  If you use an installed command, run `dsh web` instead. Bundle membership is read
@@ -309,7 +309,7 @@ dsh plugin --profile web update relay-dsh-plugin-claude
309
309
  dsh plugin --profile web remove relay-dsh-plugin-claude
310
310
  ```
311
311
 
312
- Use the `npx @deepseek-ai/dsh@0.1.2-alpha.3` prefix instead of `dsh` when you do not
312
+ Use the `npx @deepseek-ai/dsh@0.1.2-rc.1` prefix instead of `dsh` when you do not
313
313
  have a persistent DSH command.
314
314
 
315
315
  ## Troubleshooting
@@ -364,7 +364,7 @@ Report bugs and feature requests in this repository's
364
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`.
365
365
 
366
366
  ```sh
367
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add relay-dsh-plugin-claude@latest
367
+ npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@latest
368
368
  # Git tag alternative, after publication:
369
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#v0.2.1
369
+ npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#v0.2.2
370
370
  ```
package/README.zh.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # 在 DeepSeek Harness 中使用 Claude Code 对话
2
2
 
3
- > **现已支持最新 DSH `0.1.2-alpha.3`。** 插件 `0.2.1` 已在 DSH `0.1.2-alpha.3`、`0.1.2-alpha.2` `0.1.1-rc.2` 上完成兼容验证。[安装插件,立即体验最新版 DSH](https://www.npmjs.com/package/relay-dsh-plugin-claude) · [兼容性详情](docs/dsh-0.1.2-alpha.3.md)。
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
4
 
5
- > **发布通道:** `latest` → `0.2.1`;`next` → `0.2.1-rc.1`。
5
+ > **发布通道:** `latest` → `0.2.2`;`next` → `0.2.1-rc.1`。
6
6
 
7
7
  ```bash
8
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add relay-dsh-plugin-claude@0.2.1
9
- npx @deepseek-ai/dsh@0.1.2-alpha.3 web
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
10
10
  ```
11
11
 
12
12
  [![npm 版本](https://img.shields.io/npm/v/relay-dsh-plugin-claude?label=npm)](https://www.npmjs.com/package/relay-dsh-plugin-claude)
@@ -38,8 +38,8 @@ Agent SDK Session。本插件可独立安装,不需要下载 Relay 仓库。
38
38
  安装经过测试的稳定版本并重新启动:
39
39
 
40
40
  ```bash
41
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add relay-dsh-plugin-claude@latest
42
- npx @deepseek-ai/dsh@0.1.2-alpha.3 web
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
43
43
  ```
44
44
 
45
45
  打开 **New Session**,选择工作区,再从模式菜单中选择 **Claude Code** 并发送
@@ -110,7 +110,7 @@ claude
110
110
  使用 `@latest` 安装当前稳定版本:
111
111
 
112
112
  ```bash
113
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add relay-dsh-plugin-claude@latest
113
+ npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@latest
114
114
  ```
115
115
 
116
116
  本文更新时,`latest` 指向稳定版 `0.2.1`。最新版本请以链接中的 npm 页面
@@ -122,7 +122,7 @@ npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add relay-dsh-plugin-cla
122
122
  候选版本。当前候选版本还包含最新的模型选择同步修复:
123
123
 
124
124
  ```bash
125
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add relay-dsh-plugin-claude@next
125
+ npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@next
126
126
  ```
127
127
 
128
128
  本文更新时,`next` 指向 `0.2.1-rc.1`。
@@ -132,14 +132,14 @@ npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add relay-dsh-plugin-cla
132
132
  如需测试尚未发布的修改,可以直接安装当前 `main` 分支:
133
133
 
134
134
  ```bash
135
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#main
135
+ npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#main
136
136
  ```
137
137
 
138
138
  `main` 会持续变化。如需可复现的 GitHub 安装,请固定 Tag 或完整 Commit
139
139
  SHA。例如:
140
140
 
141
141
  ```bash
142
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#v0.2.1
142
+ npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#v0.2.2
143
143
  ```
144
144
 
145
145
  官方 DSH CLI 会在需要时初始化 `web` Profile,通过 `pnpm` 安装所选软件包和
@@ -147,12 +147,12 @@ Claude Agent SDK 依赖,并将插件加入 Bundle 配置。用户不需要下
147
147
  仓库。首次安装还会下载 Claude Agent SDK 的平台相关软件包,可能需要更长
148
148
  时间;请等待 pnpm 最终显示 `Done` 或明确错误。如果已经安装了持久可用的
149
149
  `dsh` 命令,可以将上述任一命令开头的
150
- `npx @deepseek-ai/dsh@0.1.2-alpha.3` 替换为 `dsh`。
150
+ `npx @deepseek-ai/dsh@0.1.2-rc.1` 替换为 `dsh`。
151
151
 
152
152
  ### 3. 启动或重启 DSH Web
153
153
 
154
154
  ```bash
155
- npx @deepseek-ai/dsh@0.1.2-alpha.3 web
155
+ npx @deepseek-ai/dsh@0.1.2-rc.1 web
156
156
  ```
157
157
 
158
158
  如果使用已经安装的命令,则执行 `dsh web`。DSH 只在启动时读取 Bundle
@@ -279,7 +279,7 @@ dsh plugin --profile web remove relay-dsh-plugin-claude
279
279
  ```
280
280
 
281
281
  如果没有持久安装 `dsh` 命令,请将命令开头的 `dsh` 替换为
282
- `npx @deepseek-ai/dsh@0.1.2-alpha.3`。
282
+ `npx @deepseek-ai/dsh@0.1.2-rc.1`。
283
283
 
284
284
  ## 常见问题
285
285
 
@@ -334,7 +334,7 @@ npm pack
334
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` 安装。
335
335
 
336
336
  ```sh
337
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add relay-dsh-plugin-claude@latest
337
+ npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add relay-dsh-plugin-claude@latest
338
338
  # Git tag alternative, after publication:
339
- npx @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#v0.2.1
339
+ npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add github:yangbobo2021/relay-dsh-plugin-claude#v0.2.2
340
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
+ }
@@ -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.events);
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
- for (let index = session.events.length - 1; index >= 0; index -= 1) {
2777
- const event = session.events[index];
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 }) {