earakely-scale commited on
Commit
15fe97e
·
verified ·
1 Parent(s): 51e5df2

REA computer-use environment, v0.1.0

Browse files
README.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ pretty_name: Inkscape computer-use environment (REA)
4
+ tags:
5
+ - computer-use
6
+ - cua
7
+ - gui-agent
8
+ - rl-environment
9
+ - agentenv
10
+ - desktop
11
+ - linux
12
+ - rea
13
+ - vector-graphics
14
+ - svg
15
+ - design
16
+ ---
17
+
18
+ # Inkscape: a computer-use environment
19
+
20
+ ![An agent solving the task in Inkscape](media/hero.gif)
21
+
22
+ **The real Inkscape 1.2 vector graphics editor running on an Ubuntu 24.04 desktop, as an [agentenv](https://pypi.org/project/agentenv-framework/) computer environment. An agent completes the task only through screenshots, mouse and keyboard, and a verifier grades the saved files with no model.**
23
+
24
+ Inkscape opens a bake sale poster. The agent has to change the headline from Spring to Summer with Inkscape's text tool and save the drawing. It sees only the screen and acts only with the mouse and keyboard.
25
+
26
+ ## Watch
27
+
28
+ - Agent runs (Claude Code with Claude Sonnet 5.5): [run 1](media/solve-1.mp4), [run 2](media/solve-2.mp4), [run 3](media/solve-3.mp4)
29
+ - Scripted witness, which proves the task can be done through the computer: [witness.mp4](media/witness.mp4)
30
+
31
+ Each video is the computer's own screen recording at 10 frames per second.
32
+
33
+ ## The task
34
+
35
+ > In the bake sale poster open in Inkscape, change the headline from "Spring Bake Sale" to "Summer Bake Sale", then save the poster.
36
+
37
+ `bundle/artifacts/summer-headline-check/verify.py` reads the app's files through the computer's `data/get` view and passes only if every check holds:
38
+
39
+ | Check | Kind | File |
40
+ | --- | --- | --- |
41
+ | `headline` | `value_equals` | `Documents/poster.svg` |
42
+ | `price-kept` | `value_equals` | `Documents/poster.svg` |
43
+ | `date-kept` | `value_equals` | `Documents/poster.svg` |
44
+
45
+ The checks read the saved SVG as XML. They find the text by its layer label and `id`, never by position. The headline must read "Summer Bake Sale" exactly, and the price and date lines must be unchanged.
46
+
47
+ ## Results
48
+
49
+ 3 of 3 runs passed, about $0.41 per run.
50
+
51
+ | Run | Outcome | Turns | Cost | Video |
52
+ | --- | --- | --- | --- | --- |
53
+ | 1 | passed | 10 | $0.66 | [video](media/solve-1.mp4) |
54
+ | 2 | passed | 10 | $0.41 | [video](media/solve-2.mp4) |
55
+ | 3 | passed | 10 | $0.17 | [video](media/solve-3.mp4) |
56
+
57
+ ## Run it
58
+
59
+ You need Docker. `agentenv-framework` builds the computer: Ubuntu 24.04 with the app installed from Ubuntu's archive (`inkscape` 1.2.2).
60
+
61
+ ```bash
62
+ pip install agentenv-framework==0.9.1431
63
+ hf download earakely-scale/InkscapeComputerEnv-REA --repo-type dataset --local-dir inkscape
64
+ agent-env run inkscape/bundle --task summer-headline --agent claude-code --model <model>
65
+ ```
66
+
67
+ The agent needs a model provider configured for agentenv. `--task smoke` only boots the computer, with no agent. `bundle/README.md` describes the bundle in detail.
68
+
69
+ ## How it was made
70
+
71
+ [REA](https://github.com/morluto/rea) built this environment from a real session with the app:
72
+
73
+ 1. **Capture.** REA launched Inkscape on a Linux desktop and recorded its package, windows and opened files while a scripted user made the edit. It also recorded the app's state folders before and after.
74
+ 2. **Export.** REA turned the capture into an agentenv `computer_app`. It installs the app, seeds the starting files, starts the app, and waits for its main window. It also serves typed views of the app's files for verifiers.
75
+ 3. **Task.** The task's checks were validated against the capture: they fail on the starting state and pass on the captured end state.
76
+ 4. **Witness and runs.** Scripted computer actions solved the task in a fresh computer, and the verifier failed before, passed after and failed again after `data/reset`. Then an agent solved it 3 times, each run recorded.
77
+
78
+ ## What's inside
79
+
80
+ ```
81
+ bundle/ the agentenv bundle: envs/ (app module, seed files), tasks/, artifacts/ (verifier), evals/
82
+ media/ witness and agent-run recordings (MP4) with short GIF previews
83
+ results.json the runs above, with each check's result
84
+ ```
85
+
86
+ ## Limits
87
+
88
+ - The checks expect each line of text to stay one `tspan` inside its `text` element, in the layer labelled Layer 1. A correct-looking poster whose text was moved to another layer, ungrouped or split over two lines fails.
89
+ - The headline must match exactly, so a stray double space fails.
90
+ - The computer uses the `inkscape` version in Ubuntu 24.04's archive at build time; it is not pinned.
91
+ - Three runs is a small sample: the solve rate shows the task is solvable, not how hard it is.
92
+
93
+ ## Licences
94
+
95
+ The bundle code, the task and the synthetic seed files are Apache-2.0. Inkscape itself is not included: the computer installs it from Ubuntu's archive (`inkscape` 1.2.2) at build time, under its own licence (GNU GPL).
bundle/README.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Inkscape computer app
2
+
3
+ Exported by REA's `export-desktop-application` from a capture of the `inkscape` package
4
+ (capture Evidence `ev_c45a1b957a5bdf56e22a2cfb85f1a4dda39b4ef058c41d591f36273295ebddc7`). It was checked against agentenv-framework
5
+ 0.9.1431.
6
+
7
+ - `envs/inkscape/` is a computer app on the `ubuntu-24.04` base with the `reference` driver, for
8
+ `amd64` and `arm64`. It installs `inkscape` from the distribution archive, launches `sh -c exec 'inkscape' "$HOME"/'Documents/poster.svg'` at boot and is ready
9
+ when a window of class `Inkscape` appears.
10
+ - Owned paths: `~/.config/inkscape`, `~/Documents`.
11
+ `data/get` returns their files and a typed JSON view of each; `data/reset` restores the seed.
12
+ - Seed: 3 file(s) from the user's home before the capture, with the captured home path
13
+ respelled in text files.
14
+ - `tasks/smoke.json` deploys the app.
15
+
16
+ Run the task with `agent-env run <this folder>`, or only the deploy with `--task smoke`.
17
+
18
+ The seed is synthetic test data made for this showcase; it holds no one's real files.
19
+
20
+ ## Task `summer-headline`
21
+
22
+ `tasks/summer-headline.json` deploys the app, has the agent work through the computer from the prompt below, and grades
23
+ the outcome with `artifacts/summer-headline-check/verify.py`, which reads the app's `data/get` views and needs
24
+ no model. `evals/inkscape.toml` names it, so a run of the bundle runs it.
25
+
26
+ > In the bake sale poster open in Inkscape, change the headline from "Spring Bake Sale" to "Summer Bake Sale", then save the poster.
27
+
28
+ Checks, each of which must pass:
29
+
30
+ - `headline`: `{"kind":"value_equals","file":"Documents/poster.svg","pointer":"/root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=headline]/children/[name=tspan]/children/0","value":"Summer Bake Sale"}`
31
+ - `price-kept`: `{"kind":"value_equals","file":"Documents/poster.svg","pointer":"/root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=price]/children/[name=tspan]/children/0","value":"All cakes $2"}`
32
+ - `date-kept`: `{"kind":"value_equals","file":"Documents/poster.svg","pointer":"/root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=date]/children/[name=tspan]/children/0","value":"Saturday 14 March, 10am"}`
33
+
34
+ REA kept the task because its checks fail on the seed (`headline`) and all
35
+ pass on the captured end state.
36
+
37
+ To measure a solve rate, run the task k times (3 by default) with the agent and model to measure, and count the runs
38
+ whose summary line says `passed`; a run that says `failed` did not finish and is run again rather than counted:
39
+
40
+ agent-env run <this folder> --task summer-headline --agent claude-code --model MODEL
bundle/artifacts/summer-headline-check/verify.py ADDED
@@ -0,0 +1,300 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Checks of the task summer-headline against the inkscape app's state, exported by REA from a desktop application capture.
2
+
3
+ It reads the app's data/get through the computer, takes the typed views of its files and evaluates each check: no
4
+ model, no code from the task. A failure to reach the app raises, so the run fails rather than scoring the agent.
5
+ """
6
+ import json
7
+ import math
8
+ import re
9
+
10
+ from agentenv_protocol import client as protocol
11
+ from agentenv_protocol.types import RPC_PATH
12
+
13
+ APP = "inkscape"
14
+ CHECKS = [
15
+ {"id": "headline", "kind": "value_equals", "file": "Documents/poster.svg", "pointer": "/root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=headline]/children/[name=tspan]/children/0", "value": "Summer Bake Sale"},
16
+ {"id": "price-kept", "kind": "value_equals", "file": "Documents/poster.svg", "pointer": "/root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=price]/children/[name=tspan]/children/0", "value": "All cakes $2"},
17
+ {"id": "date-kept", "kind": "value_equals", "file": "Documents/poster.svg", "pointer": "/root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=date]/children/[name=tspan]/children/0", "value": "Saturday 14 March, 10am"},
18
+ ]
19
+
20
+ MISSING = object()
21
+ INDEX = re.compile(r"0|[1-9][0-9]*")
22
+ NUMERAL = re.compile(r"[+-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][+-]?[0-9]+)?")
23
+
24
+
25
+ def _shown(value) -> str:
26
+ text = json.dumps(value, ensure_ascii=False, separators=(",", ":"))
27
+ return text if len(text) <= 200 else text[:200] + "…"
28
+
29
+
30
+ def _same(actual, expected) -> bool:
31
+ """JSON equality: numbers by value but never a boolean for a number, objects by their keys, arrays in order."""
32
+ if isinstance(expected, list):
33
+ return (isinstance(actual, list) and len(actual) == len(expected)
34
+ and all(_same(item, wanted) for item, wanted in zip(actual, expected)))
35
+ if isinstance(expected, dict):
36
+ return (isinstance(actual, dict) and len(actual) == len(expected)
37
+ and all(key in actual and _same(actual[key], value) for key, value in expected.items()))
38
+ if isinstance(expected, bool) or isinstance(actual, bool):
39
+ return isinstance(expected, bool) and isinstance(actual, bool) and actual == expected
40
+ if isinstance(expected, (int, float)):
41
+ return isinstance(actual, (int, float)) and actual == expected
42
+ return type(actual) is type(expected) and actual == expected
43
+
44
+
45
+ def _bracketed(token: str) -> bool:
46
+ return len(token) >= 2 and token.startswith("[") and token.endswith("]")
47
+
48
+
49
+ def _selector(token: str):
50
+ """A selector's conditions, [KEY=VALUE] or [@KEY=VALUE] one or more times, or None when the token is not one."""
51
+ if not _bracketed(token):
52
+ return None
53
+ conditions = []
54
+ for part in token[1:-1].split("]["):
55
+ key, equals, value = part.partition("=")
56
+ name = key[1:] if key.startswith("@") else key
57
+ if not equals or not name:
58
+ return None
59
+ conditions.append((key.startswith("@"), name, value))
60
+ return conditions
61
+
62
+
63
+ def _selects(member, conditions) -> bool:
64
+ """Whether an array member meets every condition; selectors compare strings only."""
65
+ if not isinstance(member, dict):
66
+ return False
67
+ for attribute, key, value in conditions:
68
+ fields = member.get("attributes") if attribute else member
69
+ if not isinstance(fields, dict) or not isinstance(fields.get(key), str) or fields[key] != value:
70
+ return False
71
+ return True
72
+
73
+
74
+ def _step(items: list, token: str, last: bool):
75
+ """One step into an array, by index or by a selector that must match one member, or none when it is the last."""
76
+ if INDEX.fullmatch(token):
77
+ return ("member", items[int(token)]) if int(token) < len(items) else ("none", None)
78
+ conditions = _selector(token)
79
+ if conditions is None:
80
+ return ("unresolved", f"{token} is not a selector of the form [KEY=VALUE]") if _bracketed(token) else (
81
+ "none", None)
82
+ matched = [item for item in items if _selects(item, conditions)]
83
+ if len(matched) == 1:
84
+ return "member", matched[0]
85
+ if len(matched) > 1:
86
+ return "unresolved", f"{token} matches {len(matched)} members, not one"
87
+ return ("none" if last else "unresolved"), f"{token} matches no member"
88
+
89
+
90
+ def _locate(view, pointer: str):
91
+ """Where a pointer leads: ("value", value), ("none", why or None) or ("unresolved", problem)."""
92
+ current = view
93
+ tokens = [raw.replace("~1", "/").replace("~0", "~") for raw in pointer[1:].split("/")]
94
+ for position, token in enumerate(tokens):
95
+ if isinstance(current, list):
96
+ kind, found = _step(current, token, position == len(tokens) - 1)
97
+ if kind != "member":
98
+ return kind, found
99
+ current = found
100
+ elif isinstance(current, dict) and token in current:
101
+ current = current[token]
102
+ else:
103
+ return "none", None
104
+ return "value", current
105
+
106
+
107
+ def _number(value):
108
+ """A number, or a numeral string read as one; None for anything else, a boolean, or a numeral past the doubles."""
109
+ if isinstance(value, bool):
110
+ return None
111
+ if isinstance(value, (int, float)):
112
+ return value
113
+ if not isinstance(value, str) or not NUMERAL.fullmatch(value):
114
+ return None
115
+ number = float(value)
116
+ return number if math.isfinite(number) else None
117
+
118
+
119
+ def _entry_leaves_out(entry) -> bool:
120
+ return isinstance(entry, dict) and (isinstance(entry.get("view_error"), str) or (
121
+ entry.get("format") in ("text", "xml") and isinstance(entry.get("view"), dict)
122
+ and entry["view"].get("truncated") is True))
123
+
124
+
125
+ def _zip_leaves_out(view, pointer: str) -> bool:
126
+ """Whether a zip view leaves out what a pointer reaches: for a pointer into one listed entry, only that entry."""
127
+ if not isinstance(view, dict):
128
+ return False
129
+ parts = pointer[1:].split("/")
130
+ if parts[0] == "entries" and len(parts) > 1:
131
+ kind, entry = _locate(view, "/entries/" + parts[1])
132
+ return _entry_leaves_out(entry) if kind == "value" else view.get("truncated") is True
133
+ entries = view.get("entries") if isinstance(view.get("entries"), list) else []
134
+ return view.get("truncated") is True or any(_entry_leaves_out(entry) for entry in entries)
135
+
136
+
137
+ def _truncated(form, view) -> bool:
138
+ if not isinstance(view, dict):
139
+ return False
140
+ if form in ("text", "xml"):
141
+ return view.get("truncated") is True
142
+ if form != "sqlite":
143
+ return False
144
+ tables = view.get("tables")
145
+ return view.get("tables_truncated") is True or any(
146
+ isinstance(table, dict) and (table.get("truncated") is True or isinstance(table.get("error"), str))
147
+ for table in (tables.values() if isinstance(tables, dict) else []))
148
+
149
+
150
+ def _view_of(check, entry, form):
151
+ """The view, whether it is truncated, and why the check cannot read it; an absent file reads as empty."""
152
+ if entry is None:
153
+ return None, False, None
154
+ if isinstance(entry.get("error"), str):
155
+ return None, False, f"{check['file']} has no view: {entry['error']}"
156
+ if entry.get("format") in (None, "binary"):
157
+ return None, False, f"{check['file']} is binary and has no view"
158
+ if form is not None and entry.get("format") != form:
159
+ return None, False, f"{check['file']} is read as {entry.get('format')}, not {form}"
160
+ return entry.get("view"), _truncated(entry.get("format"), entry.get("view")), None
161
+
162
+
163
+ def _undecided(check):
164
+ return False, f"the view of {check['file']} is truncated, so what it leaves out is unknown"
165
+
166
+
167
+ def _compared(check, n: int, what: str):
168
+ operator = next(key for key in ("equals", "at_least", "at_most") if check.get(key) is not None)
169
+ expected = check[operator]
170
+ met = n == expected if operator == "equals" else n >= expected if operator == "at_least" else n <= expected
171
+ return met, f"{n} {what}, expected {operator.replace('_', ' ')} {expected}"
172
+
173
+
174
+ def _lines(check, entry):
175
+ view, truncated, problem = _view_of(check, entry, "text")
176
+ if problem is not None:
177
+ return False, problem
178
+ lines = view.get("lines") if isinstance(view, dict) and isinstance(view.get("lines"), list) else []
179
+ lines = [line for line in lines if isinstance(line, str)]
180
+ file = check["file"]
181
+ if check["kind"] == "lines_present":
182
+ missing = next((line for line in check["lines"] if line not in lines), None)
183
+ return (True, f"{file} has the line(s) {_shown(check['lines'])}") if missing is None else (
184
+ False, f"{file} has no line {_shown(missing)}")
185
+ if truncated:
186
+ return _undecided(check)
187
+ if check["kind"] == "lines_absent":
188
+ found = next((line for line in check["lines"] if line in lines), None)
189
+ return (True, f"{file} has none of the lines {_shown(check['lines'])}") if found is None else (
190
+ False, f"{file} still has the line {_shown(found)}")
191
+ if check.get("contains") is not None:
192
+ n = sum(1 for line in lines if check["contains"] in line)
193
+ return _compared(check, n, f"line(s) of {file} contain {_shown(check['contains'])}")
194
+ n = sum(1 for line in lines if line == check["exact"])
195
+ return _compared(check, n, f"line(s) of {file} match {_shown(check['exact'])}")
196
+
197
+
198
+ def _near(at: str, found, expected, tolerance):
199
+ """A value compared within a tolerance: numbers, and numeral strings, by their difference."""
200
+ number = _number(found)
201
+ within = f"within {_shown(tolerance)} of {_shown(expected)}"
202
+ if number is None:
203
+ return False, f"{at} is {_shown(found)}, not a number"
204
+ if abs(number - expected) <= tolerance:
205
+ return True, f"{at} is {_shown(found)}, {within}"
206
+ return False, f"{at} is {_shown(found)}, not {within}"
207
+
208
+
209
+ def _value(check, entry):
210
+ view, truncated, problem = _view_of(check, entry, None)
211
+ if problem is not None:
212
+ return False, problem
213
+ kind, found = ("none", None) if entry is None else _locate(view, check["pointer"])
214
+ at = f"{check['file']} at {check['pointer']}"
215
+ if kind == "unresolved":
216
+ return False, f"{at}: {found}"
217
+ if entry is not None and entry.get("format") == "zip":
218
+ truncated = _zip_leaves_out(view, check["pointer"])
219
+ if check["kind"] == "value_equals" and isinstance(check["value"], (dict, list)) and truncated:
220
+ return _undecided(check)
221
+ if check["kind"] == "value_equals":
222
+ if kind == "none":
223
+ return False, f"{at} has no value" if found is None else f"{at}: {found}"
224
+ expected = check["value"]
225
+ if check.get("tolerance") is not None and isinstance(expected, (int, float)) and not isinstance(expected, bool):
226
+ return _near(at, found, expected, check["tolerance"])
227
+ if _same(found, check["value"]):
228
+ return True, f"{at} is {_shown(check['value'])}"
229
+ return False, f"{at} is {_shown(found)}, not {_shown(check['value'])}"
230
+ if truncated:
231
+ return _undecided(check)
232
+ return (True, f"{at} has no value") if kind == "none" else (False, f"{at} is {_shown(found)}")
233
+
234
+
235
+ def _rows(check, entry):
236
+ view, _, problem = _view_of(check, entry, "sqlite")
237
+ if problem is not None:
238
+ return False, problem
239
+ view = view if isinstance(view, dict) else {}
240
+ tables = view.get("tables") if isinstance(view.get("tables"), dict) else {}
241
+ table = tables[check["table"]] if check["table"] in tables else MISSING
242
+ name = f"{check['file']} table {check['table']}"
243
+ if table is MISSING and view.get("tables_truncated") is True:
244
+ return _undecided(check)
245
+ table = table if isinstance(table, dict) else {}
246
+ if isinstance(table.get("error"), str):
247
+ return False, f"{name} could not be read: {table['error']}"
248
+ columns = table.get("columns") if isinstance(table.get("columns"), list) else []
249
+ rows = table.get("rows") if isinstance(table.get("rows"), list) else []
250
+ where = check.get("where") or {}
251
+
252
+ def matches(row) -> bool:
253
+ return isinstance(row, list) and all(
254
+ column in columns and columns.index(column) < len(row) and _same(row[columns.index(column)], value)
255
+ for column, value in where.items())
256
+
257
+ n = sum(1 for row in rows if matches(row))
258
+ if check["kind"] == "row_present":
259
+ return (n > 0, f"{name} has a row with {_shown(where)}" if n > 0 else f"{name} has no row with {_shown(where)}")
260
+ if table.get("truncated") is True:
261
+ return _undecided(check)
262
+ if check["kind"] == "row_absent":
263
+ return (True, f"{name} has no row with {_shown(where)}") if n == 0 else (
264
+ False, f"{name} has {n} row(s) with {_shown(where)}")
265
+ return _compared(check, n, f"row(s) of {name}" + (f" with {_shown(where)}" if "where" in check else ""))
266
+
267
+
268
+ def _verdict(check, entry):
269
+ kind = check["kind"]
270
+ if kind == "file_present":
271
+ return (entry is not None, f"{check['file']} exists" if entry is not None else f"{check['file']} does not exist")
272
+ if kind == "file_absent":
273
+ return (entry is None, f"{check['file']} does not exist" if entry is None else f"{check['file']} exists")
274
+ if kind in ("lines_present", "lines_absent", "line_count"):
275
+ return _lines(check, entry)
276
+ if kind in ("value_equals", "value_absent"):
277
+ return _value(check, entry)
278
+ return _rows(check, entry)
279
+
280
+
281
+ def evaluate(checks: list, views: dict) -> list:
282
+ """One result per check against the views data/get returned, by home path."""
283
+ results = []
284
+ for check in checks:
285
+ passed, description = _verdict(check, views.get(check["file"]))
286
+ results.append({"id": check["id"], "result": passed, "description": description})
287
+ return results
288
+
289
+
290
+ async def verify(mcp_url, env_url):
291
+ card = await protocol.get_card(env_url)
292
+ child = protocol.find_child(card, APP)
293
+ if child is None:
294
+ raise RuntimeError(f"the computer at {env_url} lists no app named {APP}")
295
+ answer = await protocol.get_data(env_url + (child.get("url") or RPC_PATH).removesuffix(RPC_PATH), timeout=120)
296
+ states = [part.data["state"] for part in answer.parts
297
+ if part.kind == "data" and isinstance(part.data.get("state"), dict)]
298
+ if not states:
299
+ raise RuntimeError(f"the {APP} app's data/get returned no state views")
300
+ return evaluate(CHECKS, states[0])
bundle/envs/inkscape/SKILL.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ description: Use Inkscape on this Linux desktop; its window has class Inkscape.
3
+ ---
4
+
5
+ # Inkscape
6
+
7
+ Inkscape is open on the desktop at boot. Its window's class is `Inkscape`.
8
+
9
+ Its files live under `~/.config/inkscape`, `~/Documents`. Work through the application's own
10
+ window and dialogs; the result is read from those files.
bundle/envs/inkscape/env.toml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ type = "computer_app"
2
+ module = "inkscape_app.py:Inkscape"
3
+ computer = "ubuntu-24.04"
4
+ driver = "reference"
bundle/envs/inkscape/inkscape_app.py ADDED
@@ -0,0 +1,564 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Inkscape as an agentenv computer app, exported by REA from a desktop application capture.
2
+
3
+ Package: inkscape (captured at 1.2.2-2ubuntu12). Capture Evidence: ev_c45a1b957a5bdf56e22a2cfb85f1a4dda39b4ef058c41d591f36273295ebddc7.
4
+ The seed is synthetic test data made for this showcase.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import contextlib
10
+ import hashlib
11
+ import json
12
+ import math
13
+ import os
14
+ import re
15
+ import sqlite3
16
+ import subprocess
17
+ import sys
18
+ import tempfile
19
+ import zipfile
20
+ import zlib
21
+ from pathlib import Path
22
+ from xml.parsers import expat
23
+
24
+ from agentenv_protocol import add_data, get_data, reset_data
25
+ from agentenv_protocol.computer import AptSource, ComputerAppEnvironment, Download, Launch, Packages, Ready, RunScript, computer_app, linux, ready_check
26
+ from agentenv_protocol.computer.app_data import INITIAL, add, get, in_thread, keep_initial, reset
27
+ from agentenv_protocol.types import DataPart
28
+
29
+ HERE = Path(__file__).resolve().parent
30
+ CAPTURED_HOME = "/home/user"
31
+ PATHS = [".config/inkscape", "Documents"]
32
+ DCONF = ""
33
+ TEXT_SEEDS = frozenset([".config/inkscape/extension-errors.log", ".config/inkscape/preferences.xml", "Documents/poster.svg"])
34
+ WINDOW_CLASS = "Inkscape"
35
+
36
+ XML_SUFFIXES = (".xml", ".xbel", ".plist", ".svg", ".ui")
37
+ GROUP_HEADER = re.compile(r"^\[([^\]]+)\]$")
38
+ LINE_BREAK = re.compile(r"\r?\n")
39
+ SQLITE_HEADER = b"SQLite format 3\x00"
40
+ GVDB_HEADER = b"GVariant"
41
+ ZIP_HEADER = b"PK\x03\x04"
42
+ XML_SPACE = "xml:space"
43
+ MAX_VIEW_BYTES = 64 * 1024 * 1024
44
+ MAX_SAFE_INTEGER = 2**53 - 1
45
+ MAX_TABLES = 64
46
+ MAX_ROWS = 500
47
+ MAX_LINES = 5000
48
+ MAX_XML_NODES = 5000
49
+ MAX_XML_DEPTH = 64
50
+ SQLITE_BUSY_S = 0.25
51
+ MAX_PARSED_BYTES = 4 * 1024 * 1024
52
+ MAX_ZIP_ENTRIES = 1000
53
+ MAX_ZIP_ENTRY_BYTES = 16 * 1024 * 1024
54
+ MAX_ZIP_BYTES = 64 * 1024 * 1024
55
+ MAX_ZIP_RATIO = 100
56
+ #: Formats an archive entry may have whose reader needs a tool, a worker or another archive opened.
57
+ NOT_READ_INSIDE = ((SQLITE_HEADER, "sqlite", "a SQLite database"), (GVDB_HEADER, "dconf", "a dconf database"),
58
+ (ZIP_HEADER, "zip", "an archive"))
59
+
60
+
61
+ def _respelled(text: str, home: Path) -> str:
62
+ """The captured home path respelled to this computer's home, only where a whole path segment ends after it."""
63
+ return re.sub(re.escape(CAPTURED_HOME) + r"(?![\w.@+~-])", lambda _: str(home), text)
64
+
65
+
66
+ def _respelled_utf16(data: bytes, home: Path) -> bytes:
67
+ """A UTF-16 text file with a byte-order mark respelled like a text seed, its mark kept; any other bytes as given."""
68
+ for mark, codec in ((b"\xff\xfe", "utf-16-le"), (b"\xfe\xff", "utf-16-be")):
69
+ if data.startswith(mark):
70
+ try:
71
+ text = data[len(mark):].decode(codec)
72
+ except UnicodeDecodeError:
73
+ return data
74
+ return mark + _respelled(text, home).encode(codec) if CAPTURED_HOME in text else data
75
+ return data
76
+
77
+
78
+ #: What marks a window as not yet the app's own: skipping the taskbar, as splash screens and dialogs do, or a splash type.
79
+ SPLASH_MARKS = ("_NET_WM_STATE_SKIP_TASKBAR", "_NET_WM_WINDOW_TYPE_SPLASH")
80
+
81
+
82
+ def _taskbar_window(window_class: str) -> bool:
83
+ """Whether a top-level window of the given class that the taskbar lists is shown; a splash screen or a dialog
84
+ skips the taskbar."""
85
+ def xprop(*args: str) -> str:
86
+ done = subprocess.run(["xprop", *args], capture_output=True, text=True)
87
+ return done.stdout if done.returncode == 0 else ""
88
+
89
+ for window in re.findall(r"0x[0-9a-f]+", xprop("-root", "_NET_CLIENT_LIST").partition("#")[2]):
90
+ props = xprop("-id", window, "WM_CLASS", "_NET_WM_STATE", "_NET_WM_WINDOW_TYPE")
91
+ classes = re.findall(r'"((?:[^"\\]|\\.)*)"', props.partition("WM_CLASS")[2].split("\n", 1)[0])
92
+ if window_class in classes and not any(mark in props for mark in SPLASH_MARKS):
93
+ return True
94
+ return False
95
+
96
+
97
+ def _seed_home(home: Path) -> None:
98
+ """Copy the captured files into this computer's home; text files, UTF-16 ones too, have the captured home path
99
+ respelled."""
100
+ seed = HERE / "seed"
101
+ for source in sorted(seed.rglob("*")) if seed.is_dir() else []:
102
+ if not source.is_file():
103
+ continue
104
+ relative = source.relative_to(seed).as_posix()
105
+ target = home / relative
106
+ target.parent.mkdir(parents=True, exist_ok=True)
107
+ data = source.read_bytes()
108
+ if relative in TEXT_SEEDS:
109
+ data = _respelled(data.decode("utf-8"), home).encode("utf-8")
110
+ else:
111
+ data = _respelled_utf16(data, home)
112
+ target.write_bytes(data)
113
+
114
+
115
+ def _dconf(arguments: list, environment: dict) -> str:
116
+ return subprocess.run(["dconf", *arguments], env={**os.environ, **environment}, capture_output=True, text=True,
117
+ check=True).stdout
118
+
119
+
120
+ def _load_dconf(home: Path) -> None:
121
+ """Compile the captured dconf keys into the user database without D-Bus, which is not up yet. Keys already there
122
+ stay unless captured: dconf compile reads the key files in name order and a later file wins. A failure is
123
+ reported and the app starts without them."""
124
+ if not DCONF:
125
+ return
126
+ database = home / ".config" / "dconf" / "user"
127
+ try:
128
+ database.parent.mkdir(parents=True, exist_ok=True)
129
+ with tempfile.TemporaryDirectory(dir=database.parent) as scratch:
130
+ keyfiles = Path(scratch, "keyfiles")
131
+ keyfiles.mkdir()
132
+ if database.is_file():
133
+ profile = Path(scratch, "profile")
134
+ profile.write_text(f"file-db:{database}\n")
135
+ existing = _dconf(["dump", "/"], {"DCONF_PROFILE": str(profile)})
136
+ (keyfiles / "00-existing").write_text(existing)
137
+ (keyfiles / "01-captured").write_text(_respelled(DCONF, home))
138
+ _dconf(["compile", str(Path(scratch, "user")), str(keyfiles)], {})
139
+ os.replace(Path(scratch, "user"), database)
140
+ except (OSError, subprocess.CalledProcessError) as error:
141
+ detail = (getattr(error, "stderr", None) or "").strip().splitlines()
142
+ print(f"warning: the captured dconf settings were not loaded: {detail[-1] if detail else error}",
143
+ file=sys.stderr)
144
+
145
+
146
+ def _sqlite_text(data: bytes):
147
+ text = data.decode("utf-8", "replace")
148
+ return {"text": text, "bytes_hex": data.hex()} if "�" in text else text
149
+
150
+
151
+ def _cell(value):
152
+ if isinstance(value, bytes):
153
+ return {"blob_hex": value.hex()}
154
+ if isinstance(value, int) and abs(value) > MAX_SAFE_INTEGER:
155
+ return {"integer": str(value)}
156
+ # JSON has no infinities or negative zero; REA's SQLite reader spells them as strings.
157
+ if isinstance(value, float) and (math.isinf(value) or (value == 0 and math.copysign(1, value) < 0)):
158
+ return "Infinity" if value == math.inf else "-Infinity" if value == -math.inf else "-0"
159
+ return value
160
+
161
+
162
+ def _table(db, name: str, primary_key: list) -> dict:
163
+ quoted = '"' + name.replace('"', '""') + '"'
164
+ cursor = db.execute(f"select * from main.{quoted} not indexed limit {MAX_ROWS + 1}")
165
+ rows = [[_cell(value) for value in row] for row in cursor]
166
+ return {"columns": [column[0] for column in cursor.description], "primary_key": primary_key,
167
+ "rows": rows[:MAX_ROWS], "truncated": len(rows) > MAX_ROWS}
168
+
169
+
170
+ def _sqlite(path: Path) -> dict:
171
+ """The database's ordinary tables, in schema order, up to REA's table and row limits."""
172
+ with contextlib.closing(sqlite3.connect(path.resolve().as_uri() + "?mode=ro", uri=True, timeout=SQLITE_BUSY_S)) as db:
173
+ kinds = dict(db.execute("select name, type from pragma_table_list where schema = 'main'"))
174
+ names = [name for (name,) in db.execute("select name from sqlite_schema where type = 'table'")
175
+ if kinds.get(name) == "table"]
176
+ keys = {name: [key for (key,) in db.execute(
177
+ "select name from pragma_table_info(?, 'main') where pk > 0 order by pk", (name,))]
178
+ for name in names[:MAX_TABLES]}
179
+ db.text_factory = _sqlite_text
180
+ tables = {name: _table(db, name, keys[name]) for name in names[:MAX_TABLES]}
181
+ cut = len(names) > MAX_TABLES
182
+ return {"format": "sqlite", "view": {"tables": tables, "tables_truncated": cut},
183
+ "truncated": cut or any(table["truncated"] for table in tables.values())}
184
+
185
+
186
+ def _text(text: str) -> dict:
187
+ lines = LINE_BREAK.split(text)
188
+ if lines[-1] == "":
189
+ lines.pop()
190
+ view = {"lines": lines[:MAX_LINES], "line_count": len(lines), "truncated": len(lines) > MAX_LINES}
191
+ return {"format": "text", "view": view, "truncated": view["truncated"]}
192
+
193
+
194
+ def _keyfile_line(raw: str) -> tuple:
195
+ """A key file line as REA reads it: skip (blank or comment), group, entry or other."""
196
+ line = raw.strip()
197
+ if not line or line[0] in "#;":
198
+ return ("skip",)
199
+ header = GROUP_HEADER.match(line)
200
+ if header:
201
+ return ("group", header.group(1))
202
+ key, equals, value = line.partition("=")
203
+ return ("entry", key.strip(), value.strip()) if equals and key else ("other",)
204
+
205
+
206
+ def _is_keyfile(text: str) -> bool:
207
+ """REA's rule: at least one group, and nothing a key file view would drop."""
208
+ kinds = {_keyfile_line(line)[0] for line in LINE_BREAK.split(text)}
209
+ return "group" in kinds and "other" not in kinds
210
+
211
+
212
+ def _keyfile(text: str) -> dict:
213
+ groups, group = {}, ""
214
+ for line in map(_keyfile_line, LINE_BREAK.split(text)):
215
+ if line[0] == "group":
216
+ group = line[1]
217
+ groups.setdefault(group, {})
218
+ elif line[0] == "entry":
219
+ groups.setdefault(group, {})[line[1]] = line[2]
220
+ return groups
221
+
222
+
223
+ def _expat(namespaces: bool):
224
+ """An expat parser that refuses DOCTYPEs as REA does; with namespaces it also enforces their rules, as REA's
225
+ parser does, and without them it reports names as the document spells them."""
226
+ parser = expat.ParserCreate(namespace_separator=" " if namespaces else None)
227
+
228
+ def doctype(*_) -> None:
229
+ raise ValueError("the document declares a DOCTYPE")
230
+
231
+ parser.StartDoctypeDeclHandler = doctype
232
+ return parser
233
+
234
+
235
+ class _XmlReader:
236
+ """REA's XML view built as expat reads: names as spelled, declarations as attributes, text split where REA's DOM
237
+ splits it (an empty CDATA section joins the text around it), and each node counted against REA's limits."""
238
+
239
+ def __init__(self) -> None:
240
+ self.remaining, self.truncated, self.root = MAX_XML_NODES, False, None
241
+ #: Per open element: its view or None when left out, whether xml:space="preserve" applies inside it, and
242
+ #: whether it holds an element, which makes whitespace-only text in it formatting.
243
+ self.open = []
244
+ self.text, self.cdata = [], None
245
+
246
+ def read(self, text: str) -> None:
247
+ parser = _expat(False)
248
+ parser.buffer_text = True
249
+ parser.StartElementHandler, parser.EndElementHandler = self._start, self._end
250
+ parser.CharacterDataHandler = self._data
251
+ parser.StartCdataSectionHandler, parser.EndCdataSectionHandler = self._cdata_start, self._cdata_end
252
+ parser.CommentHandler = parser.ProcessingInstructionHandler = self._other
253
+ parser.Parse(text, True)
254
+
255
+ def _admit(self) -> bool:
256
+ """Whether the next node inside a kept element is kept, within the node and depth limits; one past them
257
+ marks the view truncated."""
258
+ if self.open and self.open[-1][0] is None:
259
+ return False
260
+ if self.remaining <= 0 or len(self.open) > MAX_XML_DEPTH:
261
+ self.truncated = True
262
+ return False
263
+ self.remaining -= 1
264
+ return True
265
+
266
+ def _text_node(self, text: str) -> None:
267
+ if self._admit():
268
+ self.open[-1][0]["children"].append(text)
269
+
270
+ def _flush(self) -> None:
271
+ if self.text:
272
+ text, self.text = "".join(self.text), []
273
+ self._text_node(text)
274
+
275
+ def _data(self, text: str) -> None:
276
+ (self.text if self.cdata is None else self.cdata).append(text)
277
+
278
+ def _cdata_start(self) -> None:
279
+ self.cdata = []
280
+
281
+ def _cdata_end(self) -> None:
282
+ text, self.cdata = "".join(self.cdata), None
283
+ if text:
284
+ self._flush()
285
+ self._text_node(text)
286
+
287
+ def _other(self, *_) -> None:
288
+ """A comment or processing instruction, counted like any node and never kept."""
289
+ self._flush()
290
+ if self.open:
291
+ self._admit()
292
+
293
+ def _start(self, name: str, attributes: dict) -> None:
294
+ self._flush()
295
+ parent = self.open[-1] if self.open else [None, False, False]
296
+ parent[2] = True
297
+ view = {"name": name, "attributes": attributes, "children": []} if self._admit() else None
298
+ if view is not None and parent[0] is not None:
299
+ parent[0]["children"].append(view)
300
+ space = attributes.get(XML_SPACE)
301
+ self.open.append([view, space == "preserve" if space else parent[1], False])
302
+
303
+ def _end(self, _name: str) -> None:
304
+ self._flush()
305
+ view, preserve, holds_element = self.open.pop()
306
+ if view is not None and holds_element and not preserve:
307
+ view["children"] = [child for child in view["children"] if not isinstance(child, str) or child.strip()]
308
+ if not self.open:
309
+ self.root = view
310
+
311
+
312
+ def _xml_view(text: str):
313
+ """REA's XML view, or None for a document REA's parser refuses: a pass with namespaces checks the document as REA's
314
+ parser does, then a pass without them reads names as spelled, as REA's view keeps them."""
315
+ reader = _XmlReader()
316
+ try:
317
+ _expat(True).Parse(text, True)
318
+ reader.read(text)
319
+ except (expat.ExpatError, ValueError):
320
+ return None
321
+ return {"root": reader.root, "truncated": reader.truncated}
322
+
323
+
324
+ def _not_json(constant: str):
325
+ raise ValueError(f"{constant} is not JSON")
326
+
327
+
328
+ class _Inexact(Exception):
329
+ """A JSON number that REA's state view refuses, since reading it would change it."""
330
+
331
+
332
+ def _digits(text: str) -> str:
333
+ return re.split(r"[eE]", text.lstrip("-"))[0].replace(".", "").strip("0") or "0"
334
+
335
+
336
+ def _js_string(value: float) -> str:
337
+ """How JavaScript's String() writes a finite double: an integer below 1e21 in full, any other in shortest form."""
338
+ return str(int(value)) if value.is_integer() and abs(value) < 1e21 else repr(value)
339
+
340
+
341
+ def _safe_number(text: str) -> bool:
342
+ """lossless-json's isSafeNumber: an integer spelling within 2^53, or a float spelling that keeps its digits."""
343
+ if re.fullmatch(r"-?[0-9]+", text):
344
+ return len(text.lstrip("-")) <= 16 and abs(int(text)) <= MAX_SAFE_INTEGER
345
+ value = float(text)
346
+ if not math.isfinite(value):
347
+ return False
348
+ written = _js_string(value)
349
+ return written == text or _digits(written) == _digits(text)
350
+
351
+
352
+ def _exact_number(text: str):
353
+ """A JSON number read only when reading it changes nothing, as REA's state view rules: its spelling and its
354
+ written-back form both safe, and not -0."""
355
+ value = float(text)
356
+ if (not _safe_number(text) or not math.isfinite(value) or not _safe_number(_js_string(value))
357
+ or (value == 0 and math.copysign(1, value) < 0)):
358
+ raise _Inexact(text)
359
+ return int(text) if re.fullmatch(r"-?[0-9]+", text) else value
360
+
361
+
362
+ _INEXACT = object()
363
+ _INEXACT_END = object()
364
+
365
+
366
+ def _number_or_mark(spelling: str):
367
+ """A JSON number read exactly, or a mark for one REA's state view refuses."""
368
+ try:
369
+ return _exact_number(spelling)
370
+ except _Inexact:
371
+ return _INEXACT
372
+
373
+
374
+ def _holds_inexact(value) -> bool:
375
+ """Whether a parsed JSON value still holds a marked number once duplicate keys kept their last value; one
376
+ iterator per nesting level, so no child list is copied."""
377
+ levels = [iter((value,))]
378
+ while levels:
379
+ item = next(levels[-1], _INEXACT_END)
380
+ if item is _INEXACT_END:
381
+ levels.pop()
382
+ elif item is _INEXACT:
383
+ return True
384
+ elif isinstance(item, dict):
385
+ levels.append(iter(item.values()))
386
+ elif isinstance(item, list):
387
+ levels.append(iter(item))
388
+ return False
389
+
390
+
391
+ def _text_view(name: str, text: str) -> dict:
392
+ """The format REA's state view detects for decoded text, and its view."""
393
+ trimmed = re.sub(r"^[\s]+", "", text)
394
+ if name.endswith(".json") or trimmed[:1] in ("[", "{"):
395
+ # The whole text must parse, and duplicate keys settle, before an inexact number makes it JSON with an error.
396
+ try:
397
+ view = json.loads(text, parse_constant=_not_json, parse_float=_number_or_mark, parse_int=_number_or_mark)
398
+ except ValueError:
399
+ pass
400
+ else:
401
+ if _holds_inexact(view):
402
+ return {"format": "json", "view": None,
403
+ "error": "a number in it cannot be read exactly, such as an integer above 2^53"}
404
+ return {"format": "json", "view": view, "truncated": False}
405
+ lowered = name.lower()
406
+ if lowered.endswith(XML_SUFFIXES) or trimmed.startswith("<?xml"):
407
+ view = _xml_view(text)
408
+ return _text(text) if view is None else {"format": "xml", "view": view, "truncated": view["truncated"]}
409
+ if _is_keyfile(text):
410
+ return {"format": "keyfile", "view": {"groups": _keyfile(text)}, "truncated": False}
411
+ return _text(text)
412
+
413
+
414
+ def _entry_view(name: str, data: bytes) -> dict:
415
+ """An archive entry's format and view by the rules a file's follow; a database or an archive inside is not
416
+ read."""
417
+ for header, form, inside in NOT_READ_INSIDE:
418
+ if data.startswith(header):
419
+ return {"format": form, "view": None, "error": f"{inside} inside an archive is not read"}
420
+ try:
421
+ text = data.decode("utf-8-sig") if b"\x00" not in data[:8192] else None
422
+ except UnicodeDecodeError:
423
+ text = None
424
+ if text is None:
425
+ return {"format": "binary", "view": None}
426
+ view = _text_view(name, text)
427
+ if view["format"] in ("json", "keyfile") and len(data) > MAX_PARSED_BYTES:
428
+ return {"format": view["format"], "view": None,
429
+ "error": "larger than the 4 MiB limit for JSON and key file views"}
430
+ return view
431
+
432
+
433
+ def _zip_refusal(info, spent: int):
434
+ """Why an entry is not read, checked in REA's order, or None; spent is the archive's bytes read so far."""
435
+ if info.flag_bits & 0x1:
436
+ return "encrypted, so it is not read"
437
+ if info.compress_type not in (zipfile.ZIP_STORED, zipfile.ZIP_DEFLATED):
438
+ return f"compressed with method {info.compress_type}, which the view does not read"
439
+ if info.file_size > MAX_ZIP_ENTRY_BYTES:
440
+ return "larger than the 16 MiB an entry's view reads"
441
+ if info.file_size > MAX_ZIP_RATIO * info.compress_size:
442
+ return f"expands more than {MAX_ZIP_RATIO} times, so it is not read"
443
+ if spent + info.file_size > MAX_ZIP_BYTES:
444
+ return "past the 64 MiB read from one archive"
445
+ return None
446
+
447
+
448
+ def _zip_entry(archive, info, refusal):
449
+ """One entry of a zip view: its name, size and digest, and its own format and view, or why it was not read."""
450
+ entry = {"name": info.filename, "size": info.file_size, "sha256": None, "format": None, "view": None,
451
+ "view_error": refusal}
452
+ if refusal is not None:
453
+ return entry
454
+ try:
455
+ with archive.open(info) as member:
456
+ data = member.read()
457
+ except (zipfile.BadZipFile, zlib.error, EOFError, OSError, ValueError):
458
+ data = None
459
+ if data is None or len(data) != info.file_size:
460
+ return {**entry, "view_error": "its compressed data is damaged"}
461
+ view = _entry_view(info.filename, data)
462
+ return {**entry, "sha256": hashlib.sha256(data).hexdigest(), "format": view["format"],
463
+ "view": view.get("view"), "view_error": view.get("error")}
464
+
465
+
466
+ def _zip(path: Path) -> dict:
467
+ """A zip archive's file entries in archive order, up to REA's entry, size, ratio and archive limits; nothing is
468
+ extracted to disk and no archive inside is opened."""
469
+ entries, count, spent = [], 0, 0
470
+ try:
471
+ with zipfile.ZipFile(path) as archive:
472
+ for info in archive.infolist():
473
+ if info.is_dir():
474
+ continue
475
+ count += 1
476
+ if len(entries) >= MAX_ZIP_ENTRIES:
477
+ continue
478
+ refusal = _zip_refusal(info, spent)
479
+ spent += info.file_size if refusal is None else 0
480
+ entries.append(_zip_entry(archive, info, refusal))
481
+ except (zipfile.BadZipFile, zlib.error, EOFError, NotImplementedError, OSError, ValueError):
482
+ return {"format": "zip", "view": None, "error": "not a readable zip archive"}
483
+ view = {"entries": entries, "entry_count": count, "truncated": count > len(entries)}
484
+ return {"format": "zip", "view": view, "truncated": view["truncated"]}
485
+
486
+
487
+ def _view(path: Path) -> dict:
488
+ """A typed JSON view of one file in the shapes of REA's state view; truncated says the view is partial."""
489
+ too_large = {"format": None, "view": None, "error": "larger than 64 MiB, the most the view reads"}
490
+ if path.stat().st_size > MAX_VIEW_BYTES:
491
+ return too_large
492
+ with path.open("rb") as file:
493
+ data = file.read(8192)
494
+ whole = not data.startswith(SQLITE_HEADER) and b"\x00" not in data
495
+ data += file.read(MAX_VIEW_BYTES + 1 - len(data)) if whole else b""
496
+ if data.startswith(SQLITE_HEADER):
497
+ return _sqlite(path)
498
+ if data.startswith(ZIP_HEADER):
499
+ return _zip(path)
500
+ if len(data) > MAX_VIEW_BYTES:
501
+ return too_large
502
+ try:
503
+ text = data.decode("utf-8-sig") if whole else None
504
+ except UnicodeDecodeError:
505
+ text = None
506
+ return {"format": "binary", "view": None, "truncated": False} if text is None else _text_view(path.name, text)
507
+
508
+
509
+ def _views(home: Path, paths: list) -> dict:
510
+ """A view of every file under the app's paths, keyed by its home-relative path."""
511
+ files = {}
512
+ for owned in paths:
513
+ root = home / owned
514
+ candidates = [root] if root.is_file() else sorted(root.rglob("*")) if root.is_dir() else []
515
+ for path in candidates:
516
+ if path.is_file() and not path.is_symlink():
517
+ key = path.relative_to(home).as_posix()
518
+ try:
519
+ files[key] = _view(path)
520
+ except (OSError, ValueError, sqlite3.Error, RecursionError) as error:
521
+ files[key] = {"format": None, "view": None, "error": str(error)}
522
+ return files
523
+
524
+
525
+ @computer_app(supports=[{"os": {"type": "linux", "display": ["x11"]}, "arch": ["amd64", "arm64"]}])
526
+ @linux(
527
+ packages=Packages(apt=["inkscape"]),
528
+ launch=Launch(at="boot", command=["sh", "-c", "exec 'inkscape' \"$HOME\"/'Documents/poster.svg'"], window={"class": "Inkscape"}, ready=Ready(window=True)),
529
+ paths=PATHS,
530
+ skill="SKILL.md",
531
+ )
532
+ class Inkscape(ComputerAppEnvironment):
533
+ """Inkscape, launched at boot with the captured state in its home.
534
+
535
+ Declaring data hooks switches off agentenv's default data plane, so these call its helpers: the seed is kept as
536
+ the initial state, reset restores it, add writes files under PATHS, and get returns those files plus a typed JSON
537
+ view of each.
538
+ """
539
+
540
+ def __init__(self) -> None:
541
+ super().__init__()
542
+ if not INITIAL.exists():
543
+ _seed_home(Path.home())
544
+ _load_dconf(Path.home())
545
+ keep_initial(self.paths)
546
+
547
+ @add_data
548
+ async def add_files(self, parts: list) -> None:
549
+ await add(parts, self.paths)
550
+
551
+ @get_data
552
+ async def get_files(self, write_namespace=None) -> list:
553
+ files = await get(self.paths, write_namespace)
554
+ views = await in_thread(_views, Path.home(), self.paths)
555
+ return [*files, DataPart(data={"state": views})]
556
+
557
+ @reset_data
558
+ async def reset_files(self) -> None:
559
+ await reset(self.paths)
560
+
561
+ @ready_check
562
+ def main_window_shown(self) -> bool:
563
+ """A window of the app's class that the taskbar lists is shown, not only a splash screen or a dialog."""
564
+ return _taskbar_window(WINDOW_CLASS)
bundle/envs/inkscape/seed/.config/inkscape/extension-errors.log ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Extension "XFIG Input" failed to load because a dependency was not met.
2
+ Dependency:
3
+ type: executable
4
+ location: path
5
+ string: fig2dev
6
+
7
+ Extension "Export to PDF via Scribus" failed to load because a dependency was not met.
8
+ Dependency:
9
+ type: executable
10
+ location: path
11
+ string: scribus
12
+
13
+ Extension "GIMP XCF" failed to load because a dependency was not met.
14
+ Dependency:
15
+ type: executable
16
+ location: path
17
+ string: gimp
18
+
19
+ Extension "Formula (pdflatex)" failed to load because a dependency was not met.
20
+ Dependency:
21
+ type: executable
22
+ location: path
23
+ string: pdflatex
24
+
25
+ Extension "PostScript Input" failed to load because a dependency was not met.
26
+ Dependency:
27
+ type: executable
28
+ location: path
29
+ string: ps2pdf
30
+
31
+ Extension "Optimized PNG" failed to load because a dependency was not met.
32
+ Dependency:
33
+ type: executable
34
+ location: path
35
+ string: optipng
36
+
37
+ Extension "EPS Input" failed to load because a dependency was not met.
38
+ Dependency:
39
+ type: executable
40
+ location: path
41
+ string: ps2pdf
42
+
bundle/envs/inkscape/seed/.config/inkscape/preferences.xml ADDED
@@ -0,0 +1,493 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <inkscape version="1"
3
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
4
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
5
+ <group id="window">
6
+ <group id="menu" state="1"/>
7
+ <group id="commands" state="1"/>
8
+ <group id="snaptoolbox" state="1"/>
9
+ <group id="toppanel" state="1"/>
10
+ <group id="toolbox" state="1"/>
11
+ <group id="statusbar" state="1"/>
12
+ <group id="panels" state="1"/>
13
+ <group id="rulers" state="1"/>
14
+ <group id="scrollbars" state="1"/>
15
+ </group>
16
+ <group id="fullscreen">
17
+ <group id="menu" state="1"/>
18
+ <group id="commands" state="1"/>
19
+ <group id="snaptoolbox" state="1"/>
20
+ <group id="toppanel" state="1"/>
21
+ <group id="toolbox" state="1"/>
22
+ <group id="statusbar" state="1"/>
23
+ <group id="panels" state="1"/>
24
+ <group id="rulers" state="1"/>
25
+ <group id="scrollbars" state="1"/>
26
+ </group>
27
+ <group id="focus">
28
+ <group id="menu" state="0"/>
29
+ <group id="commands" state="0"/>
30
+ <group id="snaptoolbox" state="0"/>
31
+ <group id="toppanel" state="0"/>
32
+ <group id="toolbox" state="0"/>
33
+ <group id="statusbar" state="0"/>
34
+ <group id="panels" state="0"/>
35
+ <group id="rulers" state="0"/>
36
+ <group id="scrollbars" state="0"/>
37
+ </group>
38
+
39
+ <group id="template">
40
+ <sodipodi:namedview
41
+ id="base"
42
+ pagecolor="#ffffff"
43
+ pageopacity="0.0"
44
+ pagecheckerboard="0"
45
+ bordercolor="#000000"
46
+ borderopacity="0.25"
47
+ objecttolerance="10.0"
48
+ gridtolerance="10.0"
49
+ guidetolerance="10.0"
50
+ pageshadow="2" />
51
+ </group>
52
+
53
+ <group id="tools" bounding_box="0">
54
+
55
+ <group id="shapes" style="fill-rule:evenodd;" selcue="1" gradientdrag="1">
56
+ <eventcontext id="rect" style="fill:blue;" usecurrent="1"/>
57
+ <eventcontext id="3dbox" style="stroke:none;stroke-linejoin:round;" usecurrent="1">
58
+ <side id="XYfront" style="fill:#8686bf;stroke:none;stroke-linejoin:round;" usecurrent="0"/>
59
+ <side id="XYrear" style="fill:#e9e9ff;stroke:none;stroke-linejoin:round;" usecurrent="0"/>
60
+ <side id="XZtop" style="fill:#4d4d9f;stroke:none;stroke-linejoin:round;" usecurrent="0"/>
61
+ <side id="XZbottom" style="fill:#afafde;stroke:none;stroke-linejoin:round;" usecurrent="0"/>
62
+ <side id="YZright" style="fill:#353564;stroke:none;stroke-linejoin:round;" usecurrent="0"/>
63
+ <side id="YZleft" style="fill:#d7d7ff;stroke:none;stroke-linejoin:round;" usecurrent="0"/>
64
+ </eventcontext>
65
+ <eventcontext id="arc" style="fill:red;" end="0" start="0" usecurrent="1"/>
66
+ <eventcontext id="star" magnitude="5" style="fill:yellow;" usecurrent="1"/>
67
+ <eventcontext id="spiral" style="fill:none;stroke:black" expansion="1" usecurrent="0"/>
68
+ </group>
69
+
70
+ <group id="freehand"
71
+ style="fill:none;stroke:black;stroke-opacity:1;stroke-linejoin:miter;stroke-linecap:butt;">
72
+ <eventcontext id="pencil" tolerance="15.0" selcue="1" style="stroke-width:1px;" usecurrent="1" average_all_sketches="1"/>
73
+ <eventcontext id="pen" mode="drag" selcue="1" style="stroke-width:1px;" usecurrent="1"/>
74
+ </group>
75
+
76
+ <eventcontext id="calligraphic" style="fill:black;fill-opacity:1;fill-rule:nonzero;stroke:none;"
77
+ mass="2" angle="30" width="15.118" thinning="10" flatness="-90" cap_rounding="0.0" usecurrent="1"
78
+ tracebackground="0" usepressure="1" usetilt="0" keep_selected="1" abs_width="1" unit="mm">
79
+
80
+ <group id="preset">
81
+ <group id="cp0" name="Dip pen" mass="2" wiggle="0.0" angle="30.0" thinning="10" tremor="0.0" flatness="-90" cap_rounding="0.0" tracebackground="0" usepressure="1" usetilt="1" />
82
+ <group id="cp1" name="Marker" mass="2" wiggle="0.0" angle="90.0" thinning="0.0" tremor="0.0" flatness="0.0" cap_rounding="1.0" tracebackground="0" usepressure="0" usetilt="0" />
83
+ <group id="cp2" name="Brush" mass="2" wiggle="25" angle="45.0" thinning="-40" tremor="0.0" flatness="16" cap_rounding=".1" tracebackground="0" usepressure="1" usetilt="1" />
84
+ <group id="cp3" name="Wiggly" usetilt="1" tracebackground="0" usepressure="1" cap_rounding="0.1" flatness="16" tremor="18" thinning="-30" angle="30" wiggle="50" mass="0" />
85
+ <group id="cp4" name="Splotch" width="100" usetilt="1" tracebackground="0" usepressure="0" cap_rounding="1" flatness="0" tremor="10" thinning="30" angle="30" wiggle="0" mass="0" />
86
+ <group id="cp5" name="Tracing" width="50" mass="0" wiggle="0.0" angle="0.0" thinning="0.0" tremor="0.0" flatness="0" cap_rounding="0.0" tracebackground="1" usepressure="1" usetilt="1"/>
87
+ </group>
88
+ </eventcontext>
89
+
90
+ <eventcontext id="eraser" mode="1" style="fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none;"
91
+ mass="3.00" drag="1" angle="30" width="10" thinning="0.1" flatness="0.0" cap_rounding="1.4" usecurrent="0"
92
+ tracebackground="0" usepressure="1" usetilt="0" selcue="1">
93
+ </eventcontext>
94
+
95
+ <eventcontext id="lpetool" mode="drag" style="fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none;">
96
+ </eventcontext>
97
+
98
+ <eventcontext id="text" usecurrent="1" gradientdrag="1"
99
+ font_sample="AaBbCcIiPpQq12369$€¢?.;/()"
100
+ show_sample_in_list="1" use_svg2="1"
101
+ style="fill:black;fill-opacity:1;line-height:1.25;stroke:none;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:40px;" selcue="1"/>
102
+
103
+ <eventcontext id="nodes" selcue="1" gradientdrag="1"
104
+ pathflash_enabled="1" pathflash_unselected="0" pathflash_timeout="500" show_handles="1" show_outline="0"
105
+ sculpting_profile="1" single_node_transform_handles="0" show_transform_handles="0" live_outline="1" live_objects="1" show_helperpath="0" x="0" y="0" edit_clipping_paths="0" edit_masks="0" />
106
+ <eventcontext id="marker" selcue="1" gradientdrag="1" />
107
+ <eventcontext id="tweak" selcue="0" gradientdrag="0" show_handles="0" width="0.2" force="0.2" fidelity="0.5" usepressure="1" style="fill:red;stroke:none;" usecurrent="1"/>
108
+ <eventcontext id="spray" selcue="1" gradientdrag="0" usepressure="1" width="15" population="70" mode="1" rotation_variation="0" scale_variation="0" standard_deviation="70" mean="0"/>
109
+ <eventcontext id="gradient" selcue="1"/>
110
+ <eventcontext id="mesh" selcue="1"/>
111
+ <eventcontext id="zoom" selcue="1" gradientdrag="0"/>
112
+ <eventcontext id="dropper" selcue="1" gradientdrag="1" pick="1" setalpha="1"/>
113
+ <eventcontext id="select" selcue="1" gradientdrag="0"/>
114
+ <eventcontext id="connector" style="fill:none;fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-linejoin:miter;stroke-width:1px;stroke-linecap:butt;" selcue="1"/>
115
+ <eventcontext id="paintbucket" style="fill:#a0a0a0;stroke:none;" usecurrent="1"/>
116
+ <group
117
+ id="geometric"
118
+ mode="drag" />
119
+ </group>
120
+
121
+ <group id="palette">
122
+ <group id="dashes">
123
+ <dash id="solid" style="stroke-dasharray:none"/>
124
+ <dash id="dash-1-1" style="stroke-dasharray:1,1"/>
125
+ <dash id="dash-1-2" style="stroke-dasharray:1,2"/>
126
+ <dash id="dash-1-3" style="stroke-dasharray:1,3"/>
127
+ <dash id="dash-1-4" style="stroke-dasharray:1,4"/>
128
+ <dash id="dash-1-6" style="stroke-dasharray:1,6"/>
129
+ <dash id="dash-1-8" style="stroke-dasharray:1,8"/>
130
+ <dash id="dash-1-12" style="stroke-dasharray:1,12"/>
131
+ <dash id="dash-1-24" style="stroke-dasharray:1,24"/>
132
+ <dash id="dash-1-48" style="stroke-dasharray:1,48"/>
133
+ <dash id="dash-empty" style="stroke-dasharray:0 11"/>
134
+ <dash id="dash-2-1" style="stroke-dasharray:2,1"/>
135
+ <dash id="dash-3-1" style="stroke-dasharray:3,1"/>
136
+ <dash id="dash-4-1" style="stroke-dasharray:4,1"/>
137
+ <dash id="dash-6-1" style="stroke-dasharray:6,1"/>
138
+ <dash id="dash-8-1" style="stroke-dasharray:8,1"/>
139
+ <dash id="dash-12-1" style="stroke-dasharray:12,1"/>
140
+ <dash id="dash-24-1" style="stroke-dasharray:24,1"/>
141
+ <dash id="dash-2-2" style="stroke-dasharray:2,2"/>
142
+ <dash id="dash-3-3" style="stroke-dasharray:3,3"/>
143
+ <dash id="dash-4-4" style="stroke-dasharray:4,4"/>
144
+ <dash id="dash-6-6" style="stroke-dasharray:6,6"/>
145
+ <dash id="dash-8-8" style="stroke-dasharray:8,8"/>
146
+ <dash id="dash-12-12" style="stroke-dasharray:12,12"/>
147
+ <dash id="dash-24-24" style="stroke-dasharray:24,24"/>
148
+ <dash id="dash-2-4" style="stroke-dasharray:2,4"/>
149
+ <dash id="dash-4-2" style="stroke-dasharray:4,2"/>
150
+ <dash id="dash-2-6" style="stroke-dasharray:2,6"/>
151
+ <dash id="dash-6-2" style="stroke-dasharray:6,2"/>
152
+ <dash id="dash-4-8" style="stroke-dasharray:4,8"/>
153
+ <dash id="dash-8-4" style="stroke-dasharray:8,4"/>
154
+ <dash id="dash-2-1-012-1" style="stroke-dasharray:2,1,0.5,1"/>
155
+ <dash id="dash-4-2-1-2" style="stroke-dasharray:4,2,1,2"/>
156
+ <dash id="dash-8-2-1-2" style="stroke-dasharray:8,2,1,2"/>
157
+ <dash id="dash-012-012" style="stroke-dasharray:0.5,0.5"/>
158
+ <dash id="dash-014-014" style="stroke-dasharray:0.25,0.25"/>
159
+ <dash id="dash-0110-0110" style="stroke-dasharray:0.1,0.1"/>
160
+ </group>
161
+ </group>
162
+
163
+ <group id="colorselector" page="0" switcher="1" />
164
+
165
+ <group id="embedded">
166
+ <group id="swatches"
167
+ panel_size="1"
168
+ panel_mode="1"
169
+ panel_ratio="100"
170
+ panel_wrap="0"
171
+ palette="Inkscape default" />
172
+ </group>
173
+
174
+ <group id="dialogs">
175
+ <group id="toolbox"/>
176
+ <group id="fillstroke"/>
177
+ <group id="filtereffects"/>
178
+ <group id="textandfont"/>
179
+ <group id="transformation" applyseparately="0"/>
180
+ <group id="align"/>
181
+ <group id="xml" h="500" w="300" />
182
+ <group id="find"/>
183
+ <group id="spellcheck" w="200" h="250" ignorenumbers="1"/>
184
+ <group id="documentoptions" state="1"/>
185
+ <group id="preferences" state="1"/>
186
+ <group id="gradienteditor"/>
187
+ <group id="object"/>
188
+ <group id="export" default="" append_extension="1" path="">
189
+ <group id="exportarea"/>
190
+ <group id="defaultxdpi"/>
191
+ </group>
192
+ <group id="save_as" default="" append_extension="1" enable_preview="1" path="" use_current_dir="1"/>
193
+ <group id="save_copy" default="" append_extension="1" enable_preview="1" path=""/>
194
+ <group id="open" enable_preview="1" path=""/>
195
+ <group id="import" enable_preview="1" path="" ask="1" ask_svg="1" link="link" scale="optimizeSpeed"/>
196
+ <group id="debug" redirect="0"/>
197
+ <group id="clonetiler" dotrace="0" />
198
+ <group id="gridtiler" />
199
+ <group id="extension-error" show-on-startup="0"/>
200
+ <group id="memory" />
201
+ <group id="messages" />
202
+ <group id="swatches" />
203
+ <group id="iconpreview" />
204
+ <group id="aboutextensions" />
205
+ <group id="treeeditor" />
206
+ <group id="layers" maxDepth="20" w="200" h="300" />
207
+ <group id="trace" state="1" />
208
+ <group id="script" />
209
+ <group id="input" />
210
+ <group id="colorpickerwindow" />
211
+ <group id="undo-history" />
212
+ </group>
213
+ <group id="printing">
214
+ <settings id="ps"/>
215
+ <group id="debug" add-label-comments="0"/>
216
+ </group>
217
+
218
+ <group id="options"
219
+ rotationlock="1">
220
+ <group id="renderingcache" size="512" />
221
+ <group id="useoldpdfexporter" value="0" />
222
+ <group id="highlightoriginal" value="1" />
223
+ <group id="relinkclonesonduplicate" value="0" />
224
+ <group id="mapalt" value="1" />
225
+ <group id="trackalt" value="0" />
226
+ <group id="switchonextinput" value="0" />
227
+ <group id="useextinput" value="1" />
228
+ <group id="nudgedistance" value="2px"/>
229
+ <group id="rotationsnapsperpi" value="12"/>
230
+ <group id="cursortolerance" value="8.0"/>
231
+ <group id="dragtolerance" value="4.0"/>
232
+ <group id="grabsize" value="4"/>
233
+ <group
234
+ id="displayprofile"
235
+ enable="0"
236
+ from_display="0"
237
+ intent="0"
238
+ uri="" />
239
+ <group
240
+ id="softproof"
241
+ enable="0"
242
+ intent="0"
243
+ gamutcolor="#808080"
244
+ gamutwarn="0"
245
+ bpc="0"
246
+ preserveblack="0"
247
+ uri="" />
248
+ <group id="savewindowgeometry" value="1"/>
249
+ <group id="defaultoffsetwidth" value="2px"/>
250
+ <group id="defaultscale" value="2px"/>
251
+ <group id="maxrecentdocuments" value="36"/>
252
+ <group id="zoomincrement" value="1.414213562"/>
253
+ <group id="zoomcorrection" value="1.0" unit="mm"/>
254
+ <group id="keyscroll" value="15"/>
255
+ <group id="wheelscroll" value="40"/>
256
+ <group id="spacebarpans" value="1"/>
257
+ <group id="transientpolicy" value="1"/>
258
+ <group id="scrollingacceleration" value="0.4"/>
259
+ <group id="snapdelay" value="0"/>
260
+ <group id="snapweight" value="0.5"/>
261
+ <group id="snapclosestonly" value="0"/>
262
+ <group id="snapindicator" value="1"/>
263
+ <group id="autoscrollspeed" value="0.7"/>
264
+ <group id="autoscrolldistance" value="-10"/>
265
+ <group id="simplifythreshold" value="0.002"/>
266
+ <group id="bitmapeditor" value="gimp"/>
267
+ <group id="svgeditor" value="inkscape"/>
268
+ <group id="bitmapautoreload" value="1"/>
269
+ <group id="dialogtype" value="1"/>
270
+ <group id="dialogsskiptaskbar" value="1"/>
271
+ <group id="defaultwindowsize" value="2" />
272
+ <group id="arenatilescachesize" value="8192"/>
273
+ <group id="preservetransform" value="0"/>
274
+ <group id="clonecompensation" value="1"/>
275
+ <group id="cloneorphans" value="0"/>
276
+ <group id="stickyzoom" value="0"/>
277
+ <group id="selcue" value="2"/>
278
+ <group id="transform" stroke="1" rectcorners="1" pattern="1" gradient="1" />
279
+ <group id="dash" scale="1" />
280
+ <group id="kbselection" inlayer="1" onlyvisible="1" onlysensitive="1" />
281
+ <group id="selection" layerdeselect="1" />
282
+ <group id="createbitmap"/>
283
+ <group id="compassangledisplay" value="0"/>
284
+ <group id="middlemousezoom" value="1"/>
285
+ <group id="maskobject" topmost="1" remove="1"/>
286
+ <group id="blurquality" value="0"/>
287
+ <group id="filterquality" value="1"/>
288
+ <group id="showfiltersinfobox" value="1" />
289
+ <group id="startmode" outline="0"/>
290
+ <group id="outlinemode" value="0"/>
291
+
292
+ <group id="wireframecolors"
293
+ onlight="255"
294
+ ondark="4294967295"
295
+ images="4278190335"
296
+ clips="16711935"
297
+ masks="65535"/>
298
+ <group id="svgoutput"
299
+ disable_optimizations="0"
300
+ usenamedcolors="0"
301
+ numericprecision="8"
302
+ minimumexponent="-8"
303
+ inlineattrs="0"
304
+ indent="2"
305
+ pathstring_format="2"
306
+ forcerepeatcommands="0"
307
+ incorrect_attributes_warn="1"
308
+ incorrect_attributes_remove="0"
309
+ incorrect_style_properties_warn="1"
310
+ incorrect_style_properties_remove="0"
311
+ style_defaults_warn="1"
312
+ style_defaults_remove="0"
313
+ check_on_reading="0"
314
+ check_on_editing="0"
315
+ check_on_writing="0"
316
+ sort_attributes="0"/>
317
+ <group id="externalresources">
318
+ <group id="xml"
319
+ allow_net_access="0"/>
320
+ </group>
321
+ <group id="forkgradientvectors" value="1"/>
322
+ <group id="iconrender" named_nodelay="0"/>
323
+ <group id="autosave" enable="1" interval="10" path="" max="50"/>
324
+ <group id="grids"
325
+ no_emphasize_when_zoomedout="0">
326
+ <group id="xy"
327
+ units="px"
328
+ origin_x="0.0"
329
+ origin_y="0.0"
330
+ spacing_x="1.0"
331
+ spacing_y="1.0"
332
+ empspacing="5"
333
+ dotted="0"/>
334
+ <group id="axonom"
335
+ units="mm"
336
+ origin_x="0.0"
337
+ origin_y="0.0"
338
+ spacing_y="1.0"
339
+ angle_x="30.0"
340
+ angle_z="30.0"
341
+ empspacing="5"/>
342
+ </group>
343
+ <group id="workarounds"
344
+ colorsontop="0"
345
+ partialdynamic="0"/>
346
+ <group
347
+ id="font"
348
+ unitType="2" />
349
+ <group
350
+ id="boot"
351
+ theme="colorful" />
352
+ </group>
353
+
354
+ <group
355
+ id="extensions"
356
+ org.inkscape.output.png.inkscape.png_bitdepth="99"
357
+ org.inkscape.output.png.inkscape.png_compression="6"
358
+ org.inkscape.output.png.inkscape.png_antialias="2" />
359
+
360
+ <group id="desktop"
361
+ style="fill:#000000">
362
+ <group
363
+ width="640"
364
+ height="480"
365
+ x="0"
366
+ y="0"
367
+ maximized="1"
368
+ fullscreen="0"
369
+ id="geometry" />
370
+ <group
371
+ id="XYfront" />
372
+ <group
373
+ id="XYrear" />
374
+ <group
375
+ id="XZtop" />
376
+ <group
377
+ id="XZbottom" />
378
+ <group
379
+ id="YZleft" />
380
+ <group
381
+ id="YZright" />
382
+ </group>
383
+
384
+ <group id="devices">
385
+ </group>
386
+
387
+ <group
388
+ id="toolbox"
389
+ icononly="1"
390
+ secondary="1"
391
+ simplesnap="1"
392
+ small="1">
393
+ <group
394
+ id="tools"
395
+ icononly="1"
396
+ small="0"
397
+ iconsize="16">
398
+ <group
399
+ id="buttons" />
400
+ </group>
401
+ <group
402
+ id="controlbars"
403
+ iconsize="16" />
404
+ </group>
405
+
406
+ <group
407
+ id="statusbar">
408
+ <group
409
+ id="visibility" />
410
+ </group>
411
+
412
+ <group
413
+ id="iconpreview"
414
+ autoRefresh="1"
415
+ pack="1"
416
+ selectionHold="1"
417
+ showFrames="1"
418
+ selectionOnly="0">
419
+ <group
420
+ id="sizes">
421
+ <group
422
+ id="default">
423
+ <group
424
+ value="16"
425
+ show="1"
426
+ id="size16" />
427
+ <group
428
+ value="22"
429
+ show="0"
430
+ id="size22" />
431
+ <group
432
+ value="24"
433
+ show="1"
434
+ id="size24" />
435
+ <group
436
+ value="32"
437
+ show="1"
438
+ id="size32" />
439
+ <group
440
+ value="48"
441
+ show="1"
442
+ id="size48" />
443
+ <group
444
+ value="50"
445
+ show="0"
446
+ id="size50" />
447
+ <group
448
+ value="64"
449
+ show="0"
450
+ id="size64" />
451
+ <group
452
+ value="72"
453
+ show="0"
454
+ id="size72" />
455
+ <group
456
+ value="80"
457
+ show="0"
458
+ id="size80" />
459
+ <group
460
+ value="96"
461
+ show="0"
462
+ id="size96" />
463
+ <group
464
+ value="128"
465
+ show="1"
466
+ id="size128" />
467
+ <group
468
+ value="256"
469
+ show="0"
470
+ id="size256" />
471
+ </group>
472
+ </group>
473
+ </group>
474
+ <group id="debug">
475
+ <group id="latency" skew="1"/>
476
+ </group>
477
+ <group id="ui"
478
+ language=""/>
479
+ <group
480
+ id="live_effects"
481
+ flattening="0" />
482
+ <group
483
+ id="theme"
484
+ defaultPreferDarkTheme="1"
485
+ defaultIconTheme="multicolor"
486
+ defaultGtkTheme="Adwaita"
487
+ narrowSpinButton="1"
488
+ preferDarkTheme="1"
489
+ darkTheme="1"
490
+ symbolicIcons="1"
491
+ symbolicDefaultBaseColors="1"
492
+ symbolicDefaultHighColors="0"/>
493
+ </inkscape>
bundle/envs/inkscape/seed/Documents/poster.svg ADDED
bundle/evals/inkscape.toml ADDED
@@ -0,0 +1 @@
 
 
1
+ tasks = ["summer-headline"]
bundle/tasks/smoke.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "env",
4
+ "type": "deploy_env",
5
+ "env_id": "inkscape"
6
+ }
7
+ ]
bundle/tasks/summer-headline.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {"id":"env","type":"deploy_env","env_id":"inkscape"},
3
+ {"id":"agent","type":"deploy_agent","env_ids":["inkscape"]},
4
+ {"id":"skills","type":"add_skills","env_ids":["inkscape"]},
5
+ {"id":"record","type":"start_computer_recording","env_id":"inkscape","name":"agent","depends_on":["env"]},
6
+ {"id":"task","type":"prompt_agent","depends_on":["skills","record"],"prompt":"In the bake sale poster open in Inkscape, change the headline from \"Spring Bake Sale\" to \"Summer Bake Sale\", then save the poster."},
7
+ {"id":"check","type":"env_outcome_verifier","env_id":"inkscape","file_artifact_id":"summer-headline-check","verifier_id":"summer-headline","depends_on":["task"]},
8
+ {"id":"end","type":"end_computer_recording","name":"agent","depends_on":["task"]}
9
+ ]
media/hero.gif ADDED

