agentic-mermaid 0.1.1 → 0.1.2

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 (336) hide show
  1. package/CHANGELOG.md +144 -4
  2. package/LICENSES/Apache-2.0.txt +202 -0
  3. package/README.md +25 -32
  4. package/THIRD_PARTY_NOTICES.md +29 -0
  5. package/dist/agent-core.d.ts +463 -0
  6. package/dist/agent-core.js +397 -0
  7. package/dist/agent.d.ts +73 -1868
  8. package/dist/agent.js +336 -37325
  9. package/dist/agentic-mermaid-mcp.js +7 -38399
  10. package/dist/am.js +33632 -40445
  11. package/dist/chunk-4QECACIA.js +4702 -0
  12. package/dist/chunk-CDPKJ2BQ.js +37 -0
  13. package/dist/chunk-QKDLMOJJ.js +3487 -0
  14. package/dist/chunk-WI35L7IR.js +615 -0
  15. package/dist/chunk-WN3YDOBG.js +149 -0
  16. package/dist/chunk-ZYMMKQ3I.js +62637 -0
  17. package/dist/index-D54dqSdC.d.ts +6777 -0
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.js +310 -33014
  20. package/dist/mcp-cli-SBQSTJFC.js +17 -0
  21. package/docs/README.md +14 -6
  22. package/docs/schemas/style-spec.schema.json +1221 -30
  23. package/examples/styles/catalog.json +54 -0
  24. package/examples/styles/cloudflare-workers-inspired-prototype.mmd +9 -0
  25. package/examples/styles/cloudflare-workers-inspired-prototype.style.json +110 -0
  26. package/examples/styles/cupertino-prototype.mmd +10 -0
  27. package/examples/styles/cupertino-prototype.style.json +63 -0
  28. package/examples/styles/mid-century-report.style.json +2 -2
  29. package/examples/styles/star-chart-atlas.style.json +2 -1
  30. package/examples/styles/transit-route-map.style.json +2 -2
  31. package/examples/styles/vercel-inspired-prototype.mmd +6 -0
  32. package/examples/styles/vercel-inspired-prototype.style.json +87 -0
  33. package/package.json +68 -43
  34. package/server.json +2 -2
  35. package/skills/agentic-mermaid-diagram-workflow/SKILL.md +17 -36
  36. package/skills/agentic-mermaid-diagram-workflow/references/cli.md +4 -5
  37. package/skills/agentic-mermaid-diagram-workflow/references/code-mode.md +15 -31
  38. package/skills/agentic-mermaid-diagram-workflow/references/sequence.md +10 -14
  39. package/skills/agentic-mermaid-live-editor/SKILL.md +100 -206
  40. package/AGENT_NATIVE.md +0 -607
  41. package/Instructions_for_agents.md +0 -89
  42. package/TODO.md +0 -684
  43. package/assets/hero.png +0 -0
  44. package/dist/index-wjRjbsP-.d.ts +0 -1102
  45. package/docs/agent-api-cookbook.md +0 -308
  46. package/docs/agent-mutation-policy.md +0 -104
  47. package/docs/agent-workflow-examples.md +0 -46
  48. package/docs/api.md +0 -211
  49. package/docs/ascii.md +0 -103
  50. package/docs/assets/improvements/box-start-connector.png +0 -0
  51. package/docs/assets/improvements/comment-dropped-lint.png +0 -0
  52. package/docs/assets/improvements/er-content-loss.png +0 -0
  53. package/docs/assets/improvements/fan-in-trunks.png +0 -0
  54. package/docs/assets/improvements/gantt-family.png +0 -0
  55. package/docs/assets/improvements/gantt-milestone-clamp.png +0 -0
  56. package/docs/assets/improvements/gantt-verify-seam.png +0 -0
  57. package/docs/assets/improvements/subgraph-container-edges.png +0 -0
  58. package/docs/assets/improvements/wrapper-frontmatter.png +0 -0
  59. package/docs/assets/improvements/wrapper-init-directive.png +0 -0
  60. package/docs/assets/improvements/wrapper-leading-comment.png +0 -0
  61. package/docs/assets/style-cookbook/mid-century-report.png +0 -0
  62. package/docs/assets/style-cookbook/star-chart-atlas.png +0 -0
  63. package/docs/assets/style-cookbook/transit-route-map.png +0 -0
  64. package/docs/comparison.md +0 -94
  65. package/docs/config.md +0 -105
  66. package/docs/contributing/adding-diagram-types.md +0 -144
  67. package/docs/contributing/diagram-family-citizenship.matrix.json +0 -2127
  68. package/docs/contributing/diagram-family-citizenship.md +0 -82
  69. package/docs/contributing/harvesting-upstream-tests.md +0 -126
  70. package/docs/contributing/lessons-learned.md +0 -276
  71. package/docs/contributing/releasing.md +0 -82
  72. package/docs/contributing/visual-review-evidence.md +0 -53
  73. package/docs/custom-style-cookbook.md +0 -154
  74. package/docs/design/families/README.md +0 -26
  75. package/docs/design/families/architecture-beta.md +0 -48
  76. package/docs/design/families/flowchart-parser-conformance.md +0 -22
  77. package/docs/design/families/gantt-research.md +0 -137
  78. package/docs/design/families/gantt.md +0 -329
  79. package/docs/design/families/journey-agentic-cards-before.png +0 -0
  80. package/docs/design/families/journey-experience-curve-implementation.png +0 -0
  81. package/docs/design/families/journey-mermaid-classic-implementation.png +0 -0
  82. package/docs/design/families/journey-mermaid-classic-prototype.png +0 -0
  83. package/docs/design/families/journey-mermaid-classic-prototype.svg +0 -163
  84. package/docs/design/families/journey-mermaid-classic-prototype.svg.png +0 -0
  85. package/docs/design/families/journey-migration-parity.md +0 -439
  86. package/docs/design/families/journey-section-overlap-after.png +0 -0
  87. package/docs/design/families/journey-section-overlap-before.png +0 -0
  88. package/docs/design/families/journey-usage-research.md +0 -423
  89. package/docs/design/families/journey.md +0 -153
  90. package/docs/design/families/xychart.md +0 -85
  91. package/docs/design/system/README.md +0 -45
  92. package/docs/design/system/abstraction-audit.md +0 -224
  93. package/docs/design/system/abstraction-recommendations.md +0 -655
  94. package/docs/design/system/architecture.mmd +0 -29
  95. package/docs/design/system/architecture.svg +0 -137
  96. package/docs/design/system/layout-guarantees-and-robustness.md +0 -351
  97. package/docs/design/system/layout-rubric.md +0 -138
  98. package/docs/design/system/route-contracts.md +0 -848
  99. package/docs/design/system/source-preservation-ladder.md +0 -52
  100. package/docs/design/system/styles-rollout.md +0 -216
  101. package/docs/design/system/ugly-layouts.md +0 -119
  102. package/docs/diagram-families.md +0 -193
  103. package/docs/features.md +0 -147
  104. package/docs/fork-differences.md +0 -130
  105. package/docs/getting-started.md +0 -175
  106. package/docs/issue-derived-test-cases.md +0 -156
  107. package/docs/layout-characterization/README.md +0 -245
  108. package/docs/layout-characterization/contact-sheet-families.md +0 -498
  109. package/docs/layout-characterization/contact-sheet.md +0 -638
  110. package/docs/layout-characterization/properties.md +0 -281
  111. package/docs/layout-characterization/visual-quality.md +0 -160
  112. package/docs/layout-characterization/visual-snapshots/architecture.svg +0 -79
  113. package/docs/layout-characterization/visual-snapshots/class.svg +0 -60
  114. package/docs/layout-characterization/visual-snapshots/er.svg +0 -61
  115. package/docs/layout-characterization/visual-snapshots/flowchart.svg +0 -58
  116. package/docs/layout-characterization/visual-snapshots/gantt.svg +0 -52
  117. package/docs/layout-characterization/visual-snapshots/journey.svg +0 -98
  118. package/docs/layout-characterization/visual-snapshots/pie.svg +0 -36
  119. package/docs/layout-characterization/visual-snapshots/quadrant.svg +0 -47
  120. package/docs/layout-characterization/visual-snapshots/sequence.svg +0 -59
  121. package/docs/layout-characterization/visual-snapshots/state.svg +0 -52
  122. package/docs/layout-characterization/visual-snapshots/timeline.svg +0 -64
  123. package/docs/layout-characterization/visual-snapshots/xychart.svg +0 -97
  124. package/docs/mcp-code-mode-rationale.md +0 -101
  125. package/docs/mcp-http-transport.md +0 -223
  126. package/docs/mermaid-layout-complaints.md +0 -837
  127. package/docs/mutation-testing.md +0 -206
  128. package/docs/project/divergences.md +0 -98
  129. package/docs/project/dogfooding-docs-strategy.md +0 -66
  130. package/docs/project/hosted-mcp-cloudflare-plan.md +0 -338
  131. package/docs/project/lessons-learned.md +0 -1019
  132. package/docs/project/remove-role-styling-plan.md +0 -176
  133. package/docs/quality.md +0 -215
  134. package/docs/react.md +0 -97
  135. package/docs/style-authoring.md +0 -133
  136. package/docs/testing-strategy.md +0 -335
  137. package/docs/theming.md +0 -162
  138. package/examples/agent-improve-auth-flow.ts +0 -206
  139. package/examples/agent-loop.ts +0 -53
  140. package/examples/mcp-vs-cli-complex-diagrams.ts +0 -133
  141. package/llms.txt +0 -104
  142. package/skill-evals/README.md +0 -77
  143. package/skill-evals/fixtures/architecture-cache/input.mmd +0 -5
  144. package/skill-evals/fixtures/class-payment/input.mmd +0 -4
  145. package/skill-evals/fixtures/er-orders/input.mmd +0 -10
  146. package/skill-evals/fixtures/flowchart-cache/input.mmd +0 -3
  147. package/skill-evals/fixtures/gantt-release/input.mmd +0 -7
  148. package/skill-evals/fixtures/journey-checkout/input.mmd +0 -6
  149. package/skill-evals/fixtures/pie-exports/input.mmd +0 -5
  150. package/skill-evals/fixtures/quadrant-priorities/input.mmd +0 -11
  151. package/skill-evals/fixtures/sequence-retry/input.mmd +0 -8
  152. package/skill-evals/fixtures/state-lifecycle/input.mmd +0 -5
  153. package/skill-evals/fixtures/timeline-release/input.mmd +0 -6
  154. package/skill-evals/fixtures/xychart-growth/input.mmd +0 -5
  155. package/skill-evals/shared-benchmark.json +0 -510
  156. package/src/agent/analyze.ts +0 -157
  157. package/src/agent/apply.ts +0 -146
  158. package/src/agent/architecture-body.ts +0 -458
  159. package/src/agent/certificates.ts +0 -110
  160. package/src/agent/class-body.ts +0 -319
  161. package/src/agent/core.ts +0 -207
  162. package/src/agent/create.ts +0 -106
  163. package/src/agent/describe.ts +0 -368
  164. package/src/agent/er-body.ts +0 -224
  165. package/src/agent/facts.ts +0 -360
  166. package/src/agent/families-builtin.ts +0 -920
  167. package/src/agent/families.ts +0 -232
  168. package/src/agent/family-layouts.ts +0 -832
  169. package/src/agent/flowchart-body.ts +0 -372
  170. package/src/agent/flowchart-unsupported.ts +0 -243
  171. package/src/agent/font-coverage.ts +0 -288
  172. package/src/agent/gantt-body.ts +0 -495
  173. package/src/agent/index.ts +0 -10
  174. package/src/agent/journey-body.ts +0 -374
  175. package/src/agent/label-metrics.ts +0 -28
  176. package/src/agent/layout-to-rendered.ts +0 -63
  177. package/src/agent/mutate.ts +0 -97
  178. package/src/agent/mutation-ops.ts +0 -51
  179. package/src/agent/op-schema.ts +0 -443
  180. package/src/agent/parse.ts +0 -223
  181. package/src/agent/pie-body.ts +0 -270
  182. package/src/agent/png.ts +0 -171
  183. package/src/agent/quadrant-body.ts +0 -336
  184. package/src/agent/quality.ts +0 -363
  185. package/src/agent/readability-audit.ts +0 -92
  186. package/src/agent/rendered-route-audit.ts +0 -61
  187. package/src/agent/sequence-body.ts +0 -345
  188. package/src/agent/serialize.ts +0 -214
  189. package/src/agent/state-body.ts +0 -589
  190. package/src/agent/structural-count.ts +0 -150
  191. package/src/agent/timeline-body.ts +0 -280
  192. package/src/agent/trace-log.ts +0 -43
  193. package/src/agent/types.ts +0 -995
  194. package/src/agent/verify.ts +0 -603
  195. package/src/agent/xychart-body.ts +0 -472
  196. package/src/architecture/config.ts +0 -282
  197. package/src/architecture/layout.ts +0 -496
  198. package/src/architecture/parser.ts +0 -375
  199. package/src/architecture/renderer.ts +0 -611
  200. package/src/architecture/types.ts +0 -113
  201. package/src/ascii/ansi.ts +0 -423
  202. package/src/ascii/architecture.ts +0 -210
  203. package/src/ascii/canvas.ts +0 -443
  204. package/src/ascii/class-diagram.ts +0 -697
  205. package/src/ascii/converter.ts +0 -475
  206. package/src/ascii/draw.ts +0 -1693
  207. package/src/ascii/edge-bundling.ts +0 -328
  208. package/src/ascii/edge-routing.ts +0 -330
  209. package/src/ascii/er-diagram.ts +0 -439
  210. package/src/ascii/gantt.ts +0 -276
  211. package/src/ascii/grid.ts +0 -747
  212. package/src/ascii/index.ts +0 -196
  213. package/src/ascii/journey.ts +0 -169
  214. package/src/ascii/meta.ts +0 -244
  215. package/src/ascii/multiline-utils.ts +0 -80
  216. package/src/ascii/pathfinder.ts +0 -301
  217. package/src/ascii/pie.ts +0 -67
  218. package/src/ascii/quadrant.ts +0 -158
  219. package/src/ascii/reverse.ts +0 -216
  220. package/src/ascii/sequence.ts +0 -499
  221. package/src/ascii/shapes/circle.ts +0 -27
  222. package/src/ascii/shapes/corners.ts +0 -143
  223. package/src/ascii/shapes/diamond.ts +0 -27
  224. package/src/ascii/shapes/hexagon.ts +0 -27
  225. package/src/ascii/shapes/index.ts +0 -106
  226. package/src/ascii/shapes/rectangle.ts +0 -168
  227. package/src/ascii/shapes/rounded.ts +0 -27
  228. package/src/ascii/shapes/special.ts +0 -332
  229. package/src/ascii/shapes/stadium.ts +0 -110
  230. package/src/ascii/shapes/state.ts +0 -192
  231. package/src/ascii/shapes/types.ts +0 -73
  232. package/src/ascii/timeline.ts +0 -141
  233. package/src/ascii/types.ts +0 -312
  234. package/src/ascii/validate.ts +0 -120
  235. package/src/ascii/width.ts +0 -81
  236. package/src/ascii/wrap.ts +0 -131
  237. package/src/ascii/xychart.ts +0 -919
  238. package/src/browser.ts +0 -29
  239. package/src/class/layout.ts +0 -240
  240. package/src/class/parser.ts +0 -332
  241. package/src/class/renderer.ts +0 -638
  242. package/src/class/types.ts +0 -129
  243. package/src/cli/agent-instructions.ts +0 -1
  244. package/src/cli/am-bin.ts +0 -6
  245. package/src/cli/exit-codes.ts +0 -18
  246. package/src/cli/index.ts +0 -1132
  247. package/src/cli/init-agent.ts +0 -147
  248. package/src/cli/run-entrypoint.ts +0 -10
  249. package/src/color-resolver.ts +0 -152
  250. package/src/elk-instance.ts +0 -114
  251. package/src/er/layout.ts +0 -187
  252. package/src/er/parser.ts +0 -226
  253. package/src/er/renderer.ts +0 -792
  254. package/src/er/types.ts +0 -99
  255. package/src/family-rubric.ts +0 -425
  256. package/src/font-manifest.ts +0 -31
  257. package/src/gantt/layout.ts +0 -365
  258. package/src/gantt/parser.ts +0 -282
  259. package/src/gantt/pipeline.ts +0 -27
  260. package/src/gantt/renderer.ts +0 -414
  261. package/src/gantt/schedule.ts +0 -513
  262. package/src/gantt/types.ts +0 -255
  263. package/src/index.ts +0 -368
  264. package/src/journey/layout.ts +0 -554
  265. package/src/journey/parse-core.ts +0 -251
  266. package/src/journey/parser.ts +0 -101
  267. package/src/journey/renderer.ts +0 -917
  268. package/src/journey/types.ts +0 -144
  269. package/src/layout/geometry.ts +0 -182
  270. package/src/layout/pass.ts +0 -142
  271. package/src/layout/passes/index.ts +0 -3916
  272. package/src/layout-engine.ts +0 -1565
  273. package/src/layout-rubric.ts +0 -659
  274. package/src/mcp/artifacts.ts +0 -137
  275. package/src/mcp/dynamic-harness.ts +0 -31
  276. package/src/mcp/dynamic-modules.d.ts +0 -7
  277. package/src/mcp/facade.ts +0 -608
  278. package/src/mcp/harness-runtime.ts +0 -203
  279. package/src/mcp/hosted-server.ts +0 -468
  280. package/src/mcp/mcp-bin.ts +0 -3
  281. package/src/mcp/mcp-cli.ts +0 -82
  282. package/src/mcp/protocol.ts +0 -13
  283. package/src/mcp/sandbox.ts +0 -195
  284. package/src/mcp/sdk-decl.ts +0 -391
  285. package/src/mcp/server.ts +0 -362
  286. package/src/mcp/tool-surface.ts +0 -146
  287. package/src/mermaid-source.ts +0 -655
  288. package/src/multiline-utils.ts +0 -228
  289. package/src/parser.ts +0 -1031
  290. package/src/pie/layout.ts +0 -168
  291. package/src/pie/parser.ts +0 -136
  292. package/src/pie/renderer.ts +0 -234
  293. package/src/pie/types.ts +0 -82
  294. package/src/quadrant/layout.ts +0 -191
  295. package/src/quadrant/parser.ts +0 -183
  296. package/src/quadrant/renderer.ts +0 -322
  297. package/src/quadrant/types.ts +0 -113
  298. package/src/render-family-hooks.ts +0 -244
  299. package/src/renderer.ts +0 -1099
  300. package/src/route-contracts.ts +0 -2723
  301. package/src/scene/backend.ts +0 -76
  302. package/src/scene/fidelity.ts +0 -183
  303. package/src/scene/hybrid-backend.ts +0 -174
  304. package/src/scene/ir.ts +0 -181
  305. package/src/scene/marks.ts +0 -127
  306. package/src/scene/rough-backend.ts +0 -378
  307. package/src/scene/seed.ts +0 -46
  308. package/src/scene/style-registry.ts +0 -556
  309. package/src/sequence/layout.ts +0 -456
  310. package/src/sequence/parser.ts +0 -255
  311. package/src/sequence/renderer.ts +0 -604
  312. package/src/sequence/types.ts +0 -154
  313. package/src/shape-clipping.ts +0 -351
  314. package/src/shared/accessibility-directives.ts +0 -22
  315. package/src/shared/batched.ts +0 -61
  316. package/src/shared/color-math.ts +0 -93
  317. package/src/shared/svg-a11y.ts +0 -29
  318. package/src/shared/syntax-error.ts +0 -17
  319. package/src/shared/unicode-ranges.ts +0 -135
  320. package/src/styles.ts +0 -318
  321. package/src/svg-paths.ts +0 -28
  322. package/src/text-metrics.ts +0 -248
  323. package/src/theme.ts +0 -710
  324. package/src/timeline/layout.ts +0 -381
  325. package/src/timeline/parser.ts +0 -215
  326. package/src/timeline/renderer.ts +0 -538
  327. package/src/timeline/types.ts +0 -105
  328. package/src/types.ts +0 -462
  329. package/src/website-worker-modules.d.ts +0 -18
  330. package/src/xychart/axis-utils.ts +0 -109
  331. package/src/xychart/colors.ts +0 -124
  332. package/src/xychart/config.ts +0 -88
  333. package/src/xychart/layout.ts +0 -656
  334. package/src/xychart/parser.ts +0 -504
  335. package/src/xychart/renderer.ts +0 -640
  336. package/src/xychart/types.ts +0 -282
