dsh-copilot-vision 0.0.0-stage → 1.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ccr-wer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,91 @@
1
- # Temporary Holding Version
1
+ # Vision-Pilot
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 为 DSH(DeepSeek Harness)打造的 Computer Use 增强插件:让模型不仅能「看」屏幕,还能「等」变化、并「精准」操作。纯 JS 生态实现——无 sharp、无 OpenCV、无重型 native 图像库,唯一的 native 依赖是 robot-ts 随包分发的 Windows 预编译模块。
4
+
5
+ ## 核心设计
6
+
7
+ ### 双轨执行
8
+
9
+ 本地轨道经 robot-ts 直连 Windows(屏幕捕获 + 鼠标注入 + 低层键盘钩子);`src/vp-ssh-core.js` 预留远程轨道接口。当前发版只启用本地轨道,远程不注册任何工具——接口在那里,能力按需放开。
10
+
11
+ ### 动态视觉感知:不传全屏,传差分
12
+
13
+ `vp_screenshot_diff` 用 pixelmatch 逐像素比对,4 邻域连通块合并,小于 100 像素的噪声(光标、闪烁)直接丢弃,把「哪里变了」而不是「整屏是什么」交还给模型。`vp_wait_change` 更进一步:每 100ms 在内存里截屏比对,**轮询期零落盘**,变化出现的瞬间才落一张正式截图。「等页面加载」从反复截图碰运气,变成一次有明确语义的等待。换显示器或改缩放后坐标即不可信——宽高或 scaleFactor 不一致直接报错,绝不重采样硬算。网格放大图不再固定 4 倍:按区域面积自适应倍率——≤50,000 物理像素 4x、≤200,000 2x、更大 1x 只画网格,大区域不再产出巨图;同时以「放大后单边 ≤2,000 像素」兜底,4,344×4 这类细长条不会被放大成 17,376 宽的畸形长图。每个区域以 `gridScale` 字段标明实际倍数。`coverage` 只是变色像素的比例,白底同类元素位移时可能仅 2% 却已改天换地——判断变化要看 `regions` 与 `gridPath` 的实际内容,不能只看覆盖率。上下文策略同样内置在工具 description 里(「长程上下文纪律」):旧图会被清理、历史路径随时可能失效,模型必须以最新一次观察为准,偏离预期就直接重新截图,不翻历史记录。
14
+
15
+ ### 人机共驾安全
16
+
17
+ 授权是一个五态状态机(unauthorized / pending-once / authorized-once / pending-persistent / persistent),铁律:**授权只由人的动作进入和撤销,不由时钟改变**——没有到期时间,没有剩余毫秒,持续授权等再久都不失效(回归测试用 35 秒等待证明这一点)。人有三条通道:问答卡片上点「允许」、Shift+Space 热键随时接管或撤销、JSON Lines 审计日志事后追溯(只记状态机动作与来源,不记任何按键内容)。点击闸门顺序是授权 → 参数 → 越界 → 消费,失败路径不浪费单次授权。
18
+
19
+ <!-- 配图位 1:授权问答卡片截图(宿主内 vp_request_auth 弹出的人类确认卡片) -->
20
+
21
+ ### 位置编码注入
22
+
23
+ 大模型在原尺寸小图上数错行、估偏上百像素是常态。Vision-Pilot 把坐标计算交还给代码:每个差分区域附一张 `gridPath` 放大图——按区域面积与单边长度自适应倍率(4x / 2x / 1x,放大后单边 ≤2,000 像素)的最近邻放大,每 20 物理像素一条半透明红线,网格原点就是区域左上角(pngjs + 手写 Bresenham,零新增依赖)。模型只负责数格子、报百分比,`vp_click_relative` 完成精确换算。实测:模型按网格估点落进文字区,误差 ≤ 2.5px;同一场景靠肉眼估坐标偏过 111px。
24
+
25
+ <!-- 配图位 2:vp-grid-*.png 网格放大图示例(自适应倍率 4x/2x/1x 且单边 ≤2,000 像素,红线每格 = 20 物理像素) -->
26
+
27
+ ## 工具集
28
+
29
+ | 工具 | 一句话 |
30
+ |---|---|
31
+ | `vp_screenshot` | 截主屏全屏,返回 `shotId`——后续一切操作的句柄。 |
32
+ | `vp_screenshot_diff` | 与历史截图逐像素差分,输出差异区域 + 网格放大图。 |
33
+ | `vp_wait_change` | 高频轮询等待屏幕变化,变化即返回;超时不消耗 shotId。 |
34
+ | `vp_click` | 按绝对物理坐标点击(内部换算逻辑坐标,需已授权)。 |
35
+ | `vp_click_relative` | 在差分区域的网格图内按相对百分比点击(需已授权)。 |
36
+ | `vp_request_auth` | 请求人类授权(once / persistent),经宿主问答卡片等待确认。 |
37
+ | `vp_auth_status` | 只读查询授权状态、热键可用性与审计日志路径。 |
38
+
39
+ ## 长程任务工作流(The OSA V Loop)
40
+
41
+ 这段协议内嵌在全部 7 个工具的 description 里,模型每次调用都会被提醒:
42
+
43
+ 1. **观察 Observe**——每步开始前,用截图或差分确认当前屏幕状态。
44
+ 2. **行动 Act**——点击目标(绝对坐标或相对百分比)。
45
+ 3. **等待 Wait**——点击后必须立刻 `vp_wait_change`。绝对禁止连续两次点击(盲点):第二次点击必须以界面反馈为前提。
46
+ 4. **验证 Verify**——结合变化区域与超时判断是否达标;`timeout:true` 意味着可能失败或卡死,必须重新截图观察、重新规划,绝不盲目重试。
47
+
48
+ 模型的工作日志就是它自己每一次工具调用的原始 JSON 返回——纠错靠重读上一步的返回,不靠想象。
49
+
50
+ <!-- 配图位 3:OSA V Loop 循环示意图(观察→行动→等待→验证) -->
51
+
52
+ ## 快速开始
53
+
54
+ ```bash
55
+ # 从 npm 安装
56
+ DSH_HOME=<DSH_HOME> dsh plugin --profile web add dsh-copilot-vision
57
+
58
+ # 或从本地 tarball 安装(开发调试)
59
+ npm pack
60
+ DSH_HOME=<DSH_HOME> dsh plugin --profile web add file:<绝对路径>/dsh-copilot-vision-1.1.0.tgz
61
+ ```
62
+
63
+ - **宿主**:web(问答卡片授权)/ headless(无 UI 答者,只能 Shift+Space,需真人在场)/ desktop(待 DSH 市场审核后内置验证)。
64
+ - **授权**:模型调 `vp_request_auth`,你在卡片上确认;或随时 Shift+Space 进入持续授权、再按撤销。
65
+ - **平台**:仅 Windows、仅本地主屏。pnpm 11 拦截构建脚本时,在 profile 的 `pnpm-workspace.yaml` 中允许 `robot-ts` 构建;native 缺失时插件仍可加载,调用时返回可读错误。
66
+ - **落盘**:截图、索引、审计日志默认在 `os.tmpdir()/vision-pilot-shots/`,`VP_SHOT_DIR` 可整体重定向。
67
+ - **迭代**:tarball 是快照,同版本重新 `add` 会被判 "Already up to date"——改源码后标准流程是 `npm pack` → `remove` → `add`。
68
+
69
+ ## 限制与边界
70
+
71
+ - **输入能力边界**:不支持键盘注入、拖拽、滚轮、双击。模型无法自己「在地址栏输入」,该步需人代做。
72
+ - **聊天窗口自干扰**:宿主聊天窗口的流式重绘会被当成屏幕变化(实测覆盖率约为变化门限的 14 倍)。等页面加载时,先把聊天窗口移出主屏或最小化。
73
+ - **鼠标移动不可检测**:Windows 屏幕捕获不含硬件光标,挪鼠标不产生任何像素变化。
74
+ - **热键无法区分真人与合成按键**:按键事件流不携带注入标记,审计日志只作事后追溯、不作防伪。真正的护栏在插件之外——宿主安全分类器与操作纪律。
75
+ - **索引并发**:截图索引整份覆盖写、不做跨进程并发保护,多进程共用 `VP_SHOT_DIR` 会互相覆盖;回归测试一律用独立目录。
76
+ - **临时目录卫生**:超过 3 天的差分/网格切片(`vp-diff-*` / `vp-grid-*`)会在插件启动时被自动清理,基准截图(`vp-shot-*`)和审计日志永久保留。
77
+
78
+ ## 本地验证
79
+
80
+ > 以下脚本为开发期本机验证用,含本机绝对路径,**不随仓库与 npm 包分发**(`.gitignore` 已排除 `test-*.mjs`)。克隆仓库后需自备对应脚本。
81
+
82
+ ```bash
83
+ node test-mvp.mjs # 五态授权 + 热键/卡片竞态 + 无时钟衰减(约 45s,真实点击屏幕中心)
84
+ node test-diff.mjs # 差分与索引(单元层不碰屏幕;--integration 需配合动屏)
85
+ node test-relative.mjs # 网格渲染 + 相对坐标换算 + 未授权闸门(不截图、不注入)
86
+ node test-wait.mjs # 轮询语义(--integration 配合静屏/动屏/假基线)
87
+ ```
88
+
89
+ ---
90
+
91
+ License: MIT(见 LICENSE 与 package.json)。第三方依赖声明见 THIRD_PARTY_NOTICES.md。
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dolphin Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,149 @@
1
+ # Third-Party Notices
2
+
3
+ 本插件包含两类第三方内容:**随源码分发的派生代码**(第一节),以及**直接依赖的 npm 库**(第二节)。
4
+ 第二节的文本复制自各依赖随包分发的 LICENSE 文件,与 `package-lock.json` 锁定的版本一致。
5
+
6
+ ---
7
+
8
+ ## 一、派生代码:`src/vp-ssh-core.js`
9
+
10
+ 该文件是远程执行层的「独立维护副本」,不是原创实现。来源链:
11
+
12
+ ```
13
+ dsh-web / packages / dsh-ssh/src Apache-2.0 https://github.com/zhu1090093659/dsh-web
14
+ └─ dolphin-ssh-core.js MIT dsh-dolphin-security(裁剪为单文件 ESM)
15
+ └─ vp-ssh-core.js (本文件) MIT 本项目 dsh-copilot-vision
16
+ ```
17
+
18
+ - **直接上游**:`dsh-dolphin-security@0.3.1` 的 `dolphin-ssh-core.js`(MIT,Copyright (c) 2026 Dolphin Contributors)
19
+ - **最上游**:`dsh-ssh`(Apache License 2.0,Copyright (c) dsh-web contributors)
20
+ - **完整原文**:`THIRD_PARTY_LICENSES/dsh-web-Apache-2.0.txt`、`THIRD_PARTY_LICENSES/dsh-dolphin-security-MIT.txt`
21
+ - **同源实现**:`dsh-remote-rea` 的 `remote-ssh-core.js` 与本文件同出一源(该项目做过 DOLPHIN→REVERSE 的机械改名,本文件未做)
22
+
23
+ ### 上游已完成、本项目继承的裁剪
24
+
25
+ 以下适配由 `dsh-dolphin-security` 完成,本项目原样继承:
26
+
27
+ - 移除 `cordis`、`@deepseek-ai/dsh-settings`、`@deepseek-ai/dsh-tools`、`schemastery` 等宿主专属上下文
28
+ - 移除面向 Web 界面的 `client/` 半区(含 dsh-market 遥测心跳)、`engine/pty.ts`、`engine/tunnel.ts`、`routes.ts`、`loopback.ts`
29
+ - 保留上游模块:`engine.ts`、`engine/connection-pool.ts`、`engine/sftp.ts`、`engine/cluster.ts`、`store.ts`、`protocol.ts`(类型契约以 JSDoc 保留)
30
+ - 运行时唯一三方依赖为 `ssh2`(MIT)
31
+
32
+ ### 本项目对 `dolphin-ssh-core.js` 的修改(Apache-2.0 §4(b) 注明修改)
33
+
34
+ | # | 修改内容 | 位置 |
35
+ |---|---|---|
36
+ | 1 | 文件更名为 `src/vp-ssh-core.js`,并入 `src/` 目录;文件头重写,新增「为何是副本而不是 import」说明(上游 exports 只暴露 `.`,子路径 import 会 `ERR_PACKAGE_PATH_NOT_EXPORTED`;跨目录 file-URL 导入会让 `createRequire` 上溯到源目录解析 `ssh2` 而失败) | 文件头 |
37
+ | 2 | 第 2 节标题中性化:`dsh-home.ts —— DSH_HOME 解析(移除 @deepseek-ai/dsh-settings 依赖后内联)` → `home 解析 —— DSH_HOME 解析(内联实现,不依赖宿主包)` | `resolveDolphinHome()` 上方注释 |
38
+ | 3 | **主机库路径独立化**:`storePath()` 不再调用 `resolveDolphinHome()`,改用本插件自己的文件 `$DSH_HOME/vision-pilot-ssh-hosts.json` 或 `~/.vision-pilot/ssh-hosts.json`,不与 Dolphin 共用同一主机库 | `storePath()` |
39
+ | 4 | **新增 §4.1 提权护栏**:移植 `assertNoPrivilegeEscalation()`(拦截 `sudo` 与 `--break-system-packages`)。原属上层巡逻逻辑,SSH 核心本身不含此函数;本副本只是把判定函数移入,**不自动挂进 `execCommand`**,是否对所有远程命令强制前置校验由上层调用方决定 | 原第 4 节与第 5 节之间 |
40
+ | 5 | 自检横幅与自检临时文件名改为本插件中性命名 | `selfTest()` 及文件末尾自检区 |
41
+ | 6 | **未改名保留**:`DOLPHIN_HOME`、`DOLPHIN_SSH2_MODULE`、`~/.dolphin`(`resolveDolphinHome()` 回退路径)、`resolveDolphinHome` 导出名及其余中性标识符(`isSsh2Available`、`loadSsh2`、`expandHome`、`HostStore`、`buildConnectConfig`、`execCommand`、`SshEngine` 等),以保证与上游 API 兼容 | 全文 |
42
+
43
+ > 本项目自身代码以 MIT 发布(见 `LICENSE`);上述派生文件在再分发时,其 Apache-2.0 部分仍受 Apache License 2.0 约束,不做 MIT 化处理。本项目未使用上游商标,未以原作者名义背书。
44
+
45
+ ---
46
+
47
+ ## 二、直接依赖的 npm 库
48
+
49
+ | 依赖 | 锁定版本 | 许可证 |
50
+ |---|---|---|
51
+ | robot-ts | 2.0.3 | MIT |
52
+ | ssh2 | 1.17.0 | MIT |
53
+ | pixelmatch | 8.0.0 | ISC |
54
+ | pngjs | 7.0.0 | MIT |
55
+
56
+ ### robot-ts (MIT)
57
+
58
+ ```
59
+ The MIT License
60
+
61
+ Copyright (c) 2019 Code Quality Resources
62
+
63
+ Permission is hereby granted, free of charge, to any person obtaining a copy
64
+ of this software and associated documentation files (the "Software"), to deal
65
+ in the Software without restriction, including without limitation the rights
66
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
67
+ copies of the Software, and to permit persons to whom the Software is
68
+ furnished to do so, subject to the following conditions:
69
+
70
+ The above copyright notice and this permission notice shall be included in
71
+ all copies or substantial portions of the Software.
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
75
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
76
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
77
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
78
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
79
+ THE SOFTWARE.
80
+ ```
81
+
82
+ ### ssh2 (MIT)
83
+
84
+ ```
85
+ Copyright Brian White. All rights reserved.
86
+
87
+ Permission is hereby granted, free of charge, to any person obtaining a copy
88
+ of this software and associated documentation files (the "Software"), to
89
+ deal in the Software without restriction, including without limitation the
90
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
91
+ sell copies of the Software, and to permit persons to whom the Software is
92
+ furnished to do so, subject to the following conditions:
93
+
94
+ The above copyright notice and this permission notice shall be included in
95
+ all copies or substantial portions of the Software.
96
+
97
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
98
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
99
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
100
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
101
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
102
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
103
+ IN THE SOFTWARE.
104
+ ```
105
+
106
+ ### pixelmatch (ISC)
107
+
108
+ ```
109
+ ISC License
110
+
111
+ Copyright (c) 2025, Mapbox
112
+
113
+ Permission to use, copy, modify, and/or distribute this software for any purpose
114
+ with or without fee is hereby granted, provided that the above copyright notice
115
+ and this permission notice appear in all copies.
116
+
117
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
118
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
119
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
120
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
121
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
122
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
123
+ THIS SOFTWARE.
124
+ ```
125
+
126
+ ### pngjs (MIT)
127
+
128
+ ```
129
+ pngjs original work Copyright (c) 2015 Luke Page & Original Contributors
130
+ pngjs derived work Copyright (c) 2012 Kuba Niegowski
131
+
132
+ Permission is hereby granted, free of charge, to any person obtaining a copy
133
+ of this software and associated documentation files (the "Software"), to deal
134
+ in the Software without restriction, including without limitation the rights
135
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
136
+ copies of the Software, and to permit persons to whom the Software is
137
+ furnished to do so, subject to the following conditions:
138
+
139
+ The above copyright notice and this permission notice shall be included in
140
+ all copies or substantial portions of the Software.
141
+
142
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
143
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
144
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
145
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
146
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
147
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
148
+ THE SOFTWARE.
149
+ ```
@@ -0,0 +1,5 @@
1
+ # dsh bundle patch:把本插件声明进 DSH 生态的组合层。
2
+ # insert 一条:id 用于配置树定位,name 是加载器实际 import 的包名(必须等于 package.json 的 name)。
3
+ - insert:
4
+ - id: dsh-copilot-vision
5
+ name: dsh-copilot-vision
package/package.json CHANGED
@@ -1,6 +1,54 @@
1
1
  {
2
2
  "name": "dsh-copilot-vision",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.1.0",
4
+ "description": "Computer Use enhancement plugin for DeepSeek Harness (DSH). 纯 JS 视觉差分、网格位置编码、长程任务闭环与人机共驾授权。",
5
+ "main": "./src/index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [
10
+ "dsh",
11
+ "deepseek",
12
+ "cordis",
13
+ "plugin",
14
+ "computer-use",
15
+ "screenshot",
16
+ "gui-automation"
17
+ ],
18
+ "author": "ccr-wer",
19
+ "license": "MIT",
20
+ "type": "module",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/ccr-wer/dsh-copilot-vision.git"
24
+ },
25
+ "homepage": "https://github.com/ccr-wer/dsh-copilot-vision#readme",
26
+ "bugs": {
27
+ "url": "https://github.com/ccr-wer/dsh-copilot-vision/issues"
28
+ },
29
+ "files": [
30
+ "src/**/*.js",
31
+ "cordis.patch.yml",
32
+ "THIRD_PARTY_NOTICES.md",
33
+ "THIRD_PARTY_LICENSES/"
34
+ ],
35
+ "dsh": {
36
+ "bundle": {
37
+ "patch": "./cordis.patch.yml"
38
+ }
39
+ },
40
+ "dependencies": {
41
+ "pixelmatch": "^8.0.0",
42
+ "pngjs": "^7.0.0",
43
+ "robot-ts": "^2.0.3",
44
+ "ssh2": "^1.17.0"
45
+ },
46
+ "peerDependencies": {
47
+ "@deepseek-ai/cordis": "^4.0.1",
48
+ "@deepseek-ai/dsh-tools": "^0.1.5-rc.1 || ^0.2.0-rc.2"
49
+ },
50
+ "devDependencies": {
51
+ "@deepseek-ai/cordis": "^4.0.1",
52
+ "@deepseek-ai/dsh-tools": "^0.1.5-rc.1 || ^0.2.0-rc.2"
53
+ }
54
+ }