deskwright 0.1.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.
Files changed (62) hide show
  1. deskwright-0.1.0/LICENSE +202 -0
  2. deskwright-0.1.0/PKG-INFO +373 -0
  3. deskwright-0.1.0/README.md +344 -0
  4. deskwright-0.1.0/deskwright/__init__.py +30 -0
  5. deskwright-0.1.0/deskwright/atspi.py +1176 -0
  6. deskwright-0.1.0/deskwright/atspi_ui.py +173 -0
  7. deskwright-0.1.0/deskwright/capture.py +1343 -0
  8. deskwright-0.1.0/deskwright/cli.py +36 -0
  9. deskwright-0.1.0/deskwright/config.py +16 -0
  10. deskwright-0.1.0/deskwright/desktop.py +266 -0
  11. deskwright-0.1.0/deskwright/errors.py +74 -0
  12. deskwright-0.1.0/deskwright/extension/README.md +53 -0
  13. deskwright-0.1.0/deskwright/extension/deskwright@zeticle.com/check-syntax.sh +56 -0
  14. deskwright-0.1.0/deskwright/extension/deskwright@zeticle.com/dbus.js +723 -0
  15. deskwright-0.1.0/deskwright/extension/deskwright@zeticle.com/extension.js +73 -0
  16. deskwright-0.1.0/deskwright/extension/deskwright@zeticle.com/indicator.js +226 -0
  17. deskwright-0.1.0/deskwright/extension/deskwright@zeticle.com/metadata.json +8 -0
  18. deskwright-0.1.0/deskwright/extension/deskwright@zeticle.com/schemas/gschemas.compiled +0 -0
  19. deskwright-0.1.0/deskwright/extension/deskwright@zeticle.com/schemas/org.gnome.shell.extensions.deskwright.gschema.xml +17 -0
  20. deskwright-0.1.0/deskwright/frames.py +292 -0
  21. deskwright-0.1.0/deskwright/headless.py +697 -0
  22. deskwright-0.1.0/deskwright/input.py +1123 -0
  23. deskwright-0.1.0/deskwright/journal.py +318 -0
  24. deskwright-0.1.0/deskwright/ocr.py +253 -0
  25. deskwright-0.1.0/deskwright/portal_input.py +412 -0
  26. deskwright-0.1.0/deskwright/remote_input.py +408 -0
  27. deskwright-0.1.0/deskwright/screencast.py +305 -0
  28. deskwright-0.1.0/deskwright/server.py +1362 -0
  29. deskwright-0.1.0/deskwright/session.py +99 -0
  30. deskwright-0.1.0/deskwright/setup_cli.py +706 -0
  31. deskwright-0.1.0/deskwright/shell.py +833 -0
  32. deskwright-0.1.0/deskwright/steps.py +356 -0
  33. deskwright-0.1.0/deskwright/tripwire.py +77 -0
  34. deskwright-0.1.0/deskwright.egg-info/PKG-INFO +373 -0
  35. deskwright-0.1.0/deskwright.egg-info/SOURCES.txt +60 -0
  36. deskwright-0.1.0/deskwright.egg-info/dependency_links.txt +1 -0
  37. deskwright-0.1.0/deskwright.egg-info/entry_points.txt +6 -0
  38. deskwright-0.1.0/deskwright.egg-info/requires.txt +1 -0
  39. deskwright-0.1.0/deskwright.egg-info/top_level.txt +1 -0
  40. deskwright-0.1.0/pyproject.toml +114 -0
  41. deskwright-0.1.0/setup.cfg +4 -0
  42. deskwright-0.1.0/tests/test_atspi_addressing.py +330 -0
  43. deskwright-0.1.0/tests/test_click_guards.py +242 -0
  44. deskwright-0.1.0/tests/test_clipboard.py +274 -0
  45. deskwright-0.1.0/tests/test_docs_match_the_server.py +67 -0
  46. deskwright-0.1.0/tests/test_e2e_real_task.py +403 -0
  47. deskwright-0.1.0/tests/test_entry_points.py +209 -0
  48. deskwright-0.1.0/tests/test_headless.py +240 -0
  49. deskwright-0.1.0/tests/test_journal.py +306 -0
  50. deskwright-0.1.0/tests/test_look.py +299 -0
  51. deskwright-0.1.0/tests/test_pointer.py +292 -0
  52. deskwright-0.1.0/tests/test_portal_input.py +131 -0
  53. deskwright-0.1.0/tests/test_prose.py +78 -0
  54. deskwright-0.1.0/tests/test_refs.py +331 -0
  55. deskwright-0.1.0/tests/test_rename_compat.py +157 -0
  56. deskwright-0.1.0/tests/test_screencast.py +312 -0
  57. deskwright-0.1.0/tests/test_setup_cli.py +383 -0
  58. deskwright-0.1.0/tests/test_steps_validation.py +271 -0
  59. deskwright-0.1.0/tests/test_tripwire.py +309 -0
  60. deskwright-0.1.0/tests/test_two_sessions.py +228 -0
  61. deskwright-0.1.0/tests/test_wait_and_targets.py +205 -0
  62. deskwright-0.1.0/tests/test_zoom_and_delta.py +418 -0
