agentic-mermaid 0.4.1 → 0.5.3

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 (253) hide show
  1. package/AGENT_NATIVE.md +94 -627
  2. package/CHANGELOG.md +651 -0
  3. package/Instructions_for_agents.md +44 -23
  4. package/LICENSES/Khroma-MIT.txt +21 -0
  5. package/LICENSES/Mermaid-MIT.txt +21 -0
  6. package/LICENSES/es-toolkit-MIT.txt +21 -0
  7. package/LICENSES/pele-MIT.txt +40 -0
  8. package/LICENSES/zenuml-core-MIT.txt +21 -0
  9. package/README.md +93 -50
  10. package/SECURITY.md +28 -12
  11. package/THIRD_PARTY_NOTICES.md +60 -0
  12. package/assets/hero.png +0 -0
  13. package/dist/agent-core.d.ts +478 -210
  14. package/dist/agent-core.js +1 -396
  15. package/dist/agent.d.ts +17 -8
  16. package/dist/agent.js +1 -408
  17. package/dist/agentic-mermaid-mcp.js +1 -11
  18. package/dist/am.js +1 -34562
  19. package/dist/browser-lazy/chunks/agentic-producer-core-CC6OOLDW.js +1 -0
  20. package/dist/browser-lazy/chunks/architecture-QUFVKYJR.js +13 -0
  21. package/dist/browser-lazy/chunks/block-6J3Q63BO.js +11 -0
  22. package/dist/browser-lazy/chunks/builtin-backends-7SOZZHPF.js +12 -0
  23. package/dist/browser-lazy/chunks/c4-SQVBZAKJ.js +10 -0
  24. package/dist/browser-lazy/chunks/chunk-2GPK4VFF.js +5 -0
  25. package/dist/browser-lazy/chunks/chunk-2I4UPL7Q.js +3 -0
  26. package/dist/browser-lazy/chunks/chunk-2SH76OTH.js +1 -0
  27. package/dist/browser-lazy/chunks/chunk-2UIA2IME.js +3 -0
  28. package/dist/browser-lazy/chunks/chunk-4LHYF3BS.js +1 -0
  29. package/dist/browser-lazy/chunks/chunk-5B2Z7575.js +1 -0
  30. package/dist/browser-lazy/chunks/chunk-5FQ534HP.js +1 -0
  31. package/dist/browser-lazy/chunks/chunk-5UVGUSD6.js +1 -0
  32. package/dist/browser-lazy/chunks/chunk-5X6MJX3H.js +1 -0
  33. package/dist/browser-lazy/chunks/chunk-AMJLVPUB.js +4 -0
  34. package/dist/browser-lazy/chunks/chunk-BU5LHXNJ.js +3 -0
  35. package/dist/browser-lazy/chunks/chunk-BY2CPG6B.js +1 -0
  36. package/dist/browser-lazy/chunks/chunk-CN7WTBWB.js +1 -0
  37. package/dist/browser-lazy/chunks/chunk-CQE4HQEW.js +1 -0
  38. package/dist/browser-lazy/chunks/chunk-CSFUKSU6.js +1 -0
  39. package/dist/browser-lazy/chunks/chunk-DF6765YX.js +17 -0
  40. package/dist/browser-lazy/chunks/chunk-E2WMJZNM.js +1 -0
  41. package/dist/browser-lazy/chunks/chunk-FAIMVOX5.js +6 -0
  42. package/dist/browser-lazy/chunks/chunk-GVOEAY52.js +1 -0
  43. package/dist/browser-lazy/chunks/chunk-HLWUNUCM.js +1 -0
  44. package/dist/browser-lazy/chunks/chunk-ICC7HBJX.js +1 -0
  45. package/dist/browser-lazy/chunks/chunk-J35HAQQF.js +20 -0
  46. package/dist/browser-lazy/chunks/chunk-J7FFAFQF.js +1 -0
  47. package/dist/browser-lazy/chunks/chunk-LH7HUDKW.js +1 -0
  48. package/dist/browser-lazy/chunks/chunk-N5ELX7LR.js +2 -0
  49. package/dist/browser-lazy/chunks/chunk-NMQQMRIR.js +1 -0
  50. package/dist/browser-lazy/chunks/chunk-NO7ZIVRU.js +1 -0
  51. package/dist/browser-lazy/chunks/chunk-OZ443IVJ.js +16 -0
  52. package/dist/browser-lazy/chunks/chunk-PQGPS2YV.js +7 -0
  53. package/dist/browser-lazy/chunks/chunk-QA6GJQ4X.js +1 -0
  54. package/dist/browser-lazy/chunks/chunk-RIVTHZAQ.js +1 -0
  55. package/dist/browser-lazy/chunks/chunk-SZELX2EJ.js +1 -0
  56. package/dist/browser-lazy/chunks/chunk-TYZOZXUJ.js +22 -0
  57. package/dist/browser-lazy/chunks/chunk-UL6NDWLL.js +1 -0
  58. package/dist/browser-lazy/chunks/chunk-VQYYGAXP.js +1 -0
  59. package/dist/browser-lazy/chunks/chunk-VWVZGQE2.js +1 -0
  60. package/dist/browser-lazy/chunks/chunk-X2UYKWKM.js +4 -0
  61. package/dist/browser-lazy/chunks/chunk-YCEICNM6.js +1 -0
  62. package/dist/browser-lazy/chunks/chunk-Z3FDIVLN.js +20 -0
  63. package/dist/browser-lazy/chunks/class-5QA4SCTS.js +13 -0
  64. package/dist/browser-lazy/chunks/decode-63UIZGD2.js +1 -0
  65. package/dist/browser-lazy/chunks/elk.bundled-L4CADV5W.js +24 -0
  66. package/dist/browser-lazy/chunks/er-7ZSKGN7Y.js +11 -0
  67. package/dist/browser-lazy/chunks/eventmodeling-2BPLHWRN.js +19 -0
  68. package/dist/browser-lazy/chunks/flowchart-NEIMZTB5.js +4 -0
  69. package/dist/browser-lazy/chunks/forest-implementation-AEP24AIP.js +1 -0
  70. package/dist/browser-lazy/chunks/gantt-RDPIFYAF.js +11 -0
  71. package/dist/browser-lazy/chunks/gitgraph-N4Y5RYB7.js +9 -0
  72. package/dist/browser-lazy/chunks/ishikawa-LD3YBDJN.js +6 -0
  73. package/dist/browser-lazy/chunks/journey-6YQR5DJX.js +16 -0
  74. package/dist/browser-lazy/chunks/kanban-PLMJ7NBW.js +20 -0
  75. package/dist/browser-lazy/chunks/mermaid-yaml-runtime-QVYX4EWK.js +136 -0
  76. package/dist/browser-lazy/chunks/mindmap-K2UBFO3Y.js +12 -0
  77. package/dist/browser-lazy/chunks/packet-CUW4QY6Y.js +7 -0
  78. package/dist/browser-lazy/chunks/pie-7F7UUCG3.js +15 -0
  79. package/dist/browser-lazy/chunks/quadrant-TOONO2WC.js +10 -0
  80. package/dist/browser-lazy/chunks/radar-J6JVWVAX.js +16 -0
  81. package/dist/browser-lazy/chunks/render-core-BZOM3K7D.js +3 -0
  82. package/dist/browser-lazy/chunks/requirement-CMAKDJPO.js +19 -0
  83. package/dist/browser-lazy/chunks/sankey-AWXQEP3F.js +13 -0
  84. package/dist/browser-lazy/chunks/sequence-Q2RJRB4L.js +5 -0
  85. package/dist/browser-lazy/chunks/state-WRBFQEDX.js +4 -0
  86. package/dist/browser-lazy/chunks/timeline-D2KILFXM.js +6 -0
  87. package/dist/browser-lazy/chunks/treemap-N3VYX5D4.js +6 -0
  88. package/dist/browser-lazy/chunks/xychart-G73OGK66.js +16 -0
  89. package/dist/browser-lazy/chunks/zenuml-H4BXNYXR.js +16 -0
  90. package/dist/browser-lazy/index.d.ts +544 -275
  91. package/dist/browser-lazy/index.js +1 -1
  92. package/dist/browser.global.js +802 -565
  93. package/dist/chunk-3LGLPG33.js +2 -0
  94. package/dist/chunk-7CRDX2QR.js +2 -0
  95. package/dist/chunk-7PPW2BMO.js +2 -0
  96. package/dist/chunk-DQDKA5ND.js +2 -0
  97. package/dist/chunk-EHCMJUMD.js +52 -0
  98. package/dist/chunk-GVCHLSHH.js +4 -0
  99. package/dist/chunk-H3NCS2XZ.js +19 -0
  100. package/dist/chunk-JZOJ4YGS.js +201 -0
  101. package/dist/chunk-MKE7GNYU.js +146 -0
  102. package/dist/chunk-NKNFOREZ.js +2 -0
  103. package/dist/chunk-O7H2UX5K.js +2 -0
  104. package/dist/chunk-OMY6NRQD.js +58 -0
  105. package/dist/chunk-UA234O4M.js +4 -0
  106. package/dist/chunk-VUFVLGTH.js +2 -0
  107. package/dist/chunk-XU5LPD2D.js +2 -0
  108. package/dist/cli-YGGTJZH7.js +226 -0
  109. package/dist/elk-constructor.js +2 -0
  110. package/dist/elk-constructor.node.js +11 -0
  111. package/dist/index-EeXqJXr5.d.ts +1223 -0
  112. package/dist/index.d.ts +4 -1
  113. package/dist/index.js +1 -334
  114. package/dist/jsonl-RPJY6YWO.js +2 -0
  115. package/dist/mcp-cli-63DYXTVD.js +2 -0
  116. package/dist/{index-BGA_-6LV.d.ts → paint-certification-6rwQjIv_.d.ts} +5283 -6173
  117. package/dist/server-5NEOHOFS.js +524 -0
  118. package/dist/svg-styles-BdnoM7AT.d.ts +724 -0
  119. package/dist/svg-styles.d.ts +1 -0
  120. package/dist/svg-styles.js +2 -0
  121. package/dist/svg.d.ts +13 -0
  122. package/dist/svg.js +2 -0
  123. package/dist/types-BcS52Mjt.d.ts +1360 -0
  124. package/dist/zenuml/chunks/appearance-UOQ5KA6O.js +1 -0
  125. package/dist/zenuml/chunks/builtin-backends-KDKE7YHO.js +12 -0
  126. package/dist/zenuml/chunks/chunk-42DXZ5C6.js +4 -0
  127. package/dist/zenuml/chunks/chunk-7TVYPTDW.js +1 -0
  128. package/dist/zenuml/chunks/chunk-EVPSMEKN.js +1 -0
  129. package/dist/zenuml/chunks/chunk-OXQWRSBM.js +20 -0
  130. package/dist/zenuml/chunks/chunk-QWX77U7G.js +2 -0
  131. package/dist/zenuml/chunks/chunk-RLJEI7YN.js +29 -0
  132. package/dist/zenuml/chunks/chunk-RZ6XK5CD.js +29 -0
  133. package/dist/zenuml/chunks/decode-BWERFDGK.js +1 -0
  134. package/dist/zenuml/chunks/mermaid-yaml-runtime-KZVU74WU.js +136 -0
  135. package/dist/zenuml/chunks/render-core-V5RQ737O.js +3 -0
  136. package/dist/zenuml/chunks/zenuml-EA2ZFRUX.js +20 -0
  137. package/dist/zenuml-frame.global.js +3626 -0
  138. package/dist/zenuml.d.ts +83 -0
  139. package/dist/zenuml.js +1 -0
  140. package/docs/MCP-DIRECTORY-LISTINGS.md +5 -1
  141. package/docs/README.md +59 -103
  142. package/docs/agent-api-cookbook.md +26 -16
  143. package/docs/agent-mutation-policy.md +86 -15
  144. package/docs/agent-workflow-examples.md +1 -1
  145. package/docs/api-advanced.md +385 -0
  146. package/docs/api.md +320 -366
  147. package/docs/ascii.md +40 -4
  148. package/docs/browser.md +46 -7
  149. package/docs/choosing-a-diagram.md +148 -0
  150. package/docs/code-mode-impact.md +1 -0
  151. package/docs/comparison.md +244 -28
  152. package/docs/computational-aesthetics-prototype-plan.md +10 -10
  153. package/docs/config.md +60 -2
  154. package/docs/custom-fonts.md +78 -21
  155. package/docs/diagram-families.md +160 -10
  156. package/docs/eventmodeling-and-zenuml.md +165 -0
  157. package/docs/features.md +21 -19
  158. package/docs/fork-differences.md +105 -32
  159. package/docs/getting-started.md +56 -51
  160. package/docs/layout-certification.md +126 -0
  161. package/docs/mcp-code-mode-rationale.md +20 -12
  162. package/docs/mcp-http-transport.md +14 -8
  163. package/docs/quality.md +145 -15
  164. package/docs/react.md +76 -31
  165. package/docs/style-authoring.md +23 -11
  166. package/docs/svg-semantic-contract.md +104 -4
  167. package/docs/testing-strategy.md +684 -126
  168. package/docs/theming.md +27 -8
  169. package/examples/styles/readme-hero.md +25 -0
  170. package/examples/styles/readme-hero.mmd +13 -0
  171. package/examples/styles/readme-hero.style.json +7 -0
  172. package/package.json +114 -57
  173. package/server.json +2 -2
  174. package/skills/agentic-mermaid-diagram-workflow/SKILL.md +26 -8
  175. package/skills/agentic-mermaid-diagram-workflow/references/cli.md +13 -3
  176. package/skills/agentic-mermaid-diagram-workflow/references/code-mode.md +2 -1
  177. package/skills/agentic-mermaid-diagram-workflow/references/flowchart.md +9 -6
  178. package/skills/agentic-mermaid-diagram-workflow/references/hosted-mcp.md +1 -0
  179. package/skills/agentic-mermaid-diagram-workflow/references/sequence.md +4 -3
  180. package/skills/agentic-mermaid-diagram-workflow/references/timeline.md +7 -6
  181. package/skills/agentic-mermaid-diagram-workflow/references/upstream/agentflow.md +574 -0
  182. package/skills/agentic-mermaid-diagram-workflow/references/upstream/architecture.md +10 -2
  183. package/skills/agentic-mermaid-diagram-workflow/references/upstream/c4.md +18 -0
  184. package/skills/agentic-mermaid-diagram-workflow/references/upstream/classDiagram.md +123 -0
  185. package/skills/agentic-mermaid-diagram-workflow/references/upstream/cynefin.md +6 -1
  186. package/skills/agentic-mermaid-diagram-workflow/references/upstream/entityRelationshipDiagram.md +129 -9
  187. package/skills/agentic-mermaid-diagram-workflow/references/upstream/eventmodeling.md +22 -0
  188. package/skills/agentic-mermaid-diagram-workflow/references/upstream/flowchart.md +188 -60
  189. package/skills/agentic-mermaid-diagram-workflow/references/upstream/gitgraph.md +13 -7
  190. package/skills/agentic-mermaid-diagram-workflow/references/upstream/mindmap.md +110 -1
  191. package/skills/agentic-mermaid-diagram-workflow/references/upstream/packet.md +38 -0
  192. package/skills/agentic-mermaid-diagram-workflow/references/upstream/requirementDiagram.md +115 -0
  193. package/skills/agentic-mermaid-diagram-workflow/references/upstream/sequenceDiagram.md +101 -0
  194. package/skills/agentic-mermaid-diagram-workflow/references/upstream/stateDiagram.md +87 -0
  195. package/skills/agentic-mermaid-diagram-workflow/references/upstream/swimlanes.md +105 -2
  196. package/skills/agentic-mermaid-diagram-workflow/references/upstream/timeline.md +12 -6
  197. package/skills/agentic-mermaid-diagram-workflow/references/upstream/usecase.md +953 -0
  198. package/skills/agentic-mermaid-diagram-workflow/references/upstream/venn.md +77 -0
  199. package/skills/agentic-mermaid-diagram-workflow/references/upstream/xyChart.md +1 -1
  200. package/dist/browser-lazy/chunks/architecture-KTHE2HX3.js +0 -31
  201. package/dist/browser-lazy/chunks/chunk-2XCPFAD5.js +0 -46
  202. package/dist/browser-lazy/chunks/chunk-3H4F7RBT.js +0 -1
  203. package/dist/browser-lazy/chunks/chunk-4EVLW2NJ.js +0 -1
  204. package/dist/browser-lazy/chunks/chunk-5Q4S74UO.js +0 -1
  205. package/dist/browser-lazy/chunks/chunk-6OAPWSDO.js +0 -1
  206. package/dist/browser-lazy/chunks/chunk-A7L4WWVW.js +0 -143
  207. package/dist/browser-lazy/chunks/chunk-C7FJO2I3.js +0 -4
  208. package/dist/browser-lazy/chunks/chunk-D3XXDKIO.js +0 -1
  209. package/dist/browser-lazy/chunks/chunk-DXA5WL7H.js +0 -4
  210. package/dist/browser-lazy/chunks/chunk-EPFMQPXX.js +0 -1
  211. package/dist/browser-lazy/chunks/chunk-FFOHLPDA.js +0 -2
  212. package/dist/browser-lazy/chunks/chunk-FLD63DXE.js +0 -2
  213. package/dist/browser-lazy/chunks/chunk-G6OLSHRG.js +0 -7
  214. package/dist/browser-lazy/chunks/chunk-GRXCKTHX.js +0 -0
  215. package/dist/browser-lazy/chunks/chunk-I6VE56S7.js +0 -1
  216. package/dist/browser-lazy/chunks/chunk-KJVNXJ5Y.js +0 -1
  217. package/dist/browser-lazy/chunks/chunk-L227EPFP.js +0 -11
  218. package/dist/browser-lazy/chunks/chunk-LNIHDJSF.js +0 -1
  219. package/dist/browser-lazy/chunks/chunk-M6BT2HIP.js +0 -1
  220. package/dist/browser-lazy/chunks/chunk-NZRUMODH.js +0 -1
  221. package/dist/browser-lazy/chunks/chunk-OFRMKQA6.js +0 -1
  222. package/dist/browser-lazy/chunks/chunk-P7HMSKHJ.js +0 -1
  223. package/dist/browser-lazy/chunks/chunk-PXKL3O6H.js +0 -1
  224. package/dist/browser-lazy/chunks/chunk-PZEWZT35.js +0 -1
  225. package/dist/browser-lazy/chunks/chunk-STQRDZ67.js +0 -1
  226. package/dist/browser-lazy/chunks/chunk-SUFMSWTX.js +0 -1
  227. package/dist/browser-lazy/chunks/chunk-T7IJ6V4B.js +0 -3
  228. package/dist/browser-lazy/chunks/chunk-UAEZO5VL.js +0 -1
  229. package/dist/browser-lazy/chunks/chunk-WEUWIFG3.js +0 -1
  230. package/dist/browser-lazy/chunks/chunk-X64T74C5.js +0 -24
  231. package/dist/browser-lazy/chunks/class-F7R6TJ73.js +0 -9
  232. package/dist/browser-lazy/chunks/er-BDK7CM5L.js +0 -9
  233. package/dist/browser-lazy/chunks/flowchart-KFU6XV7S.js +0 -4
  234. package/dist/browser-lazy/chunks/gantt-I64VVDSP.js +0 -28
  235. package/dist/browser-lazy/chunks/gitgraph-EDUVJ5IJ.js +0 -8
  236. package/dist/browser-lazy/chunks/journey-TLO2RNM3.js +0 -40
  237. package/dist/browser-lazy/chunks/mindmap-OJCNDYPM.js +0 -9
  238. package/dist/browser-lazy/chunks/pie-HVG6XO7K.js +0 -19
  239. package/dist/browser-lazy/chunks/quadrant-U6S2L4MJ.js +0 -24
  240. package/dist/browser-lazy/chunks/radar-ZDLOBTVG.js +0 -32
  241. package/dist/browser-lazy/chunks/render-core-Y2DFNMQG.js +0 -12
  242. package/dist/browser-lazy/chunks/sequence-Z4WFS3VB.js +0 -12
  243. package/dist/browser-lazy/chunks/state-2HV2YGN3.js +0 -4
  244. package/dist/browser-lazy/chunks/timeline-XM4UFPOC.js +0 -20
  245. package/dist/browser-lazy/chunks/xychart-7JDHWTQY.js +0 -36
  246. package/dist/chunk-GGXCNCNA.js +0 -4118
  247. package/dist/chunk-IVD4NXNE.js +0 -615
  248. package/dist/chunk-JDMRPUAG.js +0 -37
  249. package/dist/chunk-JWAAW3FH.js +0 -149
  250. package/dist/chunk-LCGBT32P.js +0 -62036
  251. package/dist/chunk-RWMZRUIC.js +0 -4715
  252. package/dist/mcp-cli-4MLKC3ZH.js +0 -17
  253. package/docs/mutation-testing.md +0 -285
