@senad-d/drawme 0.1.11 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/reference.md CHANGED
@@ -4,11 +4,13 @@
4
4
 
5
5
  DrawMe turns diagram requirements into editable `.drawio` sources and local PNG, SVG, PDF, or JPG exports, including verified standalone animated SVG. The extension provides commands that start guided workflows and tools for CLI detection, Mermaid conversion, XML layout, structural and animation validation, shape lookup, export, explanation, and file opening.
6
6
 
7
- This document lists the extension's public surface: commands, tools, options, defaults, output behavior, and limitations. It is not a workflow guide — the `/drawme` command injects the full authoring workflow itself, and the registered tool descriptions carry the operational rules. Two conventions apply everywhere: the `.drawio` file is the source of truth (exports are derived artifacts), and several tools report failures as a text result (`Export failed`, `Layout failed`, `Mermaid conversion failed`, `Fit canvas failed`, `Explain failed`, `Open failed`) rather than a tool-call error, so results must always be read.
7
+ This document lists the extension's public surface: commands, tools, options, defaults, output behavior, and limitations. It is not a workflow guide — the `/drawme` command injects the full authoring workflow itself, and the registered tool descriptions carry the operational rules. The `.drawio` file is the source of truth; exports are derived artifacts. Relative tool and command paths resolve against the calling Pi session's working directory; absolute paths are used as supplied.
8
+
9
+ Always read the result text. These prefixes indicate failure even if the tool call returns normally: `Export failed:`, `Animate failed:`, `Fit canvas failed:`, `Mermaid conversion failed:`, `Layout failed:`, `Explain failed:`, and `Open failed:`. Validation returns diagnostics and flags incomplete reports separately.
8
10
 
9
11
  ## Functional availability
10
12
 
11
- | Functionality | draw.io CLI required | draw.io 30+ required |
13
+ | Functionality | draw.io CLI required | draw.io 30.2.4 or newer required |
12
14
  | --- | --- | --- |
13
15
  | Write or edit uncompressed `.drawio` XML with normal file tools | No | No |
14
16
  | `drawio_validate` | No | No |
@@ -23,7 +25,9 @@ This document lists the extension's public surface: commands, tools, options, de
23
25
 
24
26
  When the CLI is unavailable, you can still author, edit, validate, explain, and search for shapes. Skip conversion, layout, preview, and final export.
25
27
 
26
- When the CLI is older than version 30, export remains available. Mermaid conversion and ELK layout do not.
28
+ Mermaid conversion and ELK layout require draw.io **30.2.4 or newer**. Explicit `pageIndex` on export or animation requires **32.4.1 or newer**; omitting it leaves page selection to the renderer rather than sending an index. Ordinary exports without an explicit index do not require these feature versions.
29
+
30
+ On WSL, install a native Linux draw.io renderer inside WSL; using the Windows executable from WSL is not supported. On Linux, run Pi as an unprivileged user: DrawMe refuses to run draw.io as root rather than disabling the renderer sandbox. For headless Linux, install `xvfb-run` so discovery and rendering can run without a display.
27
31
 
28
32
  ## Commands
29
33
 
@@ -31,11 +35,17 @@ Commands are user-facing shortcuts. Use the model-callable tools when you need e
31
35
 
32
36
  | Command | Functionality |
33
37
  | --- | --- |
