Computer use CLI for AI agents
Rust accessibilityaccessibility-apiai-agentsautomationclicomputer-usecomputer-use-agentcomputer-use-agentsdesktop-automationmacosmcprust
docs: add the architecture-diagram skill for the docs site
Lahfirf7ec3f012c28
diff --git a/.agents/skills/architecture-diagram/SKILL.md b/.agents/skills/architecture-diagram/SKILL.mdnew file mode 100644index 000000000..6945e8668--- /dev/null+++ b/.agents/skills/architecture-diagram/SKILL.md@@ -0,0 +1,50 @@+---+name: architecture-diagram+description: Create or update architecture and flow diagrams for agent-desktop's docs site in apps/docs. Use when a docs page needs a diagram of components, data flow, or a command pipeline, or when an existing diagram in apps/docs/public/desktop/diagrams changes.+metadata:+ internal: true+---++# Architecture diagram++Diagrams are standalone HTML files that the docs embed with the `Diagram` component. Follow the technical-writer skill for any prose.++## Folder convention++- One folder per diagram: `apps/docs/public/desktop/diagrams/<name>/index.html`, served at `/desktop/diagrams/<name>/index.html`. `<name>` is a short kebab-case slug. Keep it under `/desktop`: agent-browser.dev routes only `/desktop` paths to this app.+- `apps/docs/proxy.ts` returns 404 for `/desktop` paths that are not docs pages, so its matcher must exclude `desktop/diagrams/`, as it does for `desktop/favicon.ico`.+- The file is standalone: inline CSS, one inline SVG, no external requests. Start from [references/template.html](references/template.html).+- The visual tokens are in [references/style.md](references/style.md). Reuse them so every diagram looks the same.+- The theme comes from `?theme=light` or `?theme=dark`. Without the parameter the diagram follows `prefers-color-scheme` and defaults to dark.+- Give the SVG a `<title>` and a `<desc>` that states the whole flow in words.++## Draw the real mechanism++1. Read the code before drawing. For observation and refs, read `crates/core/src/snapshot/`, `crates/core/src/refs/`, and the command in `crates/core/src/commands/`. For platforms, read the `PlatformAdapter` trait in `crates/core/src/adapter/` and the platform crate. Draw only components, names, and directions you can point to in source.+2. Use the identifiers from the code as labels (`PlatformAdapter`, `RefStore`) and put the mechanism in the gray second line (`AX API`, `UI Automation`).+3. Draw one arrow per real data path. Label arrows that cross a boundary with the command, flag, or call (`snapshot --root`).+4. Group components by where they run: an outer dashed container for a machine, a nested panel for a process. Put the calling agent outside.+5. Mark the entry point of the flow with the highlighted circle node. Use it once.+6. Lay it out for the 720px docs column at 1:1 scale (see style.md) and keep it to 12 nodes or fewer. Move detail to the page text.++## Embed it++```mdx+<Diagram name="snapshot-drill-down" title="Skeleton snapshot and drill-down" aspectRatio="720 / 448" />+```++`aspectRatio` is the SVG `viewBox` width and height. The component passes the site theme to the iframe.++If `apps/docs` has no `Diagram` component yet, add `components/geistdocs/diagram.tsx`: a client component that renders the file in a lazy iframe from `/desktop/diagrams/<name>/index.html` and appends `?theme=` from `next-themes`. Register it in `components/geistdocs/mdx-components.tsx`.++## Text version++Keep a text version of the flow next to the diagram on the page, such as a short list or code block with the same components and order. Readers of the `.md` route, agents, and screen readers depend on it.++## Check it++1. In `apps/docs`, run `pnpm dev` and, in a second terminal, `pnpm exec microfrontends proxy microfrontends.json --local-apps agent-desktop`.+2. Open `http://localhost:3024/desktop/diagrams/<name>/index.html` and the same URL with `?theme=light` at 1440x900. Look for clipped text, overlapping labels, arrows that miss their node, and unreadable gray text.+3. Open the docs page and check the diagram in both site themes.+4. Run `pnpm build` in `apps/docs`.+5. Stop the dev server and the proxy, and close the browser session.diff --git a/.agents/skills/architecture-diagram/references/style.md b/.agents/skills/architecture-diagram/references/style.mdnew file mode 100644index 000000000..9dfa31e38--- /dev/null+++ b/.agents/skills/architecture-diagram/references/style.md@@ -0,0 +1,67 @@+# Diagram style tokens++The style follows Vercel architecture diagrams: dashed containers, thin gray connectors, small open arrowheads, one highlighted entry node. All tokens are CSS custom properties on `:root` in the template.++## Colors++| Token | Dark | Light | Use |+| --- | --- | --- | --- |+| `--bg` | `#000` | `#fff` | Canvas and outer container fill |+| `--panel` | `#0a0a0a` | `#fafafa` | Nested panel fill |+| `--node` | `#111` | `#fff` | Node fill |+| `--border` | `#5c5c5c` | `#b8b8b8` | Dashed borders |+| `--fg` | `#ededed` | `#171717` | Labels and headers |+| `--muted` | `#8f8f8f` | `#666` | Second line, route labels, icons |+| `--line` | `#8f8f8f` | `#7a7a7a` | Connectors and arrowheads |+| `--line-strong` | `#ededed` | `#171717` | Main flow connectors |+| `--hl-fill` | `#0a2a5e` | `#dbe8ff` | Highlighted node fill |+| `--hl-ring` | `#1e5fd6` | `#2563eb` | Highlighted node ring |+| `--hl-icon` | `#cfe0ff` | `#1d4ed8` | Highlighted node icon |++## Background++The `html` and `body` background and the outer container fill are transparent, so an embedded diagram takes the docs page color in either site theme. `:root` also sets `color-scheme` (dark by default, light for the light theme) to match the parent page; a mismatch makes the browser paint an opaque canvas behind the iframe. Only when the file is opened directly (`window.self === window.top`) the script sets `data-top` on `:root` and the page uses `--bg`. Nested panels keep their `--panel` fill.++## Borders and shapes++- Stroke width 1 with `vector-effect: non-scaling-stroke`, so lines stay 1px at any scale.+- Dash pattern `4 4`.+- Outer container radius 8, nested panel radius 8, node radius 6.+- Nodes are 120 x 64 (152 wide for wider labels). Gap between nodes in a row is 40, row gap 44 between a node bottom and the next row.+- Container padding is 20 to 28 from its border to the nearest node. A container header sits 20 from the top, icon first, label 8 to 10 to its right.++## Typography++Font stack `Geist, "Geist Sans", system-ui, -apple-system, "Segoe UI", sans-serif`.++| Element | Size | Weight | Color |+| --- | --- | --- | --- |+| Container header | 16 | 500 | `--fg` |+| Node label | 15 | 400 | `--fg` |+| Node second line | 11.5 | 400 | `--muted` |+| Route label on an arrow | 12.5 | 400 | `--muted` |++Node text is centered, label at the vertical middle minus 6, second line at the middle plus 11. Route labels sit 8 above their connector.++## Connectors++- Straight connectors start and end 6 away from the node edge, except where they cross a container border.+- Elbows use a 14 radius arc: `V…a14 14 0 0 1 -14 14H…`.+- Arrowhead: an open chevron marker, `viewBox 0 0 8 8`, path `M1.5 1.5 L5.5 4 L1.5 6.5`, stroke 1, round caps and joins, `refX 6`, `markerUnits="userSpaceOnUse"`, `orient="auto"`.+- Use `--line-strong` for the main path and `--line` for secondary paths.++## Icons++- Stroke only, `--muted` for node icons and `--fg` for the outer container header icon.+- Stroke width 1.5, round caps and joins, 18 to 28 px.+- Server icon (container header): two stacked rounded rectangles with a dot each. Person icon: a circle, a head circle, and a shoulder arc. Globe: a circle, a vertical ellipse, and a horizontal line.++## Highlighted node++A circle of radius 30 filled with `--hl-fill`, ringed with a 1px `--hl-ring` stroke, with a globe icon drawn at 24 px in `--hl-icon` (1.2 stroke). Place it directly in front of the node it enters. Use it once per diagram.++## Size and scaling++Lay diagrams out for the docs content column, not for a wide canvas. The column is about 720px wide at a 1440px viewport, so the target `viewBox` width is 720 and the height is whatever the layout needs (the architecture diagram is 720 x 448). The font sizes above are in `viewBox` units, so at 720 wide they render at 1:1. Do not design a wider canvas and let it scale down: a 1124 wide diagram renders at 0.64 and its labels shrink to about 8px. When the content does not fit in 720, wrap it onto more rows or place clients below the container instead.++One SVG with a `viewBox`, `width: 100%`, `height: auto`. Keep the `viewBox` size and the `aspectRatio` prop of `<Diagram>` equal. On a phone the diagram scales down with the column; keep node text short so it stays readable.diff --git a/.agents/skills/architecture-diagram/references/template.html b/.agents/skills/architecture-diagram/references/template.htmlnew file mode 100644index 000000000..426f0e69a--- /dev/null+++ b/.agents/skills/architecture-diagram/references/template.html@@ -0,0 +1,86 @@+<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<title>Diagram name</title>+<script>+ var t = new URLSearchParams(location.search).get("theme");+ if (t === "light" || t === "dark") document.documentElement.setAttribute("data-theme", t);+ if (window.self === window.top) document.documentElement.setAttribute("data-top", "");+</script>+<style>+ :root {+ color-scheme: dark;+ --bg: #000; --panel: #0a0a0a; --node: #111; --border: #5c5c5c;+ --fg: #ededed; --muted: #8f8f8f; --line: #8f8f8f; --line-strong: #ededed;+ --hl-fill: #0a2a5e; --hl-ring: #1e5fd6; --hl-icon: #cfe0ff;+ }+ @media (prefers-color-scheme: light) {+ :root:not([data-theme]) {+ color-scheme: light;+ --bg: #fff; --panel: #fafafa; --node: #fff; --border: #b8b8b8;+ --fg: #171717; --muted: #666; --line: #7a7a7a; --line-strong: #171717;+ --hl-fill: #dbe8ff; --hl-ring: #2563eb; --hl-icon: #1d4ed8;+ }+ }+ :root[data-theme="light"] {+ color-scheme: light;+ --bg: #fff; --panel: #fafafa; --node: #fff; --border: #b8b8b8;+ --fg: #171717; --muted: #666; --line: #7a7a7a; --line-strong: #171717;+ --hl-fill: #dbe8ff; --hl-ring: #2563eb; --hl-icon: #1d4ed8;+ }+ html, body { margin: 0; background: transparent; }+ :root[data-top], :root[data-top] body { background: var(--bg); }+ svg { display: block; width: 100%; height: auto; font-family: Geist, "Geist Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }+ .box { fill: var(--panel); stroke: var(--border); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }+ .node { fill: var(--node); }+ .label { fill: var(--fg); font-size: 15px; text-anchor: middle; }+ .sub { fill: var(--muted); font-size: 11.5px; text-anchor: middle; }+ .head { fill: var(--fg); font-size: 16px; font-weight: 500; }+ .tag { fill: var(--muted); font-size: 12.5px; text-anchor: middle; }+ .wire { fill: none; stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; marker-end: url(#arrow); }+ .wire.strong { stroke: var(--line-strong); }+ .icon { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }+ .icon.fg { stroke: var(--fg); }+ .hl { fill: var(--hl-fill); stroke: var(--hl-ring); stroke-width: 1; vector-effect: non-scaling-stroke; }+ .hl-icon { fill: none; stroke: var(--hl-icon); stroke-width: 1.2; vector-effect: non-scaling-stroke; }+ #arrow path { fill: none; stroke: var(--line); stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }+</style>+</head>+<body>+<svg viewBox="0 0 720 240" role="img" aria-labelledby="t d">+ <title id="t">Diagram name</title>+ <desc id="d">Describe the whole flow in one or two sentences.</desc>+ <defs>+ <marker id="arrow" viewBox="0 0 8 8" refX="6" refY="4" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto">+ <path d="M1.5 1.5 L5.5 4 L1.5 6.5"/>+ </marker>+ </defs>++ <rect class="box" x="8" y="8" width="704" height="224" rx="8" style="fill:none"/>+ <text class="head" x="28" y="40">Container</text>++ <rect class="box node" x="40" y="80" width="120" height="64" rx="6"/>+ <text class="label" x="100" y="110">First</text>+ <text class="sub" x="100" y="127">detail</text>++ <rect class="box node" x="280" y="80" width="120" height="64" rx="6"/>+ <text class="label" x="340" y="110">Second</text>+ <text class="sub" x="340" y="127">detail</text>++ <path class="wire strong" d="M166 112H274"/>+ <text class="tag" x="220" y="104">/route</text>++ <path class="wire" d="M340 150V170a14 14 0 0 1-14 14H114a14 14 0 0 1-14-14V150"/>++ <path class="wire" d="M406 112H494"/>+ <circle class="hl" cx="530" cy="112" r="30"/>+ <g transform="translate(518 100)">+ <circle class="hl-icon" cx="12" cy="12" r="9"/>+ <ellipse class="hl-icon" cx="12" cy="12" rx="4" ry="9"/>+ <path class="hl-icon" d="M3 12h18"/>+ </g>+</svg>+</body>+</html>diff --git a/.gitignore b/.gitignoreindex 03956a44e..cb00c1173 100644--- a/.gitignore+++ b/.gitignore@@ -62,6 +62,7 @@ logs/!.agents/skills/.agents/skills/*!.agents/skills/technical-writer/+!.agents/skills/architecture-diagram/.cursor/.context/skills-lock.json