agentic-mermaid 0.1.0 → 0.1.1

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 (66) hide show
  1. package/AGENT_NATIVE.md +8 -3
  2. package/CHANGELOG.md +5 -0
  3. package/Instructions_for_agents.md +7 -1
  4. package/README.md +1 -1
  5. package/TODO.md +53 -31
  6. package/assets/fonts/FONT-LICENSES.md +9 -5
  7. package/assets/fonts/Inter-Bold.ttf +0 -0
  8. package/assets/fonts/Inter-Medium.ttf +0 -0
  9. package/assets/fonts/Inter-Regular.ttf +0 -0
  10. package/assets/fonts/Inter-SemiBold.ttf +0 -0
  11. package/dist/agent.d.ts +59 -5
  12. package/dist/agent.js +965 -479
  13. package/dist/agentic-mermaid-mcp.js +976 -485
  14. package/dist/am.js +8516 -4326
  15. package/dist/{index-x2Cj1dVv.d.ts → index-wjRjbsP-.d.ts} +13 -0
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +634 -456
  18. package/docs/agent-api-cookbook.md +2 -2
  19. package/docs/api.md +13 -5
  20. package/docs/comparison.md +1 -1
  21. package/docs/contributing/releasing.md +16 -5
  22. package/docs/design/families/journey-experience-curve-implementation.png +0 -0
  23. package/docs/design/families/journey-migration-parity.md +11 -5
  24. package/docs/design/families/journey-section-overlap-after.png +0 -0
  25. package/docs/design/families/journey-section-overlap-before.png +0 -0
  26. package/docs/design/families/journey.md +33 -5
  27. package/docs/features.md +3 -3
  28. package/docs/fork-differences.md +1 -1
  29. package/docs/layout-characterization/contact-sheet-families.md +2 -0
  30. package/docs/layout-characterization/visual-quality.md +12 -12
  31. package/docs/layout-characterization/visual-snapshots/journey.svg +32 -52
  32. package/docs/quality.md +11 -8
  33. package/llms.txt +2 -2
  34. package/package.json +3 -1
  35. package/server.json +41 -0
  36. package/src/agent/describe.ts +5 -1
  37. package/src/agent/facts.ts +23 -0
  38. package/src/agent/families-builtin.ts +49 -63
  39. package/src/agent/family-layouts.ts +7 -1
  40. package/src/agent/font-coverage.ts +288 -0
  41. package/src/agent/journey-body.ts +111 -151
  42. package/src/agent/mutation-ops.ts +1 -1
  43. package/src/agent/op-schema.ts +6 -2
  44. package/src/agent/png.ts +61 -7
  45. package/src/agent/types.ts +19 -3
  46. package/src/agent/verify.ts +34 -2
  47. package/src/ascii/journey.ts +48 -68
  48. package/src/ascii/timeline.ts +21 -8
  49. package/src/ascii/wrap.ts +131 -0
  50. package/src/cli/agent-instructions.ts +1 -1
  51. package/src/cli/am-bin.ts +2 -2
  52. package/src/cli/index.ts +24 -9
  53. package/src/cli/run-entrypoint.ts +10 -0
  54. package/src/family-rubric.ts +425 -0
  55. package/src/font-manifest.ts +4 -0
  56. package/src/journey/layout.ts +95 -61
  57. package/src/journey/parse-core.ts +251 -0
  58. package/src/journey/parser.ts +35 -152
  59. package/src/journey/renderer.ts +126 -20
  60. package/src/mcp/sdk-decl.ts +7 -3
  61. package/src/mcp/tool-surface.ts +1 -1
  62. package/src/render-family-hooks.ts +1 -1
  63. package/src/shared/color-math.ts +21 -0
  64. package/src/theme.ts +86 -15
  65. package/src/types.ts +8 -0
  66. package/src/xychart/colors.ts +2 -2
package/AGENT_NATIVE.md CHANGED
@@ -146,6 +146,7 @@ Tier 3 warnings are family-specific quality hints for "common LLM mistakes" that
146
146
  | `COMMENT_DROPPED` | warning | The source contains in-body `%%` comments that this diagram's structured serialization does not preserve (reported with `count` and `lines`). The leading wrapper — frontmatter, `%%{init}%%` directives, comments before the header — always round-trips byte-verbatim; in-body comments survive only in opaque bodies or preserved opaque segments. Re-home load-bearing comments into the wrapper, or accept the loss as canonicalization. |
147
147
  | `UNSUPPORTED_SYNTAX` | warning | The source uses Mermaid syntax that is preserved losslessly but not fully modeled by local structured mutation/render semantics (for example flowchart edge IDs, edge metadata, click/href directives, or markdown strings). Payload includes `syntax`, optional `line`, and `message`. |
