@diagrammo/dgmo 0.8.25 → 0.8.26

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.
@@ -244,392 +244,16 @@ palette catppuccin // directives are space-separated (no colon)
244
244
  Inline colors on most elements: append `(colorname)` — e.g. `North(red) 850`, `[Process(blue)]`.
245
245
  Named colors: `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `teal`, `cyan`, `gray`.
246
246
 
247
- ### sequence (most commonly used)
247
+ ### Per-chart-type syntax
248
248
 
249
- ```
250
- sequence Auth Flow
251
-
252
- User -Login-> API
253
- API -Find user-> DB
254
- DB -user record-> API
255
- note
256
- Indexed lookup on email column
257
-
258
- if credentials valid
259
- API -200 OK + token-> User
260
- else
261
- API -401 Unauthorized-> User
262
-
263
- == Logout ==
264
-
265
- note session cleanup
266
- User -Logout-> API
267
- API -Delete session-> DB
268
- ```
269
-
270
- - Sync: `A -label-> B` · Async: `A ~label~> B` · Unlabeled: `A -> B`
271
- - Blocks: `if` / `else`, `loop`, `parallel` — closed by indentation (no `end` keyword)
272
- - Notes: place `note text` after a message — it naturally associates with that position.
273
- - Single-line: `note text`
274
- - Multi-line: `note` then indent continuation lines beneath it
275
- - Anchored: `note right of API` then indent continuation lines
276
- - Sections: `== Title ==`
277
- - Groups: `[Group Name]` with indented participants
278
-
279
- ### flowchart
280
-
281
- ```
282
- (Start) -> <Valid Input?>
283
- -yes-> [Process Data] -> (Done)
284
- -no-> /Get Input/ -> <Valid Input?>
285
- ```
286
-
287
- Shapes: `(oval)` `[rect]` `<diamond>` `/parallelogram/` `[[subroutine]]` `[document~]`
288
-
289
- ### bar / line / pie (data charts)
290
-
291
- **Data-chart conventions (apply to every chart under §15 of the spec):**
292
- - Data rows are **space-separated**. Commas between values are tolerated for back-compat but not idiomatic — do not generate them.
293
- - Multi-series `series` declarations use the **indented one-per-line form** when there's more than one series; it's easier to read and reviewers prefer it.
294
-
295
- ```
296
- // bar (single series)
297
- bar Revenue by Region
298
- series Revenue
299
- North 850
300
- South 620
301
-
302
- // line (multi-series — use indented series block + space-separated values)
303
- line Quarterly Numbers
304
- series
305
- Sales (red)
306
- Costs (blue)
307
- Q1 100 50
308
- Q2 120 55
309
-
310
- // pie
311
- pie Market Share
312
- labels percent
313
- Company A 40
314
- Company B 35
315
- ```
316
-
317
- ### er
318
-
319
- ```
320
- users
321
- id int [pk]
322
- email varchar [unique]
323
- 1-writes-* posts
324
-
325
- posts
326
- id int [pk]
327
- author_id int [fk]
328
- ```
329
-
330
- ### org
331
-
332
- ```
333
- CEO
334
- VP Engineering
335
- [Platform Team]
336
- Lead
337
- Dev 1
338
- Dev 2
339
- VP Marketing
340
- ```
341
-
342
- ### infra
343
-
344
- ```
345
- infra
346
-
347
- edge
348
- rps 10000
349
- -> CDN
350
-
351
- CDN
352
- cache-hit 80%
353
- -> API
354
-
355
- API
356
- instances 3
357
- max-rps 500
358
- latency-ms 45
359
- ```
360
-
361
- ### slope
362
-
363
- ```
364
- slope Fleet Strength
365
-
366
- period 1715 1725
367
-
368
- Blackbeard 40 4
369
- Roberts 12 52
370
- Anne Bonny (red) 8 15
371
- ```
372
-
373
- - `period` directive required before data rows (one-line or indented block for multi-token labels)
374
- - Data rows: `Label value1 value2` — space-separated, no colons
375
- - Right-scan: parser takes numeric values from the right, everything left is the label
376
- - Color annotations: `Label (color) value1 value2`
377
-
378
- ### timeline
379
-
380
- ```
381
- timeline Product Roadmap
382
- sort tag:Team
383
-
384
- tag Team alias t
385
- Engineering(blue)
386
- Design(purple)
387
-
388
- era 2024-01 -> 2024-06 Phase 1
389
- marker 2024-03 Beta Launch
390
-
391
- 2024-01->2024-03 Core API | t: Engineering
392
- 2024-02->2024-05 UX Research | t: Design
393
- 2024-06 GA Release | t: Engineering
394
- ```
395
-
396
- - Dates: `YYYY`, `YYYY-MM`, `YYYY-MM-DD`. Ranges: `start->end`. Durations: `start->6m`, `->2w`, `->30d`
397
- - Uncertain end: `2024-03?`. Point events: single date, no range
398
- - `era start -> end Label` — background band. `marker date Label` — vertical line
399
- - `## Group(color)` headers for manual grouping, or `tag` + `sort tag:Name` for swimlanes
400
- - Pipe metadata: `| tagalias: Value`
401
-
402
- ### gantt
403
-
404
- ```
405
- gantt Sprint Plan
406
- start 2024-01-15
407
- today-marker 2024-03-01
408
- critical-path
409
- dependencies
410
-
411
- 10bd Design | 80%
412
- parallel
413
- [Backend]
414
- 15bd API Layer
415
- 5bd? Auth Module
416
- -> Frontend.Integration | offset: -3bd
417
- [Frontend]
418
- 10bd Components
419
- 5bd Integration
420
- 5bd QA Testing
421
- 0d Release
422
- ```
423
-
424
- - `start YYYY-MM-DD` — project start date (required)
425
- - Duration: `10bd Task Name` (business days). Uncertain: `5bd?`. Milestone: `0d`
426
- - `parallel` block for concurrent tracks. `[Group]` for named sections
427
- - Progress: `| 80%` or trailing `80%`
428
- - Dependencies: `-> Target.Task` or `-blocks-> Target.Task`. `offset: -3bd` for overlap
429
- - `today-marker`, `critical-path`, `dependencies` — top-level directives
430
- - Tags + eras + markers same as timeline
431
-
432
- ### c4
433
-
434
- ```
435
- c4 Banking System
436
-
437
- Customer is a person
438
- description: A customer of the bank
439
-
440
- Banking is a system
441
- description: Online banking portal
442
- containers
443
- WebApp is a container | tech: React
444
- API is a container | tech: Node.js
445
- DB is a container is a database | tech: PostgreSQL
446
-
447
- Email is a system
448
- description: External email service
249
+ For every specific chart type (sequence, flowchart, bar/line/pie, scatter, er, org, infra, slope, timeline, gantt, c4, class, venn, quadrant, sankey/chord, state, boxes-and-lines, and the rest), do not guess from prior knowledge — call the MCP tools:
449
250
 
450
- Customer -Uses-> Banking
451
- Banking -Sends emails [SMTP]-> Email
452
251
  ```
