dsh-cua 0.3.0__tar.gz

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.
dsh_cua-0.3.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hutusion
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.
dsh_cua-0.3.0/PKG-INFO ADDED
@@ -0,0 +1,172 @@
1
+ Metadata-Version: 2.4
2
+ Name: dsh-cua
3
+ Version: 0.3.0
4
+ Summary: Windows computer-use MCP server: accessibility-first element actions, skyshot text trees, guarded raw input, and a cross-session arbiter that yields to the human
5
+ Author: Hutusion
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Hutusion/dsh-cua
8
+ Keywords: mcp,computer-use,windows,ui-automation,accessibility,agent
9
+ Classifier: Operating System :: Microsoft :: Windows
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: mcp<2,>=1.2
19
+ Requires-Dist: pywinauto>=0.6.9
20
+ Requires-Dist: comtypes>=1.4
21
+ Requires-Dist: pyperclip>=1.9
22
+ Requires-Dist: Pillow>=10
23
+ Provides-Extra: test
24
+ Requires-Dist: pyyaml>=6; extra == "test"
25
+ Dynamic: license-file
26
+
27
+ # dsh-cua
28
+
29
+ [![ci](https://github.com/Hutusion/dsh-cua/actions/workflows/ci.yml/badge.svg)](https://github.com/Hutusion/dsh-cua/actions/workflows/ci.yml)
30
+
31
+ Windows 电脑操控的 MCP 服务器 + agent 技能:**无障碍元素动作优先,截图只是兜底**;
32
+ 带跨会话仲裁器——多个 agent 共享一台电脑时自动串行化,并在你正在使用电脑时主动让行。
33
+
34
+ 本仓库只含 MCP 服务器与技能本身,**对任何 stdio MCP 客户端保持中立**
35
+ (dsh / Claude Code / Codex / Cursor / Cline / ZCode …)—— 不依赖 dsh 才能用。
36
+
37
+ ## 它是什么
38
+
39
+ 一个 stdio MCP 服务器,暴露 19 个工具:
40
+
41
+ - **观测**(只读,随时可调):`skyshot`(把窗口读成带 diff 的紧凑文本树,比截图小三个数量级)、
42
+ `element_at_point`、`read_element`、`find_elements`、`capture_window`(DPI 感知 + 客户区裁剪)、
43
+ `list_windows` / `find_window` / `get_window_rect`、`list_displays`、`cursor_position`、
44
+ `clipboard_read`、`coexistence_status`
45
+ - **元素动作**(软门:跨 agent 串行,无物理输入注入):`element_action` /
46
+ `element_action_at`——press / set_value / select / toggle / expand / collapse /
47
+ scroll_into_view / focus,直接作用于 UIA 元素,**不抢焦点、不关心 z 序**
48
+ - **物理输入**(硬门:跨 agent 串行 + 人机让行):`click_at`(先元素路径后裸事件)、
49
+ `send_keys`、`type_text`(PostMessage 定向)、`clipboard_write`、`open_application`
50
+
51
+ 每个动作返回**回执**而非自述成功:`action_sent` / `effect_verified` / `foreground_changed` /
52
+ `user-active` / `arbiter-busy`。「调用被接受」和「效果发生」是两件事——工具替 agent 分清。
53
+
54
+ ## 与同类有何不同
55
+
56
+ Windows 侧已经有好几个成熟的开源实现。dsh-cua 的差异集中在**「和人类共用一台机器」**这一点上:
57
+
58
+ | | dsh-cua | [cua-driver](https://github.com/trycua/cua) | [ahk-mcp](https://github.com/anomalous3/ahk-mcp) | [lean-computer-use-mcp](https://github.com/Kvxw1105/lean-computer-use-mcp) |
59
+ |---|---|---|---|---|
60
+ | 元素动作走 UIA 模式(不抢焦点、不关心 z 序) | ✅ | ✅(ax 档) | ❌ 只有坐标点击 | 经 cua-driver |
61
+ | **检测到人正在输入 → 拒绝** | ✅ `user-active` | ❌ | ❌ | ❌ |
62
+ | 跨 agent 串行化(多进程) | ✅ named mutex | ❌ | ❌ | ❌ |
63
+ | 逐动作效果断言 | ✅ `effect_verified` 三态 | 报告交付档位 | ❌ | ❌ 仅 `state_changed` 启发式 |
64
+ | 抢前台副作用度量 | ✅ `foreground_changed` | ❌ | ❌ | ❌ |
65
+ | 工具数 | 19 | 59 | 15 | 6 |
66
+
67
+ **关键区别是两件常被混为一谈的事:**
68
+
69
+ - **「不抢焦点」是机制保证** —— 走 UIA 模式或定向 `PostMessage`,物理上不碰光标和键盘焦点。
70
+ cua-driver 有(ax 档);**ahk-mcp 其实没有** —— 它只有坐标点击,每次都移动真实光标。
71
+ - **「你一动就让路」是时间保证** —— 用 `GetLastInputInfo` 读人类最后一次输入的年龄,
72
+ 检测到你正在用就等待,超时则**拒绝**(`user-active`)而不是硬上。**上表另外三个实现里都没有这一条。**
73
+
74
+ `effect_verified` 同样是同类没有的:它把「调用被接受」和「效果发生」分开,给出三态
75
+ (`true` 变化符合预期 / `false` 接受了但没变并降级为失败 / `null` 无可比状态即未确认)。
76
+ 同类的替代做法是动作后重新观察一次,把判断留给模型。
77
+
78
+ **dsh-cua 不做的事**(先说清楚,避免误解):没有像素/视觉接地——树表达不了的界面(canvas、
79
+ 游戏、远程桌面)用不了;没有录制回放;没有隔离沙箱。这些各有更合适的方案。
80
+
81
+ ## 安装
82
+
83
+ 需要 **Windows x64 + 交互式桌面会话 + Python ≥3.10**。
84
+
85
+ ```bash
86
+ # 方式一:uvx 零安装(推荐)
87
+ uvx dsh-cua # 直接运行 stdio MCP server
88
+
89
+ # 方式二:pip
90
+ pip install dsh-cua
91
+
92
+ # 方式三:从源码
93
+ pip install git+https://github.com/Hutusion/dsh-cua.git
94
+ ```
95
+
96
+ 三种方式装完后,**用 `python -m dsh_cua` 起服务**:
97
+
98
+ ```bash
99
+ python -m dsh_cua # 不依赖 PATH 上的任何可执行文件
100
+ ```
101
+
102
+ > **为什么不写 `dsh-cua-server`**:pip 会把 console script 装进解释器的 `Scripts` 目录,
103
+ > 而**那个目录不一定在 PATH 上** —— 实测 stock python.org 3.12 的 User 与 Machine PATH
104
+ > 都不含它,于是 `pip install dsh-cua` 成功、`dsh-cua-server` 却报 command not found。
105
+ > `python -m` 不需要任何 PATH 条目。console script 仍然提供,PATH 里有它时可用。
106
+ >
107
+ > 方式一/二要求包已发布到 PyPI。**若 `uvx`/`pip` 报 404,用方式三 —— 它总是可用。**
108
+
109
+ ## 接线
110
+
111
+ 任何 MCP 客户端,把 server 命名为 **`win32`**(skill 的工具名约定是 `mcp__win32__*`)。
112
+
113
+ **`python -m`(不依赖 PATH,推荐)**:
114
+
115
+ ```json
116
+ { "mcpServers": { "win32": { "command": "python", "args": ["-m", "dsh_cua"] } } }
117
+ ```
118
+
119
+ **`uvx`(PyPI 发布后)**:
120
+
121
+ ```json
122
+ { "mcpServers": { "win32": { "command": "uvx", "args": ["dsh-cua"] } } }
123
+ ```
124
+
125
+ 更多形状见 [`examples/`](examples/):Claude Code / 通用客户端 / dsh 的 cordis.patch.yml 片段 /
126
+ 想让模型看懂截图时所需的路由模态声明(`tr-route-settings.yml`)。
127
+
128
+ ## 技能(可选但强烈建议)
129
+
130
+ [`skill/computer-use/SKILL.md`](skill/computer-use/SKILL.md) 是配套的使用教条:观察→定位→动作→复核
131
+ 的循环、回执语义、重试安全、与人类共存的纪律。没有它模型也能用工具,但有了它模型会**自己选对
132
+ 路径**——实测差别很大。把它复制进你的技能目录即可:
133
+
134
+ ```bash
135
+ # Claude Code / 通用 agents
136
+ cp -r skill/computer-use ~/.agents/skills/
137
+ # dsh
138
+ cp -r skill/computer-use ~/.dsh/skills/
139
+ ```
140
+
141
+ ## 安全模型
142
+
143
+ | 级别 | 覆盖操作 | 门 |
144
+ |---|---|---|
145
+ | 只读 | 观测类 12 个工具 | 不进门,随时可调 |
146
+ | 软门 | 元素动作、PostMessage 打字、剪贴板写、启动应用 | 跨 agent 互斥锁(named mutex,多进程自动串行) |
147
+ | 硬门 | 裸点击、全局热键 | 互斥锁 + `GetLastInputInfo` 人机让行:用户最近有输入就等待,超时则拒绝 `user-active` 而非抢光标 |
148
+
149
+ 诚实边界:让行是合作协议不是硬保证(注入前 150ms 紧检查已尽量收窄窗口);
150
+ 个别应用连 `set_value` 都会自激活(回执会如实报告 `foreground_changed`);
151
+ 同一窗口的「双人操作」没有技术解,别和 agent 同时操作同一个窗口。
152
+
153
+ ## 测试
154
+
155
+ ```bash
156
+ python tests/verify-coexistence.py # 25 项:零输入证明 / 跨进程互斥 / 合成人机争用 / 杀开关
157
+ python tests/verify-p0-fixes.py # 0.2.0 修掉的三个 P0:每项在修复前必失败
158
+ ```
159
+
160
+ 测试不需要真人配合——「用户输入」由一次真实 1px 光标移动合成,跑完还原。
161
+
162
+ **测试需要真实交互式桌面会话**(部分检查要创建窗口并用 UIA 寻址),所以**不能在 GitHub 托管的
163
+ runner 上跑**。CI 覆盖的是不需要桌面的那部分:打包安装、模块导入、diff 索引与树行转义的回归、
164
+ 仲裁器的判定逻辑 —— 见 [`.github/workflows/ci.yml`](.github/workflows/ci.yml)。
165
+
166
+ ```bash
167
+ python tests/ci-desktop-free.py # 上面这些的本地等价物,不需要桌面
168
+ ```
169
+
170
+ ## License
171
+
172
+ MIT
@@ -0,0 +1,146 @@
1
+ # dsh-cua
2
+
3
+ [![ci](https://github.com/Hutusion/dsh-cua/actions/workflows/ci.yml/badge.svg)](https://github.com/Hutusion/dsh-cua/actions/workflows/ci.yml)
4
+
5
+ Windows 电脑操控的 MCP 服务器 + agent 技能:**无障碍元素动作优先,截图只是兜底**;
6
+ 带跨会话仲裁器——多个 agent 共享一台电脑时自动串行化,并在你正在使用电脑时主动让行。
7
+
8
+ 本仓库只含 MCP 服务器与技能本身,**对任何 stdio MCP 客户端保持中立**
9
+ (dsh / Claude Code / Codex / Cursor / Cline / ZCode …)—— 不依赖 dsh 才能用。
10
+
11
+ ## 它是什么
12
+
13
+ 一个 stdio MCP 服务器,暴露 19 个工具:
14
+
15
+ - **观测**(只读,随时可调):`skyshot`(把窗口读成带 diff 的紧凑文本树,比截图小三个数量级)、
16
+ `element_at_point`、`read_element`、`find_elements`、`capture_window`(DPI 感知 + 客户区裁剪)、
17
+ `list_windows` / `find_window` / `get_window_rect`、`list_displays`、`cursor_position`、
18
+ `clipboard_read`、`coexistence_status`
19
+ - **元素动作**(软门:跨 agent 串行,无物理输入注入):`element_action` /
20
+ `element_action_at`——press / set_value / select / toggle / expand / collapse /
21
+ scroll_into_view / focus,直接作用于 UIA 元素,**不抢焦点、不关心 z 序**
22
+ - **物理输入**(硬门:跨 agent 串行 + 人机让行):`click_at`(先元素路径后裸事件)、
23
+ `send_keys`、`type_text`(PostMessage 定向)、`clipboard_write`、`open_application`
24
+
25
+ 每个动作返回**回执**而非自述成功:`action_sent` / `effect_verified` / `foreground_changed` /
26
+ `user-active` / `arbiter-busy`。「调用被接受」和「效果发生」是两件事——工具替 agent 分清。
27
+
28
+ ## 与同类有何不同
29
+
30
+ Windows 侧已经有好几个成熟的开源实现。dsh-cua 的差异集中在**「和人类共用一台机器」**这一点上:
31
+
32
+ | | dsh-cua | [cua-driver](https://github.com/trycua/cua) | [ahk-mcp](https://github.com/anomalous3/ahk-mcp) | [lean-computer-use-mcp](https://github.com/Kvxw1105/lean-computer-use-mcp) |
33
+ |---|---|---|---|---|
34
+ | 元素动作走 UIA 模式(不抢焦点、不关心 z 序) | ✅ | ✅(ax 档) | ❌ 只有坐标点击 | 经 cua-driver |
35
+ | **检测到人正在输入 → 拒绝** | ✅ `user-active` | ❌ | ❌ | ❌ |
36
+ | 跨 agent 串行化(多进程) | ✅ named mutex | ❌ | ❌ | ❌ |
37
+ | 逐动作效果断言 | ✅ `effect_verified` 三态 | 报告交付档位 | ❌ | ❌ 仅 `state_changed` 启发式 |
38
+ | 抢前台副作用度量 | ✅ `foreground_changed` | ❌ | ❌ | ❌ |
39
+ | 工具数 | 19 | 59 | 15 | 6 |
40
+
41
+ **关键区别是两件常被混为一谈的事:**
42
+
43
+ - **「不抢焦点」是机制保证** —— 走 UIA 模式或定向 `PostMessage`,物理上不碰光标和键盘焦点。
44
+ cua-driver 有(ax 档);**ahk-mcp 其实没有** —— 它只有坐标点击,每次都移动真实光标。
45
+ - **「你一动就让路」是时间保证** —— 用 `GetLastInputInfo` 读人类最后一次输入的年龄,
46
+ 检测到你正在用就等待,超时则**拒绝**(`user-active`)而不是硬上。**上表另外三个实现里都没有这一条。**
47
+
48
+ `effect_verified` 同样是同类没有的:它把「调用被接受」和「效果发生」分开,给出三态
49
+ (`true` 变化符合预期 / `false` 接受了但没变并降级为失败 / `null` 无可比状态即未确认)。
50
+ 同类的替代做法是动作后重新观察一次,把判断留给模型。
51
+
52
+ **dsh-cua 不做的事**(先说清楚,避免误解):没有像素/视觉接地——树表达不了的界面(canvas、
53
+ 游戏、远程桌面)用不了;没有录制回放;没有隔离沙箱。这些各有更合适的方案。
54
+
55
+ ## 安装
56
+
57
+ 需要 **Windows x64 + 交互式桌面会话 + Python ≥3.10**。
58
+
59
+ ```bash
60
+ # 方式一:uvx 零安装(推荐)
61
+ uvx dsh-cua # 直接运行 stdio MCP server
62
+
63
+ # 方式二:pip
64
+ pip install dsh-cua
65
+
66
+ # 方式三:从源码
67
+ pip install git+https://github.com/Hutusion/dsh-cua.git
68
+ ```
69
+
70
+ 三种方式装完后,**用 `python -m dsh_cua` 起服务**:
71
+
72
+ ```bash
73
+ python -m dsh_cua # 不依赖 PATH 上的任何可执行文件
74
+ ```
75
+
76
+ > **为什么不写 `dsh-cua-server`**:pip 会把 console script 装进解释器的 `Scripts` 目录,
77
+ > 而**那个目录不一定在 PATH 上** —— 实测 stock python.org 3.12 的 User 与 Machine PATH
78
+ > 都不含它,于是 `pip install dsh-cua` 成功、`dsh-cua-server` 却报 command not found。
79
+ > `python -m` 不需要任何 PATH 条目。console script 仍然提供,PATH 里有它时可用。
80
+ >
81
+ > 方式一/二要求包已发布到 PyPI。**若 `uvx`/`pip` 报 404,用方式三 —— 它总是可用。**
82
+
83
+ ## 接线
84
+
85
+ 任何 MCP 客户端,把 server 命名为 **`win32`**(skill 的工具名约定是 `mcp__win32__*`)。
86
+
87
+ **`python -m`(不依赖 PATH,推荐)**:
88
+
89
+ ```json
90
+ { "mcpServers": { "win32": { "command": "python", "args": ["-m", "dsh_cua"] } } }
91
+ ```
92
+
93
+ **`uvx`(PyPI 发布后)**:
94
+
95
+ ```json
96
+ { "mcpServers": { "win32": { "command": "uvx", "args": ["dsh-cua"] } } }
97
+ ```
98
+
99
+ 更多形状见 [`examples/`](examples/):Claude Code / 通用客户端 / dsh 的 cordis.patch.yml 片段 /
100
+ 想让模型看懂截图时所需的路由模态声明(`tr-route-settings.yml`)。
101
+
102
+ ## 技能(可选但强烈建议)
103
+
104
+ [`skill/computer-use/SKILL.md`](skill/computer-use/SKILL.md) 是配套的使用教条:观察→定位→动作→复核
105
+ 的循环、回执语义、重试安全、与人类共存的纪律。没有它模型也能用工具,但有了它模型会**自己选对
106
+ 路径**——实测差别很大。把它复制进你的技能目录即可:
107
+
108
+ ```bash
109
+ # Claude Code / 通用 agents
110
+ cp -r skill/computer-use ~/.agents/skills/
111
+ # dsh
112
+ cp -r skill/computer-use ~/.dsh/skills/
113
+ ```
114
+
115
+ ## 安全模型
116
+
117
+ | 级别 | 覆盖操作 | 门 |
118
+ |---|---|---|
119
+ | 只读 | 观测类 12 个工具 | 不进门,随时可调 |
120
+ | 软门 | 元素动作、PostMessage 打字、剪贴板写、启动应用 | 跨 agent 互斥锁(named mutex,多进程自动串行) |
121
+ | 硬门 | 裸点击、全局热键 | 互斥锁 + `GetLastInputInfo` 人机让行:用户最近有输入就等待,超时则拒绝 `user-active` 而非抢光标 |
122
+
123
+ 诚实边界:让行是合作协议不是硬保证(注入前 150ms 紧检查已尽量收窄窗口);
124
+ 个别应用连 `set_value` 都会自激活(回执会如实报告 `foreground_changed`);
125
+ 同一窗口的「双人操作」没有技术解,别和 agent 同时操作同一个窗口。
126
+
127
+ ## 测试
128
+
129
+ ```bash
130
+ python tests/verify-coexistence.py # 25 项:零输入证明 / 跨进程互斥 / 合成人机争用 / 杀开关
131
+ python tests/verify-p0-fixes.py # 0.2.0 修掉的三个 P0:每项在修复前必失败
132
+ ```
133
+
134
+ 测试不需要真人配合——「用户输入」由一次真实 1px 光标移动合成,跑完还原。
135
+
136
+ **测试需要真实交互式桌面会话**(部分检查要创建窗口并用 UIA 寻址),所以**不能在 GitHub 托管的
137
+ runner 上跑**。CI 覆盖的是不需要桌面的那部分:打包安装、模块导入、diff 索引与树行转义的回归、
138
+ 仲裁器的判定逻辑 —— 见 [`.github/workflows/ci.yml`](.github/workflows/ci.yml)。
139
+
140
+ ```bash
141
+ python tests/ci-desktop-free.py # 上面这些的本地等价物,不需要桌面
142
+ ```
143
+
144
+ ## License
145
+
146
+ MIT
@@ -0,0 +1,55 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "dsh-cua"
7
+ version = "0.3.0"
8
+ description = "Windows computer-use MCP server: accessibility-first element actions, skyshot text trees, guarded raw input, and a cross-session arbiter that yields to the human"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "Hutusion" }]
13
+ keywords = ["mcp", "computer-use", "windows", "ui-automation", "accessibility", "agent"]
14
+ classifiers = [
15
+ "Operating System :: Microsoft :: Windows",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Topic :: Software Development :: Libraries :: Python Modules",
21
+ ]
22
+ dependencies = [
23
+ # Upper bound is load-bearing, not decorative. Measured 2026-09-25: a clean
24
+ # `pip install .` resolves mcp to 2.x, where FastMCP was renamed to MCPServer and
25
+ # `from mcp.server.fastmcp import FastMCP` (src/dsh_cua/server.py:5) raises
26
+ # ModuleNotFoundError. The working machine happened to have 1.28.1, so the desktop-free
27
+ # suite died on the runner at import — with an unreadable log, every run. Migrating to
28
+ # the 2.x API is its own piece of work; until then the ceiling keeps installs working.
29
+ "mcp>=1.2,<2",
30
+ "pywinauto>=0.6.9",
31
+ "comtypes>=1.4",
32
+ "pyperclip>=1.9",
33
+ "Pillow>=10",
34
+ ]
35
+
36
+ # Test/CI-only dependencies. PyYAML lives here rather than in `dependencies` because only
37
+ # the workflow self-check (tests/check-workflow-shell.py) parses YAML — the shipped server
38
+ # must not carry it. CI installs `.[test]`.
39
+ #
40
+ # Why this extra exists at all: the import was undeclared, so it resolved on a developer
41
+ # machine that happened to have PyYAML and failed on the runner. That step exited non-zero
42
+ # in 0 seconds with no output, and GitHub's pwsh wrapper normalizes every non-zero exit to
43
+ # 1, so the code could not even be told apart from a genuine parse failure. One undeclared
44
+ # import cost four CI runs. Declare test-only imports here.
45
+ [project.optional-dependencies]
46
+ test = ["pyyaml>=6"]
47
+
48
+ [project.urls]
49
+ Homepage = "https://github.com/Hutusion/dsh-cua"
50
+
51
+ [project.scripts]
52
+ dsh-cua-server = "dsh_cua.server:main"
53
+
54
+ [tool.setuptools.packages.find]
55
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,14 @@
1
+ """dsh-cua: Windows computer-use MCP server.
2
+
3
+ Accessibility-first element actions (UIA), skyshot text trees, guarded raw input,
4
+ and a cross-session arbiter that yields to the human. Windows only by design.
5
+ """
6
+ import sys
7
+
8
+ __version__ = "0.3.0"
9
+
10
+ if sys.platform != "win32":
11
+ raise RuntimeError(
12
+ "dsh-cua drives the Windows desktop via user32/kernel32 and UIA. "
13
+ f"It only runs on Windows; got platform={sys.platform!r}."
14
+ )
@@ -0,0 +1,19 @@
1
+ """Let `python -m dsh_cua` start the stdio MCP server.
2
+
3
+ Why this exists: the console script (`dsh-cua-server`) is only invocable when the
4
+ interpreter's Scripts directory is on PATH, and that is not guaranteed — measured on a
5
+ stock python.org 3.12 install, neither the user PATH nor the machine PATH contained
6
+ `%LOCALAPPDATA%\\Programs\\Python\\Python312\\Scripts`, so `pip install dsh-cua` followed
7
+ by `dsh-cua-server` fails with "command not found" while the package itself is installed
8
+ correctly.
9
+
10
+ `python -m` needs no PATH entry and no console script, so it is the invocation that
11
+ always works. MCP clients can use it directly:
12
+
13
+ {"mcpServers": {"win32": {
14
+ "command": "python", "args": ["-m", "dsh_cua"]}}}
15
+ """
16
+ from .server import main
17
+
18
+ if __name__ == "__main__":
19
+ main()