148
148
  | `CONTENT_DROPPED_ON_ROUNDTRIP` | warning | The structured `{nodes, edges, groups}` tally changed across a parse → serialize → re-parse cycle, so canonical serialization is silently dropping or duplicating content even though the bytes may re-parse (payload carries `before`/`after` counts). The faithfulness analogue of `COMMENT_DROPPED` — "100% parse success is not faithfulness". Runs on every verify, for every family; opaque bodies (byte-verbatim) are exempt. |
149
+ | `INEFFECTIVE_CONFIG` | warning | A Mermaid config field was accepted (for config-shape compatibility) but has no effect on this family's geometry or paint — e.g. Journey's sequence-era fields (`boxMargin`, `rightAngles`, …). Payload names the `field`. Accepting-and-ignoring silently misleads migrating users; this lint says so. |
149
150
 
150
151
  `FamilyPlugin.verify` hooks are wired and run today; built-ins use them for Tier 1 structural warnings for class/ER and the central flowchart verifier emits the initial Tier 3 lint catalogue. Future lint codes should be added deliberately to `WARNING_TIER`, documented here, and covered by doc-sync tests.
151
152
 
@@ -295,20 +296,24 @@ Two contracts:
295
296
  | `add_relation` | `from`, `to`, `leftCard`, `rightCard` (+ `dashed`, `label`) | `remove_relation(index)` |
296
297
  | `remove_relation` | `index` | `add_relation(...)` |
297
298
 
298
- **Journey MutationOp kinds** (10, BUILD-15 — the pilot promotion from opaque-only fallback semantics to structured mutation via the FamilyPlugin registry):
299
+ **Journey MutationOp kinds** (14, BUILD-15 — the pilot promotion from opaque-only fallback semantics to structured mutation via the FamilyPlugin registry; ordering + accessibility ops added with the Mermaid-classic renderer elevation, since journey order IS the timeline):
299
300
 
300
301
  | Kind | Required | Inverse |
301
302
  |---|---|---|
302
303
  | `set_title` | `title \| null` | `set_title(prev_title)` |
303
- | `add_section` | `label` | `remove_section(index)` |
304
+ | `add_section` | `label` (+ optional insert `index`) | `remove_section(index)` |
304
305
  | `remove_section` | `index` | `add_section(label)` |
305
306
  | `set_section_label` | `index`, `label` | `set_section_label(index, prev_label)` |
306
- | `add_task` | `sectionIndex`, `text`, `score` (+ optional `actors`) | `remove_task(sectionIndex, taskIndex)` |
307
+ | `add_task` | `sectionIndex`, `text`, `score` (+ optional `actors`, insert `index`) | `remove_task(sectionIndex, taskIndex)` |
307
308
  | `remove_task` | `sectionIndex`, `taskIndex` | `add_task(...)` |
308
309
  | `set_task_text` | `sectionIndex`, `taskIndex`, `text` | `set_task_text(... prev_text)` |
309
310
  | `set_task_score` | `sectionIndex`, `taskIndex`, `score` (integer 1..5) | `set_task_score(... prev_score)` |
310
311
  | `set_task_actors` | `sectionIndex`, `taskIndex`, `actors: string[]` | `set_task_actors(... prev_actors)` |
311
312
  | `rename_actor` | `from`, `to` | `rename_actor(to, from)` |
313
+ | `move_task` | `fromSection`, `fromIndex`, `toSection`, `toIndex` | `move_task(toSection, toIndex, fromSection, fromIndex)` |
314
+ | `move_section` | `from`, `to` | `move_section(to, from)` |
315
+ | `set_accessibility_title` | `title \| null` | `set_accessibility_title(prev)` |
316
+ | `set_accessibility_description` | `description \| null` | `set_accessibility_description(prev)` |
312
317
 
313
318
  **Architecture MutationOp kinds** (10, BUILD-17 — promoting the architecture-beta family to structured mutation via the FamilyPlugin registry, following the BUILD-15 journey pilot):
314
319
 
