agentic-mermaid 0.1.0 → 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.
- package/CHANGELOG.md +149 -4
- package/LICENSES/Apache-2.0.txt +202 -0
- package/README.md +25 -32
- package/THIRD_PARTY_NOTICES.md +29 -0
- package/assets/fonts/FONT-LICENSES.md +9 -5
- package/assets/fonts/Inter-Bold.ttf +0 -0
- package/assets/fonts/Inter-Medium.ttf +0 -0
- package/assets/fonts/Inter-Regular.ttf +0 -0
- package/assets/fonts/Inter-SemiBold.ttf +0 -0
- package/dist/agent-core.d.ts +463 -0
- package/dist/agent-core.js +397 -0
- package/dist/agent.d.ts +81 -1822
- package/dist/agent.js +336 -36839
- package/dist/agentic-mermaid-mcp.js +7 -37908
- package/dist/am.js +33638 -36261
- package/dist/chunk-4QECACIA.js +4702 -0
- package/dist/chunk-CDPKJ2BQ.js +37 -0
- package/dist/chunk-QKDLMOJJ.js +3487 -0
- package/dist/chunk-WI35L7IR.js +615 -0
- package/dist/chunk-WN3YDOBG.js +149 -0
- package/dist/chunk-ZYMMKQ3I.js +62637 -0
- package/dist/index-D54dqSdC.d.ts +6777 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +310 -32836
- package/dist/mcp-cli-SBQSTJFC.js +17 -0
- package/docs/README.md +14 -6
- package/docs/schemas/style-spec.schema.json +1221 -30
- package/examples/styles/catalog.json +54 -0
- package/examples/styles/cloudflare-workers-inspired-prototype.mmd +9 -0
- package/examples/styles/cloudflare-workers-inspired-prototype.style.json +110 -0
- package/examples/styles/cupertino-prototype.mmd +10 -0
- package/examples/styles/cupertino-prototype.style.json +63 -0
- package/examples/styles/mid-century-report.style.json +2 -2
- package/examples/styles/star-chart-atlas.style.json +2 -1
- package/examples/styles/transit-route-map.style.json +2 -2
- package/examples/styles/vercel-inspired-prototype.mmd +6 -0
- package/examples/styles/vercel-inspired-prototype.style.json +87 -0
- package/package.json +70 -43
- package/server.json +41 -0
- package/skills/agentic-mermaid-diagram-workflow/SKILL.md +17 -36
- package/skills/agentic-mermaid-diagram-workflow/references/cli.md +4 -5
- package/skills/agentic-mermaid-diagram-workflow/references/code-mode.md +15 -31
- package/skills/agentic-mermaid-diagram-workflow/references/sequence.md +10 -14
- package/skills/agentic-mermaid-live-editor/SKILL.md +100 -206
- package/AGENT_NATIVE.md +0 -602
- package/Instructions_for_agents.md +0 -83
- package/TODO.md +0 -662
- package/assets/hero.png +0 -0
- package/dist/index-x2Cj1dVv.d.ts +0 -1089
- package/docs/agent-api-cookbook.md +0 -308
- package/docs/agent-mutation-policy.md +0 -104
- package/docs/agent-workflow-examples.md +0 -46
- package/docs/api.md +0 -203
- package/docs/ascii.md +0 -103
- package/docs/assets/improvements/box-start-connector.png +0 -0
- package/docs/assets/improvements/comment-dropped-lint.png +0 -0
- package/docs/assets/improvements/er-content-loss.png +0 -0
- package/docs/assets/improvements/fan-in-trunks.png +0 -0
- package/docs/assets/improvements/gantt-family.png +0 -0
- package/docs/assets/improvements/gantt-milestone-clamp.png +0 -0
- package/docs/assets/improvements/gantt-verify-seam.png +0 -0
- package/docs/assets/improvements/subgraph-container-edges.png +0 -0
- package/docs/assets/improvements/wrapper-frontmatter.png +0 -0
- package/docs/assets/improvements/wrapper-init-directive.png +0 -0
- package/docs/assets/improvements/wrapper-leading-comment.png +0 -0
- package/docs/assets/style-cookbook/mid-century-report.png +0 -0
- package/docs/assets/style-cookbook/star-chart-atlas.png +0 -0
- package/docs/assets/style-cookbook/transit-route-map.png +0 -0
- package/docs/comparison.md +0 -94
- package/docs/config.md +0 -105
- package/docs/contributing/adding-diagram-types.md +0 -144
- package/docs/contributing/diagram-family-citizenship.matrix.json +0 -2127
- package/docs/contributing/diagram-family-citizenship.md +0 -82
- package/docs/contributing/harvesting-upstream-tests.md +0 -126
- package/docs/contributing/lessons-learned.md +0 -276
- package/docs/contributing/releasing.md +0 -71
- package/docs/contributing/visual-review-evidence.md +0 -53
- package/docs/custom-style-cookbook.md +0 -154
- package/docs/design/families/README.md +0 -26
- package/docs/design/families/architecture-beta.md +0 -48
- package/docs/design/families/flowchart-parser-conformance.md +0 -22
- package/docs/design/families/gantt-research.md +0 -137
- package/docs/design/families/gantt.md +0 -329
- package/docs/design/families/journey-agentic-cards-before.png +0 -0
- package/docs/design/families/journey-mermaid-classic-implementation.png +0 -0
- package/docs/design/families/journey-mermaid-classic-prototype.png +0 -0
- package/docs/design/families/journey-mermaid-classic-prototype.svg +0 -163
- package/docs/design/families/journey-mermaid-classic-prototype.svg.png +0 -0
- package/docs/design/families/journey-migration-parity.md +0 -433
- package/docs/design/families/journey-usage-research.md +0 -423
- package/docs/design/families/journey.md +0 -125
- package/docs/design/families/xychart.md +0 -85
- package/docs/design/system/README.md +0 -45
- package/docs/design/system/abstraction-audit.md +0 -224
- package/docs/design/system/abstraction-recommendations.md +0 -655
- package/docs/design/system/architecture.mmd +0 -29
- package/docs/design/system/architecture.svg +0 -137
- package/docs/design/system/layout-guarantees-and-robustness.md +0 -351
- package/docs/design/system/layout-rubric.md +0 -138
- package/docs/design/system/route-contracts.md +0 -848
- package/docs/design/system/source-preservation-ladder.md +0 -52
- package/docs/design/system/styles-rollout.md +0 -216
- package/docs/design/system/ugly-layouts.md +0 -119
- package/docs/diagram-families.md +0 -193
- package/docs/features.md +0 -147
- package/docs/fork-differences.md +0 -130
- package/docs/getting-started.md +0 -175
- package/docs/issue-derived-test-cases.md +0 -156
- package/docs/layout-characterization/README.md +0 -245
- package/docs/layout-characterization/contact-sheet-families.md +0 -496
- package/docs/layout-characterization/contact-sheet.md +0 -638
- package/docs/layout-characterization/properties.md +0 -281
- package/docs/layout-characterization/visual-quality.md +0 -160
- package/docs/layout-characterization/visual-snapshots/architecture.svg +0 -79
- package/docs/layout-characterization/visual-snapshots/class.svg +0 -60
- package/docs/layout-characterization/visual-snapshots/er.svg +0 -61
- package/docs/layout-characterization/visual-snapshots/flowchart.svg +0 -58
- package/docs/layout-characterization/visual-snapshots/gantt.svg +0 -52
- package/docs/layout-characterization/visual-snapshots/journey.svg +0 -118
- package/docs/layout-characterization/visual-snapshots/pie.svg +0 -36
- package/docs/layout-characterization/visual-snapshots/quadrant.svg +0 -47
- package/docs/layout-characterization/visual-snapshots/sequence.svg +0 -59
- package/docs/layout-characterization/visual-snapshots/state.svg +0 -52
- package/docs/layout-characterization/visual-snapshots/timeline.svg +0 -64
- package/docs/layout-characterization/visual-snapshots/xychart.svg +0 -97
- package/docs/mcp-code-mode-rationale.md +0 -101
- package/docs/mcp-http-transport.md +0 -223
- package/docs/mermaid-layout-complaints.md +0 -837
- package/docs/mutation-testing.md +0 -206
- package/docs/project/divergences.md +0 -98
- package/docs/project/dogfooding-docs-strategy.md +0 -66
- package/docs/project/hosted-mcp-cloudflare-plan.md +0 -338
- package/docs/project/lessons-learned.md +0 -1019
- package/docs/project/remove-role-styling-plan.md +0 -176
- package/docs/quality.md +0 -212
- package/docs/react.md +0 -97
- package/docs/style-authoring.md +0 -133
- package/docs/testing-strategy.md +0 -335
- package/docs/theming.md +0 -162
- package/examples/agent-improve-auth-flow.ts +0 -206
- package/examples/agent-loop.ts +0 -53
- package/examples/mcp-vs-cli-complex-diagrams.ts +0 -133
- package/llms.txt +0 -104
- package/skill-evals/README.md +0 -77
- package/skill-evals/fixtures/architecture-cache/input.mmd +0 -5
- package/skill-evals/fixtures/class-payment/input.mmd +0 -4
- package/skill-evals/fixtures/er-orders/input.mmd +0 -10
- package/skill-evals/fixtures/flowchart-cache/input.mmd +0 -3
- package/skill-evals/fixtures/gantt-release/input.mmd +0 -7
- package/skill-evals/fixtures/journey-checkout/input.mmd +0 -6
- package/skill-evals/fixtures/pie-exports/input.mmd +0 -5
- package/skill-evals/fixtures/quadrant-priorities/input.mmd +0 -11
- package/skill-evals/fixtures/sequence-retry/input.mmd +0 -8
- package/skill-evals/fixtures/state-lifecycle/input.mmd +0 -5
- package/skill-evals/fixtures/timeline-release/input.mmd +0 -6
- package/skill-evals/fixtures/xychart-growth/input.mmd +0 -5
- package/skill-evals/shared-benchmark.json +0 -510
- package/src/agent/analyze.ts +0 -157
- package/src/agent/apply.ts +0 -146
- package/src/agent/architecture-body.ts +0 -458
- package/src/agent/certificates.ts +0 -110
- package/src/agent/class-body.ts +0 -319
- package/src/agent/core.ts +0 -207
- package/src/agent/create.ts +0 -106
- package/src/agent/describe.ts +0 -364
- package/src/agent/er-body.ts +0 -224
- package/src/agent/facts.ts +0 -337
- package/src/agent/families-builtin.ts +0 -934
- package/src/agent/families.ts +0 -232
- package/src/agent/family-layouts.ts +0 -826
- package/src/agent/flowchart-body.ts +0 -372
- package/src/agent/flowchart-unsupported.ts +0 -243
- package/src/agent/gantt-body.ts +0 -495
- package/src/agent/index.ts +0 -10
- package/src/agent/journey-body.ts +0 -414
- package/src/agent/label-metrics.ts +0 -28
- package/src/agent/layout-to-rendered.ts +0 -63
- package/src/agent/mutate.ts +0 -97
- package/src/agent/mutation-ops.ts +0 -51
- package/src/agent/op-schema.ts +0 -439
- package/src/agent/parse.ts +0 -223
- package/src/agent/pie-body.ts +0 -270
- package/src/agent/png.ts +0 -117
- package/src/agent/quadrant-body.ts +0 -336
- package/src/agent/quality.ts +0 -363
- package/src/agent/readability-audit.ts +0 -92
- package/src/agent/rendered-route-audit.ts +0 -61
- package/src/agent/sequence-body.ts +0 -345
- package/src/agent/serialize.ts +0 -214
- package/src/agent/state-body.ts +0 -589
- package/src/agent/structural-count.ts +0 -150
- package/src/agent/timeline-body.ts +0 -280
- package/src/agent/trace-log.ts +0 -43
- package/src/agent/types.ts +0 -979
- package/src/agent/verify.ts +0 -571
- package/src/agent/xychart-body.ts +0 -472
- package/src/architecture/config.ts +0 -282
- package/src/architecture/layout.ts +0 -496
- package/src/architecture/parser.ts +0 -375
- package/src/architecture/renderer.ts +0 -611
- package/src/architecture/types.ts +0 -113
- package/src/ascii/ansi.ts +0 -423
- package/src/ascii/architecture.ts +0 -210
- package/src/ascii/canvas.ts +0 -443
- package/src/ascii/class-diagram.ts +0 -697
- package/src/ascii/converter.ts +0 -475
- package/src/ascii/draw.ts +0 -1693
- package/src/ascii/edge-bundling.ts +0 -328
- package/src/ascii/edge-routing.ts +0 -330
- package/src/ascii/er-diagram.ts +0 -439
- package/src/ascii/gantt.ts +0 -276
- package/src/ascii/grid.ts +0 -747
- package/src/ascii/index.ts +0 -196
- package/src/ascii/journey.ts +0 -189
- package/src/ascii/meta.ts +0 -244
- package/src/ascii/multiline-utils.ts +0 -80
- package/src/ascii/pathfinder.ts +0 -301
- package/src/ascii/pie.ts +0 -67
- package/src/ascii/quadrant.ts +0 -158
- package/src/ascii/reverse.ts +0 -216
- package/src/ascii/sequence.ts +0 -499
- package/src/ascii/shapes/circle.ts +0 -27
- package/src/ascii/shapes/corners.ts +0 -143
- package/src/ascii/shapes/diamond.ts +0 -27
- package/src/ascii/shapes/hexagon.ts +0 -27
- package/src/ascii/shapes/index.ts +0 -106
- package/src/ascii/shapes/rectangle.ts +0 -168
- package/src/ascii/shapes/rounded.ts +0 -27
- package/src/ascii/shapes/special.ts +0 -332
- package/src/ascii/shapes/stadium.ts +0 -110
- package/src/ascii/shapes/state.ts +0 -192
- package/src/ascii/shapes/types.ts +0 -73
- package/src/ascii/timeline.ts +0 -128
- package/src/ascii/types.ts +0 -312
- package/src/ascii/validate.ts +0 -120
- package/src/ascii/width.ts +0 -81
- package/src/ascii/xychart.ts +0 -919
- package/src/browser.ts +0 -29
- package/src/class/layout.ts +0 -240
- package/src/class/parser.ts +0 -332
- package/src/class/renderer.ts +0 -638
- package/src/class/types.ts +0 -129
- package/src/cli/agent-instructions.ts +0 -1
- package/src/cli/am-bin.ts +0 -6
- package/src/cli/exit-codes.ts +0 -18
- package/src/cli/index.ts +0 -1117
- package/src/cli/init-agent.ts +0 -147
- package/src/color-resolver.ts +0 -152
- package/src/elk-instance.ts +0 -114
- package/src/er/layout.ts +0 -187
- package/src/er/parser.ts +0 -226
- package/src/er/renderer.ts +0 -792
- package/src/er/types.ts +0 -99
- package/src/font-manifest.ts +0 -27
- package/src/gantt/layout.ts +0 -365
- package/src/gantt/parser.ts +0 -282
- package/src/gantt/pipeline.ts +0 -27
- package/src/gantt/renderer.ts +0 -414
- package/src/gantt/schedule.ts +0 -513
- package/src/gantt/types.ts +0 -255
- package/src/index.ts +0 -368
- package/src/journey/layout.ts +0 -520
- package/src/journey/parser.ts +0 -218
- package/src/journey/renderer.ts +0 -811
- package/src/journey/types.ts +0 -144
- package/src/layout/geometry.ts +0 -182
- package/src/layout/pass.ts +0 -142
- package/src/layout/passes/index.ts +0 -3916
- package/src/layout-engine.ts +0 -1565
- package/src/layout-rubric.ts +0 -659
- package/src/mcp/artifacts.ts +0 -137
- package/src/mcp/dynamic-harness.ts +0 -31
- package/src/mcp/dynamic-modules.d.ts +0 -7
- package/src/mcp/facade.ts +0 -608
- package/src/mcp/harness-runtime.ts +0 -203
- package/src/mcp/hosted-server.ts +0 -468
- package/src/mcp/mcp-bin.ts +0 -3
- package/src/mcp/mcp-cli.ts +0 -82
- package/src/mcp/protocol.ts +0 -13
- package/src/mcp/sandbox.ts +0 -195
- package/src/mcp/sdk-decl.ts +0 -387
- package/src/mcp/server.ts +0 -362
- package/src/mcp/tool-surface.ts +0 -146
- package/src/mermaid-source.ts +0 -655
- package/src/multiline-utils.ts +0 -228
- package/src/parser.ts +0 -1031
- package/src/pie/layout.ts +0 -168
- package/src/pie/parser.ts +0 -136
- package/src/pie/renderer.ts +0 -234
- package/src/pie/types.ts +0 -82
- package/src/quadrant/layout.ts +0 -191
- package/src/quadrant/parser.ts +0 -183
- package/src/quadrant/renderer.ts +0 -322
- package/src/quadrant/types.ts +0 -113
- package/src/render-family-hooks.ts +0 -244
- package/src/renderer.ts +0 -1099
- package/src/route-contracts.ts +0 -2723
- package/src/scene/backend.ts +0 -76
- package/src/scene/fidelity.ts +0 -183
- package/src/scene/hybrid-backend.ts +0 -174
- package/src/scene/ir.ts +0 -181
- package/src/scene/marks.ts +0 -127
- package/src/scene/rough-backend.ts +0 -378
- package/src/scene/seed.ts +0 -46
- package/src/scene/style-registry.ts +0 -556
- package/src/sequence/layout.ts +0 -456
- package/src/sequence/parser.ts +0 -255
- package/src/sequence/renderer.ts +0 -604
- package/src/sequence/types.ts +0 -154
- package/src/shape-clipping.ts +0 -351
- package/src/shared/accessibility-directives.ts +0 -22
- package/src/shared/batched.ts +0 -61
- package/src/shared/color-math.ts +0 -72
- package/src/shared/svg-a11y.ts +0 -29
- package/src/shared/syntax-error.ts +0 -17
- package/src/shared/unicode-ranges.ts +0 -135
- package/src/styles.ts +0 -318
- package/src/svg-paths.ts +0 -28
- package/src/text-metrics.ts +0 -248
- package/src/theme.ts +0 -639
- package/src/timeline/layout.ts +0 -381
- package/src/timeline/parser.ts +0 -215
- package/src/timeline/renderer.ts +0 -538
- package/src/timeline/types.ts +0 -105
- package/src/types.ts +0 -454
- package/src/website-worker-modules.d.ts +0 -18
- package/src/xychart/axis-utils.ts +0 -109
- package/src/xychart/colors.ts +0 -124
- package/src/xychart/config.ts +0 -88
- package/src/xychart/layout.ts +0 -656
- package/src/xychart/parser.ts +0 -504
- package/src/xychart/renderer.ts +0 -640
- package/src/xychart/types.ts +0 -282
package/CHANGELOG.md
CHANGED
|
@@ -4,18 +4,163 @@ This changelog tracks user-facing changes for **Agentic Mermaid**, a fork of `lu
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
-
|
|
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.
|
|
147
|
+
|
|
148
|
+
## 0.1.1 — 2026-07-10
|
|
149
|
+
|
|
150
|
+
### Added
|
|
151
|
+
- **Standards-based agent discovery and MCP Registry publishing.** Agent guidance now states when to use Agentic Mermaid and when to keep diagrams local. The website publishes `/index.md`, negotiates it from `/` with `Vary: Accept`, and advertises machine-readable resources with RFC 8288 links. The npm package ships official `server.json` metadata, exposes the registry launch path as `npx -y agentic-mermaid mcp`, and publishes each new release to the MCP Registry after npm succeeds.
|
|
8
152
|
|
|
9
153
|
## 0.1.0 — 2026-07-09
|
|
10
154
|
|
|
11
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.
|
|
12
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.
|
|
13
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.
|
|
14
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).
|
|
15
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.
|
|
16
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.
|
|
17
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`.
|
|
18
|
-
- **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
|
|
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`).
|
|
19
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.
|
|
20
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.
|
|
21
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).
|
|
@@ -54,7 +199,7 @@ _No changes yet._
|
|
|
54
199
|
- Style + Palette SVG styling via named looks, palette stacks, custom public JSON style records, and deterministic `seed` values.
|
|
55
200
|
- Style + Palette showcase samples in the live examples surface.
|
|
56
201
|
- Fork documentation describing differences from upstream in [`docs/fork-differences.md`](./docs/fork-differences.md).
|
|
57
|
-
-
|
|
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.
|
|
58
203
|
- Homepage sample search and category filters for browsing the full showcase.
|
|
59
204
|
- Mobile editor pane switching for Code, Config, Preview, and Examples.
|
|
60
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`.
|
|
@@ -65,7 +210,7 @@ _No changes yet._
|
|
|
65
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`.
|
|
66
211
|
- **`LABEL_OVERFLOW` now measures the rendered label, not raw source chars** (from direct agent feedback: the cap counted `<br/>` tags and ` ` 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.
|
|
67
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).
|
|
68
|
-
- The website MCP and security pages now carry an explicit privacy note: hosted tool calls send diagram source/code to the server
|
|
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.
|
|
69
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.
|
|
70
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.
|
|
71
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 | `
|
|
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
|
-
- **
|
|
36
|
-
- **SVG, PNG, ASCII, Unicode, JSON** — one
|
|
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;
|
|
39
|
-
- **
|
|
40
|
-
- **Agent-native editing** — typed mutation for
|
|
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
|
-
|
|
48
|
-
agentic-mermaid
|
|
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 …`
|
|
66
|
-
>
|
|
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`. 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 {
|
|
149
|
+
import { parseRegisteredMermaid, asFlowchart, mutate, verifyMermaid, serializeMermaid } from 'agentic-mermaid/agent'
|
|
148
150
|
|
|
149
|
-
const parsed =
|
|
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
|
|
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
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
|
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)
|