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
@@ -0,0 +1,724 @@
1
+ /**
2
+ * Identity metadata shared by the kind-specific extension registries.
3
+ *
4
+ * This module deliberately does not provide a global extension registry:
5
+ * families, styles, backends, resources, and roles retain their own typed
6
+ * registries and share only naming, provenance, version, and collision rules.
7
+ */
8
+ interface ExtensionCompatibility {
9
+ readonly [contract: string]: string | undefined;
10
+ /** Compatible Agentic Mermaid core contract/range. */
11
+ readonly core?: string;
12
+ /** Compatible Scene contract/range, when the extension consumes Scene. */
13
+ readonly scene?: string;
14
+ }
15
+ interface ExtensionProvenance {
16
+ /** Stable owner/package identifier, not a display label. */
17
+ readonly owner: string;
18
+ /** Where the registration came from (for example `built-in` or `host`). */
19
+ readonly source: string;
20
+ /** Optional source URL, package reference, or build receipt. */
21
+ readonly reference?: string;
22
+ }
23
+ interface ExtensionIdentity<Kind extends string = string> {
24
+ /** Collision-safe `${kind}:${local-name}` identifier. */
25
+ readonly id: `${Kind}:${string}`;
26
+ readonly kind: Kind;
27
+ readonly version: string;
28
+ readonly compatibility: ExtensionCompatibility;
29
+ readonly provenance: ExtensionProvenance;
30
+ }
31
+ /** Host contract versions understood by this runtime. Requirements for other
32
+ * namespaced contracts are retained but deliberately deferred to their owner. */
33
+ declare const KNOWN_EXTENSION_CONTRACT_VERSIONS: Readonly<{
34
+ readonly core: "0.5.3";
35
+ readonly scene: "2.0.0";
36
+ }>;
37
+ interface ExtensionCompatibilityResolution {
38
+ readonly contract: string;
39
+ readonly range: string;
40
+ readonly status: 'compatible' | 'incompatible' | 'deferred' | 'invalid';
41
+ readonly version?: string;
42
+ readonly diagnostic?: string;
43
+ }
44
+ interface ExtensionCompatibilityDecision {
45
+ readonly accepted: boolean;
46
+ readonly resolutions: readonly ExtensionCompatibilityResolution[];
47
+ }
48
+ /**
49
+ * Evaluate every identity kind through one compatibility policy. Known core
50
+ * and Scene ranges are enforced now; valid unknown namespaced requirements
51
+ * remain visible and deferred for forward-compatible hosts.
52
+ */
53
+ declare function evaluateExtensionCompatibility(identity: Pick<ExtensionIdentity, 'id' | 'compatibility'>): ExtensionCompatibilityDecision;
54
+ interface ExtensionRegistration<Value, Kind extends string = string> {
55
+ readonly identity: ExtensionIdentity<Kind>;
56
+ readonly value: Value;
57
+ }
58
+ declare function canonicalExtensionId<Kind extends string>(kind: Kind, localId: string): `${Kind}:${string}`;
59
+ declare function parseExtensionId(id: string): {
60
+ kind: string;
61
+ localId: string;
62
+ } | undefined;
63
+ declare function createExtensionIdentity<Kind extends string>(input: {
64
+ id: string;
65
+ kind: Kind;
66
+ version: string;
67
+ compatibility?: ExtensionCompatibility;
68
+ provenance: ExtensionProvenance;
69
+ }): ExtensionIdentity<Kind>;
70
+ declare class ExtensionCollisionError extends Error {
71
+ readonly incoming: ExtensionIdentity;
72
+ readonly existing: ExtensionIdentity;
73
+ readonly code = "EXTENSION_ID_COLLISION";
74
+ constructor(incoming: ExtensionIdentity, existing: ExtensionIdentity);
75
+ }
76
+ /** Register into one existing kind-specific registry without implicit replace. */
77
+ declare function registerExtension<Value, Kind extends string>(registry: Map<string, ExtensionRegistration<Value, Kind>>, registration: ExtensionRegistration<Value, Kind>): void;
78
+
79
+ /** Closed brand-neutral leaves available to applicable Scene roles. */
80
+ declare const ROLE_STYLE_PROPERTY_DESCRIPTORS: Readonly<{
81
+ readonly fontFamily: {
82
+ readonly kind: "font";
83
+ readonly description: "Safe font family/stack for roles whose descriptor exposes family-specific typography.";
84
+ };
85
+ readonly fontSize: {
86
+ readonly kind: "number";
87
+ readonly minimum: 1;
88
+ readonly maximum: 256;
89
+ readonly expected: "between 1 and 256";
90
+ readonly description: "Font size in SVG user units.";
91
+ };
92
+ readonly fontWeight: {
93
+ readonly kind: "number";
94
+ readonly minimum: 1;
95
+ readonly maximum: 1000;
96
+ readonly expected: "between 1 and 1000";
97
+ readonly description: "CSS numeric font weight.";
98
+ };
99
+ readonly letterSpacing: {
100
+ readonly kind: "number";
101
+ readonly minimum: -2;
102
+ readonly maximum: 4;
103
+ readonly expected: "between -2 and 4";
104
+ readonly description: "Letter spacing in SVG user units.";
105
+ };
106
+ readonly textTransform: {
107
+ readonly kind: "enum";
108
+ readonly values: readonly ["uppercase", "lowercase", "capitalize"];
109
+ readonly description: "Text transformation.";
110
+ };
111
+ readonly textColor: {
112
+ readonly kind: "color";
113
+ readonly description: "Text paint.";
114
+ };
115
+ readonly paddingX: {
116
+ readonly kind: "number";
117
+ readonly minimum: 0;
118
+ readonly maximum: 256;
119
+ readonly expected: "between 0 and 256";
120
+ readonly description: "Horizontal role padding.";
121
+ };
122
+ readonly paddingY: {
123
+ readonly kind: "number";
124
+ readonly minimum: 0;
125
+ readonly maximum: 256;
126
+ readonly expected: "between 0 and 256";
127
+ readonly description: "Vertical role padding.";
128
+ };
129
+ readonly cornerRadius: {
130
+ readonly kind: "number";
131
+ readonly minimum: 0;
132
+ readonly maximum: 256;
133
+ readonly expected: "between 0 and 256";
134
+ readonly description: "Applicable corner radius.";
135
+ };
136
+ readonly lineWidth: {
137
+ readonly kind: "number";
138
+ readonly exclusiveMinimum: 0;
139
+ readonly maximum: 20;
140
+ readonly expected: "greater than 0 and at most 20";
141
+ readonly description: "Border or connector width.";
142
+ };
143
+ readonly bendRadius: {
144
+ readonly kind: "number";
145
+ readonly minimum: 0;
146
+ readonly maximum: 256;
147
+ readonly expected: "between 0 and 256";
148
+ readonly description: "Applicable connector bend radius.";
149
+ };
150
+ readonly fillColor: {
151
+ readonly kind: "color";
152
+ readonly description: "Surface fill paint.";
153
+ };
154
+ readonly borderColor: {
155
+ readonly kind: "color";
156
+ readonly description: "Border paint.";
157
+ };
158
+ readonly strokeColor: {
159
+ readonly kind: "color";
160
+ readonly description: "Connector stroke paint.";
161
+ };
162
+ readonly headerFillColor: {
163
+ readonly kind: "color";
164
+ readonly description: "Group header surface paint.";
165
+ };
166
+ readonly cue: {
167
+ readonly kind: "enum";
168
+ readonly values: readonly ["none", "outline", "double-line", "pattern"];
169
+ readonly description: "Non-color semantic cue on roles whose family renderer exposes a cue projection.";
170
+ };
171
+ }>;
172
+ type RolePropertyValue<D> = D extends {
173
+ readonly kind: 'number';
174
+ } ? number : D extends {
175
+ readonly kind: 'font' | 'color';
176
+ } ? string : D extends {
177
+ readonly kind: 'enum';
178
+ readonly values: readonly (infer V)[];
179
+ } ? V : never;
180
+ type RoleStyleSpec = {
181
+ -readonly [K in keyof typeof ROLE_STYLE_PROPERTY_DESCRIPTORS]?: RolePropertyValue<(typeof ROLE_STYLE_PROPERTY_DESCRIPTORS)[K]>;
182
+ };
183
+ /**
184
+ * The single exact-role styling authority. Runtime role descriptors, public
185
+ * TypeScript, JSON Schema, binding admission, docs, and the executable census
186
+ * all project from this record.
187
+ */
188
+ declare const EXACT_ROLE_STYLE_CONTRACT: Readonly<{
189
+ readonly node: Readonly<{
190
+ properties: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "paddingX", "paddingY", "cornerRadius", "lineWidth", "fillColor", "borderColor"];
191
+ }>;
192
+ readonly edge: Readonly<{
193
+ properties: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "lineWidth", "bendRadius", "strokeColor"];
194
+ }>;
195
+ readonly group: Readonly<{
196
+ properties: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "paddingX", "paddingY", "cornerRadius", "lineWidth", "fillColor", "borderColor", "fontFamily", "headerFillColor"];
197
+ }>;
198
+ readonly 'group-header': Readonly<{
199
+ properties: readonly ["fontFamily", "fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "fillColor", "borderColor", "strokeColor", "lineWidth", "cue"];
200
+ bindingFamilies: readonly ["journey"];
201
+ }>;
202
+ readonly label: Readonly<{
203
+ properties: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor"];
204
+ }>;
205
+ readonly actor: Readonly<{
206
+ properties: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "paddingX", "paddingY", "cornerRadius", "lineWidth", "fillColor", "borderColor"];
207
+ bindingFamilies: readonly ["sequence"];
208
+ }>;
209
+ readonly relationship: Readonly<{
210
+ properties: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "lineWidth", "bendRadius", "strokeColor"];
211
+ bindingFamilies: readonly ["er"];
212
+ }>;
213
+ readonly 'pie-slice': Readonly<{
214
+ properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth", "cue"];
215
+ bindingFamilies: readonly ["pie", "radar"];
216
+ }>;
217
+ readonly legend: Readonly<{
218
+ properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth", "textColor"];
219
+ bindingFamilies: readonly ["radar"];
220
+ }>;
221
+ readonly bar: Readonly<{
222
+ properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth"];
223
+ bindingFamilies: readonly ["xychart", "sankey", "treemap"];
224
+ }>;
225
+ readonly series: Readonly<{
226
+ properties: readonly ["borderColor", "strokeColor", "lineWidth"];
227
+ bindingFamilies: readonly ["xychart"];
228
+ }>;
229
+ readonly point: Readonly<{
230
+ properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth"];
231
+ bindingFamilies: readonly ["radar", "xychart"];
232
+ }>;
233
+ readonly task: Readonly<{
234
+ properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth", "cue"];
235
+ bindingFamilies: readonly ["gantt"];
236
+ }>;
237
+ readonly milestone: Readonly<{
238
+ properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth", "cue"];
239
+ bindingFamilies: readonly ["gantt"];
240
+ }>;
241
+ }>;
242
+ type ExactStyleSceneRole = keyof typeof EXACT_ROLE_STYLE_CONTRACT;
243
+ type BindableSceneRole = {
244
+ [Role in ExactStyleSceneRole]: (typeof EXACT_ROLE_STYLE_CONTRACT)[Role] extends {
245
+ readonly bindingFamilies: readonly [string, ...string[]];
246
+ } ? Role : never;
247
+ }[ExactStyleSceneRole];
248
+ declare const EXACT_STYLE_SCENE_ROLES: readonly ("legend" | "relationship" | "label" | "node" | "edge" | "group" | "group-header" | "actor" | "pie-slice" | "bar" | "series" | "point" | "task" | "milestone")[];
249
+ declare const BINDABLE_SCENE_ROLES: readonly BindableSceneRole[];
250
+ /** Closed union of leaves that at least one executable category-binding role
251
+ * can consume. Role-free bindings must intersect this set after stack merge. */
252
+ declare const BINDABLE_ROLE_STYLE_PROPERTIES: readonly ("borderColor" | "textColor" | "fontFamily" | "fontSize" | "fontWeight" | "letterSpacing" | "textTransform" | "paddingX" | "paddingY" | "cornerRadius" | "lineWidth" | "bendRadius" | "fillColor" | "strokeColor" | "cue")[];
253
+ type RoleStyleFor<Role extends BuiltinSceneRole> = Role extends ExactStyleSceneRole ? Pick<RoleStyleSpec, (typeof EXACT_ROLE_STYLE_CONTRACT)[Role]['properties'][number]> : never;
254
+ type RoleStyles = {
255
+ [Role in ExactStyleSceneRole]?: Readonly<RoleStyleFor<Role>>;
256
+ };
257
+
258
+ type BrandConstraintAction = 'warn' | 'error';
259
+ type BrandConstraintWarningCode = 'BRAND_CONSTRAINT_WARNING' | 'BRAND_CONSTRAINT_ERROR';
260
+ type BrandConstraintFieldDescriptor = {
261
+ readonly kind: 'role';
262
+ readonly required?: true;
263
+ } | {
264
+ readonly kind: 'number';
265
+ readonly minimum: number;
266
+ readonly maximum: number;
267
+ readonly required?: true;
268
+ };
269
+ /**
270
+ * Single payload-shape authority for every public Brand constraint. Public
271
+ * TypeScript, runtime admission, JSON Schema, diagnostics, and evaluator
272
+ * exhaustiveness project from this record.
273
+ */
274
+ declare const BRAND_CONSTRAINT_DESCRIPTORS: Readonly<{
275
+ readonly contrast: Readonly<{
276
+ properties: Readonly<{
277
+ role: Readonly<{
278
+ readonly kind: "role";
279
+ }>;
280
+ minimum: Readonly<{
281
+ readonly kind: "number";
282
+ readonly minimum: 1;
283
+ readonly maximum: 21;
284
+ }>;
285
+ }>;
286
+ recovery: "Choose an authored text/surface pair that meets the requested ratio, or remove the rule; the renderer will not repaint it.";
287
+ }>;
288
+ readonly 'accent-area': Readonly<{
289
+ properties: Readonly<{
290
+ maxFraction: Readonly<{
291
+ readonly kind: "number";
292
+ readonly minimum: 0;
293
+ readonly maximum: 1;
294
+ readonly required: true;
295
+ }>;
296
+ }>;
297
+ recovery: "Reduce authored accent-filled area or raise the declared maximum; the renderer will not rewrite fills.";
298
+ }>;
299
+ readonly 'mono-role': Readonly<{
300
+ properties: Readonly<{
301
+ role: Readonly<{
302
+ readonly kind: "role";
303
+ readonly required: true;
304
+ }>;
305
+ }>;
306
+ recovery: "Use measurable monochrome paint for the named role or remove the rule; the renderer will not rewrite paint.";
307
+ }>;
308
+ }>;
309
+ type BrandConstraintKind = keyof typeof BRAND_CONSTRAINT_DESCRIPTORS;
310
+ declare const BRAND_CONSTRAINT_KINDS: readonly ("contrast" | "accent-area" | "mono-role")[];
311
+ type FieldValue<Descriptor extends BrandConstraintFieldDescriptor> = Descriptor['kind'] extends 'role' ? BuiltinSceneRole : number;
312
+ type PropertiesOf<Kind extends BrandConstraintKind> = (typeof BRAND_CONSTRAINT_DESCRIPTORS)[Kind]['properties'];
313
+ type RequiredPropertyNames<Kind extends BrandConstraintKind> = {
314
+ [Field in keyof PropertiesOf<Kind>]: PropertiesOf<Kind>[Field] extends {
315
+ readonly required: true;
316
+ } ? Field : never;
317
+ }[keyof PropertiesOf<Kind>];
318
+ type OptionalPropertyNames<Kind extends BrandConstraintKind> = Exclude<keyof PropertiesOf<Kind>, RequiredPropertyNames<Kind>>;
319
+ type ConstraintPayload<Kind extends BrandConstraintKind> = {
320
+ readonly [Field in RequiredPropertyNames<Kind>]: PropertiesOf<Kind>[Field] extends BrandConstraintFieldDescriptor ? FieldValue<PropertiesOf<Kind>[Field]> : never;
321
+ } & {
322
+ readonly [Field in OptionalPropertyNames<Kind>]?: PropertiesOf<Kind>[Field] extends BrandConstraintFieldDescriptor ? FieldValue<PropertiesOf<Kind>[Field]> : never;
323
+ };
324
+ type BrandConstraint = {
325
+ [Kind in BrandConstraintKind]: Readonly<{
326
+ kind: Kind;
327
+ action: BrandConstraintAction;
328
+ } & ConstraintPayload<Kind>>;
329
+ }[BrandConstraintKind];
330
+ declare const BRAND_CONSTRAINT_WARNING_POLICY: Readonly<{
331
+ warn: Readonly<{
332
+ code: "BRAND_CONSTRAINT_WARNING";
333
+ severity: "warning";
334
+ tier: "lint";
335
+ }>;
336
+ error: Readonly<{
337
+ code: "BRAND_CONSTRAINT_ERROR";
338
+ severity: "error";
339
+ tier: "lint";
340
+ }>;
341
+ }>;
342
+
343
+ /**
344
+ * The persisted StyleSpec wire format. Inputs may omit the version; registry
345
+ * and stack resolution normalize it to this value before returning a spec.
346
+ */
347
+ declare const STYLE_SPEC_FORMAT_VERSION: 1;
348
+ /**
349
+ * One authority for the public palette vocabulary. The runtime validator,
350
+ * TypeScript type, JSON Schema, and generated field reference all project
351
+ * from this record.
352
+ */
353
+ declare const STYLE_COLOR_TOKEN_DESCRIPTORS: {
354
+ readonly bg: {
355
+ readonly description: "Diagram page background.";
356
+ };
357
+ readonly fg: {
358
+ readonly description: "Primary text and foreground paint.";
359
+ };
360
+ readonly line: {
361
+ readonly description: "Connector and secondary line paint.";
362
+ };
363
+ readonly accent: {
364
+ readonly description: "Accent paint for emphasis and data series.";
365
+ };
366
+ readonly muted: {
367
+ readonly description: "Muted text and secondary data paint.";
368
+ };
369
+ readonly surface: {
370
+ readonly description: "Node and group surface fill.";
371
+ };
372
+ readonly border: {
373
+ readonly description: "Node and group border paint.";
374
+ };
375
+ };
376
+ type StyleColors = {
377
+ -readonly [Key in keyof typeof STYLE_COLOR_TOKEN_DESCRIPTORS]?: string;
378
+ };
379
+ declare const SEMANTIC_BINDING_CHANNELS: readonly ["category"];
380
+ type SemanticBindingChannel = typeof SEMANTIC_BINDING_CHANNELS[number];
381
+ interface SemanticBinding {
382
+ readonly channel: SemanticBindingChannel;
383
+ readonly value: string;
384
+ readonly slot: string;
385
+ readonly role?: BindableSceneRole;
386
+ }
387
+ type SemanticSlots = Readonly<Record<string, Readonly<RoleStyleSpec>>>;
388
+ /**
389
+ * One authority for every public StyleSpec field and constraint. Keep
390
+ * renderer-private face defaults out of this manifest: they are not part of
391
+ * the external style contract.
392
+ */
393
+ declare const STYLE_SPEC_FIELD_DESCRIPTORS: {
394
+ readonly formatVersion: {
395
+ readonly kind: "const";
396
+ readonly value: 1;
397
+ readonly group: "metadata";
398
+ readonly description: "Persisted wire-format version. Optional on input and normalized to 1 on output.";
399
+ };
400
+ readonly $schema: {
401
+ readonly kind: "string";
402
+ readonly group: "metadata";
403
+ readonly description: "Optional JSON Schema pointer for file-backed styles; ignored while rendering.";
404
+ };
405
+ readonly name: {
406
+ readonly kind: "string";
407
+ readonly group: "metadata";
408
+ readonly description: "Canonical look:name or palette:name identity; required only when registering a style.";
409
+ };
410
+ readonly blurb: {
411
+ readonly kind: "string";
412
+ readonly group: "metadata";
413
+ readonly description: "Short human-readable description used by discovery surfaces.";
414
+ };
415
+ readonly colors: {
416
+ readonly kind: "colors";
417
+ readonly group: "palette";
418
+ readonly description: "Partial palette of safe, non-fetching CSS color tokens.";
419
+ };
420
+ readonly font: {
421
+ readonly kind: "string";
422
+ readonly runtimeValidator: "safeCssFontFamily";
423
+ readonly group: "typography";
424
+ readonly description: "Safe, non-fetching CSS font family or stack; the rendering environment supplies the font face.";
425
+ };
426
+ readonly roles: {
427
+ readonly kind: "roles";
428
+ readonly group: "roles";
429
+ readonly description: "Partial semantic SceneRole defaults. Family-authored styling remains authoritative.";
430
+ };
431
+ readonly semanticSlots: {
432
+ readonly kind: "semanticSlots";
433
+ readonly group: "policy";
434
+ readonly description: "Named brand-neutral role-style slots selected by semantic bindings.";
435
+ };
436
+ readonly bindings: {
437
+ readonly kind: "bindings";
438
+ readonly group: "policy";
439
+ readonly description: "Ordered equality bindings from authored/domain meaning to semantic slots.";
440
+ };
441
+ readonly constraints: {
442
+ readonly kind: "constraints";
443
+ readonly group: "policy";
444
+ readonly description: "Closed inspect-only brand constraints with warn or error actions.";
445
+ };
446
+ readonly stroke: {
447
+ readonly kind: "enum";
448
+ readonly values: readonly ["crisp", "jittered", "freehand"];
449
+ readonly group: "stroke";
450
+ readonly description: "Stroke treatment; crisp is the default renderer.";
451
+ };
452
+ readonly roughness: {
453
+ readonly kind: "number";
454
+ readonly minimum: 0;
455
+ readonly maximum: 10;
456
+ readonly expected: "between 0 and 10";
457
+ readonly group: "stroke";
458
+ readonly description: "Rough.js stroke irregularity.";
459
+ };
460
+ readonly bowing: {
461
+ readonly kind: "number";
462
+ readonly minimum: 0;
463
+ readonly maximum: 10;
464
+ readonly expected: "between 0 and 10";
465
+ readonly group: "stroke";
466
+ readonly description: "Rough.js line bowing.";
467
+ };
468
+ readonly passes: {
469
+ readonly kind: "integer";
470
+ readonly minimum: 1;
471
+ readonly maximum: 8;
472
+ readonly expected: "an integer from 1 through 8";
473
+ readonly group: "stroke";
474
+ readonly description: "Number of sketch strokes; 1 is single-pass and 2 is the usual double stroke.";
475
+ };
476
+ readonly strokeWidth: {
477
+ readonly kind: "number";
478
+ readonly exclusiveMinimum: 0;
479
+ readonly maximum: 20;
480
+ readonly expected: "greater than 0 and at most 20";
481
+ readonly group: "stroke";
482
+ readonly description: "Base stroke width in SVG user units.";
483
+ };
484
+ readonly fill: {
485
+ readonly kind: "enum";
486
+ readonly values: readonly ["none", "hachure", "solid", "wash"];
487
+ readonly group: "fill";
488
+ readonly description: "Fill policy for rough/hybrid rendering; none and solid require a final stack that activates one of those backends.";
489
+ };
490
+ readonly hachureAngle: {
491
+ readonly kind: "number";
492
+ readonly minimum: -360;
493
+ readonly maximum: 360;
494
+ readonly expected: "between -360 and 360";
495
+ readonly group: "fill";
496
+ readonly description: "Hachure line angle in degrees; requires fill hachure in the final stack.";
497
+ };
498
+ readonly hachureGap: {
499
+ readonly kind: "number";
500
+ readonly exclusiveMinimum: 0;
501
+ readonly maximum: 100;
502
+ readonly expected: "greater than 0 and at most 100";
503
+ readonly group: "fill";
504
+ readonly description: "Gap between hachure lines; requires fill hachure in the final stack.";
505
+ };
506
+ readonly fillWeight: {
507
+ readonly kind: "number";
508
+ readonly exclusiveMinimum: 0;
509
+ readonly maximum: 20;
510
+ readonly expected: "greater than 0 and at most 20";
511
+ readonly group: "fill";
512
+ readonly description: "Hachure line weight; requires fill hachure in the final stack.";
513
+ };
514
+ readonly washOpacity: {
515
+ readonly kind: "number";
516
+ readonly minimum: 0;
517
+ readonly maximum: 1;
518
+ readonly expected: "between 0 and 1";
519
+ readonly group: "fill";
520
+ readonly description: "Watercolor glaze opacity; requires fill wash in the final stack.";
521
+ };
522
+ readonly washEdge: {
523
+ readonly kind: "number";
524
+ readonly minimum: 0;
525
+ readonly maximum: 1;
526
+ readonly expected: "between 0 and 1";
527
+ readonly group: "fill";
528
+ readonly description: "Watercolor edge-darkening opacity; requires fill wash in the final stack.";
529
+ };
530
+ readonly backdrop: {
531
+ readonly kind: "enum";
532
+ readonly values: readonly ["plain", "paper-ruled", "grid"];
533
+ readonly group: "page";
534
+ readonly description: "Flat page furniture drawn behind the diagram.";
535
+ };
536
+ readonly intent: {
537
+ readonly kind: "enum";
538
+ readonly values: readonly ["premium", "draft", "lofi"];
539
+ readonly group: "advisory";
540
+ readonly description: "Advisory intent metadata for pickers and quality tooling.";
541
+ };
542
+ readonly mono: {
543
+ readonly kind: "boolean";
544
+ readonly group: "advisory";
545
+ readonly description: "Advisory monochrome contract: express tone through shading and weight.";
546
+ };
547
+ };
548
+ type DescriptorValue<Descriptor> = Descriptor extends {
549
+ readonly kind: 'const';
550
+ readonly value: infer Value;
551
+ } ? Value : Descriptor extends {
552
+ readonly kind: 'string';
553
+ } ? string : Descriptor extends {
554
+ readonly kind: 'boolean';
555
+ } ? boolean : Descriptor extends {
556
+ readonly kind: 'number' | 'integer';
557
+ } ? number : Descriptor extends {
558
+ readonly kind: 'enum';
559
+ readonly values: readonly (infer Value)[];
560
+ } ? Value : Descriptor extends {
561
+ readonly kind: 'colors';
562
+ } ? StyleColors : Descriptor extends {
563
+ readonly kind: 'roles';
564
+ } ? RoleStyles : Descriptor extends {
565
+ readonly kind: 'semanticSlots';
566
+ } ? SemanticSlots : Descriptor extends {
567
+ readonly kind: 'bindings';
568
+ } ? readonly SemanticBinding[] : Descriptor extends {
569
+ readonly kind: 'constraints';
570
+ } ? readonly BrandConstraint[] : never;
571
+ /** A partial, composable public description of how diagrams look. */
572
+ type StyleSpec = {
573
+ -readonly [Key in keyof typeof STYLE_SPEC_FIELD_DESCRIPTORS]?: DescriptorValue<(typeof STYLE_SPEC_FIELD_DESCRIPTORS)[Key]>;
574
+ };
575
+ /**
576
+ * Validate untrusted JSON-like input against the canonical field manifest.
577
+ * Style data is declarative by construction: it cannot carry markup or URLs,
578
+ * and colors must pass the shared non-fetching CSS-color policy.
579
+ */
580
+ declare function validateStyleSpec(value: unknown): string[];
581
+ type JsonSchema = Readonly<Record<string, unknown>>;
582
+ /** JSON Schema projected from the same descriptors used at runtime. */
583
+ declare function styleSpecJsonSchema(): JsonSchema;
584
+
585
+ /** Private renderer defaults for built-in looks. This is intentionally not
586
+ * part of the public StyleSpec schema, registerStyle boundary, or docs. */
587
+ interface InternalStyleFace {
588
+ /** Complete admitted public role/policy view retained for family lowering. */
589
+ roles?: Readonly<RoleStyles>;
590
+ semanticSlots?: SemanticSlots;
591
+ bindings?: readonly SemanticBinding[];
592
+ constraints?: readonly BrandConstraint[];
593
+ text?: InternalTextFace;
594
+ node?: InternalNodeFace;
595
+ edge?: InternalEdgeFace;
596
+ group?: InternalGroupFace;
597
+ }
598
+ /** Runtime census authority: the private face is only a compiled projection of
599
+ * these admitted public role records and cannot own an extra expressive leaf. */
600
+ declare const INTERNAL_STYLE_FACE_PROJECTION: Readonly<{
601
+ text: Readonly<{
602
+ sourceRole: "label";
603
+ fields: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor"];
604
+ }>;
605
+ node: Readonly<{
606
+ sourceRole: "node";
607
+ fields: readonly ("borderColor" | "textColor" | "fontSize" | "fontWeight" | "letterSpacing" | "textTransform" | "paddingX" | "paddingY" | "cornerRadius" | "lineWidth" | "fillColor")[];
608
+ }>;
609
+ edge: Readonly<{
610
+ sourceRole: "edge";
611
+ fields: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "lineWidth", "bendRadius", "strokeColor"];
612
+ }>;
613
+ group: Readonly<{
614
+ sourceRole: "group";
615
+ fields: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "paddingX", "paddingY", "cornerRadius", "lineWidth", "fillColor", "borderColor", "fontFamily", "headerFillColor"];
616
+ }>;
617
+ }>;
618
+ type InternalTextFace = Pick<RoleStyleSpec, (typeof INTERNAL_STYLE_FACE_PROJECTION.text.fields)[number]>;
619
+ type InternalNodeFace = Pick<RoleStyleSpec, (typeof INTERNAL_STYLE_FACE_PROJECTION.node.fields)[number]>;
620
+ type InternalEdgeFace = Pick<RoleStyleSpec, (typeof INTERNAL_STYLE_FACE_PROJECTION.edge.fields)[number]>;
621
+ type InternalGroupFace = Pick<RoleStyleSpec, (typeof INTERNAL_STYLE_FACE_PROJECTION.group.fields)[number]>;
622
+ /** What RenderOptions.style accepts: a registered name, an inline spec, or a
623
+ * stack of either (merged left → right). */
624
+ type StyleInput = string | StyleSpec;
625
+ type StyleRegistryKind = 'look' | 'palette';
626
+ interface StyleRegistrationOptions {
627
+ readonly version?: string;
628
+ readonly compatibility?: ExtensionCompatibility;
629
+ readonly provenance?: ExtensionProvenance;
630
+ }
631
+ interface StyleDescriptor {
632
+ readonly identity: ExtensionIdentity<StyleRegistryKind>;
633
+ readonly spec: StyleSpec;
634
+ /** Stable preferred input. */
635
+ readonly inputName: string;
636
+ /** Stable label shared by CLI, editor, website, MCP, and generated docs. */
637
+ readonly displayLabel: string;
638
+ readonly kind: StyleRegistryKind;
639
+ readonly isDefault: boolean;
640
+ }
641
+ interface StyleReferenceResolution {
642
+ readonly canonicalId: string;
643
+ readonly spec: StyleSpec;
644
+ }
645
+ /**
646
+ * Register a reusable declarative style. New registrations use an explicit
647
+ * `look:` or `palette:` identity. Third-party registrations cannot create
648
+ * unqualified inputs or compatibility aliases.
649
+ */
650
+ declare function registerStyle(spec: StyleSpec, options?: StyleRegistrationOptions): () => boolean;
651
+ declare function resolveStyleReference(name: string): StyleReferenceResolution | undefined;
652
+ declare function getStyle(name: string): StyleSpec | undefined;
653
+ declare function knownStyles(): string[];
654
+ declare function knownStyleDescriptors(): readonly StyleDescriptor[];
655
+ /** Which backend a style needs, derived from what it asks for — authors
656
+ * describe the look, the engine picks the machinery. */
657
+ declare function inferBackend(spec: StyleSpec): 'default' | 'rough' | 'hybrid';
658
+ declare function resolveStyleStack(input: StyleInput | StyleInput[] | undefined): StyleSpec | undefined;
659
+
660
+ /**
661
+ * Stable role vocabulary shared by every Scene backend. Built-in roles keep
662
+ * their existing rendering policy, while extensions must use a namespace
663
+ * (`vendor:role`) so they cannot accidentally acquire new core semantics.
664
+ */
665
+
666
+ type CoreSceneRole = 'node' | 'edge' | 'edge-label' | 'group' | 'group-header' | 'label' | 'title' | 'defs' | 'prelude' | 'chrome';
667
+ 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';
668
+ type NamespacedSceneRole = `${string}:${string}`;
669
+ type SceneRole = BuiltinSceneRole | NamespacedSceneRole;
670
+ type SceneMarkKind = 'shape' | 'connector' | 'text' | 'group' | 'document';
671
+ type SceneSketchPolicy = 'shape' | 'connector' | 'none';
672
+ type SceneRoleStyleFallback = 'node' | 'edge' | 'group' | 'label';
673
+ interface SceneRoleTraits {
674
+ /** Scene mark kinds on which the role is meaningful. */
675
+ applicableKinds: readonly SceneMarkKind[];
676
+ /** Public brand archetype inherited by this semantic role. */
677
+ styleFallback: SceneRoleStyleFallback;
678
+ /** Whether an exact role record has an implemented family projection. */
679
+ styleConsumption: 'exact' | 'fallback-only';
680
+ /** Additional role-specific leaves with an implemented family projection. */
681
+ styleExtras: readonly (keyof RoleStyleSpec)[];
682
+ /** Optional exact applicable set when the fallback archetype is broader. */
683
+ styleProperties?: readonly (keyof RoleStyleSpec)[];
684
+ /** Built-in families that resolve semantic bindings for this exact role. */
685
+ styleBindingFamilies: readonly string[];
686
+ /** Whether structured SVG receives the stable data-id/data-role contract. */
687
+ domIdentity: boolean;
688
+ /** Whether endpoint-bearing marks receive relation accessibility semantics. */
689
+ relation: boolean;
690
+ /** Styled-backend realization policy. */
691
+ sketch: SceneSketchPolicy;
692
+ /** Whether text receives the cartographic readability halo. */
693
+ textHalo: boolean;
694
+ }
695
+ /** Exact built-in policy. Backends consume this table; exact style properties
696
+ * and binding-family admission are projected from EXACT_ROLE_STYLE_CONTRACT. */
697
+ declare const BUILTIN_SCENE_ROLE_TRAITS: Readonly<Record<BuiltinSceneRole, SceneRoleTraits>>;
698
+ interface ResolvedSceneRoleTraits {
699
+ traits: SceneRoleTraits;
700
+ source: 'builtin' | 'namespaced-safe';
701
+ }
702
+ type RoleStyleProperty = keyof RoleStyleSpec;
703
+ interface SceneRoleStyleDescriptor {
704
+ readonly fallbackRole: SceneRoleStyleFallback;
705
+ readonly applicableProperties: readonly RoleStyleProperty[];
706
+ }
707
+ interface SceneRoleDescriptor {
708
+ readonly identity: ExtensionIdentity<'role'>;
709
+ readonly role: BuiltinSceneRole;
710
+ readonly traits: SceneRoleTraits;
711
+ readonly style: SceneRoleStyleDescriptor;
712
+ }
713
+ /** Canonical discovery/identity/style projection derived from the trait authority. */
714
+ declare const SCENE_ROLE_DESCRIPTORS: readonly SceneRoleDescriptor[];
715
+ /**
716
+ * Resolve extension behavior deterministically. Namespaced roles always get
717
+ * the inert identity-only policy. Their local names never inherit current or
718
+ * future core semantics implicitly; a versioned trait-registration contract
719
+ * can be added later if a concrete extension needs one.
720
+ */
721
+ declare function resolveSceneRoleTraits(role: SceneRole): ResolvedSceneRoleTraits;
722
+ declare function sceneRoleTraits(role: SceneRole): SceneRoleTraits;
723
+
724
+ export { type ExtensionCompatibilityResolution as $, type StyleRegistrationOptions as A, BINDABLE_ROLE_STYLE_PROPERTIES as B, type StyleSpec as C, createExtensionIdentity as D, EXACT_ROLE_STYLE_CONTRACT as E, getStyle as F, inferBackend as G, knownStyleDescriptors as H, knownStyles as I, registerStyle as J, resolveSceneRoleTraits as K, resolveStyleReference as L, resolveStyleStack as M, sceneRoleTraits as N, styleSpecJsonSchema as O, validateStyleSpec as P, type InternalStyleFace as Q, ROLE_STYLE_PROPERTY_DESCRIPTORS as R, type StyleInput as S, BRAND_CONSTRAINT_WARNING_POLICY as T, type BrandConstraintWarningCode as U, type ExtensionCompatibility as V, type ExtensionProvenance as W, type BuiltinSceneRole as X, type CoreSceneRole as Y, ExtensionCollisionError as Z, type ExtensionCompatibilityDecision as _, BINDABLE_SCENE_ROLES as a, type ExtensionRegistration as a0, KNOWN_EXTENSION_CONTRACT_VERSIONS as a1, type NamespacedSceneRole as a2, type ResolvedSceneRoleTraits as a3, type SceneMarkKind as a4, type SceneRoleDescriptor as a5, type SceneRoleTraits as a6, type SceneSketchPolicy as a7, type StyleRegistryKind as a8, canonicalExtensionId as a9, evaluateExtensionCompatibility as aa, parseExtensionId as ab, registerExtension as ac, BRAND_CONSTRAINT_DESCRIPTORS as b, BRAND_CONSTRAINT_KINDS as c, BUILTIN_SCENE_ROLE_TRAITS as d, type BindableSceneRole as e, type BrandConstraint as f, type BrandConstraintAction as g, type BrandConstraintKind as h, EXACT_STYLE_SCENE_ROLES as i, type ExactStyleSceneRole as j, type ExtensionIdentity as k, type RoleStyleFor as l, type RoleStyleSpec as m, type RoleStyles as n, SCENE_ROLE_DESCRIPTORS as o, SEMANTIC_BINDING_CHANNELS as p, STYLE_COLOR_TOKEN_DESCRIPTORS as q, STYLE_SPEC_FIELD_DESCRIPTORS as r, STYLE_SPEC_FORMAT_VERSION as s, type SceneRole as t, type SemanticBinding as u, type SemanticBindingChannel as v, type SemanticSlots as w, type StyleColors as x, type StyleDescriptor as y, type StyleReferenceResolution as z };