@diagrammo/dgmo 0.61.0 → 0.62.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.
Files changed (47) hide show
  1. package/README.md +1 -1
  2. package/dist/advanced.d.ts +382 -396
  3. package/dist/advanced.js +135 -21
  4. package/dist/auto.js +143 -142
  5. package/dist/block.js +6 -5
  6. package/dist/{chart-meta-gUwAzi7N.d.ts → chart-meta-D98NbYDp.d.ts} +1 -1
  7. package/dist/chart-meta.d.ts +2 -2
  8. package/dist/chart-meta.js +1 -1
  9. package/dist/{charts-d3-MN6QCYKU.js → charts-d3-3WMDA5Z5.js} +3 -3
  10. package/dist/{chunk-OPBZYISB.js → chunk-37EHGTQ2.js} +2204 -2018
  11. package/dist/{chunk-ZDFIY6WX.js → chunk-3PVUGECM.js} +1 -2
  12. package/dist/{chunk-6CWNVQPW.js → chunk-4C3BTTOL.js} +2 -2
  13. package/dist/{chunk-4B5YISOR.js → chunk-536EBUPG.js} +16 -1
  14. package/dist/{chunk-VHO3YBTB.js → chunk-CVVICCSB.js} +24 -2
  15. package/dist/{chunk-BSJIPMPG.js → chunk-DHIBVN2D.js} +28 -17
  16. package/dist/{chunk-MOT3NXB5.js → chunk-FVYHDZ6Q.js} +2 -2
  17. package/dist/{chunk-S23HOUJS.js → chunk-JU2VMFYC.js} +2 -2
  18. package/dist/{chunk-5PWIV7ZF.js → chunk-LFAQ4BLZ.js} +2 -2
  19. package/dist/{chunk-DNSEG6P2.js → chunk-PJDX4IKR.js} +2 -2
  20. package/dist/{chunk-2WPLOS4Q.js → chunk-USHDV2AF.js} +2 -2
  21. package/dist/{registry-Ch0Umdi1.d.ts → dgmo-router-Dd5PTjxl.d.ts} +98 -98
  22. package/dist/{dgmo-router-UVYAJCAF.js → dgmo-router-Z5N6QLIC.js} +2 -2
  23. package/dist/{dimensions-QCPOPPKE.js → dimensions-ES6O2T4H.js} +4 -4
  24. package/dist/element.js +144 -143
  25. package/dist/index.d.ts +21 -10
  26. package/dist/index.js +10 -20
  27. package/dist/{renderer-IYMA5W7X.js → renderer-A5GFW2XH.js} +4 -4
  28. package/dist/{renderer-R6OKKSVR.js → renderer-Q2YHQQSN.js} +4 -4
  29. package/dist/{resolver-W3WKLWDP.js → resolver-ZLYSMILY.js} +3 -3
  30. package/dist/{themes-DC6u80yr.d.ts → themes-DiUAG4Bf.d.ts} +37 -2
  31. package/docs/ai-integration.md +5 -5
  32. package/package.json +2 -21
  33. package/.claude/commands/dgmo-codebase-report.md +0 -172
  34. package/.claude/commands/dgmo-diagram-this.md +0 -60
  35. package/.claude/commands/dgmo-document-project.md +0 -128
  36. package/.claude/commands/dgmo.md +0 -313
  37. package/.cursorrules +0 -587
  38. package/.github/copilot-instructions.md +0 -597
  39. package/.windsurfrules +0 -587
  40. package/SKILL.md +0 -573
  41. package/dist/auto.d.ts +0 -60
  42. package/dist/auto.mjs +0 -88466
  43. package/dist/chunk-6MTWIQVO.js +0 -121
  44. package/dist/cli.cjs +0 -489
  45. package/dist/element.d.ts +0 -68
  46. package/dist/element.mjs +0 -88332
  47. package/dist/load-data-EHDDZ5ZS.js +0 -8