453
-
454
- - Elements: `Name is a person|system|container|component`
455
- - Metadata (pipe-delimited): `| description: text, tech: stack`
456
- - Indented `description:` also works (no pipe needed)
457
- - Sections: `containers` (inside system), `components` (inside container), `deployment`
458
- - Deployment: `NodeName is a cloud|database|cache|queue`
459
- - Arrows: sync `-label [tech]->`, async `~label [tech]~>`, bidirectional `<->`, `<~>`
460
-
461
- ### class
462
-
463
- ```
464
- class Type Hierarchy
465
-
466
- Drawable [interface]
467
- + draw(): void
468
-
469
- Shape implements Drawable [abstract]
470
- # x: number
471
- + area(): number
472
- count: number {static}
473
-
474
- Circle extends Shape
475
- - radius: number
476
-
477
- Color [enum]
478
- Red
479
- Green
480
- Blue
481
-
482
- Canvas
483
- *-- Shape : contains
484
- ..> Logger : uses
485
- ```
486
-
487
- - Modifiers: `[abstract]`, `[interface]`, `[enum]`
488
- - Inheritance: `Child extends Parent`, `Child implements Interface`
489
- - Visibility: `+` public, `#` protected, `-` private. Static: `{static}`
490
- - Relationships: `A *-- B` (composition), `A o-- B` (aggregation), `A --|> B` (inheritance), `A ..|> B` (implementation), `A ..> B` (dependency), `A -> B` (association)
491
- - Optional label: `A *-- B : description`
492
-
493
- ### venn
494
-
495
- ```
496
- venn Full-Stack Skills
497
-
498
- Frontend(blue) alias fe
499
- Backend(green) alias be
500
- DevOps(orange) alias de
501
-
502
- fe + be Web Systems
503
- be + de Platform Ops
504
- fe + be + de Full Stack
505
- ```
506
-
507
- - Sets: `Name(color) alias id` — declares a circle
508
- - Overlaps: `id + id Label` — names the intersection region
509
- - Option: `values on` to show sizes. Sized form: `id(color): 120 "Label"`
510
-
511
- ### quadrant
512
-
513
- ```
514
- quadrant Feature Priorities
515
-
516
- x-label Low Effort, High Effort
517
- y-label Low Impact, High Impact
518
-
519
- top-left Quick Wins(green)
520
- top-right Major Projects
521
- bottom-left Fill-ins
522
- bottom-right Avoid(red)
523
-
524
- Dark Mode (blue) 0.25 0.85
525
- API v2 0.8 0.9
526
- Fix Typos 0.1 0.15
527
- ```
528
-
529
- - Axis labels: `x-label Low, High` and `y-label Low, High` (comma is the low/high delimiter here by design, not a data-row delimiter)
530
- - Quadrant labels: `top-left`, `top-right`, `bottom-left`, `bottom-right`
531
- - Data points: `Label (color) x y` — space-separated per §15 Rule A (comma-form tolerated for back-compat but not idiomatic)
532
-
533
- ### sankey / chord
534
-
535
- ```
536
- // sankey — flow diagram
537
- sankey Budget Allocation
538
-
539
- Revenue (green)
540
- Costs: 600
541
- Profit (blue): 400
542
-
543
- // arrow syntax also works
544
- Revenue -> Marketing: 200
545
-
546
- // chord — same syntax, circular layout
547
- chord Team Collaboration
548
- Engineering -> Design 85
549
- Design -> Product 68
550
- ```
551
-
552
- - Indented syntax: parent → child with `Target: weight`
553
- - Arrow syntax: `Source -> Target: weight` (sankey) or `Source -> Target weight` (chord)
554
- - Node colors: `Name (color)`. Link colors: `Target: 600 (red)`
555
-
556
- ### state
557
-
558
- ```
559
- state Order Lifecycle
560
- direction LR
561
-
562
- [*] -> Pending -submit-> Validating
563
-
564
- Validating
565
- -approved-> Processing
566
- -rejected-> Cancelled(red)
567
-
568
- ## Fulfillment(blue)
569
- Processing -ship-> Shipped
570
- Shipped -delivered-> Done
571
-
572
- Cancelled -> [*]
573
- Done -> [*]
574
- ```
575
-
576
- - `[*]` — start/end pseudostate (filled circle)
577
- - Transitions: `A -> B`, `A -label-> B`, `A -(color)-> B`
578
- - Chains: `A -> B -> C` on one line
579
- - Indented transitions use parent as source
580
- - Groups: `## GroupName(color)` with indented states
581
- - Options: `direction LR` (left-right) or `TB` (top-bottom, default)
582
-
583
- ### scatter
584
-
585
- ```
586
- scatter Funding vs Revenue
587
- x-label Funding ($M)
588
- y-label Revenue ($M)
589
-
590
- [SaaS](blue)
591
- Acme 12 8.5
592
- DataSync 5.2 3.1
593
-
594
- [Fintech](green)
595
- PayFlow 45 32
596
- LendTech 18 12.5
597
- ```
598
-
599
- - Data: `Label x y` or `Label x y size` (bubble chart) — space-separated per §15 Rule A
600
- - Groups: `[Category](color)` headers
601
- - Options: `labels on`, `xlabel`, `ylabel`, `sizelabel`
602
-
603
- ### boxes-and-lines
604
-
605
- ```
606
- boxes-and-lines Architecture
607
-
608
- tag Team t Backend(blue), Frontend(green), Platform(purple)
609
- active-tag Team
610
- direction LR
611
-
612
- API Gateway | t: Backend
613
- -routes-> AuthService
614
- -queries-> DB
615
-
616
- AuthService | t: Backend
617
- DB | t: Platform
618
-
619
- [Cloud]
620
- API Gateway
621
- AuthService
622
-
623
- Redis <-syncs-> DB | t: Platform
252
+ mcp__dgmo__get_language_reference("<type>") // authoritative grammar + directives
253
+ mcp__dgmo__get_examples("<type>") // real starter templates from the gallery
624
254
  ```