Git LFS Details

  • SHA256: 42ce18f307ab99dd9bddc772fa2193be56e71edb0c8d6a0d792827a72ce56233
  • Pointer size: 131 Bytes
  • Size of remote file: 290 kB
media/solve-1.gif ADDED

Git LFS Details

  • SHA256: 80f1865ef53456db4553717e36793a8e0ad7d503fd791eac9fc418025008230d
  • Pointer size: 131 Bytes
  • Size of remote file: 389 kB
media/solve-1.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:65d012b653dd6ce0d0ae1fabe8cb53162859de48755e28ff265aaea8e7b4e9d1
3
+ size 620423
media/solve-2.gif ADDED

Git LFS Details

  • SHA256: b8e056fd7bad7c61df20683271c2e600f16765df29a4cd3d70958fd2167c226e
  • Pointer size: 131 Bytes
  • Size of remote file: 382 kB
media/solve-2.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b6ba5e61038e9a948f88c803e72c5effff0e90cb7338fb6f1ab2e5be5c3792a
3
+ size 618904
media/solve-3.gif ADDED

Git LFS Details

  • SHA256: 387034493c361ff0880924918ffe0ec6da2f47eac7170d95408a2b948682c84d
  • Pointer size: 131 Bytes
  • Size of remote file: 382 kB
