dsh-remote-bridge 2.4.0 → 2.4.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.en.md +7 -7
- package/README.md +7 -7
- package/docs/api/asyncapi.yaml +32 -1
- package/docs/api/openapi.yaml +24 -2
- package/kotlin-sdk/build.gradle.kts +1 -1
- package/kotlin-sdk/src/main/kotlin/ai/deepseek/dsh/workspace/DshWorkspaceClient.kt +37 -0
- package/lib/index.d.ts +57 -1
- package/lib/index.js +2900 -2774
- package/package.json +4 -4
package/README.en.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<img alt="Version" src="https://img.shields.io/badge/version-v2.4.
|
|
12
|
+
<img alt="Version" src="https://img.shields.io/badge/version-v2.4.2-087f8c">
|
|
13
13
|
<img alt="DSH plugin" src="https://img.shields.io/badge/DeepSeek_Harness-plugin-1f2328">
|
|
14
14
|
<img alt="Platforms" src="https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-586069">
|
|
15
15
|
<img alt="License" src="https://img.shields.io/badge/license-AGPL--3.0-2da44e">
|
|
@@ -77,10 +77,10 @@ dsh plugin --profile web add dsh-remote-bridge
|
|
|
77
77
|
dsh plugin --profile web add dsh-remote-bridge --registry https://registry.npmmirror.com
|
|
78
78
|
|
|
79
79
|
# 2. tarball from the GitHub release
|
|
80
|
-
dsh plugin --profile web add https://github.com/westanke/dsh-remote-bridge/releases/download/v2.4.
|
|
80
|
+
dsh plugin --profile web add https://github.com/westanke/dsh-remote-bridge/releases/download/v2.4.2/dsh-remote-bridge-v2.4.2.tgz
|
|
81
81
|
|
|
82
82
|
# 3. tarball from the Gitee release (faster from mainland China)
|
|
83
|
-
dsh plugin --profile web add https://gitee.com/westanke/dsh-remote-bridge/releases/download/v2.4.
|
|
83
|
+
dsh plugin --profile web add https://gitee.com/westanke/dsh-remote-bridge/releases/download/v2.4.2/dsh-remote-bridge-v2.4.2.tgz
|
|
84
84
|
|
|
85
85
|
npx @deepseek-ai/dsh web
|
|
86
86
|
```
|
|
@@ -97,7 +97,7 @@ Restart DSH after installation, then open settings — The section is titled **
|
|
|
97
97
|
To install a downloaded release archive:
|
|
98
98
|
|
|
99
99
|
```sh
|
|
100
|
-
dsh plugin --profile web add ./dsh-remote-bridge-v2.4.
|
|
100
|
+
dsh plugin --profile web add ./dsh-remote-bridge-v2.4.2.tgz
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
## First connection
|
|
@@ -329,13 +329,13 @@ pnpm pack
|
|
|
329
329
|
|
|
330
330
|
`pnpm check` covers type-checking, documentation consistency, and tests. It currently passes **30 test files / 226 cases**, plus **4 browser-layer cases** (Playwright measuring real computed styles).
|
|
331
331
|
|
|
332
|
-
`npm pack` produces roughly a **0.
|
|
332
|
+
`npm pack` produces roughly a **0.53 MB** archive (v2.4.2 measured 558,704 bytes, SHA-256 `0260fe57…e3067f`): 2.2.0 dropped the standalone page and its editor dependencies and turned source maps off, down from 1.72 MB; it has since grown slightly with projection passthrough and the permission BFF.
|
|
333
333
|
|
|
334
|
-
v2.4.
|
|
334
|
+
v2.4.2 was developed against DSH `master@47f943859bef60e4160492346772ded9b24f765a`. CI covers Windows, Ubuntu, and macOS.
|
|
335
335
|
|
|
336
336
|
## Project
|
|
337
337
|
|
|
338
|
-
- Version: `v2.4.
|
|
338
|
+
- Version: `v2.4.2`
|
|
339
339
|
- Author: upstream [Hakunm](https://github.com/Hakunm); this fork maintained by [westanke](https://github.com/westanke)
|
|
340
340
|
- Repository: [GitHub](https://github.com/westanke/dsh-remote-bridge) · [Gitee](https://gitee.com/westanke/dsh-remote-bridge)
|
|
341
341
|
- npm: [`dsh-remote-bridge`](https://www.npmjs.com/package/dsh-remote-bridge) ([mainland-China mirror](https://registry.npmmirror.com/dsh-remote-bridge))
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<img alt="Version" src="https://img.shields.io/badge/version-v2.4.
|
|
12
|
+
<img alt="Version" src="https://img.shields.io/badge/version-v2.4.2-087f8c">
|
|
13
13
|
<img alt="DSH plugin" src="https://img.shields.io/badge/DeepSeek_Harness-plugin-1f2328">
|
|
14
14
|
<img alt="Platforms" src="https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-586069">
|
|
15
15
|
<img alt="License" src="https://img.shields.io/badge/license-AGPL--3.0-2da44e">
|
|
@@ -76,10 +76,10 @@ dsh plugin --profile web add dsh-remote-bridge
|
|
|
76
76
|
dsh plugin --profile web add dsh-remote-bridge --registry https://registry.npmmirror.com
|
|
77
77
|
|
|
78
78
|
# ② GitHub Release 的 tarball
|
|
79
|
-
dsh plugin --profile web add https://github.com/westanke/dsh-remote-bridge/releases/download/v2.4.
|
|
79
|
+
dsh plugin --profile web add https://github.com/westanke/dsh-remote-bridge/releases/download/v2.4.2/dsh-remote-bridge-v2.4.2.tgz
|
|
80
80
|
|
|
81
81
|
# ③ Gitee Release 的 tarball(国内访问更快)
|
|
82
|
-
dsh plugin --profile web add https://gitee.com/westanke/dsh-remote-bridge/releases/download/v2.4.
|
|
82
|
+
dsh plugin --profile web add https://gitee.com/westanke/dsh-remote-bridge/releases/download/v2.4.2/dsh-remote-bridge-v2.4.2.tgz
|
|
83
83
|
|
|
84
84
|
npx @deepseek-ai/dsh web
|
|
85
85
|
```
|
|
@@ -95,7 +95,7 @@ npx @deepseek-ai/dsh web
|
|
|
95
95
|
从 GitHub Release 下载离线安装包时,可直接安装 tarball:
|
|
96
96
|
|
|
97
97
|
```sh
|
|
98
|
-
dsh plugin --profile web add ./dsh-remote-bridge-v2.4.
|
|
98
|
+
dsh plugin --profile web add ./dsh-remote-bridge-v2.4.2.tgz
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
## 第一次使用
|
|
@@ -323,13 +323,13 @@ pnpm pack
|
|
|
323
323
|
|
|
324
324
|
`pnpm check` 覆盖类型检查、文档一致性与测试;当前 **30 个测试文件 / 226 个用例**,外加 **4 个浏览器层用例**(Playwright 实测量出的计算样式),全部通过。
|
|
325
325
|
|
|
326
|
-
`npm pack` 的产物约 **0.
|
|
326
|
+
`npm pack` 的产物约 **0.53 MB**(v2.4.2 实测 558,704 字节,SHA-256 `0260fe57…e3067f`):2.2.0 删除独立页及其编辑器依赖、并关闭 source map 之后从 1.72 MB 降下来,之后随投影透传与权限 BFF 小幅增长。
|
|
327
327
|
|
|
328
|
-
v2.4.
|
|
328
|
+
v2.4.2 基于 DSH `master@47f943859bef60e4160492346772ded9b24f765a` 开发,CI 覆盖 Windows、Ubuntu 和 macOS。
|
|
329
329
|
|
|
330
330
|
## 项目信息
|
|
331
331
|
|
|
332
|
-
- 当前版本:`v2.4.
|
|
332
|
+
- 当前版本:`v2.4.2`
|
|
333
333
|
- 作者:上游 [Hakunm](https://github.com/Hakunm),本 fork 维护 [westanke](https://github.com/westanke)
|
|
334
334
|
- 仓库:[GitHub](https://github.com/westanke/dsh-remote-bridge) · [Gitee](https://gitee.com/westanke/dsh-remote-bridge)
|
|
335
335
|
- npm:[`dsh-remote-bridge`](https://www.npmjs.com/package/dsh-remote-bridge)([国内镜像](https://registry.npmmirror.com/dsh-remote-bridge))
|
package/docs/api/asyncapi.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
asyncapi: 3.0.0
|
|
2
2
|
info:
|
|
3
3
|
title: DeepSeek Harness Mobile Events
|
|
4
|
-
version: 2.4.
|
|
4
|
+
version: 2.4.2
|
|
5
5
|
description: |
|
|
6
6
|
Live file and authorized DSH chat events. Reconnect clients must refresh
|
|
7
7
|
REST state; unbounded replay is not provided.
|
|
@@ -143,6 +143,37 @@ components:
|
|
|
143
143
|
code: { type: string }
|
|
144
144
|
stopped: { type: boolean, const: true }
|
|
145
145
|
|
|
146
|
+
ChatTurnEnd:
|
|
147
|
+
type: object
|
|
148
|
+
description: |
|
|
149
|
+
A turn ended. Emitted for every `turn/end` the host reports, including the
|
|
150
|
+
ordinary `reason.kind === 'ok'` case. When the host stops a turn at its
|
|
151
|
+
output-token cap (`reason.kind === 'max-tokens'`) the reply is **truncated,
|
|
152
|
+
not failed** — this frame is the only place a client can learn that, because
|
|
153
|
+
no separate failure frame is emitted for it. Clients that ignore `reason`
|
|
154
|
+
keep working unchanged (the field is additive).
|
|
155
|
+
required: [sessionId, eventType]
|
|
156
|
+
properties:
|
|
157
|
+
sessionId: { type: string }
|
|
158
|
+
eventType: { type: string, const: turn/end }
|
|
159
|
+
seq: { type: integer }
|
|
160
|
+
reason:
|
|
161
|
+
type: object
|
|
162
|
+
description: |
|
|
163
|
+
Forwarded **verbatim** from the host; this repository does not interpret
|
|
164
|
+
it. Known `kind` values (kernel `turn-error.js` / `turn-max-tokens.js` /
|
|
165
|
+
`retry.js`): `ok` (normal), `error` (terminal failure — also delivered as
|
|
166
|
+
`chat.turn.failed`), `max-tokens` (output-token cap: reply truncated,
|
|
167
|
+
earlier output preserved — render as a **warning**, not an error),
|
|
168
|
+
`aborted` (cancelled by the user or a hook, e.g. signing out).
|
|
169
|
+
Unknown kinds must be ignored rather than treated as failure.
|
|
170
|
+
properties:
|
|
171
|
+
kind: { type: string }
|
|
172
|
+
error:
|
|
173
|
+
type: object
|
|
174
|
+
properties:
|
|
175
|
+
message: { type: string }
|
|
176
|
+
code: { type: string }
|
|
146
177
|
ChatDeliverablesPresented:
|
|
147
178
|
type: object
|
|
148
179
|
description: |
|
package/docs/api/openapi.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
openapi: 3.1.0
|
|
2
2
|
info:
|
|
3
3
|
title: DeepSeek Harness Mobile API
|
|
4
|
-
version: 2.4.
|
|
4
|
+
version: 2.4.2
|
|
5
5
|
description: Versioned file and chat BFF for mobile and third-party DSH clients. HTTP and HTTPS are both supported.
|
|
6
6
|
servers:
|
|
7
7
|
- url: http://127.0.0.1:3090/api/v1
|
|
@@ -24,7 +24,7 @@ paths:
|
|
|
24
24
|
properties:
|
|
25
25
|
ok: { type: boolean, const: true }
|
|
26
26
|
version: { type: string, const: v1 }
|
|
27
|
-
pluginVersion: { type: string, const: 2.4.
|
|
27
|
+
pluginVersion: { type: string, const: 2.4.2 }
|
|
28
28
|
/pairings/exchange:
|
|
29
29
|
post:
|
|
30
30
|
security: []
|
|
@@ -307,6 +307,28 @@ paths:
|
|
|
307
307
|
items:
|
|
308
308
|
type: array
|
|
309
309
|
items: { $ref: '#/components/schemas/AgentPreset' }
|
|
310
|
+
/chat/permission-presets:
|
|
311
|
+
get:
|
|
312
|
+
operationId: listPermissionPresets
|
|
313
|
+
description: >-
|
|
314
|
+
Lists the permission presets a session can switch between (the catalog behind
|
|
315
|
+
DSH WebUI's access-mode selector). Session projections only carry the *current*
|
|
316
|
+
value, so clients cannot enumerate the choices without this endpoint.
|
|
317
|
+
responses:
|
|
318
|
+
'200':
|
|
319
|
+
description: Permission preset choices and the deployment default.
|
|
320
|
+
content:
|
|
321
|
+
application/json:
|
|
322
|
+
schema:
|
|
323
|
+
type: object
|
|
324
|
+
required: [options, defaultPreset]
|
|
325
|
+
properties:
|
|
326
|
+
options:
|
|
327
|
+
type: array
|
|
328
|
+
items: { $ref: '#/components/schemas/PermissionOption' }
|
|
329
|
+
defaultPreset:
|
|
330
|
+
type: string
|
|
331
|
+
'403': { $ref: '#/components/responses/Error' }
|
|
310
332
|
/settings/providers:
|
|
311
333
|
get:
|
|
312
334
|
operationId: listProviderSettings
|
|
@@ -116,6 +116,30 @@ data class AgentPreset(
|
|
|
116
116
|
@Serializable
|
|
117
117
|
data class ModelSelection(val provider: String, val model: String, val reasoningEffort: String? = null)
|
|
118
118
|
|
|
119
|
+
/**
|
|
120
|
+
* 一个可选的权限档位。
|
|
121
|
+
*
|
|
122
|
+
* [name] 是**非空**的:服务端 `normalizePermissionCatalog` 保证名字缺失时用 `value` 顶上,
|
|
123
|
+
* 空名字会在严格反序列化器上失败,或在 UI 上留下一行没有文字的选项。
|
|
124
|
+
*/
|
|
125
|
+
@Serializable
|
|
126
|
+
data class PermissionOption(
|
|
127
|
+
val value: String,
|
|
128
|
+
val name: String,
|
|
129
|
+
val description: String? = null,
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* 权限档位清单(`GET /chat/permission-presets`)。
|
|
134
|
+
*
|
|
135
|
+
* [defaultPreset] 是部署默认,**不等于**某个会话的当前档位 —— 当前值只认会话投影。
|
|
136
|
+
*/
|
|
137
|
+
@Serializable
|
|
138
|
+
data class PermissionCatalog(
|
|
139
|
+
val options: List<PermissionOption> = emptyList(),
|
|
140
|
+
val defaultPreset: String = "",
|
|
141
|
+
)
|
|
142
|
+
|
|
119
143
|
@Serializable
|
|
120
144
|
data class ModelReasoningEffort(val id: String, val name: String, val description: String? = null)
|
|
121
145
|
|
|
@@ -343,6 +367,19 @@ class DshWorkspaceClient(
|
|
|
343
367
|
AgentPresetList.serializer(),
|
|
344
368
|
).items
|
|
345
369
|
|
|
370
|
+
/**
|
|
371
|
+
* 权限档位候选清单。
|
|
372
|
+
*
|
|
373
|
+
* 必须单开一条:会话投影里那条 `permissions` 视图**只给 currentValue**,
|
|
374
|
+
* 候选项在内核的独立远程服务上,所以客户端列不出档位菜单。
|
|
375
|
+
*/
|
|
376
|
+
fun listPermissionPresets(): PermissionCatalog = executeJson(
|
|
377
|
+
"chat/permission-presets",
|
|
378
|
+
"GET",
|
|
379
|
+
null,
|
|
380
|
+
PermissionCatalog.serializer(),
|
|
381
|
+
)
|
|
382
|
+
|
|
346
383
|
fun selectSessionAgentPreset(sessionId: String, agentPreset: String): String {
|
|
347
384
|
val body = json.encodeToString(AgentPresetSelection.serializer(), AgentPresetSelection(agentPreset))
|
|
348
385
|
return executeJson(
|
package/lib/index.d.ts
CHANGED
|
@@ -655,6 +655,22 @@ interface AgentPresetsLike {
|
|
|
655
655
|
resolveAgent?: never;
|
|
656
656
|
select(agent: unknown, agentPreset: string): Promise<string>;
|
|
657
657
|
}
|
|
658
|
+
/**
|
|
659
|
+
* 内核 `dsh-permission-presets`(cordis 服务名 `permissionPresets`)。
|
|
660
|
+
*
|
|
661
|
+
* @patch
|
|
662
|
+
* id: permission-presets-catalog-bff
|
|
663
|
+
* for: 内核把「权限预设清单」放在**独立的远程服务**上(`@Remote('catalog')`),
|
|
664
|
+
* 而会话投影里那条同名 wire 视图只给 `currentValue`(`wire.view: state => ({ currentValue })`),
|
|
665
|
+
* 两者没有任何交叉引用。客户端要列候选档位就只能自己编。
|
|
666
|
+
* why: 没有正规写法可用 —— 内核的 Host FaceModel 里没有「把 catalog 并进投影」这个方法;
|
|
667
|
+
* 插件唯一的入口就是那个远程服务。
|
|
668
|
+
* until: 内核把候选项并进投影,或提供一条已含 options 的查询。
|
|
669
|
+
* test: tests/permission-presets.spec.ts
|
|
670
|
+
*/
|
|
671
|
+
interface PermissionPresetsLike {
|
|
672
|
+
catalog(): Promise<unknown>;
|
|
673
|
+
}
|
|
658
674
|
interface LlmLike {
|
|
659
675
|
/** Live routes, as `{ id, name }` rows. */
|
|
660
676
|
listProviders(): readonly {
|
|
@@ -694,6 +710,7 @@ interface Dsh02HostServices {
|
|
|
694
710
|
settingsController: SettingsControllerLike;
|
|
695
711
|
credentialsController: CredentialsControllerLike;
|
|
696
712
|
agentPresets: AgentPresetsLike;
|
|
713
|
+
permissionPresets: PermissionPresetsLike;
|
|
697
714
|
llm: LlmLike;
|
|
698
715
|
/**
|
|
699
716
|
* 内核附件存储(`ctx.attachments`);会话历史里的图片要经它取字节。
|
|
@@ -1006,6 +1023,18 @@ interface DshApiProxy {
|
|
|
1006
1023
|
agentPreset: string;
|
|
1007
1024
|
}>>;
|
|
1008
1025
|
};
|
|
1026
|
+
/**
|
|
1027
|
+
* 权限档位目录(内核 `ctx.permissionPresets`)。
|
|
1028
|
+
*
|
|
1029
|
+
* 单开命名空间的理由与 userQuestions 相同:它由**另一个内核服务**提供
|
|
1030
|
+
* (`@deepseek-ai/dsh-permission-presets`),在没装它的 profile 上是可选能力。
|
|
1031
|
+
*/
|
|
1032
|
+
permissionPresets: {
|
|
1033
|
+
catalog(request: {
|
|
1034
|
+
rpcId: string;
|
|
1035
|
+
payload: Record<string, never>;
|
|
1036
|
+
}): Promise<RpcResponse<unknown>>;
|
|
1037
|
+
};
|
|
1009
1038
|
/**
|
|
1010
1039
|
* 用户问题(内核 `ctx.userQuestions`,即 ask_user_question 工具)。
|
|
1011
1040
|
*
|
|
@@ -1114,7 +1143,14 @@ interface CommandExecutionView {
|
|
|
1114
1143
|
}
|
|
1115
1144
|
interface DshCommandRuntime {
|
|
1116
1145
|
list(agent: unknown): readonly CommandDescriptorView[];
|
|
1117
|
-
|
|
1146
|
+
/**
|
|
1147
|
+
* 内核签名是 **四个**参数:`execute(agent, line, submittedAttachments, signal)`。
|
|
1148
|
+
*
|
|
1149
|
+
* 少传一个(把 signal 传到第三个位)会让内核读到 `undefined.aborted`,
|
|
1150
|
+
* 表现为**所有**斜杠命令都报 `Cannot read properties of undefined (reading 'aborted')`。
|
|
1151
|
+
* 实测 2026-10-19 踩过:手机端因此切不了会话权限档位。
|
|
1152
|
+
*/
|
|
1153
|
+
execute(agent: unknown, line: string, submittedAttachments: readonly unknown[], signal: AbortSignal): Promise<CommandExecutionView | undefined>;
|
|
1118
1154
|
}
|
|
1119
1155
|
interface DshAgentRegistry {
|
|
1120
1156
|
get(sessionId: string): unknown | undefined;
|
|
@@ -1263,6 +1299,16 @@ interface AgentPresetView {
|
|
|
1263
1299
|
isDefault: boolean;
|
|
1264
1300
|
available: boolean;
|
|
1265
1301
|
}
|
|
1302
|
+
/**
|
|
1303
|
+
* 一个可选的权限档位。字段名刻意与内核 `optionOf()` 的产出一致
|
|
1304
|
+
* (`{ value, name, description? }`),中间不再改名 —— 客户端的
|
|
1305
|
+
* kotlinx.serialization 严格解码器对字段名敏感。
|
|
1306
|
+
*/
|
|
1307
|
+
interface PermissionOptionView {
|
|
1308
|
+
value: string;
|
|
1309
|
+
name: string;
|
|
1310
|
+
description?: string;
|
|
1311
|
+
}
|
|
1266
1312
|
declare class DshChatAdapter {
|
|
1267
1313
|
private readonly api;
|
|
1268
1314
|
private readonly database;
|
|
@@ -1293,6 +1339,16 @@ declare class DshChatAdapter {
|
|
|
1293
1339
|
renameWorkspace(principal: Principal, workspaceId: string, title: string): Promise<ChatWorkspaceView>;
|
|
1294
1340
|
deleteWorkspace(principal: Principal, workspaceId: string): Promise<void>;
|
|
1295
1341
|
listAgentPresets(): Promise<AgentPresetView[]>;
|
|
1342
|
+
/**
|
|
1343
|
+
* 权限档位候选清单。
|
|
1344
|
+
*
|
|
1345
|
+
* 为什么这条必须在插件侧:BFF 要把内核的进程级 catalog 透出来。会话投影里那条
|
|
1346
|
+
* wire 视图只带 `currentValue`,没有候选项 —— 客户端拿不到候选就列不出档位菜单。
|
|
1347
|
+
*/
|
|
1348
|
+
listPermissionPresets(): Promise<{
|
|
1349
|
+
options: PermissionOptionView[];
|
|
1350
|
+
defaultPreset: string;
|
|
1351
|
+
}>;
|
|
1296
1352
|
selectAgentPreset(principal: Principal, sessionId: string, agentPreset: string): Promise<string>;
|
|
1297
1353
|
createSessionInWorkspace(principal: Principal, workspaceId: string, options: {
|
|
1298
1354
|
sessionId?: string;
|