625
255
 
626
- - Nodes: explicit `Name | metadata` or implicit from edges
627
- - Edges: `A -label-> B` (directed), `A <-label-> B` (bidirectional)
628
- - Indented edges use parent as source: `Parent` then ` -label-> Target`
629
- - Groups: `[Name]` with indented children (max 2 levels deep)
630
- - Tags: `tag Name alias Value1(color), Value2(color)` + `active-tag Name` + `hide alias:value`
631
- - Options: `direction LR` (left-right) or `TB` (top-bottom, default)
632
- - Shape inference: names containing DB/database → cylinder, Cache/Redis → diamond, Queue → hexagon, etc.
256
+ Both ship inside `@diagrammo/dgmo` and always reflect the installed version, so they never drift from the actual parsers. This replaces the per-type sections that used to live here and went stale every time a chart type's syntax evolved.
633
257
 
634
258
  ## Anti-Patterns
635
259
 
package/.cursorrules CHANGED
@@ -121,9 +121,9 @@ API Gateway | t: Backend
121
121
 
122
122
  Nodes: implicit from edges or explicit with `| metadata`. Edges: `A -label-> B`, `A <-label-> B` (bidi). Groups: `[Name]` with indented children (max 2 levels). Tags: `tag Name alias values`, `active-tag`, `hide`. Options: `direction LR|TB`.