package/CHANGELOG.md CHANGED
@@ -4,7 +4,146 @@ This changelog tracks user-facing changes for **Agentic Mermaid**, a fork of `lu
4
4
 
5
5
  ## Unreleased
6
6
 
7
- _No changes yet._
7
+ ## 0.1.2 — 2026-07-21
8
+
9
+ ### Fixed
10
+ - Updated the transitive `brace-expansion` development dependency to 5.0.7 so the high-severity dependency audit remains enforced without blocking CI on GHSA-3jxr-9vmj-r5cp. The override stays within `minimatch`'s declared compatible range and is exercised by the retained Stryker mutation lane.
11
+ - Completed the 0.1.2 version projection across package, hosted MCP registry, generated agent guidance, and compatibility tests; host-version assertions now derive from the package authority instead of embedding the previous release.
12
+ - Made installed-resource verification portable to Windows by applying `/proc/self/fd` and `/dev/fd` canonicalization only on Linux and macOS; other platforms retain the rooted post-open file-identity proof instead of probing a nonexistent `/dev/fd` path.
13
+ - Made the editor/website generator's local file URL conversion portable to Windows by using `fileURLToPath` instead of passing `/D:/...` URL pathnames to `Bun.build`.
14
+
15
+ ### Changed
16
+ - Simplified the published package to compiled ESM entries and removed the internal `./capabilities` and `./resources` subpaths. The supported library entries are `agentic-mermaid`, `agentic-mermaid/agent`, and the browser/workerd-safe `agentic-mermaid/agent/core`.
17
+ - Consolidated mutation testing behind `bun run mutation-test -- <profile>`, projected editor and comparison examples from the family descriptor registry, and made website/Worker generated assets clean-build outputs instead of tracked source. Older entries below retain the command spellings that shipped at the time; use `bun run mutation-test -- routes` or `bun run mutation-test -- gantt` now.
18
+
19
+ ### Added
20
+ - Implemented Section A of the rendering-contract
21
+ program: one immutable request and appearance waist, descriptor-owned
22
+ family/style/render-option discovery, typed connector terminals and backend
23
+ claims, explicit product/output parity, a version-pinned Mermaid compatibility
24
+ manifest, and versioned extension and resource contracts.
25
+ - Completed the family-elevation program across all registered families: typed mutation operations, deterministic family layout rubrics/certificates, expanded semantic facts, exhaustive configuration wire-or-warn coverage, parser/serializer conformance, and a zero-exception citizenship matrix.
26
+ - Added Flowchart v11 shape metadata and edge IDs; State notes/pseudostates/history/concurrency/paint; Sequence box/autonumber/create/destroy/standalone activation behavior; Class namespaces/generics/paint/cardinality allocation; ER bare entities/paint/ordered segments; vertical Timeline layout; Gantt dependency/critical-path overlays; XYChart legends and explicit orientation mutation; Pie wedge labels/donut/legend controls; Quadrant accessibility/style functions; deterministic side-constrained Architecture routing and offline icons; and first-class Mindmap and GitGraph families.
27
+ - Added measured bold/italic Flowchart markdown rendering and support for a bare `flowchart` header, which defaults to top-down layout while remaining source-preserved at the typed-edit boundary.
28
+ - Added a mechanically checked family-elevation ledger: all 72 original items and 18 completion packages have stable IDs, constrained statuses, ordinal work-plan correspondence, and named evidence. B01–B18 are done; final-head CI and post-fix review evidence is retained in the stable PR audit record.
29
+ - Completed the Phase 0 honesty contract with generated serializer→agent/renderer-parser properties for every family, registry-complete lossless opaque diagnostics, and a typed `StateRuntimeConfig` that wires ten faithful fields while warning on legacy, invalid, unknown, or unavailable-renderer requests.
30
+ - Added hard terminal-cell `targetWidth` rendering across library, CLI (`--target-width`), Code Mode, and hosted `render_ascii`, with typed `AsciiWidthError` diagnostics when geometry cannot fit.
31
+ - Published one all-family SVG contract: deterministic `data-id`/`data-role`, normalized relation endpoints and ARIA semantics, complete local-reference namespacing, and typed Scene identity/accessibility records.
32
+ - Added full Mindmap and GitGraph citizenship across library, CLI, Code Mode, local/hosted MCP, editor, website, docs, eval, packaging, and terminal rendering. Compatibility is pinned to Mermaid commit `f3dea58385fd5c7dd1f4e9c9c1876751ae6943cc`; all 26 Mindmap and 69 GitGraph official spec blocks are now imported, excluded, or explicitly classified in an executable revision/hash-bound oracle; generated GitGraph ids are deterministic `c<N>` values.
33
+ - Added first-class Mermaid `radar-beta` charts across SVG/PNG/ASCII/Unicode, typed mutation, Code Mode/MCP, config diagnostics, styles, docs, website samples, and executable upstream provenance. Radar supports positional/keyed curves, circle/polygon graticules, accessibility metadata, same-line whitespace statements, palette-aware areas, deterministic semantic identities, and bounded geometry configuration.
34
+ - Added focused Mindmap/GitGraph mutation lanes and exhaustive operation contracts. The latest 2026-07-10 local runs killed 400/405 Mindmap mutants (98.77%) and 294/303 GitGraph mutants (97.03%); the lanes are opt-in diagnostics without break floors or acceptance authority.
35
+ - Added official Mermaid 11.16.0 comparison fixtures and reproducible SVG/terminal contact sheets for Mindmap and GitGraph. The evidence records AlexanderGrooff/mermaid-ascii 1.4.0's exact unsupported-family result instead of fabricating equivalent output.
36
+ - Added exact executable-title evidence for every done family-elevation ledger row; CI now rejects uncited files, missing titles, duplicate IDs, empty evidence, and newly-done rows without a matching evidence entry.
37
+ - Added a pinned official Mermaid 11.16 documentation showcase for all registered families and a registry-derived exhaustive non-default Look × Palette × family compatibility gate.
38
+ - Completed the mandatory Section B public styling surface: descriptor-derived exact role records, named semantic slots, executable V1 `category` bindings, visible non-color cues, and inspect-only contrast/accent-area/mono-role constraints across SVG, PNG, and declared lossy terminal projections. Authored Mermaid paint and family semantics remain authoritative, and evidence-gated B4 BrandPack packaging remains unpromoted.
39
+ - Added `renderMermaidWithActions()` with one inert, versioned action/region sidecar across SVG, PNG, ASCII, and Unicode; exact authored source spans; family-semantic rendered regions; and expanded deterministic spacing, density, overlap, and resolved-contrast metrics across all registered families.
40
+ - Promoted the Cupertino-, Vercel-, and Cloudflare Workers-inspired research fixtures to the highest non-built-in evidence form: schema-validated public `StyleSpec` prototypes with executable family-specific fixtures, deterministic screenshots, role styles, inspect-only constraints, and semantic bindings/cues where the family exposes them. They remain documentation-only, unendorsed, and absent from built-in discovery.
41
+
42
+ ### Changed
43
+ - Canonical serialization, terminal metadata, extension discovery, capability reports, quality tie-breaking, and evaluation artifacts now use locale-independent Unicode code-point ordering instead of ambient host collation.
44
+ - Semantic binding admission now derives its explicit role union from roles with executable category consumers. Permanently inert targets such as `role: "node"` are rejected consistently by TypeScript, runtime validation, JSON Schema, generated SDK declarations, and final stack resolution.
45
+ - Exact role properties, binding-family enrollment, public role types, runtime descriptors, schema, and docs now project from one role-style contract. Brand-constraint payloads likewise project from one descriptor record into TypeScript, runtime admission, JSON Schema, diagnostics, and an exhaustive evaluator map.
46
+ - Terminal flowchart/state RL output now reverses the logical grid before text drawing instead of aliasing LR, and feedback edges can no longer enter primary fan-in/fan-out bundles and overwrite node labels in a three-node 2-cycle.
47
+ - Every continuous painted text advance—including bundled, monospace, and custom faces—now receives a deterministic SVG `textLength`/`spacingAndGlyphs` projection matching the width reserved by layout across SVG and native/browser PNG. Independently positioned multiline tspans are fitted per line, nested formatting contributes inherited metrics, and explicit emitter-owned `textLength` remains authoritative.
48
+ - Section B causal evidence now pins and executes the pre-feature commit instead of following moving `origin/main`; its receipt also hashes default, rough, and hybrid SVG+PNG sentinel probes across every registered family and links the separately approved brand-inspired prototypes.
49
+ - Retired and deleted the broad scheduled mutation matrix and its sharding/oracle machinery after 26 consecutive failed or cancelled runs. The bounded incremental counter gate and five behavior-specific sabotage probes remain automatic; family lanes are opt-in diagnostics without acceptance floors.
50
+ - Removed the accidental `cupertino` built-in registration and its private-face evidence path. Cupertino now exists only as an explicitly loaded, documentation-only public `StyleSpec` prototype; no compatibility alias is retained.
51
+ - CLI, Code Mode, local/hosted MCP, editor, website, SVG, PNG, ASCII, and
52
+ Unicode now project shared options and capabilities from canonical
53
+ descriptors. Historical execution plans moved to the archive, copied family
54
+ and style menus were removed, and Section B branding work has one live owner.
55
+ - Connector terminal evidence now preserves exact endpoints, routed contours,
56
+ hit geometry, stroke fields, label visuals, marker descriptors, and every
57
+ per-subpath marker placement behind an executable per-feature manifest.
58
+ - Local MCP `render_png` now advertises managed-file side effects accurately, accepts `fontDirs`/`loadSystemFonts`, and returns deterministic configuration and font-coverage warnings in every output mode.
59
+ - Agent evaluations, shipped-artifact fuzzing, website comparisons, fork documentation, and browser counts now cover every registered family; deployment catalogs carry the exact Git SHA and build time.
60
+ - Configuration diagnostics now use fully qualified family paths consistently across source wrappers and explicit `mermaidConfig`; duplicate warnings are deterministically ordered and deduplicated.
61
+ - Gantt calendar spans use the documented `(start, end]` exclusion boundary model and excluded-day shading is enabled by default; today markers remain caller-clocked.
62
+ - Known command-inapplicable CLI flags and value-taking flags without values now exit 2 instead of being accepted as silent no-ops.
63
+ - PNG coverage warnings now flow through local and hosted MCP renders; system-font mode reports qualified bundled-font uncertainty rather than suppressing it.
64
+ - State `nodeSpacing`, `rankSpacing`, node padding/radius/font size, composite-title size, fork dimensions, note margin, and divider margin now affect rendering. Legacy or invalid `state.*` values and unsupported renderer selections emit qualified `INEFFECTIVE_CONFIG` diagnostics through source verification, library/Code Mode callbacks, CLI SVG/PNG envelopes, and hosted SVG/ASCII/PNG tools.
65
+ - Built-in concrete palettes now normalize normal text to WCAG AA (4.5:1) and meaningful relation lines/markers to 3:1; already-compliant colors and unresolved CSS-variable palettes remain unchanged.
66
+ - Mindmap now accepts official multiline Markdown Strings, renders bold/italic spans, recognizes `layout: tidy-tree`, and fails closed on malformed reserved decorations, accessibility directives, and shape delimiters. Its bilateral layout now sizes depth columns per side and colors first-level subtrees accessibly. GitGraph now renders frontmatter titles, stabilizes equal-order lanes by source order, validates cherry-picks against full ancestry, and packs 45° commit labels/tags from measured bounds with contrast-preserving backplates and stronger branch rails.
67
+ - Editor supported-family diagnostics, characterization enrollment, and architecture documentation now derive from or are checked exactly against the runtime family registry.
68
+ - Architecture edges now use deterministic side-constrained placement and orthogonal visibility-grid routing with explicit placement/facing/obstacle certificates. State, Class, ER, and Architecture terminal output is spatial and display-cell aware; Class compact namespaces and ER ordered typed/opaque segments remain editable without stale identity references.
69
+ - **Output compatibility note:** semantic SVG identity/ARIA attributes, palette contrast normalization, corrected marker/routing geometry, and spatial terminal rendering intentionally change SVG/PNG/ASCII bytes and regenerated characterization hashes. Consumers that snapshot output bytes should review and re-pin; source parsing and deterministic repeatability remain stable.
70
+
71
+ ### Removed
72
+ - Removed five stale, unreferenced website SVG snapshots and one obsolete terminal snapshot that were copied into the public deployment despite no page consuming them. The authored `.mmd` sources remain, `workflow-themeable.svg` remains generated from the current renderer, and a build contract now rejects checked-in renderer snapshots in `website/source/diagrams`.
73
+
74
+ ### Fixed
75
+ - Prevented ASCII/Unicode action and label regions from absorbing matching text from neighboring nodes or edge labels, and from binding punctuation-only labels to box borders; multiline hit bounds now compare and claim display cells rather than UTF-16 offsets.
76
+ - Preserved the exact Style, Palette, seed, and render configuration when opening every Examples, homepage, comparison, and warning reproducer in the Editor. Examples and the Editor now share one render-state resolver, and browser coverage checks every distinct handoff shape for complete SVG and appearance parity.
77
+ - Restored public editor deep links after legacy hash decoding was removed. Website and checked-in links now share one bounded canonical deflate codec and current `palette` schema, with repository, generated-site, and real-browser navigation gates to catch producer/consumer drift before deployment.
78
+ - Prevented the editor’s Style and Palette dropdowns from flashing during startup. Idempotent initialization closes no longer trigger the visible closing animation; real open-to-closed transitions retain it.
79
+ - Corrected Class composition, aggregation, and lollipop marker anchors at both relationship ends in every layout direction. Diamond bodies now remain outside class surfaces and lollipops meet the boundary at their tangent in crisp and styled output.
80
+ - Closed editor share/draft insertion, decompression, and share-hash DOM XSS risks; hardened imported render configuration and StyleSpec prototype/font/CSS boundaries; externalized executable scripts; and removed `unsafe-inline` from the production CSP. Editor and hosted SVG rendering now force strict security and reject active content or external references.
81
+ - Closed unknown-family Flowchart fallthrough, connector-marker fidelity loss, and verified-resource time-of-check/time-of-use gaps. PNG/resource receipts now state whether bytes were verified, caller-supplied, system-provided, embedded, or unavailable.
82
+ - Closed connector topology now has one path-only invariant across SVG,
83
+ sketch, bounds, hit testing, endpoint anchors, and terminal evidence. Marker
84
+ bounds honor SVG's default `markerUnits="strokeWidth"`, use typed marker
85
+ viewports for path geometry, and no longer diverge in rough/hybrid output.
86
+ - Enforced JSON-RPC 2.0 envelopes and notification suppression across local and hosted MCP transports. Local bearer/Origin checks now cover SSE, messages, and artifacts, and SSE sessions have a fixed upper bound.
87
+ - Rejected source-controlled Pie colors that could escape SVG attributes or styles; hardened cross-format color contrast and XML sinks.
88
+ - Fixed successful-but-lossy Journey/State/Sequence/Class/ER/Architecture/Timeline/XYChart mutations and parser round trips, including accessibility metadata, history endpoints, boxed participants, labeled and generic classes, bare/aliased ER entities, post-alignment route anchors, event text containing clock-time colons, event-less Timeline periods, and explicit vertical orientation.
89
+ - Typed paint and Mindmap decoration/metadata edits now reject line/comment delimiters that would serialize into new semantic statements; empty Mindmap icon decorations are rejected instead of being accepted and dropped; successful edits are grammar-closed and round-trip stable. The pinned GitGraph oracle also AST-expands constant-loop variants, and SVG identity tests compare exact node, group, and relation tuples rather than counts/endpoints alone.
90
+ - Fixed quoted Flowchart shape labels containing their own delimiters, Unicode/CJK Flowchart identifiers, corrupt State/Class `:::class` text, ER `:::class` phantom identities, and comma-separated ER composite keys; ER display aliases now have typed `set_entity_label` mutation.
91
+ - Fixed dense self-loop route/label collisions and reserved rank clearance so loop pills cannot cover adjacent nodes or primary-chain arrowheads; also fixed grapheme-splitting label wraps, terminal formatting leakage, ER relationship glyph fidelity, and State pseudostate visuals.
92
+ - Finished grapheme/display-cell writes and measurements in Class, ER, Sequence blocks, Flowchart subgraphs, Pie, Quadrant, XYChart, validation, and TUI metadata; ER attribute comments are visible in terminal output.
93
+ - Replaced Flowchart start-arrow reliance on `auto-start-reverse` with explicit pre-rotated geometry and balanced start/end cross-marker reference points, verified at raster pixels.
94
+ - Fixed blank ER diagrams becoming opaque after ordered-segment promotion, preserving header-only ER as a structured typed-authoring canvas while keeping opaque-only tolerated subgraphs lossless.
95
+ - Fixed label-less ER relations being silently dropped, XYChart `backgroundColor` being lost during PNG rasterization, and long Quadrant axis labels overprinting beyond their half-plot budgets.
96
+ - Replaced delimiter-concatenated Mindmap/GitGraph Scene IDs with injective semantic identities, rejected already-reachable GitGraph cherry-picks, and aligned equal-order branch lanes across SVG and terminal renderers.
97
+ - Closed the Radar audit gaps in public synthesis validation, upstream title/comment/options grammar, Style-face-aware measurement, independent frame dimensions, theme paint/typography propagation, styled-backend opacity, empty-curve ASCII output, tick geometry, and duplicate-ID stability.
98
+
99
+ ### Breaking
100
+ - Removed the deprecated compatibility layer across library, agent, CLI, MCP,
101
+ editor, Style, Scene, and SVG surfaces. Library callers must use
102
+ `renderMermaidSVG` / `renderMermaidSVGAsync`, `renderMermaidASCII`, and
103
+ `parseRegisteredMermaid`; `AsciiWidthError.requestedWidth` replaces
104
+ `targetWidth`. The browser PNG raster callback no longer receives `scale`.
105
+ Agent callers must use `FlowchartMutationOp`, required Sequence statements,
106
+ and canonical message endpoint data instead of the removed mutation/type
107
+ aliases and projections.
108
+ - CLI and MCP inputs now accept canonical spellings and nesting only: use
109
+ `am render --format ascii`, batch `format: "ascii"`, layout
110
+ `--format layout`, and `agentic-mermaid-mcp --transport http`. MCP render
111
+ appearance belongs under canonical nested options; hosted SVG uses
112
+ `palette`, not `theme`. Removed and unknown MCP flags now fail closed instead
113
+ of silently starting stdio.
114
+ - Style discovery no longer exposes `THEMES`, compatibility-alias registration,
115
+ `default`, bare `tufte`, or dormant Style aliases. Use `crisp` and the
116
+ canonical-only `look:tufte`. Editor share links are deflate-only, accept
117
+ `palette` only, and drafts persist in `sessionStorage` for the current tab;
118
+ old plain-base64 links and persistent draft controls are not migrated.
119
+ - Scene contract v2 removes public crisp/raw/prelude serialization carriers and
120
+ duplicate connector geometry/paint/marker fields. Connector marks and private
121
+ serialization sidecars are the sole authorities. External Scene families and
122
+ backends must declare `identity.compatibility.scene: "^2.0.0"`; v1 ranges are
123
+ rejected before callbacks run. The render receipt, Scene validation, family
124
+ descriptor, family conformance, and backend conformance generations were
125
+ advanced with the incompatible schemas.
126
+ - Default SVG rendering no longer embeds font imports, an explicit empty
127
+ `idPrefix` is invalid, registered ASCII routing requires `routeClass`, opaque
128
+ State bodies use the canonical layout result, and unknown render failures use
129
+ one generic diagnostic instead of transport-specific fallbacks. Consumers
130
+ relying on historical SVG byte order, legacy ARIA/data-entity projections, or
131
+ built-in Scene object identity must migrate to the typed canonical contracts.
132
+ - The duplicate light Tufte palette (`palette:tufte` and legacy theme `tufte`) and the ambiguous bare `tufte` Style input are removed and now fail as unknown. Use the sole light Tufte resource, `look:tufte`; the distinct `tufte-dark` palette is unchanged.
133
+ - Consumers matching `INEFFECTIVE_CONFIG.field` for family-section keys must use the qualified path (for example `journey.boxMargin` rather than `boxMargin`).
134
+ - Gantt exclusion-boundary semantics and default shading may change existing rendered calendars; CLI scripts relying on ignored known flags now fail fast with exit 2.
135
+ - The transitional `FamilyPlugin` type alias has been removed; extension hosts should import `FamilyDescriptor`, which is the canonical registration and discovery contract.
136
+ - Extension registration is now collision-safe and versioned. External families
137
+ use `family:*` identities and complete descriptors; external Scene backends
138
+ use `backend:*` identities, declare feature/operation capability evidence,
139
+ and pass executable conformance at registration instead of silently replacing
140
+ a prior implementation.
141
+ - Declarative `StyleSpec.backend` has been removed. Style data now selects only safe appearance; trusted hosts that install executable Scene backends select them through `createMermaidRenderer`, `createMermaidPNGRenderer`, or `createMermaidBrowserPNGRenderer` with a host-only `backendPolicy`.
142
+ - External Scene v1 path connectors now accept only one linear `M`/`L`/`Z`
143
+ contour whose vertices exactly match typed points; use polyline or await a
144
+ future curve-flattening contract instead of supplying divergent SVG and hit
145
+ geometry. The serializer-only `MarkerSerializationOptions.markerUnits`
146
+ override was removed; set units on the marker descriptor, the sole authority.
8
147
 
9
148
  ## 0.1.1 — 2026-07-10
10
149
 
@@ -14,13 +153,14 @@ _No changes yet._
14
153
  ## 0.1.0 — 2026-07-09
15
154
 
16
155
  ### Added
156
+ - **Journey and output-family foundation.** Journey gained deterministic geometry/paint and accessibility-aware rendering; ASCII/Unicode output became a first-class cross-family surface; PNG switched to bundled Inter metrics with DejaVu per-glyph fallback and introduced the public warning vocabulary used by verification/render tooling.
17
157
  - **Validated declarative edit boundary + `mutate`/`build` hosted MCP tools.** The untyped MCP/CLI JSON boundary now shape-validates every op before the mutator (field presence, primitive type, enum membership across all 12 families), so a malformed op — e.g. `add_class {name:'Duck'}` where `id` is expected — returns a prescriptive `INVALID_OP` naming the offending field and listing the valid ones, instead of silently producing `class undefined`. One choke point (`mutateChecked`) backs every untyped path: the new hosted `mutate` (edit a `source`) and `build` (author from a `family`) tools, the Code Mode facade, and the CLI `--op`/`--ops`. All return one canonical envelope `{ ok, family, source, verify }`. Code Mode `execute` now also marshals a returned diagram (or `Result` wrapping one) to that same envelope rather than failing "non-serializable"; other unserializable returns get a prescriptive plain-data hint.
18
158
  - **Blank-slate authoring on the typed path: `createMermaid(kind)` / `buildMermaid(kind, ops)`** (from direct agent feedback). `createMermaid` returns an empty structured `ValidDiagram` for any built-in family (overloads narrow the return per kind; `direction` option for flowchart/state); `buildMermaid` folds a typed mutation list over that empty diagram, with errors carrying the failing op's `opIndex`. Exposed in the library (`agentic-mermaid/agent`), the Code Mode `mermaid.*` SDK (results are trusted inputs to `mutate`/`verify`/`serialize`), and the SDK declaration. Creating a new diagram no longer requires hand-writing Mermaid source. To let empty diagrams be built up op by op, the journey/xychart "structured floor" now refuses only mutations that would *empty a non-empty* body, and the ER serializer emits label-less relations as `: ""` so they re-parse structured instead of falling back to opaque.
19
159
  - **Repo-wide fast-check seed policy**: every property suite now runs at one pinned global seed via a `bun test` preload (`src/__tests__/fc-seed.preload.ts`; `AM_FC_SEED=<int>` reproduces a specific roll, `AM_FC_SEED=random` restores finder-mode randomness). Suite-scoped seed overrides save/restore the global config instead of resetting it, and two meta-gates keep the policy from silently un-landing (a preload-wiring test plus an end-of-alphabet epilogue). Landed after a 1,368-run sweep (48/24/12 seeds per suite, scaled by runtime) found zero latent seed-dependent failures. Completes the determinism policy from the 2026-07 audit, which had been applied incident-by-incident to three suites (see `docs/testing-strategy.md` §4).
20
160
  - **Label-collision detection and gating (`eval/overlap-audit/`)**: an SVG-level overlap auditor (text boxes measured with the renderer's own text metrics, ownership from SVG group metadata or containment, rotation-aware, off-canvas detection) with a curated-corpus gate, deterministic 12-family fuzz generators, and a CI gate (`label-overlap-gate.test.ts`) holding the corpus at zero findings with per-family fuzz ratchets. Labels were previously unmeasured in every family.
21
161
  - **Certificate completeness is now a deterministic gate**: `certificate-completeness.test.ts` pins that every edge leaves the pipeline certified (tracked corpus + shrunk repros + fixed-seed duplicate-edge sweep), and the route-contracts property suite runs at a pinned fast-check seed instead of flaking ~1 CI run in 7.
22
162
  - **Scoped mutation lane for the link-rank packing repair** (`stryker.linkrank.config.json`), harvested from 49.86% to 65.07% via geometry-characterization snapshots; residual classified in `docs/mutation-testing.md`.
23
- - **Hosted MCP on Cloudflare** (`https://agentic-mermaid.dev/mcp`): the website Worker now serves a stateless Streamable HTTP MCP endpoint (JSON-RPC over POST, no sessions/SSE) with six tools — `execute`, `render_svg`, `render_ascii`, `render_png`, `verify`, `describe`. Code Mode `execute` runs agent JavaScript in per-code Dynamic Worker isolates (Worker Loader binding; `globalOutbound: null`, empty env, `cpuMs` budget, `subRequests: 0`) against the same hardened `mermaid.*` facade as the local vm sandbox — semantics pinned by a differential test suite (`hosted-execute-differential.test.ts`), with two documented divergences (CPU-time vs wall-clock budgets; strict-module vs sloppy-vm implicit globals). Hosted `render_png` uses `@resvg/resvg-wasm` (pinned to the napi version) with the bundled DejaVu fonts and is documented as outside the byte-determinism contract. Deterministic `tools/call` responses are edge-cached (Cache API keyed on a hash of the canonicalized call), request bodies cap at 128KB and tool inputs at 64KB, and sync-only violations are rejected before any isolate spins. Transport guards: reflective CORS with Origin validation, `MCP-Protocol-Version` validation, and a batch fan-out cap. The `mermaid.*` Code Mode facade moved to runtime-neutral modules (`src/mcp/facade.ts`, `src/mcp/harness-runtime.ts`; `src/agent/core.ts` is the pure barrel without the napi PNG dependency) shared by the vm sandbox, the isolate harness, and the hosted server core (`src/mcp/hosted-server.ts`). The local stdio/HTTP MCP server is unchanged. Also fixes ELK instantiation under Cloudflare workerd (`src/elk-instance.ts` now flips elk-worker's environment sniff by temporarily defining `document` instead of deleting the undeletable `self`).
163
+ - **Hosted MCP on Cloudflare** (`https://agentic-mermaid.dev/mcp`): the website Worker now serves a stateless Streamable HTTP MCP endpoint (JSON-RPC over POST, no sessions/SSE) with six tools — `execute`, `render_svg`, `render_ascii`, `render_png`, `verify`, `describe`. Code Mode `execute` runs agent JavaScript in content-addressed Dynamic Worker isolates (Worker Loader binding; `globalOutbound: null`, empty env, `cpuMs` budget, `subRequests: 0`) against the same hardened `mermaid.*` facade as the local vm sandbox — semantics pinned by a differential test suite (`hosted-execute-differential.test.ts`), with two documented divergences (CPU-time vs wall-clock budgets; strict-module vs sloppy-vm implicit globals). Hosted `render_png` uses `@resvg/resvg-wasm` (pinned to the napi version) with the bundled DejaVu fonts and is documented as outside the byte-determinism contract. Eligible deterministic pure-tool results may be reused through a private Workers Cache API compute cache; JSON-RPC responses remain `cache-control: no-store`, and non-idempotent `execute` bypasses the cache. Request bodies cap at 128KB and tool inputs at 64KB, and sync-only violations are rejected before any isolate spins. Transport guards: reflective CORS with Origin validation, `MCP-Protocol-Version` validation, and a batch fan-out cap. The `mermaid.*` Code Mode facade moved to runtime-neutral modules (`src/mcp/facade.ts`, `src/mcp/harness-runtime.ts`; `src/agent/core.ts` is the pure barrel without the napi PNG dependency) shared by the vm sandbox, the isolate harness, and the hosted server core (`src/mcp/hosted-server.ts`). The local stdio/HTTP MCP server is unchanged. Also fixes ELK instantiation under Cloudflare workerd (`src/elk-instance.ts` now flips elk-worker's environment sniff by temporarily defining `document` instead of deleting the undeletable `self`).
24
164
  - **Layout-certificate closure for #26/#38**: `layoutMermaid(d, { debug: true })` and `am render --format json --certificates` now expose opt-in graph route certificates plus accepted family certificates for class/ER (`orthogonal-box`), architecture (`side-anchored`), sequence (`lifeline-message`/`self-message` with real self-loop geometry), and timeline/xychart/pie/quadrant/Gantt containment layouts. Default layout JSON remains certificate-free. Route certificates now include exact ports plus additive side/slot/role assignments, and ELK `FIXED_SIDE` hints are fed only for safe primary-forward edges whose endpoints are not incident to non-primary routes or direction-override subgraphs.
25
165
  - **Agent analysis and region/action sidecars**: `analyzeMermaid` / `analyzeMermaidSource` expose deterministic feedback-edge facts, source-only action records (unsafe `javascript:`/`data:`/`vbscript:` links marked unsafe, never executed), and Gantt critical-path/slack summaries. Debug layout JSON can include V1 `regions` and source-only `actions` sidecars for UI/tooling alignment; label regions now bound the label around its center rather than treating the center as a top-left corner.
26
166
  - **Port ranking** (issue #26 WS3, completing the yFiles cost model): a shape side carrying exactly one line uses its canonical port — for diamonds, the exact vertex; when no straight vertex lane exists, a single proof-gated Z from the vertex into the target's port outranks a straight lane floating on the facet (lines emit from points, upgraded back to straight by the fixed-point loop when obstacles move). Sides carrying several lines spread along the facet/flat region; fan-ins still merge at the target port; sharper shapes win conflicts and the source wins ties. Verified across all four directions, bi-directional pairs, and diamond-to-diamond chains by tests and the rubric battery. An unlabeled reciprocal pair (A→B with B→A) renders as **two equal parallel lines** straddling the shared centerline at `center ± 6` (primary low, feedback high) — equal deviation gives equal lengths on diamond facets, the way dot offsets reciprocal splines symmetrically about the spine; both pair members enroll in the fixed-point repair pool even when already straight, and any straightening that won on a non-preferred lane (an *upgradeable* success) is re-proved each round so the symmetric lane wins once the partner's geometry settles. Port-only shapes (circles) keep both lines on the exact port. A blocked vertex emit now prefers a **1-bend hook** into the target's *facing* cross-side port (the box's top/bottom in horizontal flow — the IBM flowcharting-manual entry) over the 2-bend Z into the flow-side port; an available fan-in merge at the flow-side port (shared arrowhead) outranks the hook, and a stub shorter than 8px keeps the Z. **Port-lane alignment** (`alignPortLanes`): a "straight but off both midpoints" edge — floating through the sliver where two side-spans overlap because ELK's balanced placement aligned the node with neither neighbor — is now fixed at the placement stage: one endpoint node slides along the cross axis so the two midpoint ports share a lane (port-aware coordinate assignment, Rüegg et al. GD'15), making the edge straight AND port-exact with no routing trade. Slides are proof-gated (shared lane clear of intermediate nodes; sibling edges bent with a perpendicular segment to absorb the shift, labels following translated runs; no node/corridor/label-pill collisions; no group members; aligned endpoints frozen against later re-breaking). The pass covers the whole PORT_EXACT shape catalog — circles, stadiums, hexagons, cylinders, pseudostates, and diamonds slide too (for port-only shapes this converts a forced 2-bend Z into a port-to-port straight; a source diamond with a fan-out never aligns, its vertex has capacity 1; stretched perpendicular segments are proved node-free across their swept corridor) — and an explained detour whose entry lands off-port now seeks a port-exact Z, so the edge left behind by an alignment still converges at the shared entry port. Docs-corpus effect: straight edges 97→101, multi-bend routes 7→5, port-exact endpoints 76.0%→78.2%. **Active fan-in centering**: an unlabeled equal-rank peer fan-in (≥2 distinct unlabeled forward sources stacked in one layer) now snaps the hub to the exact cross-axis barycenter of its sources — correcting ELK's ~20px Brandes–Köpf placement drift — so the incoming edges converge **mirror-symmetric** at the hub's single exact port instead of the old one-straight/one-Z asymmetry. Proof-gated (no node/corridor/label-pill collision; hub not in a group, not also emitting a forward edge; ELK-gridded large fan-ins correctly out of scope). Exact symmetry (0.00px barycenter error, ≤1.5px clipping floor on curved shapes) with zero hard-metric regressions; the trade is +2 bends per fan-in. The L–V contact-sheet scenarios now demonstrate the symmetric merge across every shape. **Diamond facet-mid ports (the 8-port model)**: diamonds gain four extra designated ports at their facet midpoints (NE/SE/SW/NW, all on the outline; `diamondFacetPorts`, recognized by `portAt`, certificates widen to `AnyPort`). Three uses: a diamond fan-out of two forward edges attaches them at the NE/SE facet-mids and slides the targets onto those lanes for **port-to-port straight** edges (E; the vertical case F correctly bails when the targets are too wide to align); a diamond↔diamond reciprocal pair attaches at the nearest facing facet-mids — two parallel lines *between* the diamonds, never through them (G); and a side input below a diamond whose facing port is claimed enters the **S vertex** instead of floating on the facet (K). `shapePorts` stays four-cardinal for every shape and `portAt` is byte-identical for non-diamonds, so this is strictly additive. Heuristic tracker (`bun run track`): 6 improvements, 0 regressions, 0 hard violations across 51 examples. The canonical scenarios are pinned as a **contact sheet** (`bun run contact:sheet` renders lettered scenarios A–S from `eval/visual-rubric/scenarios.ts`; `contact-sheet.test.ts` snapshot-pins each scenario's geometry and asserts zero hard rubric metrics, making the sheet a CI visual-regression gate, now A–V). **Parallelogram shapes** `[/text/]` and `[\text\]` (Mermaid lean_right/lean_left — the ISO 5807 input/output symbol) now parse, render, serialize, and round-trip correctly (previously misparsed as trapezoid/rectangle), and the whole slanted family — parallelograms, trapezoids, the asymmetric flag — joined the PORT_EXACT catalog: exact ports at the true side midpoints (slant midpoints / flag point), flat-side attachment spans, convex-polygon clipping, exact rubric outline oracles, randomized property coverage, and contact-sheet scenarios T–V. `verifyMermaid` gains the Tier-3 `DECISION_BRANCH_UNLABELED` lint (ISO 5807 10.3.1.2 / ANSI X3.5 4.10.2: every exit of a multi-exit decision shall be labeled with its condition value).
@@ -59,7 +199,7 @@ _No changes yet._
59
199
  - Style + Palette SVG styling via named looks, palette stacks, custom public JSON style records, and deterministic `seed` values.
60
200
  - Style + Palette showcase samples in the live examples surface.
61
201
  - Fork documentation describing differences from upstream in [`docs/fork-differences.md`](./docs/fork-differences.md).
62
- - Product/design context documents ([`docs/project/product.md`](./docs/project/product.md), [`docs/project/design.md`](./docs/project/design.md)) for future design-system aligned work.
202
+ - Historical product/design context documents ([`docs/project/product.md`](https://github.com/adewale/agentic-mermaid/blob/8516976c679dccf758e68d47e7969c9b58ed3cb7/docs/project/product.md), [`docs/project/design.md`](https://github.com/adewale/agentic-mermaid/blob/8516976c679dccf758e68d47e7969c9b58ed3cb7/docs/project/design.md)) for future design-system aligned work.
63
203
  - Homepage sample search and category filters for browsing the full showcase.
64
204
  - Mobile editor pane switching for Code, Config, Preview, and Examples.
65
205
  - **Package-surface property fuzzing** (`src/__tests__/property-cli-surface-fuzz.test.ts`, `property-mcp-surface-fuzz.test.ts`): fast-check now drives the agent-facing package entry points that previously had only example-based coverage — the CLI argv parser (`parseArgs`, total-shape + verbatim-flag invariants), the `am batch` line handler (`runBatchLine`) and markdown-block renderer, and the MCP JSON-RPC router (`handleRequest`) plus the Code-Mode `execute` sandbox (`executeInSandbox`). The contract under test: a malformed request or hostile code yields a structured error / `{ok:false}` result, never an unhandled crash that would take down the stdio/HTTP server. These are crash-freedom/contract guards that would catch a future regression, complementing the engine-level parser fuzzing in `property-crash-freedom.test.ts`.
@@ -70,7 +210,7 @@ _No changes yet._
70
210
  - **0.1.0 release prep**: README, Getting started, and the generated website install card now make `npm install agentic-mermaid` the primary path; source-checkout instructions remain for repository development and pre-publish previews can still force source-install copy with `SITE_NPM_STATUS=source` or `SITE_NPM_PUBLISHED=0`.
71
211
  - **`LABEL_OVERFLOW` now measures the rendered label, not raw source chars** (from direct agent feedback: the cap counted `<br/>` tags and `&#160;` entities toward the 40-char limit, flagging legitimately-fine multi-line labels). The cap now applies to the longest *displayed* line — XML entities decode to one character, `<br>`/`\n` split lines, and formatting tags (`<b>`, `<i>`, …) are stripped — mirroring what the SVG renderer draws. `charCount` in the warning payload reports the rendered length. Applies to every family and to the opaque-body label extractors.
72
212
  - The local HTTP MCP startup line now names the plain-JSON `/rpc` endpoint alongside `/sse`, and `docs/mcp-http-transport.md` spells out which endpoints reply with SSE framing vs. plain `application/json` (from direct agent feedback: a script POSTing to the SSE session flow had to strip `data:` framing by hand).
73
- - The website MCP and security pages now carry an explicit privacy note: hosted tool calls send diagram source/code to the server and successful responses are edge-cached; local library/CLI/stdio need no network.
213
+ - The website MCP and security pages now carry an explicit privacy note: hosted tool calls send diagram source/code to the server; eligible pure-tool results may be reused by a private server-side compute cache while HTTP responses remain `no-store`; local library/CLI/stdio need no network.
74
214
  - BUILD-20 now has a checked cross-family upstream parser/DB harvest under `eval/mermaid-upstream-suite-bench/` with a pinned Mermaid revision (`a2d9686451df7c4644a3eeca20535bbd4c5776b0`), repeatable `harvest:upstream` and `harvest:upstream:refresh-check` commands, exact structural assertions, BUILD-20 ownership on local compatibility exclusions, and a family-by-family manifest accounting for all 1,170 considered upstream parser/DB blocks: 658 imported source blocks, 512 documented exclusions, and 0 deferred blocks. The executable gate covers 648 cases including the existing 68-case Gantt companion bench, and `ratchet.json` fails CI if imported coverage drops or local-gap budgets grow.
75
215
  - **Breaking (unreleased agent surface, BUILD-19): flowchart ops no longer apply to state diagrams.** `asFlowchart` now returns `null` on a state diagram (its body kind is `'state'`, not `'flowchart'`); narrow with `asState` and use the state-shaped ops instead. The CLI `MUTATION_OPS_BY_FAMILY.state` list changed from the 6 flowchart ops to the 8 new state ops, and `mutateAny` narrows `asState` before `asFlowchart`. Every agent surface that said "state shares the flowchart body / narrow via asFlowchart" is updated to the new truth.
76
216
  - SVG appearance customization now uses Style + Palette render options; removed flat render style aliases are intentionally ignored.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -25,27 +25,27 @@ Use it when you want to describe a diagram in plain language and get back someth
25
25
  | An agent to draft the diagram | Mermaid source plus a verified render path |
26
26
  | Beautiful defaults | Built-in looks such as `watercolor`, `blueprint`, `hand-drawn`, and `publication-figure` |
27
27
  | Brand fit | Style + Palette stacks and custom JSON palettes you can keep in your repo |
28
- | Safe edits later | `parseMermaid` → family narrower → `mutate` → `verifyMermaid` → `serializeMermaid` |
28
+ | Safe edits later | `parseRegisteredMermaid` → family narrower → `mutate` → `verifyMermaid` → `serializeMermaid` |
29
29
  | Reviewable artifacts | SVG, PNG, ASCII, Unicode, and JSON layout from the same source |
30
30
 
31
31
  The agent workflow is the guardrail behind the polish: agents should not guess from pixels, concatenate strings, or regenerate whole diagrams when a structured edit is available.
32
32
 
33
33
  ## Highlights
34
34
 
35
- - **12 diagram families** — flowchart, state, architecture, sequence, class, ER, timeline, journey, XY chart, pie, quadrant, and Gantt.
36
- - **SVG, PNG, ASCII, Unicode, JSON** — one deterministic layout foundation for docs, decks, terminals, and agent workflows.
35
+ - **Descriptor-registered diagram families** — built-ins and namespaced extensions share one discovery and capability contract.
36
+ - **SVG, PNG, ASCII, Unicode, JSON** — one resolved request with explicit graphical, terminal, and positioned-layout projections.
37
37
  - **Synchronous, zero-DOM SVG renderer** — no Puppeteer, no browser flash.
38
- - **Composable styles** — `{ style: ['hand-drawn', 'dracula'] }` stacks a look over a palette; 15 full looks cover sketch, watercolor, blueprint, accessibility, print, operational, physical-media, architecture, and editorial/report use cases. Custom styles are plain JSON records any agent can author (`docs/style-authoring.md`). `seed` re-rolls the ink, never the layout.
39
- - **21 built-in themes + Shiki compatibility** — a theme is a palette-only style: theme from two colors or a VS Code theme.
40
- - **Agent-native editing** — typed mutation for all twelve renderable families (flowchart/state, sequence, timeline, class, ER, journey, architecture, XY chart, pie, quadrant, Gantt); source-level round-trip only for opaque fallbacks (unmodeled syntax).
41
- - **CLI + MCP + library** — `am`, `agentic-mermaid-mcp`, `agentic-mermaid`, and `agentic-mermaid/agent`.
38
+ - **Composable styles** — `{ style: ['hand-drawn', 'dracula'] }` stacks a look over a palette; discoverable full looks cover sketch, watercolor, blueprint, accessibility, print, operational, physical-media, architecture, and editorial/report use cases. Custom styles are plain JSON records any agent can author (`docs/style-authoring.md`). `seed` re-rolls the ink, never the layout.
39
+ - **Discoverable palettes + Shiki compatibility** — a theme is a palette-only style: discover the canonical catalog at runtime, theme from two colors, or adapt a VS Code theme.
40
+ - **Agent-native editing** — typed mutation for every registered renderable family; source-level round-trip only for opaque fallbacks containing unmodeled syntax.
41
+ - **CLI + MCP + library** — `am`, `agentic-mermaid-mcp`, `agentic-mermaid`, `agentic-mermaid/agent`, and the browser/workerd-safe `agentic-mermaid/agent/core`. Audit reports and trusted host-resource helpers remain repository tooling instead of published runtime entry points.
42
42
 
43
43
  ## Installation
44
44
 
45
45
  ```bash
46
46
  npm install agentic-mermaid # or: bun add agentic-mermaid / pnpm add agentic-mermaid
47
- am --help
48
- agentic-mermaid-mcp
47
+ npx --no-install agentic-mermaid --help
48
+ npx --no-install agentic-mermaid mcp
49
49
  ```
50
50
 
51
51
  For repository development, install from source and run the Bun entrypoints:
@@ -62,8 +62,10 @@ bun run bin/agentic-mermaid-mcp.ts # MCP stdio server
62
62
  > **ESM-only.** `agentic-mermaid` ships ES modules (there is no CommonJS build);
63
63
  > `require()` consumers should use dynamic `import()` instead. Requires Node ≥ 18.
64
64
  >
65
- > The `am …` commands shown below assume the published bin. From a source
66
- > checkout, run them as `bun run bin/am.ts …` instead.
65
+ > The `am …` examples below name the published bin. After a project-local npm
66
+ > install, invoke it from a shell as `npx --no-install agentic-mermaid …` (or
67
+ > from an npm script as `am …`). From a source checkout, use
68
+ > `bun run bin/am.ts …` instead.
67
69
 
68
70
  ## Output quick starts
69
71
 
@@ -136,17 +138,17 @@ For multi-step MCP edits, connect `agentic-mermaid-mcp` and use Code Mode `execu
136
138
 
137
139
  Agentic Mermaid ships a Model Context Protocol server so MCP-capable agents can render and safely edit diagrams without shelling out.
138
140
 
139
- - **Self-hosted (default).** `agentic-mermaid-mcp` runs a stdio server exposing `execute` (Code Mode sandbox), `render_png`, and `describe`. Package runners can use `npx -y agentic-mermaid mcp`; the `mcp` argument routes the package-name binary to the same stdio server. Add `--transport http` for HTTP/SSE with managed PNG file/URL artifacts. See [`docs/mcp-http-transport.md`](./docs/mcp-http-transport.md) and [`docs/mcp-code-mode-rationale.md`](./docs/mcp-code-mode-rationale.md).
140
- - **Hosted.** A stateless Streamable HTTP endpoint is available at `https://agentic-mermaid.dev/mcp` (tools: `execute`, `render_svg`, `render_ascii`, `render_png`, `verify`, `describe`, `mutate`, `build`; 64 KB input caps). It is MCP JSON-RPC only, not a REST render API. Hosted `execute` runs the same `mermaid.*` facade in a Cloudflare Dynamic Worker isolate with no network; hosted PNG returns base64 only.
141
+ - **Self-hosted (default).** `agentic-mermaid-mcp` runs a stdio server exposing `execute` (Code Mode sandbox), `describe_sdk` (one family's mutation schema on demand), `render_png`, and `describe`. Package runners can use `npx -y agentic-mermaid mcp`; the `mcp` argument routes the package-name binary to the same stdio server. Add `--transport http` for HTTP/SSE with managed PNG file/URL artifacts. See [`docs/mcp-http-transport.md`](./docs/mcp-http-transport.md) and [`docs/mcp-code-mode-rationale.md`](./docs/mcp-code-mode-rationale.md).
142
+ - **Hosted.** A stateless Streamable HTTP endpoint is available at `https://agentic-mermaid.dev/mcp` (tools: `execute`, `describe_sdk`, `render_svg`, `render_ascii`, `render_png`, `verify`, `describe`, `mutate`, `build`; 64 KB input caps). Call `describe_sdk` for compact signatures or exact fields before authoring unfamiliar ops. It is MCP JSON-RPC only, not a REST render API. Hosted `execute` runs the same `mermaid.*` facade in a Cloudflare Dynamic Worker isolate with no network; hosted PNG returns base64 only.
141
143
 
142
144
  Local-first is the default posture: prefer the library, CLI, or a self-hosted MCP for anything sensitive, offline, larger than the hosted caps, or needing local PNG file/URL artifacts. The hosted endpoint is a public, unauthenticated convenience for zero-install render/verify/describe and bounded structured edits.
143
145
 
144
146
  ## Structured edit example
145
147
 
146
148
  ```ts
147
- import { parseMermaid, asFlowchart, mutate, verifyMermaid, serializeMermaid } from 'agentic-mermaid/agent'
149
+ import { parseRegisteredMermaid, asFlowchart, mutate, verifyMermaid, serializeMermaid } from 'agentic-mermaid/agent'
148
150
 
149
- const parsed = parseMermaid('flowchart TD\n API --> DB')
151
+ const parsed = parseRegisteredMermaid('flowchart TD\n API --> DB')
150
152
  if (!parsed.ok) throw new Error('parse failed')
151
153
 
152
154
  const flow = asFlowchart(parsed.value)
@@ -163,36 +165,27 @@ const source = serializeMermaid(next.value)
163
165
 
164
166
  Rules:
165
167
 
166
- - Use `asFlowchart` / `asState` / `asSequence` / `asTimeline` / `asClass` / `asEr` / `asJourney` / `asArchitecture` / `asXyChart` / `asPie` / `asQuadrant` / `asGantt` before mutating existing diagrams.
168
+ - Use the matching exported `as<Family>` narrower before mutating an existing structured diagram.
167
169
  - Mutation ops use `kind`, not `type`.
168
170
  - Run `verifyMermaid` before every commit point.
169
171
  - Do not call `mutate` on opaque fallback bodies; the narrower returns `null` for unmodeled syntax.
170
172
 
171
173
  ## Supported diagram families
172
174
 
173
- | Family | Parse | Verify | Render | Structured mutate |
174
- |---|---:|---:|---:|---:|
175
- | Flowchart / state | ✓ | ✓ | SVG/PNG/ASCII | ✓ |
176
- | Sequence | ✓ | ✓ | SVG/PNG/ASCII | simple messages/participants |
177
- | Timeline | ✓ | ✓ | SVG/PNG/ASCII | ✓ |
178
- | Class | ✓ | ✓ | SVG/PNG/ASCII | ✓ |
179
- | ER | ✓ | ✓ | SVG/PNG/ASCII | ✓ |
180
- | Journey | ✓ | ✓ | SVG/PNG/ASCII | modeled subset (BUILD-15) |
181
- | XY chart | ✓ | ✓ | SVG/PNG/ASCII | modeled subset (BUILD-16) |
182
- | Pie | ✓ | ✓ | SVG/PNG/ASCII | ✓ |
183
- | Quadrant | ✓ | ✓ | SVG/PNG/ASCII | ✓ |
184
- | Architecture | ✓ | ✓ | SVG/PNG/ASCII | modeled subset (BUILD-17) |
185
- | Gantt | ✓ | ✓ | SVG/PNG/ASCII | sections/tasks; calendar directives ride along verbatim |
186
-
187
- See [diagram families](./docs/diagram-families.md) for examples and compatibility notes.
175
+ Family support and its executable evidence are projected from the
176
+ `FamilyDescriptor` registry into the generated
177
+ [Section A capability report](./docs/project/section-a-capability-report.md).
178
+ See [diagram families](./docs/diagram-families.md) for syntax examples and
179
+ compatibility notes.
188
180
 
189
181
  ## More documentation
190
182
 
191
- - [System architecture](./docs/design/system/README.md) — **start here** for how the engine works: the rendered three-stacks overview (dogfooded, drift-proof) routing to the design and route-contract docs.
183
+ - [System architecture](./docs/design/system/README.md) — **start here** for the rendered resolved-request, family-descriptor, positioned-artifact, and output-security overview (dogfooded, drift-proof).
192
184
  - [API reference](./docs/api.md) — renderers, agent API, options, CLI/MCP pointers.
193
185
  - [Agent API cookbook](./docs/agent-api-cookbook.md) — practical recipes for agents.
194
186
  - [Theming](./docs/theming.md) — two-color themes, built-ins, Shiki compatibility.
195
187
  - [Custom style cookbook](./docs/custom-style-cookbook.md) — JSON style files, screenshots, schema usage, and CLI commands.
188
+ - [Fonts in custom styles](./docs/custom-fonts.md) — font selection, SVG declarations, PNG directories, fallbacks, and browser usage.
196
189
  - [React integration](./docs/react.md) — zero-flash `useMemo` rendering.
197
190
  - [ASCII output](./docs/ascii.md) — terminal output, color modes, XY charts.
198
191
  - [Mermaid config](./docs/config.md) — frontmatter, init directives, runtime config.
@@ -0,0 +1,29 @@
1
+ # Third-party notices
2
+
3
+ ## Material Design Icons (curated Architecture icon paths)
4
+
5
+ A size-bounded subset of SVG path data in `src/architecture/icons.ts` is
6
+ derived from **@iconify-json/mdi 1.2.3**, the Iconify packaging of Material
7
+ Design Icons.
8
+
9
+ - Source: <https://www.npmjs.com/package/@iconify-json/mdi/v/1.2.3>
10
+ - Upstream project: <https://github.com/Templarian/MaterialDesign>
11
+ - License: **Apache License 2.0**
12
+ - Packaged license copy: [`LICENSES/Apache-2.0.txt`](LICENSES/Apache-2.0.txt)
13
+ - Canonical license URL: <https://www.apache.org/licenses/LICENSE-2.0>
14
+
15
+ Only curated path data is bundled. Agentic Mermaid does not fetch Iconify packs
16
+ at runtime and does not bundle the full npm package. The published
17
+ `@iconify-json/mdi@1.2.3` tarball contains no upstream `NOTICE` file to
18
+ reproduce.
19
+
20
+ ## Mermaid pinned test specifications
21
+
22
+ The revision-bound oracle vendors two upstream Mermaid test specifications at
23
+ `eval/mermaid-upstream-suite-bench/upstream-f3dea583/` solely to verify the
24
+ 26/69-block provenance inventory offline.
25
+
26
+ - Source: <https://github.com/mermaid-js/mermaid/tree/f3dea58385fd5c7dd1f4e9c9c1876751ae6943cc>
27
+ - Copyright: © 2014–2022 Knut Sveidqvist
28
+ - License: **MIT**
29
+ - Repository license copy: `eval/mermaid-upstream-suite-bench/upstream-f3dea583/LICENSE.mermaid.txt` (the upstream specs are verification-only and excluded from the npm package)