package/SKILL.md DELETED
@@ -1,573 +0,0 @@
1
- ---
2
- name: dgmo-diagramming
3
- description: Use when the user asks for a diagram, chart, sequence diagram, flowchart, ER diagram, org chart, kanban, sitemap, infra/architecture diagram, or any visual based on the DGMO diagram markup language. Provides syntax, MCP tool guidance, and rendering/sharing workflows.
4
- ---
5
-
6
- # DGMO Diagram Language
7
-
8
- Use dgmo tools to create, render, and share diagrams. dgmo is a text-based diagram markup language that renders to SVG/PNG.
9
-
10
- <!-- GENERATED by dgmo/scripts/gen-ai-core.mjs from docs/language-reference.md — DO NOT EDIT between the DGMO-AI-CORE markers; run `node scripts/gen-ai-core.mjs` (or sync-language-ref.sh) to regenerate. -->
11
- <!-- DGMO-AI-CORE:START -->
12
- ## DGMO AI Core
13
-
14
- _Generated from `language-reference.md` — the anti-patterns and 50-type index below are identical across every DGMO AI surface._
15
-
16
- ### Disambiguation — where DGMO diverges from LLM priors
17
-
18
- LLMs default to Mermaid / PlantUML habits; DGMO differs. These rules prevent the most common parse errors:
19
-
20
- - **No colons in declarations, directives, tags, or data rows.** `bar Revenue` (not `bar: Revenue`); `series Cloud blue, Legacy red` (not `series: ...`); `North 850` (not `North: 850`); `tag Team as t` (not `tag: Team`). A colon binds a value only in metadata (`key: value`), class/function type separators, and a few scoped spots — see §26.
21
- - **No Mermaid arrow-labels.** Put the label _between_ the dashes: `A -Login-> B`, never `A -> B: Login`. Sequence: `->` sync, `~>` async; left-to-right only — no `<-` / `<~`.
22
- - **No indented edges on a map.** Every map connection is ONE full line — `JFK ~daily~> LAX`; for a hub repeat the origin per spoke (`JFK ~daily~> LHR`, …). A bare source with indented `-> dest` legs errors as `Malformed edge`; indented legs are valid ONLY inside a `route` block (an ordered stop→stop voyage). Edge endpoints auto-create their POIs — don't add separate `poi` lines for places already in an edge.
23
- - **No `|` metadata delimiter** (removed 0.18.0 → `E_PIPE_OPERATOR_REMOVED`). Use same-line `Name key: value, k2: v2` or indented `key: value`. (`|` survives only in wireframe `{A | B}` dropdowns, in-arrow label text, and quoted names.)
24
- - **No removed participant keywords.** Do not write `X is a service` / `external` / `frontend` / `networking` / `gateway` — these were removed and error. A bare name renders the default shape; for a typed glyph use `is a person` / `is a database` / `is a queue`.
25
- <!-- COLORS start -->
26
- - **Colors are a closed set of EXACTLY these 11 — nothing else is a color.** Valid colors, the complete list: `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `teal`, `cyan`, `gray`, `black`, `white`. That is the entire universe of DGMO colors — there are no others. Do NOT use hex (`#1f77b4`), `rgb(...)`, `hsl(...)`, or ANY CSS color name: `crimson`, `royalblue`, `navy`, `pink`, `lime`, `magenta`, `indigo`, `gold`, `salmon`, `turquoise`, `violet`, etc. are ALL invalid — they are rejected and the element falls back to an auto-assigned color. When you want a color outside the 11, map it to the nearest one: crimson/scarlet→`red`, royalblue/navy/cobalt→`blue`, pink/magenta/violet/indigo→`purple`, lime/olive→`green`, gold/amber→`yellow`, turquoise→`teal`. Apply a color as a trailing token (`Done green`) or after a category/group bracket (`[North America] red`). Named colors are mandatory because they re-resolve per active palette + light/dark theme; a hardcoded value never would.
27
- <!-- COLORS end -->
28
- - **Show-everything is the default.** Every label / value / percent renders by default. Emit `no-name` / `no-value` / `no-percent` / `no-*` ONLY when the user explicitly asks to hide something — never defensively.
29
- - **`//` comments only** (never `#`). **Indentation closes blocks** — never `end`.
30
- - **Declare before reference.** An edge target must be declared on a prior line; put metadata and edges on/under one declaration to avoid `Duplicate node` warnings.
31
- - **No reference scaffolding in output.** Emit only DGMO source. This doc is organized with HTML-comment anchors (the `TYPE`, `TIPS`, and `AI-CORE` markers, each wrapped in comment delimiters); never copy any such `<!-- … -->` comment into a diagram. They mark sections of the docs, not DGMO syntax; the parser flags a stray HTML comment as an `Unexpected line` warning. (DGMO's only comment form is `//`.)
32
-
33
- Two traps in the _other_ direction (DGMO wants a colon / a space where you might not expect):
34
-
35
- - **Infra node properties REQUIRE the colon** — `cache-hit: 80%`, `instances: 3`, `max-rps: 8000`, `latency-ms: 45`. But top-level infra **options** are space-separated (`default-rps 100`). Don't conflate them.
36
- - **ER columns are space-separated** — `id int pk`, `email varchar` (the one SQL-DDL carve-out; everything else indented-typed uses a colon).
37
-
38
- Idiomatic example — color via tags, metadata on the declaration line, indented edges:
39
-
40
- ```dgmo
41
- boxes-and-lines Service Map
42
- tag Team as t
43
- Platform blue
44
- Product green
45
- active-tag Team
46
-
47
- API Gateway t: Platform
48
- -routes-> Orders
49
- -routes-> Billing
50
- Orders t: Product
51
- Billing t: Product
52
- ```
53
-
54
- ### Make it look good — authoring guidance
55
-
56
- Valid markup is the floor, not the goal. A good diagram reads at a glance. Apply these unless the prompt says otherwise:
57
-
58
- <!-- TITLE start -->
59
-
60
- - **Always title it.** Every diagram gets a short title on the type-declaration line (`flowchart Checkout Flow`, `sequence Checkout`, `boxes-and-lines Service Map`) so it is self-describing — never leave the bare type keyword alone. Infer a fitting title from the request when the user gives none.
61
- <!-- TITLE end -->
62
- <!-- CATEGORIZE start -->
63
- - **Categorize and color — by default, not only when obvious.** Before drawing, find the axis that sorts the items into kinds and color by it: layer (frontend / backend / data), role (client / service / datastore), trust zone (internal / external / third-party), status (done / active / blocked), owner/team, or read-path vs write-path. Almost every diagram has such an axis — actively look for one rather than leaving everything monochrome. Express it with a **tag group**, never ad-hoc per-node colors: declare `tag <Axis> as t` (the name is a single word — `tag TrustZone as tz` — or quote a multi-word name: `tag "Trust Zone" as tz`), indent the category values (a trailing color is optional — bare values auto-pick a palette color), set `active-tag <Axis>`, then assign each item `Node t: <Category>` (see the tag-group syntax in the per-type section below). Only the 11 named palette colors exist, and they re-resolve per palette/theme. Color the grouping so the categories — and the boundaries between them — read at a glance. **Buckets, not name tags — never 1:1.** A tag group must have _fewer_ values than it has members: each color should bucket two or more items so the palette compresses the diagram into a few meaningful kinds (aim for ~2–4 categories, and keep distinct colors well under half the item count). If you find yourself giving nearly every item its own value, you've enumerated, not categorized — merge the singletons up a level until each color groups at least two (a `cache` and a `database` are both `datastore`; a caller and a gateway are both `client`; two microservices are both `service`). One color per item is the same visual noise as random colors — the grouping only earns its place when a color means "these belong together." Leave items uncolored only when they genuinely form a single undifferentiated kind, or the user asked for no color.
64
- <!-- CATEGORIZE end -->
65
- - **Keep labels short.** A few words per node. Move detail into notes or metadata, never a full sentence inside a label.
66
- - **Let the defaults show.** Don't add `no-*` opt-outs unless the user asked to hide or disable something — they strip helpful labels, values, and color.
67
- - **Pick a fitting direction.** Top-to-bottom for hierarchies and processes; left-to-right for pipelines and flows (where the type supports a direction).
68
-
69
- ### Chart-type index (45) — pick the type, then fetch its section
70
-
71
- | id | when to use |
72
- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
73
- | `sequence` | message / interaction flows over time |
74
- | `flowchart` | decision trees and process flows |
75
- | `state` | state-machine / lifecycle transitions |
76
- | `class` | UML class hierarchies |
77
- | `er` | database schemas and relationships |
78
- | `c4` | system architecture (context / container / component / deployment) |
79
- | `infra` | infrastructure traffic flow with RPS computation |
80
- | `boxes-and-lines` | general-purpose node-edge diagrams with groups and tags |
81
- | `sitemap` | site / app navigation structure |
82
- | `mindmap` | radial hierarchy of ideas from a central topic |
83
- | `org` | reporting hierarchy |
84
- | `family` | family tree / genealogy: unions (couples), children, remarriage, adoption, GEDCOM-style metadata |
85
- | `bracket` | single-elimination tournament bracket: winners auto-advance; seed the field for a day-0 skeleton or list results casually; two sides mirror to a championship |
86
- | `kanban` | task-board columns |
87
- | `gantt` | project scheduling with task dependencies and milestones |
88
- | `pert` | project network with three-point estimates and critical path |
89
- | `swimlane` | cross-functional process flow with lanes, phases and gateways (BPMN-style) |
90
- | `version-control` | git / version-control branch-and-merge graph: commits, branches, merges, rebase, HEAD and remote-tracking (gitGraph-style) |
91
- | `timeline` | events, eras, and date ranges |
92
- | `event-line` | annotated narrative timeline — events on a line with descriptions, optionally not to scale (NOT the date-scaled `timeline`) |
93
- | `body` | human anatomy figure annotated by muscle name — for medical, exercise, and educational diagrams |
94
- | `journey-map` | UX flow with emotion scores, phases, annotations |
95
- | `cycle` | cyclical process (PDCA, OODA, DevOps loops) |
96
- | `raci` | tasks × roles responsibility matrix; variant (RACI / RASCI / DACI) is inferred from the markers used |
97
- | `tech-radar` | technology adoption quadrants (adopt / trial / assess / hold) |
98
- | `quadrant` | 2×2 positioning matrix |
99
- | `pyramid` | stacked hierarchy of layers (Maslow, DIKW) |
100
- | `ring` | concentric rings of nested categories |
101
- | `treemap` | nested rectangles sized by value (budgets, disk usage, portfolios) |
102
- | `block` | author-controlled grid of nested, collapsible blocks (system / architecture layouts) |
103
- | `sketch` | GUI-first free-placement canvas: uniform shapes on a snap grid, arrows, tags (markup is app-generated) |
104
- | `goal` | single progress-toward-a-target value (`now` vs `target`) as a progress bar, thermometer, or gauge — KPIs, fundraising, quotas |
105
- | `countdown` | live "N days until X" that ticks every second and is accurate on every load — trip dates, launches, deadlines; the only dynamic chart type |
106
- | `clock` | live world-clock board: current time for people/places across time zones, ticking every second, with optional working-hours status and sundown line |
107
- | `map` | geographic concept map: regions, points, routes |
108
- | `wireframe` | low-fidelity UI layout with panels and controls |
109
- | `bar` | categorical comparisons (multi-series via `stack` / `group`) |
110
- | `line` | trends over time (multiple series via a `series` block; filled via `fill`; dual y-axes via `y-label` / `y-right-label`) |
111
- | `pie` | part-to-whole proportions (ring/doughnut via `hole`) |
112
- | `radar` | multi-dimensional metrics |
113
- | `polar-area` | radial bar chart |
114
- | `scatter` | 2D points or bubble chart |
115
- | `heatmap` | matrix intensity |
116
- | `funnel` | conversion pipeline |
117
- | `sankey` | flow / allocation |
118
- | `arc` | network relationships (linear, or circular via `layout chord`) |
119
- | `slope` | change between two periods |
120
- | `venn` | set overlaps |
121
- | `wordcloud` | term-frequency |
122
- | `function` | mathematical expressions (colon required: `f(x): x^2`) |
123
-
124
- **Need more than the index gives you?** Fetch the per-type section: MCP `get_language_reference(type)` / `get_examples(type)`, or read that type's section below. The `suggest_chart_type` tool returns the chosen type's section automatically.
125
-
126
- **When the type isn't obvious, ask — don't guess.** Call `suggest_chart_type` first. If it returns an `⚠️ ASK THE USER` directive (the request is ambiguous between candidates, or nothing matched), present those candidate options to the user and wait for their pick before generating — never silently choose. A confident result (high/medium) you can proceed with.
127
-
128
- ### Common examples (curated, parse-clean)
129
-
130
- _The most common types, inline so you can generate them without a fetch. For the other 42, get the per-type section (see below)._
131
-
132
- #### journey-map
133
-
134
- ```dgmo
135
- journey-map A Cabin Boy's First Voyage
136
-
137
- persona Squidlips Sam color: blue
138
- Greenhorn cabin boy, first time at sea
139
- Sworn to the crew but quietly terrified
140
-
141
- [Signing On]
142
- Sign the articles score: 4, emotion: Hopeful
143
- description: Captain reads the code aloud — pay shares, no women aboard, lights out at 8
144
-
145
- [The Tempest]
146
- Caught in a squall off the reef score: 1, emotion: Terrified
147
- pain: Two crewmates lost overboard before dawn
148
- thought: Maybe the merchant fleet wasn't so bad after all
149
- Dawn, and she still floats score: 3, emotion: Relieved
150
-
151
- [The Prize]
152
- Strike the colors score: 5, emotion: Triumphant
153
- description: Heavy with silver from the Veracruz mines
154
-
155
- [Homecoming]
156
- Bury a share on the island score: 5, emotion: Proud
157
- thought: Three doubloons hidden where only he can find them
158
- Back to the Rusty Anchor score: 4, emotion: Content
159
- opportunity: Next time he signs on as a full hand, not a boy
160
- ```
161
- #### c4
162
-
163
- ```dgmo
164
- c4 Pirate Treasure Map System
165
-
166
- tag Scope as sc
167
- Crew blue
168
- External gray
169
-
170
- Captain is a person description: Commands the fleet and plans raids
171
-
172
- TreasureMap is a system description: Tracks buried treasure locations and raid intelligence
173
- -Views treasure locations-> Captain
174
- -Sends raid alerts [carrier pigeon]-> Lookout
175
-
176
- containers
177
- ChartRoom is a container description: Interactive sea chart with treasure markers, tech: Parchment
178
- -Queries treasure data [secret code]-> Vault
179
-
180
- Vault is a container description: Encrypted treasure ledger and coordinates, tech: Iron Chest
181
- -Reads/writes [quill and ink]-> TreasureLog
182
-
183
- TreasureLog is a container description: "Stores locations, guard counts, and loot inventories", tech: Leather-Bound Tome
184
-
185
- Lookout is an external description: Crow's nest spotter on allied ships, sc: External
186
- ~Relays sightings to~> Captain
187
-
188
- deployment
189
- Flagship
190
- container ChartRoom
191
- container Vault
192
- SecretCave
193
- container TreasureLog
194
- ```
195
- #### er
196
-
197
- ```dgmo
198
- er Pirate Fleet
199
-
200
- ships
201
- id int pk
202
- name varchar
203
- ship_type varchar
204
- cannons int
205
- 1-aboard-* crew_members
206
- 1-1 captains
207
- 1-carries-* treasure
208
-
209
- captains
210
- id int pk
211
- name varchar
212
- ship_id int fk
213
- bounty int
214
- ?-frequents-1 ports
215
- *-has-1 crew_members
216
-
217
- crew_members
218
- id int pk
219
- name varchar
220
- ship_id int fk
221
- role varchar nullable
222
-
223
- treasure
224
- id int pk
225
- name varchar
226
- value int
227
- ship_id int fk, nullable
228
-
229
- ports
230
- id int pk
231
- name varchar
232
- region varchar unique
233
- 1-docks-* ships
234
- ```
235
- #### class
236
-
237
- ```dgmo
238
- class Ship Class Hierarchy
239
-
240
- interface Vessel
241
- + sail(): void
242
- + anchor(): void
243
-
244
- abstract Ship implements Vessel
245
- # name: string
246
- # crew: number
247
- + getName(): string
248
-
249
- Galleon extends Ship
250
- - cannons: number
251
- + fire(): void
252
-
253
- Sloop extends Ship
254
- - speed: number
255
- + flee(): void
256
-
257
- enum ShipType
258
- Galleon
259
- Sloop
260
- Frigate
261
-
262
- Ship
263
- -> ShipType has type
264
- ```
265
- #### sequence
266
-
267
- ```dgmo
268
- sequence Treasure Hunt App
269
-
270
- tag Concern as c
271
- Search blue
272
- Claims green
273
- Notifications orange
274
-
275
- User is an actor
276
-
277
- [Treasure Service]
278
- TreasureAPI
279
- MapDB is a database
280
- NotifyQueue is a queue
281
-
282
- User -Search nearby loot-> WebApp
283
- WebApp -GET /treasures?nearby-> TreasureAPI c: Search
284
- TreasureAPI -Find within 5nm-> MapDB c: Search
285
- note
286
- - check location
287
- - use compass
288
- MapDB -3 results-> TreasureAPI
289
- TreasureAPI -locations-> WebApp
290
- WebApp -Show treasure map-> User
291
-
292
- == Claim ==
293
-
294
- User -Claim chest #42-> WebApp
295
- WebApp -POST /claim-> TreasureAPI c: Claims
296
- if chest available
297
- TreasureAPI -Set status = claimed-> MapDB c: Claims
298
- MapDB -OK-> TreasureAPI
299
- TreasureAPI ~treasure.claimed~> NotifyQueue c: Notifications
300
- TreasureAPI -Claim accepted-> WebApp
301
- WebApp -500 doubloons earned!-> User
302
- else
303
- TreasureAPI -409 Already claimed-> WebApp
304
- WebApp -Too slow, matey!-> User
305
- ```
306
- #### state
307
-
308
- ```dgmo
309
- state Ship Battle Lifecycle
310
-
311
- [*] -> Sailing
312
-
313
- Sailing
314
- -enemy spotted-> BattleStations
315
-
316
- [Losses] gray
317
- Captured -> [*]
318
- Sinking -> [*]
319
-
320
- [Aftermath] teal
321
- Victorious
322
- -loot taken-> Sailing
323
-
324
- Retreating
325
- -escaped-> Sailing
326
- -caught-> Captured
327
-
328
- [Combat] red
329
- Engaging
330
- -alongside-> Boarding
331
- -hull breach-> Sinking
332
- -outgunned-> Retreating
333
-
334
- Boarding
335
- -crew wins-> Victorious
336
- -crew loses-> Captured
337
-
338
- BattleStations
339
- -in range-> Engaging
340
- -enemy retreats-> Sailing
341
- ```
342
- #### infra
343
-
344
- ```dgmo
345
- infra Pirate Communication Network
346
-
347
- tag Fleet as f
348
- Blackbeard red
349
- Bonny purple
350
- Rackham blue
351
-
352
- Edge
353
- rps: 200
354
- -> SignalFlags
355
-
356
- SignalFlags f: Blackbeard
357
- description: Flag semaphore relay — ship-to-ship messaging
358
- latency-ms: 30000
359
- -> Flagship
360
- -> ScoutShip
361
-
362
- Flagship f: Blackbeard
363
- description: Command vessel — decrypts and routes all intelligence
364
- instances: 1
365
- max-rps: 50
366
- latency-ms: 5000
367
- -> CarrierPigeons
368
- -> RumRunner
369
-
370
- ScoutShip f: Bonny
371
- description: Fast sloop for reconnaissance
372
- instances: 2
373
- max-rps: 30
374
- latency-ms: 8000
375
- -> Flagship
376
-
377
- CarrierPigeons f: Rackham
378
- description: Long-range bird relay — messages to allied ports
379
- buffer: 100
380
- drain-rate: 12
381
- retention-hours: 72
382
- -> TavernNetwork
383
-
384
- [Allied Ports]
385
- instances: 3
386
-
387
- TavernNetwork f: Rackham
388
- description: Dockside tavern informants across the Caribbean
389
- max-rps: 20
390
- latency-ms: 86400000
391
-
392
- RumRunner f: Bonny
393
- description: Smuggler supply line — moves coded messages in rum barrels
394
- concurrency: 4
395
- duration-ms: 172800000
396
- -> TavernNetwork
397
- ```
398
- #### gantt
399
-
400
- ```dgmo
401
- gantt Blackbeard's Blockade — 1718
402
-
403
- start-date 1718-05-01
404
- today-marker 1718-05-15
405
-
406
- tag Role as r
407
- Command red
408
- Crew blue
409
- Captives orange
410
-
411
- marker 1718-05-14 Ransom Deadline red
412
- era 1718-05-08 -> 1718-05-17 Blockade Active blue
413
-
414
- [Preparation] r: Command
415
- Provision Ship 3d r: Crew, progress: 100
416
- -> Anchor Fleet 2d r: Crew, progress: 100
417
- Scout Harbor 3d r: Crew, progress: 100
418
- -> Position Cannons 3d r: Crew, progress: 100
419
- Recruit Hands 5d r: Crew, progress: 100
420
-
421
- +7d [Blockade] r: Crew
422
- Seize Merchants 4d progress: 100
423
- -> Hold Hostages 5d r: Captives, progress: 60
424
- Patrol Perimeter 9d progress: 75
425
- Demand Medicine 4d r: Command, progress: 100
426
- -> Threaten Executions 3d? r: Command, progress: 90
427
-
428
- +17d [Resolution] r: Command
429
- Receive Ransom 2d r: Captives
430
- -> Release Prisoners 1d r: Captives
431
- -> Set Sail 0d
432
- Burn Evidence 2d r: Crew
433
- ```
434
-
435
- **Fetch more:** call `get_language_reference(type)` for a type's full syntax and `get_examples(type)` for starter templates. `suggest_chart_type` returns the chosen type's reference automatically.
436
- <!-- DGMO-AI-CORE:END -->
437
-
438
- ## Output — where the diagram goes
439
-
440
- **Always save the `.dgmo` source** to `<name>.dgmo` in the working directory — it's the editable deliverable; the app/URL just displays it. **Never render a PNG/SVG unless the user explicitly asks** for an image.
441
-
442
- Decide the visual output **once per session** with `check_app_installed`:
443
-
444
- 1. **App installed →** save the source, then `open_in_app({ dgmo, filePath: "<abs path to the saved file>" })`. The app opens *that file*, so in-app edits autosave back to it — one source of truth, live re-render. **Best UX.** Don't open an online URL and don't render a PNG.
445
- 2. **App not installed →** `share_diagram` returns a `https://online.diagrammo.app/...` URL; `open` it. Same chart + editor view in the browser. **Preferred fallback.**
446
-
447
- Other tools (use only when the user asks for them):
448
- 3. `render_diagram` — PNG or SVG to a file path. Use when the user wants an image artifact (export, embed, attach).
449
- 4. `generate_report` — renders multiple diagrams into an HTML report with table of contents.
450
- 5. `preview_diagram` — local HTML preview in the browser; also the multi-diagram side-by-side tool.
451
- 6. `list_chart_types` / `get_language_reference` — discovery; call `get_language_reference` before generating an unfamiliar chart type.
452
-
453
- ## When to use dgmo
454
-
455
- - Architecture diagrams, sequence diagrams, flowcharts
456
- - Data charts (bar, line, pie, scatter, heatmap, etc.)
457
- - ER diagrams, class diagrams, org charts
458
- - Project roadmaps, kanban boards, gantt charts, timelines
459
- - Responsibility matrices (RACI / RASCI / DACI), journey maps, pyramids, rings, mindmaps, wireframes, tech radars
460
-
461
- ## Quick syntax reference
462
-
463
- ### Sequence diagram
464
- ```dgmo
465
- sequence Auth Flow
466
-
467
- User -Login-> API
468
- API -Find user-> DB
469
- DB -user-> API
470
- if valid
471
- API -200 OK-> User
472
- else
473
- API -401-> User
474
- ```
475
-
476
- ### Flowchart
477
- ```dgmo
478
- flowchart Process
479
-
480
- (Start) -> <Valid?>
481
- -yes-> [Process] -> (Done)
482
- -no-> /Get Input/ -> <Valid?>
483
- ```
484
-
485
- ### Bar chart
486
- ```dgmo
487
- bar Revenue
488
-
489
- North 850
490
- South 620
491
- East 1100
492
- ```
493
-
494
- ### ER diagram
495
- ```dgmo
496
- er Schema
497
-
498
- users
499
- id int pk
500
- email varchar
501
-
502
- posts
503
- id int pk
504
- user_id int fk
505
-
506
- users 1-writes-* posts
507
- ```
508
-
509
- ### Org chart
510
- ```dgmo
511
- org
512
-
513
- CEO
514
- VP Engineering
515
- Team Lead A
516
- Team Lead B
517
- VP Marketing
518
- ```
519
-
520
- ### Infra chart
521
- ```dgmo
522
- infra
523
-
524
- edge
525
- rps: 10000
526
- -> CDN
527
-
528
- CDN
529
- cache-hit: 80%
530
- -> LB
531
-
532
- LB
533
- -> API split: 70%
534
- -> Web split: 30%
535
-
536
- API
537
- instances: 3
538
- max-rps: 500
539
- latency-ms: 45
540
- ```
541
-
542
- ## All chart types
543
-
544
- **Data charts:** bar, line, pie, radar, polar-area, scatter, sankey, function, heatmap, funnel, treemap
545
-
546
- **Visualizations:** slope, wordcloud, arc, timeline, event-line, venn, quadrant, tech-radar, cycle, pyramid, ring, map
547
-
548
- **Diagrams:** sequence, flowchart, state, class, er, org, kanban, c4, sitemap, infra, gantt, pert, boxes-and-lines, block, swimlane, version-control, mindmap, wireframe, journey-map, raci
549
-
550
- ## Common patterns
551
-
552
- - First line: chart type keyword (e.g. `sequence`, `flowchart`, `bar`), optionally followed by a title (`bar Revenue`)
553
- - `// comment` — only `//` comments (not `#`)
554
- - `(colorname)` — inline colors on data series, tag values, kanban columns: `Label(red) 100`
555
- - `series A(red), B(blue)` — multi-series with colors
556
-
557
- ## Rendering via CLI
558
-
559
- ```bash
560
- dgmo file.dgmo -o output.svg # SVG
561
- dgmo share file.dgmo # shareable link (copied to clipboard)
562
- dgmo file.dgmo --json # structured JSON output
563
- ```
564
-
565
- ## Mistakes to avoid
566
-
567
- - Don't use `#` for comments — use `//`
568
- - Don't use `end` to close sequence blocks — indentation closes them
569
- - Don't use hex colors in section headers — use named colors
570
- - Start the file with the chart type keyword when content is ambiguous
571
- - Sequence arrows: `->` (sync), `~>` (async) — always left-to-right
572
-
573
- Full reference: call `get_language_reference` MCP tool or visit diagrammo.app/docs
package/dist/auto.d.ts DELETED
@@ -1,60 +0,0 @@
1
- /**
2
- * Shared browser-embed helpers for the `@diagrammo/dgmo` client-side
3
- * drop-ins (`./auto` script-tag renderer and `./element` custom element).
4
- *
5
- * These are the SVG sanitizer, theme resolver, the standard-block DOM
6
- * assembler (canonical chrome from `src/embed` — BL-114), the error card,
7
- * aria-label derivation, style injection, and share-URL builder — factored
8
- * out of `auto/index.ts` so the two entries share one implementation rather
9
- * than diverging copies. The `auto` entry's public `window.dgmo` surface is
10
- * unaffected; it imports from here.
11
- */
12
- declare const VERSION: string;
13
-
14
- type ThemePreference = 'auto' | 'light' | 'dark' | 'transparent';
15
- declare function resolveTheme(theme: ThemePreference | undefined): 'light' | 'dark' | 'transparent';
16
-
17
- /**
18
- * `@diagrammo/dgmo/auto` — IIFE-distributed auto-renderer for static HTML.
19
- *
20
- * Drop a `<script src="…/auto.js">` on any page; on `DOMContentLoaded`
21
- * this module scans for `.dgmo, .language-dgmo`, runs `render()`, and
22
- * replaces each match with the standard DGMO embed block (BL-114,
23
- * `figure.dgmo.dgmo-rendered`) — the diagram plus a hover-reveal icon
24
- * toolbar with view-source, Copy, and "Open in editor" actions.
25
- *
26
- * Public API: frozen `window.dgmo` and alias `window.diagrammo` with
27
- * `{ initialize, run, version }`. Configuration is read from the
28
- * bundle's own `<script data-config='{…}'>` (JSON with strict
29
- * allowlist) or via `dgmo.initialize(opts)` for `data-auto="false"`
30
- * embedders.
31
- */
32
-
33
- interface AutoConfig {
34
- theme?: 'auto' | 'light' | 'dark' | 'transparent';
35
- palette?: string;
36
- /** Show the source-view toggle + collapsible source panel. Default true. */
37
- showSource?: boolean;
38
- /** Show the copy-source button. Default true. */
39
- showCopy?: boolean;
40
- /** Show the expand (full-screen) button. Default true. */
41
- showExpand?: boolean;
42
- /** Show the open-in-editor link. Default true. */
43
- showEditorLink?: boolean;
44
- }
45
- interface RunOptions {
46
- nodes?: Element[] | NodeListOf<Element>;
47
- }
48
-
49
- declare function findScriptTag(): HTMLScriptElement | null;
50
- declare function parseConfig(raw: string | null | undefined): Partial<AutoConfig>;
51
- declare function selectTargets(root?: ParentNode): Element[];
52
- declare function initialize(opts?: AutoConfig): void;
53
- declare function run(opts?: RunOptions): Promise<void>;
54
- declare const api: Readonly<{
55
- initialize: typeof initialize;
56
- run: typeof run;
57
- version: string;
58
- }>;
59
-
60
- export { type AutoConfig, type RunOptions, VERSION, api as default, findScriptTag, initialize, parseConfig, resolveTheme, run, selectTargets };