34
- | `/drawme <description>` | Starts the full autonomous workflow: check, plan, author, validate, gated multi-pass visual review (fit/sizing → element placement → connections → holistic confirmation), and final export — no human intervention once started. The command pre-resolves the draw.io CLI and embeds the diagram-types, XML-authoring, style-presets, and (on v30+) Mermaid references into the injected message, so the run starts without tool calls or file reads; only the troubleshooting reference is read on demand. |
35
- | `/drawme-check` | Displays the detected draw.io path and version, or reports that the CLI is unavailable. |
36
- | `/drawme-export <file> [png\|svg\|animated-svg\|pdf\|jpg]` | Performs a final export of an existing `.drawio`; format defaults to PNG. `animated-svg` requires motion and verifies the result. |
38
+ | `/drawme <description>` | Starts the autonomous [authoring workflow](../README.md#the-drawme-workflow): check, source-grounded planning where applicable, author, validate, gated multi-pass review, and final export when available. |
39
+ | `/drawme-check` | Displays the detected draw.io path, version, and whether Mermaid import and `--layout` are supported, or explains why the CLI is unavailable. |
40
+ | `/drawme-export <file> [png\|svg\|animated-svg\|pdf\|jpg]` | Performs a final export of an existing `.drawio`; format defaults to PNG. `animated-svg` verifies native connector flow or a portable native page sequence. For stored DrawMe motion, call `drawio_animate` with `input` and omit `steps`. |
41
+
42
+ `/drawme` resolves the draw.io CLI and sends one follow-up with the status and the diagram-types, XML-authoring, style-presets, and (when conversion is supported) Mermaid references. Pi need not reread preloaded references; a failed preload still has a read fallback, and the troubleshooting reference stays on demand. Project source is not part of the preload.
43
+
44
+ For implementation requests, Pi reads the relevant source in Plan, records the evidence for each claim, and draws only what the source supports. If no useful subset is supported, the reply explains what is missing instead of creating an implementation diagram. Source read into Pi may enter the configured model's context. Conceptual requests use the supplied description without unrelated reads. An explicit view wins; otherwise the [purpose guide](../assets/references/diagram-types.md#choose-a-view) selects a composition by the reader's question.
37
45
 
38
- `/drawme-export` intentionally exposes only the source path and format. Use `drawio_export` for output naming, dimensions, border, transparency, embedding, page selection, animation mode, or binary selection. The command uses whitespace-separated arguments and is unsuitable for paths containing spaces.
46
+ With or without an attached preview, review compares implementation claims with the source before final export. If no validated version passes that check, Pi reports the limitation instead of delivering an implementation diagram. When no preview image is attached, structural review uses `drawio_validate`, `drawio_explain`, and the editable XML for facts the explanation omits. It flags facts that remain unverified and does not claim that pixels were inspected. The reply names key source locations and consequential gaps for implementation views.
47
+
48
+ `/drawme-export` intentionally exposes only the source path and format. Use `drawio_export` for output naming, dimensions, border, transparency, embedding, page selection, or animation mode. The command uses whitespace-separated arguments and is unsuitable for paths containing spaces.
39
49
 
40
50
  ## Tools
41
51
 
@@ -45,11 +55,7 @@ DrawMe registers ten model-callable tools.
45
55
 
46
56
  Detects the draw.io desktop CLI, its version, and version-gated features.
47
57
 
48
- #### Options
49
-
50
- | Option | Type | Required | Description |
51
- | --- | --- | --- | --- |
52
- | `binary` | string | No | Explicit binary path to test first. Standard platform candidates are tried afterward if it fails. |
58
+ This tool takes no arguments. All tools and commands share the same CLI discovery. To use a custom installation, set `DRAWME_DRAWIO_BINARY` to its absolute executable path in Pi's launch environment. DrawMe tries that path before the usual PATH and installation locations. Tool calls cannot choose an executable.
53
59
 
54
60
  #### Result behavior
55
61
 
@@ -58,9 +64,9 @@ A successful result includes:
58
64
  - `available: true`;
59
65
  - resolved `binary` path or command;
60
66
  - `version` and numeric `major` version;
61
- - `supportsMermaid` and `supportsLayout` flags.
67
+ - `supportsMermaid` and `supportsLayout` flags (both require 30.2.4 or newer).
62
68
 
63
- An unavailable result includes `available: false` and guidance that XML authoring can continue without export.
69
+ An unavailable result includes `available: false` and recovery guidance, rather than claiming feature support. XML authoring can continue without the renderer.
64
70
 
65
71
  #### Use
66
72
 
@@ -68,7 +74,6 @@ Call once at the start of any workflow that may use conversion, layout, preview,
68
74
 
69
75
  ```text
70
76
  drawio_check({})
71
- drawio_check({ "binary": "/custom/path/to/drawio" })
72
77
  ```
73
78
 
74
79
  ---
@@ -84,45 +89,46 @@ Exports an existing `.drawio` through the local draw.io desktop CLI.
84
89
  | `input` | string | Yes | — | Existing `.drawio` source path. |
85
90
  | `format` | `png` \| `svg` \| `pdf` \| `jpg` | No | `png` | Output format. |
86
91
  | `mode` | `preview` \| `final` | No | `final` | Selects inspection or deliverable defaults. |
87
- | `output` | string | No | Derived beside input | Explicit output path. |
88
- | `scale` | number | No | `2` | Scale for final PNG/JPG when `width` is absent. |
89
- | `width` | number | No | Preview: `2000` | Target width in pixels. Overrides `scale`. |
92
+ | `output` | string | No | Derived beside input | Destination file, not a directory. A filename suffix, if supplied, must match the format (case-insensitive; `.jpeg` is accepted for JPG). |
93
+ | `scale` | number | No | `2` | Requested scale for final PNG/JPG when `width` is absent; DrawMe may lower it to meet the pixel budget. |
94
+ | `width` | positive integer | No | See below | Requested width in pixels. Overrides raster scale; SVG padding is added afterward. PDF uses the authored page size. There is no public `height` option. |
90
95
  | `transparent` | boolean | No | `false` | Enables transparency for PNG only. |
91
- | `border` | number | No | `40` | Outer margin around the content in diagram units (so 80px in a scale-2 PNG). draw.io crops exports to the content, so this is the image's only margin; the default matches `drawio_fit_canvas`. Use `0` for no border. |
92
- | `pageIndex` | number | No | draw.io default | Positive, 1-based page number for multi-page files. |
96
+ | `border` | number | No | `40` | Outer margin; see format-specific sizing below. Use `0` for no added border. |
97
+ | `pageIndex` | positive integer | No | draw.io default | One-based page number. Must identify an existing page; explicit selection requires draw.io 32.4.1 or newer. |
93
98
  | `embed` | boolean | No | Mode/format dependent | Controls embedding of editable diagram XML. |
94
99
  | `animated` | boolean | No | `false` | Requires and verifies standalone animation. Valid only for final SVG; when format is omitted, animated mode defaults it to SVG. |
95
- | `binary` | string | No | Auto-detected | Explicit binary path to test first. |
96
100
 
97
101
  #### Mode and naming behavior
98
102
 
99
103
  For an input named `name.drawio`:
100
104
 
101
- | Export | Default output | Raster sizing | Embedded XML |
105
+ | Export | Default output | Default sizing | Default embedded XML |
102
106
  | --- | --- | --- | --- |
103
- | Preview PNG | `name.png` | Width 2000 | No |
104
- | Final PNG | `name.drawio.png` | Scale 2 | Yes |
105
- | Final SVG | `name.svg` | Vector | Yes |
106
- | Verified animated SVG (`animated:true`) | `name.svg` | Vector | Yes |
107
- | Final PDF | `name.pdf` | Vector | Yes |
108
- | Final JPG | `name.jpg` | Scale 2 | No |
107
+ | Preview PNG | `name.preview.png` | At most 2000px on either axis | No |
108
+ | Final PNG | `name.drawio.png` | Scale 2, subject to budget | Yes |
109
+ | Final SVG | `name.svg` | Vector, with added margin | Yes |
110
+ | Verified animated SVG (`animated:true`) | `name.svg` | Vector, with added margin | Yes |
111
+ | Final PDF | `name.pdf` | Authored print page | Yes |
112
+ | Final JPG | `name.jpg` | Scale 2, subject to budget | No |
109
113
 
110
114
  Additional behavior:
111
115
 
112
- - An explicit `output` replaces the derived name.
116
+ - Other preview formats use the same `.preview` suffix before the format extension. If the default preview path is already in use by a file the current preview does not own, choose an explicit `output`. An explicit `output` replaces the derived name, but it must not refer to the editable input, even through a link. DrawMe publishes new bytes only after rendering and verification succeed; a failed export leaves the existing destination intact.
113
117
  - `animated:true` is valid only with `mode:"final"` and SVG. It rejects a static result instead of silently returning an ordinary SVG. Persistent `flowAnimation=1` connector motion is verified after draw.io renders it. Portable page-root visibility/opacity/fade/wait sequences are compiled into CSS inside the SVG and include a `prefers-reduced-motion` fallback that stops motion and reveals sequenced cells.
114
118
  - Standalone page sequences support `opacity`, `show`, `hide`, `toggle`, `fadeIn`, `fadeOut`, `fadeTo`, `wait`, explicit cell/wildcard/exclusion selectors, loop control, and `immediate:true` parallel batches. Viewer-dependent wipe/pop, highlight, dynamic-flow, style, navigation, tag/layer, and link actions are rejected in animated SVG mode.
115
- - The outer margin is even on all sides. draw.io applies its border unevenly for scaled rasters and for SVG, so a final PNG/JPG is sized with `--width` from the page's content width (keeping the requested scale) and an SVG is exported borderless and padded by DrawMe.
116
- - Every SVG (static or animated) is pinned to its authored colors: draw.io's `light-dark()` adaptive colors are resolved to the authored value and the color scheme is fixed to `light`, so the SVG looks the same as the PNG/PDF in every viewer, including dark-mode ones.
117
- - An explicit `width` replaces raster scaling.
118
- - `scale` is ignored in preview mode and for vector formats.
119
- - `transparent` has no effect outside PNG.
120
- - Preview mode defaults to unembedded output suitable for visual inspection. When the current model can view images, a successful PNG preview tool result contains its normal text/metadata block followed by an `image/png` base64 image block; otherwise the image is omitted. The result text always states which case applies, and the output path in the text stays usable either way. A first preview asks for a critique against the current review pass's checklist; a preview that replaces an earlier one instead asks for a before/after comparison with a fixed / not fixed / regressed verdict per addressed finding.
121
- - Final exports stay text-only; final PNG, SVG, and PDF default to embedded/editable output.
122
- - JPG cannot carry editable XML; never set `embed: true` for JPG.
123
- - Embedded PNG exports are checked for draw.io's known truncated IEND chunk and repaired automatically when necessary.
124
- - Every successful preview output is tracked, including explicit `output` paths. After a replacement preview exists, the tool automatically removes the previous preview file for the same source, so only the latest artifact remains. The first successful final export removes that remaining preview. Cleanup failures are returned as warnings without invalidating the new export.
125
- - Headless Linux handling is automatic, including `xvfb-run`, GPU disabling, and the root sandbox flag.
119
+ - **PNG/JPG:** The 6,000,000-pixel (6 megapixel) area budget includes the border. DrawMe may lower the requested scale or constrain explicit sizes while preserving aspect ratio, or refuse a result that cannot fit. An explicit raster `width` includes the border; without it, scaling applies to both the content and its margin in final exports. Raster previews ignore scale and fit within 2000px on **both** axes, including the border.
120
+ - **SVG:** The renderer sizes the borderless content first. The requested `width` is before padding; DrawMe then adds the margin on each side. The final width includes both margins and may reflect renderer rounding. SVGs keep their authored colors in dark-mode viewers.
121
+ - **PDF:** Exports use the authored print-page bounds, not a tight content crop. `width` and `scale` do not resize the print page.
122
+ - `transparent` has no effect outside PNG. Preview mode never embeds editable XML, even with `embed: true`. JPG cannot carry editable XML; a JPG request with `embed: true` fails.
123
+ - Final exports are text-only; final PNG, SVG, and PDF default to embedded/editable output. Only an otherwise valid PNG is eligible for repair of a missing or truncated IEND tail.
124
+
125
+ #### Preview attachments and cleanup
126
+
127
+ A PNG preview attaches an `image/png` block only when the published file is readable, matches the verified export, is unembedded and within the review limit, and the active model explicitly supports images. Text-only and unknown models get no image. A failed read or verification returns `Export failed:` as text, not an attachment claim. Read the result before attempting visual review; `details.imageAttached` says whether an image block is present.
128
+
129
+ Compare before and after only when the result reports a comparable prior attachment of the same source and page still in the model's context. A replaced file or a message in the transcript does not prove that the older image is available to the model. Without a comparable attachment, critique the fresh image against the written findings.
130
+
131
+ A successful preview or final export can retire older previews tracked for the same source, including previews of other pages and explicit preview paths. Tracking is process-local: DrawMe does not reconstruct it after restart. Cleanup leaves edited or replaced files and symlink destinations alone, and reports cleanup failures as warnings without invalidating the new export. Removal of a file does not erase its earlier image attachment from the transcript.
126
132
 
127
133
  #### Use
128
134
 
@@ -154,7 +160,7 @@ drawio_export({
154
160
  })
155
161
  ```
156
162
 
157
- Use a distinct `output` for each format or page. Never present a preview artifact as the final deliverable when a final export was requested. Do not manually delete superseded or final-review previews; the tool replaces and cleans them automatically.
163
+ Use a distinct `output` for each format or page. Never present a preview artifact as the final deliverable when a final export was requested. During review, let the tool manage eligible tracked previews; do not promise that their paths will remain on disk.
158
164
 
159
165
  ---
160
166
 
@@ -170,16 +176,15 @@ Adds motion to an existing `.drawio` page and exports a verified standalone anim
170
176
  | `steps` | array | No | Stored motion | Ordered motion steps (below). Omit to re-export the motion already stored on the page. |
171
177
  | `loop` | boolean | No | `true` | Repeat the sequence. |
172
178
  | `hold` | number | No | `1600` | Pause in ms on the final state before a loop restarts. |
173
- | `pageIndex` | number | No | `1` | Positive, 1-based page to animate. |
174
- | `output` | string | No | `name.animated.svg` | Animated SVG path. |
175
- | `storyboard` | boolean | No | `true` | Render `name.storyboard.png`. |
176
- | `binary` | string | No | Auto-detected | Explicit binary path to test first. |
179
+ | `pageIndex` | positive integer | No | `1` | One-based page to animate. Passing it explicitly requires draw.io 32.4.1 or newer. |
180
+ | `output` | string | No | `name.animated.svg` | Animated SVG file. Use distinct outputs to retain the SVGs for multiple pages. |
181
+ | `storyboard` | boolean | No | `true` | Render a persistent storyboard PNG; see naming below. |
177
182
 
178
183
  Each step has an `effect` and, except for `wait`, a `cells` array of vertex or edge ids. Optional fields: `duration` (ms; required for `wait`), `stagger` (ms between consecutive cells), `parallel` (start with the previous step), `direction` (`slideIn`: `up`, `down`, `left`, `right`), `color` (hex, for `highlight` and `travel`), and `value` (`dim` opacity, default 0.25).
179
184
 
180
185
  | Effect | Targets | Default duration | Result |
181
186
  | --- | --- | --- | --- |
182
- | `fadeIn` / `fadeOut` | any cell | 600 / 500 ms | Fade to visible / hidden |
187
+ | `fadeIn` / `fadeOut` | any cell | 600 / 500 ms | Fade to fully visible / hidden; `fadeIn` also works on a dimmed visible cell |
183
188
  | `dim` | any cell | 500 ms | Fade to `value` |
184
189
  | `popIn` | hidden cell | 550 ms | Scale up from 60% with overshoot while fading in |
185
190
  | `slideIn` | hidden cell | 650 ms | Move 32px in `direction` while fading in |
@@ -190,11 +195,14 @@ Each step has an `effect` and, except for `wait`, a `cells` array of vertex or e
190
195
 
191
196
  #### Behavior
192
197
 
193
- - A cell whose first effect is an entrance (`fadeIn`, `popIn`, `slideIn`, `drawIn`) starts hidden; all other cells start visible. Entrances on visible cells, emphasis on hidden cells, a cell targeted twice in one parallel group, `drawIn` on dashed or `flowAnimation=1` connectors, and missing or wrong-kind ids are rejected before anything is written.
198
+ - Use at most 200 steps. `hold`, `stagger`, and wait duration accept 0–60,000 ms inclusive. Visual effect duration must be greater than 0 and at most 60,000 ms (0.5 ms is valid; 0 ms is not). The timeline may be at most 300,000 ms before the final hold.
199
+ - A cell whose first effect is an entrance (`fadeIn`, `popIn`, `slideIn`, `drawIn`) starts hidden; other cells start in their authored state. A dimmed visible cell can `fadeIn` to full opacity, but a fully visible cell cannot enter again. Emphasis on a cell hidden by itself or an ancestor, a cell targeted twice in one parallel group, `drawIn` on dashed or `flowAnimation=1` connectors, and missing or wrong-kind ids are rejected before anything is written. A sequence with no effective visual motion is rejected.
194
200
  - Valid steps are stored as JSON in the `drawmeMotion` attribute of the page root cell (wrapping `<mxCell id="0"/>` in a `UserObject` when needed). This is a source edit; `drawio_validate` checks stored motion and reports a page that also has an enabled native page animation.
195
- - The page is exported to an embedded SVG, then group opacity, transform, and glow become CSS keyframes, connector draw-in uses `pathLength` and `stroke-dashoffset`, and travelling dots use SMIL `animateMotion` along the rendered connector path. A `prefers-reduced-motion` rule shows the final state and hides dots. Persistent connector flow is preserved. A missing cell group or connector path fails the call and removes the output.
201
+ - The page is exported to an embedded SVG, then group opacity, transform, and glow become CSS keyframes, connector draw-in uses `pathLength` and `stroke-dashoffset`, and travelling dots use SMIL `animateMotion` along the rendered connector path. A `prefers-reduced-motion` rule shows the final state and hides dots. Persistent connector flow is preserved. A missing cell group or connector path fails before publication, leaving any previous SVG and preview intact.
196
202
  - `highlight` and `travel` default to the theme accent: `#60a5fa` on a dark page `background`, `#2563eb` otherwise.
197
- - The storyboard is one PNG with a captioned frame per sequential step (at most 12, sampled evenly) showing the end state of that step; highlight and travel steps show their accent on the stroke. It proves order and visibility, not easing. When the current model can view images, the storyboard is attached to the result.
203
+ - The storyboard shows captioned end states of visual batches. Parallel steps share one frame; a wait-only batch consumes time without adding a frame. DrawMe samples at most 12 frames evenly across the visual batches, keeping the first and last. Use it to check order and visibility, not easing or playback.
204
+ - Page 1 exported to the default `name.animated.svg` uses `name.storyboard.png`. Otherwise, DrawMe appends `.page-<index>.frames.png` to the full SVG output path (for example, `story.v2.svg.page-2.frames.png`).
205
+ - The storyboard is a persistent, unembedded final PNG. If either side exceeds 2000px, the valid file stays on disk and the tool reports its path without attaching it. Otherwise an image is attached only if the published PNG passes the same checks as a [preview attachment](#preview-attachments-and-cleanup) and the model supports images. A failed read or verification returns `Animate failed:` without claiming an attachment.
198
206
  - The motion plays in browsers and in SVGs embedded as images. draw.io itself does not play it.
199
207
 
200
208
  #### Use
@@ -256,7 +264,7 @@ Actionable warnings include:
256
264
 
257
265
  Informational observations identify checks intentionally skipped for infinite canvases or omitted/invalid page dimensions. They also identify auto-routed edges whose direct connection line pierces an unrelated shape so the rendered route can receive focused preview review. All normal-page diagnostics are page-specific. Content bounds account for nested container offsets, visible nodes/containers, explicit waypoints, and separately sized edge labels on resolvable explicit routes where practical.
258
266
 
259
- The result text and details also include a readability score:
267
+ A complete report includes a readability score in the result text and details:
260
268
 
261
269
  - route through vertex: 20 points;
262
270
  - edge crossing: 10 points;
@@ -269,6 +277,8 @@ Lower is better, but scores are meaningful only when comparing layout variants o
269
277
 
270
278
  Fix every error and rerun validation. Fix each warning or record an explicit reviewed-and-acceptable reason before final export. Informational observations do not require correction.
271
279
 
280
+ `Validation incomplete` (`complete: false` in details) is not a clean result, even if few findings were reported. Resolve the read or parse problem or address the reported limit (for example, split a large diagram), then validate again.
281
+
272
282
  ```text
273
283
  drawio_validate({ "input": "architecture.drawio" })
274
284
  ```
@@ -311,7 +321,7 @@ drawio_fit_canvas({ "input": "architecture.drawio", "margin": 60 })
311
321
 
312
322
  ### `drawio_from_mermaid`
313
323
 
314
- Converts Mermaid into an automatically laid-out, editable native `.drawio`. Requires draw.io 30 or newer.
324
+ Converts Mermaid into an automatically laid-out, editable native `.drawio`. Requires draw.io 30.2.4 or newer.
315
325
 
316
326
  #### Options
317
327
 
@@ -320,14 +330,13 @@ Converts Mermaid into an automatically laid-out, editable native `.drawio`. Requ
320
330
  | `mermaid` | string | One of `mermaid`/`input` | — | Inline Mermaid text. A temporary `.mmd` is removed after conversion. |
321
331
  | `input` | string | One of `mermaid`/`input` | — | Existing `.mmd` source path. |
322
332
  | `output` | string | No | See below | Destination `.drawio` path. |
323
- | `binary` | string | No | Auto-detected | Explicit binary path to test first. |
324
333
 
325
334
  Output defaults:
326
335
 
327
336
  - file input: same directory and stem with `.drawio`;
328
- - inline Mermaid: `diagram.drawio` in the current working directory.
337
+ - inline Mermaid: `diagram.drawio` in the Pi session's working directory.
329
338
 
330
- Provide exactly one of `mermaid` or `input`. Normally provide `output` explicitly to avoid ambiguous names or accidental replacement.
339
+ Provide exactly one nonblank source: `mermaid` or `input`. Supplying neither or both is a pre-conversion error. Normally provide `output` explicitly to avoid ambiguous names or accidental replacement.
331
340
 
332
341
  #### Best use
333
342
 
@@ -341,7 +350,7 @@ Use for standard structure-first diagrams without precise draw.io styling requir
341
350
  - gantt charts;
342
351
  - mind maps.
343
352
 
344
- Do not choose Mermaid conversion when the requested artifact needs official vendor icons, exact UML/BPMN styles, custom containers or swimlanes, precise coordinates, explicit edge waypoints, or multi-page drill-down behavior.
353
+ Do not choose Mermaid conversion when it cannot preserve the chosen composition or when the requested artifact needs official vendor icons, exact UML/BPMN styles, custom containers or swimlanes, precise coordinates, explicit edge waypoints, or multi-page drill-down behavior.
345
354
 
346
355
  The conversion already lays out the graph. Never run `drawio_layout` afterward.
347
356
 
@@ -352,13 +361,13 @@ drawio_from_mermaid({
352
361
  })
353
362
  ```
354
363
 
355
- The converted file is a normal `.drawio` source: it can be validated, previewed, and exported like any other.
364
+ The converted `.drawio` has a finite canvas. Fit it to the content with `drawio_fit_canvas`, then validate, preview, and export it like any other source.
356
365
 
357
366
  ---
358
367
 
359
368
  ### `drawio_layout`
360
369
 
361
- Repositions nodes and routes edges in an XML-authored `.drawio` using a safe ELK preset. Requires draw.io 30 or newer.
370
+ Repositions nodes and routes edges on the first page of an XML-authored `.drawio` using a safe ELK preset. It preserves the authored page display settings and leaves other pages unchanged. Requires draw.io 30.2.4 or newer.
362
371
 
363
372
  #### Options
364
373
 
@@ -367,7 +376,6 @@ Repositions nodes and routes edges in an XML-authored `.drawio` using a safe ELK
367
376
  | `input` | string | Yes | — | Existing `.drawio` source. |
368
377
  | `preset` | layout preset | Yes | — | One of the six allowlisted values below. |
369
378
  | `output` | string | No | `<name>.layout.drawio` | Destination path beside the input. May equal `input` for intentional in-place layout. |
370
- | `binary` | string | No | Auto-detected | Explicit binary path to test first. |
371
379
 
372
380
  #### Presets
373
381
 
@@ -380,7 +388,7 @@ Repositions nodes and routes edges in an XML-authored `.drawio` using a safe ELK
380
388
  | `radialTree` | Tree arranged around a center. |
381
389
  | `organic` | Force-directed network or mind-map-like layout. |
382
390
 
383
- Use this tool for large or graph-heavy hand-authored XML, typically above approximately 15 nodes. Unknown presets are rejected because unsupported values can open a modal dialog and hang a headless process.
391
+ Use this tool for large or graph-heavy hand-authored XML when repositioning preserves the chosen composition. Do not use it to reposition sequence lifelines or message rows. Unknown presets are rejected because unsupported values can open a modal dialog and hang a headless process.
384
392
 
385
393
  ```text
386
394
  drawio_layout({
@@ -403,7 +411,7 @@ Searches a bundled local index of more than 10,000 official draw.io shapes.
403
411
  | Option | Type | Required | Default | Description |
404
412
  | --- | --- | --- | --- | --- |
405
413
  | `query` | string | Yes | — | Shape keywords such as `aws lambda`, `uml actor`, `bpmn timer event`, or `k8s pod`. |
406
- | `limit` | number | No | `10` | Maximum number of ranked results. |
414
+ | `limit` | nonnegative integer | No | `10` | Maximum number of ranked results; `0` returns none. |
407
415
 
408
416
  Each result contains:
409
417
 
@@ -434,7 +442,7 @@ The result:
434
442
 
435
443
  - lists leaf components;
436
444
  - groups components by named container;
437
- - lists relations between labeled endpoints;
445
+ - lists relations between existing endpoints, using an ID fallback for unlabeled endpoints;
438
446
  - uses edge labels as relation verbs;
439
447
  - produces a separate section for each page.
440
448
 
@@ -452,21 +460,21 @@ Explanation is a structural summary, not a validator and not a visual renderer.
452
460
 
453
461
  ### `drawio_open`
454
462
 
455
- Opens a local `.drawio` source or exported file with the operating system's default application.
463
+ Opens a local diagram or export with the operating system's default application.
456
464
 
457
465
  #### Options
458
466
 
459
467
  | Option | Type | Required | Description |
460
468
  | --- | --- | --- | --- |
461
- | `path` | string | Yes | Existing local file to open. |
469
+ | `path` | string | Yes | File to open. The resolved target must be a regular file with a `.drawio`, `.png`, `.svg`, `.pdf`, `.jpg`, or `.jpeg` extension (case-insensitive). |
462
470
 
463
471
  Platform behavior:
464
472
 
465
473
  - macOS: `open`;
466
- - Windows: `start`;
474
+ - Windows: the system file-association helper, without `cmd.exe`;
467
475
  - Linux: `xdg-open`.
468
476
 
469
- Use it when the user requests desktop review or accepts an offer to fine-tune the source manually. Opening an application is a user-visible side effect.
477
+ Use it when the user requests desktop review or accepts an offer to fine-tune the source manually. Opening a document is a user-visible side effect.
470
478
 
471
479
  ```text
472
480
  drawio_open({ "path": "architecture.drawio" })
@@ -476,14 +484,14 @@ drawio_open({ "path": "architecture.drawio" })
476
484
 
477
485
  | Requirement | Recommended path |
478
486
  | --- | --- |
479
- | Standard diagram with no custom styling and CLI 30+ | Mermaid → `drawio_from_mermaid`. |
480
- | Vendor icons, exact UML/BPMN notation, custom styling, swimlanes, containers, precise routing, or multi-page output | Hand-authored uncompressed XML plus `drawio_shapesearch`. |
481
- | Large hand-authored graph and CLI 30+ | Rough XML → `drawio_layout`. |
482
- | CLI unavailable or older than 30 | Hand-authored XML; validation and shape search remain available. |
487
+ | Standard diagram with no custom styling, Mermaid support, and a composition conversion can preserve | Mermaid → `drawio_from_mermaid`. |
488
+ | Precise placement or routing, custom notation or containers, vendor icons, or multi-page output | Hand-authored uncompressed XML; use `drawio_shapesearch` if needed. |
489
+ | Large hand-authored graph and layout support, where repositioning preserves the composition | Rough XML → `drawio_layout`. |
490
+ | CLI unavailable or missing conversion/layout support | Hand-authored XML; validation and shape search remain available. |
483
491
  | Existing diagram must be understood | `drawio_explain`, then inspect the source XML. |
484
492
  | Existing diagram only needs validation | `drawio_validate`; no CLI check is necessary. |
485
493
  | Existing diagram only needs export | `drawio_check` → `drawio_export`; do not rebuild it. |
486
- | Diagram needs continuous or timed motion | Hand-authored XML with connector flow/page animation metadata → validate → static PNG review → `drawio_export` with `animated:true`. |
494
+ | Diagram needs continuous or timed motion | Validate and review a static PNG. Use `drawio_animate` for typed DrawMe motion or `drawio_export` with `animated:true` for native connector flow or a portable native page sequence. |
487
495
 
488
496
  DrawMe does not expose a single natural-language-to-file tool. Author or edit Mermaid/XML with normal file tools, then use DrawMe for conversion, layout, validation, rendering, explanation, or opening.
489
497
 
@@ -491,22 +499,21 @@ DrawMe does not expose a single natural-language-to-file tool. Author or edit Me
491
499
 
492
500
  - `.drawio` is always the canonical editable source.
493
501
  - Final PNG, SVG, and PDF embed XML by default and can be reopened in draw.io where supported.
494
- - Verified animated SVG is standalone: it uses SVG/CSS motion rather than draw.io's network-loaded HTML viewer. Connector flow is rendered by draw.io; portable page sequences are compiled after export. A static PNG fallback is recommended for reduced-motion users and consumers that sanitize SVG animation.
502
+ - Verified animated SVG uses SVG/CSS motion rather than draw.io's network-loaded HTML viewer. Connector flow is rendered by draw.io; portable page sequences are compiled after export. If verification reports an unresolved local image dependency, re-embed the image in draw.io and export again. A static PNG fallback is recommended for viewers that sanitize SVG animation.
495
503
  - JPG cannot embed XML.
496
- - Preview PNG is intentionally clean and unembedded for visual inspection. Its successful tool result includes the image when the current model can view images, and the text always states whether it was attached and reports the output path. Each successful replacement removes the prior same-source preview file, and final export removes the latest remaining preview.
504
+ - Preview PNG is intentionally unembedded. See [Preview attachments and cleanup](#preview-attachments-and-cleanup) for when its image is attached or its file is retired.
497
505
  - A final embedded PNG normally uses the `.drawio.png` double extension.
498
506
  - Multi-page exports should use `pageIndex` and explicit unique output names.
499
507
  - `drawio_explain` returns Markdown as text; it does not write a documentation file.
500
508
  - `drawio_layout` creates a sibling `.layout.drawio` unless `output` is supplied.
501
- - Inline Mermaid conversion creates `diagram.drawio` in the working directory unless `output` is supplied.
509
+ - Inline Mermaid conversion creates `diagram.drawio` in the Pi session's working directory unless `output` is supplied.
502
510
 
503
511
  ## Functional limitations
504
512
 
505
513
  - Validation cannot inspect compressed pages.
506
514
  - Explanation cannot describe compressed pages.
507
515
  - Deterministic validation cannot replace visual inspection; rendered clipping, wrapping, contrast, and automatic routes can only be judged from the preview image. When the current model cannot view images, these remain unverified and must be reported as such.
508
- - Removing a superseded preview file does not rewrite Pi session history: image blocks already stored in earlier tool-result messages can remain visible in the transcript even though only the latest preview file remains on disk.
509
- - Route-through and crossing analysis is limited to edges with explicit waypoints; dense auto-routed graphs can validate without connector-route warnings.
516
+ - Deterministic route-through and crossing checks apply to explicit waypoint routes. An unchecked auto-route warning means validation could not inspect the rendered route, not that it found a crossing. A direct-path obstruction observation is a hint for preview review, not proof of the rendered route.
510
517
  - Shape search covers bundled official draw.io shapes, not arbitrary third-party logos.
511
518
  - Mermaid conversion cannot express all draw.io styles, containers, routing, or multi-page behavior.
512
519
  - ELK layout accepts only the six registered presets; arbitrary JSON layouts are not exposed.
@@ -514,14 +521,13 @@ DrawMe does not expose a single natural-language-to-file tool. Author or edit Me
514
521
  - SVG hosts may sanitize styles or display only a static frame; retain the `.drawio` source and provide a PNG fallback when compatibility matters.
515
522
  - Animation preview is structural: the attached review PNG is static. Final animated export verifies generated animation markup but does not attach temporal playback to the model for visual review.
516
523
  - The extension does not expose GIF/video rendering, HTML viewers, XML compression/decompression, Python generators, or arbitrary draw.io CLI arguments.
517
- - A failed operation may be returned as text beginning with `Export failed`, `Layout failed`, `Mermaid conversion failed`, `Explain failed`, or `Open failed`. Treat that result as failure.
518
524
 
519
525
  ## Authoring references
520
526
 
521
527
  Use these packaged references when additional notation or XML detail is needed:
522
528
 
523
529
  - [`../assets/references/xml-authoring.md`](../assets/references/xml-authoring.md) — XML cells, containers, edges, palette, and spacing;
524
- - [`../assets/references/diagram-types.md`](../assets/references/diagram-types.md) — notation-specific shapes and layout conventions;
530
+ - [`../assets/references/diagram-types.md`](../assets/references/diagram-types.md) — purpose selector, composition and review recipes, and notation-specific shapes;
525
531
  - [`../assets/references/mermaid-authoring.md`](../assets/references/mermaid-authoring.md) — Mermaid syntax and conversion guidance;
526
532
  - [`../assets/references/troubleshooting.md`](../assets/references/troubleshooting.md) — rendering and platform failure patterns.
527
533
 
@@ -0,0 +1,18 @@
1
+ # DrawMe testing
2
+
3
+ Run these checks from the repository root after installing the locked dependencies. See the [contributor guide](https://github.com/senad-d/DrawMe/blob/main/CONTRIBUTING.md#the-validation-gate) for the required merge gate.
4
+
5
+ | Check | Command | Coverage |
6
+ | --- | --- | --- |
7
+ | Bundled asset integrity | `npm run check:golden` | SHA-256 baseline for relative paths and file content under `assets/`. |
8
+ | Lint | `npm run lint` | Runs the type, ESLint, and formatting checks below in order. |
9
+ | Type checking | `npm run typecheck` | TypeScript in `src/` and `tests/`, without emitting files. |
10
+ | ESLint | `npm run lint:eslint` | TypeScript and JavaScript covered by `eslint.config.js`; fails on warnings. |
11
+ | Formatting | `npm run format:check` | LF endings, trailing whitespace, final newlines, and JSON syntax in the files selected by `scripts/format-check.mjs`. |
12
+ | PNG unit tests | `npx vitest run tests/png.test.ts` | PNG metadata, chunk validation, and repair. |
13
+ | Registered authoring contracts | `npx vitest run tests/documented-contracts.test.ts tests/integration.test.ts -t "registered authoring contracts\|gated multi-pass, fully autonomous workflow"` | `/drawme` follow-up delivery, gated multi-pass autonomous workflow, packaged selector links, and renderer-gated references and tools. |
14
+ | Native renderer tests | `npx vitest run tests/integration-native.test.ts tests/native-artifacts.test.ts` | Preview and final exports, artifact contents, Mermaid conversion, and layout against the installed draw.io renderer. |
15
+ | Package inventory | `npm run pack:dry-run` | Lists files npm would ship without writing a tarball. |
16
+ | Package contents | `npm run check:pack` | Checks required and forbidden files and the local runtime import graph against the npm package manifest. |
17
+
18
+ Native cases can skip when the renderer or the required capabilities are unavailable. See the [renderer requirements](../README.md#requirements-and-compatibility) and check the test output before counting these cases as exercised.
package/example/README.md CHANGED
@@ -4,21 +4,21 @@ The `.drawio` files are the editable sources of truth. Each has a final `.drawio
4
4
 
5
5
  | Diagram | What it demonstrates |
6
6
  | --- | --- |
7
- | [User flow](drawme-how-it-works.drawio.png) · [source](drawme-how-it-works.drawio) | **Multi-color:** numbered stages, native input/document shapes, blue authoring, purple quality, green delivery, a three-role legend, and explicit CLI/text-only fallbacks. |
8
- | [Installation](drawme-installation-guide.drawio.png) · [source](drawme-installation-guide.drawio) | **Light:** three columns separate preparation, package scope, and first use; monospace commands distinguish terminal actions from commands inside Pi. |
9
- | [Architecture](drawme-architecture.drawio.png) · [source](drawme-architecture.drawio) | All ten tools, pure-TypeScript checks versus desktop CLI operations, optional OS opening, and local rendering versus model-provider access. Replaces the obsolete waterfall overview. |
10
- | [Validation decision tree](drawme-validation-decision-tree.drawio.png) · [source](drawme-validation-decision-tree.drawio) | Error/warning gates, attachment-aware review, correction of the current pass, eight-retry limit, explicit exceptions, and preview cleanup. |
11
- | [Animated order fulfillment](event-driven-orders.animated.svg) · [source](event-driven-orders.drawio) · [PNG fallback](event-driven-orders.drawio.png) · [storyboard](event-driven-orders.storyboard.png) | **Dark:** 13 official AWS4 components in four zones, transactional outbox, SNS/SQS fan-out, idempotent Lambda consumers, queue-level redrive, and staged motion in a 12.56-second loop. |
12
- | [Git graph](git-graph-example.drawio.png) · [source](git-graph-example.drawio) | Retained classic multi-color branching/merge example. Its commit IDs and version labels are illustrative, not this repository's current history. |
7
+ | [User flow](https://github.com/senad-d/DrawMe/blob/main/example/drawme-how-it-works.drawio.png) · [source](drawme-how-it-works.drawio) | **Multi-color:** numbered stages, native input/document shapes, blue authoring, purple quality, green delivery, a three-role legend, and explicit CLI/text-only fallbacks. |
8
+ | [Installation](https://github.com/senad-d/DrawMe/blob/main/example/drawme-installation-guide.drawio.png) · [source](drawme-installation-guide.drawio) | **Light:** three columns separate preparation, package scope, and first use; monospace commands distinguish terminal actions from commands inside Pi. |
9
+ | [Architecture](https://github.com/senad-d/DrawMe/blob/main/example/drawme-architecture.drawio.png) · [source](drawme-architecture.drawio) | All ten tools, pure-TypeScript checks versus desktop CLI operations, optional OS opening, and local rendering versus model-provider access. Replaces the obsolete waterfall overview. |
10
+ | [Validation decision tree](https://github.com/senad-d/DrawMe/blob/main/example/drawme-validation-decision-tree.drawio.png) · [source](drawme-validation-decision-tree.drawio) | Error/warning gates, attachment-aware review, correction of the current pass, eight-retry limit, explicit exceptions, and preview cleanup. |
11
+ | [Animated order fulfillment](https://github.com/senad-d/DrawMe/blob/main/example/event-driven-orders.animated.svg) · [source](event-driven-orders.drawio) · [PNG fallback](https://github.com/senad-d/DrawMe/blob/main/example/event-driven-orders.drawio.png) · [storyboard](https://github.com/senad-d/DrawMe/blob/main/example/event-driven-orders.storyboard.png) | **Dark:** 13 official AWS4 components in four zones, transactional outbox, SNS/SQS fan-out, idempotent Lambda consumers, queue-level redrive, and staged motion in a 12.56-second loop. |
12
+ | [Git graph](https://github.com/senad-d/DrawMe/blob/main/example/git-graph-example.drawio.png) · [source](git-graph-example.drawio) | Retained classic multi-color branching/merge example. Its commit IDs and version labels are illustrative, not this repository's current history. |
13
13
 
14
14
  The showcase follows the **Light**, **Dark**, and **Multi-color** presets in [`style-presets.md`](../assets/references/style-presets.md). Installation, extension architecture, and the detailed validation reference stay Light. User-flow colors encode roles, not arbitrary decoration; the cloud example uses the Dark accent for its main path and motion. The Git graph intentionally keeps its classic palette.
15
15
 
16
16
  ## Correctness and scope
17
17
 
18
18
  - Installation commands follow the version-matched Pi package/CLI documentation. Personal settings default to `~/.pi/agent/settings.json`; project settings require trust. `pi -e` starts a single invocation without changing settings, unlike persistent installation followed by `pi` or `/reload`.
19
- - `/drawme-check` reports the detected CLI path and version. Mermaid conversion and ELK layout require draw.io v30+; ordinary rendering and export do not.
19
+ - `/drawme-check` reports the detected CLI path and version and whether Mermaid import and `--layout` are supported, or explains why the renderer is unavailable. Mermaid conversion and ELK layout require draw.io 30.2.4 or newer; ordinary exports without an explicit page index do not.
20
20
  - User/review flows are checked against [`src/index.ts`](../src/index.ts) and [`src/workflow.ts`](../src/workflow.ts). The correction cap is eight retries across the run, not eight per pass; inspection previews do not consume retries. A new pass starts only after the current pass is cleared, except for inspection-only completion after the limit.
21
- - No CLI means XML authoring and structural validation only. No attached image means structural/semantic review, with rendered inspection explicitly unverified. A successful final export removes the latest preview in either vision mode.
21
+ - No CLI means XML authoring and structural validation only. No attached image means structural/semantic review, with rendered inspection explicitly unverified. A successful final export may retire tracked same-source previews even in text-only mode; [preview attachments and files have separate lifetimes](../docs/reference.md#preview-attachments-and-cleanup).
22
22
  - PNG, SVG and PDF embed editable XML by default; JPG cannot. Motion is stored on the `.drawio` page and verified in the standalone SVG. draw.io Desktop shows the static geometry, not DrawMe motion playback.
23
23
  - The order architecture is an illustrative AWS design, not a deployment template. API Gateway invokes the Orders Lambda; a DynamoDB transaction commits order + outbox together. A stream-triggered publisher filters outbox records and publishes to an SNS standard topic. Separate SQS standard queues buffer both Lambda consumers. SNS/SQS delivery is at least once, requiring idempotency. The fulfillment queue's `maxReceiveCount` redrive policy sends repeatedly failed messages to its DLQ; the Lambda does not write directly to the DLQ. Notification retry/DLQ policy, authentication, IAM, telemetry, and deployment details are deliberately outside this example.
24
24
 
@@ -31,7 +31,7 @@ Use the DrawMe tools from Pi, rather than invoking the desktop CLI directly:
31
31
  3. After layout changes, run `drawio_fit_canvas`, then validate again. Grow the canvas rather than shrinking the content.
32
32
  4. Export a `mode: "preview"` PNG and review label fit, placement, connectors, and semantics. Validate and re-preview any correction.
33
33
  5. For the order example, `drawio_animate({ "input": "example/event-driven-orders.drawio" })` reuses the stored steps, regenerates the animated SVG/storyboard, and verifies motion. Validate the source afterward and inspect the storyboard's order/visibility; it does not prove easing or dot movement.
34
- 6. Export the final PNG with `drawio_export({ "input": "example/<name>.drawio", "mode": "final", "format": "png" })`. This embeds XML and removes the review preview. Keep the PNG fallback beside the animated SVG.
34
+ 6. Export the final PNG with `drawio_export({ "input": "example/<name>.drawio", "mode": "final", "format": "png" })`. Use this for the installation guide, how-it-works, and architecture companion PNGs after editing their `.drawio` sources. Check the legibility of each new render and reopen it in draw.io to confirm the embedded source. Keep the PNG fallback beside the animated SVG.
35
35
  7. Run `npm run validate`. The tests discover every example source and require zero structural warnings; additional checks cover installation, user-flow relationships, and stored animation versus the exported SVG.
36
36
 
37
37
  Rendered files are checked into Git for documentation. The npm package includes editable `.drawio` sources; README images are hosted from the repository.
@@ -23,16 +23,16 @@
23
23
  <mxCell id="open" value="&lt;b&gt;OS file handler&lt;/b&gt;&lt;br&gt;&lt;font color=&quot;#64748B&quot; style=&quot;font-size:18px&quot;&gt;open • optional desktop fine-tuning&lt;/font&gt;" style="rounded=1;absoluteArcSize=1;arcSize=12;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=20;spacing=16;strokeWidth=1.5;fillColor=#FFFFFF;strokeColor=#CBD5E1;fontColor=#0F172A;fillColor=#F8FAFC;strokeColor=#CBD5E1;fontColor=#475569;" vertex="1" parent="tools">
24
24
  <mxGeometry x="30" y="270" width="370" height="100" as="geometry"/>
25
25
  </mxCell>
26
- <mxCell id="bridge" value="&lt;b&gt;Desktop CLI adapter&lt;/b&gt;&lt;br&gt;&lt;font color=&quot;#64748B&quot; style=&quot;font-size:18px&quot;&gt;check · export · animate&lt;br&gt;Mermaid import · ELK layout&lt;br&gt;Import + layout require v30+&lt;/font&gt;" style="rounded=1;absoluteArcSize=1;arcSize=12;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=20;spacing=16;strokeWidth=1.5;fillColor=#FFFFFF;strokeColor=#CBD5E1;fontColor=#0F172A;" vertex="1" parent="tools">
26
+ <mxCell id="bridge" value="&lt;b&gt;Desktop CLI adapter&lt;/b&gt;&lt;br&gt;&lt;font color=&quot;#64748B&quot; style=&quot;font-size:18px&quot;&gt;check · export · animate&lt;br&gt;Mermaid import · ELK layout&lt;br&gt;Import + layout: draw.io 30.2.4+&lt;br&gt;Explicit export page index: 32.4.1+&lt;/font&gt;" style="rounded=1;absoluteArcSize=1;arcSize=12;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=20;spacing=16;strokeWidth=1.5;fillColor=#FFFFFF;strokeColor=#CBD5E1;fontColor=#0F172A;" vertex="1" parent="tools">
27
27
  <mxGeometry x="30" y="420" width="370" height="200" as="geometry"/>
28
28
  </mxCell>
29
29
  <mxCell id="source" value="&lt;b&gt;Editable source of truth&lt;/b&gt;&lt;br&gt;&lt;font color=&quot;#64748B&quot; style=&quot;font-size:18px&quot;&gt;.drawio XML authored by Pi&lt;br&gt;Validation does not render pixels&lt;/font&gt;" style="rounded=1;absoluteArcSize=1;arcSize=12;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=20;spacing=16;strokeWidth=1.5;fillColor=#FFFFFF;strokeColor=#CBD5E1;fontColor=#0F172A;" vertex="1" parent="1">
30
30
  <mxGeometry x="40" y="760" width="360" height="120" as="geometry"/>
31
31
  </mxCell>
32
- <mxCell id="renderer" value="&lt;b&gt;draw.io Desktop&lt;/b&gt;&lt;br&gt;&lt;font color=&quot;#64748B&quot; style=&quot;font-size:18px&quot;&gt;Local CLI process&lt;br&gt;Preview · render · convert · layout&lt;/font&gt;" style="rounded=1;absoluteArcSize=1;arcSize=12;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=20;spacing=16;strokeWidth=1.5;fillColor=#FFFFFF;strokeColor=#CBD5E1;fontColor=#0F172A;" vertex="1" parent="1">
32
+ <mxCell id="renderer" value="&lt;b&gt;draw.io Desktop&lt;/b&gt;&lt;br&gt;&lt;font color=&quot;#64748B&quot; style=&quot;font-size:18px&quot;&gt;Local CLI process&lt;br&gt;Preview · render · convert · layout&lt;br&gt;WSL: native Linux renderer&lt;/font&gt;" style="rounded=1;absoluteArcSize=1;arcSize=12;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=20;spacing=16;strokeWidth=1.5;fillColor=#FFFFFF;strokeColor=#CBD5E1;fontColor=#0F172A;" vertex="1" parent="1">
33
33
  <mxGeometry x="1040" y="600" width="360" height="170" as="geometry"/>
34
34
  </mxCell>
35
- <mxCell id="deliverables" value="&lt;b&gt;Derived deliverables&lt;/b&gt;&lt;br&gt;&lt;font color=&quot;#64748B&quot; style=&quot;font-size:18px&quot;&gt;PNG · SVG · PDF · JPG&lt;br&gt;Verified animated SVG + fallback&lt;br&gt;PNG / SVG / PDF embed XML&lt;/font&gt;" style="rounded=1;absoluteArcSize=1;arcSize=12;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=20;spacing=16;strokeWidth=1.5;fillColor=#FFFFFF;strokeColor=#CBD5E1;fontColor=#0F172A;fillColor=#EFF6FF;strokeColor=#2563EB;fontColor=#1E3A8A;" vertex="1" parent="1">
35
+ <mxCell id="deliverables" value="&lt;b&gt;Derived deliverables&lt;/b&gt;&lt;br&gt;&lt;font color=&quot;#64748B&quot; style=&quot;font-size:18px&quot;&gt;PNG · SVG · PDF · JPG&lt;br&gt;Verified animated SVG + fallback&lt;br&gt;XML by default: PNG / SVG / PDF&lt;/font&gt;" style="rounded=1;absoluteArcSize=1;arcSize=12;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=20;spacing=16;strokeWidth=1.5;fillColor=#FFFFFF;strokeColor=#CBD5E1;fontColor=#0F172A;fillColor=#EFF6FF;strokeColor=#2563EB;fontColor=#1E3A8A;" vertex="1" parent="1">
36
36
  <mxGeometry x="1040" y="250" width="360" height="170" as="geometry"/>
37
37
  </mxCell>
38
38
  <mxCell id="e-agent-core" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#2563EB;strokeWidth=2;endArrow=blockThin;endFill=1;endSize=8;fontFamily=Helvetica;fontSize=16;fontColor=#475569;labelBackgroundColor=#FFFFFF;exitX=1;exitY=0.25;entryX=0;entryY=0.5;strokeColor=#94A3B8;strokeWidth=1.5;" edge="1" parent="1" source="agent" target="core">
@@ -50,10 +50,10 @@
50
50
  <mxCell id="e-renderer-deliverables" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#2563EB;strokeWidth=2;endArrow=blockThin;endFill=1;endSize=8;fontFamily=Helvetica;fontSize=16;fontColor=#475569;labelBackgroundColor=#FFFFFF;exitX=0.5;exitY=0;entryX=0.5;entryY=1;" edge="1" parent="1" source="renderer" target="deliverables">
51
51
  <mxGeometry x="0" relative="1" as="geometry"><Array as="points"><mxPoint x="1220" y="510"/></Array></mxGeometry>
52
52
  </mxCell>
53
- <mxCell id="e-source-renderer" value="reads source" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#2563EB;strokeWidth=2;endArrow=blockThin;endFill=1;endSize=8;fontFamily=Helvetica;fontSize=16;fontColor=#475569;labelBackgroundColor=#FFFFFF;exitX=1;exitY=0.5;entryX=0.5;entryY=1;strokeColor=#94A3B8;strokeWidth=1.5;" edge="1" parent="1" source="source" target="renderer">
53
+ <mxCell id="e-source-renderer" value="supplies XML" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#2563EB;strokeWidth=2;endArrow=blockThin;endFill=1;endSize=8;fontFamily=Helvetica;fontSize=16;fontColor=#475569;labelBackgroundColor=#FFFFFF;exitX=1;exitY=0.5;entryX=0.5;entryY=1;strokeColor=#94A3B8;strokeWidth=1.5;" edge="1" parent="1" source="source" target="renderer">
54
54
  <mxGeometry x="0.35" relative="1" as="geometry"><mxPoint x="0" y="-22" as="offset"/><Array as="points"><mxPoint x="460" y="820"/><mxPoint x="460" y="920"/><mxPoint x="1220" y="920"/></Array></mxGeometry>
55
55
  </mxCell>
56
- <mxCell id="locality" value="&lt;b&gt;Local rendering is not an offline-model promise&lt;/b&gt;&lt;br&gt;&lt;font color=&quot;#64748B&quot; style=&quot;font-size:18px&quot;&gt;Diagram files, the bundled shape index, structural checks and desktop rendering stay local.&lt;br&gt;Pi uses the selected model/provider for planning and authoring; an SVG needs no draw.io web viewer.&lt;/font&gt;" style="rounded=1;absoluteArcSize=1;arcSize=12;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=20;spacing=16;strokeWidth=1.5;fillColor=#FFFFFF;strokeColor=#CBD5E1;fontColor=#0F172A;fillColor=#F8FAFC;strokeColor=#CBD5E1;fontColor=#475569;align=left;" vertex="1" parent="1">
56
+ <mxCell id="locality" value="&lt;b&gt;Local rendering, model-provider context&lt;/b&gt;&lt;br&gt;&lt;font color=&quot;#64748B&quot; style=&quot;font-size:18px&quot;&gt;Shape search, structural checks and desktop rendering run locally.&lt;br&gt;Requests and attached previews or storyboards enter Pi’s model context; a hosted provider may receive them.&lt;/font&gt;" style="rounded=1;absoluteArcSize=1;arcSize=12;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=20;spacing=16;strokeWidth=1.5;fillColor=#FFFFFF;strokeColor=#CBD5E1;fontColor=#0F172A;fillColor=#F8FAFC;strokeColor=#CBD5E1;fontColor=#475569;align=left;" vertex="1" parent="1">
57
57
  <mxGeometry x="40" y="980" width="1360" height="100" as="geometry"/>
58
58
  </mxCell>
59
59
  </root>