dsh-lsp-actions 0.5.19 → 0.5.21
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/CHANGELOG.md +9 -0
- package/LICENSE +0 -0
- package/PRIVACY.md +0 -0
- package/README.en.md +520 -0
- package/README.es.md +520 -0
- package/README.hi.md +520 -0
- package/README.md +313 -235
- package/README.pt.md +520 -0
- package/cordis.patch.yml +0 -0
- package/docs/assets/dsh-lsp-actions-demo.gif +0 -0
- package/docs/assets/dsh-lsp-actions-demo.png +0 -0
- package/docs/assets/dsh-lsp-actions-flow-dark.svg +35 -0
- package/docs/assets/dsh-lsp-actions-flow-light.svg +35 -0
- package/docs/assets/dsh-lsp-actions-flow-v5-dark.svg +136 -0
- package/docs/assets/dsh-lsp-actions-flow-v5-light.svg +136 -0
- package/docs/assets/dsh-lsp-actions-flow.svg +0 -0
- package/docs/assets/dsh-lsp-actions-hero-en-dark.webp +0 -0
- package/docs/assets/dsh-lsp-actions-hero-en-light.webp +0 -0
- package/docs/assets/dsh-lsp-actions-hero-zh-dark.webp +0 -0
- package/docs/assets/dsh-lsp-actions-hero-zh-light.webp +0 -0
- package/docs/assets/dsh-lsp-actions-hero.png +0 -0
- package/docs/editor-protocol.md +0 -0
- package/docs/editor-protocol.zh-CN.md +0 -0
- package/docs/seam-extension-notes.md +0 -0
- package/examples/vscode/README.md +0 -0
- package/examples/vscode/README.zh-CN.md +0 -0
- package/examples/vscode/backend/bin.mjs +0 -0
- package/examples/vscode/backend/cordis.yml +0 -0
- package/examples/vscode/backend/package.json +0 -0
- package/examples/vscode/extension/package.json +0 -0
- package/examples/vscode/extension/src/client.js +0 -0
- package/examples/vscode/extension/src/extension.js +0 -0
- package/examples/vscode/extension/src/views.js +0 -0
- package/icon.svg +0 -0
- package/lib/abort.d.ts +0 -0
- package/lib/abort.d.ts.map +0 -0
- package/lib/abort.js +0 -0
- package/lib/abort.js.map +0 -0
- package/lib/call-id.d.ts +0 -0
- package/lib/call-id.d.ts.map +0 -0
- package/lib/call-id.js +0 -0
- package/lib/call-id.js.map +0 -0
- package/lib/client.d.ts +0 -0
- package/lib/client.d.ts.map +0 -0
- package/lib/client.js +0 -0
- package/lib/client.js.map +0 -0
- package/lib/connection.d.ts +0 -0
- package/lib/connection.d.ts.map +0 -0
- package/lib/connection.js +0 -0
- package/lib/connection.js.map +0 -0
- package/lib/editor/actions.d.ts +0 -0
- package/lib/editor/actions.d.ts.map +0 -0
- package/lib/editor/actions.js +0 -0
- package/lib/editor/actions.js.map +0 -0
- package/lib/editor/cache.d.ts +0 -0
- package/lib/editor/cache.d.ts.map +0 -0
- package/lib/editor/cache.js +0 -0
- package/lib/editor/cache.js.map +0 -0
- package/lib/editor/server.d.ts +0 -0
- package/lib/editor/server.d.ts.map +0 -0
- package/lib/editor/server.js +0 -0
- package/lib/editor/server.js.map +0 -0
- package/lib/editor/service.d.ts +0 -0
- package/lib/editor/service.d.ts.map +0 -0
- package/lib/editor/service.js +0 -0
- package/lib/editor/service.js.map +0 -0
- package/lib/editor/transport.d.ts +0 -0
- package/lib/editor/transport.d.ts.map +0 -0
- package/lib/editor/transport.js +0 -0
- package/lib/editor/transport.js.map +0 -0
- package/lib/editor/types.d.ts +0 -0
- package/lib/editor/types.d.ts.map +0 -0
- package/lib/editor/types.js +0 -0
- package/lib/editor/types.js.map +0 -0
- package/lib/edits.d.ts +0 -0
- package/lib/edits.d.ts.map +0 -0
- package/lib/edits.js +0 -0
- package/lib/edits.js.map +0 -0
- package/lib/extension.d.ts +0 -0
- package/lib/extension.d.ts.map +0 -0
- package/lib/extension.js +0 -0
- package/lib/extension.js.map +0 -0
- package/lib/extra-tools.d.ts +0 -0
- package/lib/extra-tools.d.ts.map +0 -0
- package/lib/extra-tools.js +0 -0
- package/lib/extra-tools.js.map +0 -0
- package/lib/framing.d.ts +0 -0
- package/lib/framing.d.ts.map +0 -0
- package/lib/framing.js +0 -0
- package/lib/framing.js.map +0 -0
- package/lib/host.d.ts +0 -0
- package/lib/host.d.ts.map +0 -0
- package/lib/host.js +0 -0
- package/lib/host.js.map +0 -0
- package/lib/index.d.ts +0 -0
- package/lib/index.d.ts.map +0 -0
- package/lib/index.js +0 -0
- package/lib/index.js.map +0 -0
- package/lib/project.d.ts +0 -0
- package/lib/project.d.ts.map +0 -0
- package/lib/project.js +0 -0
- package/lib/project.js.map +0 -0
- package/lib/render.d.ts +0 -0
- package/lib/render.d.ts.map +0 -0
- package/lib/render.js +0 -0
- package/lib/render.js.map +0 -0
- package/lib/runner.d.ts +0 -0
- package/lib/runner.d.ts.map +0 -0
- package/lib/runner.js +0 -0
- package/lib/runner.js.map +0 -0
- package/lib/sandbox.d.ts +0 -0
- package/lib/sandbox.d.ts.map +0 -0
- package/lib/sandbox.js +0 -0
- package/lib/sandbox.js.map +0 -0
- package/lib/seam.d.ts +0 -0
- package/lib/seam.d.ts.map +0 -0
- package/lib/seam.js +0 -0
- package/lib/seam.js.map +0 -0
- package/lib/servers.d.ts +0 -0
- package/lib/servers.d.ts.map +0 -0
- package/lib/servers.js +0 -0
- package/lib/servers.js.map +0 -0
- package/lib/session-cwd.d.ts +0 -0
- package/lib/session-cwd.d.ts.map +0 -0
- package/lib/session-cwd.js +0 -0
- package/lib/session-cwd.js.map +0 -0
- package/lib/tools.d.ts +0 -0
- package/lib/tools.d.ts.map +0 -0
- package/lib/tools.js +0 -0
- package/lib/tools.js.map +0 -0
- package/lib/translate.d.ts +0 -0
- package/lib/translate.d.ts.map +0 -0
- package/lib/translate.js +0 -0
- package/lib/translate.js.map +0 -0
- package/lib/vocabulary.d.ts +0 -0
- package/lib/vocabulary.d.ts.map +0 -0
- package/lib/vocabulary.js +0 -0
- package/lib/vocabulary.js.map +0 -0
- package/package.json +35 -20
- package/README-es.md +0 -445
- package/README-hi.md +0 -445
- package/README-pt.md +0 -445
- package/README-zh.md +0 -445
package/README.md
CHANGED
|
@@ -1,141 +1,163 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/dsh-lsp-actions-hero-zh-dark.webp">
|
|
5
|
+
<img src="docs/assets/dsh-lsp-actions-hero-zh-light.webp" width="100%" alt="dsh-lsp-actions:八个工具与编辑器协议共用一条 ActionRunner——诊断、格式化、补全、代码动作、符号、签名、内联提示与重命名,各自对应真实语言服务器方法;六个只读,两个写盘">
|
|
6
|
+
</picture>
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
[](https://dshfind.com/plugins/PerryLink/dsh-lsp-actions?ref=badge)
|
|
9
|
-
[](https://api.securityscorecards.dev/projects/github.com/PerryLink/dsh-lsp-actions)
|
|
8
|
+
# dsh-lsp-actions
|
|
9
|
+
|
|
10
|
+
**让 agent 在真实语言服务器上写代码、改代码——诊断、格式化、补全、代码动作、符号、签名、内联提示与重命名一步到位。**
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
面向 DeepSeek Harness 的 LSP 动作面:官方 `ctx.lsp` seam 负责导航,本插件补齐动作闭环,并附带稳定的编辑器 action 协议(`lsp.actions.*`),让 VS Code 等编辑器直接把它当 IDE 后端。
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
[安装](#三步上手) · [配置](#配置) · [FAQ](#faq) · [简体中文](README.md) · [English](README.en.md) · [Español](README.es.md) · [Português](README.pt.md) · [हिन्दी](README.hi.md)
|
|
14
15
|
|
|
15
|
-
[](https://github.com/PerryLink/dsh-lsp-actions/actions)
|
|
21
|
-
[](https://github.com/PerryLink/dsh-lsp-actions/releases)
|
|
22
|
-
[](https://www.npmjs.com/package/dsh-lsp-actions)
|
|
23
|
-
[](https://www.npmjs.com/package/dsh-lsp-actions)
|
|
16
|
+
[](LICENSE)
|
|
17
|
+
[](#兼容性)
|
|
18
|
+
[](https://www.npmjs.com/package/dsh-lsp-actions)
|
|
19
|
+
[](https://github.com/PerryLink/dsh-lsp-actions/actions/workflows/ci.yml)
|
|
20
|
+
[](#兼容性)
|
|
24
21
|
|
|
25
|
-
[
|
|
22
|
+
[](https://github.com/PerryLink/dsh-lsp-actions/stargazers)
|
|
23
|
+
[](https://www.npmjs.com/package/dsh-lsp-actions)
|
|
24
|
+
[](https://dshfind.com/plugins/PerryLink/dsh-lsp-actions?ref=badge)
|
|
25
|
+
[](https://securityscorecards.dev/viewer/?uri=github.com/PerryLink/dsh-lsp-actions)
|
|
26
|
+
[](https://dsh.market/)
|
|
27
|
+
[](https://gitee.com/perrylink/dsh-lsp-actions)
|
|
26
28
|
|
|
27
29
|
```sh
|
|
28
30
|
dsh plugin --profile <name> add dsh-lsp-actions
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
|
|
32
33
|
</div>
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
**📖 Ecosystem knowledge base** — measured data, not marketing: [plugin development guide · plugin-selection data · maintenance criteria](https://perrylink.github.io/dsh-plugin-guide/).
|
|
37
|
-
|
|
38
|
-
<!-- star-cta -->
|
|
39
|
-
## Install & uninstall
|
|
35
|
+
<sub>社区插件,与 DeepSeek 官方无关。唯一仓库:<https://github.com/PerryLink/dsh-lsp-actions>(Gitee 为镜像)。</sub>
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
- **npm channel** (published releases): `dsh plugin --profile web add dsh-lsp-actions`.
|
|
43
|
-
- **tarball channel**: `pnpm pack` in this repo, then `dsh plugin --profile web add ./dsh-lsp-actions-<version>.tgz`.
|
|
44
|
-
- **uninstall**: `dsh plugin --profile web remove dsh-lsp-actions` (or remove the row from the profile patch).
|
|
37
|
+
## 它是什么
|
|
45
38
|
|
|
46
|
-
|
|
39
|
+
`dsh-lsp-actions` 把 agent 写代码时最需要的那圈反馈接到真实语言服务器上:诊断、格式化、补全、代码动作、符号、签名提示、内联提示与重命名,全部由你 IDE 正在用的那些服务器(`typescript-language-server`、gopls、pyright、rust-analyzer……)应答。官方 `ctx.lsp` seam 只覆盖导航(跳转定义、引用、实现、悬停),本插件补齐动作面——并把它包装成稳定的编辑器 action 协议(`lsp.actions.*`),让 VS Code 等编辑器不必自己实现 LSP 就能消费这些能力。它以单个 host 行挂载(`id: lsp-actions`、`inject: [tools, fs, subprocess]`),服务端进程按需懒启动,所有写操作走官方 `fs/write-intent` 与沙箱审批。
|
|
47
40
|
|
|
48
|
-
|
|
41
|
+
<picture>
|
|
42
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/dsh-lsp-actions-flow-v5-dark.svg">
|
|
43
|
+
<img src="docs/assets/dsh-lsp-actions-flow-v5-light.svg" width="100%" alt="dsh-lsp-actions 结构图:请求-回传环——工具与编辑器协议汇入 ActionRunner,优先走 ctx.lsp seam,缺席或旧版时回落到 servers 路由与内置 stdio 客户端;服务器作答经归一化与有界回传,只有格式化与重命名穿过写入单向阀">
|
|
44
|
+
</picture>
|
|
49
45
|
|
|
50
|
-
|
|
46
|
+
## 三步上手
|
|
51
47
|
|
|
48
|
+
1. **安装**(三选一):
|
|
52
49
|
|
|
53
|
-
|
|
50
|
+
```sh
|
|
51
|
+
# git 通道(最新 main;prepare 脚本会用 tsc 构建出 lib/)
|
|
52
|
+
dsh plugin --profile web add github:PerryLink/dsh-lsp-actions
|
|
53
|
+
# npm 通道(已发布版本)
|
|
54
|
+
dsh plugin --profile web add dsh-lsp-actions
|
|
55
|
+
# tarball 通道:本仓库 pnpm pack 后
|
|
56
|
+
dsh plugin --profile web add ./dsh-lsp-actions-<version>.tgz
|
|
57
|
+
```
|
|
54
58
|
|
|
55
|
-
|
|
59
|
+
2. **最小配置**(默认 `servers: {}` 不激活任何服务器,至少加一条):
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
```yaml
|
|
62
|
+
- insert:
|
|
63
|
+
- id: lsp-actions
|
|
64
|
+
name: dsh-lsp-actions
|
|
65
|
+
config:
|
|
66
|
+
servers:
|
|
67
|
+
typescript:
|
|
68
|
+
command: typescript-language-server
|
|
69
|
+
args: ["--stdio"]
|
|
70
|
+
extensionToLanguage: { ".ts": typescript, ".tsx": typescriptreact }
|
|
71
|
+
projectMarkers: ["package.json", "tsconfig.json"]
|
|
72
|
+
```
|
|
58
73
|
|
|
59
|
-
|
|
74
|
+
3. **验证已生效**:
|
|
60
75
|
|
|
61
|
-
|
|
76
|
+
```sh
|
|
77
|
+
dsh --profile web --dump-config | grep -A3 'id: lsp-actions'
|
|
78
|
+
```
|
|
62
79
|
|
|
80
|
+
```text
|
|
81
|
+
> lsp_diagnostics a.ts
|
|
82
|
+
a.ts:1:3 [Error] boom [ts 2304]
|
|
83
|
+
```
|
|
63
84
|
|
|
85
|
+
**卸载**:`dsh plugin --profile web remove dsh-lsp-actions`(或从 profile patch 删掉该行)。
|
|
64
86
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
| Surface | Status |
|
|
68
|
-
|---|---|
|
|
69
|
-
| Harness | DeepSeek Harness `dsh-v0.2.1-alpha.1` (compat declared for `>=0.1.2-rc.1 <0.2.0 \|\| >=0.1.5-alpha.1 <0.2.0 \|\| >=0.1.6-0 <0.2.0 \|\| >=0.1.7-0 <0.2.0`); the plugin writes no session events itself - the host records the standard tool/call + tool/result events. The released seam still carries only the four legacy operations, so the plugin keeps its own client and records that vintage on the first action call. Verified 2026-09-24 (dual typecheck rulers + full test suite + self-contained/artifacts gates). |
|
|
70
|
-
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
71
|
-
| Platforms | All (pure host; subprocess + filesystem, no network) |
|
|
72
|
-
| Model | Any (tools are model-agnostic; the plugin never calls a model) |
|
|
73
|
-
|
|
74
|
-
## What you get
|
|
75
|
-
|
|
76
|
-
`dsh-lsp-actions` mounts as a single host row (`id: lsp-actions`, `name: dsh-lsp-actions`, `inject: [tools, fs, subprocess]`). The official DeepSeek Harness `ctx.lsp` seam covers **navigation** (go-to-definition, references, implementation, hover); this plugin completes the **action surface** — the feedback loop an agent needs while it writes and fixes code:
|
|
87
|
+
<details>
|
|
88
|
+
<summary>从 DSH Desktop 市场安装</summary>
|
|
77
89
|
|
|
78
|
-
|
|
79
|
-
2. **Editor action protocol v1** — a stable JSON-RPC surface (`lsp.actions.list` / `lsp.actions.run` / `lsp.events`) that lets any editor (VS Code first) consume those capabilities directly.
|
|
80
|
-
3. **Real-server verification** — a real `typescript-language-server` run is part of the test suite (self-contained, CI on Node 22/24 across Linux, Windows, and macOS), not just mocks.
|
|
90
|
+
所有 PerryLink 插件均可在 DSH Desktop 内置市场中浏览:**市场 → 来源 → 添加来源 → 粘贴** `https://perrylink-dsh-catalog.perrylink.workers.dev/catalog-source.json` **→ 选中**。安装仍需通过市场的 npm 身份校验与你的确认。
|
|
81
91
|
|
|
82
|
-
|
|
92
|
+
</details>
|
|
83
93
|
|
|
84
|
-
|
|
85
|
-
dsh plugin --profile web add github:PerryLink/dsh-lsp-actions
|
|
86
|
-
```
|
|
94
|
+
## 核心能力
|
|
87
95
|
|
|
88
|
-
|
|
89
|
-
# 1. install the bundle into your profile
|
|
90
|
-
dsh plugin --profile web add github:PerryLink/dsh-lsp-actions
|
|
96
|
+
本插件**只补齐动作面**:导航仍由官方 `ctx.lsp` seam 提供,动作在 seam 缺席、版本过旧或该文件没有 provider 时回落到插件自带的最小 stdio 客户端。
|
|
91
97
|
|
|
92
|
-
|
|
93
|
-
|
|
98
|
+
- **八个 `lsp_*` 工具** —— 诊断、格式化、补全、代码动作、符号、签名提示、内联提示与重命名,全部由真实语言服务器应答,不是 mock。
|
|
99
|
+
- **编辑器 action 协议 v1** —— 稳定的 JSON-RPC 面(`lsp.actions.list` / `lsp.actions.run` / `lsp.events`),任何编辑器(先行 VS Code)都能直接消费这些能力。
|
|
100
|
+
- **真实服务器验证** —— 测试套件含一次真实 `typescript-language-server` 运行与一次编辑器协议 e2e;CI 在 Node 22/24 × Linux/Windows/macOS 上跑。
|
|
101
|
+
- **写操作走官方通道** —— `lsp_format` / `lsp_rename` 经 `fs/write-intent` waterfall 与每次调用的沙箱策略;只读会话在服务器往返前就被拒绝。
|
|
102
|
+
- **默认只读** —— 八个工具里六个纯参考;只有格式化与重命名会改文件。
|
|
103
|
+
- **有界** —— 结果条数、字符数、文档字节数与每次调用超时都有上限;诊断缓存是有界 LRU。
|
|
94
104
|
|
|
95
|
-
|
|
96
|
-
|
|
105
|
+
```text
|
|
106
|
+
lsp_diagnostics / lsp_format / lsp_completion / lsp_code_action /
|
|
107
|
+
lsp_symbols / lsp_signature / lsp_inlay_hints / lsp_rename
|
|
108
|
+
│
|
|
109
|
+
▼
|
|
110
|
+
ctx.lsp seam(扩展后:diagnostics / formatDocument / completion)
|
|
111
|
+
│ 缺席 · 旧版 · 该文件无 provider
|
|
112
|
+
▼
|
|
113
|
+
内置 stdio 客户端 ← servers 表(ctx.subprocess.spawn + JSON-RPC)
|
|
97
114
|
```
|
|
98
115
|
|
|
99
|
-
###
|
|
116
|
+
### 工具与动作面
|
|
100
117
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
118
|
+
| 表面 | 类型 | 说明 |
|
|
119
|
+
|---|---|---|
|
|
120
|
+
| `lsp_diagnostics` | tool | `<file>` —— 编译器/分析器的错误、警告与提示,含严重级、范围、消息与来源服务器(只读) |
|
|
121
|
+
| `lsp_format` | tool | `<file> [range?]` —— 经语言服务器格式化文件/选区并应用,返回 diff(经 `fs/write-intent` 写盘) |
|
|
122
|
+
| `lsp_completion` | tool | `<file> <line> <character>` —— 光标处的补全建议,含插入文本(只读) |
|
|
123
|
+
| `lsp_code_action` | tool | `<file> [range?] [only?]` —— 服务器验证过的快速修复/重构(含其编辑),作用于某范围或首个诊断(仅参考) |
|
|
124
|
+
| `lsp_symbols` | tool | `<query?> <file_path?>` —— 按名字全局搜索符号,或列出单个文件的大纲(只读) |
|
|
125
|
+
| `lsp_signature` | tool | `<file> <line> <character>` —— 调用点处的签名提示(参数与文档)(只读) |
|
|
126
|
+
| `lsp_inlay_hints` | tool | `<file> [range?]` —— 服务器给出的类型标注与参数名提示(只读) |
|
|
127
|
+
| `lsp_rename` | tool | `<file> <line> <character> <new_name>` —— 服务器验证过的重命名,跨工作区应用并返回逐文件 diff(经 `fs/write-intent` 写盘) |
|
|
128
|
+
| `lsp.actions.*` | protocol | 编辑器 action 协议 v1:经 JSON-RPC 的 `lsp.actions.list` / `lsp.actions.run` / `lsp.events` |
|
|
129
|
+
| `examples/vscode/` | extension | 纯 UI 的 VS Code 扩展,及其所连接的 headless 后端组合 |
|
|
104
130
|
|
|
105
|
-
|
|
131
|
+
### 示例
|
|
106
132
|
|
|
107
|
-
|
|
108
|
-
lsp_diagnostics
|
|
109
|
-
~~~
|
|
133
|
+
以下为插件真实入口;安装后调用一个即可。
|
|
110
134
|
|
|
111
|
-
|
|
135
|
+
**详细示例** —— 命令 `lsp_diagnostics`,输入:
|
|
112
136
|
|
|
113
|
-
|
|
137
|
+
```json
|
|
114
138
|
{
|
|
115
139
|
"file_path": "a.ts"
|
|
116
140
|
}
|
|
117
|
-
|
|
141
|
+
```
|
|
118
142
|
|
|
119
|
-
|
|
143
|
+
输出:
|
|
120
144
|
|
|
121
|
-
|
|
145
|
+
```text
|
|
122
146
|
a.ts:1:3 [Error] boom [ts 2304]
|
|
123
147
|
a.ts:3:1 [Hint] hint
|
|
124
|
-
|
|
148
|
+
```
|
|
125
149
|
|
|
126
150
|
*Observed from `plugins/dsh-lsp-actions/tests/render.spec.ts:32-37 (exact toBe); tool-level no-result render at plugins/dsh-lsp-actions/tests/tools.spec.ts:150-156`*
|
|
127
151
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
**Input**
|
|
152
|
+
**失败分支** —— 输入:
|
|
131
153
|
|
|
132
|
-
|
|
154
|
+
```text
|
|
133
155
|
{"action":"format","requestId":"f1","params":{"filePath":"a.ts","workspaceRoot":"<session-workspace>"}} under a read-only permission preset
|
|
134
|
-
|
|
156
|
+
```
|
|
135
157
|
|
|
136
|
-
|
|
158
|
+
输出:
|
|
137
159
|
|
|
138
|
-
|
|
160
|
+
```text
|
|
139
161
|
{
|
|
140
162
|
"requestId": "f1",
|
|
141
163
|
"action": "format",
|
|
@@ -145,38 +167,98 @@ a.ts:3:1 [Hint] hint
|
|
|
145
167
|
"message": "[sandbox: file access denied under read-only mode]\n[sandbox: escalation available — retry this exact operation once with sandbox_permissions (the narrowest wider mode that suffices) + justification; the approval prompt asks the user]"
|
|
146
168
|
}
|
|
147
169
|
}
|
|
148
|
-
|
|
170
|
+
```
|
|
149
171
|
|
|
150
172
|
*Observed from `plugins/dsh-lsp-actions/src/tools.ts:213-223; plugins/dsh-lsp-actions/src/editor/actions.ts:320-330; plugins/dsh-lsp-actions/tests/editor-protocol.spec.ts:305-325`*
|
|
151
173
|
|
|
152
|
-
|
|
174
|
+
**简短示例**:`lsp_format` · `lsp_completion`
|
|
175
|
+
|
|
176
|
+
### 编辑器 action 协议 v1
|
|
177
|
+
|
|
178
|
+
在专用 headless 组合中设置 `editor.enabled: true` 后,`dsh-lsp-actions` 通过换行分帧的 JSON-RPC 2.0(与官方 SDK/ACP 传输同一线格式)提供稳定的编辑器协议:
|
|
179
|
+
|
|
180
|
+
| 方法 | 作用 |
|
|
181
|
+
|---|---|
|
|
182
|
+
| `lsp.actions.list` | 返回 `lsp-actions/v1` 协议版本、动作目录(`diagnostics.get`、`completion.get`、`quickfix.apply`、`format`,逐个标注 `writes`)与可寻址的 DSH 会话 |
|
|
183
|
+
| `lsp.actions.run` | 执行一个动作,返回结构化 `{ requestId, action, status, result \| error }` 信封;错误携带稳定的 `LSP_ACTION_*` 码 |
|
|
184
|
+
| `lsp.events` | 订阅流式 `lsp.event` 通知:`diagnostics.updated`、`action.status`、`file.changed`、`sessions.changed` |
|
|
185
|
+
|
|
186
|
+
所有写动作(`quickfix.apply`、`format`)都走**官方权限预设与审批**:`read-only` 会话在任何服务器往返前以 `LSP_ACTION_READ_ONLY` 拒绝;编辑走 `fs/write-intent` waterfall;`sandbox_permissions` + `justification` 升级对经官方 `approveEscalation` 询问(无应答方时 fail-closed)。完整线上规范(双语):[`docs/editor-protocol.md`](docs/editor-protocol.md) · [`docs/editor-protocol.zh-CN.md`](docs/editor-protocol.zh-CN.md)。
|
|
187
|
+
|
|
188
|
+
**版本化与向后兼容承诺**
|
|
189
|
+
|
|
190
|
+
- 协议带版本 —— `lsp.actions.list` 返回 `protocol: "lsp-actions/v1"`、`version: 1`。**v1 已冻结:**字段名、动作 id、事件类型与错误码永久稳定。
|
|
191
|
+
- 演进**只做加法**:新动作、新字段、新事件类型无需升版本;既有语义绝不原地变更;破坏性变更以新的 `protocol` 版本发布,服务端可并行服务多版本。
|
|
192
|
+
- 客户端必须忽略未知字段、未知事件类型与未知动作,并按稳定的错误 `code` 路由,绝不解析消息文本。
|
|
193
|
+
|
|
194
|
+
**错误码**
|
|
195
|
+
|
|
196
|
+
每个失败都携带稳定 `code`;模型与调用方按 code 路由,绝不解析消息文本。
|
|
197
|
+
|
|
198
|
+
| Code | 含义 |
|
|
199
|
+
|---|---|
|
|
200
|
+
| `LSP_ACTION_UNAVAILABLE` | 没有服务器 entry、seam provider 也不处理该文件 |
|
|
201
|
+
| `LSP_ACTION_UNSUPPORTED` | 服务器(或 seam provider)未广告该操作 |
|
|
202
|
+
| `LSP_ACTION_SERVER_FAILED` | 服务器失败(附 stderr 尾部);启动失败重试一次 |
|
|
203
|
+
| `LSP_ACTION_MALFORMED_RESPONSE` | 服务器返回了结构非法的负载 |
|
|
204
|
+
| `LSP_ACTION_CONFLICT` | 文件读后已变,或编辑重叠 / 越界 / 越出工作区 |
|
|
205
|
+
| `LSP_ACTION_READ_ONLY` | 会话沙箱模式禁止格式化/重命名写入 |
|
|
206
|
+
| `LSP_ACTION_WORKSPACE_REQUIRED` | 调用会话没有可扎根的 workspace cwd |
|
|
207
|
+
| `LSP_ACTION_NO_SYMBOL` | 服务器在光标位置找不到可重命名的符号 |
|
|
208
|
+
| `LSP_ACTION_UNKNOWN` | 编辑器协议:未知动作 id,或没有 code action 匹配 `title`/`index` |
|
|
209
|
+
| `LSP_ACTION_INVALID_ARGS` | 编辑器协议:动作参数不合法 |
|
|
210
|
+
| `LSP_ACTION_APPROVAL_UNAVAILABLE` | 编辑器协议:审批路径未能授予更宽沙箱模式(fail-closed) |
|
|
211
|
+
| `LSP_PROTOCOL_VERSION_UNSUPPORTED` | 编辑器协议:所声明的协议版本不被支持 |
|
|
212
|
+
|
|
213
|
+
### VS Code 扩展
|
|
214
|
+
|
|
215
|
+
[`examples/vscode/`](examples/vscode/) 附带**纯 UI** 扩展(侧栏:DSH 会话、诊断列表、quickfix 一键应用、点击定位、格式化)及其经 ACP 风格 JSON-RPC 连接的 headless 后端组合(`backend/cordis.yml`)。扩展不实现任何 LSP 逻辑——所有能力与每一笔写入都属于插件。安装步骤、设置项与动图录制脚本见 [`examples/vscode/README.md`](examples/vscode/README.md)。
|
|
216
|
+
|
|
217
|
+
### 架构
|
|
218
|
+
|
|
219
|
+
动作**优先走官方 seam**,未命中则回落插件自带的最小 stdio 客户端。seam 扩展已向上游提案([`upstream/lsp-action-seam.patch`](upstream/lsp-action-seam.patch),PR 描述见 [`upstream/PR-description.md`](upstream/PR-description.md));合入后插件无需改动即自动迁移——内置客户端停止被使用即可。内置客户端会保留为 `servers` 表的独立兜底。**编辑器协议**复用同一 runner、同一写入路径与同一权限机制。
|
|
220
|
+
|
|
221
|
+
动作后端位于公开 provider 接口 `ActionRunner`(从包导出)之后:内置 runner 是其中一个实现,第三方 provider 可另行提供;八个工具只消费该接口,绝不依赖具体客户端。完整调研与设计笔记:[`docs/seam-extension-notes.md`](docs/seam-extension-notes.md)。
|
|
153
222
|
|
|
154
|
-
|
|
155
|
-
- `lsp_completion`
|
|
223
|
+
## 配置
|
|
156
224
|
|
|
157
|
-
|
|
225
|
+
所有可调项都是 Schemastery `Config` 字段(可从 cordis.yml 修改)。以 id 为目标的覆盖会替换整行——你需要重述每一个键。`cordis.patch.yml` 对每个键都有内联说明。
|
|
158
226
|
|
|
159
|
-
|
|
227
|
+
最常用键:
|
|
160
228
|
|
|
161
|
-
|
|
|
229
|
+
| 键 | 默认值 | 含义 |
|
|
162
230
|
|---|---|---|
|
|
163
|
-
| `servers` | `{}` |
|
|
164
|
-
| `editor.enabled` | `false` |
|
|
165
|
-
| `
|
|
166
|
-
| `
|
|
167
|
-
| `
|
|
168
|
-
| `
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
|
174
|
-
|
|
175
|
-
| `
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
231
|
+
| `servers` | `{}` | 命名的语言服务器;空表不激活任何服务器 |
|
|
232
|
+
| `editor.enabled` | `false` | 通过 JSON-RPC stdio 提供编辑器 action 协议(仅限 headless 后端) |
|
|
233
|
+
| `maxDiagnostics` | `200` | 每次结果的诊断上限 |
|
|
234
|
+
| `maxResultChars` | `16000` | 渲染结果上限(字符数) |
|
|
235
|
+
| `maxDocumentBytes` | `4000000` | 文档读取上限(字节数) |
|
|
236
|
+
| `timeoutMs` | `60000` | 每次调用的超时,由官方 timeout 策略执行 |
|
|
237
|
+
|
|
238
|
+
<details>
|
|
239
|
+
<summary>完整配置表(13 个键)</summary>
|
|
240
|
+
|
|
241
|
+
| 键 | 默认值 | 含义 |
|
|
242
|
+
|---|---|---|
|
|
243
|
+
| `servers` | `{}` | 命名的语言服务器;空表不激活任何服务器 |
|
|
244
|
+
| `editor.enabled` | `false` | 通过 JSON-RPC stdio 提供编辑器 action 协议(仅限 headless 后端) |
|
|
245
|
+
| `editor.requestTimeoutMs` | `60000` | 编辑器协议每次运行的超时预算(毫秒) |
|
|
246
|
+
| `editor.diagnosticsCacheMaxFiles` | `64` | 有界 LRU 诊断缓存大小(按文件数) |
|
|
247
|
+
| `maxDiagnostics` | `200` | 每次结果的诊断上限 |
|
|
248
|
+
| `maxCompletionItems` | `20` | 每次结果的补全项上限 |
|
|
249
|
+
| `maxCodeActions` | `50` | 每次结果的代码动作上限 |
|
|
250
|
+
| `maxSymbols` | `100` | 符号结果上限 |
|
|
251
|
+
| `maxSignatures` | `10` | 签名提示上限 |
|
|
252
|
+
| `maxInlayHints` | `200` | 内联提示上限 |
|
|
253
|
+
| `maxResultChars` | `16000` | 渲染结果上限(字符数) |
|
|
254
|
+
| `maxDocumentBytes` | `4000000` | 文档读取上限(字节数) |
|
|
255
|
+
| `timeoutMs` | `60000` | 每次调用的超时,由官方 timeout 策略执行 |
|
|
256
|
+
|
|
257
|
+
</details>
|
|
258
|
+
|
|
259
|
+
每个 `servers` 条目都是一个 `LspServerEntry`:`command`(可执行文件,加载期在 PATH 上解析)与 `extensionToLanguage`(`".ts"` → `typescript`)为必填;可选的 `fileGlobs`、`projectMarkers`、`args`、`env`、`initializationOptions`、`configuration`、`formattingOptions`、`maxMessageBytes`、`maxStderrBytes`、`killGraceMs`、`shutdownTimeoutMs`、`diagnosticsSettleMs`、`diagnosticsDebounceMs` 与 `idleTimeoutMs`(`0` = 保持服务器进程存活,这也是默认值)用于调校内置 stdio 客户端。
|
|
260
|
+
|
|
261
|
+
路由是确定性的,且完全由配置决定。每个文件按以下顺序取第一个命中:**(1)** 某条目的 `fileGlobs` 匹配该路径;**(2)** 从文件所在目录向上走到工作区根,最近的、含有某个条目 `projectMarkers` 所列工程配置文件的目录——且该条目同时映射该文件的扩展名;**(3)** 按配置顺序,`extensionToLanguage` 映射该扩展名的条目。因此同一工作区内的 `apps/node-app/{package.json,tsconfig.json,src/main.ts}` 与 `apps/deno-app/{deno.json,src/main.ts}` 会各自用本工程的服务器处理 `main.ts`:无需维护任何路径规则,新增、改名或移动工程也不必改动配置:
|
|
180
262
|
|
|
181
263
|
```yaml
|
|
182
264
|
servers:
|
|
@@ -192,166 +274,160 @@ servers:
|
|
|
192
274
|
projectMarkers: ["deno.json", "deno.jsonc"]
|
|
193
275
|
```
|
|
194
276
|
|
|
195
|
-
|
|
277
|
+
工程标记只在该文件扩展名已被若干服务器映射的前提下做选择(绝不会扩大某个服务器的文件类型范围);向上查找永不越过工作区根;某个目录里的工程配置绝不会作用于同级目录。第 **(1)** 步优先于工程标记:若某条目的 `fileGlobs` 命中该路径,仍以它为准——采用 `projectMarkers` 时请一并删掉项目级的 glob,否则残留的 `**/*.ts` 会继续把这些文件抢走。以上规则作用于内置 stdio 客户端;挂载的 `ctx.lsp` seam provider 自行决定路由。
|
|
196
278
|
|
|
197
|
-
##
|
|
279
|
+
## FAQ
|
|
198
280
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
| `lsp_diagnostics` | tool | `<file>` — compiler/analyzer errors, warnings, and hints with severity, range, message, and source server (read-only) |
|
|
202
|
-
| `lsp_format` | tool | `<file> [range?]` — formats a file/selection through the language server and applies it, returning the diff (writes via `fs/write-intent`) |
|
|
203
|
-
| `lsp_completion` | tool | `<file> <line> <character>` — completion suggestions at a cursor position, including the insertion text (read-only) |
|
|
204
|
-
| `lsp_code_action` | tool | `<file> [range?] [only?]` — server-verified quickfixes/refactorings with their edits, for a range or the first diagnostic (reference-only) |
|
|
205
|
-
| `lsp_symbols` | tool | `<query?> <file_path?>` — workspace-wide symbol search by name, or one file's outline (read-only) |
|
|
206
|
-
| `lsp_signature` | tool | `<file> <line> <character>` — signature help (parameters and documentation) inside a call (read-only) |
|
|
207
|
-
| `lsp_inlay_hints` | tool | `<file> [range?]` — type annotations and parameter-name hints from the server (read-only) |
|
|
208
|
-
| `lsp_rename` | tool | `<file> <line> <character> <new_name>` — server-verified rename, applied workspace-wide with per-file diffs (writes via `fs/write-intent`) |
|
|
209
|
-
| `lsp.actions.*` | protocol | Editor action protocol v1: `lsp.actions.list` / `lsp.actions.run` / `lsp.events` over JSON-RPC |
|
|
210
|
-
| `examples/vscode/` | extension | UI-only VS Code extension plus the headless backend composition it connects to |
|
|
211
|
-
|
|
212
|
-
## Editor action protocol v1
|
|
213
|
-
|
|
214
|
-
When `editor.enabled: true` is set in a dedicated headless composition, `dsh-lsp-actions` serves a stable editor protocol over newline-delimited JSON-RPC 2.0 (the same wire framing as the official SDK/ACP transports):
|
|
215
|
-
|
|
216
|
-
| Method | What it does |
|
|
217
|
-
|---|---|
|
|
218
|
-
| `lsp.actions.list` | Returns the `lsp-actions/v1` protocol version, the action catalog (`diagnostics.get`, `completion.get`, `quickfix.apply`, `format` — each flagged `writes`), and the addressable DSH sessions |
|
|
219
|
-
| `lsp.actions.run` | Executes one action with a structured `{ requestId, action, status, result \| error }` envelope; errors carry the stable `LSP_ACTION_*` codes |
|
|
220
|
-
| `lsp.events` | Subscribes to the streamed `lsp.event` notifications: `diagnostics.updated`, `action.status`, `file.changed`, `sessions.changed` |
|
|
281
|
+
<details>
|
|
282
|
+
<summary>默认 <code>servers: {}</code> 时会怎样?会静默失效吗?</summary>
|
|
221
283
|
|
|
222
|
-
|
|
284
|
+
不会静默。八个工具仍会注册,但每次调用在既无服务器条目、又无 `ctx.lsp` seam provider 处理该文件时,以 `LSP_ACTION_UNAVAILABLE` 响亮失败。seam 是逐次调用解析的,因此插件挂载之后再挂载 seam 也不需要重载。`editor.enabled: false`(默认)时编辑器协议根本不启动。
|
|
223
285
|
|
|
224
|
-
|
|
286
|
+
</details>
|
|
225
287
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
- Clients must ignore unknown fields, unknown event kinds, and unknown actions, and route on the stable error `code`, never on message text.
|
|
288
|
+
<details>
|
|
289
|
+
<summary>写文件会不会绕过沙箱与审批?</summary>
|
|
229
290
|
|
|
230
|
-
|
|
291
|
+
不会。只有 `lsp_format` 与 `lsp_rename` 会写入,且与官方 `write`/`edit` 走同一条通道:先过 `fs/write-intent` waterfall(观测 → 守卫写 → 观测)与本次调用的沙箱策略;`read-only` 会话在任何服务器往返之前就以 `LSP_ACTION_READ_ONLY` 拒绝;需要更宽权限时,`sandbox_permissions` + `justification` 升级对经官方 `approveEscalation` 询问用户,无应答方时 fail-closed 为 `LSP_ACTION_APPROVAL_UNAVAILABLE`。
|
|
231
292
|
|
|
232
|
-
|
|
293
|
+
</details>
|
|
233
294
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
| `LSP_ACTION_UNAVAILABLE` | No server entry and no seam provider handles this file |
|
|
237
|
-
| `LSP_ACTION_UNSUPPORTED` | The server (or seam provider) does not advertise the operation |
|
|
238
|
-
| `LSP_ACTION_SERVER_FAILED` | The server failed (with its stderr tail); startup failures retry once |
|
|
239
|
-
| `LSP_ACTION_MALFORMED_RESPONSE` | The server sent a structurally invalid payload |
|
|
240
|
-
| `LSP_ACTION_CONFLICT` | The file changed since it was read, or the edits overlap / go out of bounds / leave the workspace |
|
|
241
|
-
| `LSP_ACTION_READ_ONLY` | The session's sandbox mode forbids the formatting/rename write |
|
|
242
|
-
| `LSP_ACTION_WORKSPACE_REQUIRED` | The calling session has no workspace cwd to root the server in |
|
|
243
|
-
| `LSP_ACTION_NO_SYMBOL` | The server found no renameable symbol at the cursor position |
|
|
244
|
-
| `LSP_ACTION_UNKNOWN` | Editor protocol: unknown action id, or no code action matched `title`/`index` |
|
|
245
|
-
| `LSP_ACTION_INVALID_ARGS` | Editor protocol: malformed action parameters |
|
|
246
|
-
| `LSP_ACTION_APPROVAL_UNAVAILABLE` | Editor protocol: the approval path could not grant a wider sandbox mode (fail-closed) |
|
|
247
|
-
| `LSP_PROTOCOL_VERSION_UNSUPPORTED` | Editor protocol: the declared protocol version is not supported |
|
|
295
|
+
<details>
|
|
296
|
+
<summary>会和别的插件抢工具名、事件或 slot 吗?</summary>
|
|
248
297
|
|
|
249
|
-
|
|
298
|
+
不会。工具全部带命名空间、不提供任何服务键、不注册客户端 slot、不注册 `webServer` 前缀、不改全局对象;组合包 patch 只 `insert` 自己那一行;唯一共享事件 `fs/write-intent` 一律经 `next()` 委托,绝不短路链条。逐条论证见「与其他 DSH 插件的互操作性」。
|
|
250
299
|
|
|
251
|
-
|
|
300
|
+
</details>
|
|
252
301
|
|
|
302
|
+
<details>
|
|
303
|
+
<summary>文件在我读完之后被改了,会被覆盖吗?</summary>
|
|
253
304
|
|
|
254
|
-
|
|
305
|
+
不会。文件读后已在磁盘上变化,动作以 `LSP_ACTION_CONFLICT` 失败;编辑重叠、越界或越出工作区同样报冲突。`lsp_rename` 在第一笔写入之前预检每一个待改文件。
|
|
255
306
|
|
|
256
|
-
|
|
257
|
-
- **Data**: nothing is stored on disk; tool results live only in the session log (no cross-session persistence). The editor protocol keeps one bounded in-memory LRU diagnostics cache, freshness-stamped and never persisted across restarts.
|
|
258
|
-
- **No network**: the plugin makes no network requests; it talks to language servers over local subprocess stdio.
|
|
307
|
+
</details>
|
|
259
308
|
|
|
260
|
-
|
|
309
|
+
<details>
|
|
310
|
+
<summary>资源开销多大?</summary>
|
|
261
311
|
|
|
262
|
-
|
|
263
|
-
- **Official seams, not re-implemented.** Every byte goes through the `fs/write-intent` waterfall (observation → guarded write → observation) and the per-call sandbox policy; escalation matches the official `write`/`edit` tools.
|
|
264
|
-
- **Fail loud, fast, structured.** Empty `servers` + no `ctx.lsp` seam → `LSP_ACTION_UNAVAILABLE`; read-only sessions → `LSP_ACTION_READ_ONLY` before any server round-trip; command forms are reported and never executed.
|
|
265
|
-
- **Conflicts never clobber.** A file changed on disk after it was read fails with `LSP_ACTION_CONFLICT`; `lsp_rename` pre-flights every edited file before the first write.
|
|
266
|
-
- **Bounded work.** Result caps, byte caps, and the platform's timeout policy bound every call; the diagnostics cache is a bounded LRU.
|
|
267
|
-
- **Nothing cached on the model path.** Tool results live only in the session log; the diagnostics cache never persists across restarts.
|
|
268
|
-
- **Bad servers fail loudly.** A missing executable fails at load; a server that dies at startup fails the call with `LSP_ACTION_SERVER_FAILED` plus its stderr tail (after one fresh-spawn retry).
|
|
269
|
-
- **Prompt hygiene.** The plugin injects no persona or prompt prose into the session system prompt — its model-facing surface is the eight tool schemas.
|
|
312
|
+
服务器进程按需懒启动,每个实例的文档保持常驻直到进程回收;`idleTimeoutMs` 默认 `0`(常驻),设为正数即可在空闲后回收。每次调用的结果条数、字符数、文档字节数与总时长都有上限;编辑器协议的诊断缓存是有界 LRU(`editor.diagnosticsCacheMaxFiles`);插件不发起任何网络请求。
|
|
270
313
|
|
|
271
|
-
|
|
314
|
+
</details>
|
|
272
315
|
|
|
273
|
-
|
|
316
|
+
## 安全边界
|
|
274
317
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
built-in stdio client ← servers table (ctx.subprocess.spawn + JSON-RPC)
|
|
284
|
-
```
|
|
318
|
+
- **默认只读。** 八个工具中有六个仅作参考;只有 `lsp_format` 与 `lsp_rename` 会变更,且按真实的 `write`/`edit` 变更对待。
|
|
319
|
+
- **走官方 seam,而非另起炉灶。** 每个字节都经过 `fs/write-intent` waterfall(观测 → 守卫写 → 观测)与每次调用的沙箱策略;升级路径与官方 `write`/`edit` 工具一致。
|
|
320
|
+
- **响亮、快速、结构化地失败。** `servers` 为空且无 `ctx.lsp` seam → `LSP_ACTION_UNAVAILABLE`;只读会话在任何服务器往返前 → `LSP_ACTION_READ_ONLY`;命令形态只报告、绝不执行。
|
|
321
|
+
- **冲突绝不覆盖。** 文件读后已变则以 `LSP_ACTION_CONFLICT` 失败;`lsp_rename` 在第一笔写入前预检每个待改文件。
|
|
322
|
+
- **有界工作。** 结果上限、字节上限与平台的 timeout 策略约束每一次调用;诊断缓存是有界 LRU。
|
|
323
|
+
- **模型路径不缓存任何东西。** 工具结果只存在于会话日志;诊断缓存绝不跨重启持久化。
|
|
324
|
+
- **坏服务器响亮失败。** 命令缺失在加载期即失败;启动即死的服务器以 `LSP_ACTION_SERVER_FAILED` + stderr 尾部失败(启动失败先自动换新进程重试一次)。
|
|
325
|
+
- **提示词卫生。** 本插件不向会话系统提示词注入任何 persona 或提示词段落——面向模型的接口只有八个工具 Schema。
|
|
285
326
|
|
|
286
|
-
|
|
327
|
+
## 权限与数据
|
|
287
328
|
|
|
288
|
-
|
|
329
|
+
- **权限**:格式化与重命名走官方权限预设与审批——`fs/write-intent` waterfall 与 `sandbox_permissions` / `justification` 升级对,经 `ctx.approval` 裁决。插件在其 workshop manifest 中声明 `fs:read`、`fs:write`、`subprocess:spawn` 与 `network:none`。
|
|
330
|
+
- **数据**:不向磁盘写入任何东西;工具结果只存在于会话日志(无跨会话持久化)。编辑器协议只保留一个有界的内存 LRU 诊断缓存,带新鲜度戳,绝不跨重启持久化。隐私说明见 [`PRIVACY.md`](PRIVACY.md)。
|
|
331
|
+
- **无网络**:插件不发起任何网络请求;它通过本地子进程 stdio 与语言服务器通信。
|
|
289
332
|
|
|
290
|
-
##
|
|
333
|
+
## 已知限制
|
|
291
334
|
|
|
292
|
-
-
|
|
293
|
-
-
|
|
294
|
-
-
|
|
335
|
+
- **常驻文档。** 每个文档只打开一次,并在该服务器实例的整个生命周期内保持打开——后续请求若源码已变,会发一次全量 `didChange`;进程关闭时才收拢所有文档。因此基于工程的服务器(如 tsls)能应答 `textDocument/signatureHelp` 与不依赖打开文档的 `workspace/symbol`,而不是对刚关闭的文档返回 `null`。常驻集合以工作区为界,并随实例回收(空闲驱逐或插件释放)而清空。
|
|
336
|
+
- **范围格式化要求服务器的 range provider。** 只广告全文格式化的服务器对范围请求以 `LSP_ACTION_UNSUPPORTED` 失败。
|
|
337
|
+
- **重命名只应用文本编辑。** 服务器重命名结果中的资源操作(新建/删除/重命名文件)以 `LSP_ACTION_UNSUPPORTED` 拒绝;越出工作区的编辑在任何写入发生前以 `LSP_ACTION_CONFLICT` 失败。
|
|
295
338
|
|
|
296
|
-
##
|
|
339
|
+
## 与其他 DSH 插件的互操作性
|
|
297
340
|
|
|
298
|
-
|
|
299
|
-
pnpm install # node ^22.19 || >=24
|
|
300
|
-
pnpm run lint # oxlint over src/ and tests/
|
|
301
|
-
pnpm test # vitest: unit + fixture-server integration + editor-protocol e2e + real tsls e2e
|
|
302
|
-
pnpm run test:coverage # coverage gate
|
|
303
|
-
pnpm build # tsc --noEmitOnError && node scripts/fix-dts.mjs → lib/
|
|
304
|
-
pnpm run prepare # tsc --noEmitOnError && node scripts/fix-dts.mjs (runs on install)
|
|
305
|
-
pnpm run prepublishOnly # tsc --noEmitOnError && node scripts/fix-dts.mjs (runs before publish)
|
|
306
|
-
```
|
|
341
|
+
已对照 **DSH `0.2.0-rc.2`**(本 README 面向的运行时)与 2026-10-05 实测的高星插件集验证。
|
|
307
342
|
|
|
308
|
-
|
|
343
|
+
本插件**不干扰**其他插件,包括广泛安装的高星插件:
|
|
309
344
|
|
|
310
|
-
|
|
345
|
+
- **无工具名冲突。** 所有工具都带命名空间,不占用任何已被内置工具或其他插件持有的裸名。
|
|
346
|
+
- **无服务键冲突。** 不提供任何服务键,因此不存在服务键冲突。
|
|
347
|
+
- **无 slot 冲突。** 不注册客户端 slot key,因此不参与 `shadows-shipped-ui` 座位争抢。
|
|
348
|
+
- **无 HTTP 路由冲突。** 不注册任何 `webServer` 前缀。
|
|
349
|
+
- **无 patch 层冲突。** 组合包 patch 只 `insert` 自己那一行,从不覆写内置行的 `config`。
|
|
350
|
+
- **无全局改写。** 不改原型、不改写 `process.env`、不替换全局 fetch dispatcher。
|
|
311
351
|
|
|
312
|
-
|
|
352
|
+
**共享事件监听器在构造上就不互相干扰。** 它用 `ctx.on()` 监听顺序敏感事件 `fs/write-intent` —— Cordis 的**广播**语义:每个监听器都会运行,任何一个都无法饿死其他监听器。**此处每个监听器都通过 `next()` 委托**,因此链条绝不会被短路;改写作用在 `next()` 产出的值上,而不是用它顶替返回。
|
|
313
353
|
|
|
314
|
-
-
|
|
315
|
-
- **No service-key collision.** It provides no service key at all, so it cannot collide on one.
|
|
316
|
-
- **No slot collision.** It registers no client slot key, so it cannot contend for a `shadows-shipped-ui` seat.
|
|
317
|
-
- **No HTTP route collision.** It registers no `webServer` prefix.
|
|
318
|
-
- **No patch-layer collision.** The bundle patch only `insert`s its own row; it never overrides a built-in row's `config`.
|
|
319
|
-
- **No global mutation.** It does not patch prototypes, rewrite `process.env`, or replace the global fetch dispatcher.
|
|
354
|
+
静态证据:`dsh-plugin-doctor` 的 K10–K13 在本仓全部为 `pass`。
|
|
320
355
|
|
|
321
|
-
|
|
356
|
+
## 兼容性
|
|
322
357
|
|
|
323
|
-
|
|
358
|
+
| 维度 | 状态 |
|
|
359
|
+
|---|---|
|
|
360
|
+
| Harness | DeepSeek Harness `dsh-v0.2.1-alpha.1`(`engines.dsh`:`>=0.2.1-0 <0.3.0 \|\| >=0.2.2-0 <0.3.0`);插件不自写会话事件——宿主记录标准 tool/call + tool/result 事件。已发布 seam 仍只有四个 legacy 操作,故插件保留自建客户端并在首次动作调用时记录该 vintage。已于 2026-09-24 核验(双 typecheck 尺子 + 全量测试 + self-contained/artifacts 门)。 |
|
|
361
|
+
| Node | `^22.19.0 \|\| >=24.9.0` |
|
|
362
|
+
| 平台 | 全部(纯 host;子进程 + 文件系统,无网络) |
|
|
363
|
+
| 模型 | 任意(工具与模型无关;插件从不调用模型) |
|
|
324
364
|
|
|
325
|
-
##
|
|
365
|
+
## 生态与质量
|
|
326
366
|
|
|
327
|
-
|
|
367
|
+
- [Gitee 镜像](https://gitee.com/perrylink/dsh-lsp-actions)(同步镜像,以 GitHub 为准)
|
|
368
|
+
- [dshfind 插件页](https://dshfind.com/plugins/PerryLink/dsh-lsp-actions)(安装量与排名)
|
|
369
|
+
- [OpenSSF Scorecard 报告](https://securityscorecards.dev/viewer/?uri=github.com/PerryLink/dsh-lsp-actions)(由 [.github/workflows/scorecard.yml](.github/workflows/scorecard.yml) 驱动)
|
|
370
|
+
- [dsh-plugin-doctor 验证报告](https://github.com/PerryLink/dsh-plugin-doctor#verified-徽章)(K10–K13 全 `pass`)
|
|
371
|
+
- [DSH Market](https://dsh.market/)(已上架)
|
|
372
|
+
- **1024 商店渠道**:先 `npm i -g dsh1024`,再 `dsh1024 plugin --profile web add dsh-lsp-actions`(计入 [deepseek1024.com](https://deepseek1024.com) 安装排行)
|
|
373
|
+
- [生态实测知识库](https://perrylink.github.io/dsh-plugin-guide/):插件开发指南 · 选型实测数据 · 维护取舍判据
|
|
328
374
|
|
|
329
|
-
##
|
|
375
|
+
## 开发
|
|
330
376
|
|
|
331
|
-
|
|
377
|
+
```sh
|
|
378
|
+
pnpm install # node ^22.19 || >=24.9
|
|
379
|
+
pnpm run lint # oxlint over src/ and tests/
|
|
380
|
+
pnpm test # vitest: 单元 + fixture-server 集成 + 编辑器协议 e2e + 真实 tsls e2e
|
|
381
|
+
pnpm run test:coverage # 覆盖率门禁
|
|
382
|
+
pnpm build # tsc --noEmitOnError && node scripts/fix-dts.mjs → lib/
|
|
383
|
+
pnpm run prepare # 构建(安装时运行)
|
|
384
|
+
pnpm run prepublishOnly # 构建(发布前运行)
|
|
385
|
+
pnpm run check:readmes # 五语 README 一致性门禁
|
|
386
|
+
pnpm run verify:self-contained # 依赖 spec 均来自 registry
|
|
387
|
+
pnpm run verify:artifacts # 发布文件齐全 + 产物可 import
|
|
388
|
+
pnpm run check:lockfile # lockfile 漂移检查
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
目录布局:
|
|
392
|
+
|
|
393
|
+
```text
|
|
394
|
+
src/ 插件主体:servers / client / runner / tools / editor / seam
|
|
395
|
+
tests/ vitest:单元 + fixture server + 编辑器协议 e2e + 真实 tsls e2e
|
|
396
|
+
examples/vscode 纯 UI 的 VS Code 扩展 + 它连接的 headless 后端组合
|
|
397
|
+
docs/ 编辑器协议(双语)+ seam 扩展调研 + assets/
|
|
398
|
+
scripts/ 构建产物修补与机械门禁(readme 同步 / self-contained / artifacts)
|
|
399
|
+
upstream/ seam 扩展的上游提案(补丁 + PR 描述)
|
|
400
|
+
verify/ 编辑器后端的冒烟脚本与 scratch 组合
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
配图由 [`scripts/gen-readme-assets.py`](scripts/gen-readme-assets.py) 程序化生成(Pillow 出 1440×576 的 hero WebP,深浅 × 中英四版;手写 1100×660 的 SVG 请求-回传环),可重复执行。
|
|
332
404
|
|
|
333
|
-
|
|
405
|
+
Topics:`dsh`, `dsh-plugin`, `deepseek-harness`, `lsp`, `language-server`, `diagnostics`, `formatting`, `completion`, `code-action`, `symbols`, `signature-help`, `inlay-hints`, `rename`, `refactor`, `ide`, `editor`, `vscode`, `acp`, `json-rpc`
|
|
334
406
|
|
|
335
|
-
|
|
407
|
+
## 家族与致谢
|
|
408
|
+
|
|
409
|
+
本项目是 [PerryLink](https://github.com/PerryLink) 维护的 DeepSeek Harness 插件家族成员(全部 Apache-2.0)。如果这个插件帮到了你,**给个 star**——它不解锁任何功能,但会让下一个人更容易找到它。
|
|
410
|
+
|
|
411
|
+
- [@PerryLink](https://github.com/PerryLink) —— 创建者与维护者:LSP 动作客户端与服务器生命周期、全部八个工具、编辑器 action 协议、测试、CI,以及五语种文档。
|
|
336
412
|
|
|
337
413
|
<details>
|
|
338
|
-
<summary
|
|
414
|
+
<summary>展开全部插件</summary>
|
|
339
415
|
|
|
340
|
-
|
|
|
416
|
+
| 插件 | 状态 |
|
|
341
417
|
|---|---|
|
|
342
418
|
| **[dsh-aqua-input-check](https://github.com/PerryLink/dsh-aqua-input-check)** | |
|
|
343
419
|
| **[dsh-archive-check](https://github.com/PerryLink/dsh-archive-check)** | |
|
|
344
420
|
| **[dsh-auto-review](https://github.com/PerryLink/dsh-auto-review)** | |
|
|
345
|
-
| **[dsh-autotier](https://github.com/PerryLink/dsh-autotier)** | 🧊
|
|
421
|
+
| **[dsh-autotier](https://github.com/PerryLink/dsh-autotier)** | 🧊 已冻结 — 见仓库 README |
|
|
346
422
|
| **[dsh-bid-ca-precheck](https://github.com/PerryLink/dsh-bid-ca-precheck)** | |
|
|
347
423
|
| **[dsh-bid-qual-check](https://github.com/PerryLink/dsh-bid-qual-check)** | |
|
|
348
|
-
| **[dsh-cert-mcp](https://github.com/PerryLink/dsh-cert-mcp)** | 🧊
|
|
424
|
+
| **[dsh-cert-mcp](https://github.com/PerryLink/dsh-cert-mcp)** | 🧊 已冻结 — 见仓库 README |
|
|
349
425
|
| **[dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind)** | |
|
|
350
426
|
| **[dsh-click](https://github.com/PerryLink/dsh-click)** | |
|
|
351
427
|
| **[dsh-composer-history](https://github.com/PerryLink/dsh-composer-history)** | |
|
|
352
428
|
| **[dsh-contract-stance](https://github.com/PerryLink/dsh-contract-stance)** | |
|
|
353
429
|
| **[dsh-customs-doc-check](https://github.com/PerryLink/dsh-customs-doc-check)** | |
|
|
354
|
-
| **[dsh-data-quality](https://github.com/PerryLink/dsh-data-quality)** |
|
|
430
|
+
| **[dsh-data-quality](https://github.com/PerryLink/dsh-data-quality)** | 🧊 已冻结 — 见仓库 README |
|
|
355
431
|
| **[dsh-demurrage-ledger](https://github.com/PerryLink/dsh-demurrage-ledger)** | |
|
|
356
432
|
| **[dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck)** | |
|
|
357
433
|
| **[dsh-drill-script-check](https://github.com/PerryLink/dsh-drill-script-check)** | |
|
|
@@ -384,7 +460,7 @@ This project is part of the DeepSeek Harness plugin family from [PerryLink](http
|
|
|
384
460
|
| **[dsh-mask](https://github.com/PerryLink/dsh-mask)** | |
|
|
385
461
|
| **[dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel)** | |
|
|
386
462
|
| **[dsh-medrec-qc](https://github.com/PerryLink/dsh-medrec-qc)** | |
|
|
387
|
-
| **[dsh-memento](https://github.com/PerryLink/dsh-memento)** |
|
|
463
|
+
| **[dsh-memento](https://github.com/PerryLink/dsh-memento)** | 🧊 已冻结 — 见仓库 README |
|
|
388
464
|
| **[dsh-nsfc-form-check](https://github.com/PerryLink/dsh-nsfc-form-check)** | |
|
|
389
465
|
| **[dsh-nurse-record-check](https://github.com/PerryLink/dsh-nurse-record-check)** | |
|
|
390
466
|
| **[dsh-observe](https://github.com/PerryLink/dsh-observe)** | |
|
|
@@ -396,10 +472,10 @@ This project is part of the DeepSeek Harness plugin family from [PerryLink](http
|
|
|
396
472
|
| **[dsh-permit-report-check](https://github.com/PerryLink/dsh-permit-report-check)** | |
|
|
397
473
|
| **[dsh-pipeline-check](https://github.com/PerryLink/dsh-pipeline-check)** | |
|
|
398
474
|
| **[dsh-pleading-draft](https://github.com/PerryLink/dsh-pleading-draft)** | |
|
|
399
|
-
| **[dsh-plugin-doctor](https://github.com/PerryLink/dsh-plugin-doctor)** |
|
|
475
|
+
| **[dsh-plugin-doctor](https://github.com/PerryLink/dsh-plugin-doctor)** | 🚫 已退役(仓库已归档) |
|
|
400
476
|
| **[dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide)** | |
|
|
401
|
-
| **[dsh-plugin-kit](https://github.com/PerryLink/dsh-plugin-kit)** |
|
|
402
|
-
| **[dsh-plugin-upgrade](https://github.com/PerryLink/dsh-plugin-upgrade)** |
|
|
477
|
+
| **[dsh-plugin-kit](https://github.com/PerryLink/dsh-plugin-kit)** | 🚫 已退役(仓库已归档) |
|
|
478
|
+
| **[dsh-plugin-upgrade](https://github.com/PerryLink/dsh-plugin-upgrade)** | 🚫 已退役(仓库已归档) |
|
|
403
479
|
| **[dsh-policy-brief-draft](https://github.com/PerryLink/dsh-policy-brief-draft)** | |
|
|
404
480
|
| **[dsh-power-loss-split](https://github.com/PerryLink/dsh-power-loss-split)** | |
|
|
405
481
|
| **[dsh-power-ticket-check](https://github.com/PerryLink/dsh-power-ticket-check)** | |
|
|
@@ -411,7 +487,7 @@ This project is part of the DeepSeek Harness plugin family from [PerryLink](http
|
|
|
411
487
|
| **[dsh-review-reply-check](https://github.com/PerryLink/dsh-review-reply-check)** | |
|
|
412
488
|
| **[dsh-rulefile-check](https://github.com/PerryLink/dsh-rulefile-check)** | |
|
|
413
489
|
| **[dsh-safety-brief-check](https://github.com/PerryLink/dsh-safety-brief-check)** | |
|
|
414
|
-
| **[dsh-score](https://github.com/PerryLink/dsh-score)** |
|
|
490
|
+
| **[dsh-score](https://github.com/PerryLink/dsh-score)** | 🧊 已冻结 — 见仓库 README |
|
|
415
491
|
| **[dsh-session-sync](https://github.com/PerryLink/dsh-session-sync)** | |
|
|
416
492
|
| **[dsh-site-log-check](https://github.com/PerryLink/dsh-site-log-check)** | |
|
|
417
493
|
| **[dsh-skill-pack-security](https://github.com/PerryLink/dsh-skill-pack-security)** | |
|
|
@@ -423,22 +499,24 @@ This project is part of the DeepSeek Harness plugin family from [PerryLink](http
|
|
|
423
499
|
| **[dsh-tender-extract](https://github.com/PerryLink/dsh-tender-extract)** | |
|
|
424
500
|
| **[dsh-tender-matrix](https://github.com/PerryLink/dsh-tender-matrix)** | |
|
|
425
501
|
| **[dsh-test-drive](https://github.com/PerryLink/dsh-test-drive)** | |
|
|
426
|
-
| **[dsh-ticktick](https://github.com/PerryLink/dsh-ticktick)** |
|
|
502
|
+
| **[dsh-ticktick](https://github.com/PerryLink/dsh-ticktick)** | 🚫 已退役(仓库已归档) |
|
|
427
503
|
| **[dsh-translate](https://github.com/PerryLink/dsh-translate)** | |
|
|
428
504
|
| **[dsh-warranty-calc](https://github.com/PerryLink/dsh-warranty-calc)** | |
|
|
429
|
-
| **[dsh-budget](https://github.com/PerryLink/dsh-budget)** | 🧊
|
|
430
|
-
| **[dsh-claude-move](https://github.com/PerryLink/dsh-claude-move)** | 🧊
|
|
431
|
-
| **[dsh-defend](https://github.com/PerryLink/dsh-defend)** | 🧊
|
|
432
|
-
| **[dsh-draw](https://github.com/PerryLink/dsh-draw)** | 🧊
|
|
433
|
-
| **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | 🧊
|
|
434
|
-
| **[dsh-background-agents](https://github.com/PerryLink/dsh-background-agents)** | 🚫
|
|
435
|
-
| **[dsh-session-pin](https://github.com/PerryLink/dsh-session-pin)** | 🚫
|
|
436
|
-
| **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | 🚫
|
|
505
|
+
| **[dsh-budget](https://github.com/PerryLink/dsh-budget)** | 🧊 已冻结 — 见仓库 README |
|
|
506
|
+
| **[dsh-claude-move](https://github.com/PerryLink/dsh-claude-move)** | 🧊 已冻结 — 见仓库 README |
|
|
507
|
+
| **[dsh-defend](https://github.com/PerryLink/dsh-defend)** | 🧊 已冻结 — 见仓库 README |
|
|
508
|
+
| **[dsh-draw](https://github.com/PerryLink/dsh-draw)** | 🧊 已冻结 — 见仓库 README |
|
|
509
|
+
| **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | 🧊 已冻结 — 见仓库 README |
|
|
510
|
+
| **[dsh-background-agents](https://github.com/PerryLink/dsh-background-agents)** | 🚫 已退役(仓库已归档) |
|
|
511
|
+
| **[dsh-session-pin](https://github.com/PerryLink/dsh-session-pin)** | 🚫 已退役(仓库已归档) |
|
|
512
|
+
| **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | 🚫 已退役(仓库已归档) |
|
|
437
513
|
|
|
438
514
|
</details>
|
|
439
515
|
|
|
440
|
-
- [Privacy](PRIVACY.md)
|
|
441
|
-
|
|
442
516
|
## License
|
|
443
517
|
|
|
444
|
-
[Apache License 2.0
|
|
518
|
+
[LICENSE](LICENSE)(Apache License 2.0)© 2026 dsh-lsp-actions contributors
|
|
519
|
+
|
|
520
|
+
<p align="center"><sub>Apache-2.0 · 社区插件,与 DeepSeek 无关。</sub></p>
|
|
521
|
+
|
|
522
|
+
<p align="center"><sub>工具链:<a href="https://github.com/PerryLink/dsh-plugin-guide">dsh-plugin-guide</a> · <a href="https://github.com/PerryLink/dsh-standards">dsh-standards</a> · <a href="https://github.com/PerryLink/dsh-plugin-start">dsh-plugin-start</a></sub></p>
|