@@ -142,7 +142,7 @@ declare const EXACT_ROLE_STYLE_CONTRACT: Readonly<{
142
142
  }>;
143
143
  readonly bar: Readonly<{
144
144
  properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth"];
145
- bindingFamilies: readonly ["xychart"];
145
+ bindingFamilies: readonly ["xychart", "sankey", "treemap"];
146
146
  }>;
147
147
  readonly series: Readonly<{
148
148
  properties: readonly ["borderColor", "strokeColor", "lineWidth"];
@@ -150,7 +150,7 @@ declare const EXACT_ROLE_STYLE_CONTRACT: Readonly<{
150
150
  }>;
151
151
  readonly point: Readonly<{
152
152
  properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth"];
153
- bindingFamilies: readonly ["radar"];
153
+ bindingFamilies: readonly ["radar", "xychart"];
154
154
  }>;
155
155
  readonly task: Readonly<{
156
156
  properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth", "cue"];
@@ -172,15 +172,6 @@ type RoleStyles = {
172
172
  [Role in ExactStyleSceneRole]?: Readonly<RoleStyleFor<Role>>;
173
173
  };
174
174
 
175
- /**
176
- * Stable role vocabulary shared by every Scene backend. Built-in roles keep
177
- * their existing rendering policy, while extensions must use a namespace
178
- * (`vendor:role`) so they cannot accidentally acquire new core semantics.
179
- */
180
-
181
- type CoreSceneRole = 'node' | 'edge' | 'edge-label' | 'group' | 'group-header' | 'label' | 'title' | 'defs' | 'prelude' | 'chrome';
182
- type BuiltinSceneRole = CoreSceneRole | 'actor' | 'lifeline' | 'activation' | 'message' | 'block' | 'note' | 'class-box' | 'member' | 'entity' | 'attribute' | 'relationship' | 'cardinality' | 'pie-slice' | 'legend' | 'bar' | 'series' | 'point' | 'axis' | 'grid' | 'plate' | 'section' | 'task' | 'milestone' | 'marker-line' | 'rail' | 'period' | 'event' | 'score' | 'actor-pill' | 'service' | 'junction' | 'icon';
183
-
184
175
  type BrandConstraintAction = 'warn' | 'error';
185
176
  type BrandConstraintFieldDescriptor = {
186
177
  readonly kind: 'role';
@@ -252,6 +243,261 @@ type BrandConstraint = {
252
243
  } & ConstraintPayload<Kind>>;
253
244
  }[BrandConstraintKind];
254
245
 
246
+ /**
247
+ * One authority for the public palette vocabulary. The runtime validator,
248
+ * TypeScript type, JSON Schema, and generated field reference all project
249
+ * from this record.
250
+ */
251
+ declare const STYLE_COLOR_TOKEN_DESCRIPTORS: {
252
+ readonly bg: {
253
+ readonly description: "Diagram page background.";
254
+ };
255
+ readonly fg: {
256
+ readonly description: "Primary text and foreground paint.";
257
+ };
258
+ readonly line: {
259
+ readonly description: "Connector and secondary line paint.";
260
+ };
261
+ readonly accent: {
262
+ readonly description: "Accent paint for emphasis and data series.";
263
+ };
264
+ readonly muted: {
265
+ readonly description: "Muted text and secondary data paint.";
266
+ };
267
+ readonly surface: {
268
+ readonly description: "Node and group surface fill.";
269
+ };
270
+ readonly border: {
271
+ readonly description: "Node and group border paint.";
272
+ };
273
+ };
274
+ type StyleColors = {
275
+ -readonly [Key in keyof typeof STYLE_COLOR_TOKEN_DESCRIPTORS]?: string;
276
+ };
277
+ declare const SEMANTIC_BINDING_CHANNELS: readonly ["category"];
278
+ type SemanticBindingChannel = typeof SEMANTIC_BINDING_CHANNELS[number];
279
+ interface SemanticBinding {
280
+ readonly channel: SemanticBindingChannel;
281
+ readonly value: string;
282
+ readonly slot: string;
283
+ readonly role?: BindableSceneRole;
284
+ }
285
+ type SemanticSlots = Readonly<Record<string, Readonly<RoleStyleSpec>>>;
286
+ /**
287
+ * One authority for every public StyleSpec field and constraint. Keep
288
+ * renderer-private face defaults out of this manifest: they are not part of
289
+ * the external style contract.
290
+ */
291
+ declare const STYLE_SPEC_FIELD_DESCRIPTORS: {
292
+ readonly formatVersion: {
293
+ readonly kind: "const";
294
+ readonly value: 1;
295
+ readonly group: "metadata";
296
+ readonly description: "Persisted wire-format version. Optional on input and normalized to 1 on output.";
297
+ };
298
+ readonly $schema: {
299
+ readonly kind: "string";
300
+ readonly group: "metadata";
301
+ readonly description: "Optional JSON Schema pointer for file-backed styles; ignored while rendering.";
302
+ };
303
+ readonly name: {
304
+ readonly kind: "string";
305
+ readonly group: "metadata";
306
+ readonly description: "Canonical look:name or palette:name identity; required only when registering a style.";
307
+ };
308
+ readonly blurb: {
309
+ readonly kind: "string";
310
+ readonly group: "metadata";
311
+ readonly description: "Short human-readable description used by discovery surfaces.";
312
+ };
313
+ readonly colors: {
314
+ readonly kind: "colors";
315
+ readonly group: "palette";
316
+ readonly description: "Partial palette of safe, non-fetching CSS color tokens.";
317
+ };
318
+ readonly font: {
319
+ readonly kind: "string";
320
+ readonly runtimeValidator: "safeCssFontFamily";
321
+ readonly group: "typography";
322
+ readonly description: "Safe, non-fetching CSS font family or stack; the rendering environment supplies the font face.";
323
+ };
324
+ readonly roles: {
325
+ readonly kind: "roles";
326
+ readonly group: "roles";
327
+ readonly description: "Partial semantic SceneRole defaults. Family-authored styling remains authoritative.";
328
+ };
329
+ readonly semanticSlots: {
330
+ readonly kind: "semanticSlots";
331
+ readonly group: "policy";
332
+ readonly description: "Named brand-neutral role-style slots selected by semantic bindings.";
333
+ };
334
+ readonly bindings: {
335
+ readonly kind: "bindings";
336
+ readonly group: "policy";
337
+ readonly description: "Ordered equality bindings from authored/domain meaning to semantic slots.";
338
+ };
339
+ readonly constraints: {
340
+ readonly kind: "constraints";
341
+ readonly group: "policy";
342
+ readonly description: "Closed inspect-only brand constraints with warn or error actions.";
343
+ };
344
+ readonly stroke: {
345
+ readonly kind: "enum";
346
+ readonly values: readonly ["crisp", "jittered", "freehand"];
347
+ readonly group: "stroke";
348
+ readonly description: "Stroke treatment; crisp is the default renderer.";
349
+ };
350
+ readonly roughness: {
351
+ readonly kind: "number";
352
+ readonly minimum: 0;
353
+ readonly maximum: 10;
354
+ readonly expected: "between 0 and 10";
355
+ readonly group: "stroke";
356
+ readonly description: "Rough.js stroke irregularity.";
357
+ };
358
+ readonly bowing: {
359
+ readonly kind: "number";
360
+ readonly minimum: 0;
361
+ readonly maximum: 10;
362
+ readonly expected: "between 0 and 10";
363
+ readonly group: "stroke";
364
+ readonly description: "Rough.js line bowing.";
365
+ };
366
+ readonly passes: {
367
+ readonly kind: "integer";
368
+ readonly minimum: 1;
369
+ readonly maximum: 8;
370
+ readonly expected: "an integer from 1 through 8";
371
+ readonly group: "stroke";
372
+ readonly description: "Number of sketch strokes; 1 is single-pass and 2 is the usual double stroke.";
373
+ };
374
+ readonly strokeWidth: {
375
+ readonly kind: "number";
376
+ readonly exclusiveMinimum: 0;
377
+ readonly maximum: 20;
378
+ readonly expected: "greater than 0 and at most 20";
379
+ readonly group: "stroke";
380
+ readonly description: "Base stroke width in SVG user units.";
381
+ };
382
+ readonly fill: {
383
+ readonly kind: "enum";
384
+ readonly values: readonly ["none", "hachure", "solid", "wash"];
385
+ readonly group: "fill";
386
+ readonly description: "Fill policy for rough/hybrid rendering; none and solid require a final stack that activates one of those backends.";
387
+ };
388
+ readonly hachureAngle: {
389
+ readonly kind: "number";
390
+ readonly minimum: -360;
391
+ readonly maximum: 360;
392
+ readonly expected: "between -360 and 360";
393
+ readonly group: "fill";
394
+ readonly description: "Hachure line angle in degrees; requires fill hachure in the final stack.";
395
+ };
396
+ readonly hachureGap: {
397
+ readonly kind: "number";
398
+ readonly exclusiveMinimum: 0;
399
+ readonly maximum: 100;
400
+ readonly expected: "greater than 0 and at most 100";
401
+ readonly group: "fill";
402
+ readonly description: "Gap between hachure lines; requires fill hachure in the final stack.";
403
+ };
404
+ readonly fillWeight: {
405
+ readonly kind: "number";
406
+ readonly exclusiveMinimum: 0;
407
+ readonly maximum: 20;
408
+ readonly expected: "greater than 0 and at most 20";
409
+ readonly group: "fill";
410
+ readonly description: "Hachure line weight; requires fill hachure in the final stack.";
411
+ };
412
+ readonly washOpacity: {
413
+ readonly kind: "number";
414
+ readonly minimum: 0;
415
+ readonly maximum: 1;
416
+ readonly expected: "between 0 and 1";
417
+ readonly group: "fill";
418
+ readonly description: "Watercolor glaze opacity; requires fill wash in the final stack.";
419
+ };
420
+ readonly washEdge: {
421
+ readonly kind: "number";
422
+ readonly minimum: 0;
423
+ readonly maximum: 1;
424
+ readonly expected: "between 0 and 1";
425
+ readonly group: "fill";
426
+ readonly description: "Watercolor edge-darkening opacity; requires fill wash in the final stack.";
427
+ };
428
+ readonly backdrop: {
429
+ readonly kind: "enum";
430
+ readonly values: readonly ["plain", "paper-ruled", "grid"];
431
+ readonly group: "page";
432
+ readonly description: "Flat page furniture drawn behind the diagram.";
433
+ };
434
+ readonly intent: {
435
+ readonly kind: "enum";
436
+ readonly values: readonly ["premium", "draft", "lofi"];
437
+ readonly group: "advisory";
438
+ readonly description: "Advisory intent metadata for pickers and quality tooling.";
439
+ };
440
+ readonly mono: {
441
+ readonly kind: "boolean";
442
+ readonly group: "advisory";
443
+ readonly description: "Advisory monochrome contract: express tone through shading and weight.";
444
+ };
445
+ };
446
+ type DescriptorValue<Descriptor> = Descriptor extends {
447
+ readonly kind: 'const';
448
+ readonly value: infer Value;
449
+ } ? Value : Descriptor extends {
450
+ readonly kind: 'string';
451
+ } ? string : Descriptor extends {
452
+ readonly kind: 'boolean';
453
+ } ? boolean : Descriptor extends {
454
+ readonly kind: 'number' | 'integer';
455
+ } ? number : Descriptor extends {
456
+ readonly kind: 'enum';
457
+ readonly values: readonly (infer Value)[];
458
+ } ? Value : Descriptor extends {
459
+ readonly kind: 'colors';
460
+ } ? StyleColors : Descriptor extends {
461
+ readonly kind: 'roles';
462
+ } ? RoleStyles : Descriptor extends {
463
+ readonly kind: 'semanticSlots';
464
+ } ? SemanticSlots : Descriptor extends {
465
+ readonly kind: 'bindings';
466
+ } ? readonly SemanticBinding[] : Descriptor extends {
467
+ readonly kind: 'constraints';
468
+ } ? readonly BrandConstraint[] : never;
469
+ /** A partial, composable public description of how diagrams look. */
470
+ type StyleSpec = {
471
+ -readonly [Key in keyof typeof STYLE_SPEC_FIELD_DESCRIPTORS]?: DescriptorValue<(typeof STYLE_SPEC_FIELD_DESCRIPTORS)[Key]>;
472
+ };
473
+
474
+ /** What RenderOptions.style accepts: a registered name, an inline spec, or a
475
+ * stack of either (merged left → right). */
476
+ type StyleInput = string | StyleSpec;
477
+
478
+ /**
479
+ * Stable role vocabulary shared by every Scene backend. Built-in roles keep
480
+ * their existing rendering policy, while extensions must use a namespace
481
+ * (`vendor:role`) so they cannot accidentally acquire new core semantics.
482
+ */
483
+
484
+ type CoreSceneRole = 'node' | 'edge' | 'edge-label' | 'group' | 'group-header' | 'label' | 'title' | 'defs' | 'prelude' | 'chrome';
485
+ type BuiltinSceneRole = CoreSceneRole | 'actor' | 'lifeline' | 'activation' | 'message' | 'block' | 'note' | 'class-box' | 'member' | 'entity' | 'attribute' | 'relationship' | 'cardinality' | 'pie-slice' | 'legend' | 'bar' | 'series' | 'point' | 'axis' | 'grid' | 'plate' | 'section' | 'task' | 'milestone' | 'marker-line' | 'rail' | 'period' | 'event' | 'score' | 'actor-pill' | 'service' | 'junction' | 'icon';
486
+
487
+ interface GraphLayoutDecision {
488
+ readonly requested: 'elk' | 'agentic';
489
+ readonly fallback: 'none' | 'elk';
490
+ readonly selected: 'elk' | 'agentic';
491
+ readonly reason?: string;
492
+ readonly attempts: readonly {
493
+ readonly backend: 'elk' | 'agentic';
494
+ readonly outcome: 'selected' | 'unsupported' | 'candidate-rejected';
495
+ readonly reason?: string;
496
+ }[];
497
+ readonly implementation: string;
498
+ readonly role?: 'primary' | 'companion';
499
+ }
500
+
255
501
  type MermaidConfigScalar = string | number | boolean | null;
256
502
  type MermaidConfigValue = MermaidConfigScalar | MermaidConfigValue[] | MermaidConfigMap;
257
503
  interface MermaidConfigMap {
@@ -265,7 +511,7 @@ interface TimelineRuntimeConfig extends MermaidConfigMap {
265
511
  sectionFills?: string[];
266
512
  sectionColours?: string[];
267
513
  }
268
- /** Mermaid stateDiagram config. Faithful ELK/measured-text fields are wired; legacy fields warn. */
514
+ /** Mermaid stateDiagram config. Faithful ELK/measured-text fields are wired; unsupported fields warn. */
269
515
  interface StateRuntimeConfig extends MermaidConfigMap {
270
516
  titleTopMargin?: number;
271
517
  arrowMarkerAbsolute?: boolean;
@@ -287,6 +533,11 @@ interface StateRuntimeConfig extends MermaidConfigMap {
287
533
  compositTitleSize?: number;
288
534
  radius?: number;
289
535
  defaultRenderer?: 'dagre-d3' | 'dagre-wrapper' | 'elk';
536
+ layout?: string;
537
+ look?: string;
538
+ minNodeWidth?: number;
539
+ theme?: string;
540
+ wrappingWidth?: number;
290
541
  }
291
542
  interface XyChartRuntimeConfig extends MermaidConfigMap {
292
543
  width?: number;
@@ -298,6 +549,7 @@ interface XyChartRuntimeConfig extends MermaidConfigMap {
298
549
  chartOrientation?: 'vertical' | 'horizontal';
299
550
  plotReservedSpacePercent?: number;
300
551
  showDataLabel?: boolean;
552
+ showDataLabelOutsideBar?: boolean;
301
553
  showTitle?: boolean;
302
554
  showLegend?: boolean;
303
555
  legendFontSize?: number;
@@ -313,6 +565,20 @@ interface PieRuntimeConfig extends MermaidConfigMap {
313
565
  useMaxWidth?: boolean;
314
566
  useWidth?: number;
315
567
  }
568
+ interface SankeyRuntimeConfig extends MermaidConfigMap {
569
+ width?: number;
570
+ height?: number;
571
+ linkColor?: 'source' | 'target' | 'gradient' | string;
572
+ nodeAlignment?: 'justify' | 'center' | 'left' | 'right';
573
+ showValues?: boolean;
574
+ prefix?: string;
575
+ suffix?: string;
576
+ labelStyle?: 'legacy' | 'outlined';
577
+ nodeWidth?: number;
578
+ nodePadding?: number;
579
+ nodeColors?: Record<string, string>;
580
+ useMaxWidth?: boolean;
581
+ }
316
582
  interface RadarRuntimeConfig extends MermaidConfigMap {
317
583
  width?: number;
318
584
  height?: number;
@@ -412,7 +678,7 @@ interface GitGraphRuntimeConfig extends MermaidConfigMap {
412
678
  * nodeSpacing/rankSpacing are wired into the ELK layout
413
679
  * (src/class/layout.ts resolveClassRenderOptions); every other documented
414
680
  * key is accepted for config-shape compatibility and named by verify's
415
- * INEFFECTIVE_CONFIG lint (CLASS_NOOP_CONFIG_FIELDS in src/agent/verify.ts).
681
+ * INEFFECTIVE_CONFIG lint (the family's config.noopKeys in src/agent/families.ts).
416
682
  */
417
683
  interface ClassRuntimeConfig extends MermaidConfigMap {
418
684
  nodeSpacing?: number;
@@ -432,7 +698,7 @@ interface ClassRuntimeConfig extends MermaidConfigMap {
432
698
  * Mermaid's documented er config shape (wire-or-warn, P4): layoutDirection +
433
699
  * nodeSpacing/rankSpacing are wired (src/er/layout.ts
434
700
  * applyErFrontmatterConfig); the rest emit INEFFECTIVE_CONFIG
435
- * (ER_NOOP_CONFIG_FIELDS in src/agent/verify.ts).
701
+ * (the family's config.noopKeys in src/agent/families.ts).
436
702
  */
437
703
  interface ErRuntimeConfig extends MermaidConfigMap {
438
704
  layoutDirection?: string;
@@ -452,8 +718,8 @@ interface ErRuntimeConfig extends MermaidConfigMap {
452
718
  * iconSize, fontSize, nodeSeparation, and idealEdgeLengthMultiplier are wired
453
719
  * (src/architecture/config.ts); the fcose simulation knobs — edgeElasticity,
454
720
  * numIter, seed, randomize — have no meaning in the deterministic layout and
455
- * emit INEFFECTIVE_CONFIG (ARCHITECTURE_NOOP_CONFIG_FIELDS in
456
- * src/architecture/config.ts).
721
+ * emit INEFFECTIVE_CONFIG (the family's config.noopKeys in
722
+ * src/agent/families.ts).
457
723
  */
458
724
  interface ArchitectureRuntimeConfig extends MermaidConfigMap {
459
725
  padding?: number;
@@ -471,8 +737,8 @@ interface ArchitectureRuntimeConfig extends MermaidConfigMap {
471
737
  * nodeSpacing/rankSpacing/wrappingWidth are wired
472
738
  * (src/flowchart-config.ts resolveFlowchartRenderOptions); every other
473
739
  * documented key is accepted for config-shape compatibility and named by
474
- * verify's INEFFECTIVE_CONFIG lint (FLOWCHART_NOOP_CONFIG_FIELDS in
475
- * src/flowchart-config.ts).
740
+ * verify's INEFFECTIVE_CONFIG lint (the family's config.noopKeys in
741
+ * src/agent/families.ts).
476
742
  */
477
743
  interface FlowchartRuntimeConfig extends MermaidConfigMap {
478
744
  nodeSpacing?: number;
@@ -494,8 +760,8 @@ interface FlowchartRuntimeConfig extends MermaidConfigMap {
494
760
  * and showSequenceNumbers are wired (src/sequence/config.ts
495
761
  * resolveSequenceConfig → src/sequence/layout.ts); every other documented key
496
762
  * is accepted for config-shape compatibility and named by verify's
497
- * INEFFECTIVE_CONFIG lint (SEQUENCE_NOOP_CONFIG_FIELDS in
498
- * src/sequence/config.ts).
763
+ * INEFFECTIVE_CONFIG lint (the family's config.noopKeys in
764
+ * src/agent/families.ts).
499
765
  */
500
766
  interface SequenceRuntimeConfig extends MermaidConfigMap {
501
767
  actorMargin?: number;
@@ -531,261 +797,53 @@ interface SequenceRuntimeConfig extends MermaidConfigMap {
531
797
  messageFontFamily?: string;
532
798
  messageFontWeight?: string | number;
533
799
  }
534
- interface MermaidRuntimeConfig extends MermaidConfigMap {
535
- theme?: string;
536
- fontFamily?: string;
537
- themeVariables?: MermaidThemeVariables;
538
- flowchart?: FlowchartRuntimeConfig;
539
- state?: StateRuntimeConfig;
540
- timeline?: TimelineRuntimeConfig;
541
- journey?: JourneyRuntimeConfig;
542
- xyChart?: XyChartRuntimeConfig;
543
- pie?: PieRuntimeConfig;
544
- quadrantChart?: QuadrantRuntimeConfig;
545
- radar?: RadarRuntimeConfig;
546
- gantt?: GanttRuntimeConfig;
547
- sequence?: SequenceRuntimeConfig;
548
- class?: ClassRuntimeConfig;
549
- er?: ErRuntimeConfig;
550
- architecture?: ArchitectureRuntimeConfig;
551
- mindmap?: MindmapRuntimeConfig;
552
- gitGraph?: GitGraphRuntimeConfig;
553
- useMaxWidth?: boolean;
554
- useWidth?: number;
555
- themeCSS?: string;
556
- }
557
-
558
- /**
559
- * One authority for the public palette vocabulary. The runtime validator,
560
- * TypeScript type, JSON Schema, and generated field reference all project
561
- * from this record.
562
- */
563
- declare const STYLE_COLOR_TOKEN_DESCRIPTORS: {
564
- readonly bg: {
565
- readonly description: "Diagram page background.";
566
- };
567
- readonly fg: {
568
- readonly description: "Primary text and foreground paint.";
569
- };
570
- readonly line: {
571
- readonly description: "Connector and secondary line paint.";
572
- };
573
- readonly accent: {
574
- readonly description: "Accent paint for emphasis and data series.";
575
- };
576
- readonly muted: {
577
- readonly description: "Muted text and secondary data paint.";
578
- };
579
- readonly surface: {
580
- readonly description: "Node and group surface fill.";
581
- };
582
- readonly border: {
583
- readonly description: "Node and group border paint.";
584
- };
585
- };
586
- type StyleColors = {
587
- -readonly [Key in keyof typeof STYLE_COLOR_TOKEN_DESCRIPTORS]?: string;
588
- };
589
- declare const SEMANTIC_BINDING_CHANNELS: readonly ["category"];
590
- type SemanticBindingChannel = typeof SEMANTIC_BINDING_CHANNELS[number];
591
- interface SemanticBinding {
592
- readonly channel: SemanticBindingChannel;
593
- readonly value: string;
594
- readonly slot: string;
595
- readonly role?: BindableSceneRole;
800
+ /** C4 spacing is pixel-space; terminal layout allocates its own cell geometry. */
801
+ interface C4RuntimeConfig extends MermaidConfigMap {
802
+ /** Reflow budget in pixels; minimum legible geometry may exceed it with a diagnostic. */
803
+ maxWidth?: number;
804
+ /** Compact independently measured pixel and terminal layouts. */
805
+ compact?: boolean;
806
+ /** Automatic semantic type legend; authored legend directives remain independent. */
807
+ typeLegend?: boolean;
808
+ diagramMarginX?: number;
809
+ diagramMarginY?: number;
810
+ c4ShapeMargin?: number;
811
+ c4ShapePadding?: number;
812
+ width?: number;
813
+ height?: number;
814
+ boxMargin?: number;
815
+ nextLinePaddingX?: number;
816
+ c4ShapeInRow?: number;
817
+ c4BoundaryInRow?: number;
818
+ wrap?: boolean;
819
+ wrapPadding?: number;
820
+ useMaxWidth?: boolean;
821
+ }
822
+ interface MermaidRuntimeConfig extends MermaidConfigMap {
823
+ theme?: string;
824
+ fontFamily?: string;
825
+ themeVariables?: MermaidThemeVariables;
826
+ flowchart?: FlowchartRuntimeConfig;
827
+ state?: StateRuntimeConfig;
828
+ timeline?: TimelineRuntimeConfig;
829
+ journey?: JourneyRuntimeConfig;
830
+ xyChart?: XyChartRuntimeConfig;
831
+ pie?: PieRuntimeConfig;
832
+ quadrantChart?: QuadrantRuntimeConfig;
833
+ radar?: RadarRuntimeConfig;
834
+ sankey?: SankeyRuntimeConfig;
835
+ c4?: C4RuntimeConfig;
836
+ gantt?: GanttRuntimeConfig;
837
+ sequence?: SequenceRuntimeConfig;
838
+ class?: ClassRuntimeConfig;
839
+ er?: ErRuntimeConfig;
840
+ architecture?: ArchitectureRuntimeConfig;
841
+ mindmap?: MindmapRuntimeConfig;
842
+ gitGraph?: GitGraphRuntimeConfig;
843
+ useMaxWidth?: boolean;
844
+ useWidth?: number;
845
+ themeCSS?: string;
596
846
  }
597
- type SemanticSlots = Readonly<Record<string, Readonly<RoleStyleSpec>>>;
598
- /**
599
- * One authority for every public StyleSpec field and constraint. Keep
600
- * renderer-private face defaults out of this manifest: they are not part of
601
- * the external style contract.
602
- */
603
- declare const STYLE_SPEC_FIELD_DESCRIPTORS: {
604
- readonly formatVersion: {
605
- readonly kind: "const";
606
- readonly value: 1;
607
- readonly group: "metadata";
608
- readonly description: "Persisted wire-format version. Optional on input and normalized to 1 on output.";
609
- };
610
- readonly $schema: {
611
- readonly kind: "string";
612
- readonly group: "metadata";
613
- readonly description: "Optional JSON Schema pointer for file-backed styles; ignored while rendering.";
614
- };
615
- readonly name: {
616
- readonly kind: "string";
617
- readonly group: "metadata";
618
- readonly description: "Canonical look:name or palette:name identity; required only when registering a style.";
619
- };
620
- readonly blurb: {
621
- readonly kind: "string";
622
- readonly group: "metadata";
623
- readonly description: "Short human-readable description used by discovery surfaces.";
624
- };
625
- readonly colors: {
626
- readonly kind: "colors";
627
- readonly group: "palette";
628
- readonly description: "Partial palette of safe, non-fetching CSS color tokens.";
629
- };
630
- readonly font: {
631
- readonly kind: "string";
632
- readonly runtimeValidator: "safeCssFontFamily";
633
- readonly group: "typography";
634
- readonly description: "Safe, non-fetching CSS font family or stack; the rendering environment supplies the font face.";
635
- };
636
- readonly roles: {
637
- readonly kind: "roles";
638
- readonly group: "roles";
639
- readonly description: "Partial semantic SceneRole defaults. Family-authored styling remains authoritative.";
640
- };
641
- readonly semanticSlots: {
642
- readonly kind: "semanticSlots";
643
- readonly group: "policy";
644
- readonly description: "Named brand-neutral role-style slots selected by semantic bindings.";
645
- };
646
- readonly bindings: {
647
- readonly kind: "bindings";
648
- readonly group: "policy";
649
- readonly description: "Ordered equality bindings from authored/domain meaning to semantic slots.";
650
- };
651
- readonly constraints: {
652
- readonly kind: "constraints";
653
- readonly group: "policy";
654
- readonly description: "Closed inspect-only brand constraints with warn or error actions.";
655
- };
656
- readonly stroke: {
657
- readonly kind: "enum";
658
- readonly values: readonly ["crisp", "jittered", "freehand"];
659
- readonly group: "stroke";
660
- readonly description: "Stroke treatment; crisp is the default renderer.";
661
- };
662
- readonly roughness: {
663
- readonly kind: "number";
664
- readonly minimum: 0;
665
- readonly maximum: 10;
666
- readonly expected: "between 0 and 10";
667
- readonly group: "stroke";
668
- readonly description: "Rough.js stroke irregularity.";
669
- };
670
- readonly bowing: {
671
- readonly kind: "number";
672
- readonly minimum: 0;
673
- readonly maximum: 10;
674
- readonly expected: "between 0 and 10";
675
- readonly group: "stroke";
676
- readonly description: "Rough.js line bowing.";
677
- };
678
- readonly passes: {
679
- readonly kind: "integer";
680
- readonly minimum: 1;
681
- readonly maximum: 8;
682
- readonly expected: "an integer from 1 through 8";
683
- readonly group: "stroke";
684
- readonly description: "Number of sketch strokes; 1 is single-pass and 2 is the usual double stroke.";
685
- };
686
- readonly strokeWidth: {
687
- readonly kind: "number";
688
- readonly exclusiveMinimum: 0;
689
- readonly maximum: 20;
690
- readonly expected: "greater than 0 and at most 20";
691
- readonly group: "stroke";
692
- readonly description: "Base stroke width in SVG user units.";
693
- };
694
- readonly fill: {
695
- readonly kind: "enum";
696
- readonly values: readonly ["none", "hachure", "solid", "wash"];
697
- readonly group: "fill";
698
- readonly description: "Fill policy for rough/hybrid rendering; none and solid require a final stack that activates one of those backends.";
699
- };
700
- readonly hachureAngle: {
701
- readonly kind: "number";
702
- readonly minimum: -360;
703
- readonly maximum: 360;
704
- readonly expected: "between -360 and 360";
705
- readonly group: "fill";
706
- readonly description: "Hachure line angle in degrees; requires fill hachure in the final stack.";
707
- };
708
- readonly hachureGap: {
709
- readonly kind: "number";
710
- readonly exclusiveMinimum: 0;
711
- readonly maximum: 100;
712
- readonly expected: "greater than 0 and at most 100";
713
- readonly group: "fill";
714
- readonly description: "Gap between hachure lines; requires fill hachure in the final stack.";
715
- };
716
- readonly fillWeight: {
717
- readonly kind: "number";
718
- readonly exclusiveMinimum: 0;
719
- readonly maximum: 20;
720
- readonly expected: "greater than 0 and at most 20";
721
- readonly group: "fill";
722
- readonly description: "Hachure line weight; requires fill hachure in the final stack.";
723
- };
724
- readonly washOpacity: {
725
- readonly kind: "number";
726
- readonly minimum: 0;
727
- readonly maximum: 1;
728
- readonly expected: "between 0 and 1";
729
- readonly group: "fill";
730
- readonly description: "Watercolor glaze opacity; requires fill wash in the final stack.";
731
- };
732
- readonly washEdge: {
733
- readonly kind: "number";
734
- readonly minimum: 0;
735
- readonly maximum: 1;
736
- readonly expected: "between 0 and 1";
737
- readonly group: "fill";
738
- readonly description: "Watercolor edge-darkening opacity; requires fill wash in the final stack.";
739
- };
740
- readonly backdrop: {
741
- readonly kind: "enum";
742
- readonly values: readonly ["plain", "paper-ruled", "grid"];
743
- readonly group: "page";
744
- readonly description: "Flat page furniture drawn behind the diagram.";
745
- };
746
- readonly intent: {
747
- readonly kind: "enum";
748
- readonly values: readonly ["premium", "draft", "lofi"];
749
- readonly group: "advisory";
750
- readonly description: "Advisory intent metadata for pickers and quality tooling.";
751
- };
752
- readonly mono: {
753
- readonly kind: "boolean";
754
- readonly group: "advisory";
755
- readonly description: "Advisory monochrome contract: express tone through shading and weight.";
756
- };
757
- };
758
- type DescriptorValue<Descriptor> = Descriptor extends {
759
- readonly kind: 'const';
760
- readonly value: infer Value;
761
- } ? Value : Descriptor extends {
762
- readonly kind: 'string';
763
- } ? string : Descriptor extends {
764
- readonly kind: 'boolean';
765
- } ? boolean : Descriptor extends {
766
- readonly kind: 'number' | 'integer';
767
- } ? number : Descriptor extends {
768
- readonly kind: 'enum';
769
- readonly values: readonly (infer Value)[];
770
- } ? Value : Descriptor extends {
771
- readonly kind: 'colors';
772
- } ? StyleColors : Descriptor extends {
773
- readonly kind: 'roles';
774
- } ? RoleStyles : Descriptor extends {
775
- readonly kind: 'semanticSlots';
776
- } ? SemanticSlots : Descriptor extends {
777
- readonly kind: 'bindings';
778
- } ? readonly SemanticBinding[] : Descriptor extends {
779
- readonly kind: 'constraints';
780
- } ? readonly BrandConstraint[] : never;
781
- /** A partial, composable public description of how diagrams look. */
782
- type StyleSpec = {
783
- -readonly [Key in keyof typeof STYLE_SPEC_FIELD_DESCRIPTORS]?: DescriptorValue<(typeof STYLE_SPEC_FIELD_DESCRIPTORS)[Key]>;
784
- };
785
-
786
- /** What RenderOptions.style accepts: a registered name, an inline spec, or a
787
- * stack of either (merged left → right). */
788
- type StyleInput = string | StyleSpec;
789
847
 
790
848
  interface ArchitectureVisualConfig {
791
849
  groupHeaderHeight: number;
@@ -840,7 +898,26 @@ interface ConfigDiagnostic {
840
898
  field: string;
841
899
  message: string;
842
900
  }
901
+ interface GraphLayoutHints {
902
+ /** Ordered ELK partitions; unlisted nodes use partition zero. These are relative ranks, not pixel coordinates. */
903
+ ranks?: Record<string, number>;
904
+ /** Preferred consecutive model order within one container; geometry remains certified. */
905
+ adjacent?: readonly (readonly string[])[];
906
+ /** Authored edge IDs or from->to / from->to#k occurrence IDs to prioritize for short routes. */
907
+ shortEdges?: readonly string[];
908
+ }
909
+ interface GraphLayoutOptions {
910
+ backend: 'elk' | 'agentic';
911
+ /** Agentic may explicitly fall back to ELK; omitted means none. */
912
+ fallback?: 'none' | 'elk';
913
+ }
843
914
  interface RenderOptions {
915
+ /** Explicit deterministic Flowchart/State placement preferences; included in render receipts. */
916
+ layoutHints?: GraphLayoutHints;
917
+ /** Graph geometry producer; omitted preserves the existing ELK pipeline. */
918
+ graphLayout?: GraphLayoutOptions;
919
+ /** Require complete native layout evidence, or report explicit limitations. */
920
+ layoutSafety?: 'report' | 'strict';
844
921
  /** Background color → CSS variable --bg. Default: '#FFFFFF' */
845
922
  bg?: string;
846
923
  /** Foreground / primary text color → CSS variable --fg. Default: '#27272A' */
@@ -894,6 +971,21 @@ interface RenderOptions {
894
971
  /** Nest namespace compounds (default true); false lays them out compactly as siblings. */
895
972
  hierarchicalNamespaces?: boolean;
896
973
  };
974
+ /** Opt-in graphical Kanban layout controls; source order and card membership remain unchanged. */
975
+ kanban?: {
976
+ /** Wrap whole columns into rows within this best-effort pixel width, retaining readable column widths. */
977
+ maxWidth?: number;
978
+ };
979
+ /** Opt-in graphical fitting; selected typography and slice meaning are retained. */
980
+ pie?: {
981
+ /** Best-effort pixel width; explicit legend placement retains precedence. */
982
+ maxWidth?: number;
983
+ };
984
+ /** Opt-in graphical fitting; authored frames and radar scale meaning are retained. */
985
+ radar?: {
986
+ /** Best-effort pixel width with a bounded plot/legend arrangement search. */
987
+ maxWidth?: number;
988
+ };
897
989
  /** Family-specific SVG renderer options for architecture-beta diagrams. */
898
990
  architecture?: {
899
991
  visual?: ArchitectureVisualOverrides;
@@ -1000,6 +1092,181 @@ interface RenderOptions {
1000
1092
  seed?: number;
1001
1093
  }
1002
1094
 
1095
+ interface PaintViewport {
1096
+ readonly x: number;
1097
+ readonly y: number;
1098
+ readonly width: number;
1099
+ readonly height: number;
1100
+ }
1101
+ interface PaintCertificationIssue {
1102
+ readonly code: 'UNMEASURED_PAINT' | 'UNPREPARED_TEXT' | 'CONDITIONAL_PAINT' | 'LABEL_CONTAINMENT' | 'TEXT_OCCLUDED' | 'CHECK_BUDGET' | 'OUTPUT_SCOPE' | 'POTENTIAL_OCCLUSION' | 'MARKER_OCCLUDED' | 'CONNECTOR_CARD_CROSSING';
1103
+ readonly id?: string;
1104
+ readonly by?: string;
1105
+ readonly message: string;
1106
+ }
1107
+ interface PaintLayoutCertification {
1108
+ readonly version: 1;
1109
+ readonly unit: 'px';
1110
+ readonly scope: 'native-scene';
1111
+ readonly status: 'passed' | 'failed' | 'unverified';
1112
+ /** Digest of the final secured SVG this proof was issued with. Its shape,
1113
+ * text and connector elements are written from the fields the proof reads;
1114
+ * the document passes after the backend resolve colour variables, fit
1115
+ * uncalibrated host fonts, namespace ids and scope styles, and the security
1116
+ * policy may remove content it does not admit. */
1117
+ readonly outputDigest?: string;
1118
+ readonly viewport: PaintViewport;
1119
+ readonly attempts: 1 | 2;
1120
+ readonly repairs: readonly 'expand-viewport'[];
1121
+ readonly coverage: {
1122
+ readonly measured: number;
1123
+ readonly unmeasured: number;
1124
+ readonly preparedText: number;
1125
+ readonly fallbackText: number;
1126
+ readonly conditional: number;
1127
+ };
1128
+ readonly checks: {
1129
+ readonly primitives: number;
1130
+ readonly labels: number;
1131
+ readonly occlusionPairs: number;
1132
+ readonly maxOcclusionPairs: number;
1133
+ readonly operations: number;
1134
+ readonly maxOperations: number;
1135
+ readonly markers: number;
1136
+ };
1137
+ readonly issues: readonly PaintCertificationIssue[];
1138
+ readonly limitations: readonly string[];
1139
+ }
1140
+
1141
+ type TerminalCertificationStatus = 'passed' | 'failed' | 'unverified';
1142
+ interface TerminalLayoutCertificationIssue {
1143
+ readonly code: string;
1144
+ readonly status: Exclude<TerminalCertificationStatus, 'passed'>;
1145
+ readonly message: string;
1146
+ readonly elementId?: string;
1147
+ readonly cell?: Readonly<{
1148
+ column: number;
1149
+ row: number;
1150
+ }>;
1151
+ }
1152
+ interface TerminalLayoutCertification {
1153
+ readonly version: 1;
1154
+ readonly unit: 'cell';
1155
+ readonly scope: 'terminal-cells';
1156
+ readonly status: TerminalCertificationStatus;
1157
+ /** Digest of the exact encoded text returned to this caller, not source/model data. */
1158
+ readonly outputDigest?: string;
1159
+ readonly bounds?: Readonly<{
1160
+ width: number;
1161
+ height: number;
1162
+ }>;
1163
+ readonly coverage: Readonly<{
1164
+ cells: number;
1165
+ graphemes: number;
1166
+ ownedCells: number;
1167
+ unownedCells: number;
1168
+ textAllocations: number;
1169
+ textClusters: number;
1170
+ identities: number;
1171
+ ports: number;
1172
+ markerContracts: number;
1173
+ }>;
1174
+ readonly budget: Readonly<{
1175
+ operations: number;
1176
+ maxOperations: number;
1177
+ outputCodeUnits: number;
1178
+ maxOutputCodeUnits: number;
1179
+ exhausted: boolean;
1180
+ issuesTruncated: boolean;
1181
+ projectionsTruncated: boolean;
1182
+ }>;
1183
+ readonly issues: readonly TerminalLayoutCertificationIssue[];
1184
+ /** Native representation choices are reported separately from cell-layout correctness. */
1185
+ readonly projections: readonly Readonly<{
1186
+ feature: string;
1187
+ message: string;
1188
+ }>[];
1189
+ readonly limitations: readonly string[];
1190
+ }
1191
+
1192
+ /** Versioned, deterministic capability negotiation for hosts and receipts. */
1193
+ declare const CAPABILITY_NEGOTIATION_VERSION: 1;
1194
+ type CapabilityId = `${string}:${string}`;
1195
+ type CapabilityRequirementLevel = 'required' | 'preferred' | 'optional';
1196
+ interface CapabilityResolution {
1197
+ id: CapabilityId;
1198
+ range: string;
1199
+ level: CapabilityRequirementLevel;
1200
+ status: 'selected' | 'unsupported' | 'incompatible';
1201
+ version?: string;
1202
+ }
1203
+ interface CapabilityDecision {
1204
+ version: typeof CAPABILITY_NEGOTIATION_VERSION;
1205
+ accepted: boolean;
1206
+ resolutions: readonly CapabilityResolution[];
1207
+ }
1208
+
1209
+ /** Closed first-party output vocabulary shared by render and negotiation. */
1210
+ declare const RENDER_OUTPUTS: readonly ["svg", "png", "ascii", "unicode", "html", "layout"];
1211
+ type RenderOutput = typeof RENDER_OUTPUTS[number];
1212
+
1213
+ /** Trusted pixel metrics. Executable profiles never enter diagram/config data. */
1214
+ interface TextMeasurementProfileIdentity {
1215
+ readonly id: string;
1216
+ readonly version: string;
1217
+ }
1218
+
1219
+ declare const RENDER_CONTRACT_VERSION: 2;
1220
+
1221
+ interface RenderRequestReceipt {
1222
+ /** Actual graph geometry decisions, retained outside caller-owned metadata. */
1223
+ layoutDecisions?: readonly GraphLayoutDecision[];
1224
+ /** Bounded evidence from the actual pixel or terminal-cell projection. */
1225
+ layoutCertification?: PaintLayoutCertification | TerminalLayoutCertification;
1226
+ version: typeof RENDER_CONTRACT_VERSION;
1227
+ output: RenderOutput;
1228
+ sharedRequestDigest: string;
1229
+ requestDigest: string;
1230
+ appearanceDigest: string;
1231
+ capabilityDecision: CapabilityDecision;
1232
+ /** Request-resolution and output-policy decisions. */
1233
+ diagnostics?: readonly RenderArtifactDiagnostic[];
1234
+ /** Digest of the secured graphical projection emitted by this execution. */
1235
+ graphicalProjectionDigest?: string;
1236
+ /** Family/backend selected at execution, including trusted host policy. */
1237
+ executionDecision?: RenderExecutionDecision;
1238
+ /** Pixel metrics used by graphical outputs; contains no executable host inputs. */
1239
+ textMeasurement?: TextMeasurementProfileIdentity;
1240
+ }
1241
+ interface RenderExecutionDecision {
1242
+ readonly family: {
1243
+ readonly id: string;
1244
+ readonly version: string;
1245
+ };
1246
+ readonly backend: {
1247
+ readonly mode: 'scene';
1248
+ readonly requestedId: string;
1249
+ readonly selectedId: string;
1250
+ readonly version: string;
1251
+ readonly hostPolicy: boolean;
1252
+ } | {
1253
+ readonly mode: 'family-svg';
1254
+ };
1255
+ readonly digest: string;
1256
+ readonly textMeasurement?: TextMeasurementProfileIdentity;
1257
+ }
1258
+ interface RenderArtifactDiagnostic {
1259
+ readonly code: string;
1260
+ readonly message?: string;
1261
+ readonly reference?: string;
1262
+ readonly feature?: string;
1263
+ }
1264
+
1265
+ interface RenderedSvg {
1266
+ readonly svg: string;
1267
+ readonly receipt: RenderRequestReceipt;
1268
+ }
1269
+
1003
1270
  declare class BrowserFamilyDetectionError extends Error {
1004
1271
  readonly code = "UNSUPPORTED_FAMILY";
1005
1272
  constructor(firstLine: string);
@@ -1008,5 +1275,7 @@ declare class BrowserFamilyDetectionError extends Error {
1008
1275
  * The classic synchronous `agentic-mermaid/browser` entry remains available
1009
1276
  * for script-tag consumers that prefer one all-in-one file. */
1010
1277
  declare function renderMermaidSVGAsync(source: string, options?: RenderOptions): Promise<string>;
1278
+ /** Receipt-bearing lazy rendering retains the complete canonical contract. */
1279
+ declare function renderMermaidSVGWithReceiptAsync(source: string, options?: RenderOptions): Promise<RenderedSvg>;
1011
1280
 
1012
- export { BrowserFamilyDetectionError, type RenderOptions, renderMermaidSVGAsync };
1281
+ export { BrowserFamilyDetectionError, type RenderOptions, renderMermaidSVGAsync, renderMermaidSVGWithReceiptAsync };