@diagrammo/dgmo 0.33.0 → 0.35.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 (59) hide show
  1. package/.claude/commands/dgmo.md +17 -32
  2. package/.github/copilot-instructions.md +1 -1
  3. package/README.md +7 -1
  4. package/SKILL.md +1 -1
  5. package/dist/advanced.cjs +791 -614
  6. package/dist/advanced.d.cts +8 -51
  7. package/dist/advanced.d.ts +8 -51
  8. package/dist/advanced.js +791 -615
  9. package/dist/auto.cjs +793 -292
  10. package/dist/auto.js +95 -95
  11. package/dist/auto.mjs +793 -292
  12. package/dist/cli.cjs +145 -328
  13. package/dist/index.cjs +792 -291
  14. package/dist/index.js +792 -291
  15. package/docs/ai-integration.md +46 -26
  16. package/docs/language-reference.md +2 -2
  17. package/package.json +3 -3
  18. package/src/advanced.ts +0 -12
  19. package/src/boxes-and-lines/label-placement.ts +339 -0
  20. package/src/boxes-and-lines/layout-search.ts +16 -2
  21. package/src/boxes-and-lines/layout.ts +32 -7
  22. package/src/boxes-and-lines/renderer.ts +67 -139
  23. package/src/c4/parser.ts +15 -6
  24. package/src/chart.ts +1 -1
  25. package/src/class/parser.ts +6 -2
  26. package/src/cli-banner.ts +2 -3
  27. package/src/cli.ts +539 -1223
  28. package/src/cycle/parser.ts +4 -1
  29. package/src/dgmo-router.ts +16 -2
  30. package/src/diagnostics.ts +0 -0
  31. package/src/echarts.ts +5 -1
  32. package/src/er/parser.ts +5 -1
  33. package/src/gantt/parser.ts +13 -4
  34. package/src/graph/flowchart-parser.ts +5 -1
  35. package/src/graph/state-parser.ts +5 -1
  36. package/src/infra/parser.ts +10 -6
  37. package/src/journey-map/parser.ts +5 -2
  38. package/src/kanban/parser.ts +6 -2
  39. package/src/map/context-labels.ts +29 -19
  40. package/src/map/layout.ts +403 -108
  41. package/src/map/legend-band.ts +28 -0
  42. package/src/map/parser.ts +13 -4
  43. package/src/map/renderer.ts +74 -23
  44. package/src/map/resolver.ts +2 -2
  45. package/src/org/parser.ts +8 -2
  46. package/src/pyramid/parser.ts +4 -1
  47. package/src/raci/parser.ts +4 -1
  48. package/src/ring/parser.ts +4 -1
  49. package/src/sequence/parser.ts +6 -3
  50. package/src/sitemap/parser.ts +12 -3
  51. package/src/tech-radar/parser.ts +6 -3
  52. package/src/utils/parsing.ts +2 -2
  53. package/src/utils/tag-groups.ts +3 -3
  54. package/src/visualizations/parse.ts +9 -3
  55. package/src/migrate/data-comma.ts +0 -117
  56. package/src/migrate/embedded.ts +0 -238
  57. package/src/migrate/index.ts +0 -295
  58. package/src/migrate/line-classifier.ts +0 -128
  59. package/src/migrate/line-transformer.ts +0 -218
@@ -18,37 +18,15 @@ If the MCP tools are **not** available, run the setup flow below — do not ask
18
18
  which dgmo || npm install -g @diagrammo/dgmo
19
19
  ```
20
20
 
21
- ### Step 2 — Install the MCP server (if missing)
21
+ ### Step 2 — Run the one-step installer
22
22
 
23
23
  ```bash
