@senad-d/drawme 0.1.8 → 0.1.10
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/CHANGELOG.md +34 -1
- package/README.md +32 -16
- package/assets/references/diagram-types.md +1 -1
- package/assets/references/style-presets.md +94 -0
- package/assets/references/xml-authoring.md +84 -6
- package/docs/reference.md +89 -9
- package/example/README.md +37 -0
- package/example/drawme-architecture.drawio +62 -0
- package/example/drawme-how-it-works.drawio +79 -122
- package/example/drawme-installation-guide.drawio +63 -97
- package/example/drawme-validation-decision-tree.drawio +74 -69
- package/example/event-driven-orders.drawio +119 -0
- package/package.json +7 -7
- package/src/animate.ts +177 -0
- package/src/animation.ts +637 -0
- package/src/drawio.ts +208 -52
- package/src/fitcanvas.ts +1 -1
- package/src/index.ts +119 -16
- package/src/motion.ts +839 -0
- package/src/storyboard.ts +161 -0
- package/src/svgexport.ts +124 -0
- package/src/validate.ts +162 -7
- package/src/workflow.ts +7 -5
- package/example/drawme-extension-waterfall-overview.drawio +0 -72
package/docs/reference.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Catalog of the commands and tools the DrawMe Pi extension provides, for any project or session that uses it.
|
|
4
4
|
|
|
5
|
-
DrawMe turns diagram requirements into editable `.drawio` sources and local PNG, SVG, PDF, or JPG exports. The extension provides commands that start guided workflows and tools for CLI detection, Mermaid conversion, XML layout, structural validation, shape lookup, export, explanation, and file opening.
|
|
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
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.
|
|
8
8
|
|
|
@@ -17,6 +17,7 @@ This document lists the extension's public surface: commands, tools, options, de
|
|
|
17
17
|
| `drawio_explain` | No | No |
|
|
18
18
|
| `drawio_open` | No CLI check; requires an OS file handler | No |
|
|
19
19
|
| `drawio_export` | Yes | No |
|
|
20
|
+
| `drawio_animate` | Yes | No |
|
|
20
21
|
| `drawio_from_mermaid` | Yes | Yes |
|
|
21
22
|
| `drawio_layout` | Yes | Yes |
|
|
22
23
|
|
|
@@ -30,15 +31,15 @@ Commands are user-facing shortcuts. Use the model-callable tools when you need e
|
|
|
30
31
|
|
|
31
32
|
| Command | Functionality |
|
|
32
33
|
| --- | --- |
|
|
33
|
-
| `/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, 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. |
|
|
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. |
|
|
34
35
|
| `/drawme-check` | Displays the detected draw.io path and version, or reports that the CLI is unavailable. |
|
|
35
|
-
| `/drawme-export <file> [png\|svg\|pdf\|jpg]` | Performs a final export of an existing `.drawio`; format defaults to PNG. |
|
|
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. |
|
|
36
37
|
|
|
37
|
-
`/drawme-export` intentionally exposes only the source path and format. Use `drawio_export` for output naming, dimensions, border, transparency, embedding, page selection, or binary selection. The command uses whitespace-separated arguments and is unsuitable for paths containing spaces.
|
|
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.
|
|
38
39
|
|
|
39
40
|
## Tools
|
|
40
41
|
|
|
41
|
-
DrawMe registers
|
|
42
|
+
DrawMe registers ten model-callable tools.
|
|
42
43
|
|
|
43
44
|
### `drawio_check`
|
|
44
45
|
|
|
@@ -87,9 +88,10 @@ Exports an existing `.drawio` through the local draw.io desktop CLI.
|
|
|
87
88
|
| `scale` | number | No | `2` | Scale for final PNG/JPG when `width` is absent. |
|
|
88
89
|
| `width` | number | No | Preview: `2000` | Target width in pixels. Overrides `scale`. |
|
|
89
90
|
| `transparent` | boolean | No | `false` | Enables transparency for PNG only. |
|
|
90
|
-
| `border` | number | No | `
|
|
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. |
|
|
91
92
|
| `pageIndex` | number | No | draw.io default | Positive, 1-based page number for multi-page files. |
|
|
92
93
|
| `embed` | boolean | No | Mode/format dependent | Controls embedding of editable diagram XML. |
|
|
94
|
+
| `animated` | boolean | No | `false` | Requires and verifies standalone animation. Valid only for final SVG; when format is omitted, animated mode defaults it to SVG. |
|
|
93
95
|
| `binary` | string | No | Auto-detected | Explicit binary path to test first. |
|
|
94
96
|
|
|
95
97
|
#### Mode and naming behavior
|
|
@@ -101,12 +103,17 @@ For an input named `name.drawio`:
|
|
|
101
103
|
| Preview PNG | `name.png` | Width 2000 | No |
|
|
102
104
|
| Final PNG | `name.drawio.png` | Scale 2 | Yes |
|
|
103
105
|
| Final SVG | `name.svg` | Vector | Yes |
|
|
106
|
+
| Verified animated SVG (`animated:true`) | `name.svg` | Vector | Yes |
|
|
104
107
|
| Final PDF | `name.pdf` | Vector | Yes |
|
|
105
108
|
| Final JPG | `name.jpg` | Scale 2 | No |
|
|
106
109
|
|
|
107
110
|
Additional behavior:
|
|
108
111
|
|
|
109
112
|
- An explicit `output` replaces the derived name.
|
|
113
|
+
- `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
|
+
- 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.
|
|
110
117
|
- An explicit `width` replaces raster scaling.
|
|
111
118
|
- `scale` is ignored in preview mode and for vector formats.
|
|
112
119
|
- `transparent` has no effect outside PNG.
|
|
@@ -130,6 +137,13 @@ drawio_export({
|
|
|
130
137
|
"mode": "final"
|
|
131
138
|
})
|
|
132
139
|
|
|
140
|
+
# Verified standalone animated SVG (format defaults to SVG)
|
|
141
|
+
drawio_export({
|
|
142
|
+
"input": "request-flow.drawio",
|
|
143
|
+
"mode": "final",
|
|
144
|
+
"animated": true
|
|
145
|
+
})
|
|
146
|
+
|
|
133
147
|
# A specific page with an unambiguous path
|
|
134
148
|
drawio_export({
|
|
135
149
|
"input": "system.drawio",
|
|
@@ -144,6 +158,65 @@ Use a distinct `output` for each format or page. Never present a preview artifac
|
|
|
144
158
|
|
|
145
159
|
---
|
|
146
160
|
|
|
161
|
+
### `drawio_animate`
|
|
162
|
+
|
|
163
|
+
Adds motion to an existing `.drawio` page and exports a verified standalone animated SVG plus a storyboard PNG.
|
|
164
|
+
|
|
165
|
+
#### Options
|
|
166
|
+
|
|
167
|
+
| Option | Type | Required | Default | Description |
|
|
168
|
+
| --- | --- | --- | --- | --- |
|
|
169
|
+
| `input` | string | Yes | — | Existing `.drawio` source path. |
|
|
170
|
+
| `steps` | array | No | Stored motion | Ordered motion steps (below). Omit to re-export the motion already stored on the page. |
|
|
171
|
+
| `loop` | boolean | No | `true` | Repeat the sequence. |
|
|
172
|
+
| `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. |
|
|
177
|
+
|
|
178
|
+
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
|
+
|
|
180
|
+
| Effect | Targets | Default duration | Result |
|
|
181
|
+
| --- | --- | --- | --- |
|
|
182
|
+
| `fadeIn` / `fadeOut` | any cell | 600 / 500 ms | Fade to visible / hidden |
|
|
183
|
+
| `dim` | any cell | 500 ms | Fade to `value` |
|
|
184
|
+
| `popIn` | hidden cell | 550 ms | Scale up from 60% with overshoot while fading in |
|
|
185
|
+
| `slideIn` | hidden cell | 650 ms | Move 32px in `direction` while fading in |
|
|
186
|
+
| `drawIn` | hidden solid connector | 900 ms | Draw the line, then show arrowhead and label |
|
|
187
|
+
| `highlight` | visible cell | 1000 ms | Brief glow and slight scale |
|
|
188
|
+
| `travel` | visible connector | 1400 ms | Dot runs from source to target |
|
|
189
|
+
| `wait` | — | required | Pause |
|
|
190
|
+
|
|
191
|
+
#### Behavior
|
|
192
|
+
|
|
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.
|
|
194
|
+
- 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.
|
|
196
|
+
- `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.
|
|
198
|
+
- The motion plays in browsers and in SVGs embedded as images. draw.io itself does not play it.
|
|
199
|
+
|
|
200
|
+
#### Use
|
|
201
|
+
|
|
202
|
+
```text
|
|
203
|
+
drawio_animate({
|
|
204
|
+
"input": "checkout.drawio",
|
|
205
|
+
"steps": [
|
|
206
|
+
{ "effect": "popIn", "cells": ["client"] },
|
|
207
|
+
{ "effect": "drawIn", "cells": ["e1"] },
|
|
208
|
+
{ "effect": "popIn", "cells": ["api", "db"], "stagger": 120 },
|
|
209
|
+
{ "effect": "travel", "cells": ["e1"] },
|
|
210
|
+
{ "effect": "highlight", "cells": ["api"] }
|
|
211
|
+
]
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
# Re-export the stored motion after editing the layout
|
|
215
|
+
drawio_animate({ "input": "checkout.drawio" })
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
147
220
|
### `drawio_validate`
|
|
148
221
|
|
|
149
222
|
Structurally lints uncompressed `.drawio` XML without launching draw.io.
|
|
@@ -163,7 +236,8 @@ Errors include:
|
|
|
163
236
|
- references to missing parents;
|
|
164
237
|
- edge references to missing sources or targets;
|
|
165
238
|
- missing or invalid vertex geometry;
|
|
166
|
-
- missing edge geometry, or edge geometry without both `relative="1"` and `as="geometry"
|
|
239
|
+
- missing edge geometry, or edge geometry without both `relative="1"` and `as="geometry"`;
|
|
240
|
+
- malformed page-animation JSON, dangling/non-animatable animation cell references, invalid opacity/timing values, and invalid connector flow controls.
|
|
167
241
|
|
|
168
242
|
Actionable warnings include:
|
|
169
243
|
|
|
@@ -177,7 +251,8 @@ Actionable warnings include:
|
|
|
177
251
|
- pinned source exits or target entries that face away from their adjacent waypoint, or their peer on an auto-route;
|
|
178
252
|
- edge labels likely overlapping shapes or sitting directly on their own connector;
|
|
179
253
|
- auto-routed edges whose missing waypoints prevent deterministic route checks;
|
|
180
|
-
- compressed pages that cannot be inspected
|
|
254
|
+
- compressed pages that cannot be inspected;
|
|
255
|
+
- legacy animation text, page effects, or selector types that cannot be represented in standalone animated SVG.
|
|
181
256
|
|
|
182
257
|
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.
|
|
183
258
|
|
|
@@ -408,6 +483,7 @@ drawio_open({ "path": "architecture.drawio" })
|
|
|
408
483
|
| Existing diagram must be understood | `drawio_explain`, then inspect the source XML. |
|
|
409
484
|
| Existing diagram only needs validation | `drawio_validate`; no CLI check is necessary. |
|
|
410
485
|
| 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`. |
|
|
411
487
|
|
|
412
488
|
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.
|
|
413
489
|
|
|
@@ -415,6 +491,7 @@ DrawMe does not expose a single natural-language-to-file tool. Author or edit Me
|
|
|
415
491
|
|
|
416
492
|
- `.drawio` is always the canonical editable source.
|
|
417
493
|
- 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.
|
|
418
495
|
- JPG cannot embed XML.
|
|
419
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.
|
|
420
497
|
- A final embedded PNG normally uses the `.drawio.png` double extension.
|
|
@@ -433,7 +510,10 @@ DrawMe does not expose a single natural-language-to-file tool. Author or edit Me
|
|
|
433
510
|
- Shape search covers bundled official draw.io shapes, not arbitrary third-party logos.
|
|
434
511
|
- Mermaid conversion cannot express all draw.io styles, containers, routing, or multi-page behavior.
|
|
435
512
|
- ELK layout accepts only the six registered presets; arbitrary JSON layouts are not exposed.
|
|
436
|
-
-
|
|
513
|
+
- Standalone animated SVG requires an uncompressed `.drawio` source and intentionally supports a portable subset of native page effects. It does not compile wipe/pop, highlight, dynamic-flow, style, navigation, tags/layers, links, or custom actions. Use persistent connector flow or visibility/opacity/fade/wait sequences.
|
|
514
|
+
- SVG hosts may sanitize styles or display only a static frame; retain the `.drawio` source and provide a PNG fallback when compatibility matters.
|
|
515
|
+
- 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
|
+
- The extension does not expose GIF/video rendering, HTML viewers, XML compression/decompression, Python generators, or arbitrary draw.io CLI arguments.
|
|
437
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.
|
|
438
518
|
|
|
439
519
|
## Authoring references
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# DrawMe examples
|
|
2
|
+
|
|
3
|
+
The `.drawio` files are the editable sources of truth. Each has a final `.drawio.png` with embedded XML. The animated example also includes a standalone SVG and a static storyboard.
|
|
4
|
+
|
|
5
|
+
| Diagram | What it demonstrates |
|
|
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. |
|
|
13
|
+
|
|
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
|
+
|
|
16
|
+
## Correctness and scope
|
|
17
|
+
|
|
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.
|
|
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.
|
|
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
|
+
- 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
|
+
|
|
25
|
+
## Re-exporting after edits
|
|
26
|
+
|
|
27
|
+
Use the DrawMe tools from Pi, rather than invoking the desktop CLI directly:
|
|
28
|
+
|
|
29
|
+
1. `drawio_check({})` before any rendering.
|
|
30
|
+
2. After every source edit, `drawio_validate({ "input": "example/<name>.drawio" })`. Fix errors and warnings.
|
|
31
|
+
3. After layout changes, run `drawio_fit_canvas`, then validate again. Grow the canvas rather than shrinking the content.
|
|
32
|
+
4. Export a `mode: "preview"` PNG and review label fit, placement, connectors, and semantics. Validate and re-preview any correction.
|
|
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.
|
|
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
|
+
|
|
37
|
+
Rendered files are checked into Git for documentation. The npm package includes editable `.drawio` sources; README images are hosted from the repository.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<mxfile host="drawio" version="31.7.0">
|
|
3
|
+
<diagram id="drawme-architecture" name="Architecture">
|
|
4
|
+
<mxGraphModel grid="1" gridSize="10" guides="1" page="1" pageScale="1" pageWidth="1440" pageHeight="1120" background="#FFFFFF" shadow="0">
|
|
5
|
+
<root>
|
|
6
|
+
<mxCell id="0"/>
|
|
7
|
+
<mxCell id="1" parent="0"/>
|
|
8
|
+
<mxCell id="title" value="Local tools, editable outputs" style="text;html=1;whiteSpace=wrap;fontFamily=Helvetica;align=left;verticalAlign=middle;spacing=0;strokeColor=none;fillColor=none;fontSize=32;fontStyle=1;fontColor=#0F172A;" vertex="1" parent="1">
|
|
9
|
+
<mxGeometry x="40" y="40" width="1360" height="50" as="geometry"/>
|
|
10
|
+
</mxCell>
|
|
11
|
+
<mxCell id="subtitle" value="Pi orchestrates authoring; DrawMe supplies ten tools; draw.io renders on demand" style="text;html=1;whiteSpace=wrap;fontFamily=Helvetica;align=left;verticalAlign=middle;spacing=0;strokeColor=none;fillColor=none;fontSize=18;fontColor=#64748B;" vertex="1" parent="1">
|
|
12
|
+
<mxGeometry x="40" y="100" width="1360" height="36" as="geometry"/>
|
|
13
|
+
</mxCell>
|
|
14
|
+
<mxCell id="tools" value="DRAWME EXTENSION • TEN TOOLS" style="rounded=1;absoluteArcSize=1;arcSize=16;whiteSpace=wrap;html=1;container=1;pointerEvents=0;verticalAlign=top;align=left;spacingLeft=20;spacingTop=16;fontFamily=Helvetica;fontSize=16;fontStyle=1;strokeWidth=1.5;fillColor=#F8FAFC;strokeColor=#E2E8F0;fontColor=#64748B;" vertex="1" parent="1">
|
|
15
|
+
<mxGeometry x="500" y="180" width="430" height="670" as="geometry"/>
|
|
16
|
+
</mxCell>
|
|
17
|
+
<mxCell id="agent" value="<b>Pi agent + /drawme</b><br><font color="#64748B" style="font-size:18px">Plan, author and critique<br>Built-in read / write / edit tools<br>Configured model may be remote</font>" 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">
|
|
18
|
+
<mxGeometry x="40" y="430" width="360" height="170" as="geometry"/>
|
|
19
|
+
</mxCell>
|
|
20
|
+
<mxCell id="core" value="<b>Pure TypeScript • no CLI</b><br><font color="#64748B" style="font-size:18px">validate · fit canvas<br>shape search · explain</font>" 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">
|
|
21
|
+
<mxGeometry x="30" y="70" width="370" height="160" as="geometry"/>
|
|
22
|
+
</mxCell>
|
|
23
|
+
<mxCell id="open" value="<b>OS file handler</b><br><font color="#64748B" style="font-size:18px">open • optional desktop fine-tuning</font>" 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
|
+
<mxGeometry x="30" y="270" width="370" height="100" as="geometry"/>
|
|
25
|
+
</mxCell>
|
|
26
|
+
<mxCell id="bridge" value="<b>Desktop CLI adapter</b><br><font color="#64748B" style="font-size:18px">check · export · animate<br>Mermaid import · ELK layout<br>Import + layout require v30+</font>" 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
|
+
<mxGeometry x="30" y="420" width="370" height="200" as="geometry"/>
|
|
28
|
+
</mxCell>
|
|
29
|
+
<mxCell id="source" value="<b>Editable source of truth</b><br><font color="#64748B" style="font-size:18px">.drawio XML authored by Pi<br>Validation does not render pixels</font>" 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
|
+
<mxGeometry x="40" y="760" width="360" height="120" as="geometry"/>
|
|
31
|
+
</mxCell>
|
|
32
|
+
<mxCell id="renderer" value="<b>draw.io Desktop</b><br><font color="#64748B" style="font-size:18px">Local CLI process<br>Preview · render · convert · layout</font>" 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
|
+
<mxGeometry x="1040" y="600" width="360" height="170" as="geometry"/>
|
|
34
|
+
</mxCell>
|
|
35
|
+
<mxCell id="deliverables" value="<b>Derived deliverables</b><br><font color="#64748B" style="font-size:18px">PNG · SVG · PDF · JPG<br>Verified animated SVG + fallback<br>PNG / SVG / PDF embed XML</font>" 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
|
+
<mxGeometry x="1040" y="250" width="360" height="170" as="geometry"/>
|
|
37
|
+
</mxCell>
|
|
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">
|
|
39
|
+
<mxGeometry x="0" relative="1" as="geometry"><Array as="points"><mxPoint x="460" y="472.5"/><mxPoint x="460" y="330"/></Array></mxGeometry>
|
|
40
|
+
</mxCell>
|
|
41
|
+
<mxCell id="e-agent-bridge" 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.75;entryX=0;entryY=0.5;" edge="1" parent="1" source="agent" target="bridge">
|
|
42
|
+
<mxGeometry x="0" relative="1" as="geometry"><Array as="points"><mxPoint x="460" y="557.5"/><mxPoint x="460" y="700"/></Array></mxGeometry>
|
|
43
|
+
</mxCell>
|
|
44
|
+
<mxCell id="e-agent-source" 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=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="agent" target="source">
|
|
45
|
+
<mxGeometry x="0" relative="1" as="geometry"><Array as="points"><mxPoint x="220" y="680"/></Array></mxGeometry>
|
|
46
|
+
</mxCell>
|
|
47
|
+
<mxCell id="e-bridge-renderer" 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.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="bridge" target="renderer">
|
|
48
|
+
<mxGeometry x="0" relative="1" as="geometry"><Array as="points"><mxPoint x="980" y="700"/><mxPoint x="980" y="685"/></Array></mxGeometry>
|
|
49
|
+
</mxCell>
|
|
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
|
+
<mxGeometry x="0" relative="1" as="geometry"><Array as="points"><mxPoint x="1220" y="510"/></Array></mxGeometry>
|
|
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">
|
|
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
|
+
</mxCell>
|
|
56
|
+
<mxCell id="locality" value="<b>Local rendering is not an offline-model promise</b><br><font color="#64748B" style="font-size:18px">Diagram files, the bundled shape index, structural checks and desktop rendering stay local.<br>Pi uses the selected model/provider for planning and authoring; an SVG needs no draw.io web viewer.</font>" 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
|
+
<mxGeometry x="40" y="980" width="1360" height="100" as="geometry"/>
|
|
58
|
+
</mxCell>
|
|
59
|
+
</root>
|
|
60
|
+
</mxGraphModel>
|
|
61
|
+
</diagram>
|
|
62
|
+
</mxfile>
|