media/solve-3.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b54474c2cfa14016d5b67ab5bb4a318c49ef289dc2e8979dc5551f3676e05ae3
3
+ size 618303
media/witness.gif ADDED

Git LFS Details

  • SHA256: 375641b25a3d44865186b935744b8005b5e940339b81fac255d4615a2e55ac26
  • Pointer size: 131 Bytes
  • Size of remote file: 863 kB
media/witness.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:32539dc55d012f3c00308e09e3f5576a4a5245e97874fce5323a6b49503275e1
3
+ size 464272
results.json ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "environment": "Inkscape",
3
+ "app_version": "Inkscape 1.2 vector graphics editor",
4
+ "task": "summer-headline",
5
+ "prompt": "In the bake sale poster open in Inkscape, change the headline from \"Spring Bake Sale\" to \"Summer Bake Sale\", then save the poster.",
6
+ "agent": "claude-code",
7
+ "model": "claude-sonnet-5-5",
8
+ "agentenv_framework": "0.9.1431",
9
+ "witness": "verifier failed on the seed, passed after a scripted edit through computer actions, failed again after data/reset",
10
+ "runs": [
11
+ {
12
+ "run": 1,
13
+ "verdict": "passed",
14
+ "turns": 10,
15
+ "usd": 0.66,
16
+ "checks": {
17
+ "summer-headline": {
18
+ "score": 1.0,
19
+ "results": [
20
+ {
21
+ "id": "headline",
22
+ "result": true,
23
+ "description": "Documents/poster.svg at /root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=headline]/children/[name=tspan]/children/0 is \"Summer Bake Sale\""
24
+ },
25
+ {
26
+ "id": "price-kept",
27
+ "result": true,
28
+ "description": "Documents/poster.svg at /root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=price]/children/[name=tspan]/children/0 is \"All cakes $2\""
29
+ },
30
+ {
31
+ "id": "date-kept",
32
+ "result": true,
33
+ "description": "Documents/poster.svg at /root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=date]/children/[name=tspan]/children/0 is \"Saturday 14 March, 10am\""
34
+ }
35
+ ]
36
+ }
37
+ }
38
+ },
39
+ {
40
+ "run": 2,
41
+ "verdict": "passed",
42
+ "turns": 10,
43
+ "usd": 0.41,
44
+ "checks": {
45
+ "summer-headline": {
46
+ "score": 1.0,
47
+ "results": [
48
+ {
49
+ "id": "headline",
50
+ "result": true,
51
+ "description": "Documents/poster.svg at /root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=headline]/children/[name=tspan]/children/0 is \"Summer Bake Sale\""
52
+ },
53
+ {
54
+ "id": "price-kept",
55
+ "result": true,
56
+ "description": "Documents/poster.svg at /root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=price]/children/[name=tspan]/children/0 is \"All cakes $2\""
57
+ },
58
+ {
59
+ "id": "date-kept",
60
+ "result": true,
61
+ "description": "Documents/poster.svg at /root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=date]/children/[name=tspan]/children/0 is \"Saturday 14 March, 10am\""
62
+ }
63
+ ]
64
+ }
65
+ }
66
+ },
67
+ {
68
+ "run": 3,
69
+ "verdict": "passed",
70
+ "turns": 10,
71
+ "usd": 0.17,
72
+ "checks": {
73
+ "summer-headline": {
74
+ "score": 1.0,
75
+ "results": [
76
+ {
77
+ "id": "headline",
78
+ "result": true,
79
+ "description": "Documents/poster.svg at /root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=headline]/children/[name=tspan]/children/0 is \"Summer Bake Sale\""
80
+ },
81
+ {
82
+ "id": "price-kept",
83
+ "result": true,
84
+ "description": "Documents/poster.svg at /root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=price]/children/[name=tspan]/children/0 is \"All cakes $2\""
85
+ },
86
+ {
87
+ "id": "date-kept",
88
+ "result": true,
89
+ "description": "Documents/poster.svg at /root/children/[name=g][@inkscape:label=Layer 1]/children/[name=text][@id=date]/children/[name=tspan]/children/0 is \"Saturday 14 March, 10am\""
90
+ }
91
+ ]
92
+ }
93
+ }
94
+ }
95
+ ]
96
+ }