@@ -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 2026 deskwright contributors
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,373 @@
1
+ Metadata-Version: 2.4
2
+ Name: deskwright
3
+ Version: 0.1.0
4
+ Summary: An AI agent uses a real GNOME/Wayland desktop: pressing actual widgets rather than guessing at pixels, optionally on an invisible second GNOME session so your own screen stays yours.
5
+ Author-email: Tristan Rafe Muzzu <tristan@zeticle.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/tristanmuzzu/deskwright
8
+ Project-URL: Source, https://github.com/tristanmuzzu/deskwright
9
+ Project-URL: Issues, https://github.com/tristanmuzzu/deskwright/issues
10
+ Project-URL: Changelog, https://github.com/tristanmuzzu/deskwright/blob/main/CHANGELOG.md
11
+ Project-URL: Security, https://github.com/tristanmuzzu/deskwright/blob/main/SECURITY.md
12
+ Keywords: mcp,model-context-protocol,computer-use,ai-agents,wayland,gnome,desktop-automation,accessibility,at-spi,claude,linux
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: X11 Applications :: Gnome
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Desktop Environment :: Gnome
22
+ Classifier: Topic :: Software Development :: Testing
23
+ Classifier: Topic :: Adaptive Technologies
24
+ Requires-Python: >=3.11
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: Pillow
28
+ Dynamic: license-file
29
+
30
+ # Deskwright
31
+
32
+ [![CI](https://github.com/tristanmuzzu/deskwright/actions/workflows/ci.yml/badge.svg)](https://github.com/tristanmuzzu/deskwright/actions/workflows/ci.yml)
33
+ [![PyPI](https://img.shields.io/pypi/v/deskwright.svg)](https://pypi.org/project/deskwright/)
34
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
35
+ [![GNOME Shell](https://img.shields.io/badge/GNOME%20Shell-48--50-4a86cf)](#requirements)
36
+ [![Wayland](https://img.shields.io/badge/Wayland-native-blue)](#how-it-actually-works)
37
+
38
+ **Computer use for AI agents on GNOME Wayland.**
39
+
40
+ Let your coding agent use your Linux desktop. Or give it one of its own, so it
41
+ stops stealing your mouse.
42
+
43
+ [Install](#install) &nbsp;•&nbsp;
44
+ [What it can do](#what-it-can-do) &nbsp;•&nbsp;
45
+ [A desktop of its own](#a-second-desktop-it-uses-while-you-work) &nbsp;•&nbsp;
46
+ [When something's off](#when-somethings-off) &nbsp;•&nbsp;
47
+ [Security](SECURITY.md)
48
+
49
+ <!-- demo.gif goes here: split screen, you typing on the left, the agent
50
+ driving apps on a virtual monitor on the right, uninterrupted. -->
51
+
52
+ Claude Code can edit your files and run your commands. It can't open GIMP,
53
+ click a button in a settings dialog, or read what a native app is showing you.
54
+ On macOS and Windows it can, through computer use. On Linux that's still on
55
+ Anthropic's list.
56
+
57
+ This fills the gap on GNOME. It's an MCP server plus a small shell extension,
58
+ and it hands an agent the actual desktop: launching apps, reading widgets,
59
+ clicking, typing, dragging, window management, OCR and screen recording. Any
60
+ MCP client can drive it. Claude Code, Codex, Cursor, your own script.
61
+
62
+ The part people tend to like most: `DESKWRIGHT_SESSION=headless` runs all of
63
+ it on a virtual monitor that isn't on any of your screens. Your agent gets a real GNOME
64
+ desktop to work on, and it never takes your focus.
65
+
66
+ ## Why this exists
67
+
68
+ Wayland deliberately stops an application from seeing or touching any other
69
+ window. That's a good rule, and it's why `xdotool`, `wmctrl` and `grim` either
70
+ do nothing on GNOME or fail in ways that look like your own mistake. Every
71
+ Linux computer-use project I found either shipped a Docker container running
72
+ X11, or quietly assumed X11 and broke.
73
+
74
+ So I went looking for what GNOME actually permits, and it turns out to be quite
75
+ a lot, just not where anyone looks. Mutter answers D-Bus. AT-SPI, the
76
+ accessibility layer built for screen readers, exposes every real widget in
77
+ every running app with its name, its role and the action it performs. And a
78
+ shell extension runs inside gnome-shell itself, where the rest lives.
79
+
80
+ That middle one matters more than it sounds. Pressing a widget's own
81
+ accessibility action isn't a nicer way to click. It's a different thing: it
82
+ can't miss, it survives the window moving, and it needs no pointer at all. An
83
+ agent working this way stops guessing at coordinates, and stops taking a
84
+ screenshot after every action to find out what happened.
85
+
86
+ ## Install
87
+
88
+ You need GNOME Shell on Wayland. Check with `echo $XDG_CURRENT_DESKTOP
89
+ $XDG_SESSION_TYPE`, which should mention GNOME and wayland.
90
+
91
+ ### The lazy way: hand it to your agent
92
+
93
+ Open Claude Code, or Codex, or whatever you use, and say:
94
+
95
+ > Set up https://github.com/tristanmuzzu/deskwright on this machine,
96
+ > follow the AGENTS.md.
97
+
98
+ [`AGENTS.md`](AGENTS.md) is a runbook written for agents. Every command, how to
99
+ check each one worked, the right package names for Debian, Fedora and Arch, and
100
+ the handful of things that go wrong with their fixes. Your agent will ask you
101
+ for a sudo password once and tell you to log out once. That's your whole
102
+ involvement.
103
+
104
+ ### By hand: two commands and a logout
105
+
106
+ ```bash
107
+ pipx install --system-site-packages deskwright
108
+ deskwright-setup
109
+ ```
110
+
111
+ `deskwright-setup` narrates every step. It turns on the accessibility flag, installs
112
+ the bundled shell extension, and tells you about any missing system package
113
+ with the right install line for your distro, so you're never guessing at
114
+ package names. It never runs sudo itself.
115
+
116
+ **Then log out and log back in.** Once. There's no way around this one: on
117
+ Wayland, gnome-shell only picks up an extension at session start.
118
+
119
+ Last step, point your client at it:
120
+
121
+ ```bash
122
+ claude mcp add deskwright --scope user -- deskwright
123
+ ```
124
+
125
+ That's it. Ask your agent to open an app and it will.
126
+
127
+ <details>
128
+ <summary><b>Why <code>--system-site-packages</code>, and what breaks without it</b></summary>
129
+
130
+ PyGObject publishes no wheels to PyPI. It's a distro package everywhere
131
+ (`python3-gi`, `python3-gobject`, `python-gobject`), so an isolated venv can't
132
+ import it. Leave the flag off and you get a server that starts cleanly and then
133
+ dies on the first click with `input_backend_failed`.
134
+
135
+ `uvx` has no equivalent flag, which is the only reason this says pipx. If you'd
136
+ rather skip pipx, a plain `python3 -m venv --system-site-packages` followed by
137
+ `pip install deskwright` works identically.
138
+ </details>
139
+
140
+ <details>
141
+ <summary><b>As a Claude Code plugin instead</b></summary>
142
+
143
+ The repo is also a plugin marketplace. It registers the server plus a skill
144
+ that teaches an agent which tool to reach for first.
145
+
146
+ ```bash
147
+ claude plugin marketplace add tristanmuzzu/deskwright
148
+ claude plugin install deskwright@deskwright
149
+ ```
150
+
151
+ The plugin runs the server from its own checkout, so there's no pip install.
152
+ You still need the system packages and the extension, so run the setup out of
153
+ the checkout Claude Code cloned for you, once:
154
+
155
+ ```bash
156
+ ~/.claude/plugins/marketplaces/deskwright/bin/deskwright-setup
157
+ ```
158
+
159
+ Then log out and back in, same as above.
160
+ </details>
161
+
162
+ <details>
163
+ <summary><b>From a clone, if you want to hack on it</b></summary>
164
+
165
+ ```bash
166
+ git clone https://github.com/tristanmuzzu/deskwright
167
+ cd deskwright
168
+ bin/deskwright-setup
169
+ ./mcp_server.py --self-test
170
+ ```
171
+
172
+ `./mcp_server.py` is the same entry point as the `deskwright`
173
+ command, by the path older registrations already point at.
174
+ [`CONTRIBUTING.md`](CONTRIBUTING.md) has the layout and which test suites need
175
+ a real session.
176
+ </details>
177
+
178
+ ## Check it works
179
+
180
+ ```bash
181
+ DESKWRIGHT_SESSION=headless deskwright --self-test
182
+ ```
183
+
184
+ You want `18/18 passed`. It runs on a virtual monitor rather than your screen,
185
+ so it's safe to run while you're working. The first run takes about 20 seconds
186
+ because it has to start a second gnome-shell.
187
+
188
+ Drop `DESKWRIGHT_SESSION=headless` and it tests your real desktop instead. Do that one
189
+ while you're looking at the screen: the self-test injects real input, because
190
+ it's checking the guards that refuse dangerous key combinations.
191
+
192
+ When something's wrong, ask your agent to call `desktop_health`. It answers in
193
+ one line whether this desktop is usable, then says which mechanisms work right
194
+ now and what each of them will actually do.
195
+
196
+ ## What it can do
197
+
198
+ 33 tools, roughly 11k tokens of schema in a session. That's the honest price,
199
+ and it's why each one returns enough that you don't need a second call to work
200
+ out what happened. The order below is the order an agent should reach for them.
201
+ Accessibility tree first, pixels last.
202
+
203
+ | Tool | What it's for |
204
+ |---|---|
205
+ | `ui_apps`, `ui_tree`, `ui_find` | Find things. `ui_find` searches 30 levels deep by default, because GTK4 nests far deeper than you'd expect. |
206
+ | `ui_press` | **The good one.** Invokes the widget's own action, so it can't miss. Wants `expect_name` or `expect_role`, which is the identity check, not ceremony. |
207
+ | `ui_set_text` | **The good one for typing.** Writes straight into the widget with no focus and no keyboard, then reads it back to prove the write landed. |
208
+ | `ui_read_text` | Read a widget's contents. This is how you verify something worked. |
209
+ | `launch_app` | Start an app by desktop id and wait for its window, inside one call. |
210
+ | `screen_map` | Where everything is, in pixels: windows top of stack first, plus every pressable widget of the focused app with the point to click it at. Each carries a `ref: N` you pass straight to `ui_press` or `pointer_click`. No coordinates to copy, identity re-checked on use. |
211
+ | `pointer_click`, `pointer_move`, `pointer_drag`, `pointer_scroll` | Real pointer input in absolute screen coordinates. Pass `expect_window` and a click that would land somewhere else is refused, with the blocker named so you can redirect in the same call. |
212
+ | `window_at`, `pointer_position` | What a click at a point would hit, before you click it. And where the pointer is now, or an honest note that only the last position it set is known. |
213
+ | `find_text` | Where a visible string is, in screen coordinates. OCR, about 0.3s for a window, and no image in your transcript. This is the answer for Chrome, Electron and Qt, which expose almost nothing to `ui_find`. |
214
+ | `wait_for` | Wait for a window, a widget, some text, a focus change or the clipboard, instead of sleeping a guessed number of seconds. |
215
+ | `region_changed` | Wait for pixels to change. For what `wait_for` can't express, like a reply arriving or a spinner stopping. |
216
+ | `assert_state` | Pass or fail with evidence, so a long run can decide for itself that it's finished. |
217
+ | `do_steps` | A known sequence in one call, validated before anything runs, with per-step retry and one picture at the end, or at the step that broke. |
218
+ | `list_windows`, `activate_window`, `window_manage` | Window list, focus, and move, resize, close, minimize, maximize, workspace. |
219
+ | `screenshot`, `zoom` | A picture, or a full-resolution crop of one window, region or widget. `zoom` never scales, so small text stays readable. |
220
+ | `screencast`, `frames` | For anything that moves, because a still can't show motion. `frames` also reports a per-frame delta series, which is how you tell a smooth scroll from a juddering one. |
221
+ | `type_text`, `press_keys`, `hold_key` | Keyboard input through compositor keysyms, with focus proven before anything gets typed. |
222
+ | `clipboard_read`, `clipboard_write` | Pasting beats two thousand keystrokes, and reading back is how you check it arrived. |
223
+ | `journal` | The trail of everything the agent did: arguments, outcome, whether it landed, screenshot hashes. For reviewing an unattended run, or working out where you are after a context reset. |
224
+ | `desktop_health` | One line on whether this desktop is usable, then the detail. |
225
+
226
+ ## A second desktop it uses while you work
227
+
228
+ An agent that needs your screen is only half useful. `deskwright-headless` starts a
229
+ separate GNOME session on a virtual monitor, with its own session bus, its own
230
+ `gnome-shell --headless` and its own runtime directory. A server pinned to it
231
+ drives that desktop with the same 33 tools while you keep the physical one.
232
+
233
+ ```bash
234
+ deskwright-headless start # about 200 MB of gnome-shell, idempotent
235
+ deskwright-headless status # liveness, memory, bus address
236
+ deskwright-headless stop # don't leave it idling on an 8 GB machine
237
+ ```
238
+
239
+ Register it as a second MCP server and you can hand it long jobs:
240
+
241
+ ```bash
242
+ claude mcp add deskwright-headless --scope user --env DESKWRIGHT_SESSION=headless -- deskwright
243
+ ```
244
+
245
+ Sessions are named, so two agents can each have a desktop of their own and
246
+ never watch each other's windows move:
247
+
248
+ ```bash
249
+ deskwright-headless start --name work
250
+ deskwright-headless list # every session, memory used, memory free
251
+ DESKWRIGHT_SESSION=headless:work deskwright
252
+ ```
253
+
254
+ There are guards on this, because each session is a real compositor at around
255
+ 205 MB: a per-name start lock so two agents can't both spawn one, a session cap
256
+ (`DESKWRIGHT_HEADLESS_MAX`, default 4), and a free-memory floor that refuses a start
257
+ which would push the machine into swap. The agent that would cause that can't
258
+ see it coming, so the server does.
259
+
260
+ ## When something's off
261
+
262
+ **The extension says INACTIVE, or window tools don't work.** You haven't logged
263
+ out yet. gnome-shell can't load an extension without a session restart and
264
+ there's no workaround. Until then you still get AT-SPI, pointer, keyboard and
265
+ clipboard. You don't get window management, extension screenshots, pointer
266
+ position or the halt switch.
267
+
268
+ **An app shows no widgets in `ui_tree`.** It was already running when
269
+ `toolkit-accessibility` got turned on. Apps read that setting at startup, so
270
+ restart the app.
271
+
272
+ **Chrome, Electron or Qt apps look empty.** As far as AT-SPI is concerned, they
273
+ are. Use `find_text` instead, which OCRs the screen and hands back coordinates.
274
+ For Chrome specifically, launching it with `--force-renderer-accessibility`
275
+ gets you a real tree at a small performance cost.
276
+
277
+ **Everything fails with `input_backend_failed`.** pipx without
278
+ `--system-site-packages`. Reinstall with the flag:
279
+
280
+ ```bash
281
+ pipx install --force --system-site-packages deskwright
282
+ ```
283
+
284
+ **Every `ui_*` call says "Namespace Atspi not available".** You have
285
+ `python3-gi` but not the AT-SPI typelib, which is a separate package:
286
+ `gir1.2-atspi-2.0` on Debian and Ubuntu, `at-spi2-core` on Fedora and Arch.
287
+ `deskwright-setup --check` catches this and names it.
288
+
289
+ **A tool returns `halted`.** Somebody pressed `Super+Ctrl+Escape`, which is the
290
+ halt switch. Press it again to clear it.
291
+
292
+ **Your screen locked and half the tools stopped.** Expected. GNOME unloads
293
+ extensions that don't declare `unlock-dialog`, so screenshots and window
294
+ geometry go away until you unlock. AT-SPI keeps working, so `ui_find`,
295
+ `ui_press` and `ui_read_text` all still do.
296
+
297
+ ## What it won't do
298
+
299
+ Deliberately out of scope as a project, not just off by default:
300
+
301
+ - **No CAPTCHA solving.** CAPTCHAs exist to tell humans from software. This is
302
+ software.
303
+ - **No credential typing features.** Nothing here is built to harvest, store or
304
+ autofill secrets. The journal doesn't record what gets typed, only how much.
305
+ - **No detection evasion.** No timing jitter to look human, no fingerprint
306
+ spoofing, no anti-anti-bot work.
307
+ - **No cloud, no telemetry, no account.** It's a local process on your session
308
+ bus, and nothing leaves the machine.
309
+
310
+ On the other side of that line the design is deliberately permissive. The agent
311
+ is trusted, and the tooling's job is to make it capable rather than to fence it
312
+ in. The whole safety budget goes to three things: a halt switch a human can
313
+ always reach, guards against actions that can't be undone, and an honest record
314
+ of what happened. [SECURITY.md](SECURITY.md) is blunt about what enabling this
315
+ actually switches on, and it's worth reading before you point it at your real
316
+ screen.
317
+
318
+ ## How it actually works
319
+
320
+ Wayland denies all of this to Wayland clients. It says nothing about D-Bus, and
321
+ that's where the doors are. Four mechanisms, roughly in order of how much work
322
+ they carry:
323
+
324
+ 1. **AT-SPI** for anything semantic. Real widgets, real actions, no pointer.
325
+ 2. **A gnome-shell extension** over D-Bus for what gnome-shell keeps to itself:
326
+ window enumeration and control, screenshots, pointer position, and a
327
+ keybinding grab for the halt switch.
328
+ 3. **`org.gnome.Mutter.RemoteDesktop`** for pointer and keyboard. Absolute
329
+ coordinates, and keysyms rather than key positions, so your keyboard layout
330
+ can't transpose what gets typed.
331
+ 4. **`xdg-desktop-portal`** for the same thing, standardised. This is the route
332
+ to compositors that aren't GNOME.
333
+
334
+ Worth knowing: number 2 is the only one of those that isn't already open.
335
+ Mutter's ScreenCast and RemoteDesktop interfaces answer any client on your
336
+ session bus with no consent dialog, which is why recording here needs no
337
+ permission popup, and why the portal is a caller of them rather than a gate in
338
+ front of them. [SECURITY.md](SECURITY.md) has the exact commands if you'd
339
+ rather check that yourself than take my word for it.
340
+
341
+ [`docs/field-notes.md`](docs/field-notes.md) is the long version: every wall
342
+ hit on the way here, what the compositor refused, and the measurements that
343
+ shaped the tool surface. It's the file to read when something behaves oddly, or
344
+ before you change the code.
345
+
346
+ ## Requirements
347
+
348
+ `deskwright-setup --check` is the real answer. It detects everything, names the
349
+ package for your distro and exits nonzero if a hard requirement is missing.
350
+ The short version:
351
+
352
+ | Platform | Status |
353
+ |---|---|
354
+ | GNOME Shell 50 on Wayland | **Verified.** Developed on 50.1 (Ubuntu 26.04), live suites run against it on every change. |
355
+ | GNOME Shell 48 to 49 | **Should work.** Same D-Bus and AT-SPI surfaces, not tested. Reports welcome, attach `desktop_health` output. |
356
+ | KDE Plasma, Sway, Hyprland | **Input only.** The portal backend drives pointer and keyboard, but window management and screenshots need per-compositor work that isn't done. `desktop_health` will say it's not usable, and it means it. |
357
+ | X11 | Not a target. `xdotool` already does this well there. |
358
+
359
+ Packages, using Debian names (`deskwright-setup` prints yours): `python3-gi`,
360
+ `gir1.2-atspi-2.0`, `python3-pil`, `libglib2.0-bin`, `wl-clipboard`,
361
+ `tesseract-ocr`. `ydotool` is optional and only used as an input fallback. The
362
+ headless session additionally wants `gnome-shell` and `dbus-daemon` as
363
+ binaries, which any normal desktop already has.
364
+
365
+ ## Contributing, security, license
366
+
367
+ [`CONTRIBUTING.md`](CONTRIBUTING.md) has the layout, the test suites and what
368
+ each one needs. [`SECURITY.md`](SECURITY.md) is the threat model, stated
369
+ plainly. [`ROADMAP.md`](ROADMAP.md) is what's next and why, in order.
370
+
371
+ Apache-2.0. If you get it running on a compositor that isn't GNOME, or on a
372
+ GNOME older than 50, please open an issue and say so. That's the most useful
373
+ thing anyone can send.