repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

pi: new skills

0e3bae3ceeb04d3869bf0db4263ec6d2d39edd25

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Changed files (38)

bootstripper.java

Modified
168 168 static void install_filter(Path root) throws Throwable {
169 - var key = key_argument(root);
170 - var aes = aes_tool_argument(root);
169 + var key = quote_shell(key_argument(root));
170 + var aes = quote_shell(aes_tool_argument(root));
171 171 run(root, List.of("git", "config", "--local", "filter." + filter_name + ".clean",
172 172 "java " + aes + " encrypt --key-file " + key), null, false);
173 173 run(root, List.of("git", "config", "--local", "filter." + filter_name + ".smudge",
175 175 run(root, List.of("git", "config", "--local", "filter." + filter_name + ".required", "true"), null, false);
178 + static String quote_shell(String argument) {
179 + return "'" + argument.replace("'", "'\\''") + "'";
178 182 static void write_attributes(Path root, List<String> secrets) throws Throwable {
179 183 var attributes = git_common_path(root, "info/attributes");
180 184 Files.createDirectories(attributes.getParent());
298 302 if (!secrets.isEmpty()) {
299 303 check_filter(root);
300 304 check_attributes(root, secrets);
305 + check_worktree_secrets_decrypted(root, secrets);
301 306 check_key_not_tracked(root);
302 307 check_staged_secrets(root, secrets);
323 328 static void check_filter(Path root) throws Throwable {
324 - var key = key_argument(root);
325 - var aes = aes_tool_argument(root);
329 + var key = quote_shell(key_argument(root));
330 + var aes = quote_shell(aes_tool_argument(root));
326 331 var clean = run(root, List.of("git", "config", "--local", "--get", "filter." + filter_name + ".clean"), null, false).text().strip();
327 332 var smudge = run(root, List.of("git", "config", "--local", "--get", "filter." + filter_name + ".smudge"), null, false).text().strip();
328 333 var required = run(root, List.of("git", "config", "--local", "--get", "filter." + filter_name + ".required"), null, false).text().strip();
354 + static void check_worktree_secrets_decrypted(Path root, List<String> secrets) throws Throwable {
355 + for (var secret : secrets) {
356 + var path = root.resolve(secret);
357 + if (Files.exists(path) && starts_with(Files.readAllBytes(path), aes_magic))
358 + throw fail("Worktree secret is encrypted; smudge failed: {0}", secret);
349 362 static void check_key_not_tracked(Path root) throws Throwable {
350 363 var bad = run(root, List.of("git", "ls-files", "--", ".git/" + key_file, key_file), null, false).text().strip();
351 364 if (!bad.isEmpty())

codex/config.toml

Modified
1 1 approval_policy = "never"
2 2 sandbox_mode = "danger-full-access"
3 3 permission_profile = "disabled"
4 -approvals_reviewer = "user"
5 4 service_tier = "fast"
6 5 project_doc_fallback_filenames = ["CLAUDE.md"]

docs/super/plans/2026-07-08-zed-nugu-theme-verification.md

Added
new file mode 100644
1 +# Zed Nugu Theme Verification Implementation Plan
3 +> **For agentic workers:** REQUIRED SUB-SKILL: Use /skill:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
5 +**Goal:** Verify and iterate `nugu/zed.nu` until Zed dark and light themes are semantically Nugu, schema-complete, pixel-verified, and text-legible.
7 +**Architecture:** Treat the official Zed theme schema as the complete list of themeable color slots, then verify live Zed screenshots cover each slot family. Use `zed.nu` as the sole source for Zed mappings and regenerate `zed/themes/nugu.json` through `just zed`; never edit generated JSON directly.
9 +**Tech Stack:** Nushell, `just`, Zed CLI, Windows PowerShell driving through `win32-drive.ps1`, ImageMagick `magick`, `pastel`, Node one-off audit scripts.
11 +**Roadmap:** None
13 +**Phase:** Single-plan implementation
15 +---
17 +## File Map
19 +- Modify: `nugu/zed.nu` — semantic mapping from Nugu palette roles to Zed theme keys.
20 +- Generated: `zed/themes/nugu.json` — created by `just zed`; do not hand-edit.
21 +- Generated evidence: `nugu/output/zed/*.json`, `nugu/output/zed-ui-*.png`, `nugu/output/zed-ui-contact-sheet.png` — rebuildable evidence.
22 +- Temporary only: `%TEMP%/zed-post-*.ps1`, `%TEMP%/zed-schema-audit.mjs`, `%TEMP%/zed-contrast-audit.mjs` — delete after use.
24 +## Task 1: Baseline build health
26 +**Files:**
28 +- Read: `nugu/zed.nu`
29 +- Generate: `nugu/output/zed/nugu.json`
30 +- Generate: `zed/themes/nugu.json`
32 +- [ ] **Step 1: Check git state before work**
34 +Run from `nugu/`:
36 +```bash
37 +git status --short
38 +```
40 +Expected: existing unrelated dirty files are visible and not touched. Known unrelated dirty entries may include `../zed/settings.json`, `../pi/...`, and current `zed.nu` / generated theme work.
42 +- [ ] **Step 2: Run lint**
44 +```bash
45 +just lint
46 +```
48 +Expected: all `nu-check` commands print `true`; command exits `0`.
50 +- [ ] **Step 3: Run base palette checks**
52 +```bash
53 +just check
54 +```
56 +Expected:
58 +```text
59 +WCAG AA: dark theme
60 + ✓ all colors pass
62 +WCAG AA: light theme
63 + ✓ all colors pass
64 +```
66 +- [ ] **Step 4: Regenerate the Zed theme**
68 +```bash
69 +just zed
70 +```
72 +Expected: command exits `0` and writes both:
74 +```text
75 +output/zed/nugu.json
76 +../zed/themes/nugu.json
77 +```
79 +## Task 2: Official Zed schema coverage
81 +**Files:**
83 +- Read: `output/zed/nugu.json`
84 +- Fetch: `https://zed.dev/schema/themes/v0.2.0.json`
85 +- Modify if needed: `zed.nu`
87 +- [ ] **Step 1: Run schema-key audit**
89 +Create `%TEMP%/zed-schema-audit.mjs` with this content:
91 +```javascript
92 +import fs from 'node:fs';
93 +import https from 'node:https';
95 +const get = (url) => new Promise((resolve, reject) => {
96 + https.get(url, (response) => {
97 + let body = '';
98 + response.setEncoding('utf8');
99 + response.on('data', (chunk) => body += chunk);
100 + response.on('end', () => resolve(body));
101 + }).on('error', reject);
102 +});
104 +const schema = JSON.parse(await get('https://zed.dev/schema/themes/v0.2.0.json'));
105 +const generated = JSON.parse(fs.readFileSync('output/zed/nugu.json', 'utf8'));
106 +const properties = schema.definitions.ThemeStyleContent.properties;
107 +const skip = new Set(['accents', 'background.appearance', 'players', 'syntax']);
108 +const schemaColorKeys = Object.entries(properties)
109 + .filter(([key, value]) => !skip.has(key) && JSON.stringify(value).includes('"string"'))
110 + .map(([key]) => key)
111 + .sort();
113 +let failed = false;
114 +for (const theme of generated.themes) {
115 + const keys = new Set(Object.keys(theme.style)
116 + .filter((key) => !skip.has(key) && key !== 'players' && key !== 'syntax'));
117 + const missing = schemaColorKeys.filter((key) => !keys.has(key));
118 + const extra = [...keys].filter((key) => !schemaColorKeys.includes(key)).sort();
119 + console.log(`${theme.name}: schema color keys=${schemaColorKeys.length} present=${keys.size} missing=${missing.length} extra=${extra.length}`);
120 + for (const key of missing) console.log(`missing ${key}`);
121 + for (const key of extra) console.log(`extra ${key}`);
122 + failed ||= missing.length > 0 || extra.length > 0;
124 +process.exit(failed ? 1 : 0);
125 +```
127 +Run:
129 +```bash
130 +node "$TEMP/zed-schema-audit.mjs"
131 +```
133 +Expected:
135 +```text
136 +Nugu Dark: schema color keys=138 present=138 missing=0 extra=0
137 +Nugu Light: schema color keys=138 present=138 missing=0 extra=0
138 +```
140 +- [ ] **Step 2: Fix missing keys semantically**
142 +If missing keys exist, edit `zed.nu` only. Map them by Nugu semantics:
144 +```text
145 +editor/document local focus -> content.focus or ui.accent with alpha
146 +panel structure -> ui.unfocus/ui.minor/ui.accent
147 +terminal background -> content.backdrop
148 +hidden/ignored -> content.minor/ui.unfocus with subdued alpha
149 +pane/group borders -> ui.unfocus or ui.accent for focus
150 +```
152 +Then rerun:
154 +```bash
155 +just zed
156 +node "$TEMP/zed-schema-audit.mjs"
157 +```
159 +Expected: no missing or extra schema color keys.
161 +## Task 3: Pastel legibility audit
163 +**Files:**
165 +- Read: `output/zed/nugu.json`
166 +- Modify if needed: `zed.nu`
168 +- [ ] **Step 1: Run focused contrast audit**
170 +Create `%TEMP%/zed-contrast-audit.mjs` with this content:
172 +```javascript
173 +import fs from 'node:fs';
174 +import { execFileSync } from 'node:child_process';
176 +const theme = JSON.parse(fs.readFileSync('output/zed/nugu.json', 'utf8'));
177 +const luminanceCache = new Map();
178 +const isHex = (color) => typeof color === 'string' && /^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$/.test(color);
179 +const rgb = (color) => [1, 3, 5].map((index) => parseInt(color.slice(index, index + 2), 16));
180 +const blend = (foreground, background) => {
181 + if (!isHex(foreground) || !isHex(background)) return foreground;
182 + const alpha = foreground.length === 9 ? parseInt(foreground.slice(7, 9), 16) / 255 : 1;
183 + const fg = rgb(foreground);
184 + const bg = rgb(background);
185 + return '#' + fg
186 + .map((value, index) => Math.round(value * alpha + bg[index] * (1 - alpha)).toString(16).padStart(2, '0'))
187 + .join('');
189 +const luminance = (color) => {
190 + color = color.slice(0, 7).toLowerCase();
191 + if (!luminanceCache.has(color)) {
192 + luminanceCache.set(color, Number(execFileSync('pastel', ['format', 'luminance', color], { encoding: 'utf8' }).trim()));
194 + return luminanceCache.get(color);
196 +const contrast = (foreground, background) => {
197 + const effectiveForeground = blend(foreground, background);
198 + const a = luminance(effectiveForeground);
199 + const b = luminance(background);
200 + return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
203 +let failed = false;
204 +for (const themeEntry of theme.themes) {
205 + const style = themeEntry.style;
206 + const uiBase = style['panel.background'];
207 + const editorBase = style['editor.background'];
208 + const terminalBase = style['terminal.background'];
209 + const checks = [];
211 + for (const foreground of ['text', 'text.muted', 'text.placeholder', 'text.disabled', 'text.accent', 'icon', 'icon.muted', 'icon.disabled', 'icon.placeholder', 'icon.accent']) {
212 + for (const background of ['background', 'surface.background', 'elevated_surface.background', 'panel.background', 'toolbar.background', 'tab_bar.background', 'status_bar.background']) {
213 + checks.push([foreground, style[foreground], background, style[background]]);
217 + for (const background of ['element.hover', 'element.active', 'element.selected', 'ghost_element.hover', 'ghost_element.active', 'ghost_element.selected']) {
218 + checks.push(['text', style.text, background, blend(style[background], uiBase)]);
221 + const editorBackgrounds = [
222 + ['editor', editorBase],
223 + ['editor.active_line', blend(style['editor.active_line.background'], editorBase)],
224 + ['editor.highlighted_line', blend(style['editor.highlighted_line.background'], editorBase)],
225 + ];
226 + const editorForegrounds = [
227 + ['editor.foreground', style['editor.foreground']],
228 + ['editor.line_number', style['editor.line_number']],
229 + ['editor.active_line_number', style['editor.active_line_number']],
230 + ...Object.entries(style.syntax).map(([key, value]) => [`syntax.${key}`, value.color]),
231 + ];
232 + for (const [foregroundName, foreground] of editorForegrounds) {
233 + for (const [backgroundName, background] of editorBackgrounds) {
234 + checks.push([foregroundName, foreground, backgroundName, background]);
238 + for (const [key, value] of Object.entries(style)) {
239 + const isTerminalText = ['terminal.foreground', 'terminal.bright_foreground', 'terminal.dim_foreground'].includes(key)
240 + || (key.startsWith('terminal.ansi.') && key !== 'terminal.ansi.background');
241 + if (isHex(value) && isTerminalText) checks.push([key, value, 'terminal', terminalBase]);
244 + const failures = [];
245 + let minimum = [999, '', '', '', ''];
246 + for (const [foregroundName, foreground, backgroundName, background] of checks) {
247 + if (!isHex(foreground) || !isHex(background)) continue;
248 + const ratio = contrast(foreground, background);
249 + if (ratio < minimum[0]) minimum = [ratio, foregroundName, foreground, backgroundName, background];
250 + if (ratio < 4.5) failures.push([ratio, foregroundName, foreground, backgroundName, background]);
253 + console.log(`${themeEntry.name}: checks=${checks.length} failures=${failures.length} min=${minimum[0].toFixed(2)} ${minimum[1]} ${minimum[2]} on ${minimum[3]} ${minimum[4]}`);
254 + for (const failure of failures) {
255 + console.log(`FAIL ${failure[0].toFixed(2)} ${failure[1]} ${failure[2]} on ${failure[3]} ${failure[4]}`);
257 + failed ||= failures.length > 0;
259 +process.exit(failed ? 1 : 0);
260 +```
262 +Run:
264 +```bash
265 +node "$TEMP/zed-contrast-audit.mjs"
266 +```
268 +Expected: both themes report `failures=0`; minimum ratio must be at least `4.50`.
270 +- [ ] **Step 2: Fix contrast failures semantically**
272 +If failures appear, edit `zed.nu` only. Prefer changing alpha or existing semantic role selection over adding custom color literals. Regenerate and rerun:
274 +```bash
275 +just zed
276 +node "$TEMP/zed-contrast-audit.mjs"
277 +```
279 +Expected: no focused text-placement contrast failures.
281 +## Task 4: Drive Zed dark and light UI state matrix
283 +**Files:**
285 +- Generate screenshots in `nugu/output/`
286 +- Do not modify user files from inside Zed.
288 +- [ ] **Step 1: Create direct-message helper scripts**
290 +Create three temporary PowerShell helpers in `%TEMP%`:
292 +`%TEMP%/zed-post-f1.ps1`:
294 +```powershell
295 +param([int64]$Hwnd)
296 +Add-Type -Namespace W -Name U -MemberDefinition @'
297 +[DllImport("user32.dll")] public static extern bool PostMessage(IntPtr hWnd, uint Msg, UIntPtr wParam, IntPtr lParam);
299 +$h=[IntPtr]$Hwnd; $wp=[UIntPtr]::new([uint64]0x70)
300 +[W.U]::PostMessage($h,0x0100,$wp,[IntPtr]0x003B0001)|Out-Null; Start-Sleep -Milliseconds 80; [W.U]::PostMessage($h,0x0101,$wp,[IntPtr]0xC03B0001)|Out-Null
301 +```
303 +`%TEMP%/zed-post-esc.ps1`:
305 +```powershell
306 +param([int64]$Hwnd)
307 +Add-Type -Namespace W -Name U -MemberDefinition @'
308 +[DllImport("user32.dll")] public static extern bool PostMessage(IntPtr hWnd, uint Msg, UIntPtr wParam, IntPtr lParam);
310 +$h=[IntPtr]$Hwnd; $wp=[UIntPtr]::new([uint64]0x1B)
311 +[W.U]::PostMessage($h,0x0100,$wp,[IntPtr]0x00010001)|Out-Null; Start-Sleep -Milliseconds 80; [W.U]::PostMessage($h,0x0101,$wp,[IntPtr]0xC0010001)|Out-Null
312 +```
314 +`%TEMP%/zed-post-text.ps1`:
316 +```powershell
317 +param([int64]$Hwnd, [string]$Text, [switch]$Enter)
318 +Add-Type -Namespace W -Name U -MemberDefinition @'
319 +[DllImport("user32.dll")] public static extern bool PostMessage(IntPtr hWnd, uint Msg, UIntPtr wParam, IntPtr lParam);
321 +$h=[IntPtr]$Hwnd
322 +foreach ($ch in $Text.ToCharArray()) { [W.U]::PostMessage($h,0x0102,[UIntPtr]::new([uint64][int][char]$ch),[IntPtr]1)|Out-Null; Start-Sleep -Milliseconds 15 }
323 +if ($Enter) { $wp=[UIntPtr]::new([uint64]0x0D); [W.U]::PostMessage($h,0x0100,$wp,[IntPtr]0x001C0001)|Out-Null; Start-Sleep -Milliseconds 80; [W.U]::PostMessage($h,0x0101,$wp,[IntPtr]0xC01C0001)|Out-Null }
324 +```
326 +- [ ] **Step 2: Open a disposable Zed verification window**
328 +```bash
329 +zed -n C:/Users/okr/Workspace/dotfiles/nugu/zed.nu >/tmp/zed-nugu-verification.log 2>&1 &
330 +sleep 3
331 +powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:/Users/okr/.pi/agent/skills/win32-drive/scripts/win32-drive.ps1 list
332 +```
334 +Expected: a Zed window with title containing `zed.nu` appears. Store its HWND in a shell variable for later commands.
336 +- [ ] **Step 3: Capture dark state matrix**
338 +For mode `dark`, capture these files:
340 +```text
341 +output/zed-ui-dark-editor-content.png
342 +output/zed-ui-dark-project.png
343 +output/zed-ui-dark-command-palette.png
344 +output/zed-ui-dark-file-finder.png
345 +output/zed-ui-dark-terminal.png
346 +output/zed-ui-dark-buffer-search.png
347 +output/zed-ui-dark-diagnostics.png
348 +output/zed-ui-dark-git-panel.png
349 +output/zed-ui-dark-outline-panel.png
350 +output/zed-ui-dark-theme-selector.png
351 +output/zed-ui-dark-context-menu.png
352 +```
354 +Use command palette queries for the named surfaces:
356 +```text
357 +file finder toggle
358 +terminal panel toggle
359 +buffer search deploy
360 +diagnostics deploy
361 +git panel toggle focus
362 +outline panel toggle focus
363 +theme selector toggle
364 +editor open context menu
365 +```
367 +After each capture, dismiss transient UI with `%TEMP%/zed-post-esc.ps1` before opening the next state. If a command name does not exist in Zed 1.9, record the screenshot showing the no-match command palette and add the exact missing command to the final report.
369 +- [ ] **Step 4: Capture light state matrix**
371 +Repeat Step 3 with Windows app theme set to light and write the same filenames with `light` replacing `dark`.
373 +- [ ] **Step 5: Restore host state**
375 +```bash
376 +powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:/Users/okr/.pi/agent/skills/win32-drive/scripts/win32-drive.ps1 theme -Mode light -Scope apps
377 +powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:/Users/okr/.pi/agent/skills/win32-drive/scripts/win32-drive.ps1 window -Hwnd "$HWND" -Action close
378 +rm -f "$TEMP/zed-post-f1.ps1" "$TEMP/zed-post-esc.ps1" "$TEMP/zed-post-text.ps1"
379 +```
381 +Expected: temporary Zed window closes; the user's pre-existing Zed window remains.
383 +## Task 5: Pixel sampling and visual evidence
385 +**Files:**
387 +- Read screenshots from `nugu/output/zed-ui-*.png`
388 +- Generate: `nugu/output/zed-ui-contact-sheet.png`
390 +- [ ] **Step 1: Sample representative pixels**
392 +For every screenshot captured in Task 4, sample these coordinates:
394 +```bash
395 +for img in output/zed-ui-*.png; do
396 + echo "$img"
397 + for p in '500,200' '30,80' '1300,85' '1300,118' '1440,84' '2400,1380'; do
398 + printf '%s ' "$p"
399 + magick "$img" -format "%[pixel:p{$p}]\n" info:
400 + done
401 +done
402 +```
404 +Expected: dark screenshots use Nugu dark semantic backgrounds (`#121212`, `#242424`, focused blends); light screenshots use Nugu light semantic backgrounds (`#ededed`, `#dbdbdb`, focused blends). No light screenshot should show dark terminal/editor backgrounds, and no dark screenshot should show light terminal/editor backgrounds.
406 +- [ ] **Step 2: Create contact sheet**
408 +```bash
409 +magick montage output/zed-ui-dark-*.png output/zed-ui-light-*.png \
410 + -thumbnail 640x348 -tile 4x -geometry +8+8 -background '#000000' \
411 + output/zed-ui-contact-sheet.png
412 +```
414 +Expected: a readable contact sheet with all captured dark/light states.
416 +- [ ] **Step 3: Review screenshots visually**
418 +Read `output/zed-ui-contact-sheet.png` and each screenshot that looks suspicious. Concrete failures requiring iteration:
420 +```text
421 +mode mismatch: a light screenshot uses dark editor/terminal/panel backgrounds or reverse
422 +illegible text: visible labels cannot be read at normal screenshot size
423 +semantic mismatch: errors/warnings/info/success/focus use wrong Nugu semantic family
424 +flat UI failure: elevated menus cannot be distinguished from the underlying surface
425 +```
427 +If a failure appears, return to Task 3 Step 2 or Task 4 Step 3 after editing `zed.nu`.
429 +## Task 6: Final verification and cleanup
431 +**Files:**
433 +- Read: `zed.nu`, `zed/themes/nugu.json`, `output/zed/nugu.json`
435 +- [ ] **Step 1: Run final build checks without deleting screenshot evidence**
437 +Do not run `just zed` after Task 4, because that recipe rebuilds `output/` and deletes screenshot evidence. `just zed` already ran before screenshot capture. Run:
439 +```bash
440 +just lint
441 +just check
442 +node "$TEMP/zed-schema-audit.mjs"
443 +node "$TEMP/zed-contrast-audit.mjs"
444 +```
446 +Expected: all commands exit `0`; schema coverage reports `missing=0 extra=0`; contrast audit reports `failures=0`.
448 +- [ ] **Step 2: Check for accidental injected text**
450 +```bash
451 +! grep -n 'Stashed changes\|>>>>>>>' zed.nu ../zed/themes/nugu.json
452 +```
454 +Expected: no matches.
456 +- [ ] **Step 3: Remove temporary scripts**
458 +```bash
459 +rm -f "$TEMP/zed-schema-audit.mjs" "$TEMP/zed-contrast-audit.mjs" "$TEMP/zed-post-f1.ps1" "$TEMP/zed-post-esc.ps1" "$TEMP/zed-post-text.ps1"
460 +```
462 +Expected: no temporary audit/drive scripts remain.
464 +- [ ] **Step 4: Record final git state**
466 +```bash
467 +git status --short
468 +```
470 +Expected: only intended `nugu/zed.nu` and generated `zed/themes/nugu.json` changes are attributable to this goal; unrelated dirty files remain untouched.
472 +- [ ] **Step 5: Report evidence, not completion**
474 +Report:
476 +```text
477 +changed files
478 +schema audit result
479 +pastel contrast audit result
480 +screenshot list
481 +pixel-sample summary
482 +remaining subjective concerns or missing Zed commands
483 +```
485 +Do not call the standing goal complete unless a judge review confirms the objective is satisfied.
487 +## Current open visual review findings
489 +These are not completion criteria reductions; they are concrete blockers observed after expanded dark/light Zed driving:
491 +- Done in current iteration: semantic role split from Nugu roles, without hardcoded app colors: selection/navigation = `ui.focus`, primary/action/accent = `ui.accent`, content syntax accent = `content.accent`, git/diff/diagnostic remain status roles (`created`, `modified`, `deleted`, `warning`, `error`).
492 +- Done in current iteration: focused dark/light Git diff, gutter, minimap screenshots and pixel samples were captured after final `just zed`.
493 +- Done in current iteration: stronger structural borders now use `ui.minor`; active line moved to panel alpha `34`; status/diff backgrounds use mode-specific low alpha (`10` dark, `06` light) so syntax over diff/status backgrounds remains WCAG-legible.
494 +- Done in current iteration: strict generated audit now includes syntax tokens over conflict/created/deleted/error/hint/info/modified/renamed/success/warning backgrounds; current result is 444 checks per theme, 0 failures.
495 +- Done in current iteration: hierarchy pass strengthened `border.transparent` to alpha `80`, dark elevated surface to `ui.minor` alpha `34`, dark active line to panel alpha `40`, and active line number to the selection/focus semantic role.
496 +- Done in current iteration: scrollbar roles now use UI semantics (`ui.unfocus` thumb, `ui.minor` hover, `ui.minor` borders) instead of content-muted text roles.
497 +- Done in current iteration: light elevated surface increased to max contrast-safe `ui.minor` alpha `28`; dark stays `34`. Accent/text contrast over elevated surfaces remains >= 4.5.
498 +- Done in current iteration: `border.transparent` reduced to alpha `60` after visual review showed Zed reuses it as filled diff/hunk surface; this reduces non-border wash while preserving stronger structure than the old `40`.
499 +- Done in current iteration: dark active-line background increased to contrast-safe panel alpha `80`; light active-line background stayed at `34` because alpha `40+` fails strict syntax-over-active-line contrast.
500 +- Done in current iteration: active-line number moved from `ui.focus` to `ui.important_local`, improving cursor-line salience while staying semantic UI Nugu.
501 +- Done in current iteration: strict generated audit includes syntax over active-line/status/diff backgrounds; current result is 434 checks per theme, 0 failures, min dark 4.53 and light 4.52.
502 +- Done in current iteration: live Zed v0.2 schema search confirmed no `notification`, `minimap`, `diff`, `hunk`, or `git` color keys; only `editor.gutter.background`, shared status roles, and `scrollbar.*` are available for those visual areas.
503 +- Done in current iteration: scrollbar roles were made solid UI-semantic values (`ui.unfocus` thumb, `ui.minor` hover/border, `ui.minor` alpha `60` track border) instead of translucent approximations; focused review says scrollbar/minimap boundary is now legible in both modes.
504 +- Done in current iteration: added targeted elevated-surface audit for status/action foregrounds over `elevated_surface.background`; old elevated alphas failed (`error/deleted` in dark; `error/deleted/warning/info/hint` in light).
505 +- Done in current iteration: elevated surface changed to the contrast-safe semantic ceiling: dark `ui.minor` alpha `2c`, light `ui.minor` alpha `04`; targeted elevated status/action audit now passes.
506 +- Done in current iteration: established strict audit still passes after the elevated adjustment: 434 checks per theme, 0 failures, min dark 4.53 and light 4.52.
507 +- Done in current iteration: `border.transparent` reduced from semantic `ui.minor` alpha `60` to alpha `20`, while `border.disabled` remains alpha `60`; RED audit verifies transparent border is weaker than disabled border.
508 +- Done in current iteration: schema + strict contrast + elevated action checks still pass after the `border.transparent` reduction: 446 checks per theme, 0 failures, min dark 4.53 and light 4.52.
509 +- Done in current iteration: focused visual review says the alpha `20` transparent border is a clear win for dense diff/status row clarity and notification action separation.
510 +- Done in current iteration: `border.transparent` moved from alpha `20` to true alpha `00`; RED audit verifies transparent border is fully transparent and weaker than disabled border.
511 +- Done in current iteration: active-line number moved one semantic step stronger from `ui.important_local` to `ui.important_global` to recover cursor/row findability after true-transparent borders.
512 +- Done in current iteration: schema + strict contrast + elevated action checks still pass after the `border.transparent=00` and active-line-number changes: 446 checks per theme, 0 failures, min dark 4.53 and light 4.52.
513 +- Done in current iteration: focused visual review says true-transparent borders improve dense diff/status row grouping and the stronger active-line number recovers row findability.
514 +- Done in current iteration: inactive editor line numbers now use `ui.minor` instead of `content.minor`, because editor gutters are UI chrome; RED audit verifies line numbers no longer reuse content comment/muted syntax color.
515 +- Done in current iteration: schema + strict contrast + elevated action checks still pass after the line-number semantic change: 446 checks per theme, 0 failures, min dark 4.53 and light 4.52.
516 +- Done in current iteration: focused visual review says inactive gutter quietness and active-line-number hierarchy are improved in both modes.
517 +- Done in current iteration: schema audit proves Zed v0.2 has no dedicated `git`, `diff`, `source`, `scm`, `hunk`, `minimap`, `counter`, `added`, or `removed` color keys; exposed related knobs are only `editor.gutter.background`, shared status roles, `scrollbar.*`, and `status_bar.background`.
518 +- Done in current iteration: scrollbar thumb background moved from `ui.unfocus` to `ui.minor` because a visible scrollbar/minimap thumb is active UI chrome, not merely unfocused decoration; RED audit verifies dark `#9d9d9d`, light `#292929`.
519 +- Done in current iteration: active-line background alpha moved to the contrast-safe semantic panel ceiling: dark `#242424cd`, light `#dbdbdb3f`; RED audit verifies generated values.
520 +- Done in current iteration: schema + strict contrast + elevated action checks still pass after scrollbar and active-line changes: 446 checks per theme, 0 failures, min dark 4.53 and light 4.52.
521 +- Done in current iteration: fresh driven screenshots/pixels were recaptured after final `just zed`; sampled values include dark active line `#202020`, light active line `#e9e9e9`, dark scrollbar thumb `#9d9d9d`, and light scrollbar thumb `#292929`.
522 +- Focused visual review says scrollbar/minimap separation and active/current-line visibility are improved, with source-control diff counters legible in the final capture.
523 +- Done in current iteration: rebuilt baseline remained green (`just lint`, `just check`, `just zed`) before further changes.
524 +- Done in current iteration: recaptured current dark/light editor, notification, SCM, and focused diff screenshots after rebuild; `output/` had been wiped by `just zed` so old screenshots were not reused.
525 +- Done in current iteration: current screenshot review disproved two earlier blockers: notification parity now has proper dark/light themed surface/text, and SCM file/subpath hierarchy is readable in both modes.
526 +- Done in current iteration: expanded pastel audit found a concrete light-mode AA failure for Zed `modified`/`renamed` foregrounds on panel surfaces when they reused global `warning` (`#6e6c10` on `#dbdbdb`, contrast 3.97).
527 +- Done in current iteration: `modified` and `renamed` now use semantic `ui.important_local` instead of diagnostic `warning`; Git modified/renamed are local UI state, not warnings. RED audit verifies dark `#c9b6eb`, light `#604980`, and >= 4.5 contrast on panel surfaces.
528 +- Done in current iteration: schema + strict contrast + modified/renamed panel checks pass after the remap: schema 138/138, 0 missing/extra; strict audit 464 checks per theme, 0 failures, min dark 4.53 and light 4.52.
529 +- Done in current iteration: fresh post-remap screenshots and pixel samples show modified gutter markers now use dark `#c9b6eb` and light `#604980`, while created/deleted keep status roles.
530 +- Done in current iteration: baseline/build subgoal was rerun before new work: `git status --short`, `just lint`, `just check`, and `just zed`.
531 +- Done in current iteration: created a disposable conflict/diagnostic workspace under `output/zed-diagnostics-workspace` with an actual unresolved git merge conflict plus invalid `broken.json`; used it only for screenshots/pixel probes.
532 +- Done in current iteration: drove Zed dark/light on conflict and invalid JSON files, including command palette filtered to `diagnostic`; captured `output/zed-ui-diagnostics-conflict-contact-sheet.png` plus dark/light conflict and broken-json screenshots.
533 +- Done in current iteration: pixel/pastel checks showed conflict band text was AA in both modes: sampled dark green/blue bands were 6.27/6.32 with light text; sampled light green/blue bands were 9.38/9.00 with dark text.
534 +- Done in current iteration: found a concrete light-mode elevated-surface bleed-through issue: command palette over conflict content sampled `#68777b`, giving only 4.04 contrast with light normal text.
535 +- Done in current iteration: changed light `elevated_surface.background` from translucent `ui.minor04` to opaque semantic `surface.background` (`#ededed`), keeping dark elevated surface unchanged. RED audit verifies light elevated surface equals opaque surface.
536 +- Done in current iteration: schema + strict contrast + elevated/action checks pass after the elevated-surface fix: schema 138/138, 0 missing/extra; strict audit 464 checks per theme, 0 failures, min dark 4.53 and light 4.52.
537 +- Done in current iteration: recaptured final dark/light conflict and invalid JSON diagnostic screenshots after the final `just zed`; focused visual review says conflict markers, invalid JSON diagnostics, and diagnostic command palette are legible in both modes with no concrete blocker remaining in this coverage area.
538 +- Done in current iteration: baseline/build subgoal was rerun again before new work: `git status --short`, `just lint`, `just check`, and `just zed` all passed.
539 +- Done in current iteration: recaptured broad post-elevated-surface Zed coverage after `just zed`: editor/project, command palette, file finder, settings/keymap/assistant/diff command states, terminal, git panel, focused git diff, notification commands, extensions commands, theme selector, and focused editor/gutter/minimap crops in dark and light.
540 +- Done in current iteration: broad screenshot/pixel review found a concrete selected-row text issue: command/file-finder selected rows can contain `text.accent`/match text, but the old `ui.focus80` row background failed contrast with accent/muted text.
541 +- Done in current iteration: added selected-row text audit covering `text`, `text.muted`, and `text.accent` over `element.active`, `element.selected`, and `ghost_element.selected`; RED audit failed on the old generated theme.
542 +- Done in current iteration: lowered selected row fill to contrast-safe semantic `ui.focus` alpha: dark `0a`, light `2b`. Fresh pixels: dark selected row effective `#2e2f2f`, light selected row effective `#c9cecf`.
543 +- Done in current iteration: schema + strict contrast + selected-row text checks pass after selected-row alpha change: schema 138/138, 0 missing/extra; strict audit 473 checks per theme, 0 failures, min dark 4.53 and light 4.52.
544 +- Done in current iteration: fresh screenshots after the final `just zed` show command palette/file finder selected rows remain visible and accent/match text no longer collapses by audit.
545 +- Done in current iteration: baseline/build subgoal was rerun again before new work: `git status --short`, `just lint`, `just check`, and `just zed` all passed.
546 +- Done in current iteration: generated values exposed a concrete light hover bug after the opaque elevated-surface change: light `element.hover` and `ghost_element.active` both resolved to the same effective pixel as `elevated_surface.background` (`#ededed`), so hover had no visible pixel change.
547 +- Done in current iteration: added hover visibility audit; RED audit failed for light `element.hover` and `ghost_element.active` because max pixel delta from elevated surface was zero.
548 +- Done in current iteration: expanded selected/hover text audit showed old dark hover (`#3e3e3e` effective) failed for `text.muted` and `text.accent`, so hover also needed the text-safe focus tint in dark.
549 +- Done in current iteration: `element.hover` and `ghost_element.active` now use the same semantic `ui.focus` alpha as selected rows in both modes: dark `#9aabae0a` effective `#2e2f2f`, light `#15333b2b` effective `#c9cecf`.
550 +- Done in current iteration: hover visibility audit and selected/hover text audit now pass; schema + strict contrast pass after the hover change: schema 138/138, 0 missing/extra; strict audit 479 checks per theme, 0 failures, min dark 4.53 and light 4.52.
551 +- Done in current iteration: fresh screenshots after final `just zed` cover dark/light command palette, file finder, settings/keymap/assistant/diff command states, terminal, git panel/diff, notifications, extensions, theme selector, and focused editor/gutter/minimap crops.
552 +- Remaining visual blocker after focused review: hover/selection rows are now text-safe but deliberately subtle; continue judge/human review for subjective affordance strength.
553 +- Remaining visual blocker after focused review: broad image review still flags subjective light-mode hierarchy concerns around elevated/menu edge clarity, minimap lane strength, diff-gutter hierarchy, and notification/title weight; these need targeted pixel validation before any further semantic changes.
554 +- Next iteration should target those remaining hierarchy concerns one by one with falsifiable pixel samples, not broad visual impressions, preserving selected/hover text contrast >= WCAG AA.

mise/config.toml

Modified
1 1 [tools]
2 +"aqua:nushell/nushell" = "latest"
2 3 "cargo:kdl-lsp" = "latest"
3 4 "github:dev-cycles/contextive" = "latest"
4 5 "npm:gh-actions-language-server" = "latest"

nugu/zed.nu

Modified
8 8 { color: $color, font_style: $style, font_weight: $weight }
11 +def token-bg [color: string background: string style: any = null weight: any = null] {
12 + { color: $color, background_color: $background, font_style: $style, font_weight: $weight }
11 15 def theme [mode: string] {
12 16 let nugu = (palette nugu $mode)
13 17 let p = $nugu.palette
17 21 let fg = $p.content.normal
18 22 let panel = $p.ui.backdrop
19 23 let surface = if $dark { $p.ui.backdrop } else { $p.content.backdrop }
20 - let elevated = if $dark { $p.ui.unfocus } else { $p.ui.backdrop }
21 - let line = $p.ui.unfocus
24 + let elevated = if $dark { (a $p.ui.minor 2c) } else { $surface }
25 + let line = $p.ui.minor
22 26 let muted = $p.content.minor
27 + let ui_muted = $p.ui.minor
23 28 let accent = $p.ui.accent
24 29 let selected = $p.ui.focus
25 30 let ghost = $p.ui.minor
31 + let status_alpha = if $dark { "10" } else { "06" }
32 + let status_border_alpha = if $dark { "ff" } else { "c0" }
33 + let active_line_alpha = if $dark { "cd" } else { "3f" }
34 + let selected_alpha = if $dark { "0a" } else { "2b" }
35 + let hover = (a $selected $selected_alpha)
28 38 name: $"Nugu (($mode | str title-case))"
34 44 "border.variant": $p.ui.minor
35 45 "border.focused": $accent
36 46 "border.selected": $accent
37 - "border.transparent": (a $line 40)
47 + "border.transparent": (a $line 00)
38 48 "border.disabled": (a $line 60)
39 49 "elevated_surface.background": $elevated
40 50 "surface.background": $surface
41 51 background: $bg
42 52 "element.background": $panel
43 - "element.hover": $elevated
44 - "element.active": $p.ui.focus
45 - "element.selected": $selected
53 + "element.hover": $hover
54 + "element.active": (a $selected $selected_alpha)
55 + "element.selected": (a $selected $selected_alpha)
46 56 "element.disabled": (a $panel 80)
47 57 "drop_target.background": (a $accent 80)
48 58 "ghost_element.background": null
49 59 "ghost_element.hover": (a $ghost 80)
50 - "ghost_element.active": $elevated
51 - "ghost_element.selected": (a $selected 80)
60 + "ghost_element.active": $hover
61 + "ghost_element.selected": (a $selected $selected_alpha)
52 62 "ghost_element.disabled": (a $ghost 60)
53 63 text: $fg
54 - "text.muted": $muted
55 - "text.placeholder": (a $muted 99)
56 - "text.disabled": (a $fg 60)
64 + "text.muted": $ui_muted
65 + "text.placeholder": $ui_muted
66 + "text.disabled": $ui_muted
57 67 "text.accent": $accent
58 68 icon: $fg
59 - "icon.muted": $muted
60 - "icon.disabled": (a $fg 60)
61 - "icon.placeholder": (a $muted 80)
69 + "icon.muted": $ui_muted
70 + "icon.disabled": $ui_muted
71 + "icon.placeholder": $ui_muted
62 72 "icon.accent": $accent
63 - "status_bar.background": $bg
64 - "title_bar.background": $bg
73 + "status_bar.background": $panel
74 + "title_bar.background": $panel
65 75 "title_bar.inactive_background": $panel
66 76 "toolbar.background": $panel
67 77 "tab_bar.background": $panel
71 81 "panel.background": $panel
72 82 "panel.focused_border": $accent
73 83 "pane.focused_border": $accent
74 - "scrollbar.thumb.background": (a $muted 80)
75 - "scrollbar.thumb.hover_background": (a $muted c0)
76 - "scrollbar.thumb.border": (a $line 40)
84 + "pane_group.border": $line
85 + "panel.indent_guide": (a $line 60)
86 + "panel.indent_guide_active": $p.ui.minor
87 + "panel.indent_guide_hover": $accent
88 + "scrollbar.thumb.background": $p.ui.minor
89 + "scrollbar.thumb.hover_background": $p.ui.minor
90 + "scrollbar.thumb.border": $line
77 91 "scrollbar.track.background": $panel
78 - "scrollbar.track.border": (a $line 20)
92 + "scrollbar.track.border": (a $line 60)
79 93 "editor.foreground": $fg
80 - "editor.background": $panel
94 + "editor.background": $bg
81 95 "editor.gutter.background": $panel
82 96 "editor.subheader.background": $surface
83 97 "editor.indent_guide": (a $line 60)
84 98 "editor.indent_guide_active": $p.ui.minor
85 - "editor.active_line.background": (a $surface 80)
86 - "editor.highlighted_line.background": (a $surface 60)
87 - "editor.line_number": $muted
88 - "editor.active_line_number": $accent
99 + "editor.active_line.background": (a $panel $active_line_alpha)
100 + "editor.highlighted_line.background": (a $panel 10)
101 + "editor.line_number": $ui_muted
102 + "editor.active_line_number": $p.ui.important_global
89 103 "editor.invisible": (a $line 80)
90 104 "editor.wrap_guide": (a $line 40)
91 105 "editor.active_wrap_guide": (a $p.ui.minor 80)
106 + "editor.document_highlight.bracket_background": (a $p.content.focus 40)
92 107 "editor.document_highlight.read_background": (a $p.ui.accent 40)
93 108 "editor.document_highlight.write_background": (a $p.warning 40)
94 - "terminal.background": $panel
109 + "terminal.background": $bg
110 + "terminal.ansi.background": $bg
95 111 "terminal.foreground": $fg
96 112 "terminal.bright_foreground": $p.ui.important_global
97 113 "terminal.dim_foreground": $muted
98 - "terminal.ansi.black": $p.content.backdrop
99 - "terminal.ansi.bright_black": $p.content.minor
100 - "terminal.ansi.dim_black": $p.ui.backdrop
114 + "terminal.ansi.black": $muted
115 + "terminal.ansi.bright_black": $p.ui.minor
116 + "terminal.ansi.dim_black": $muted
101 117 "terminal.ansi.red": $p.error
102 - "terminal.ansi.bright_red": $p.info
103 - "terminal.ansi.dim_red": (a $p.error 80)
118 + "terminal.ansi.bright_red": $p.error
119 + "terminal.ansi.dim_red": $p.error
104 120 "terminal.ansi.green": $p.content.focus
105 - "terminal.ansi.bright_green": $p.ui.unfocus
106 - "terminal.ansi.dim_green": (a $p.content.focus 80)
121 + "terminal.ansi.bright_green": $p.ui.focus
122 + "terminal.ansi.dim_green": $p.content.focus
107 123 "terminal.ansi.yellow": $p.warning
108 - "terminal.ansi.bright_yellow": $p.ui.backdrop
109 - "terminal.ansi.dim_yellow": (a $p.warning 80)
124 + "terminal.ansi.bright_yellow": $p.warning
125 + "terminal.ansi.dim_yellow": $p.warning
110 126 "terminal.ansi.blue": $p.content.important_local
111 127 "terminal.ansi.bright_blue": $p.content.important_global
112 - "terminal.ansi.dim_blue": (a $p.content.important_local 80)
128 + "terminal.ansi.dim_blue": $p.content.important_local
113 129 "terminal.ansi.magenta": $p.content.accent
114 130 "terminal.ansi.bright_magenta": $p.ui.accent
115 - "terminal.ansi.dim_magenta": (a $p.content.accent 80)
131 + "terminal.ansi.dim_magenta": $p.content.accent
116 132 "terminal.ansi.cyan": $p.info
117 133 "terminal.ansi.bright_cyan": $p.ui.important_local
118 - "terminal.ansi.dim_cyan": (a $p.info 80)
134 + "terminal.ansi.dim_cyan": $p.info
119 135 "terminal.ansi.white": $fg
120 136 "terminal.ansi.bright_white": $p.ui.important_global
121 137 "terminal.ansi.dim_white": $muted
122 138 "link_text.hover": $accent
123 139 conflict: $p.error
124 - "conflict.background": (a $p.error 40)
125 - "conflict.border": $p.error
140 + "conflict.background": (a $p.error $status_alpha)
141 + "conflict.border": (a $p.error $status_border_alpha)
126 142 created: $p.content.focus
127 - "created.background": (a $p.content.focus 40)
128 - "created.border": $p.content.focus
143 + "created.background": (a $p.content.focus $status_alpha)
144 + "created.border": (a $p.content.focus $status_border_alpha)
129 145 deleted: $p.error
130 - "deleted.background": (a $p.error 40)
131 - "deleted.border": $p.error
146 + "deleted.background": (a $p.error $status_alpha)
147 + "deleted.border": (a $p.error $status_border_alpha)
132 148 error: $p.error
133 - "error.background": $p.error
134 - "error.border": $p.error
149 + "error.background": (a $p.error $status_alpha)
150 + "error.border": (a $p.error $status_border_alpha)
135 151 hidden: $line
152 + "hidden.background": (a $panel 40)
136 153 "hidden.border": (a $line 60)
137 154 hint: $p.info
138 - "hint.background": (a $p.info 40)
139 - "hint.border": $p.info
155 + "hint.background": (a $p.info $status_alpha)
156 + "hint.border": (a $p.info $status_border_alpha)
140 157 ignored: (a $muted 60)
141 158 "ignored.background": (a $panel 40)
142 159 "ignored.border": (a $line 40)
143 160 info: $p.info
144 - "info.background": (a $p.info 40)
145 - "info.border": $p.info
146 - modified: $p.warning
147 - "modified.background": (a $p.warning 40)
148 - "modified.border": $p.warning
161 + "info.background": (a $p.info $status_alpha)
162 + "info.border": (a $p.info $status_border_alpha)
163 + modified: $p.ui.important_local
164 + "modified.background": (a $p.ui.important_local $status_alpha)
165 + "modified.border": (a $p.ui.important_local $status_border_alpha)
149 166 predictive: (a $muted 80)
150 167 "predictive.border": $p.ui.minor
151 168 "predictive.background": (a $p.ui.focus 80)
152 - renamed: $p.warning
153 - "renamed.border": $p.warning
154 - "renamed.background": (a $p.warning 40)
169 + renamed: $p.ui.important_local
170 + "renamed.border": (a $p.ui.important_local $status_border_alpha)
171 + "renamed.background": (a $p.ui.important_local $status_alpha)
155 172 success: $p.content.focus
156 - "success.background": (a $p.content.focus 40)
157 - "success.border": $p.content.focus
173 + "success.background": (a $p.content.focus $status_alpha)
174 + "success.border": (a $p.content.focus $status_border_alpha)
158 175 unreachable: (a $muted 60)
159 176 "unreachable.background": (a $panel 40)
160 177 "unreachable.border": (a $line 60)
161 178 warning: $p.warning
162 - "warning.background": (a $p.warning 40)
163 - "warning.border": $p.warning
179 + "warning.background": (a $p.warning $status_alpha)
180 + "warning.border": (a $p.warning $status_border_alpha)
164 181 players: [
165 182 { cursor: $p.ui.accent, background: (a $p.ui.accent 80), selection: (a $p.ui.accent 60) }
166 183 { cursor: $p.warning, background: (a $p.warning 80), selection: (a $p.warning 60) }
168 185 syntax: {
169 - boolean: (token $p.content.focus)
170 - comment: (token $muted italic)
171 - "comment.doc": (token $muted italic)
172 - constant: (token $p.content.focus)
173 - constructor: (token $p.warning)
174 - emphasis: (token $accent italic)
175 - "emphasis.strong": (token $accent null 700)
176 - function: (token $accent)
177 - keyword: (token $p.warning)
178 - number: (token $p.info)
179 - operator: (token $muted)
186 + attribute: (token $p.content.minor)
187 + boolean: (token $p.content.focus italic)
188 + comment: (token $p.content.important_global italic 700)
189 + "comment.doc": (token $p.content.important_global italic 700)
190 + constant: (token $p.content.focus italic)
191 + "constant.builtin": (token $p.content.focus italic)
192 + constructor: (token $p.content.important_global null 700)
193 + embedded: (token $fg)
194 + emphasis: (token $p.content.accent italic)
195 + "emphasis.strong": (token $p.content.accent null 700)
196 + enum: (token $fg)
197 + function: (token $fg)
198 + hint: (token $p.ui.important_local)
199 + keyword: (token $p.content.minor)
200 + label: (token $p.content.minor)
201 + link_text: (token $fg)
202 + link_uri: (token $p.content.focus italic)
203 + number: (token $p.content.focus italic)
204 + operator: (token $p.content.minor)
205 + preproc: (token $p.content.important_global null 700)
206 + primary: (token $fg)
180 207 property: (token $fg)
181 - punctuation: (token $muted)
182 - string: (token $p.content.focus)
183 - "string.escape": (token $p.info)
184 - "string.regex": (token $p.debug)
185 - "string.special": (token $p.content.important_local)
186 - tag: (token $p.warning)
208 + punctuation: (token $p.content.minor)
209 + "punctuation.bracket": (token $p.content.minor)
210 + "punctuation.delimiter": (token $p.content.minor)
211 + "punctuation.list_marker": (token $p.content.minor)
212 + "punctuation.special": (token $p.content.important_global null 700)
213 + string: (token $p.content.focus italic)
214 + "string.escape": (token $p.content.important_global null 700)
215 + "string.regex": (token-bg $p.ui.normal $p.debug null 700)
216 + "string.special": (token $p.content.important_global null 700)
217 + "string.special.symbol": (token $p.content.important_global null 700)
218 + tag: (token $p.content.important_global null 700)
219 + "tag.doctype": (token $p.content.important_global null 700)
187 220 text: (token $fg)
188 - "text.literal": (token $p.content.focus)
189 - "title": (token $p.content.important_global null 700)
190 - type: (token $p.content.important_local)
221 + "text.literal": (token $p.content.important_global italic 700)
222 + title: (token $p.content.important_global null 700)
223 + type: (token $fg)
224 + "type.builtin": (token $fg)
191 225 variable: (token $fg)
192 - "variable.special": (token $p.content.accent)
226 + "variable.parameter": (token $p.content.important_local null 700)
227 + "variable.special": (token $p.content.important_global null 700)
228 + variant: (token $fg)

nushell/aliases.nu

Added
new file mode 100644
1 +alias view = wezterm imgcat
2 +alias list = ls --long --all --du
3 +alias show = bat
4 +alias code = neovide
5 +alias edit = nvim --clean
6 +alias video = mpv --no-config --vo=kitty --vo-kitty-use-shm=yes --profile=sw-fast --really-quiet
7 +alias package = mise use --global
8 +alias unpackage = mise unuse --global
9 +alias ll = ls --long
10 +alias la = ls --long --all
11 +alias q = exit
12 +alias g = git
13 +alias vim = nvim
14 +alias vi = nvim --clean
15 +alias vide = neovide
16 +alias delta = delta --hyperlinks --hyperlinks-file-link-format="file://{path}#{line}"
17 +alias rg = rg --hyperlink-format=kitty
18 +alias pii = pi install
19 +alias pia = pi --tools read,bash,edit,write,grep,find,ls
20 +alias pic = pi --tools read,bash,edit,write,grep,find,ls --continue
21 +alias aes = java C:\Users\okr\Workspace\dotfiles/tools/aes.java

nushell/vendor/autoload/mise.nu

Added
new file mode 100644
1 +def "parse vars" [] {
2 + $in | from csv --noheaders --no-infer | rename 'op' 'name' 'value'
3 +}
5 +def --env "update-env" [] {
6 + for $var in $in {
7 + if $var.op == "set" {
8 + if ($var.name =~ '(?i)^path$') {
9 + $env.PATH = ($var.value | split row (char esep))
10 + } else {
11 + load-env {($var.name): $var.value}
12 + }
13 + } else if $var.op == "hide" and $var.name in $env {
14 + hide-env $var.name
15 + }
16 + }
18 +export-env {
20 + '' | parse vars | update-env
21 + $env.MISE_SHELL = "nu"
22 + let mise_hook = {
23 + condition: { "MISE_SHELL" in $env }
24 + code: { mise_hook }
25 + }
26 + add-hook hooks.pre_prompt $mise_hook
27 + add-hook hooks.env_change.PWD $mise_hook
30 +def --env add-hook [field: cell-path new_hook: any] {
31 + let field = $field | split cell-path | update optional true | into cell-path
32 + let old_config = $env.config? | default {}
33 + let old_hooks = $old_config | get $field | default []
34 + $env.config = ($old_config | upsert $field ($old_hooks ++ [$new_hook]))
37 +export def --env --wrapped main [command?: string, --help, ...rest: string] {
38 + let commands = ["deactivate", "shell", "sh"]
40 + if ($command == null) {
41 + ^"C:\\Users\\okr\\AppData\\Local\\Microsoft\\WinGet\\Links\\mise.exe"
42 + } else if ($command == "activate") {
43 + $env.MISE_SHELL = "nu"
44 + } else if ($command in $commands) {
45 + ^"C:\\Users\\okr\\AppData\\Local\\Microsoft\\WinGet\\Links\\mise.exe" $command ...$rest
46 + | parse vars
47 + | update-env
48 + } else {
49 + ^"C:\\Users\\okr\\AppData\\Local\\Microsoft\\WinGet\\Links\\mise.exe" $command ...$rest
50 + }
53 +def --env mise_hook [] {
54 + ^"C:\\Users\\okr\\AppData\\Local\\Microsoft\\WinGet\\Links\\mise.exe" hook-env -s nu
55 + | parse vars
56 + | update-env

nushell/zoxide.nu

Added
new file mode 100644
1 +# Code generated by zoxide. DO NOT EDIT.
3 +# =============================================================================
4 +#
5 +# Hook configuration for zoxide.
6 +#
8 +# Initialize hook to add new entries to the database.
9 +export-env {
10 + $env.config = (
11 + $env.config?
12 + | default {}
13 + | upsert hooks { default {} }
14 + | upsert hooks.env_change { default {} }
15 + | upsert hooks.env_change.PWD { default [] }
16 + )
17 + let __zoxide_hooked = (
18 + $env.config.hooks.env_change.PWD | any { try { get __zoxide_hook } catch { false } }
19 + )
20 + if not $__zoxide_hooked {
21 + $env.config.hooks.env_change.PWD = ($env.config.hooks.env_change.PWD | append {
22 + __zoxide_hook: true,
23 + code: {|_, dir| ^zoxide add -- $dir}
24 + })
25 + }
28 +# =============================================================================
30 +# When using zoxide with --no-cmd, alias these internal functions as desired.
33 +# Jump to a directory using only keywords.
34 +export def --env --wrapped __zoxide_z [...rest: directory] {
35 + let path = match $rest {
36 + [] => {'~'},
37 + [ '-' ] => {'-'},
38 + [ $arg ] if ($arg | path expand | path type) == 'dir' => {$arg}
39 + _ => {
40 + ^zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n"
41 + }
42 + }
43 + cd $path
46 +# Jump to a directory using interactive search.
47 +export def --env --wrapped __zoxide_zi [...rest: string] {
48 + cd $'(^zoxide query --interactive -- ...$rest | str trim -r -c "\n")'
51 +# =============================================================================
53 +# Commands for zoxide. Disable these using --no-cmd.
56 +export alias z = __zoxide_z
57 +export alias zi = __zoxide_zi
59 +# =============================================================================
61 +# Add this to your env file (find it by running `$nu.env-path` in Nushell):
63 +# zoxide init nushell | save -f ~/.zoxide.nu
65 +# Now, add this to the end of your config file (find it by running
66 +# `$nu.config-path` in Nushell):
68 +# source ~/.zoxide.nu
70 +# Note: zoxide only supports Nushell v0.89.0+.

pi/.gitignore

Modified
12 12 research/
13 13 .tmp/
14 14 .pi/tune/
15 +pi-acp/

pi/agent/skills/.isp-skills.json

Modified
2 - "experimentation": "43d750f2c91f2621f3005278146740f2c118d689c5d7b2873d3806a1067318de",
3 - "fxdriver": "b71e4b751b39540748a5281919e4c19ef3418a10b7c7d1d3a4dc4d779ffb09e8",
2 + "experimentation": "4377b7dd6180967d47b1011aafd7d117129d46562388dce5778d0467679da200",
3 + "fxdriver": "60c5e9369ec272bfe2d3bff932e458bb5bfb2edd4a27de3f121d71a8cae4c473",
4 4 "fxdriver-instructions": "03acd906bfa49e7feef159191988e105505c9b5a6a1f80d7e48f1b2cf587665f",
5 - "isp-start-day": "173371555ee72b3d7d92e0df0db34a9da0e93b1a74512a47738582be00d6fd2a"
5 + "isp-start-day": "173371555ee72b3d7d92e0df0db34a9da0e93b1a74512a47738582be00d6fd2a",
6 + "desloppy": "7ffcbcfc3b414477eb6825b625b647045e43653e53d412f844d6973de0f44acc"

pi/agent/skills/desloppy/SKILL.md

Added
new file mode 100644
1 +---
2 +name: desloppy
3 +description: "Use when the user asks to desloppy, clean up, simplify, refactor, or review a specific file, directory, diff, or code scope for messy/sloppy code, code smells, technical debt, duplication, complexity, or overengineering."
4 +---
6 +# Find ugliest slop in code and fix it
8 +## Trigger points
10 +Use for broad cleanup/refactor reviews of existing code when the user wants the
11 +agent to find high-impact slop.
13 +Do not use for normal feature work, exact bug fixes, formatting-only changes, or
14 +cases where the user already specified the exact change to make.
16 +## Instructions
18 +1. **Scan** - Find the ugliest code
19 +2. **Identify** - What makes it slop?
20 + (nesting, long functions, magic numbers, no types)
21 +3. **Propose** - Pick 1-3 slops with highest impact
22 +4. **Approve** - Report minimal and terse first; wait for approval
23 +5. **Fix** - Rewrite cleanly, with project code style
24 +6. **Verify** - Run tests after fixes and create regression tests beforehand, to
25 + make sure to not break old behavior
27 +Focus on ugly code. Read the relevant reference before proposing fixes:
29 +- `references/deep-nesting.md` — deep nesting → flatten
30 +- `references/long-functions.md` — long functions → analyze before extracting
31 +- `references/single-use-functions.md` — single use functions → inline
32 +- `references/magic-values.md` — magic values → name them or express relationships
33 +- `references/missing-types-docs.md` — missing types/docs → add them
34 +- `references/poor-error-handling.md` — poor error handling → fix it
35 +- `references/overengineered-error-handling.md` — overengineered error
36 + handling → simplify
37 +- `references/legacy-overengineering.md` — "legacy" or "backwards
38 + compatibility" → verify the need
39 +- `references/complexity.md` — complexity → disentangle dependencies
40 +- `references/duplication.md` — duplication → remove only when changes should
41 + stay together
42 +- `references/poor-patterns.md` — poor patterns → challenge mechanical Clean
43 + Code / OOP ceremony
45 +Add confidence level to each proposed slop fix:
47 +- **SAFE** - unlikely to introduce breaking changes
48 +- **RISKY** - likely to introduce breaking changes
50 +No mercy.

pi/agent/skills/desloppy/references/complexity.md

Added
new file mode 100644
1 +# Complexity
3 +Complexity is not about lines of code. It is a property of the system.
5 +## Simple vs. complex
7 +Simple means one role, one task, one objective, or one concept. It is not about
8 +being easy or familiar.
10 +Complex means intertwined, braided together, or complected.
12 +Easy means near, familiar, or already in the developer’s skillset. Easy is not
13 +the same as simple.
15 +## What to look for
17 +Look for things that are intertwined and cannot be reasoned about independently.
19 +At code level, pay attention to dependencies created by:
21 +- function parameters
22 +- side effects
23 +- class parameters
24 +- module parameters
26 +At project level, pay attention to dependencies created by:
28 +- libraries
29 +- vendored code
30 +- assumptions about the operating system
31 +- assumptions about the runtime
33 +## Why it matters
35 +Complexity makes systems harder to understand, change, debug, and rely on.
37 +A system can be short, familiar, or easy to write and still be complex if
38 +concerns are braided together.
40 +## Pseudo-code examples
42 +### Bad: function entangled with too many dependencies
44 +```text
45 +function calculate_invoice(order, user, database, logger, clock, config, runtime_environment):
46 + read user discount from database
47 + check current time from clock
48 + branch on runtime_environment
49 + write audit log
50 + calculate total
51 + update order state
52 + return total
53 +```
55 +This function ties calculation to storage, time, logging, runtime assumptions,
56 +and mutation.
58 +### Better: keep calculation separate from effects
60 +```text
61 +function calculate_invoice(order, discount, current_time, rules):
62 + calculate total from values
63 + return total
65 +function save_invoice(order, total, database, logger):
66 + update order state
67 + write audit log
68 +```
70 +The calculation can be reasoned about separately from side effects.
72 +### Bad: project-level runtime assumption hidden in code
74 +```text
75 +function find_tool():
76 + return "/usr/bin/tool"
77 +```
79 +The code silently assumes a specific operating system and runtime environment.
81 +### Better: make the dependency visible
83 +```text
84 +function find_tool(runtime_config):
85 + return runtime_config.tool_path
86 +```
88 +The dependency on the runtime environment is explicit.
90 +### Bad: easy but complex
92 +```text
93 +function process(data):
94 + import convenient_big_library
95 + convenient_big_library.do_everything(data)
96 +```
98 +This may be easy to write, but it can add project-level complexity through a
99 +library dependency and its assumptions.
101 +### Better: inspect dependency tradeoffs
103 +```text
104 +function process(data, required_operation):
105 + required_operation(data)
106 +```
108 +Before adding or keeping a dependency, analyze what it intertwines with the
109 +project: libraries, vendored code, operating system assumptions, and runtime
110 +assumptions.

pi/agent/skills/desloppy/references/deep-nesting.md

Added
new file mode 100644
1 +# Deep nesting
3 +Deep nesting is a good place to start analyzing code slop.
5 +## What to look for
7 +Look for code that is deeply indented to the right, especially:
9 +- deeply nested `if` / `else` chains, for example more than 3 levels deep
10 +- nested `switch` statements
11 +- nested `for` loops
12 +- combinations of nested conditionals, switches, and loops
14 +The “more than 3 levels” rule is a simple starting point, not a universal rule. It depends on context.
16 +## Why it matters
18 +A simple but useful metric is how far the code is indented to the right.
20 +The more code is pushed to the right, the harder it usually is to read and understand.
22 +## Preferred fixes
24 +Guard clauses early in functions and early returns are often good techniques for reducing nesting.
26 +Extracting functions may be good, but be careful: extracting a function that is used only once is only worth it if the extracted code is inherently complex and can be given a good name.
28 +Splitting phases, lookup tables, and state machines are fine techniques, but the user must be made aware of the tradeoffs in memory and space-time differences compared to the old code.
30 +## When it can be acceptable
32 +Deep nesting can be appropriate and correct in some contexts, for example:
34 +- text parsers
35 +- binary parsers
36 +- algorithms
38 +Even in these cases, deep nesting is still a good starting point for analysis.
40 +## Pseudo-code examples
42 +### Bad: nested condition chain
44 +```text
45 +function process(input):
46 + if input exists:
47 + if input is valid:
48 + if user has permission:
49 + if mode is supported:
50 + do work
51 + else:
52 + return unsupported mode
53 + else:
54 + return no permission
55 + else:
56 + return invalid input
57 + else:
58 + return missing input
59 +```
61 +### Better: guard clauses and early returns
63 +```text
64 +function process(input):
65 + if input does not exist:
66 + return missing input
68 + if input is not valid:
69 + return invalid input
71 + if user does not have permission:
72 + return no permission
74 + if mode is not supported:
75 + return unsupported mode
77 + do work
78 +```
80 +### Possible but needs care: extracted single-use function
82 +```text
83 +function process(input):
84 + if input cannot be processed:
85 + return reason
87 + do work
89 +function input cannot be processed:
90 + complex validation with a good name
91 +```
93 +Only extract a single-use function when the extracted code is inherently complex and the function can be given a good name.
95 +### Possible but tradeoffs must be explained: lookup table or state machine
97 +```text
98 +function process(event):
99 + next_step = transition_table[current_state][event]
100 + run next_step
101 +```
103 +This may reduce visible nesting, but the user must be told about memory and space-time tradeoffs compared to the old code.

pi/agent/skills/desloppy/references/duplication.md

Added
new file mode 100644
1 +# Duplication
3 +DRY is generally a good guideline.
5 +Duplicated code risks drift and makes fixing bugs harder.
7 +## What to look for
9 +Look for repeated code or repeated logic that may need to change together over time.
11 +Duplication is more suspicious when a bug fix or behavior change would likely
12 +need to be applied to every copy.
14 +## Key question
16 +Before removing duplication, ask whether the repeated code should actually
17 +change together over time.
19 +If yes, deduplication may reduce drift and make fixes safer.
21 +If no, the code may only be coincidentally the same right now. In that case,
22 +extracting a shared abstraction can be wrong.
24 +## When duplication may be acceptable
26 +Duplication may be acceptable when the repeated code is independent and only
27 +coincidentally the same right now.
29 +Do not force unrelated code to share an abstraction just because it currently
30 +looks similar.
32 +## Pseudo-code examples
34 +### Bad: duplicated logic that should change together
36 +```text
37 +function price_for_web(order):
38 + subtotal = sum order items
39 + tax = subtotal * tax_rate
40 + total = subtotal + tax
41 + return total
43 +function price_for_invoice(order):
44 + subtotal = sum order items
45 + tax = subtotal * tax_rate
46 + total = subtotal + tax
47 + return total
48 +```
50 +If pricing rules must change together, the duplication risks drift.
52 +### Better: shared behavior when changes should stay together
54 +```text
55 +function calculate_price(order):
56 + subtotal = sum order items
57 + tax = subtotal * tax_rate
58 + total = subtotal + tax
59 + return total
61 +function price_for_web(order):
62 + return calculate_price(order)
64 +function price_for_invoice(order):
65 + return calculate_price(order)
66 +```
68 +This is appropriate when both callers should share the same pricing behavior
69 +over time.
71 +### Acceptable: coincidentally similar code
73 +```text
74 +function retry_network_request():
75 + wait 100 milliseconds
76 + try again
78 +function delay_tooltip_open():
79 + wait 100 milliseconds
80 + show tooltip
81 +```
83 +The same literal delay does not prove the behavior should change together.
85 +### Bad abstraction: forcing independent behavior together
87 +```text
88 +function wait_standard_delay():
89 + wait 100 milliseconds
91 +function retry_network_request():
92 + wait_standard_delay()
93 + try again
95 +function delay_tooltip_open():
96 + wait_standard_delay()
97 + show tooltip
98 +```
100 +If network retry timing and tooltip timing are independent, this shared
101 +abstraction can create future bugs.

pi/agent/skills/desloppy/references/legacy-overengineering.md

Added
new file mode 100644
1 +# Legacy and backwards-compatibility overengineering
3 +Agents tend to read the current codebase into context. When they then receive instructions for new code, old code and new instructions are not always weighed correctly.
5 +To weigh them correctly, the agent needs awareness about the state of the project and code.
7 +## What to look for
9 +Look for code or proposals that add or preserve complexity for reasons such as:
11 +- legacy behavior
12 +- backwards compatibility
13 +- migrations
14 +- versioning
16 +These concerns may be important, or they may be useless noise, depending on the lifecycle stage of the project.
18 +## Project and code state matters
20 +In production, mission-critical, important, or released code, the old code may be very important. New code needs to take it into account.
22 +In new features, prototypes, or unreleased projects, things like backwards compatibility, migrations, and versioning may be too early in the lifecycle and become useless noise.
24 +## What the agent should verify
26 +Before preserving or removing compatibility complexity, verify the state of the project and code:
28 +- Is this production or mission-critical code?
29 +- Is this released code?
30 +- Is the behavior part of an external contract?
31 +- Is this a new feature, prototype, or unreleased project?
33 +## Pseudo-code examples
35 +### Suspicious in an unreleased prototype
37 +```text
38 +if request version is 1:
39 + use old prototype behavior
40 +else if request version is 2:
41 + use current prototype behavior
42 +else:
43 + use fallback behavior
44 +```
46 +If the project is unreleased or still a prototype, versioning and backwards compatibility may be useless noise.
48 +### Important in released production code
50 +```text
51 +if request version is 1:
52 + preserve released behavior
53 +else if request version is 2:
54 + use current behavior
55 +```
57 +In released production code, old behavior may be important and new code must take it into account.
59 +### Bad agent behavior: weighing old code blindly
61 +```text
62 +existing code has migration path
63 +new feature copies migration path
64 +```
66 +This may be wrong if the new feature is unreleased and does not need migrations yet.
68 +### Bad agent behavior: ignoring old code blindly
70 +```text
71 +new implementation replaces released behavior
72 +old compatibility path removed without checking project state
73 +```
75 +This may be wrong if the code is production, mission-critical, important, or released.

pi/agent/skills/desloppy/references/long-functions.md

Added
new file mode 100644
1 +# Long functions
3 +Long functions are not inherently a problem.
5 +They can offer the benefit that complex logic can be read top to bottom and understood completely.
7 +## What to look for
9 +A long function, for example more than about 50 lines, can be a good starting point for analysis.
11 +Do not treat length alone as proof of slop.
13 +## Questions to ask
15 +When analyzing a long function, ask:
17 +- Can duplicated parts be extracted and reused?
18 +- Does the function partly reimplement existing functions or behavior?
19 +- Can the function be simplified or optimized without sacrificing behavior?
20 +- Should the function be split for better readability?
22 +## When splitting may help
24 +Splitting a long function for readability is not often the right answer, but
25 +sometimes it helps.
27 +Examples where splitting may be more understandable:
29 +- separating the happy path from error handling
30 +- separating layout / UI code from behavior
32 +General rule: separating by clear boundaries in narrow domains of behavior
34 +This is rare and should be proposed carefully.
36 +## Pseudo-code examples
38 +### Not automatically bad: long top-to-bottom logic
40 +```text
41 +function calculate_result(input):
42 + prepare data
43 + validate data
44 + apply rule A
45 + apply rule B
46 + apply rule C
47 + combine result
48 + return result
49 +```
51 +This may be acceptable if the logic is easier to understand when read top to bottom.
53 +### Candidate for extraction: duplicated parts
55 +```text
56 +function render_page_a(data):
57 + normalize title
58 + normalize date
59 + format author
60 + render page A
62 +function render_page_b(data):
63 + normalize title
64 + normalize date
65 + format author
66 + render page B
67 +```
69 +The duplicated normalization / formatting may be a candidate for extraction and
70 +reuse.
72 +### Candidate for simplification: reimplemented behavior
74 +```text
75 +function process(items):
76 + result = []
77 + for each item in items:
78 + if item matches condition:
79 + result add transformed item
80 + return result
81 +```
83 +If the project already has an existing function or behavior for this, the long
84 +function may be partly reimplementing it.
86 +### Rare but possible: split happy path from error handling
88 +```text
89 +function save(input):
90 + if input invalid:
91 + handle validation error
92 + return
94 + if storage unavailable:
95 + handle storage error
96 + return
98 + save input
99 + return success
100 +```
102 +If the error handling makes the main behavior hard to see, separating the happy
103 +path from error handling may improve readability.
105 +### Rare but possible: split UI layout from behavior
107 +```text
108 +function screen():
109 + create layout
110 + attach button behavior
111 + create more layout
112 + attach form behavior
113 + create final layout
114 +```
116 +If layout and behavior obscure each other, splitting them may be more understandable.

pi/agent/skills/desloppy/references/magic-values.md

Added
new file mode 100644
1 +# Magic values
3 +Magic values are scalar literal values in code where it is not immediately apparent why they have their current value.
5 +They are called magic because they often encode an assumption or a relationship to other values that happens to be correct at the time.
7 +## What to look for
9 +Look for scalar literal values whose meaning, origin, unit, or relationship to other values is unclear.
11 +A common example is UI layout code:
13 +```text
14 +control.padding = 8
15 +```
17 +The value `8` may only look correct because another margin or spacing somewhere else happens to be `4`. If the relationship is “padding is twice the spacing”, the code should express that relationship instead of using a magic value.
19 +## Why it matters
21 +Magic values hide assumptions.
23 +They can also be duplicated in multiple places and drift over time when one occurrence changes but another related occurrence does not.
25 +## Preferred fix
27 +When the value represents a relationship, encode the relationship directly.
29 +When the relationship or context cannot be encoded, use a well-named constant.
31 +Sometimes magic values are unavoidable because the context is not understood or the context exists outside the code. In those cases, a well-named constant is still better than an unexplained literal.
33 +## When not to extract
35 +Many literal values technically fit the definition of a magic value but are accepted in programmer culture.
37 +For example, the zero index in a `for` loop is technically a scalar literal whose value matters, but there is no benefit in extracting it to a constant because every reader knows the pattern.
39 +Extracting such values can make code worse. A shared constant for a loop start index could even introduce a bug if changing the constant changes all starting indices at once.
41 +## Pseudo-code examples
43 +### Bad: hidden relationship
45 +```text
46 +spacing = 4
47 +control.padding = 8
48 +```
50 +The `8` only makes sense because it is related to `spacing`.
52 +### Better: express the relationship
54 +```text
55 +spacing = 4
56 +control.padding = 2 * spacing
57 +```
59 +This makes the assumption visible.
61 +### Acceptable fallback: well-named constant
63 +```text
64 +minimum_visible_items = 7
66 +if item_count < minimum_visible_items:
67 + show compact layout
68 +```
70 +If the context cannot be fully expressed in code, use a well-named constant.
72 +### Bad extraction: culturally understood value
74 +```text
75 +first_index = 0
77 +for index from first_index to item_count:
78 + process item[index]
79 +```
81 +This adds no benefit over the standard loop pattern.
83 +### Worse: shared constant that can create drift or bugs
85 +```text
86 +start_index = 0
88 +for index from start_index to item_count:
89 + process item[index]
91 +for retry from start_index to retry_count:
92 + attempt retry[retry]
93 +```
95 +Changing `start_index` would affect unrelated loops at once.

pi/agent/skills/desloppy/references/missing-types-docs.md

Added
new file mode 100644
1 +# Missing types and docs
3 +Missing types and missing docs are language- and project-dependent slop signals.
5 +Follow project rules first.
7 +## Missing or weak types
9 +Missing types are mainly a problem in languages with some form of gradual typing, such as:
11 +- TypeScript / JavaScript
12 +- typed Python
13 +- Teal / Lua
15 +In those languages, well-typed code should be preferred.
17 +In languages with stricter type systems, types cannot really be missing, but they can still be too general or too specific.
19 +## Type specificity
21 +In compiled languages, the general consensus is:
23 +- use general types for parameters and declarations
24 +- use specific types for values
26 +## Missing docs or comments
28 +For documentation, follow project rules in general.
30 +Complex, surprising, or side-effect-heavy code almost always deserves a comment or doccomment.
32 +## Good comments
34 +Good comments explain:
36 +- context
37 +- reason
38 +- motivation
40 +They explain why the code exists or why it is shaped this way.
42 +## Bad comments
44 +Never simply translate what the code does into human language.
46 +A comment that only restates the code is noise.
48 +## Pseudo-code examples
50 +### Bad: weak typing in gradually typed code
52 +```text
53 +function resize(value):
54 + return value * 2
55 +```
57 +In a gradually typed language, the input and output expectations are unclear.
59 +### Better: well-typed gradually typed code
61 +```text
62 +function resize(value: Pixels) -> Pixels:
63 + return value * 2
64 +```
66 +Well-typed code should be preferred in languages that support gradual typing.
68 +### Bad: comment only repeats the code
70 +```text
71 +# Add one to retry_count.
72 +retry_count = retry_count + 1
73 +```
75 +This only translates the code into human language.
77 +### Better: comment explains reason or context
79 +```text
80 +# The first retry happens immediately because the remote cache often becomes
81 +# visible one tick after the write succeeds.
82 +retry_count = retry_count + 1
83 +```
85 +This explains the reason and context.
87 +### Worth documenting: surprising side effect
89 +```text
90 +function calculate_total(order):
91 + # Also marks expired discounts as used because the billing system expects
92 + # discount state to be finalized during total calculation.
93 + expire_old_discounts(order)
94 + return sum order lines
95 +```
97 +Complex, surprising, or side-effect-heavy code almost always deserves a comment or doccomment.

pi/agent/skills/desloppy/references/overengineered-error-handling.md

Added
new file mode 100644
1 +# Overengineered error handling
3 +Overengineered error handling relates to deep nesting, but it deserves its own reference because many languages have diverse and different error handling strategies.
5 +## What to look for
7 +Overengineered error handling includes error handling constructs that are:
9 +- misused for control flow
10 +- deeply nested
11 +- reliant on side effects
13 +## Why it matters
15 +Error handling can make code harder to understand when it obscures the normal behavior of the code or turns exceptional paths into the main control structure.
17 +## Pseudo-code examples
19 +### Bad: error handling used as control flow
21 +```text
22 +try:
23 + value = get cached value
24 +catch missing_value_error:
25 + value = calculate value
26 +```
28 +The missing cache value is part of normal control flow, but it is expressed as an error path.
30 +### Better: explicit control flow
32 +```text
33 +if cache has value:
34 + value = get cached value
35 +else:
36 + value = calculate value
37 +```
39 +Normal behavior is visible as normal control flow.
41 +### Bad: deeply nested error handling
43 +```text
44 +try:
45 + open resource
46 + try:
47 + read resource
48 + try:
49 + parse resource
50 + catch parse_error:
51 + handle parse error
52 + catch read_error:
53 + handle read error
54 +catch open_error:
55 + handle open error
56 +```
58 +The nesting makes the error behavior hard to read.
60 +### Better: flatter structure
62 +```text
63 +resource = open resource
64 +if open failed:
65 + handle open error
66 + return
68 +content = read resource
69 +if read failed:
70 + handle read error
71 + return
73 +parsed = parse content
74 +if parse failed:
75 + handle parse error
76 + return
77 +```
79 +Flattening can make the normal sequence and error cases easier to follow.
81 +### Bad: error handling reliant on side effects
83 +```text
84 +try:
85 + update account
86 +catch validation_error:
87 + validation_error handler also updates account state
88 + continue
89 +```
91 +The handler changes state in a way the reader may not expect.
93 +### Better: make side effects explicit
95 +```text
96 +validation = validate account update
97 +if validation failed:
98 + update account state for failed validation
99 + report validation error
100 + return
102 +update account
103 +```
105 +The side effect is visible in normal code instead of hidden inside error handling.

pi/agent/skills/desloppy/references/poor-error-handling.md

Added
new file mode 100644
1 +# Poor error handling
3 +Poor error handling can mean both handling too broadly and not handling broadly enough.
5 +## What to look for
7 +Poor error handling includes:
9 +- handling too broad a set of errors and reacting the same way to all of them
10 +- handling too narrow a set of errors and ignoring relevant error cases
12 +## Local or deferred handling
14 +Error handling may be local or deferred, depending on project rules.
16 +The important point is not where the error is handled, but that wherever it is handled, the handling itself is useful, actionable, and explains context to humans.
18 +## Who the error is for
20 +Some errors concern developers.
22 +Some errors concern end users.
24 +Depending on the case, different handling may be needed:
26 +- language
27 +- wording style
28 +- logging
29 +- quality of explanation
30 +- technical detail level
32 +## Error messages
34 +When crafting error messages, pay attention to:
36 +- context
37 +- technical details
38 +- localization
40 +## Pseudo-code examples
42 +### Bad: too broad, same reaction for everything
44 +```text
45 +try:
46 + load configuration
47 + connect to database
48 + read user input
49 +catch error:
50 + show "Something went wrong"
51 +```
53 +Different failures are collapsed into the same reaction, losing useful context.
55 +### Better: distinguish relevant cases
57 +```text
58 +try:
59 + load configuration
60 + connect to database
61 + read user input
62 +catch configuration_error:
63 + report developer-facing configuration context
64 +catch database_error:
65 + report connection context and useful technical details
66 +catch input_error:
67 + report user-facing input guidance
68 +```
70 +The handling gives humans useful and actionable context.
72 +### Bad: too narrow, error case ignored
74 +```text
75 +result = parse input
76 +use result
77 +```
79 +If parsing can fail, the error case is ignored.
81 +### Better: handle or defer according to project rules
83 +```text
84 +result = parse input
85 +if result is parse_error:
86 + handle here with useful context
87 + or return error with context for caller to handle
89 +use result
90 +```
92 +Handling can be local or deferred, but the eventual handling must be useful.
94 +### Developer-facing vs user-facing
96 +```text
97 +if migration file is invalid:
98 + log technical details for developers
99 + fail startup with configuration context
101 +if user entered invalid date:
102 + show localized user-facing guidance
103 +```
105 +Different audiences require different language, detail, logging, and wording style.

pi/agent/skills/desloppy/references/poor-patterns.md

Added
new file mode 100644
1 +# Poor patterns
3 +Poor patterns include blindly applying SOLID, Uncle Bob-style “Clean Code”, or
4 +old OOP patterns when they add ceremony, indirection, or hidden costs instead of
5 +making the system simpler.
7 +## What to look for
9 +Look for code shaped by patterns such as:
11 +- SOLID applied mechanically
12 +- “Clean Code” rules applied mechanically
13 +- deep type hierarchies
14 +- reference types for everything
15 +- ignoring memory and performance implications in the name of “maintainability”
17 +## Why it matters
19 +Patterns can make code worse when they add indirection, allocation, dispatch,
20 +hierarchy, or conceptual weight without a real need.
22 +Maintainability does not mean ignoring memory and performance implications.
24 +Prefer composition over inheritance when behavior can be assembled directly instead of encoded in a type hierarchy.
26 +## SOLID anti-patterns
28 +SOLID concepts can be useful, but applied mechanically they often create slop.
30 +### Single Responsibility Principle
32 +Anti-pattern: splitting code until every tiny operation becomes a separate class, service, or function, even when the pieces do not make sense independently.
34 +```text
35 +class UserNameTrimmer
36 +class UserEmailLowercaser
37 +class UserAgeValidator
38 +class UserNormalizerCoordinator
39 +```
41 +This may satisfy a narrow idea of “one responsibility” while making behavior harder to read as a whole.
43 +### Open/Closed Principle
45 +Anti-pattern: adding extension points, inheritance, plugins, or registries before there is a real need for variation.
47 +```text
48 +interface PriceRule
49 +class DefaultPriceRule implements PriceRule
50 +class PriceRuleRegistry
51 +class PriceRuleFactory
52 +```
54 +This can make simple code harder to change because future flexibility was guessed too early.
56 +### Liskov Substitution Principle
58 +Anti-pattern: deep inheritance hierarchies where subclasses technically share a parent type but violate expectations through special cases, unsupported operations, or surprising overrides.
60 +```text
61 +class Storage
62 +class ReadOnlyStorage extends Storage:
63 + function write(data):
64 + throw unsupported_operation
65 +```
67 +The type relationship claims substitutability, but the behavior does not support it.
69 +### Interface Segregation Principle
71 +Anti-pattern: creating many tiny interfaces that add names, files, dispatch, and navigation without reducing real coupling.
73 +```text
74 +interface CanGetName
75 +interface CanSetName
76 +interface CanValidateName
77 +interface CanNormalizeName
78 +```
80 +Small interfaces are not automatically simple if they fragment one concept across many places.
82 +### Dependency Inversion Principle
84 +Anti-pattern: wrapping every direct dependency in an interface, adapter, provider, or factory even when there is only one implementation and no useful boundary.
86 +```text
87 +interface ClockProvider
88 +class SystemClockProvider implements ClockProvider
89 +class ClockProviderFactory
90 +class ClockProviderFactoryProvider
91 +```
93 +This can replace a clear dependency with ceremony and indirection.
95 +## Pseudo-code examples
97 +### Bad: deep type hierarchy
99 +```text
100 +interface Thing
101 +class AbstractThing implements Thing
102 +class AbstractNamedThing extends AbstractThing
103 +class ConfigurableNamedThing extends AbstractNamedThing
104 +class RuntimeConfigurableNamedThing extends ConfigurableNamedThing
105 +class UserRuntimeConfigurableNamedThing extends RuntimeConfigurableNamedThing
106 +```
108 +The hierarchy becomes the thing the reader must understand before understanding
109 +the behavior.
111 +### Better: flatter data and behavior
113 +```text
114 +type Thing:
115 + name
116 + config
118 +function run_thing(thing, runtime):
119 + use thing.name
120 + use thing.config
121 + use runtime
122 +```
124 +Prefer a simpler shape when the hierarchy does not carry real value.
126 +### Bad: inheritance for assembled behavior
128 +```text
129 +class Exporter
130 +class CsvExporter extends Exporter
131 +class CompressedCsvExporter extends CsvExporter
132 +class EncryptedCompressedCsvExporter extends CompressedCsvExporter
133 +```
135 +The type hierarchy encodes combinations of behavior.
137 +### Better: composition over inheritance
139 +```text
140 +exporter = compose(
141 + csv_format,
142 + compression,
143 + encryption,
146 +exporter.export(data)
147 +```
149 +Assemble behavior directly when that is simpler than encoding combinations in subclasses.
151 +### Bad: reference types for everything
153 +```text
154 +class UserName:
155 + value
157 +class UserAge:
158 + value
160 +class UserEmail:
161 + value
163 +class User:
164 + name: UserName reference
165 + age: UserAge reference
166 + email: UserEmail reference
167 +```
169 +Reference types for everything can add allocation, navigation, and runtime cost
170 +without improving the system.
172 +### Better: use direct values when appropriate
174 +```text
175 +type User:
176 + name
177 + age
178 + email
179 +```
181 +Do not introduce reference-heavy structure unless it has a real purpose.
183 +### Bad: ceremony in the name of maintainability
185 +```text
186 +interface UserFactory
187 +class DefaultUserFactory implements UserFactory
188 +class UserFactoryProvider
189 +class UserFactoryProviderFactory
191 +user = UserFactoryProviderFactory.create().provider().factory().create_user(data)
192 +```
194 +This may satisfy pattern rules while making the actual behavior harder to see.
196 +### Better: direct construction when enough
198 +```text
199 +user = create_user(data)
200 +```
202 +Avoid pattern ceremony when direct code is simpler and sufficient.
204 +### Bad: ignoring performance implications
206 +```text
207 +function draw_frame(items):
208 + objects = items.map(item -> new DrawableItemWrapper(item))
209 + objects.each(object -> object.render())
210 +```
212 +A maintainability argument is weak if the code creates avoidable memory or
213 +performance costs in a hot path.
215 +### Better: consider the runtime context
217 +```text
218 +function draw_frame(items):
219 + for each item in items:
220 + render item
221 +```
223 +When memory or performance matters, do not hide costs behind abstraction.

pi/agent/skills/desloppy/references/single-use-functions.md

Added
new file mode 100644
1 +# Single-use functions
3 +Single-use functions are often bad because they force names onto blocks of code.
5 +That can sometimes be a benefit, but only when the name is very good: short, descriptive, and unambiguous.
7 +## Why it matters
9 +Single-use functions force readers to jump and navigate around the codebase to understand behavior.
11 +In some languages, they can also incur performance or runtime costs.
13 +## When a single-use function can be good
15 +For complex or surprising code, giving the block a good name can be the right move.
17 +This only applies when the function name is very good:
19 +- short
20 +- descriptive
21 +- unambiguous
23 +More often than not, comments can serve the same purpose better.
25 +## Preferred fix
27 +Inline single-use functions when they do not justify the navigation cost.
29 +If the old function name was useful, translate it into a human-readable comment above the inlined code.
31 +## Tricky case: public functions
33 +Single-use public functions require careful analysis.
35 +They may be part of an API and only appear to be single-use from the current codebase.
37 +Analyze those cases case by case before proposing an inline.
39 +## Pseudo-code examples
41 +### Bad: single-use function with weak name
43 +```text
44 +function handle_request(request):
45 + prepare(request)
46 + send response
48 +function prepare(request):
49 + trim request fields
50 + default missing values
51 + normalize date format
52 +```
54 +The reader must jump to `prepare` to understand what actually happens.
56 +### Better: inline with a useful comment
58 +```text
59 +function handle_request(request):
60 + # Normalize request input before responding.
61 + trim request fields
62 + default missing values
63 + normalize date format
65 + send response
66 +```
68 +If the function name carried useful intent, convert that intent into a human-readable comment.
70 +### Acceptable: complex or surprising block with a very good name
72 +```text
73 +function handle_request(request):
74 + reject_if_signature_was_replayed(request)
75 + send response
77 +function reject_if_signature_was_replayed(request):
78 + complex or surprising replay-detection logic
79 +```
81 +A single-use function may be worth keeping when the code is complex or surprising and the name is short, descriptive, and unambiguous.
83 +### Risky: public single-use function
85 +```text
86 +public function normalize_request(request):
87 + trim request fields
88 + default missing values
89 + normalize date format
90 +```
92 +This may be an API even if it appears single-use inside the current codebase. Analyze case by case before proposing to inline it.

pi/agent/skills/experimentation/SKILL.md

Modified
126 126 ```text
127 127 Only delete explicit paths created by this experiment.
128 -Never delete user data, research cache, repo files, broad globs, or git-clean without confirmation.
128 +Never delete user data, research cache, repo files, broad globs, or git-clean
129 +without confirmation.
131 132 Final report shape:

pi/agent/skills/find-skills/SKILL.md

Added
new file mode 100644
1 +---
2 +name: find-skills
3 +description: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
4 +---
6 +# Find Skills
8 +This skill helps you discover and install skills from the open agent skills ecosystem.
10 +## When to Use This Skill
12 +Use this skill when the user:
14 +- Asks "how do I do X" where X might be a common task with an existing skill
15 +- Says "find a skill for X" or "is there a skill for X"
16 +- Asks "can you do X" where X is a specialized capability
17 +- Expresses interest in extending agent capabilities
18 +- Wants to search for tools, templates, or workflows
19 +- Mentions they wish they had help with a specific domain (design, testing, deployment, etc.)
21 +## What is the Skills CLI?
23 +The Skills CLI (`npx skills`) is the package manager for the open agent skills ecosystem. Skills are modular packages that extend agent capabilities with specialized knowledge, workflows, and tools.
25 +**Key commands:**
27 +- `npx skills find [query] [--owner <owner>]` - Search for skills interactively or by keyword, optionally scoped to a GitHub owner
28 +- `npx skills add <package>` - Install a skill from GitHub or other sources
29 +- `npx skills check` - Check for skill updates
30 +- `npx skills update` - Update all installed skills
32 +**Browse skills at:** https://skills.sh/
34 +## How to Help Users Find Skills
36 +### Step 1: Understand What They Need
38 +When a user asks for help with something, identify:
40 +1. The domain (e.g., React, testing, design, deployment)
41 +2. The specific task (e.g., writing tests, creating animations, reviewing PRs)
42 +3. Whether this is a common enough task that a skill likely exists
44 +### Step 2: Check the Leaderboard First
46 +Before running a CLI search, check the [skills.sh leaderboard](https://skills.sh/) to see if a well-known skill already exists for the domain. The leaderboard ranks skills by total installs, surfacing the most popular and battle-tested options.
48 +For example, top skills for web development include:
49 +- `vercel-labs/agent-skills` — React, Next.js, web design (100K+ installs each)
50 +- `anthropics/skills` — Frontend design, document processing (100K+ installs)
52 +### Step 3: Search for Skills
54 +If the leaderboard doesn't cover the user's need, run the find command:
56 +```bash
57 +npx skills find [query] [--owner <owner>]
58 +```
60 +For example:
62 +- User asks "how do I make my React app faster?" → `npx skills find react performance`
63 +- User asks "can you help me with PR reviews?" → `npx skills find pr review`
64 +- User asks "I need to create a changelog" → `npx skills find changelog`
66 +### Step 4: Verify Quality Before Recommending
68 +**Do not recommend a skill based solely on search results.** Always verify:
70 +1. **Install count** — Prefer skills with 1K+ installs. Be cautious with anything under 100.
71 +2. **Source reputation** — Official sources (`vercel-labs`, `anthropics`, `microsoft`) are more trustworthy than unknown authors.
72 +3. **GitHub stars** — Check the source repository. A skill from a repo with <100 stars should be treated with skepticism.
74 +### Step 5: Present Options to the User
76 +When you find relevant skills, present them to the user with:
78 +1. The skill name and what it does
79 +2. The install count and source
80 +3. The install command they can run
81 +4. A link to learn more at skills.sh
83 +Example response:
85 +```
86 +I found a skill that might help! The "react-best-practices" skill provides
87 +React and Next.js performance optimization guidelines from Vercel Engineering.
88 +(185K installs)
90 +To install it:
91 +npx skills add vercel-labs/agent-skills@react-best-practices
93 +Learn more: https://skills.sh/vercel-labs/agent-skills/react-best-practices
94 +```
96 +### Step 6: Offer to Install
98 +If the user wants to proceed, you can install the skill for them:
100 +```bash
101 +npx skills add <owner/repo@skill> -g -y
102 +```
104 +The `-g` flag installs globally (user-level) and `-y` skips confirmation prompts.
106 +## Common Skill Categories
108 +When searching, consider these common categories:
110 +| Category | Example Queries |
111 +| --------------- | ---------------------------------------- |
112 +| Web Development | react, nextjs, typescript, css, tailwind |
113 +| Testing | testing, jest, playwright, e2e |
114 +| DevOps | deploy, docker, kubernetes, ci-cd |
115 +| Documentation | docs, readme, changelog, api-docs |
116 +| Code Quality | review, lint, refactor, best-practices |
117 +| Design | ui, ux, design-system, accessibility |
118 +| Productivity | workflow, automation, git |
120 +## Tips for Effective Searches
122 +1. **Use specific keywords**: "react testing" is better than just "testing"
123 +2. **Try alternative terms**: If "deploy" doesn't work, try "deployment" or "ci-cd"
124 +3. **Check popular sources**: Many skills come from `vercel-labs/agent-skills` or `ComposioHQ/awesome-claude-skills`
126 +## When No Skills Are Found
128 +If no relevant skills exist:
130 +1. Acknowledge that no existing skill was found
131 +2. Offer to help with the task directly using your general capabilities
132 +3. Suggest the user could create their own skill with `npx skills init`
134 +Example:
136 +```
137 +I searched for skills related to "xyz" but didn't find any matches.
138 +I can still help you with this task directly! Would you like me to proceed?
140 +If this is something you do often, you could create your own skill:
141 +npx skills init my-xyz-skill
142 +```

pi/agent/skills/fxdriver/SKILL.md

Modified
22 22 2. Attach fxdriver to its JVM PID.
23 23 3. Snapshot UI.
24 24 4. Pick stable selectors (`nodeId`, `textExact`, `type`, `role`, `eid`).
25 -5. Act: `click`/`fire` buttons, `setText`/`type` fields, `select` for
26 - choice/range/table/tree controls, `fireMenuItem` for menus, and `key` for
27 - real keystrokes (Enter/Tab/chords).
25 +5. Act: `click`/`fire` buttons, `setText`/`type` fields, `setValue` or
26 + `selectIndex` for choice/range/table/tree controls, `fireMenuItem` for menus,
27 + and `key` for real keystrokes (Enter/Tab/chords).
28 28 6. Wait/assert.
29 29 7. Capture screenshot when uncertain or after visual changes; use
30 30 `videoStart`/`videoStep`/`videoStop` to record a whole run as GIF or APNG
38 38 - `references/protocol.md` — JSON-RPC methods and selector forms.
39 39 - `references/workflow.md` — recommended observe/act/wait loop.
40 +- `references/failures.md` — verified broken-flow diagnostics and recovery
41 + examples.
40 42 - `references/visual.md` — screenshot, image summary, and diff usage.
41 43 - `references/troubleshooting.md` — attach/Wayland/selector/debug notes.
69 71 silently.
70 72 - Use `value` for `setText`/`type` payloads. `text` is a selector field, not an
71 73 input payload.
72 -- Use only disposable dev/demo credentials through fxdriver, never real secrets.
73 - Events keep raw request params, including `setText`/`type` values; redact event
74 - artifacts before sharing and clear events when done.
75 -- `click`/`fire` drive `ButtonBase` controls and `ListView`; use `select` for
76 - choice, picker, range, table, tree, and tree-table controls. Use
77 - `fireMenuItem` for `MenuBar`, `MenuButton`, `SplitMenuButton`, and context
78 - menus. For keyboard-only interactions (submit with Enter, navigate with
79 - Tab/arrows, trigger accelerators), use `key`.
74 +- `click`/`fire` drive `ButtonBase` controls and `ListView`; use `setValue`,
75 + `selectIndex`, and control-specific methods for choice, picker, range, table,
76 + tree, and tree-table controls. Use `fireMenuItem` for `MenuBar`,
77 + `MenuButton`, `SplitMenuButton`, and context menus. For keyboard-only
78 + interactions (submit with Enter, navigate with Tab/arrows, trigger
79 + accelerators), use `key`.
80 80 - Do not rely only on JSON assertions for visual quality. Read screenshots when
81 81 layout/colors are under review.
82 82 - For whole-flow videos, prefer `canvas:"fixed"` with explicit `width`/`height`,

pi/agent/skills/fxdriver/TODO.md

Deleted
deleted file mode 100644
1 -# TODO
3 -Validated against `fxdriver.jar` on 2026-07-07 with `java -jar` usage and `javap`.
5 -- Reconcile docs with packaged RPC methods. Docs mention methods absent from the jar: `videoStart`, `videoStep`, `videoStop`, `fireMenuItem`, `tableCell`, `snapshotSummary`, and `key`.
6 -- Clarify action API names. Skill says generic `select`; jar exposes narrower methods such as `selectListItem` and `selectIndex`.
7 -- Fix event clearing docs. Protocol says `events {"clear":true}` reads and clears; jar exposes `events` and `clearEvents` separately.
8 -- Verify CLI shortcuts. Protocol documents `snapshot`; jar usage does not list it.
9 -- Generate or test protocol docs from live `capabilities`/jar metadata instead of hand-maintained method lists.
10 -- Add a harmless fixture app or contract test so docs, examples, and jar cannot drift silently.

pi/agent/skills/fxdriver/fxdriver.jar

Modified

Previous version contains binary or non-UTF-8 data.

Current version contains binary or non-UTF-8 data.

pi/agent/skills/fxdriver/references/failures.md

Added
new file mode 100644
1 +# fxdriver failure examples
3 +These examples are based on integration tests that intentionally drive the
4 +probe app into failed or ambiguous states. Keep the pattern: observe the exact
5 +tool result, gather the next artifact, then change one thing.
7 +## Wait timed out
9 +Observed result:
11 +```json
12 +{"result":{"query":"text=Probe buton","present":true,"count":0,"ok":false,"error":{"code":"TIMEOUT","message":"Wait predicate not satisfied"}}}
13 +```
15 +Useful recovery:
17 +1. Do not retry the same typo.
18 +2. Run `snapshot` or CLI `snapshot --summary`.
19 +3. Compare visible text and control ids, then retry with the corrected selector.
21 +Verified recovery signal: a full snapshot after the timeout contained
22 +`Probe button`.
24 +## Input payload was wrong
26 +Observed command:
28 +```sh
29 +java -jar fxdriver.jar rpc <port> setText '{"nodeId":"probe-field","text":"wrong field"}'
30 +```
32 +Observed result included:
34 +```text
35 +setText/type require value
36 +```
38 +Useful recovery: for `setText` and `type`, put the input in `value`. `text` is a
39 +selector field.
41 +```sh
42 +java -jar fxdriver.jar rpc <port> setText '{"nodeId":"probe-field","value":"right field"}'
43 +```
45 +## Wrong primitive for a choice control
47 +Observed behavior:
49 +1. `click {"nodeId":"probe-choice"}` returned `ok:true`.
50 +2. `wait {"text":"blue"}` still timed out.
51 +3. `setValue {"nodeId":"probe-choice","value":"blue"}` returned `ok:true`.
52 +4. `wait {"text":"blue"}` then passed.
54 +Useful recovery: `ok:true` on an action means the primitive ran, not that the
55 +intended state changed. For choice-like controls, prefer `setValue` or
56 +`selectIndex`, then wait/assert the resulting value.
58 +## Useful control has no id
60 +Observed snapshot fragment:
62 +```json
63 +{"type":"Button","id":"","nodeId":"","text":"Tool action","actionable":true}
64 +```
66 +Useful recovery:
68 +1. If this is a one-off run, target by exact text or role plus text and verify
69 + with `highlight`.
70 +2. If this flow will be repeated, ask permission to add a minimal semantic
71 + JavaFX id such as `tool-action`.
72 +3. Add only ids that describe user intent, follow local style, and leave them in
73 + the app for future navigation.
75 +## Visual change needs image evidence
77 +Verified sequence:
79 +```sh
80 +java -jar fxdriver.jar rpc <port> screenshot '{"path":"/abs/before.png"}'
81 +java -jar fxdriver.jar rpc <port> click '{"textExact":"charlie"}'
82 +java -jar fxdriver.jar rpc <port> wait '{"text":"clicked charlie","timeoutMs":2000}'
83 +java -jar fxdriver.jar rpc <port> screenshot '{"path":"/abs/after.png"}'
84 +java -jar fxdriver.jar image-diff /abs/before.png /abs/after.png /abs/diff.png
85 +```
87 +The screenshot RPC returned image metadata with `source`, and the files existed.
88 +`image-diff` returned `changedPixels` and wrote the diff PNG.
90 +Useful recovery: read the screenshots. The diff proves where pixels changed,
91 +not whether the UI is correct.
93 +## Use events as a trail
95 +Observed events included method names, params, and `ok` values:
97 +```json
98 +{"method":"wait","ok":false,"params":{"text":"Probe buton","timeoutMs":250}}
99 +{"method":"setText","ok":false,"params":{"nodeId":"probe-field","text":"wrong field"}}
100 +```
102 +Useful recovery: use `events {"clear":true}` at failure boundaries to preserve a
103 +short trail of what the agent actually tried. Treat `ok:false` entries as the
104 +first questions to explain.

pi/agent/skills/fxdriver/references/protocol.md

Modified
42 42 Example launch JSON:
44 44 ```json
45 -{"pid":12345,"port":43123,"token":"...","endpoint":"http://127.0.0.1:43123/rpc","endpointFile":"/abs/target/fxdriver-endpoints/launch-1.json","startupMs":822}
46 + "pid": 12345,
47 + "port": 43123,
48 + "token": "...",
49 + "endpoint": "http://127.0.0.1:43123/rpc",
50 + "endpointFile": "/abs/target/fxdriver-endpoints/launch-1.json",
51 + "startupMs": 822
48 55 ## Core methods
111 118 - `eid` / `handle`
112 119 - `parent`
113 120 - `window`
114 -- `selectorPath`
115 121 - `type`
116 122 - `id`
117 123 - `text`
159 165 (`masked: true`). Virtualized controls expose model/selection metadata;
160 166 unrealized rows/cells are not emitted as nodes.
162 -### `snapshotSummary`
168 +### Snapshot summary
165 -java -jar fxdriver.jar rpc <port> snapshotSummary '{}'
166 171 java -jar fxdriver.jar snapshot <port> --summary
169 -Returns a compact first view:
174 +The CLI summary command returns a compact first view:
171 176 - `windows[]`: window id/index/title/focus/bounds.
172 -- `buttons[]`: visible `ButtonBase` controls with text and selector path.
177 +- `buttons[]`: visible `ButtonBase` controls with text.
173 178 - `textFields[]`: text inputs with value/prompt/editability.
174 179 - `tables[]`: visible `TableView` and `TreeTableView` row/column summaries.
175 180 - `selectedTabs[]`: selected tab text per visible `TabPane`.
176 181 - `visibleTextSample[]`: bounded visible text sample for orientation.
178 183 Use full `snapshot` when you need bounds, semantics, or raw node hierarchy.
179 -Copy `selectorPath` back as `selectorPath` when repeated labels make text
180 -selectors ambiguous.
182 185 ### `highlight`
243 246 focused first; otherwise events go to the current focus owner. Returns the
244 247 resolved key/chars and a description of the target node.
246 -### `select`
249 +### `setValue`, `selectIndex`, `selectListItem`
249 -java -jar fxdriver.jar rpc <port> select '{"nodeId":"country","itemText":"Germany"}'
250 -java -jar fxdriver.jar rpc <port> select '{"nodeId":"size","index":2}'
251 -java -jar fxdriver.jar rpc <port> select '{"nodeId":"count","value":"42"}'
252 +java -jar fxdriver.jar rpc <port> setValue '{"nodeId":"country","value":"Germany"}'
253 +java -jar fxdriver.jar rpc <port> selectIndex '{"nodeId":"projects","index":2}'
254 +java -jar fxdriver.jar rpc <port> selectListItem '{"nodeId":"duplicates-list","itemText":"portrait"}'
254 -Drives choice controls that `click`/`fire` cannot: `ComboBox`, `ChoiceBox`,
255 -`TabPane`, `Spinner`, `DatePicker`, `ColorPicker`, `Slider`, `ScrollBar`,
256 -`TableView`, `TreeView`, and `TreeTableView`. Selects by `itemText` (exact then
257 -contains, using the control's `StringConverter` where available), by `index`,
258 -or by `value` where the control exposes a direct value. For a Spinner, a
259 -positive `index` increments and a negative one decrements. Returns `kind`,
260 -`index`, `value`, and `selected`; `ok:false` with `UNSUPPORTED` if the matched
261 -node is not a selectable control, or `NO_ITEM` if no entry matched. (`ListView`
262 -selection has its own `selectListItem`.)
257 +Drives controls that `click`/`fire` cannot reliably set. Use `setValue` for
258 +controls with a direct value such as `ChoiceBox`, `ComboBox`, `DatePicker`,
259 +`Slider`, and text-like value controls. Use `selectIndex` for indexed selection
260 +in list/table/tree-style controls. Use `selectListItem` for `ListView` by item
261 +text.
264 263 ### `tableCell`
296 295 `enabled`, `focused`, `visible`. Like the action commands, `wait` and `assert`
297 296 only consider visible nodes unless `visible:false` is passed explicitly, so a
298 297 satisfied `wait` means the follow-up `click`/`type` sees the same node. Failed
299 -waits include `nearMatches[]` with nearby visible text/id/type candidates and
300 -their `selectorPath`.
298 +waits return `ok:false` with `TIMEOUT`; take a fresh snapshot or CLI summary to
299 +compare visible text, ids, roles, and control state before retrying.
302 301 ### `assert`
318 317 java -jar fxdriver.jar rpc <port> clearEvents '{}'
321 -Returns recent fxdriver calls with `ts`, `method`, `ok`, `severity`, and
322 -`params`. `params` are raw request params, so `setText`/`type` values may appear
323 -in event output. Use only disposable dev/demo credentials, never real secrets;
324 -redact event artifacts before sharing and clear events when done. `severity` is
325 -`info` for successful calls, `miss` for app-level `ok:false` responses such as
326 -exploratory selector misses, and `error` for protocol-level JSON-RPC errors. If
320 +Returns recent fxdriver calls with `ts`, `method`, `ok`, and `params`. If
327 321 request params include `tag` or `scenario`, the event copies them to top-level
328 322 fields. Use `events {"clear":true}` to read and clear in one call.
475 469 type=Button Java class simple name
476 470 role=BUTTON accessible role
477 471 accessible=Save accessible text contains
478 -path=window[0] ... selectorPath copied from snapshot
481 474 JSON params that map to selectors:
491 484 { "type": "Button" }
492 485 { "role": "BUTTON" }
493 486 { "accessible": "Save" }
494 -{ "selectorPath": "window[0] > control[0] > button#save[0]" }
495 487 { "selector": "type=Button" }

pi/agent/skills/fxdriver/references/workflow.md

Modified
35 35 - visible windows;
36 36 - stable `nodeId` values;
37 -- `selectorPath` values for repeated labels;
38 37 - actionable buttons/text inputs/lists;
39 38 - exact text vs duplicate skin/internal text;
40 39 - disabled/focused/common node state;
47 46 Preference order:
49 48 1. `nodeId` / `#id`
50 -2. `selectorPath` copied from snapshot when labels repeat
51 -3. `eid` if stable within this attached session
52 -4. `textExact`
53 -5. `role` + text/accessibility
54 -6. `type` for broad discovery only
55 -7. bare text contains only as last resort
49 +2. `eid` if stable within this attached session
50 +3. `textExact`
51 +4. `role` + text/accessibility
52 +5. `type` for broad discovery only
53 +6. bare text contains only as last resort
57 55 Verify ambiguous selectors with `highlight`:
91 89 Do not assume immediate UI update after action.
93 -If a wait fails, read `nearMatches[]` before trying another selector.
91 +If a wait fails, read the returned `ok:false`/`TIMEOUT`, then take a fresh
92 +summary or full snapshot and compare visible text, ids, roles, and control
93 +state before trying another selector.
95 95 ## Visual review

pi/agent/skills/isp-start-day/package.json

Deleted
deleted file mode 100644
1 -{
2 - "name": "isp-start-day-skill",
3 - "version": "0.1.0",
4 - "private": true,
5 - "type": "module",
6 - "scripts": {
7 - "test": "node --test scripts/*.test.mjs"
8 - }
9 -}

pi/agent/skills/isp-start-day/scripts/isp-start-day.mjs

Modified
2 2 #!/usr/bin/env node
3 3 import { execFile } from 'node:child_process';
4 4 import { existsSync } from 'node:fs';
5 5 import path from 'node:path';
6 -import { fileURLToPath } from 'node:url';
7 6 import { promisify } from 'node:util';
9 8 const execFileP = promisify(execFile);
130 129 map.get(k).add(color);
133 -export function parseOfficeLegend(body, monthLabel) {
132 +function parseOfficeLegend(body, monthLabel) {
134 133 const start = body.indexOf(monthLabel);
135 134 const scope = start > 0 ? body.slice(0, start) : body;
136 135 const tableMatch = scope.match(/<table\b[\s\S]*?<\/table>/i);
176 175 return '';
179 -export function parseOffice(body, accountId) {
178 +function parseOffice(body, accountId) {
180 179 const today = new Date();
181 180 const months = [
182 181 'Januar',
238 237 return out;
241 -export function rdKeysFrom(text) {
240 +function rdKeysFrom(text) {
242 241 return [...new Set(text.match(/RD-[0-9]+/g) || [])];
514 513 } else warn('Skipped: no RD keys or acli missing');
517 -if (process.argv[1] === fileURLToPath(import.meta.url)) {
518 - main().catch((err) => {
519 - fail(err?.message || String(err));
520 - process.exitCode = 1;
521 - });
516 +main().catch((err) => {
517 + fail(err?.message || String(err));
518 + process.exitCode = 1;
519 +});

pi/agent/skills/isp-start-day/scripts/isp-start-day.test.mjs

Deleted
deleted file mode 100644
1 -import assert from "node:assert/strict";
2 -import { test } from "node:test";
3 -import { parseOfficeLegend, rdKeysFrom } from "./isp-start-day.mjs";
5 -test("rdKeysFrom returns unique RD keys in first-seen order", () => {
6 - assert.deepEqual(rdKeysFrom("RD-1 x RD-2 y RD-1"), ["RD-1", "RD-2"]);
7 -});
9 -test("parseOfficeLegend reads current top-page legend colors", () => {
10 - const body = `
11 - <table>
12 - <tr><td data-highlight-colour="green">B/BP</td><td>Büro</td></tr>
13 - <tr><td data-highlight-colour="blue">H</td><td>Homeoffice</td></tr>
14 - <tr><td data-highlight-colour="grey">A/AP</td><td>geplant</td></tr>
15 - </table>
16 - <h1>Juli 2026</h1>`;
17 - const legend = parseOfficeLegend(body, "Juli 2026");
18 - assert.deepEqual([...legend.validColorsByValue.get("B")], ["green"]);
19 - assert.deepEqual([...legend.validColorsByValue.get("BP")], ["green"]);
20 - assert.deepEqual([...legend.validColorsByValue.get("H")], ["blue"]);
21 - assert.deepEqual([...legend.plannedColorsByValue.get("A")], ["grey"]);
22 - assert.match(legend.summary, /B\/BP=green/);
23 -});

pi/agent/skills/win32-drive/SKILL.md

Added
new file mode 100644
1 +---
2 +name: win32-drive
3 +description: "Use on Windows to observe or drive local desktop GUI apps: enumerate windows, screenshot desktop/window/region, pick pixel colors, read UI Automation, cursor/idle/clipboard/theme, click/type/hotkey/window actions. Racing/mutating actions auto-show a red guard and wait for user idle."
4 +compatibility: "Windows PowerShell 5.1+"
5 +---
7 +# Win32 Drive
9 +Run `scripts/win32-drive.ps1` relative to this skill.
11 +```powershell
12 +powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/win32-drive.ps1 <cmd> [opts]
13 +```
15 +All commands emit JSON. On nonzero exit, JSON has `ok:false,error`.
17 +## Safety
19 +Nonracing: `help`, `list`, `shot`, `pixel`, `uia`, `cursor`, `idle`, clipboard read, theme read, `overlay`.
21 +Racing/mutating: `click`, `type`, `key`, `window`, `clipboard -Set`, theme set. These fade a 16px red border/ring, wait 800ms user-idle, then act. Screenshots never show the guard.
23 +## Commands
25 +```text
26 +help
27 +list
28 +shot [-Hwnd n|-Process p -TitleContains t|-X x -Y y -Width w -Height h] [-Out file.png]
29 +pixel -X x -Y y
30 +uia [-Hwnd n|-Process p|-TitleContains t] [-Depth n]
31 +cursor
32 +idle
33 +clipboard | clipboard -Set text
34 +theme | theme -Mode dark|light [-Scope apps|system|both]
35 +overlay [-X x -Y y] [-DurationMs ms]
36 +click [-Hwnd n|-Process p|-TitleContains t] [-X x -Y y] [-Button left|right] [-Count n]
37 +type [-Hwnd n|-Process p|-TitleContains t] -Text text
38 +key [-Hwnd n|-Process p|-TitleContains t] -Keys '^s'
39 +window -Hwnd n -Action move|min|max|restore|close [-X x -Y y -Width w -Height h]
40 +```
42 +Selector preference: `-Hwnd` > `-Process` + `-TitleContains` > unique `-TitleContains` > coordinates.
44 +`click` coordinates are screen pixels unless a window selector is present; then they are window-relative. Without `-X/-Y`, window click targets center.
46 +After `shot`, immediately read the returned PNG path with the harness `read` tool.
48 +Limits: no UAC secure desktop/lock screen. Elevated apps may need elevated agent. GPU/fullscreen windows may need region/desktop screenshot fallback. Theme only updates Windows plus apps that follow system theme; apps/sites with explicit themes may ignore it.

pi/agent/skills/win32-drive/scripts/win32-drive.ps1

Added
new file mode 100644
1 +$raw = [Environment]::GetCommandLineArgs()
2 +$scriptIndex = -1
3 +$scriptName = [IO.Path]::GetFileName($PSCommandPath)
4 +for ($i = 0; $i -lt $raw.Count; $i++) {
5 + try {
6 + if ([IO.Path]::GetFileName([string]$raw[$i]) -eq $scriptName) { $scriptIndex = $i }
7 + } catch {}
8 +}
9 +$argv = @()
10 +if ($scriptIndex -ge 0) {
11 + for ($i = $scriptIndex + 1; $i -lt $raw.Count; $i++) { $argv += [string] $raw[$i] }
13 +$Command = 'help'
14 +$Rest = @()
15 +if ($argv.Count -gt 0) {
16 + $Command = [string] $argv[0]
17 + if ($argv.Count -gt 1) { $Rest = @($argv[1..($argv.Count - 1)]) }
20 +$ErrorActionPreference = 'Stop'
21 +Add-Type -AssemblyName System.Drawing,System.Windows.Forms
22 +Add-Type @"
23 +using System;
24 +using System.Text;
25 +using System.Runtime.InteropServices;
27 +public static class Win32DriveNative {
28 + public delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
30 + [StructLayout(LayoutKind.Sequential)] public struct RECT { public int Left; public int Top; public int Right; public int Bottom; }
31 + [StructLayout(LayoutKind.Sequential)] public struct POINT { public int X; public int Y; }
32 + [StructLayout(LayoutKind.Sequential)] public struct LASTINPUTINFO { public uint cbSize; public uint dwTime; }
34 + [DllImport("user32.dll")] public static extern bool EnumWindows(EnumWindowsProc cb, IntPtr lParam);
35 + [DllImport("user32.dll")] public static extern bool IsWindowVisible(IntPtr hWnd);
36 + [DllImport("user32.dll")] public static extern bool IsWindow(IntPtr hWnd);
37 + [DllImport("user32.dll", CharSet=CharSet.Unicode)] public static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count);
38 + [DllImport("user32.dll")] public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint pid);
39 + [DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr hWnd, out RECT rect);
40 + [DllImport("dwmapi.dll")] public static extern int DwmGetWindowAttribute(IntPtr hwnd, int attr, out RECT rect, int size);
41 + [DllImport("user32.dll")] public static extern bool PrintWindow(IntPtr hwnd, IntPtr hdcBlt, uint flags);
42 + [DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr hWnd);
43 + [DllImport("user32.dll")] public static extern bool MoveWindow(IntPtr hWnd, int x, int y, int w, int h, bool repaint);
44 + [DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr hWnd, int cmd);
45 + [DllImport("user32.dll")] public static extern bool PostMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
46 + [DllImport("user32.dll")] public static extern bool SetCursorPos(int x, int y);
47 + [DllImport("user32.dll")] public static extern void mouse_event(uint flags, uint dx, uint dy, uint data, UIntPtr extraInfo);
48 + [DllImport("user32.dll")] public static extern bool GetCursorPos(out POINT point);
49 + [DllImport("user32.dll")] public static extern bool GetLastInputInfo(ref LASTINPUTINFO info);
50 + [DllImport("user32.dll", CharSet=CharSet.Unicode, SetLastError=true)] public static extern IntPtr SendMessageTimeout(IntPtr hWnd, uint msg, UIntPtr wParam, string lParam, uint flags, uint timeout, out UIntPtr result);
51 + [DllImport("kernel32.dll")] public static extern uint GetTickCount();
53 +"@
55 +function Write-Json($Value) {
56 + $Value | ConvertTo-Json -Depth 24 -Compress
59 +function Parse-Options([string[]] $ArgList) {
60 + $opts = @{}
61 + $pos = @()
62 + $valueOptions = @('Hwnd','Process','TitleContains','X','Y','Width','Height','Out','Text','Keys','Action','Button','Count','DurationMs','IdleMs','TimeoutMs','Set','Depth','Mode','Scope')
63 + for ($i = 0; $i -lt $ArgList.Count; $i++) {
64 + $arg = $ArgList[$i]
65 + if ($arg.StartsWith('-')) {
66 + $key = $arg.TrimStart('-')
67 + if ($valueOptions -notcontains $key) { throw "Unknown option: -$key" }
68 + if ($i + 1 -ge $ArgList.Count) { throw "Missing value for -$key" }
69 + $i++
70 + $opts[$key] = $ArgList[$i]
71 + } else {
72 + $pos += $arg
73 + }
74 + }
75 + if ($pos.Count -gt 0) { throw ('Unexpected positional args: ' + ($pos -join ' ')) }
76 + $opts
79 +function Int-Opt($Opts, [string] $Name, $Default = $null) {
80 + if (-not $Opts.ContainsKey($Name)) { return $Default }
81 + [int] $Opts[$Name]
84 +function Long-Opt($Opts, [string] $Name, $Default = $null) {
85 + if (-not $Opts.ContainsKey($Name)) { return $Default }
86 + [int64] $Opts[$Name]
89 +function Str-Opt($Opts, [string] $Name, $Default = $null) {
90 + if (-not $Opts.ContainsKey($Name)) { return $Default }
91 + [string] $Opts[$Name]
94 +function Get-Windows {
95 + $script:win32DriveWindows = @()
96 + [Win32DriveNative]::EnumWindows({ param($h, $l)
97 + if ([Win32DriveNative]::IsWindowVisible($h)) {
98 + $sb = [Text.StringBuilder]::new(1024)
99 + [void] [Win32DriveNative]::GetWindowText($h, $sb, $sb.Capacity)
100 + $title = $sb.ToString()
101 + if ($title.Trim().Length -gt 0) {
102 + [uint32] $procId = 0
103 + [void] [Win32DriveNative]::GetWindowThreadProcessId($h, [ref] $procId)
104 + $proc = Get-Process -Id $procId -ErrorAction SilentlyContinue
105 + $rect = Get-Rect $h
106 + $script:win32DriveWindows += [pscustomobject] [ordered] @{
107 + hwnd = $h.ToInt64()
108 + pid = [int64] $procId
109 + process = if ($proc) { $proc.ProcessName } else { $null }
110 + title = $title
111 + x = $rect.Left
112 + y = $rect.Top
113 + width = $rect.Right - $rect.Left
114 + height = $rect.Bottom - $rect.Top
118 + $true
119 + }, [IntPtr]::Zero) | Out-Null
120 + $script:win32DriveWindows
123 +function Get-Rect([IntPtr] $Hwnd) {
124 + $rect = New-Object Win32DriveNative+RECT
125 + $size = [Runtime.InteropServices.Marshal]::SizeOf([type] [Win32DriveNative+RECT])
126 + $hr = [Win32DriveNative]::DwmGetWindowAttribute($Hwnd, 9, [ref] $rect, $size)
127 + if ($hr -ne 0) { [void] [Win32DriveNative]::GetWindowRect($Hwnd, [ref] $rect) }
128 + $rect
131 +function Resolve-Window($Opts) {
132 + if ($Opts.ContainsKey('Hwnd')) {
133 + $hwnd = [IntPtr] (Long-Opt $Opts 'Hwnd')
134 + if (-not [Win32DriveNative]::IsWindow($hwnd)) { throw 'Invalid window handle' }
135 + return $hwnd
137 + $wins = @(Get-Windows)
138 + $proc = Str-Opt $Opts 'Process'
139 + $title = Str-Opt $Opts 'TitleContains'
140 + if ($proc) { $wins = @($wins | Where-Object { $_.process -eq $proc }) }
141 + if ($title) { $wins = @($wins | Where-Object { $_.title.IndexOf($title, [StringComparison]::OrdinalIgnoreCase) -ge 0 }) }
142 + if ($wins.Count -eq 0) { throw 'No matching window' }
143 + if ($wins.Count -gt 1) { throw ('Ambiguous window: ' + (($wins | Select-Object -First 8 hwnd,process,title) | ConvertTo-Json -Compress)) }
144 + [IntPtr] $wins[0].hwnd
147 +function Get-IdleMs {
148 + $info = New-Object Win32DriveNative+LASTINPUTINFO
149 + $info.cbSize = [Runtime.InteropServices.Marshal]::SizeOf($info)
150 + [void] [Win32DriveNative]::GetLastInputInfo([ref] $info)
151 + [int64] ([Win32DriveNative]::GetTickCount() - $info.dwTime)
154 +function Wait-UserIdle([int] $IdleMs, [int] $TimeoutMs) {
155 + $start = Get-Date
156 + while ((Get-IdleMs) -lt $IdleMs) {
157 + if (((Get-Date) - $start).TotalMilliseconds -gt $TimeoutMs) { throw "User not idle for $IdleMs ms" }
158 + Start-Sleep -Milliseconds 100
162 +function Draw-Indicator($X = $null, $Y = $null, [int] $DurationMs = 180) {
163 + $forms = @()
164 + foreach ($screen in [Windows.Forms.Screen]::AllScreens) {
165 + $b = $screen.Bounds
166 + $targetX = $X
167 + $targetY = $Y
168 + $form = New-Object Windows.Forms.Form
169 + $form.FormBorderStyle = 'None'
170 + $form.StartPosition = 'Manual'
171 + $form.Bounds = $b
172 + $form.TopMost = $true
173 + $form.BackColor = [Drawing.Color]::Magenta
174 + $form.TransparencyKey = [Drawing.Color]::Magenta
175 + $form.ShowInTaskbar = $false
176 + $form.Opacity = 0.0
177 + $form.Add_Paint({
178 + param($sender, $event)
179 + $event.Graphics.SmoothingMode = [Drawing.Drawing2D.SmoothingMode]::AntiAlias
180 + $pen = New-Object Drawing.Pen ([Drawing.Color]::Red), 16
181 + try {
182 + $event.Graphics.DrawRectangle($pen, 8, 8, $sender.Width - 17, $sender.Height - 17)
183 + if ($targetX -ne $null -and $targetY -ne $null -and $b.Contains([Drawing.Point]::new([int]$targetX, [int]$targetY))) {
184 + $localX = [int]$targetX - $b.Left
185 + $localY = [int]$targetY - $b.Top
186 + $event.Graphics.DrawEllipse($pen, $localX - 24, $localY - 24, 48, 48)
188 + } finally {
189 + $pen.Dispose()
191 + }.GetNewClosure())
192 + $form.Show()
193 + $forms += $form
195 + foreach ($opacity in 0.2,0.45,0.7,0.9) {
196 + foreach ($form in $forms) { $form.Opacity = $opacity; $form.Invalidate() }
197 + [Windows.Forms.Application]::DoEvents()
198 + Start-Sleep -Milliseconds 20
200 + if ($DurationMs -gt 0) { Start-Sleep -Milliseconds $DurationMs }
201 + foreach ($opacity in 0.7,0.45,0.2,0.0) {
202 + foreach ($form in $forms) { $form.Opacity = $opacity }
203 + [Windows.Forms.Application]::DoEvents()
204 + Start-Sleep -Milliseconds 20
206 + foreach ($form in $forms) { $form.Close(); $form.Dispose() }
207 + [Windows.Forms.Application]::DoEvents()
210 +function Invoke-RacingGuard($Opts, $X = $null, $Y = $null) {
211 + $idle = Int-Opt $Opts 'IdleMs' 800
212 + $timeout = Int-Opt $Opts 'TimeoutMs' 10000
213 + Draw-Indicator $X $Y 80
214 + Wait-UserIdle $idle $timeout
215 + Draw-Indicator $X $Y 80
218 +function Theme-Name($Value) {
219 + if ([int]$Value -eq 0) { 'dark' } else { 'light' }
222 +function Theme-Value([string] $Mode) {
223 + switch ($Mode.ToLowerInvariant()) {
224 + 'dark' { 0 }
225 + 'light' { 1 }
226 + default { throw 'Mode must be dark or light' }
230 +function Get-Theme {
231 + $path = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize'
232 + $item = Get-ItemProperty -Path $path -ErrorAction SilentlyContinue
233 + $apps = if ($item -and $null -ne $item.AppsUseLightTheme) { $item.AppsUseLightTheme } else { 1 }
234 + $system = if ($item -and $null -ne $item.SystemUsesLightTheme) { $item.SystemUsesLightTheme } else { 1 }
235 + [pscustomobject] [ordered] @{ ok = $true; apps = Theme-Name $apps; system = Theme-Name $system }
238 +function Broadcast-ThemeChange {
239 + $result = [UIntPtr]::Zero
240 + foreach ($name in @('ImmersiveColorSet','WindowsThemeElement','Software\Microsoft\Windows\CurrentVersion\Themes\Personalize')) {
241 + [void] [Win32DriveNative]::SendMessageTimeout([IntPtr]0xffff, 0x001A, [UIntPtr]::Zero, $name, 2, 5000, [ref] $result)
243 + [void] [Win32DriveNative]::SendMessageTimeout([IntPtr]0xffff, 0x031A, [UIntPtr]::Zero, $null, 2, 5000, [ref] $result)
244 + Start-Process -WindowStyle Hidden -FilePath rundll32.exe -ArgumentList 'user32.dll,UpdatePerUserSystemParameters 1, True' -Wait
247 +function Set-Theme([string] $Mode, [string] $Scope) {
248 + $value = Theme-Value $Mode
249 + $scopeName = if ($Scope) { $Scope.ToLowerInvariant() } else { 'both' }
250 + if (@('apps','system','both') -notcontains $scopeName) { throw 'Scope must be apps, system, or both' }
251 + $path = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize'
252 + New-Item -Path $path -Force | Out-Null
253 + if ($scopeName -eq 'apps' -or $scopeName -eq 'both') { Set-ItemProperty -Path $path -Name AppsUseLightTheme -Type DWord -Value $value }
254 + if ($scopeName -eq 'system' -or $scopeName -eq 'both') { Set-ItemProperty -Path $path -Name SystemUsesLightTheme -Type DWord -Value $value }
255 + Broadcast-ThemeChange
256 + Get-Theme | Add-Member -PassThru -NotePropertyName scope -NotePropertyValue $scopeName
259 +function Save-Bitmap($Bitmap, [string] $Out) {
260 + if (-not $Out) { $Out = Join-Path $env:TEMP ("win32-drive-shot-" + [guid]::NewGuid().ToString('N') + '.png') }
261 + $full = [IO.Path]::GetFullPath($Out)
262 + $parent = Split-Path -Parent $full
263 + if ($parent -and -not (Test-Path $parent)) { New-Item -ItemType Directory -Force -Path $parent | Out-Null }
264 + $Bitmap.Save($full, [Drawing.Imaging.ImageFormat]::Png)
265 + $full
268 +function Get-PixelColor([int] $X, [int] $Y) {
269 + $bmp = [Drawing.Bitmap]::new(1, 1)
270 + $g = [Drawing.Graphics]::FromImage($bmp)
271 + try {
272 + $g.CopyFromScreen($X, $Y, 0, 0, [Drawing.Size]::new(1, 1))
273 + $c = $bmp.GetPixel(0, 0)
274 + [pscustomobject] [ordered] @{ ok = $true; x = $X; y = $Y; r = $c.R; g = $c.G; b = $c.B; hex = ('#{0:X2}{1:X2}{2:X2}' -f $c.R, $c.G, $c.B) }
275 + } finally {
276 + $g.Dispose(); $bmp.Dispose()
280 +function Capture-Region([int] $X, [int] $Y, [int] $Width, [int] $Height, [string] $Out) {
281 + $bmp = [Drawing.Bitmap]::new($Width, $Height)
282 + $g = [Drawing.Graphics]::FromImage($bmp)
283 + try {
284 + $g.CopyFromScreen($X, $Y, 0, 0, $bmp.Size)
285 + $path = Save-Bitmap $bmp $Out
286 + [pscustomobject] [ordered] @{ ok = $true; path = $path; x = $X; y = $Y; width = $Width; height = $Height; mode = 'region' }
287 + } finally {
288 + $g.Dispose(); $bmp.Dispose()
292 +function Capture-Window([IntPtr] $Hwnd, [string] $Out) {
293 + $r = Get-Rect $Hwnd
294 + $w = $r.Right - $r.Left
295 + $h = $r.Bottom - $r.Top
296 + if ($w -le 0 -or $h -le 0) { throw 'Window has empty bounds' }
297 + $bmp = [Drawing.Bitmap]::new($w, $h)
298 + $g = [Drawing.Graphics]::FromImage($bmp)
299 + $used = 'printwindow'
300 + try {
301 + $hdc = $g.GetHdc()
302 + $ok = [Win32DriveNative]::PrintWindow($Hwnd, $hdc, 2)
303 + $g.ReleaseHdc($hdc)
304 + if (-not $ok) {
305 + $used = 'screen-crop'
306 + $g.CopyFromScreen($r.Left, $r.Top, 0, 0, $bmp.Size)
308 + $path = Save-Bitmap $bmp $Out
309 + [pscustomobject] [ordered] @{ ok = $true; path = $path; hwnd = $Hwnd.ToInt64(); x = $r.Left; y = $r.Top; width = $w; height = $h; mode = $used }
310 + } finally {
311 + $g.Dispose(); $bmp.Dispose()
315 +function Dump-Uia($Element, [int] $Depth, [int] $MaxDepth) {
316 + if ($null -eq $Element) { return $null }
317 + $rect = $Element.Current.BoundingRectangle
318 + $item = [ordered] @{
319 + name = $Element.Current.Name
320 + automationId = $Element.Current.AutomationId
321 + className = $Element.Current.ClassName
322 + controlType = $Element.Current.ControlType.ProgrammaticName
323 + x = [int] $rect.X
324 + y = [int] $rect.Y
325 + width = [int] $rect.Width
326 + height = [int] $rect.Height
327 + children = @()
329 + if ($Depth -lt $MaxDepth) {
330 + $children = $Element.FindAll([Windows.Automation.TreeScope]::Children, [Windows.Automation.Condition]::TrueCondition)
331 + foreach ($child in $children) { $item.children += Dump-Uia $child ($Depth + 1) $MaxDepth }
333 + [pscustomobject] $item
336 +function Escape-SendKeysText([string] $Text) {
337 + $special = '+^%~()[]'
338 + $out = New-Object Text.StringBuilder
339 + foreach ($ch in $Text.ToCharArray()) {
340 + switch ($ch) {
341 + "`r" { break }
342 + "`n" { [void] $out.Append('{ENTER}'); break }
343 + "`t" { [void] $out.Append('{TAB}'); break }
344 + '{' { [void] $out.Append('{{}'); break }
345 + '}' { [void] $out.Append('{}}'); break }
346 + default {
347 + if ($special.IndexOf($ch) -ge 0) { [void] $out.Append('{').Append($ch).Append('}') }
348 + else { [void] $out.Append($ch) }
352 + $out.ToString()
355 +function Show-Help {
356 + [pscustomobject] [ordered] @{
357 + ok = $true
358 + runtime = 'Windows PowerShell 5.1+'
359 + coordinates = 'screen pixels; when -Hwnd and -X/-Y are used for click, X/Y are window-relative'
360 + racingGuard = 'racing commands fade a 16px red border/ring, wait for user idle, then act'
361 + commands = [ordered] @{
362 + help = [ordered] @{ racing = $false; usage = 'help' }
363 + list = [ordered] @{ racing = $false; usage = 'list' }
364 + shot = [ordered] @{ racing = $false; usage = 'shot [-Hwnd n|-Process p -TitleContains t|-X x -Y y -Width w -Height h] [-Out file.png]' }
365 + pixel = [ordered] @{ racing = $false; usage = 'pixel -X x -Y y' }
366 + uia = [ordered] @{ racing = $false; usage = 'uia [-Hwnd n|-Process p|-TitleContains t] [-Depth n]' }
367 + cursor = [ordered] @{ racing = $false; usage = 'cursor' }
368 + idle = [ordered] @{ racing = $false; usage = 'idle' }
369 + clipboard = [ordered] @{ racing = $null; usage = 'clipboard | clipboard -Set text' }
370 + theme = [ordered] @{ racing = $true; usage = 'theme | theme -Mode dark|light [-Scope apps|system|both]' }
371 + overlay = [ordered] @{ racing = $false; usage = 'overlay [-X x -Y y] [-DurationMs ms]' }
372 + click = [ordered] @{ racing = $true; usage = 'click [-Hwnd n|-Process p|-TitleContains t] -X x -Y y [-Button left|right] [-Count n]' }
373 + type = [ordered] @{ racing = $true; usage = 'type [-Hwnd n|-Process p|-TitleContains t] -Text text' }
374 + key = [ordered] @{ racing = $true; usage = 'key [-Hwnd n|-Process p|-TitleContains t] -Keys "^s"' }
375 + window = [ordered] @{ racing = $true; usage = 'window -Action move|min|max|restore|close -Hwnd n [-X x -Y y -Width w -Height h]' }
380 +function Invoke-CommandImpl {
381 + $opts = Parse-Options $Rest
382 + switch ($Command.ToLowerInvariant()) {
383 + 'help' { return Show-Help }
384 + 'list' { return [pscustomobject] [ordered] @{ ok = $true; windows = @(Get-Windows) } }
385 + 'idle' { return [pscustomobject] [ordered] @{ ok = $true; idleMs = Get-IdleMs } }
386 + 'cursor' {
387 + $p = New-Object Win32DriveNative+POINT
388 + [void] [Win32DriveNative]::GetCursorPos([ref] $p)
389 + return [pscustomobject] [ordered] @{ ok = $true; x = $p.X; y = $p.Y }
391 + 'overlay' {
392 + Draw-Indicator (Int-Opt $opts 'X') (Int-Opt $opts 'Y') (Int-Opt $opts 'DurationMs' 650)
393 + return [pscustomobject] [ordered] @{ ok = $true }
395 + 'pixel' {
396 + $x = Int-Opt $opts 'X'
397 + $y = Int-Opt $opts 'Y'
398 + if ($x -eq $null -or $y -eq $null) { throw 'pixel needs -X and -Y' }
399 + return Get-PixelColor $x $y
401 + 'shot' {
402 + $out = Str-Opt $opts 'Out'
403 + if ($opts.ContainsKey('Hwnd') -or $opts.ContainsKey('Process') -or $opts.ContainsKey('TitleContains')) { return Capture-Window (Resolve-Window $opts) $out }
404 + $screen = [System.Windows.Forms.SystemInformation]::VirtualScreen
405 + $x = Int-Opt $opts 'X' $screen.Left
406 + $y = Int-Opt $opts 'Y' $screen.Top
407 + $w = Int-Opt $opts 'Width' $screen.Width
408 + $h = Int-Opt $opts 'Height' $screen.Height
409 + return Capture-Region $x $y $w $h $out
411 + 'uia' {
412 + Add-Type -AssemblyName UIAutomationClient,UIAutomationTypes
413 + $depth = Int-Opt $opts 'Depth' 2
414 + if ($opts.ContainsKey('Hwnd') -or $opts.ContainsKey('Process') -or $opts.ContainsKey('TitleContains')) {
415 + $el = [Windows.Automation.AutomationElement]::FromHandle((Resolve-Window $opts))
416 + } else {
417 + $el = [Windows.Automation.AutomationElement]::FocusedElement
419 + return [pscustomobject] [ordered] @{ ok = $true; tree = Dump-Uia $el 0 $depth }
421 + 'clipboard' {
422 + if ($opts.ContainsKey('Set')) {
423 + Invoke-RacingGuard $opts
424 + [Windows.Forms.Clipboard]::SetText((Str-Opt $opts 'Set'))
425 + return [pscustomobject] [ordered] @{ ok = $true; action = 'set' }
427 + return [pscustomobject] [ordered] @{ ok = $true; text = [Windows.Forms.Clipboard]::GetText() }
429 + 'theme' {
430 + if (-not $opts.ContainsKey('Mode')) { return Get-Theme }
431 + Invoke-RacingGuard $opts
432 + return Set-Theme (Str-Opt $opts 'Mode') (Str-Opt $opts 'Scope' 'both')
434 + 'click' {
435 + $button = (Str-Opt $opts 'Button' 'left').ToLowerInvariant()
436 + $count = Int-Opt $opts 'Count' 1
437 + $x = Int-Opt $opts 'X'
438 + $y = Int-Opt $opts 'Y'
439 + $hwnd = $null
440 + if ($opts.ContainsKey('Hwnd') -or $opts.ContainsKey('Process') -or $opts.ContainsKey('TitleContains')) {
441 + $hwnd = Resolve-Window $opts
442 + $r = Get-Rect $hwnd
443 + [void] [Win32DriveNative]::SetForegroundWindow($hwnd)
444 + if ($x -eq $null) { $x = [int] (($r.Left + $r.Right) / 2) } else { $x = $r.Left + $x }
445 + if ($y -eq $null) { $y = [int] (($r.Top + $r.Bottom) / 2) } else { $y = $r.Top + $y }
447 + if ($x -eq $null -or $y -eq $null) { throw 'click needs -X and -Y unless targeting a window center' }
448 + Invoke-RacingGuard $opts $x $y
449 + [void] [Win32DriveNative]::SetCursorPos($x, $y)
450 + $down = if ($button -eq 'right') { 0x0008 } else { 0x0002 }
451 + $up = if ($button -eq 'right') { 0x0010 } else { 0x0004 }
452 + for ($i = 0; $i -lt $count; $i++) {
453 + [Win32DriveNative]::mouse_event($down, 0, 0, 0, [UIntPtr]::Zero)
454 + Start-Sleep -Milliseconds 45
455 + [Win32DriveNative]::mouse_event($up, 0, 0, 0, [UIntPtr]::Zero)
456 + Start-Sleep -Milliseconds 80
458 + return [pscustomobject] [ordered] @{ ok = $true; x = $x; y = $y; button = $button; count = $count }
460 + 'type' {
461 + $text = Str-Opt $opts 'Text'
462 + if ($null -eq $text) { throw 'type needs -Text' }
463 + if ($opts.ContainsKey('Hwnd') -or $opts.ContainsKey('Process') -or $opts.ContainsKey('TitleContains')) { [void] [Win32DriveNative]::SetForegroundWindow((Resolve-Window $opts)) }
464 + Invoke-RacingGuard $opts
465 + [Windows.Forms.SendKeys]::SendWait((Escape-SendKeysText $text))
466 + return [pscustomobject] [ordered] @{ ok = $true; chars = $text.Length }
468 + 'key' {
469 + $keySpec = Str-Opt $opts 'Keys'
470 + if (-not $keySpec) { throw 'key needs -Keys' }
471 + if ($opts.ContainsKey('Hwnd') -or $opts.ContainsKey('Process') -or $opts.ContainsKey('TitleContains')) { [void] [Win32DriveNative]::SetForegroundWindow((Resolve-Window $opts)) }
472 + Invoke-RacingGuard $opts
473 + [Windows.Forms.SendKeys]::SendWait($keySpec)
474 + return [pscustomobject] [ordered] @{ ok = $true; keys = $keySpec }
476 + 'window' {
477 + $action = (Str-Opt $opts 'Action').ToLowerInvariant()
478 + if (-not $action) { throw 'window needs -Action' }
479 + $hwnd = Resolve-Window $opts
480 + Invoke-RacingGuard $opts
481 + switch ($action) {
482 + 'move' {
483 + $r = Get-Rect $hwnd
484 + $x = Int-Opt $opts 'X' $r.Left
485 + $y = Int-Opt $opts 'Y' $r.Top
486 + $w = Int-Opt $opts 'Width' ($r.Right - $r.Left)
487 + $h = Int-Opt $opts 'Height' ($r.Bottom - $r.Top)
488 + [void] [Win32DriveNative]::MoveWindow($hwnd, $x, $y, $w, $h, $true)
490 + 'min' { [void] [Win32DriveNative]::ShowWindow($hwnd, 6) }
491 + 'max' { [void] [Win32DriveNative]::ShowWindow($hwnd, 3) }
492 + 'restore' { [void] [Win32DriveNative]::ShowWindow($hwnd, 9) }
493 + 'close' { [void] [Win32DriveNative]::PostMessage($hwnd, 0x0010, [IntPtr]::Zero, [IntPtr]::Zero) }
494 + default { throw "Unknown window action: $action" }
496 + return [pscustomobject] [ordered] @{ ok = $true; hwnd = $hwnd.ToInt64(); action = $action }
498 + default { throw "Unknown command: $Command" }
502 +try {
503 + Write-Json (Invoke-CommandImpl)
504 + exit 0
505 +} catch {
506 + Write-Json ([pscustomobject] [ordered] @{ ok = $false; error = $_.Exception.Message; command = $Command })
507 + exit 1

pi/agent/skills/win32-drive/scripts/win32-drive.test.ps1

Added
new file mode 100644
1 +$ErrorActionPreference = 'Stop'
2 +$script = Join-Path $PSScriptRoot 'win32-drive.ps1'
3 +if (-not (Test-Path $script)) { throw "Missing script: $script" }
5 +function Invoke-Raw($arguments, [switch] $AllowFail) {
6 + $raw = & powershell.exe -NoProfile -ExecutionPolicy Bypass -File $script @arguments
7 + $code = $LASTEXITCODE
8 + if (-not $AllowFail -and $code -ne 0) { throw "Command failed: $($arguments -join ' ')`n$raw" }
9 + [pscustomobject]@{ Code = $code; Json = ($raw | ConvertFrom-Json); Raw = $raw }
12 +function Invoke-Json($arguments) { (Invoke-Raw $arguments).Json }
13 +function Assert($condition, $message) { if (-not $condition) { throw $message } }
14 +function Assert-File($path) { Assert (Test-Path $path) "missing file: $path" }
15 +function Assert-Err($arguments, $pattern) {
16 + $r = Invoke-Raw $arguments -AllowFail
17 + Assert ($r.Code -ne 0) "expected failure: $($arguments -join ' ')"
18 + Assert ($r.Json.ok -eq $false) 'failure JSON must have ok=false'
19 + Assert ($r.Json.error -match $pattern) "error '$($r.Json.error)' does not match '$pattern'"
21 +function Start-TestWindow($title) {
22 + $app = Join-Path $env:TEMP ("win32-drive-app-" + [guid]::NewGuid().ToString('N') + '.ps1')
23 + @"
24 +`$ErrorActionPreference = 'Stop'
25 +Add-Type -AssemblyName System.Windows.Forms,System.Drawing
26 +`$form = New-Object Windows.Forms.Form
27 +`$form.Text = '$title'
28 +`$form.StartPosition = 'Manual'
29 +`$form.SetBounds(80,80,420,260)
30 +`$box = New-Object Windows.Forms.TextBox
31 +`$box.Multiline = `$true
32 +`$box.Name = 'InputBox'
33 +`$box.SetBounds(20,20,360,140)
34 +`$button = New-Object Windows.Forms.Button
35 +`$button.Name = 'ClickMe'
36 +`$button.Text = 'ClickMe'
37 +`$button.SetBounds(20,175,100,32)
38 +`$button.Add_Click({ `$form.Text = '$title clicked' })
39 +`$form.Controls.Add(`$box)
40 +`$form.Controls.Add(`$button)
41 +`$form.Add_Shown({ `$box.Focus() })
42 +[Windows.Forms.Application]::Run(`$form)
43 +"@ | Set-Content -Encoding UTF8 $app
44 + $p = Start-Process powershell.exe -ArgumentList @('-STA','-NoProfile','-ExecutionPolicy','Bypass','-File',$app) -PassThru
45 + $deadline = (Get-Date).AddSeconds(8)
46 + do {
47 + Start-Sleep -Milliseconds 150
48 + $wins = @(Invoke-Json @('list')).windows | Where-Object { $_.pid -eq $p.Id -and $_.title -like "$title*" }
49 + } while ($wins.Count -eq 0 -and (Get-Date) -lt $deadline)
50 + if ($wins.Count -eq 0) { Stop-Process -Id $p.Id -Force -ErrorAction SilentlyContinue; throw 'test window did not appear' }
51 + [pscustomobject]@{ Process = $p; Script = $app; Window = $wins[0] }
54 +$created = @()
55 +$originalClipboard = $null
56 +try {
57 + try { $originalClipboard = (Invoke-Json @('clipboard')).text } catch { $originalClipboard = $null }
59 + $help = Invoke-Json @('help')
60 + foreach ($cmd in 'help','list','shot','pixel','uia','cursor','idle','clipboard','overlay','click','type','key','window','theme') {
61 + Assert ($help.commands.PSObject.Properties.Name -contains $cmd) "help missing $cmd"
62 + }
63 + foreach ($cmd in 'click','type','key','window','theme') { Assert ($help.commands.$cmd.racing -eq $true) "$cmd must be racing" }
64 + foreach ($cmd in 'list','shot','pixel','uia','cursor','idle','overlay') { Assert ($help.commands.$cmd.racing -eq $false) "$cmd must be nonracing" }
66 + $list = Invoke-Json @('list')
67 + Assert ($list.windows.Count -gt 0) 'list should return visible windows'
68 + $idle = Invoke-Json @('idle')
69 + Assert ($idle.idleMs -is [int] -or $idle.idleMs -is [long]) 'idleMs must be numeric'
70 + $cursor = Invoke-Json @('cursor')
71 + Assert ($cursor.x -is [int] -and $cursor.y -is [int]) 'cursor must have x/y ints'
72 + Assert ((Invoke-Json @('overlay','-DurationMs','1')).ok) 'overlay failed'
73 + Assert ((Invoke-Json @('overlay','-X','10','-Y','10','-DurationMs','1')).ok) 'overlay target failed'
75 + $px = Invoke-Json @('pixel','-X','0','-Y','0')
76 + Assert ($px.hex -match '^#[0-9A-F]{6}$' -and $px.r -ge 0 -and $px.r -le 255 -and $px.g -ge 0 -and $px.g -le 255 -and $px.b -ge 0 -and $px.b -le 255) 'pixel failed'
78 + $shotPath = Join-Path $env:TEMP ("win32-drive-test-region-" + [guid]::NewGuid().ToString('N') + '.png')
79 + $created += $shotPath
80 + $shot = Invoke-Json @('shot','-X','0','-Y','0','-Width','8','-Height','8','-Out',$shotPath)
81 + Assert-File $shot.path
82 + Assert ($shot.width -eq 8 -and $shot.height -eq 8 -and $shot.mode -eq 'region') 'region shot metadata wrong'
84 + $app = Start-TestWindow ("Win32DriveTest-" + [guid]::NewGuid().ToString('N'))
85 + $created += $app.Script
86 + $hwnd = [string]$app.Window.hwnd
88 + $winShotPath = Join-Path $env:TEMP ("win32-drive-test-window-" + [guid]::NewGuid().ToString('N') + '.png')
89 + $created += $winShotPath
90 + $winShot = Invoke-Json @('shot','-Hwnd',$hwnd,'-Out',$winShotPath)
91 + Assert-File $winShot.path
92 + Assert ($winShot.hwnd -eq $app.Window.hwnd -and $winShot.width -gt 0 -and $winShot.height -gt 0) 'window shot metadata wrong'
94 + $byTitle = Invoke-Json @('shot','-Process','powershell','-TitleContains',$app.Window.title,'-Out',(Join-Path $env:TEMP ("win32-drive-test-title-" + [guid]::NewGuid().ToString('N') + '.png')))
95 + $created += $byTitle.path
96 + Assert-File $byTitle.path
98 + Assert ((Invoke-Json @('uia','-Depth','0')).ok) 'focused uia failed'
99 + $uia = Invoke-Json @('uia','-Hwnd',$hwnd,'-Depth','1')
100 + Assert ($uia.tree.name -like 'Win32DriveTest-*') 'uia root title wrong'
101 + Assert ($uia.tree.children.Count -gt 0) 'uia children missing'
103 + $theme = Invoke-Json @('theme')
104 + Assert ($theme.apps -in @('dark','light') -and $theme.system -in @('dark','light')) 'theme read failed'
105 + Assert ((Invoke-Json @('theme','-Mode',$theme.apps,'-Scope','apps','-IdleMs','0','-TimeoutMs','1000')).apps -eq $theme.apps) 'theme apps set failed'
106 + Assert ((Invoke-Json @('theme','-Mode',$theme.system,'-Scope','system','-IdleMs','0','-TimeoutMs','1000')).system -eq $theme.system) 'theme system set failed'
107 + Assert-Err @('theme','-Mode','blue','-IdleMs','0','-TimeoutMs','1000') 'Mode must be dark or light'
108 + Assert-Err @('theme','-Mode',$theme.apps,'-Scope','wat','-IdleMs','0','-TimeoutMs','1000') 'Scope must be apps, system, or both'
110 + $clipValue = 'win32-drive-clip-' + [guid]::NewGuid().ToString('N')
111 + Assert ((Invoke-Json @('clipboard','-Set',$clipValue,'-IdleMs','0','-TimeoutMs','1000')).ok) 'clipboard set failed'
112 + Assert ((Invoke-Json @('clipboard')).text -eq $clipValue) 'clipboard read after set failed'
114 + Assert ((Invoke-Json @('click','-Hwnd',$hwnd,'-IdleMs','0','-TimeoutMs','1000')).ok) 'center click failed'
115 + Assert ((Invoke-Json @('click','-Hwnd',$hwnd,'-X','40','-Y','40','-IdleMs','0','-TimeoutMs','1000')).ok) 'left click failed'
116 + Assert ((Invoke-Json @('click','-Hwnd',$hwnd,'-X','42','-Y','42','-Button','right','-IdleMs','0','-TimeoutMs','1000')).ok) 'right click failed'
117 + $typed = 'abc+^%~(){}[]'
118 + Assert ((Invoke-Json @('type','-Hwnd',$hwnd,'-Text',$typed,'-IdleMs','0','-TimeoutMs','1000')).chars -eq $typed.Length) 'type failed'
119 + Assert ((Invoke-Json @('key','-Hwnd',$hwnd,'-Keys','^a','-IdleMs','0','-TimeoutMs','1000')).ok) 'key failed'
120 + Assert ((Invoke-Json @('type','-Hwnd',$hwnd,'-Text','selected','-IdleMs','0','-TimeoutMs','1000')).ok) 'second type failed'
122 + Assert ((Invoke-Json @('window','-Hwnd',$hwnd,'-Action','move','-X','100','-Y','100','-Width','430','-Height','270','-IdleMs','0','-TimeoutMs','1000')).ok) 'window move failed'
123 + Start-Sleep -Milliseconds 150
124 + $moved = @(Invoke-Json @('list')).windows | Where-Object hwnd -eq $app.Window.hwnd | Select-Object -First 1
125 + Assert ($moved.width -gt 350 -and $moved.height -gt 200) 'window move/list update failed'
126 + foreach ($action in 'min','restore','max','restore') {
127 + Assert ((Invoke-Json @('window','-Hwnd',$hwnd,'-Action',$action,'-IdleMs','0','-TimeoutMs','1000')).action -eq $action) "window $action failed"
128 + Start-Sleep -Milliseconds 150
130 + Assert ((Invoke-Json @('window','-Hwnd',$hwnd,'-Action','close','-IdleMs','0','-TimeoutMs','1000')).ok) 'window close failed'
131 + $app.Process.WaitForExit(5000) | Out-Null
132 + Assert ($app.Process.HasExited) 'test window did not close'
134 + Assert-Err @('wat') 'Unknown command'
135 + Assert-Err @('shot','-Bogus','x') 'Unknown option'
136 + Assert-Err @('shot','-X') 'Missing value'
137 + Assert-Err @('shot','-TitleContains',('definitely-no-window-' + [guid]::NewGuid().ToString('N'))) 'No matching window'
138 + Assert-Err @('window','-Hwnd','999999999','-Action','move','-IdleMs','0','-TimeoutMs','1000') 'Invalid window|empty bounds|failed'
139 + $bad = Start-TestWindow ("Win32DriveBadAction-" + [guid]::NewGuid().ToString('N'))
140 + $created += $bad.Script
141 + Assert-Err @('window','-Hwnd',([string]$bad.Window.hwnd),'-Action','wat','-IdleMs','0','-TimeoutMs','1000') 'Unknown window action'
142 + Stop-Process -Id $bad.Process.Id -Force -ErrorAction SilentlyContinue
144 + 'OK'
145 +} finally {
146 + if ($originalClipboard -ne $null) {
147 + & powershell.exe -NoProfile -ExecutionPolicy Bypass -File $script clipboard -Set $originalClipboard -IdleMs 0 -TimeoutMs 1000 | Out-Null
149 + if ($app -and -not $app.Process.HasExited) { Stop-Process -Id $app.Process.Id -Force -ErrorAction SilentlyContinue }
150 + foreach ($path in $created) { if ($path -and (Test-Path $path)) { Remove-Item $path -Force -ErrorAction SilentlyContinue } }

zed/settings.json

Modified

Previous version contains binary or non-UTF-8 data.

Current version contains binary or non-UTF-8 data.

zed/themes/nugu.json

Modified
13 13 "#7ba1aa"
15 15 "background.appearance": "opaque",
16 - "border": "#6f6f6f",
16 + "border": "#9d9d9d",
17 17 "border.variant": "#9d9d9d",
18 18 "border.focused": "#d86dd8",
19 19 "border.selected": "#d86dd8",
20 - "border.transparent": "#6f6f6f40",
21 - "border.disabled": "#6f6f6f60",
22 - "elevated_surface.background": "#6f6f6f",
20 + "border.transparent": "#9d9d9d00",
21 + "border.disabled": "#9d9d9d60",
22 + "elevated_surface.background": "#9d9d9d2c",
23 23 "surface.background": "#242424",
24 24 "background": "#121212",
25 25 "element.background": "#242424",
26 - "element.hover": "#6f6f6f",
27 - "element.active": "#9aabae",
28 - "element.selected": "#9aabae",
26 + "element.hover": "#9aabae0a",
27 + "element.active": "#9aabae0a",
28 + "element.selected": "#9aabae0a",
29 29 "element.disabled": "#24242480",
30 30 "drop_target.background": "#d86dd880",
31 31 "ghost_element.background": null,
32 32 "ghost_element.hover": "#9d9d9d80",
33 - "ghost_element.active": "#6f6f6f",
34 - "ghost_element.selected": "#9aabae80",
33 + "ghost_element.active": "#9aabae0a",
34 + "ghost_element.selected": "#9aabae0a",
35 35 "ghost_element.disabled": "#9d9d9d60",
36 36 "text": "#ededed",
37 - "text.muted": "#8b8b8b",
38 - "text.placeholder": "#8b8b8b99",
39 - "text.disabled": "#ededed60",
37 + "text.muted": "#9d9d9d",
38 + "text.placeholder": "#9d9d9d",
39 + "text.disabled": "#9d9d9d",
40 40 "text.accent": "#d86dd8",
41 41 "icon": "#ededed",
42 - "icon.muted": "#8b8b8b",
43 - "icon.disabled": "#ededed60",
44 - "icon.placeholder": "#8b8b8b80",
42 + "icon.muted": "#9d9d9d",
43 + "icon.disabled": "#9d9d9d",
44 + "icon.placeholder": "#9d9d9d",
45 45 "icon.accent": "#d86dd8",
46 - "status_bar.background": "#121212",
47 - "title_bar.background": "#121212",
46 + "status_bar.background": "#242424",
47 + "title_bar.background": "#242424",
48 48 "title_bar.inactive_background": "#242424",
49 49 "toolbar.background": "#242424",
50 50 "tab_bar.background": "#242424",
54 54 "panel.background": "#242424",
55 55 "panel.focused_border": "#d86dd8",
56 56 "pane.focused_border": "#d86dd8",
57 - "scrollbar.thumb.background": "#8b8b8b80",
58 - "scrollbar.thumb.hover_background": "#8b8b8bc0",
59 - "scrollbar.thumb.border": "#6f6f6f40",
57 + "pane_group.border": "#9d9d9d",
58 + "panel.indent_guide": "#9d9d9d60",
59 + "panel.indent_guide_active": "#9d9d9d",
60 + "panel.indent_guide_hover": "#d86dd8",
61 + "scrollbar.thumb.background": "#9d9d9d",
62 + "scrollbar.thumb.hover_background": "#9d9d9d",
63 + "scrollbar.thumb.border": "#9d9d9d",
60 64 "scrollbar.track.background": "#242424",
61 - "scrollbar.track.border": "#6f6f6f20",
65 + "scrollbar.track.border": "#9d9d9d60",
62 66 "editor.foreground": "#ededed",
63 - "editor.background": "#242424",
67 + "editor.background": "#121212",
64 68 "editor.gutter.background": "#242424",
65 69 "editor.subheader.background": "#242424",
66 - "editor.indent_guide": "#6f6f6f60",
70 + "editor.indent_guide": "#9d9d9d60",
67 71 "editor.indent_guide_active": "#9d9d9d",
68 - "editor.active_line.background": "#24242480",
69 - "editor.highlighted_line.background": "#24242460",
70 - "editor.line_number": "#8b8b8b",
71 - "editor.active_line_number": "#d86dd8",
72 - "editor.invisible": "#6f6f6f80",
73 - "editor.wrap_guide": "#6f6f6f40",
72 + "editor.active_line.background": "#242424cd",
73 + "editor.highlighted_line.background": "#24242410",
74 + "editor.line_number": "#9d9d9d",
75 + "editor.active_line_number": "#f3effb",
76 + "editor.invisible": "#9d9d9d80",
77 + "editor.wrap_guide": "#9d9d9d40",
74 78 "editor.active_wrap_guide": "#9d9d9d80",
79 + "editor.document_highlight.bracket_background": "#7ba1aa40",
75 80 "editor.document_highlight.read_background": "#d86dd840",
76 81 "editor.document_highlight.write_background": "#f0ee6940",
77 - "terminal.background": "#242424",
82 + "terminal.background": "#121212",
83 + "terminal.ansi.background": "#121212",
78 84 "terminal.foreground": "#ededed",
79 85 "terminal.bright_foreground": "#f3effb",
80 86 "terminal.dim_foreground": "#8b8b8b",
81 - "terminal.ansi.black": "#121212",
82 - "terminal.ansi.bright_black": "#8b8b8b",
83 - "terminal.ansi.dim_black": "#242424",
87 + "terminal.ansi.black": "#8b8b8b",
88 + "terminal.ansi.bright_black": "#9d9d9d",
89 + "terminal.ansi.dim_black": "#8b8b8b",
84 90 "terminal.ansi.red": "#ec6376",
85 - "terminal.ansi.bright_red": "#3ec5e3",
86 - "terminal.ansi.dim_red": "#ec637680",
91 + "terminal.ansi.bright_red": "#ec6376",
92 + "terminal.ansi.dim_red": "#ec6376",
87 93 "terminal.ansi.green": "#7ba1aa",
88 - "terminal.ansi.bright_green": "#6f6f6f",
89 - "terminal.ansi.dim_green": "#7ba1aa80",
94 + "terminal.ansi.bright_green": "#9aabae",
95 + "terminal.ansi.dim_green": "#7ba1aa",
90 96 "terminal.ansi.yellow": "#f0ee69",
91 - "terminal.ansi.bright_yellow": "#242424",
92 - "terminal.ansi.dim_yellow": "#f0ee6980",
97 + "terminal.ansi.bright_yellow": "#f0ee69",
98 + "terminal.ansi.dim_yellow": "#f0ee69",
93 99 "terminal.ansi.blue": "#b59ae4",
94 100 "terminal.ansi.bright_blue": "#dfd3f3",
95 - "terminal.ansi.dim_blue": "#b59ae480",
101 + "terminal.ansi.dim_blue": "#b59ae4",
96 102 "terminal.ansi.magenta": "#d151d1",
97 103 "terminal.ansi.bright_magenta": "#d86dd8",
98 - "terminal.ansi.dim_magenta": "#d151d180",
104 + "terminal.ansi.dim_magenta": "#d151d1",
99 105 "terminal.ansi.cyan": "#3ec5e3",
100 106 "terminal.ansi.bright_cyan": "#c9b6eb",
101 - "terminal.ansi.dim_cyan": "#3ec5e380",
107 + "terminal.ansi.dim_cyan": "#3ec5e3",
102 108 "terminal.ansi.white": "#ededed",
103 109 "terminal.ansi.bright_white": "#f3effb",
104 110 "terminal.ansi.dim_white": "#8b8b8b",
105 111 "link_text.hover": "#d86dd8",
106 112 "conflict": "#ec6376",
107 - "conflict.background": "#ec637640",
108 - "conflict.border": "#ec6376",
113 + "conflict.background": "#ec637610",
114 + "conflict.border": "#ec6376ff",
109 115 "created": "#7ba1aa",
110 - "created.background": "#7ba1aa40",
111 - "created.border": "#7ba1aa",
116 + "created.background": "#7ba1aa10",
117 + "created.border": "#7ba1aaff",
112 118 "deleted": "#ec6376",
113 - "deleted.background": "#ec637640",
114 - "deleted.border": "#ec6376",
119 + "deleted.background": "#ec637610",
120 + "deleted.border": "#ec6376ff",
115 121 "error": "#ec6376",
116 - "error.background": "#ec6376",
117 - "error.border": "#ec6376",
118 - "hidden": "#6f6f6f",
119 - "hidden.border": "#6f6f6f60",
122 + "error.background": "#ec637610",
123 + "error.border": "#ec6376ff",
124 + "hidden": "#9d9d9d",
125 + "hidden.background": "#24242440",
126 + "hidden.border": "#9d9d9d60",
120 127 "hint": "#3ec5e3",
121 - "hint.background": "#3ec5e340",
122 - "hint.border": "#3ec5e3",
128 + "hint.background": "#3ec5e310",
129 + "hint.border": "#3ec5e3ff",
123 130 "ignored": "#8b8b8b60",
124 131 "ignored.background": "#24242440",
125 - "ignored.border": "#6f6f6f40",
132 + "ignored.border": "#9d9d9d40",
126 133 "info": "#3ec5e3",
127 - "info.background": "#3ec5e340",
128 - "info.border": "#3ec5e3",
129 - "modified": "#f0ee69",
130 - "modified.background": "#f0ee6940",
131 - "modified.border": "#f0ee69",
134 + "info.background": "#3ec5e310",
135 + "info.border": "#3ec5e3ff",
136 + "modified": "#c9b6eb",
137 + "modified.background": "#c9b6eb10",
138 + "modified.border": "#c9b6ebff",
132 139 "predictive": "#8b8b8b80",
133 140 "predictive.border": "#9d9d9d",
134 141 "predictive.background": "#9aabae80",
135 - "renamed": "#f0ee69",
136 - "renamed.border": "#f0ee69",
137 - "renamed.background": "#f0ee6940",
142 + "renamed": "#c9b6eb",
143 + "renamed.border": "#c9b6ebff",
144 + "renamed.background": "#c9b6eb10",
138 145 "success": "#7ba1aa",
139 - "success.background": "#7ba1aa40",
140 - "success.border": "#7ba1aa",
146 + "success.background": "#7ba1aa10",
147 + "success.border": "#7ba1aaff",
141 148 "unreachable": "#8b8b8b60",
142 149 "unreachable.background": "#24242440",
143 - "unreachable.border": "#6f6f6f60",
150 + "unreachable.border": "#9d9d9d60",
144 151 "warning": "#f0ee69",
145 - "warning.background": "#f0ee6940",
146 - "warning.border": "#f0ee69",
152 + "warning.background": "#f0ee6910",
153 + "warning.border": "#f0ee69ff",
147 154 "players": [
149 156 "cursor": "#d86dd8",
159 166 "syntax": {
167 + "attribute": {
168 + "color": "#8b8b8b",
169 + "font_style": null,
170 + "font_weight": null
171 + },
160 172 "boolean": {
161 173 "color": "#7ba1aa",
162 - "font_style": null,
174 + "font_style": "italic",
163 175 "font_weight": null
165 177 "comment": {
166 - "color": "#8b8b8b",
178 + "color": "#dfd3f3",
167 179 "font_style": "italic",
168 - "font_weight": null
180 + "font_weight": 700
170 182 "comment.doc": {
171 - "color": "#8b8b8b",
183 + "color": "#dfd3f3",
172 184 "font_style": "italic",
173 - "font_weight": null
185 + "font_weight": 700
175 187 "constant": {
176 188 "color": "#7ba1aa",
177 - "font_style": null,
189 + "font_style": "italic",
190 + "font_weight": null
191 + },
192 + "constant.builtin": {
193 + "color": "#7ba1aa",
194 + "font_style": "italic",
178 195 "font_weight": null
180 197 "constructor": {
181 - "color": "#f0ee69",
198 + "color": "#dfd3f3",
199 + "font_style": null,
200 + "font_weight": 700
201 + },
202 + "embedded": {
203 + "color": "#ededed",
182 204 "font_style": null,
183 205 "font_weight": null
185 207 "emphasis": {
186 - "color": "#d86dd8",
208 + "color": "#d151d1",
187 209 "font_style": "italic",
188 210 "font_weight": null
190 212 "emphasis.strong": {
191 - "color": "#d86dd8",
213 + "color": "#d151d1",
192 214 "font_style": null,
193 215 "font_weight": 700
217 + "enum": {
218 + "color": "#ededed",
219 + "font_style": null,
220 + "font_weight": null
221 + },
195 222 "function": {
196 - "color": "#d86dd8",
223 + "color": "#ededed",
224 + "font_style": null,
225 + "font_weight": null
226 + },
227 + "hint": {
228 + "color": "#c9b6eb",
197 229 "font_style": null,
198 230 "font_weight": null
200 232 "keyword": {
201 - "color": "#f0ee69",
233 + "color": "#8b8b8b",
202 234 "font_style": null,
203 235 "font_weight": null
205 - "number": {
206 - "color": "#3ec5e3",
237 + "label": {
238 + "color": "#8b8b8b",
207 239 "font_style": null,
208 240 "font_weight": null
242 + "link_text": {
243 + "color": "#ededed",
244 + "font_style": null,
245 + "font_weight": null
246 + },
247 + "link_uri": {
248 + "color": "#7ba1aa",
249 + "font_style": "italic",
250 + "font_weight": null
251 + },
252 + "number": {
253 + "color": "#7ba1aa",
254 + "font_style": "italic",
255 + "font_weight": null
256 + },
210 257 "operator": {
211 258 "color": "#8b8b8b",
212 259 "font_style": null,
213 260 "font_weight": null
262 + "preproc": {
263 + "color": "#dfd3f3",
264 + "font_style": null,
265 + "font_weight": 700
266 + },
267 + "primary": {
268 + "color": "#ededed",
269 + "font_style": null,
270 + "font_weight": null
271 + },
215 272 "property": {
216 273 "color": "#ededed",
217 274 "font_style": null,
222 279 "font_style": null,
223 280 "font_weight": null
282 + "punctuation.bracket": {
283 + "color": "#8b8b8b",
284 + "font_style": null,
285 + "font_weight": null
286 + },
287 + "punctuation.delimiter": {
288 + "color": "#8b8b8b",
289 + "font_style": null,
290 + "font_weight": null
291 + },
292 + "punctuation.list_marker": {
293 + "color": "#8b8b8b",
294 + "font_style": null,
295 + "font_weight": null
296 + },
297 + "punctuation.special": {
298 + "color": "#dfd3f3",
299 + "font_style": null,
300 + "font_weight": 700
301 + },
225 302 "string": {
226 303 "color": "#7ba1aa",
227 - "font_style": null,
304 + "font_style": "italic",
228 305 "font_weight": null
230 307 "string.escape": {
231 - "color": "#3ec5e3",
308 + "color": "#dfd3f3",
232 309 "font_style": null,
233 - "font_weight": null
310 + "font_weight": 700
235 312 "string.regex": {
236 - "color": "#ed5eed",
313 + "color": "#dbdbdb",
314 + "background_color": "#ed5eed",
237 315 "font_style": null,
238 - "font_weight": null
316 + "font_weight": 700
240 318 "string.special": {
241 - "color": "#b59ae4",
319 + "color": "#dfd3f3",
242 320 "font_style": null,
243 - "font_weight": null
321 + "font_weight": 700
322 + },
323 + "string.special.symbol": {
324 + "color": "#dfd3f3",
325 + "font_style": null,
326 + "font_weight": 700
245 328 "tag": {
246 - "color": "#f0ee69",
329 + "color": "#dfd3f3",
247 330 "font_style": null,
248 - "font_weight": null
331 + "font_weight": 700
332 + },
333 + "tag.doctype": {
334 + "color": "#dfd3f3",
335 + "font_style": null,
336 + "font_weight": 700
250 338 "text": {
251 339 "color": "#ededed",
253 341 "font_weight": null
255 343 "text.literal": {
256 - "color": "#7ba1aa",
257 - "font_style": null,
258 - "font_weight": null
344 + "color": "#dfd3f3",
345 + "font_style": "italic",
346 + "font_weight": 700
260 348 "title": {
261 349 "color": "#dfd3f3",
263 351 "font_weight": 700
265 353 "type": {
266 - "color": "#b59ae4",
354 + "color": "#ededed",
355 + "font_style": null,
356 + "font_weight": null
357 + },
358 + "type.builtin": {
359 + "color": "#ededed",
267 360 "font_style": null,
268 361 "font_weight": null
272 365 "font_style": null,
273 366 "font_weight": null
368 + "variable.parameter": {
369 + "color": "#b59ae4",
370 + "font_style": null,
371 + "font_weight": 700
372 + },
275 373 "variable.special": {
276 - "color": "#d151d1",
374 + "color": "#dfd3f3",
375 + "font_style": null,
376 + "font_weight": 700
377 + },
378 + "variant": {
379 + "color": "#ededed",
277 380 "font_style": null,
278 381 "font_weight": null
290 393 "#184e5b"
292 395 "background.appearance": "opaque",
293 - "border": "#5d5d5d",
396 + "border": "#292929",
294 397 "border.variant": "#292929",
295 398 "border.focused": "#922792",
296 399 "border.selected": "#922792",
297 - "border.transparent": "#5d5d5d40",
298 - "border.disabled": "#5d5d5d60",
299 - "elevated_surface.background": "#dbdbdb",
400 + "border.transparent": "#29292900",
401 + "border.disabled": "#29292960",
402 + "elevated_surface.background": "#ededed",
300 403 "surface.background": "#ededed",
301 404 "background": "#ededed",
302 405 "element.background": "#dbdbdb",
303 - "element.hover": "#dbdbdb",
304 - "element.active": "#15333b",
305 - "element.selected": "#15333b",
406 + "element.hover": "#15333b2b",
407 + "element.active": "#15333b2b",
408 + "element.selected": "#15333b2b",
306 409 "element.disabled": "#dbdbdb80",
307 410 "drop_target.background": "#92279280",
308 411 "ghost_element.background": null,
309 412 "ghost_element.hover": "#29292980",
310 - "ghost_element.active": "#dbdbdb",
311 - "ghost_element.selected": "#15333b80",
413 + "ghost_element.active": "#15333b2b",
414 + "ghost_element.selected": "#15333b2b",
312 415 "ghost_element.disabled": "#29292960",
313 416 "text": "#121212",
314 - "text.muted": "#3b3b3b",
315 - "text.placeholder": "#3b3b3b99",
316 - "text.disabled": "#12121260",
417 + "text.muted": "#292929",
418 + "text.placeholder": "#292929",
419 + "text.disabled": "#292929",
317 420 "text.accent": "#922792",
318 421 "icon": "#121212",
319 - "icon.muted": "#3b3b3b",
320 - "icon.disabled": "#12121260",
321 - "icon.placeholder": "#3b3b3b80",
422 + "icon.muted": "#292929",
423 + "icon.disabled": "#292929",
424 + "icon.placeholder": "#292929",
322 425 "icon.accent": "#922792",
323 - "status_bar.background": "#ededed",
324 - "title_bar.background": "#ededed",
426 + "status_bar.background": "#dbdbdb",
427 + "title_bar.background": "#dbdbdb",
325 428 "title_bar.inactive_background": "#dbdbdb",
326 429 "toolbar.background": "#dbdbdb",
327 430 "tab_bar.background": "#dbdbdb",
331 434 "panel.background": "#dbdbdb",
332 435 "panel.focused_border": "#922792",
333 436 "pane.focused_border": "#922792",
334 - "scrollbar.thumb.background": "#3b3b3b80",
335 - "scrollbar.thumb.hover_background": "#3b3b3bc0",
336 - "scrollbar.thumb.border": "#5d5d5d40",
437 + "pane_group.border": "#292929",
438 + "panel.indent_guide": "#29292960",
439 + "panel.indent_guide_active": "#292929",
440 + "panel.indent_guide_hover": "#922792",
441 + "scrollbar.thumb.background": "#292929",
442 + "scrollbar.thumb.hover_background": "#292929",
443 + "scrollbar.thumb.border": "#292929",
337 444 "scrollbar.track.background": "#dbdbdb",
338 - "scrollbar.track.border": "#5d5d5d20",
445 + "scrollbar.track.border": "#29292960",
339 446 "editor.foreground": "#121212",
340 - "editor.background": "#dbdbdb",
447 + "editor.background": "#ededed",
341 448 "editor.gutter.background": "#dbdbdb",
342 449 "editor.subheader.background": "#ededed",
343 - "editor.indent_guide": "#5d5d5d60",
450 + "editor.indent_guide": "#29292960",
344 451 "editor.indent_guide_active": "#292929",
345 - "editor.active_line.background": "#ededed80",
346 - "editor.highlighted_line.background": "#ededed60",
347 - "editor.line_number": "#3b3b3b",
348 - "editor.active_line_number": "#922792",
349 - "editor.invisible": "#5d5d5d80",
350 - "editor.wrap_guide": "#5d5d5d40",
452 + "editor.active_line.background": "#dbdbdb3f",
453 + "editor.highlighted_line.background": "#dbdbdb10",
454 + "editor.line_number": "#292929",
455 + "editor.active_line_number": "#3e2f53",
456 + "editor.invisible": "#29292980",
457 + "editor.wrap_guide": "#29292940",
351 458 "editor.active_wrap_guide": "#29292980",
459 + "editor.document_highlight.bracket_background": "#184e5b40",
352 460 "editor.document_highlight.read_background": "#92279240",
353 461 "editor.document_highlight.write_background": "#6e6c1040",
354 - "terminal.background": "#dbdbdb",
462 + "terminal.background": "#ededed",
463 + "terminal.ansi.background": "#ededed",
355 464 "terminal.foreground": "#121212",
356 465 "terminal.bright_foreground": "#3e2f53",
357 466 "terminal.dim_foreground": "#3b3b3b",
358 - "terminal.ansi.black": "#ededed",
359 - "terminal.ansi.bright_black": "#3b3b3b",
360 - "terminal.ansi.dim_black": "#dbdbdb",
467 + "terminal.ansi.black": "#3b3b3b",
468 + "terminal.ansi.bright_black": "#292929",
469 + "terminal.ansi.dim_black": "#3b3b3b",
361 470 "terminal.ansi.red": "#bd172e",
362 - "terminal.ansi.bright_red": "#116477",
363 - "terminal.ansi.dim_red": "#bd172e80",
471 + "terminal.ansi.bright_red": "#bd172e",
472 + "terminal.ansi.dim_red": "#bd172e",
364 473 "terminal.ansi.green": "#184e5b",
365 - "terminal.ansi.bright_green": "#5d5d5d",
366 - "terminal.ansi.dim_green": "#184e5b80",
474 + "terminal.ansi.bright_green": "#15333b",
475 + "terminal.ansi.dim_green": "#184e5b",
367 476 "terminal.ansi.yellow": "#6e6c10",
368 - "terminal.ansi.bright_yellow": "#dbdbdb",
369 - "terminal.ansi.dim_yellow": "#6e6c1080",
477 + "terminal.ansi.bright_yellow": "#6e6c10",
478 + "terminal.ansi.dim_yellow": "#6e6c10",
370 479 "terminal.ansi.blue": "#715696",
371 480 "terminal.ansi.bright_blue": "#4f3c69",
372 - "terminal.ansi.dim_blue": "#71569680",
481 + "terminal.ansi.dim_blue": "#715696",
373 482 "terminal.ansi.magenta": "#ae2eae",
374 483 "terminal.ansi.bright_magenta": "#922792",
375 - "terminal.ansi.dim_magenta": "#ae2eae80",
484 + "terminal.ansi.dim_magenta": "#ae2eae",
376 485 "terminal.ansi.cyan": "#116477",
377 486 "terminal.ansi.bright_cyan": "#604980",
378 - "terminal.ansi.dim_cyan": "#11647780",
487 + "terminal.ansi.dim_cyan": "#116477",
379 488 "terminal.ansi.white": "#121212",
380 489 "terminal.ansi.bright_white": "#3e2f53",
381 490 "terminal.ansi.dim_white": "#3b3b3b",
382 491 "link_text.hover": "#922792",
383 492 "conflict": "#bd172e",
384 - "conflict.background": "#bd172e40",
385 - "conflict.border": "#bd172e",
493 + "conflict.background": "#bd172e06",
494 + "conflict.border": "#bd172ec0",
386 495 "created": "#184e5b",
387 - "created.background": "#184e5b40",
388 - "created.border": "#184e5b",
496 + "created.background": "#184e5b06",
497 + "created.border": "#184e5bc0",
389 498 "deleted": "#bd172e",
390 - "deleted.background": "#bd172e40",
391 - "deleted.border": "#bd172e",
499 + "deleted.background": "#bd172e06",
500 + "deleted.border": "#bd172ec0",
392 501 "error": "#bd172e",
393 - "error.background": "#bd172e",
394 - "error.border": "#bd172e",
395 - "hidden": "#5d5d5d",
396 - "hidden.border": "#5d5d5d60",
502 + "error.background": "#bd172e06",
503 + "error.border": "#bd172ec0",
504 + "hidden": "#292929",
505 + "hidden.background": "#dbdbdb40",
506 + "hidden.border": "#29292960",
397 507 "hint": "#116477",
398 - "hint.background": "#11647740",
399 - "hint.border": "#116477",
508 + "hint.background": "#11647706",
509 + "hint.border": "#116477c0",
400 510 "ignored": "#3b3b3b60",
401 511 "ignored.background": "#dbdbdb40",
402 - "ignored.border": "#5d5d5d40",
512 + "ignored.border": "#29292940",
403 513 "info": "#116477",
404 - "info.background": "#11647740",
405 - "info.border": "#116477",
406 - "modified": "#6e6c10",
407 - "modified.background": "#6e6c1040",
408 - "modified.border": "#6e6c10",
514 + "info.background": "#11647706",
515 + "info.border": "#116477c0",
516 + "modified": "#604980",
517 + "modified.background": "#60498006",
518 + "modified.border": "#604980c0",
409 519 "predictive": "#3b3b3b80",
410 520 "predictive.border": "#292929",
411 521 "predictive.background": "#15333b80",
412 - "renamed": "#6e6c10",
413 - "renamed.border": "#6e6c10",
414 - "renamed.background": "#6e6c1040",
522 + "renamed": "#604980",
523 + "renamed.border": "#604980c0",
524 + "renamed.background": "#60498006",
415 525 "success": "#184e5b",
416 - "success.background": "#184e5b40",
417 - "success.border": "#184e5b",
526 + "success.background": "#184e5b06",
527 + "success.border": "#184e5bc0",
418 528 "unreachable": "#3b3b3b60",
419 529 "unreachable.background": "#dbdbdb40",
420 - "unreachable.border": "#5d5d5d60",
530 + "unreachable.border": "#29292960",
421 531 "warning": "#6e6c10",
422 - "warning.background": "#6e6c1040",
423 - "warning.border": "#6e6c10",
532 + "warning.background": "#6e6c1006",
533 + "warning.border": "#6e6c10c0",
424 534 "players": [
426 536 "cursor": "#922792",
436 546 "syntax": {
547 + "attribute": {
548 + "color": "#3b3b3b",
549 + "font_style": null,
550 + "font_weight": null
551 + },
437 552 "boolean": {
438 553 "color": "#184e5b",
439 - "font_style": null,
554 + "font_style": "italic",
440 555 "font_weight": null
442 557 "comment": {
443 - "color": "#3b3b3b",
558 + "color": "#4f3c69",
444 559 "font_style": "italic",
445 - "font_weight": null
560 + "font_weight": 700
447 562 "comment.doc": {
448 - "color": "#3b3b3b",
563 + "color": "#4f3c69",
449 564 "font_style": "italic",
450 - "font_weight": null
565 + "font_weight": 700
452 567 "constant": {
453 568 "color": "#184e5b",
454 - "font_style": null,
569 + "font_style": "italic",
570 + "font_weight": null
571 + },
572 + "constant.builtin": {
573 + "color": "#184e5b",
574 + "font_style": "italic",
455 575 "font_weight": null
457 577 "constructor": {
458 - "color": "#6e6c10",
578 + "color": "#4f3c69",
579 + "font_style": null,
580 + "font_weight": 700
581 + },
582 + "embedded": {
583 + "color": "#121212",
459 584 "font_style": null,
460 585 "font_weight": null
462 587 "emphasis": {
463 - "color": "#922792",
588 + "color": "#ae2eae",
464 589 "font_style": "italic",
465 590 "font_weight": null
467 592 "emphasis.strong": {
468 - "color": "#922792",
593 + "color": "#ae2eae",
469 594 "font_style": null,
470 595 "font_weight": 700
597 + "enum": {
598 + "color": "#121212",
599 + "font_style": null,
600 + "font_weight": null
601 + },
472 602 "function": {
473 - "color": "#922792",
603 + "color": "#121212",
604 + "font_style": null,
605 + "font_weight": null
606 + },
607 + "hint": {
608 + "color": "#604980",
474 609 "font_style": null,
475 610 "font_weight": null
477 612 "keyword": {
478 - "color": "#6e6c10",
613 + "color": "#3b3b3b",
479 614 "font_style": null,
480 615 "font_weight": null
482 - "number": {
483 - "color": "#116477",
617 + "label": {
618 + "color": "#3b3b3b",
484 619 "font_style": null,
485 620 "font_weight": null
622 + "link_text": {
623 + "color": "#121212",
624 + "font_style": null,
625 + "font_weight": null
626 + },
627 + "link_uri": {
628 + "color": "#184e5b",
629 + "font_style": "italic",
630 + "font_weight": null
631 + },
632 + "number": {
633 + "color": "#184e5b",
634 + "font_style": "italic",
635 + "font_weight": null
636 + },
487 637 "operator": {
488 638 "color": "#3b3b3b",
489 639 "font_style": null,
490 640 "font_weight": null
642 + "preproc": {
643 + "color": "#4f3c69",
644 + "font_style": null,
645 + "font_weight": 700
646 + },
647 + "primary": {
648 + "color": "#121212",
649 + "font_style": null,
650 + "font_weight": null
651 + },
492 652 "property": {
493 653 "color": "#121212",
494 654 "font_style": null,
499 659 "font_style": null,
500 660 "font_weight": null
662 + "punctuation.bracket": {
663 + "color": "#3b3b3b",
664 + "font_style": null,
665 + "font_weight": null
666 + },
667 + "punctuation.delimiter": {
668 + "color": "#3b3b3b",
669 + "font_style": null,
670 + "font_weight": null
671 + },
672 + "punctuation.list_marker": {
673 + "color": "#3b3b3b",
674 + "font_style": null,
675 + "font_weight": null
676 + },
677 + "punctuation.special": {
678 + "color": "#4f3c69",
679 + "font_style": null,
680 + "font_weight": 700
681 + },
502 682 "string": {
503 683 "color": "#184e5b",
504 - "font_style": null,
684 + "font_style": "italic",
505 685 "font_weight": null
507 687 "string.escape": {
508 - "color": "#116477",
688 + "color": "#4f3c69",
509 689 "font_style": null,
510 - "font_weight": null
690 + "font_weight": 700
512 692 "string.regex": {
513 - "color": "#a112a1",
693 + "color": "#242424",
694 + "background_color": "#a112a1",
514 695 "font_style": null,
515 - "font_weight": null
696 + "font_weight": 700
517 698 "string.special": {
518 - "color": "#715696",
699 + "color": "#4f3c69",
519 700 "font_style": null,
520 - "font_weight": null
701 + "font_weight": 700
702 + },
703 + "string.special.symbol": {
704 + "color": "#4f3c69",
705 + "font_style": null,
706 + "font_weight": 700
522 708 "tag": {
523 - "color": "#6e6c10",
709 + "color": "#4f3c69",
524 710 "font_style": null,
525 - "font_weight": null
711 + "font_weight": 700
712 + },
713 + "tag.doctype": {
714 + "color": "#4f3c69",
715 + "font_style": null,
716 + "font_weight": 700
527 718 "text": {
528 719 "color": "#121212",
530 721 "font_weight": null
532 723 "text.literal": {
533 - "color": "#184e5b",
534 - "font_style": null,
535 - "font_weight": null
724 + "color": "#4f3c69",
725 + "font_style": "italic",
726 + "font_weight": 700
537 728 "title": {
538 729 "color": "#4f3c69",
540 731 "font_weight": 700
542 733 "type": {
543 - "color": "#715696",
734 + "color": "#121212",
735 + "font_style": null,
736 + "font_weight": null
737 + },
738 + "type.builtin": {
739 + "color": "#121212",
544 740 "font_style": null,
545 741 "font_weight": null
549 745 "font_style": null,
550 746 "font_weight": null
748 + "variable.parameter": {
749 + "color": "#715696",
750 + "font_style": null,
751 + "font_weight": 700
752 + },
552 753 "variable.special": {
553 - "color": "#ae2eae",
754 + "color": "#4f3c69",
755 + "font_style": null,
756 + "font_weight": 700
757 + },
758 + "variant": {
759 + "color": "#121212",
554 760 "font_style": null,
555 761 "font_weight": null