package/CHANGELOG.md CHANGED
@@ -6,6 +6,11 @@ This changelog tracks user-facing changes for **Agentic Mermaid**, a fork of `lu
6
6
 
7
7
  _No changes yet._
8
8
 
9
+ ## 0.1.1 — 2026-07-10
10
+
11
+ ### Added
12
+ - **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.
13
+
9
14
  ## 0.1.0 — 2026-07-09
10
15
 
11
16
  ### Added
@@ -2,6 +2,12 @@
2
2
 
3
3
  This is the canonical agent-use guide. The same content is emitted by `am --agent-instructions`. A doc-sync test asserts the two are byte-identical.
4
4
 
5
+ ## When to use Agentic Mermaid
6
+
7
+ Use Agentic Mermaid when an agent needs to create, edit, verify, describe, or render Mermaid diagrams through deterministic library, CLI, or MCP calls. It is strongest when the workflow needs typed edits, semantic fact read-back, CI-safe verification, or reproducible SVG, PNG, ASCII, and Unicode output.
8
+
9
+ Do not use the hosted MCP for private diagrams; use the local library, CLI, or self-hosted MCP so source stays in your environment. Use another tool when the artifact is not Mermaid source or requires freeform canvas editing that Mermaid cannot express.
10
+
5
11
  ## Quick start
6
12
 
7
13
  Choose the narrowest channel. New diagrams: build with `buildMermaid(kind, ops)` — or `createMermaid(kind)` then typed mutations — and verify/render the result; author Mermaid source directly only for syntax the typed ops do not model. Existing structured diagrams: parse → narrow → mutate → verify → serialize. Code Mode/library are best for multi-step edits; CLI is best for one-shot verify/render/preview. Code Mode exposes `mermaid.*`; library users import the same names from `agentic-mermaid/agent` — including `describeOps(family)` and `opSignatures(family)`, which return each op's exact fields, required-ness, inlined enum values, and constraint/default notes (e.g. journey score `integer 1..5`, flowchart shape `default: rectangle`) so you can look up an unfamiliar op instead of guessing; use `describeMermaidFacts` / `checkMermaid` when you need semantic read-back such as `edge Processing -> [*] : done`, `member Duck +quack()`, or `task Docs start after core`. A hosted MCP at `agentic-mermaid.dev/mcp` (stateless Streamable HTTP JSON-RPC) exposes `execute` (Code Mode), `render_svg`, `render_ascii`, `render_png`, `verify`, `describe`, and the declarative `mutate` (edit a `source`) and `build` (author from a `family`) — which apply a JSON op list and return `{ok,family,source,verify}`, prescriptive `{ok:false,…,error}` on a bad op; prefer them for structured edits and reserve `execute` for logic the ops do not express — all with 64KB input caps; the call shape is a plain POST (stateless, no initialize handshake): `POST /mcp` with `content-type: application/json` and body `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"verify","arguments":{"source":"flowchart TD\n A --> B"}}}`. Prefer the local library, CLI, or a self-hosted MCP and reach for the hosted endpoint only when you cannot install. Agentic Mermaid outputs ASCII, PNG, and SVG; Unicode text and JSON layout are also available. Flowchart authoring facts: quote any label carrying punctuation (`id["HTTPS /api/sessions*"]`); `\n` inside a quoted label is a line break and canonicalizes to `<br>` on serialize; `subgraph id["Title"] … end` groups nodes; labeled and dotted edges are `A -- "label" --> B`, `A -.-> B`, and `A -. "label" .-> B`. For every other family, read that family's exact header, edge, and relationship syntax from its `example` in `am capabilities --json` (`capabilities.json` `families[].example`) rather than assuming flowchart syntax — e.g. class inheritance `Base <|-- Derived`, ER cardinality `A ||--o{ B : label`, architecture edges `api:R --> L:db`.
@@ -51,7 +57,7 @@ Tier 1 (structural, reliable, universal): `EMPTY_DIAGRAM`, `EDGE_MISANCHORED`, `
51
57
 
52
58
  Tier 2 (geometric, advisory, flowchart-specific): `NODE_OVERLAP`, `ROUTE_SELF_CROSS`, plus the route-contract tripwires `ROUTE_HITCH`, `ROUTE_UNEXPLAINED_BEND`, `ROUTE_LABEL_ON_SHARED_TRUNK`, `ROUTE_CONTAINER_MISANCHOR`, `ROUTE_SHAPE_MISANCHOR`, `ROUTE_STALE_AFTER_NODE_MOVE` (docs/design/system/route-contracts.md — the layout pipeline upholds these itself, so they fire only on pipeline regressions). Route tripwires fire for flowchart/state; class and ER additionally run boundary-anchor and overlap checks (`ROUTE_SHAPE_MISANCHOR`, `NODE_OVERLAP` on class/entity boxes). For other families, geometric concerns surface via perceptual metrics (`measureQuality(layoutMermaid(d))`). See `docs/quality.md`. Don't gate CI on Tier 2 alone.
53
59
 
54
- Tier 3 (lint, advisory): `DUPLICATE_EDGE`, `UNREACHABLE_NODE`, `DECISION_BRANCH_UNLABELED`, `COMMENT_DROPPED`, `UNSUPPORTED_SYNTAX`, `CONTENT_DROPPED_ON_ROUNDTRIP`. These catch common agent mistakes, source-preserved Mermaid syntax that is not fully modeled, and content-bearing sources whose local layout renders nothing. They never flip `verify.ok`; inspect and fix when the task asks for clean maintainable diagrams. `DECISION_BRANCH_UNLABELED` means a multi-exit decision diamond has an unlabeled branch. `COMMENT_DROPPED` means in-body `%%` comments will not survive structured serialization; the leading wrapper (frontmatter, `%%{init}%%` directives, comments before the header) always round-trips byte-verbatim. `UNSUPPORTED_SYNTAX` means either a Mermaid construct (for example flowchart edge IDs, edge metadata, click/href, or markdown strings) is preserved losslessly as source but is not fully modeled by local structured mutation/render semantics, or `syntax: "empty_layout"` means the source carries content but the local layout produced a 0x0 canvas with no nodes, edges, or groups. Inspect the warning message and `verify.layout` before accepting the artifact. `CONTENT_DROPPED_ON_ROUNDTRIP` means the structured node/edge/group tally changed across a parse → serialize → re-parse cycle — canonical serialization is silently dropping or duplicating content even though the bytes may re-parse; treat it as a faithfulness bug to report.
60
+ Tier 3 (lint, advisory): `DUPLICATE_EDGE`, `UNREACHABLE_NODE`, `DECISION_BRANCH_UNLABELED`, `COMMENT_DROPPED`, `UNSUPPORTED_SYNTAX`, `CONTENT_DROPPED_ON_ROUNDTRIP`, `INEFFECTIVE_CONFIG`. These catch common agent mistakes, source-preserved Mermaid syntax that is not fully modeled, and content-bearing sources whose local layout renders nothing. They never flip `verify.ok`; inspect and fix when the task asks for clean maintainable diagrams. `DECISION_BRANCH_UNLABELED` means a multi-exit decision diamond has an unlabeled branch. `COMMENT_DROPPED` means in-body `%%` comments will not survive structured serialization; the leading wrapper (frontmatter, `%%{init}%%` directives, comments before the header) always round-trips byte-verbatim. `UNSUPPORTED_SYNTAX` means either a Mermaid construct (for example flowchart edge IDs, edge metadata, click/href, or markdown strings) is preserved losslessly as source but is not fully modeled by local structured mutation/render semantics, or `syntax: "empty_layout"` means the source carries content but the local layout produced a 0x0 canvas with no nodes, edges, or groups. Inspect the warning message and `verify.layout` before accepting the artifact. `CONTENT_DROPPED_ON_ROUNDTRIP` means the structured node/edge/group tally changed across a parse → serialize → re-parse cycle — canonical serialization is silently dropping or duplicating content even though the bytes may re-parse; treat it as a faithfulness bug to report. `INEFFECTIVE_CONFIG` means a Mermaid config field was accepted for compatibility but has no effect on this family's output (the warning names the field).
55
61
 
56
62
  ## CLI verbs
57
63
 
package/README.md CHANGED
@@ -136,7 +136,7 @@ For multi-step MCP edits, connect `agentic-mermaid-mcp` and use Code Mode `execu
136
136
 
137
137
  Agentic Mermaid ships a Model Context Protocol server so MCP-capable agents can render and safely edit diagrams without shelling out.
138
138
 
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).
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
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
141
 
142
142
  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.
package/TODO.md CHANGED
@@ -39,23 +39,23 @@ dependents after. IDs are stable names, not an ordering.
39
39
  `{ "ok": true, "value": 42, "logs": [] }`, proving the production Dynamic
40
40
  Workers `LOADER` binding resolves for hosted Code Mode. The pure tools are no
41
41
  longer the only production evidence.
42
- - [ ] **DEC-4 — Submit the sitemap to Google and Bing** (`owner-decision`).
43
- After the first deploy that serves `https://agentic-mermaid.dev/sitemap.xml`
44
- (generated by `website/build.ts`, validated against the sitemaps.org 0.9
45
- XSD), submit it manually in Google Search Console → Sitemaps and Bing
46
- Webmaster Tools → Sitemaps. Both require a signed-in, ownership-verified
47
- account, and the anonymous ping endpoints are retired, so this cannot be
48
- automated in the repo.
49
- - [ ] **DEC-5 — Add the `Sitemap:` line in the Cloudflare dashboard**
50
- (`owner-decision`). Production serves Cloudflare's *managed* content-signals
51
- `robots.txt` (verified live: the "content signals" template, no `Sitemap:`
52
- line), which the edge is likely to serve in preference to any repo
53
- `website/public/robots.txt`. So the reliable way to make the sitemap
54
- auto-discoverable is to add `Sitemap: https://agentic-mermaid.dev/sitemap.xml`
55
- via the Cloudflare dashboard's managed robots.txt (Manage robots.txt), which
56
- also keeps the content-signals reservation intact. The repo deliberately ships
57
- no `robots.txt` (it would only collide with the managed one), so the dashboard
58
- is the single source for this line.
42
+ - [ ] **DEC-4 — Establish Google and Bing search visibility**
43
+ (`owner-decision`). In ownership-verified Google Search Console and Bing
44
+ Webmaster Tools, submit `https://agentic-mermaid.dev/sitemap.xml`, request
45
+ indexing for the homepage and core docs, and monitor coverage plus exact-name
46
+ queries for "Agentic Mermaid" and "agentic-mermaid". Fix crawl/canonical
47
+ findings before pursuing relevant external references and backlinks; do not
48
+ manufacture low-quality links. These consoles require a signed-in owner and
49
+ the anonymous sitemap ping endpoints are retired, so this cannot be automated
50
+ in the repo.
51
+ - [ ] **DEC-5 — Finish Cloudflare's managed `robots.txt` policy**
52
+ (`owner-decision`). Production serves Cloudflare's managed content-signals
53
+ file in preference to a repository asset. In **Manage robots.txt**, choose the
54
+ intended crawler/content-signals policy, preserve access for the public pages
55
+ meant to be indexed, and add
56
+ `Sitemap: https://agentic-mermaid.dev/sitemap.xml`. Then verify the live body
57
+ and status with `curl` and both search consoles. The repo deliberately ships
58
+ no competing `robots.txt`, so the dashboard remains the single source.
59
59
 
60
60
  ## 1. Security backlog
61
61
 
@@ -78,18 +78,31 @@ dependents after. IDs are stable names, not an ordering.
78
78
  - [ ] **BUILD-27 — MCP Apps support** (`todo`). Expose an interactive
79
79
  in-agent diagram UI through MCP Apps: `ui://` resources, correct
80
80
  `text/html;profile=mcp-app` resource MIME type, tool `_meta.ui.resourceUri`
81
- wiring, CSP for the view, and tests that the resources are reachable without
82
- leaking secrets. Start with a read-only preview/verify view before adding any
83
- editable surface.
84
- - [ ] **BUILD-28 — WebMCP support** (`todo`). Track and implement the WebMCP
85
- browser-discovery path once the draft stabilizes enough to commit to a public
86
- contract. Scope should cover `/.well-known/mcp` compatibility, browser-safe
87
- CORS/Origin handling, and parity with the hosted Streamable HTTP tool surface.
88
- - [ ] **BUILD-29 — ChatGPT app listing** (`todo`). Prepare a ChatGPT app
89
- listing once Agentic Mermaid has a stable in-agent UI surface. Package the
90
- public description, icon, privacy/security notes, hosted MCP/App endpoints,
91
- and reviewer-ready examples; do not submit until the MCP Apps/WebMCP surface
92
- is production-ready.
81
+ wiring, resource CSP/domain metadata, and tests that the resources are
82
+ reachable without leaking secrets. Start with a portable, read-only
83
+ preview/verify view before adding an editable surface; keep tool results useful
84
+ in MCP hosts that ignore the UI extension.
85
+ - [ ] **BUILD-28 — Experimental page-local WebMCP support** (`todo`). The
86
+ current Web Machine Learning Community Group report is not a W3C Standard or
87
+ Standards Track document. In the browser editor, feature-detect
88
+ `document.modelContext` and register a narrow active-document surface with
89
+ `document.modelContext.registerTool()` using exact JSON Schemas, truthful
90
+ `readOnlyHint` / `untrustedContentHint` annotations, and an `AbortSignal` for
91
+ lifecycle cleanup. Start with read source, verify, describe, and render; add
92
+ structured mutation only after explicit user-action and state-consistency
93
+ tests. Gate it behind supported-browser detection and test with both a shim
94
+ and a compatible browser trial. This is not `/.well-known/mcp`, CORS, or
95
+ Streamable HTTP parity: the draft is an in-page browser API and does not
96
+ prescribe MCP as the browser agent's transport.
97
+ - [ ] **BUILD-29 — Submit a ChatGPT app as a plugin** (`todo`, after
98
+ BUILD-27; WebMCP is not a dependency). Validate the public MCP + MCP Apps
99
+ experience in ChatGPT Developer Mode on web and mobile, define an exact CSP,
100
+ and audit tool schemas, `_meta`, instructions, and annotations before scanning
101
+ the endpoint. Complete organization verification and `api.apps.write`
102
+ access, then prepare the plugin submission's name, logo, description, company
103
+ and privacy-policy URLs, screenshots, test prompts/responses, localization,
104
+ and review notes. Submit through the plugin portal only when the live endpoint
105
+ and UI are stable enough to preserve the reviewed metadata contract.
93
106
  - [ ] **BUILD-25 — Structured coverage for the last silent-opaque constructs**
94
107
  (`todo`, needs legacy-renderer support first; tracked as **#118**). The systemic `UNSUPPORTED_SYNTAX`
95
108
  warning (2026-07) now announces every opaque fallback, so these are visible but
@@ -560,8 +573,17 @@ _No active blocked items._
560
573
 
561
574
  ## 5. Parked / evidence-required ideas
562
575
 
563
- - [ ] **PARK-2 — `.well-known/skills` discovery** (`parked`). Watch the
564
- ecosystem; do not implement until a standard settles.
576
+ - [ ] **PARK-2 — Agent Skills discovery and skills.sh visibility** (`parked`,
577
+ experimental draft). Reassess Cloudflare's Agent Skills Discovery draft when
578
+ its `agent-skills` well-known suffix is registered or the ecosystem contract
579
+ stabilizes. If adopted earlier, generate a v0.2.0
580
+ `/.well-known/agent-skills/index.json`, package the workflow skill plus its
581
+ references as a safe archive, publish its SHA-256 digest, support GET/HEAD +
582
+ JSON/Markdown/archive content types + CORS/cache headers, and test fetch,
583
+ extraction, and digest verification against the published schema. Once that
584
+ endpoint exists, change the homepage `Link` header from the direct `SKILL.md`
585
+ to the index. Separately document `npx skills add adewale/agentic-mermaid`;
586
+ skills.sh has no submission API and gains visibility from real CLI installs.
565
587
  - [ ] **PARK-3 — Fork feature ports** (`parked`). Vercel themes,
566
588
  browser/package export tweaks, C4, ArchiMate (upstream PR #34), and
567
589
  animation remain fork-audit ideas. Promote one only with a focused issue
@@ -2,11 +2,14 @@
2
2
 
3
3
  The `.ttf` files in this directory ship inside the `agentic-mermaid` npm
4
4
  package so PNG rasterization (`renderMermaidPNG`) is deterministic and
5
- offline: DejaVu Sans is the default face, and the four OFL faces are the
6
- typefaces referenced by the built-in styles (hand-drawn, excalidraw,
7
- watercolor → Caveat; pen-and-ink, tufte → EB Garamond; freehand →
8
- Architects Daughter; blueprint → Share Tech Mono). Custom styles that
9
- reference other families can supply them via the `fontDirs` PNG option.
5
+ offline: Inter (weights 400/500/600/700 — the weights the SVG output
6
+ requests) is the default face and the family the text-metrics model is
7
+ calibrated for; DejaVu Sans serves as the per-glyph fallback for symbols
8
+ Inter lacks; and the remaining OFL faces are the typefaces referenced by
9
+ the built-in styles (hand-drawn, excalidraw, watercolor → Caveat;
10
+ pen-and-ink, tufte → EB Garamond; freehand → Architects Daughter;
11
+ blueprint → Share Tech Mono). Custom styles that reference other families
12
+ can supply them via the `fontDirs` PNG option.
10
13
 
11
14
  ## OFL-1.1 faces
12
15
 
@@ -16,6 +19,7 @@ required by OFL condition 2.
16
19
 
17
20
  | File | Typeface | Copyright / Reserved Font Name | Source |
18
21
  |---|---|---|---|
22
+ | `Inter-Regular.ttf`, `Inter-Medium.ttf`, `Inter-SemiBold.ttf`, `Inter-Bold.ttf` | Inter (v4.001 statics, weights 400/500/600/700) | Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) | fonts.google.com/specimen/Inter |
19
23
  | `Caveat.ttf` | Caveat | Copyright 2014 The Caveat Project Authors (https://github.com/googlefonts/caveat) | fonts.google.com/specimen/Caveat |
20
24
  | `EBGaramond.ttf` | EB Garamond | Copyright 2017 The EB Garamond Project Authors (https://github.com/octaviopardo/EBGaramond12) | fonts.google.com/specimen/EB+Garamond |
21
25
  | `ArchitectsDaughter.ttf` | Architects Daughter | Copyright (c) 2010, Kimberly Geswein (kimberlygeswein.com) | fonts.google.com/specimen/Architects+Daughter |
Binary file
Binary file
Binary file
Binary file
package/dist/agent.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { N as NodeShape, E as EdgeStyle, M as MermaidFrontmatterMap, a as MermaidConfigMap, b as MermaidGraph, D as Direction, R as RouteClass, c as EdgeRouteCertificate, d as RegionContainmentCertificate, e as MermaidNode, f as MermaidEdge, g as NormalizedMermaidSource, h as RenderOptions, i as DiagramColors, P as PositionedDiagram, j as RenderContext, S as SceneDoc, A as AsciiConfig, C as ColorMode, k as AsciiTheme, L as LayoutRouteCertificate, l as AsciiRenderOptions, r as renderMermaidASCII$1, m as renderMermaidSVG$1, n as StyleInput } from './index-x2Cj1dVv.js';
2
- export { o as AnyPort, p as DiamondFacet, F as FamilyEdgeRouteCertificate, q as FamilyRouteCertificate, s as LayoutRouteClass, t as PortSemanticRole, u as PortSide, v as RouteBlocker, w as RouteCertificate, x as RoutePortAssignment, y as StyleSpec, T as TEXT_MEASUREMENT_CONTRACT, z as TextMeasurementContract, B as TextMeasurementInput, G as TextMeasurementResult, H as getStyle, I as inferBackend, J as knownStyles, K as measureText, O as measureTextWidth, Q as registerStyle, U as resolveStyleStack, V as validateStyleSpec, W as verifyNoExternalRefs } from './index-x2Cj1dVv.js';
1
+ import { N as NodeShape, E as EdgeStyle, M as MermaidFrontmatterMap, a as MermaidConfigMap, b as MermaidGraph, D as Direction, R as RouteClass, c as EdgeRouteCertificate, d as RegionContainmentCertificate, e as MermaidNode, f as MermaidEdge, g as NormalizedMermaidSource, h as RenderOptions, i as DiagramColors, P as PositionedDiagram, j as RenderContext, S as SceneDoc, A as AsciiConfig, C as ColorMode, k as AsciiTheme, L as LayoutRouteCertificate, l as AsciiRenderOptions, r as renderMermaidASCII$1, m as renderMermaidSVG$1, n as StyleInput } from './index-wjRjbsP-.js';
2
+ export { o as AnyPort, p as DiamondFacet, F as FamilyEdgeRouteCertificate, q as FamilyRouteCertificate, s as LayoutRouteClass, t as PortSemanticRole, u as PortSide, v as RouteBlocker, w as RouteCertificate, x as RoutePortAssignment, y as StyleSpec, T as TEXT_MEASUREMENT_CONTRACT, z as TextMeasurementContract, B as TextMeasurementInput, G as TextMeasurementResult, H as getStyle, I as inferBackend, J as knownStyles, K as measureText, O as measureTextWidth, Q as registerStyle, U as resolveStyleStack, V as validateStyleSpec, W as verifyNoExternalRefs } from './index-wjRjbsP-.js';
3
3
 
4
4
  type Result<T, E> = {
5
5
  ok: true;
@@ -691,6 +691,7 @@ type JourneyMutationOp = {
691
691
  } | {
692
692
  kind: 'add_section';
693
693
  label: string;
694
+ index?: number;
694
695
  } | {
695
696
  kind: 'remove_section';
696
697
  index: number;
@@ -704,6 +705,7 @@ type JourneyMutationOp = {
704
705
  text: string;
705
706
  score: number;
706
707
  actors?: string[];
708
+ index?: number;
707
709
  } | {
708
710
  kind: 'remove_task';
709
711
  sectionIndex: number;
@@ -727,6 +729,22 @@ type JourneyMutationOp = {
727
729
  kind: 'rename_actor';
728
730
  from: string;
729
731
  to: string;
732
+ } | {
733
+ kind: 'move_task';
734
+ fromSection: number;
735
+ fromIndex: number;
736
+ toSection: number;
737
+ toIndex: number;
738
+ } | {
739
+ kind: 'move_section';
740
+ from: number;
741
+ to: number;
742
+ } | {
743
+ kind: 'set_accessibility_title';
744
+ title: string | null;
745
+ } | {
746
+ kind: 'set_accessibility_description';
747
+ description: string | null;
730
748
  };
731
749
  type ArchitectureMutationOp = {
732
750
  kind: 'add_service';
@@ -968,7 +986,7 @@ type Tier2WarningCode = 'NODE_OVERLAP' | 'ROUTE_SELF_CROSS' | 'ROUTE_HITCH' | 'R
968
986
  * Tier 3 (advisory lint). Family-specific quality hints for common agent
969
987
  * mistakes that still parse and render. Lint warnings never flip verify.ok.
970
988
  */
971
- type Tier3WarningCode = 'DUPLICATE_EDGE' | 'UNREACHABLE_NODE' | 'DECISION_BRANCH_UNLABELED' | 'COMMENT_DROPPED' | 'UNSUPPORTED_SYNTAX' | 'CONTENT_DROPPED_ON_ROUNDTRIP';
989
+ type Tier3WarningCode = 'DUPLICATE_EDGE' | 'UNREACHABLE_NODE' | 'DECISION_BRANCH_UNLABELED' | 'COMMENT_DROPPED' | 'UNSUPPORTED_SYNTAX' | 'CONTENT_DROPPED_ON_ROUNDTRIP' | 'INEFFECTIVE_CONFIG';
972
990
  type WarningCode = Tier1WarningCode | Tier2WarningCode | Tier3WarningCode;
973
991
  type LayoutWarning = {
974
992
  code: 'EMPTY_DIAGRAM';
@@ -1093,6 +1111,17 @@ type LayoutWarning = {
1093
1111
  edges: number;
1094
1112
  groups: number;
1095
1113
  };
1114
+ }
1115
+ /**
1116
+ * A Mermaid config field was accepted (for config-shape compatibility) but
1117
+ * has no effect on this family's geometry or paint — e.g. Journey's
1118
+ * sequence-era fields. Accepting-and-ignoring silently misleads migrating
1119
+ * users; this lint says so. Never flips verify.ok.
1120
+ */
1121
+ | {
1122
+ code: 'INEFFECTIVE_CONFIG';
1123
+ field: string;
1124
+ message: string;
1096
1125
  };
1097
1126
  declare const WARNING_SEVERITY: Record<WarningCode, WarningSeverity>;
1098
1127
  declare const WARNING_TIER: Record<WarningCode, WarningTier>;
@@ -1540,7 +1569,7 @@ declare const MUTATION_OPS_BY_FAMILY: {
1540
1569
  readonly timeline: readonly ["set_title", "add_section", "remove_section", "set_section_label", "add_period", "remove_period", "set_period_label", "add_event", "remove_event", "set_event_text"];
1541
1570
  readonly class: readonly ["set_title", "add_class", "remove_class", "rename_class", "add_member", "remove_member", "add_relation", "remove_relation", "add_note", "remove_note"];
1542
1571
  readonly er: readonly ["add_entity", "remove_entity", "rename_entity", "add_attribute", "remove_attribute", "add_relation", "remove_relation"];
1543
- readonly journey: readonly ["set_title", "add_section", "remove_section", "set_section_label", "add_task", "remove_task", "set_task_text", "set_task_score", "set_task_actors", "rename_actor"];
1572
+ readonly journey: readonly ["set_title", "add_section", "remove_section", "set_section_label", "add_task", "remove_task", "set_task_text", "set_task_score", "set_task_actors", "rename_actor", "move_task", "move_section", "set_accessibility_title", "set_accessibility_description"];
1544
1573
  readonly architecture: readonly ["add_service", "remove_service", "rename_service", "set_service_label", "set_service_icon", "move_service", "add_group", "remove_group", "add_edge", "remove_edge"];
1545
1574
  readonly xychart: readonly ["set_title", "set_x_axis", "set_y_axis", "add_series", "remove_series", "set_series_values", "set_series_name", "reorder_series"];
1546
1575
  readonly pie: readonly ["set_title", "set_show_data", "add_slice", "remove_slice", "rename_slice", "set_slice_value", "reorder_slice"];
@@ -1801,6 +1830,21 @@ interface LayoutMermaidOptions {
1801
1830
  }
1802
1831
  declare function layoutMermaid(d: ValidDiagram, opts?: LayoutMermaidOptions): RenderedLayout;
1803
1832
 
1833
+ /**
1834
+ * Loud-tofu guard: emitted when rendered text contains characters no loaded
1835
+ * font covers (they would silently rasterize as empty boxes). Delivered to
1836
+ * `PngOptions.onWarning` when provided, otherwise written to stderr — never
1837
+ * silent either way.
1838
+ */
1839
+ interface PngFontWarning {
1840
+ code: 'PNG_FONT_COVERAGE';
1841
+ /** Coarse script bucket of the uncovered characters ('CJK', 'emoji', …). */
1842
+ script: string;
1843
+ /** The uncovered characters, unique, ascending codepoint order. */
1844
+ chars: string[];
1845
+ /** Human-readable summary naming the script and the escape hatches. */
1846
+ message: string;
1847
+ }
1804
1848
  interface PngOptions {
1805
1849
  /** Output scale multiplier (default 2 — retina). */
1806
1850
  scale?: number;
@@ -1818,8 +1862,18 @@ interface PngOptions {
1818
1862
  /** Ink-wobble seed for styled looks, same as RenderOptions.seed. */
1819
1863
  seed?: number;
1820
1864
  /** Extra font directories searched in addition to the bundled ones —
1821
- * the escape hatch for custom styles that reference unbundled families. */
1865
+ * the escape hatch for custom styles that reference unbundled families
1866
+ * and for scripts the bundled fonts don't cover (CJK, emoji). */
1822
1867
  fontDirs?: string[];
1868
+ /** Also load the OS's installed fonts (default false). Opting in trades
1869
+ * cross-machine determinism for coverage — useful when the diagram needs
1870
+ * CJK/emoji glyphs and a system font provides them. Coverage warnings are
1871
+ * skipped in this mode: the system font set is unknown to the checker. */
1872
+ loadSystemFonts?: boolean;
1873
+ /** Receives glyph-coverage warnings instead of the default stderr write.
1874
+ * Warnings never change the PNG bytes; identical inputs render
1875
+ * identically whether or not a handler is installed. */
1876
+ onWarning?: (warning: PngFontWarning) => void;
1823
1877
  }
1824
1878
  /**
1825
1879
  * Render a Mermaid diagram (source string or ValidDiagram) to a PNG byte array.