@copylee/dsh-computer-use 0.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 Copy
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 ADDED
@@ -0,0 +1,116 @@
1
+ # 🖱️ dsh-computer-use
2
+
3
+ [![npm](https://img.shields.io/npm/v/@copylee/dsh-computer-use)](https://www.npmjs.com/package/@copylee/dsh-computer-use)
4
+
5
+ 让 DeepSeek Harness 像 Claude 的 Computer Use 一样操控你的 Windows 电脑:看屏幕、点鼠标、敲键盘,打开应用、切换窗口、读写剪贴板。控制期间屏幕四周会泛起**橙色光晕**,顶部出现“**DeepSeek 正在使用你的电脑**”提示条,按 **Esc** 或点“停止”立即中断。
6
+
7
+ | 功能 | 说明 |
8
+ |---|---|
9
+ | 截图即坐标系 | 模型只用最近一张截图的像素坐标,DPI、缩放、多显示器偏移全部由插件换算,高分屏(200% 缩放)也点得准 |
10
+ | 动作后自动回传截图 | 点击 / 输入 / 按键后自动等界面稳定再截图,少一轮调用 |
11
+ | 批量动作 | `computer_batch` 一次执行“点输入框 → 输入 → 回车”等多步,最后只截一张图 |
12
+ | 按应用授权 | 仿 Claude:先 `request_access` 列出要操控的应用,经 DSH 原生审批后才能操作;也可改为“全部允许” |
13
+ | 不会操作自己 | 永远拒绝向 DeepSeek Harness 自身窗口输入;常见密码管理器默认禁止,可再自定义禁用列表 |
14
+ | 正在控制的提示 | 橙色光晕 + 胶囊提示条(显示当前动作),**不会出现在截图里**;真实按下的 Esc 才算停止,插件自己发的 Esc 不会误触发 |
15
+ | 中文输入 | Unicode 直接输入,不受输入法状态影响;长文本走剪贴板并自动恢复原剪贴板 |
16
+ | 看不见图的模型 | `ui_elements` 用 Windows UI Automation 列出可点击元素和坐标,纯文本模型也能用 |
17
+ | 零原生依赖 | 首次使用时用 Windows 自带的 .NET Framework `csc.exe` 编译一个小 helper(约 1 秒,之后缓存),不需要 node-gyp、不受 Electron ABI 影响 |
18
+
19
+ ## 安装
20
+
21
+ DSH 桌面版:**插件 → 添加插件**,输入 `@copylee/dsh-computer-use`,安装后启用。
22
+
23
+ 命令行(web 等其他 profile):
24
+
25
+ ```bash
26
+ dsh plugin --profile web add @copylee/dsh-computer-use@latest
27
+ ```
28
+
29
+ 要求:Windows 10 2004+ / Windows 11(自带 .NET Framework 4.8),DSH 0.2.0-rc.2 或更高。截图需要**支持图片输入的模型**(如 DeepSeek V4.1 Flash);纯文本模型会自动改用 `ui_elements`。
30
+
31
+ > 如果之前装过其他 computer-use 插件或 skill(例如 `dsh-computer-use-win`、Hermes 的 computer-use skill),建议先停用,避免工具和说明互相冲突。
32
+
33
+ ## 用法
34
+
35
+ 直接说要做什么就行,例如:
36
+
37
+ - 用 Chrome 打开 github.com
38
+ - 打开记事本,写一段会议纪要并保存到桌面
39
+ - 用计算器算一下 1234×5678
40
+
41
+ 按应用授权模式下,模型会先请求操控对应应用,你在 DSH 里批准即可。会话权限为“完全权限”或“自动审查”(不弹审批)时,请求会被自动批准,但 DeepSeek Harness 自身和禁用列表里的应用仍然不可操作。
42
+
43
+ **随时按 Esc 停止**,或点提示条上的“停止”。
44
+
45
+ ## Agent 工具
46
+
47
+ | 工具 | 作用 |
48
+ |---|---|
49
+ | `computer` | 单个动作:`screenshot` `left_click` `double_click` `triple_click` `right_click` `middle_click` `mouse_move` `left_click_drag` `left_mouse_down/up` `scroll` `type` `key` `hold_key` `wait` `zoom` `cursor_position`(与 Anthropic computer tool 同名同参) |
50
+ | `computer_batch` | 顺序执行多个动作,遇错即停,最后回传一张截图 |
51
+ | `open_application` | 按名称(“Chrome”“记事本”“微信”)、exe 路径或网址打开应用;已运行则切到前台 |
52
+ | `windows` | 列出窗口(含进程 exe 名)、聚焦 / 最小化 / 最大化 / 还原 / 关闭 |
53
+ | `ui_elements` | 前台窗口的 UI Automation 元素列表,坐标已换算到截图坐标系 |
54
+ | `clipboard` | 读 / 写剪贴板文本 |
55
+ | `switch_display` | 多显示器时切换截图所在屏幕 |
56
+ | `request_access` / `list_granted_applications` | 按应用授权 |
57
+
58
+ ## 设置
59
+
60
+ 在 **设置 → 插件 → dsh-computer-use** 中修改,均即时生效:
61
+
62
+ | 选项 | 默认 | 说明 |
63
+ |---|---|---|
64
+ | 授权方式 | 按应用授权 | 或“全部允许” |
65
+ | 光晕与提示条 | 开 | 控制时显示橙色边框和提示条 |
66
+ | 提示条名称 | DeepSeek | 显示为“<名称> 正在使用你的电脑” |
67
+ | 控制期间最小化 DSH | 关 | 开启后控制时最小化 DSH 窗口,结束后恢复 |
68
+ | 操作后自动截图 | 开 | 关闭可省 token,但模型需要自己截图 |
69
+ | 等待稳定 | 400 ms | 动作后多久再截图 |
70
+ | 截图最长边 / 总像素 / JPEG 质量 | 1366 / 1.15MP / 80 | 越大越清晰、越费 token |
71
+ | 禁止操控的应用 | 空 | 名称或 exe,如 `alipay` |
72
+
73
+ ## 数据与隐私
74
+
75
+ - 截图只作为当前会话的图片附件发给你选择的模型,插件不上传、不保存到别处。
76
+ - helper 源码 `helper/CuHelper.cs` 随包发布,可自行审阅;编译产物缓存在 `%LOCALAPPDATA%\dsh-computer-use\`。
77
+ - 以管理员身份运行的窗口、UAC 弹窗、锁屏无法被控制(Windows UIPI 限制),遇到时模型会请你手动处理。
78
+ - 插件注入的系统提示要求模型不代填密码、支付信息、不处理验证码,遇到时交还给你。
79
+
80
+ ## 工作原理
81
+
82
+ ```
83
+ DSH Host (Electron, Node 模式)
84
+ └─ lib/index.js 工具 / 审批 / 系统提示 / overlay 生命周期
85
+ └─ cu-helper.exe(常驻,stdin/stdout 每行一个 JSON)
86
+ Per-Monitor-V2 DPI 感知 · GDI 截图 + 缩放 + JPEG · SendInput 鼠标键盘
87
+ 窗口枚举与前置 · shell:AppsFolder 启动应用 · 剪贴板 · UI Automation
88
+ 分层窗口 overlay(WDA_EXCLUDEFROMCAPTURE)· 低级键盘钩子(只认物理 Esc)
89
+ ```
90
+
91
+ ## 开发
92
+
93
+ ```bash
94
+ pnpm install
95
+ pnpm typecheck
96
+ pnpm test # vitest(mock helper,跨平台)
97
+ pnpm build # tsc → lib/types,tsdown → lib/index.js
98
+ node scripts/helper-smoke.mjs # 本机实测:编译 helper、截图、overlay
99
+ node scripts/helper-smoke.mjs --notepad # 另外用临时文件测试中文输入
100
+ pnpm pack:check
101
+ ```
102
+
103
+ 本地联调:DSH 桌面版“添加插件”里填本仓库目录路径即可(以 link 方式安装),改完 `pnpm build` 后重启 DSH 生效。
104
+
105
+ ### 发版
106
+
107
+ 推送版本 tag 后,GitHub Actions(`.github/workflows/publish.yml`)通过 npm Trusted Publishing 自动发布并附带 provenance:
108
+
109
+ ```bash
110
+ # 先把 package.json 的 version 改成新版本并合并到 main
111
+ git tag v0.1.1 && git push origin v0.1.1
112
+ ```
113
+
114
+ ## License
115
+
116
+ MIT
@@ -0,0 +1,4 @@
1
+ - insert:
2
+ - id: copylee-computer-use
3
+ name: '@copylee/dsh-computer-use'
4
+ config: {}