24
- which dgmo-mcp || npm install -g @diagrammo/dgmo-mcp
24
+ dgmo install claude-code
25
25
  ```
26
26
 
27
- ### Step 3 — Configure the MCP server
27
+ That single command writes this skill, configures the MCP server in `~/.claude/settings.json` (entry: `{ "command": "dgmo", "args": ["mcp"] }`), and ensures the server is available — no prompts, no separate `dgmo-mcp` package to install. (Use `--scope project` to write `.mcp.json` in the current directory instead of the global settings.)
28
28
 
29
- Ask the user:
30
-
31
- > "Where should I configure the MCP server?
32
- > 1) This project only — write `.mcp.json` here [default]
33
- > 2) Globally — add to `~/.claude/settings.json` (works in all projects)"
34
-
35
- **Option 1 (default):** Create or update `.mcp.json` in the current working directory:
36
-
37
- ```json
38
- {
39
- "mcpServers": {
40
- "dgmo": {
41
- "command": "dgmo-mcp"
42
- }
43
- }
44
- }
45
- ```
46
-
47
- If `.mcp.json` already exists and has other servers, merge the `dgmo` entry in — do not overwrite the file.
48
-
49
- **Option 2 (global):** Add the `dgmo` entry to the `mcpServers` object in `~/.claude/settings.json`. Read the file first and merge — do not overwrite other keys.
50
-
51
- ### Step 4 — Prompt restart
29
+ ### Step 3 — Prompt restart
52
30
 
53
31
  Tell the user:
54
32
 
@@ -56,7 +34,7 @@ Tell the user:
56
34
 
57
35
  Then proceed with the user's original request using CLI fallback (see "Other output options" below).
58
36
 
59
- > **Note for future users:** To set up in one step from the terminal before starting a Claude Code session, run `dgmo --install-claude-code-integration`. It handles everything: installs `@diagrammo/dgmo-mcp`, writes the skill, and configures the MCP server.
37
+ > **One-step from a fresh machine:** `dgmo install` with no target auto-detects and sets up every AI assistant you have (Claude Code, Codex, Claude Desktop, Cursor, Windsurf, Copilot) at once.
60
38
 
61
39
  ## Project Awareness
62
40
 
@@ -89,7 +67,7 @@ For **examples** of real diagrams, call `mcp__dgmo__get_examples("<type>")` —
89
67
 
90
68
  ### Creating a new diagram
91
69
 
92
- 1. **Pick the right chart type** — always call `mcp__dgmo__suggest_chart_type({ prompt: <user's request> })` first. It returns up to 3 ranked candidates with a confidence banner and matched trigger phrases. Use the top match unless you have a strong reason to override it. If the MCP tool is unavailable (Setup Check fallback path), run `dgmo --chart-types` in a terminal to list supported types and pick from that list.
70
+ 1. **Pick the right chart type** — always call `mcp__dgmo__suggest_chart_type({ prompt: <user's request> })` first. It returns up to 3 ranked candidates with a confidence banner and matched trigger phrases. Use the top match unless you have a strong reason to override it. If the MCP tool is unavailable (Setup Check fallback path), run `dgmo types` in a terminal and pick from that list — do not pick from memory or assume a requested type is unsupported (see "Supported Chart Types" below).
93
71
  2. **Get syntax + examples** — call `mcp__dgmo__get_language_reference("<type>")` and `mcp__dgmo__get_examples("<type>")`.
94
72
  3. **Write the `.dgmo` content** — compose the markup.
95
73
  4. **Validate first** — call `mcp__dgmo__validate_diagram(dgmo)` to catch syntax errors before rendering. If errors come back, fix them and validate again.
@@ -216,19 +194,26 @@ Then tell the user it's been copied. Otherwise, the default is always `open <url
216
194
  ```
217
195
  dgmo <input.dgmo> [options]
218
196
  cat input.dgmo | dgmo [options]
197
+ dgmo share <input.dgmo> # shareable diagrammo.app URL (copies to clipboard)
198
+ dgmo types # list all supported chart types
219
199
  ```
220
200
 
221
201
  Key options:
222
202
  - `-o <file>` — output file; format inferred from extension (`.svg` → SVG, else PNG)
223
- - `-o url` — output a shareable diagrammo.app URL
224
203
  - `--theme <theme>` — `light` (default), `dark`, `transparent`
225
204
  - `--palette <name>` — `slate` (default), `atlas`, `blueprint`, `catppuccin`, `nord`, `tidewater`, `tokyo-night`
226
- - `--copy` — copy the URL to clipboard (use with `-o url`)
227
- - `--chart-types` — list all supported chart types
205
+ - `--json` — output structured JSON
228
206
 
229
207
  ## Supported Chart Types
230
208
 
231
- Call `mcp__dgmo__list_chart_types` to see every supported type with descriptions, or `dgmo --chart-types` in a terminal as a CLI fallback. When picking for a new diagram, use `mcp__dgmo__suggest_chart_type` — it scores the full list against the user's prompt (see "Creating a new diagram → step 1").
209
+ **There are ~45 chart types. The authoritative, complete list comes ONLY from the live tool — never from memory and never from any prose list in this skill.** Any chart types named elsewhere in this document (in examples, tips, or the "diagram this" table) are illustrative, NOT the full set. dgmo supports many specialized types people don't expect — including `journey-map`, `mindmap`, `pert`, `raci`, `pyramid`, `wireframe`, `ring`, `tech-radar`, `cycle`, and more.
210
+
211
+ **Hard rule:** before telling the user a chart type "doesn't exist," isn't supported, or that you'll use "the closest fit instead" — you MUST first query the live list:
212
+
213
+ - MCP active: `mcp__dgmo__list_chart_types` (full list + descriptions), and `mcp__dgmo__suggest_chart_type({ prompt })` to pick.
214
+ - MCP unavailable: run `dgmo types` in a terminal.
215
+
216
+ If the user asks for a named visualization (e.g. "user journey", "mind map", "RACI matrix"), assume dgmo supports it and verify against the live list — do not substitute a different type unless the list confirms the requested one is genuinely absent.
232
217
 
233
218
  ## Key Syntax Patterns
234
219
 
@@ -573,7 +573,7 @@ The canonical, ordered list lives in `src/chart-types.ts`.
573
573
 
574
574
  ```bash
575
575
  dgmo file.dgmo -o output.svg # SVG
576
- dgmo file.dgmo -o url # shareable link
576
+ dgmo share file.dgmo # shareable link (copied to clipboard)
577
577
  dgmo file.dgmo --json # structured JSON output
578
578
  ```
579
579
 
package/README.md CHANGED
@@ -110,7 +110,13 @@ Using a docs framework? First-class plugins wrap all of this:
110
110
 
111
111
  ## Use it from your AI tool
112
112
 
113
- There's an MCP server ([`@diagrammo/dgmo-mcp`](https://www.npmjs.com/package/@diagrammo/dgmo-mcp)) so Claude, Cursor, and other agents can author and render DGMO directly. Setup: **[diagrammo.app/ai](https://diagrammo.app/ai)**.
113
+ Claude, Cursor, Codex, and other agents can author and render DGMO directly. One command sets up every assistant you have — no second package, no prompts:
114
+
115
+ ```bash
116
+ dgmo install
117
+ ```
118
+
119
+ It auto-detects Claude Code, Codex, Claude Desktop, Cursor, Windsurf, and Copilot and wires each one to the bundled MCP server. More: **[diagrammo.app/ai](https://diagrammo.app/ai)**.
114
120
 
115
121
  ## Chart types
116
122
 
package/SKILL.md CHANGED
@@ -548,7 +548,7 @@ API
548
548
 
549
549
  ```bash
550
550
  dgmo file.dgmo -o output.svg # SVG
551
- dgmo file.dgmo -o url # shareable link
551
+ dgmo share file.dgmo # shareable link (copied to clipboard)
552
552
  dgmo file.dgmo --json # structured JSON output
553
553
  ```
554
554