123
123
 
124
- ## All 33 chart types
124
+ ## Supported chart types
125
125
 
126
- bar, line, multi-line, area, pie, doughnut, radar, polar-area, bar-stacked, scatter, sankey, chord, function, heatmap, funnel, slope, wordcloud, arc, timeline, venn, quadrant, sequence, flowchart, state, class, er, org, kanban, c4, sitemap, infra, gantt, boxes-and-lines
126
+ If the dgmo MCP server is configured, call `list_chart_types` for the authoritative list (with descriptions) and `suggest_chart_type({ prompt })` to pick the best match for a request. Otherwise run `dgmo --chart-types` in a terminal. The static list previously here drifted with every new chart type the MCP tool / CLI is the source of truth.
127
127
 
128
128
  ## Common patterns
129
129
 
package/.windsurfrules CHANGED
@@ -121,9 +121,9 @@ API Gateway | t: Backend
121
121
 
122
122
  Nodes: implicit from edges or explicit with `| metadata`. Edges: `A -label-> B`, `A <-label-> B` (bidi). Groups: `[Name]` with indented children (max 2 levels). Tags: `tag Name alias values`, `active-tag`, `hide`. Options: `direction LR|TB`.
123
123
 
124
- ## All 33 chart types
124
+ ## Supported chart types
125
125
 
126
- bar, line, multi-line, area, pie, doughnut, radar, polar-area, bar-stacked, scatter, sankey, chord, function, heatmap, funnel, slope, wordcloud, arc, timeline, venn, quadrant, sequence, flowchart, state, class, er, org, kanban, c4, sitemap, infra, gantt, boxes-and-lines
126
+ If the dgmo MCP server is configured, call `list_chart_types` for the authoritative list (with descriptions) and `suggest_chart_type({ prompt })` to pick the best match for a request. Otherwise run `dgmo --chart-types` in a terminal. The static list previously here drifted with every new chart type the MCP tool / CLI is the source of truth.
127
127
 
128
128
  ## Common patterns
129
129
 
package/AGENTS.md CHANGED
@@ -15,12 +15,15 @@ This installs the MCP server and writes the dgmo config to `.codex/config.toml`.
15
15
  ## MCP Tools
16
16
 
17
17
  When the `dgmo` MCP server is configured, use these tools directly:
18
- - `preview_diagram` — renders diagram(s) and opens a live HTML preview in the browser (default for showing diagrams)
18
+ - `suggest_chart_type` — first call when creating a new diagram; ranks the best chart types for a plain-English prompt
19
+ - `list_chart_types` — lists every supported chart type with descriptions
20
+ - `get_language_reference` — fetches full syntax for any chart type (call this before generating an unfamiliar chart type)
21
+ - `get_examples` — real example diagrams from the gallery; useful as few-shot references
22
+ - `validate_diagram` — fast syntax check before rendering (much cheaper than a failed render)
19
23
  - `render_diagram` — renders to PNG or SVG, returns file path
24
+ - `preview_diagram` — renders diagram(s) and opens a live HTML preview in the browser
20
25
  - `share_diagram` — creates a shareable diagrammo.app URL
21
26
  - `open_in_app` — opens diagram in Diagrammo desktop app (macOS)
22
- - `list_chart_types` — lists all 34 supported chart types with descriptions
23
- - `get_language_reference` — fetches full syntax for any chart type (call this before generating an unfamiliar chart type)
24
27
  - `generate_report` — renders multiple diagrams into an HTML report with table of contents
25
28
 
26
29
  ## When to use dgmo
@@ -113,9 +116,9 @@ API
113
116
  latency-ms: 45
114
117
  ```
115
118
 
116
- ## All 33 chart types
119
+ ## Supported chart types
117
120
 
118
- bar, line, multi-line, area, pie, doughnut, radar, polar-area, bar-stacked, scatter, sankey, chord, function, heatmap, funnel, slope, wordcloud, arc, timeline, venn, quadrant, sequence, flowchart, state, class, er, org, kanban, c4, sitemap, infra, gantt, boxes-and-lines
121
+ Call `list_chart_types` for the authoritative list with descriptions, or `suggest_chart_type({ prompt })` to rank candidates against a user request. The static list previously here drifted with every new chart type the MCP tool is the source of truth.
119
122
 
120
123
  ### Boxes and lines
121
124
  ```