agentic-mermaid 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/agent-core.d.ts +8 -3
- package/dist/agent-core.js +2 -2
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +4 -4
- package/dist/agentic-mermaid-mcp.js +5 -5
- package/dist/am.js +6 -6
- package/dist/browser-lazy/chunks/architecture-3CGEU363.js +31 -0
- package/dist/browser-lazy/chunks/chunk-2U4EUPSI.js +4 -0
- package/dist/browser-lazy/chunks/chunk-4IUBLBJJ.js +11 -0
- package/dist/browser-lazy/chunks/chunk-4U2TVB2S.js +1 -0
- package/dist/browser-lazy/chunks/chunk-5Q4S74UO.js +1 -0
- package/dist/browser-lazy/chunks/chunk-6UT2VTFI.js +1 -0
- package/dist/browser-lazy/chunks/chunk-7D24ZLOV.js +1 -0
- package/dist/browser-lazy/chunks/chunk-A7L4WWVW.js +143 -0
- package/dist/browser-lazy/chunks/chunk-CTVVJPMX.js +24 -0
- package/dist/browser-lazy/chunks/chunk-DPSSG7LR.js +4 -0
- package/dist/browser-lazy/chunks/chunk-EPFMQPXX.js +1 -0
- package/dist/browser-lazy/chunks/chunk-FFOHLPDA.js +2 -0
- package/dist/browser-lazy/chunks/chunk-FLD63DXE.js +2 -0
- package/dist/browser-lazy/chunks/chunk-FXBBGAMJ.js +46 -0
- package/dist/browser-lazy/chunks/chunk-GRXCKTHX.js +0 -0
- package/dist/browser-lazy/chunks/chunk-HZ4ADQMK.js +1 -0
- package/dist/browser-lazy/chunks/chunk-I6VE56S7.js +1 -0
- package/dist/browser-lazy/chunks/chunk-JX5ZZY3T.js +1 -0
- package/dist/browser-lazy/chunks/chunk-KJVNXJ5Y.js +1 -0
- package/dist/browser-lazy/chunks/chunk-KTTWXSIX.js +1 -0
- package/dist/browser-lazy/chunks/chunk-M6BT2HIP.js +1 -0
- package/dist/browser-lazy/chunks/chunk-MMWVZP6M.js +1 -0
- package/dist/browser-lazy/chunks/chunk-OFRMKQA6.js +1 -0
- package/dist/browser-lazy/chunks/chunk-P7HMSKHJ.js +1 -0
- package/dist/browser-lazy/chunks/chunk-PXRUFH7U.js +1 -0
- package/dist/browser-lazy/chunks/chunk-PZEWZT35.js +1 -0
- package/dist/browser-lazy/chunks/chunk-RVO6J7S3.js +1 -0
- package/dist/browser-lazy/chunks/chunk-STQRDZ67.js +1 -0
- package/dist/browser-lazy/chunks/chunk-T7IJ6V4B.js +3 -0
- package/dist/browser-lazy/chunks/chunk-VDTSULBU.js +7 -0
- package/dist/browser-lazy/chunks/chunk-WEUWIFG3.js +1 -0
- package/dist/browser-lazy/chunks/class-B3AVLSIF.js +9 -0
- package/dist/browser-lazy/chunks/er-AF4BKKKC.js +9 -0
- package/dist/browser-lazy/chunks/flowchart-BE6BQZLZ.js +4 -0
- package/dist/browser-lazy/chunks/gantt-U4BMMSEL.js +28 -0
- package/dist/browser-lazy/chunks/gitgraph-UPSWNFRP.js +8 -0
- package/dist/browser-lazy/chunks/journey-PDZ7FDJR.js +40 -0
- package/dist/browser-lazy/chunks/mindmap-BFEUURLS.js +9 -0
- package/dist/browser-lazy/chunks/pie-ZFYW5JZO.js +19 -0
- package/dist/browser-lazy/chunks/quadrant-XJVEYYXK.js +24 -0
- package/dist/browser-lazy/chunks/radar-OVXFNRNC.js +32 -0
- package/dist/browser-lazy/chunks/render-core-R4ZGGEFS.js +12 -0
- package/dist/browser-lazy/chunks/sequence-AWY6JCSB.js +12 -0
- package/dist/browser-lazy/chunks/state-TCE4DXKR.js +4 -0
- package/dist/browser-lazy/chunks/timeline-W4ZVT3FF.js +20 -0
- package/dist/browser-lazy/chunks/xychart-K3QQACKS.js +36 -0
- package/dist/browser-lazy/index.d.ts +1012 -0
- package/dist/browser-lazy/index.js +1 -0
- package/dist/browser.global.js +322 -321
- package/dist/{chunk-AVCWKYII.js → chunk-BSVM3VMO.js} +18 -5
- package/dist/{chunk-HFD4MALA.js → chunk-FGO3J7RA.js} +7 -7
- package/dist/{chunk-UJNY65QS.js → chunk-JJ7JRYZV.js} +2 -2
- package/dist/{chunk-3QCXO4V6.js → chunk-KQMJ37OY.js} +4 -4
- package/dist/{chunk-GILQUGFK.js → chunk-MBIR6S3B.js} +2 -2
- package/dist/{chunk-WHYJLDYG.js → chunk-XVY324NY.js} +47736 -47665
- package/dist/{index-CLwYn6Im.d.ts → index-Do8z5rPq.d.ts} +5409 -5391
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp-cli-7FLGTEG3.js +17 -0
- package/docs/README.md +1 -1
- package/docs/browser.md +355 -47
- package/package.json +13 -3
- package/server.json +2 -2
- package/dist/mcp-cli-SJVOGRA6.js +0 -17
|
@@ -0,0 +1,1012 @@
|
|
|
1
|
+
/** Closed brand-neutral leaves available to applicable Scene roles. */
|
|
2
|
+
declare const ROLE_STYLE_PROPERTY_DESCRIPTORS: Readonly<{
|
|
3
|
+
readonly fontFamily: {
|
|
4
|
+
readonly kind: "font";
|
|
5
|
+
readonly description: "Safe font family/stack for roles whose descriptor exposes family-specific typography.";
|
|
6
|
+
};
|
|
7
|
+
readonly fontSize: {
|
|
8
|
+
readonly kind: "number";
|
|
9
|
+
readonly minimum: 1;
|
|
10
|
+
readonly maximum: 256;
|
|
11
|
+
readonly expected: "between 1 and 256";
|
|
12
|
+
readonly description: "Font size in SVG user units.";
|
|
13
|
+
};
|
|
14
|
+
readonly fontWeight: {
|
|
15
|
+
readonly kind: "number";
|
|
16
|
+
readonly minimum: 1;
|
|
17
|
+
readonly maximum: 1000;
|
|
18
|
+
readonly expected: "between 1 and 1000";
|
|
19
|
+
readonly description: "CSS numeric font weight.";
|
|
20
|
+
};
|
|
21
|
+
readonly letterSpacing: {
|
|
22
|
+
readonly kind: "number";
|
|
23
|
+
readonly minimum: -2;
|
|
24
|
+
readonly maximum: 4;
|
|
25
|
+
readonly expected: "between -2 and 4";
|
|
26
|
+
readonly description: "Letter spacing in SVG user units.";
|
|
27
|
+
};
|
|
28
|
+
readonly textTransform: {
|
|
29
|
+
readonly kind: "enum";
|
|
30
|
+
readonly values: readonly ["uppercase", "lowercase", "capitalize"];
|
|
31
|
+
readonly description: "Text transformation.";
|
|
32
|
+
};
|
|
33
|
+
readonly textColor: {
|
|
34
|
+
readonly kind: "color";
|
|
35
|
+
readonly description: "Text paint.";
|
|
36
|
+
};
|
|
37
|
+
readonly paddingX: {
|
|
38
|
+
readonly kind: "number";
|
|
39
|
+
readonly minimum: 0;
|
|
40
|
+
readonly maximum: 256;
|
|
41
|
+
readonly expected: "between 0 and 256";
|
|
42
|
+
readonly description: "Horizontal role padding.";
|
|
43
|
+
};
|
|
44
|
+
readonly paddingY: {
|
|
45
|
+
readonly kind: "number";
|
|
46
|
+
readonly minimum: 0;
|
|
47
|
+
readonly maximum: 256;
|
|
48
|
+
readonly expected: "between 0 and 256";
|
|
49
|
+
readonly description: "Vertical role padding.";
|
|
50
|
+
};
|
|
51
|
+
readonly cornerRadius: {
|
|
52
|
+
readonly kind: "number";
|
|
53
|
+
readonly minimum: 0;
|
|
54
|
+
readonly maximum: 256;
|
|
55
|
+
readonly expected: "between 0 and 256";
|
|
56
|
+
readonly description: "Applicable corner radius.";
|
|
57
|
+
};
|
|
58
|
+
readonly lineWidth: {
|
|
59
|
+
readonly kind: "number";
|
|
60
|
+
readonly exclusiveMinimum: 0;
|
|
61
|
+
readonly maximum: 20;
|
|
62
|
+
readonly expected: "greater than 0 and at most 20";
|
|
63
|
+
readonly description: "Border or connector width.";
|
|
64
|
+
};
|
|
65
|
+
readonly bendRadius: {
|
|
66
|
+
readonly kind: "number";
|
|
67
|
+
readonly minimum: 0;
|
|
68
|
+
readonly maximum: 256;
|
|
69
|
+
readonly expected: "between 0 and 256";
|
|
70
|
+
readonly description: "Applicable connector bend radius.";
|
|
71
|
+
};
|
|
72
|
+
readonly fillColor: {
|
|
73
|
+
readonly kind: "color";
|
|
74
|
+
readonly description: "Surface fill paint.";
|
|
75
|
+
};
|
|
76
|
+
readonly borderColor: {
|
|
77
|
+
readonly kind: "color";
|
|
78
|
+
readonly description: "Border paint.";
|
|
79
|
+
};
|
|
80
|
+
readonly strokeColor: {
|
|
81
|
+
readonly kind: "color";
|
|
82
|
+
readonly description: "Connector stroke paint.";
|
|
83
|
+
};
|
|
84
|
+
readonly headerFillColor: {
|
|
85
|
+
readonly kind: "color";
|
|
86
|
+
readonly description: "Group header surface paint.";
|
|
87
|
+
};
|
|
88
|
+
readonly cue: {
|
|
89
|
+
readonly kind: "enum";
|
|
90
|
+
readonly values: readonly ["none", "outline", "double-line", "pattern"];
|
|
91
|
+
readonly description: "Non-color semantic cue on roles whose family renderer exposes a cue projection.";
|
|
92
|
+
};
|
|
93
|
+
}>;
|
|
94
|
+
type RolePropertyValue<D> = D extends {
|
|
95
|
+
readonly kind: 'number';
|
|
96
|
+
} ? number : D extends {
|
|
97
|
+
readonly kind: 'font' | 'color';
|
|
98
|
+
} ? string : D extends {
|
|
99
|
+
readonly kind: 'enum';
|
|
100
|
+
readonly values: readonly (infer V)[];
|
|
101
|
+
} ? V : never;
|
|
102
|
+
type RoleStyleSpec = {
|
|
103
|
+
-readonly [K in keyof typeof ROLE_STYLE_PROPERTY_DESCRIPTORS]?: RolePropertyValue<(typeof ROLE_STYLE_PROPERTY_DESCRIPTORS)[K]>;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* The single exact-role styling authority. Runtime role descriptors, public
|
|
107
|
+
* TypeScript, JSON Schema, binding admission, docs, and the executable census
|
|
108
|
+
* all project from this record.
|
|
109
|
+
*/
|
|
110
|
+
declare const EXACT_ROLE_STYLE_CONTRACT: Readonly<{
|
|
111
|
+
readonly node: Readonly<{
|
|
112
|
+
properties: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "paddingX", "paddingY", "cornerRadius", "lineWidth", "fillColor", "borderColor"];
|
|
113
|
+
}>;
|
|
114
|
+
readonly edge: Readonly<{
|
|
115
|
+
properties: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "lineWidth", "bendRadius", "strokeColor"];
|
|
116
|
+
}>;
|
|
117
|
+
readonly group: Readonly<{
|
|
118
|
+
properties: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "paddingX", "paddingY", "cornerRadius", "lineWidth", "fillColor", "borderColor", "fontFamily", "headerFillColor"];
|
|
119
|
+
}>;
|
|
120
|
+
readonly 'group-header': Readonly<{
|
|
121
|
+
properties: readonly ["fontFamily", "fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "fillColor", "borderColor", "strokeColor", "lineWidth", "cue"];
|
|
122
|
+
bindingFamilies: readonly ["journey"];
|
|
123
|
+
}>;
|
|
124
|
+
readonly label: Readonly<{
|
|
125
|
+
properties: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor"];
|
|
126
|
+
}>;
|
|
127
|
+
readonly actor: Readonly<{
|
|
128
|
+
properties: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "paddingX", "paddingY", "cornerRadius", "lineWidth", "fillColor", "borderColor"];
|
|
129
|
+
bindingFamilies: readonly ["sequence"];
|
|
130
|
+
}>;
|
|
131
|
+
readonly relationship: Readonly<{
|
|
132
|
+
properties: readonly ["fontSize", "fontWeight", "letterSpacing", "textTransform", "textColor", "lineWidth", "bendRadius", "strokeColor"];
|
|
133
|
+
bindingFamilies: readonly ["er"];
|
|
134
|
+
}>;
|
|
135
|
+
readonly 'pie-slice': Readonly<{
|
|
136
|
+
properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth", "cue"];
|
|
137
|
+
bindingFamilies: readonly ["pie", "radar"];
|
|
138
|
+
}>;
|
|
139
|
+
readonly legend: Readonly<{
|
|
140
|
+
properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth", "textColor"];
|
|
141
|
+
bindingFamilies: readonly ["radar"];
|
|
142
|
+
}>;
|
|
143
|
+
readonly bar: Readonly<{
|
|
144
|
+
properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth"];
|
|
145
|
+
bindingFamilies: readonly ["xychart"];
|
|
146
|
+
}>;
|
|
147
|
+
readonly series: Readonly<{
|
|
148
|
+
properties: readonly ["borderColor", "strokeColor", "lineWidth"];
|
|
149
|
+
bindingFamilies: readonly ["xychart"];
|
|
150
|
+
}>;
|
|
151
|
+
readonly point: Readonly<{
|
|
152
|
+
properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth"];
|
|
153
|
+
bindingFamilies: readonly ["radar"];
|
|
154
|
+
}>;
|
|
155
|
+
readonly task: Readonly<{
|
|
156
|
+
properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth", "cue"];
|
|
157
|
+
bindingFamilies: readonly ["gantt"];
|
|
158
|
+
}>;
|
|
159
|
+
readonly milestone: Readonly<{
|
|
160
|
+
properties: readonly ["fillColor", "borderColor", "strokeColor", "lineWidth", "cue"];
|
|
161
|
+
bindingFamilies: readonly ["gantt"];
|
|
162
|
+
}>;
|
|
163
|
+
}>;
|
|
164
|
+
type ExactStyleSceneRole = keyof typeof EXACT_ROLE_STYLE_CONTRACT;
|
|
165
|
+
type BindableSceneRole = {
|
|
166
|
+
[Role in ExactStyleSceneRole]: (typeof EXACT_ROLE_STYLE_CONTRACT)[Role] extends {
|
|
167
|
+
readonly bindingFamilies: readonly [string, ...string[]];
|
|
168
|
+
} ? Role : never;
|
|
169
|
+
}[ExactStyleSceneRole];
|
|
170
|
+
type RoleStyleFor<Role extends BuiltinSceneRole> = Role extends ExactStyleSceneRole ? Pick<RoleStyleSpec, (typeof EXACT_ROLE_STYLE_CONTRACT)[Role]['properties'][number]> : never;
|
|
171
|
+
type RoleStyles = {
|
|
172
|
+
[Role in ExactStyleSceneRole]?: Readonly<RoleStyleFor<Role>>;
|
|
173
|
+
};
|
|
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
|
+
type BrandConstraintAction = 'warn' | 'error';
|
|
185
|
+
type BrandConstraintFieldDescriptor = {
|
|
186
|
+
readonly kind: 'role';
|
|
187
|
+
readonly required?: true;
|
|
188
|
+
} | {
|
|
189
|
+
readonly kind: 'number';
|
|
190
|
+
readonly minimum: number;
|
|
191
|
+
readonly maximum: number;
|
|
192
|
+
readonly required?: true;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Single payload-shape authority for every public Brand constraint. Public
|
|
196
|
+
* TypeScript, runtime admission, JSON Schema, diagnostics, and evaluator
|
|
197
|
+
* exhaustiveness project from this record.
|
|
198
|
+
*/
|
|
199
|
+
declare const BRAND_CONSTRAINT_DESCRIPTORS: Readonly<{
|
|
200
|
+
readonly contrast: Readonly<{
|
|
201
|
+
properties: Readonly<{
|
|
202
|
+
role: Readonly<{
|
|
203
|
+
readonly kind: "role";
|
|
204
|
+
}>;
|
|
205
|
+
minimum: Readonly<{
|
|
206
|
+
readonly kind: "number";
|
|
207
|
+
readonly minimum: 1;
|
|
208
|
+
readonly maximum: 21;
|
|
209
|
+
}>;
|
|
210
|
+
}>;
|
|
211
|
+
recovery: "Choose an authored text/surface pair that meets the requested ratio, or remove the rule; the renderer will not repaint it.";
|
|
212
|
+
}>;
|
|
213
|
+
readonly 'accent-area': Readonly<{
|
|
214
|
+
properties: Readonly<{
|
|
215
|
+
maxFraction: Readonly<{
|
|
216
|
+
readonly kind: "number";
|
|
217
|
+
readonly minimum: 0;
|
|
218
|
+
readonly maximum: 1;
|
|
219
|
+
readonly required: true;
|
|
220
|
+
}>;
|
|
221
|
+
}>;
|
|
222
|
+
recovery: "Reduce authored accent-filled area or raise the declared maximum; the renderer will not rewrite fills.";
|
|
223
|
+
}>;
|
|
224
|
+
readonly 'mono-role': Readonly<{
|
|
225
|
+
properties: Readonly<{
|
|
226
|
+
role: Readonly<{
|
|
227
|
+
readonly kind: "role";
|
|
228
|
+
readonly required: true;
|
|
229
|
+
}>;
|
|
230
|
+
}>;
|
|
231
|
+
recovery: "Use measurable monochrome paint for the named role or remove the rule; the renderer will not rewrite paint.";
|
|
232
|
+
}>;
|
|
233
|
+
}>;
|
|
234
|
+
type BrandConstraintKind = keyof typeof BRAND_CONSTRAINT_DESCRIPTORS;
|
|
235
|
+
type FieldValue<Descriptor extends BrandConstraintFieldDescriptor> = Descriptor['kind'] extends 'role' ? BuiltinSceneRole : number;
|
|
236
|
+
type PropertiesOf<Kind extends BrandConstraintKind> = (typeof BRAND_CONSTRAINT_DESCRIPTORS)[Kind]['properties'];
|
|
237
|
+
type RequiredPropertyNames<Kind extends BrandConstraintKind> = {
|
|
238
|
+
[Field in keyof PropertiesOf<Kind>]: PropertiesOf<Kind>[Field] extends {
|
|
239
|
+
readonly required: true;
|
|
240
|
+
} ? Field : never;
|
|
241
|
+
}[keyof PropertiesOf<Kind>];
|
|
242
|
+
type OptionalPropertyNames<Kind extends BrandConstraintKind> = Exclude<keyof PropertiesOf<Kind>, RequiredPropertyNames<Kind>>;
|
|
243
|
+
type ConstraintPayload<Kind extends BrandConstraintKind> = {
|
|
244
|
+
readonly [Field in RequiredPropertyNames<Kind>]: PropertiesOf<Kind>[Field] extends BrandConstraintFieldDescriptor ? FieldValue<PropertiesOf<Kind>[Field]> : never;
|
|
245
|
+
} & {
|
|
246
|
+
readonly [Field in OptionalPropertyNames<Kind>]?: PropertiesOf<Kind>[Field] extends BrandConstraintFieldDescriptor ? FieldValue<PropertiesOf<Kind>[Field]> : never;
|
|
247
|
+
};
|
|
248
|
+
type BrandConstraint = {
|
|
249
|
+
[Kind in BrandConstraintKind]: Readonly<{
|
|
250
|
+
kind: Kind;
|
|
251
|
+
action: BrandConstraintAction;
|
|
252
|
+
} & ConstraintPayload<Kind>>;
|
|
253
|
+
}[BrandConstraintKind];
|
|
254
|
+
|
|
255
|
+
type MermaidConfigScalar = string | number | boolean | null;
|
|
256
|
+
type MermaidConfigValue = MermaidConfigScalar | MermaidConfigValue[] | MermaidConfigMap;
|
|
257
|
+
interface MermaidConfigMap {
|
|
258
|
+
[key: string]: MermaidConfigValue | undefined;
|
|
259
|
+
}
|
|
260
|
+
interface MermaidThemeVariables extends MermaidConfigMap {
|
|
261
|
+
fontFamily?: string;
|
|
262
|
+
}
|
|
263
|
+
interface TimelineRuntimeConfig extends MermaidConfigMap {
|
|
264
|
+
disableMulticolor?: boolean;
|
|
265
|
+
sectionFills?: string[];
|
|
266
|
+
sectionColours?: string[];
|
|
267
|
+
}
|
|
268
|
+
/** Mermaid stateDiagram config. Faithful ELK/measured-text fields are wired; legacy fields warn. */
|
|
269
|
+
interface StateRuntimeConfig extends MermaidConfigMap {
|
|
270
|
+
titleTopMargin?: number;
|
|
271
|
+
arrowMarkerAbsolute?: boolean;
|
|
272
|
+
dividerMargin?: number;
|
|
273
|
+
sizeUnit?: number;
|
|
274
|
+
padding?: number;
|
|
275
|
+
textHeight?: number;
|
|
276
|
+
titleShift?: number;
|
|
277
|
+
noteMargin?: number;
|
|
278
|
+
nodeSpacing?: number;
|
|
279
|
+
rankSpacing?: number;
|
|
280
|
+
forkWidth?: number;
|
|
281
|
+
forkHeight?: number;
|
|
282
|
+
miniPadding?: number;
|
|
283
|
+
fontSizeFactor?: number;
|
|
284
|
+
fontSize?: number;
|
|
285
|
+
labelHeight?: number;
|
|
286
|
+
edgeLengthFactor?: string;
|
|
287
|
+
compositTitleSize?: number;
|
|
288
|
+
radius?: number;
|
|
289
|
+
defaultRenderer?: 'dagre-d3' | 'dagre-wrapper' | 'elk';
|
|
290
|
+
}
|
|
291
|
+
interface XyChartRuntimeConfig extends MermaidConfigMap {
|
|
292
|
+
width?: number;
|
|
293
|
+
height?: number;
|
|
294
|
+
useMaxWidth?: boolean;
|
|
295
|
+
useWidth?: number;
|
|
296
|
+
titleFontSize?: number;
|
|
297
|
+
titlePadding?: number;
|
|
298
|
+
chartOrientation?: 'vertical' | 'horizontal';
|
|
299
|
+
plotReservedSpacePercent?: number;
|
|
300
|
+
showDataLabel?: boolean;
|
|
301
|
+
showTitle?: boolean;
|
|
302
|
+
showLegend?: boolean;
|
|
303
|
+
legendFontSize?: number;
|
|
304
|
+
legendPadding?: number;
|
|
305
|
+
xAxis?: MermaidConfigMap;
|
|
306
|
+
yAxis?: MermaidConfigMap;
|
|
307
|
+
}
|
|
308
|
+
interface PieRuntimeConfig extends MermaidConfigMap {
|
|
309
|
+
textPosition?: number;
|
|
310
|
+
donutHole?: number;
|
|
311
|
+
legendPosition?: 'top' | 'bottom' | 'left' | 'right' | 'center';
|
|
312
|
+
highlightSlice?: string;
|
|
313
|
+
useMaxWidth?: boolean;
|
|
314
|
+
useWidth?: number;
|
|
315
|
+
}
|
|
316
|
+
interface RadarRuntimeConfig extends MermaidConfigMap {
|
|
317
|
+
width?: number;
|
|
318
|
+
height?: number;
|
|
319
|
+
marginTop?: number;
|
|
320
|
+
marginRight?: number;
|
|
321
|
+
marginBottom?: number;
|
|
322
|
+
marginLeft?: number;
|
|
323
|
+
axisScaleFactor?: number;
|
|
324
|
+
axisLabelFactor?: number;
|
|
325
|
+
curveTension?: number;
|
|
326
|
+
useMaxWidth?: boolean;
|
|
327
|
+
useWidth?: number;
|
|
328
|
+
/** Agentic extension: draw the ring value labels (default off). */
|
|
329
|
+
tickLabels?: boolean;
|
|
330
|
+
}
|
|
331
|
+
interface QuadrantRuntimeConfig extends MermaidConfigMap {
|
|
332
|
+
chartWidth?: number;
|
|
333
|
+
chartHeight?: number;
|
|
334
|
+
titleFontSize?: number;
|
|
335
|
+
titlePadding?: number;
|
|
336
|
+
quadrantPadding?: number;
|
|
337
|
+
quadrantLabelFontSize?: number;
|
|
338
|
+
xAxisLabelFontSize?: number;
|
|
339
|
+
yAxisLabelFontSize?: number;
|
|
340
|
+
xAxisLabelPadding?: number;
|
|
341
|
+
yAxisLabelPadding?: number;
|
|
342
|
+
pointLabelFontSize?: number;
|
|
343
|
+
pointRadius?: number;
|
|
344
|
+
pointTextPadding?: number;
|
|
345
|
+
quadrantInternalBorderStrokeWidth?: number;
|
|
346
|
+
quadrantExternalBorderStrokeWidth?: number;
|
|
347
|
+
useMaxWidth?: boolean;
|
|
348
|
+
quadrantTextTopPadding?: number;
|
|
349
|
+
xAxisPosition?: string;
|
|
350
|
+
yAxisPosition?: string;
|
|
351
|
+
useWidth?: number;
|
|
352
|
+
}
|
|
353
|
+
interface JourneyRuntimeConfig extends MermaidConfigMap {
|
|
354
|
+
diagramMarginX?: number;
|
|
355
|
+
diagramMarginY?: number;
|
|
356
|
+
leftMargin?: number;
|
|
357
|
+
maxLabelWidth?: number;
|
|
358
|
+
width?: number;
|
|
359
|
+
height?: number;
|
|
360
|
+
boxMargin?: number;
|
|
361
|
+
boxTextMargin?: number;
|
|
362
|
+
noteMargin?: number;
|
|
363
|
+
messageMargin?: number;
|
|
364
|
+
messageAlign?: 'left' | 'center' | 'right';
|
|
365
|
+
bottomMarginAdj?: number;
|
|
366
|
+
useMaxWidth?: boolean;
|
|
367
|
+
rightAngles?: boolean;
|
|
368
|
+
taskFontSize?: string | number;
|
|
369
|
+
taskFontFamily?: string;
|
|
370
|
+
taskMargin?: number;
|
|
371
|
+
activationWidth?: number;
|
|
372
|
+
textPlacement?: string;
|
|
373
|
+
actorColours?: string[];
|
|
374
|
+
sectionFills?: string[];
|
|
375
|
+
sectionColours?: string[];
|
|
376
|
+
titleColor?: string;
|
|
377
|
+
titleFontFamily?: string;
|
|
378
|
+
titleFontSize?: string | number;
|
|
379
|
+
}
|
|
380
|
+
interface GanttRuntimeConfig extends MermaidConfigMap {
|
|
381
|
+
displayMode?: string;
|
|
382
|
+
barHeight?: number;
|
|
383
|
+
topAxis?: boolean;
|
|
384
|
+
tickInterval?: string;
|
|
385
|
+
barGap?: number;
|
|
386
|
+
topPadding?: number;
|
|
387
|
+
leftPadding?: number;
|
|
388
|
+
gridLineStartPadding?: number;
|
|
389
|
+
fontSize?: number;
|
|
390
|
+
sectionFontSize?: number;
|
|
391
|
+
numberSectionStyles?: number;
|
|
392
|
+
axisFormat?: string;
|
|
393
|
+
todayMarker?: string;
|
|
394
|
+
weekday?: string;
|
|
395
|
+
}
|
|
396
|
+
/** Wired deterministic mindmap layout fields. */
|
|
397
|
+
interface MindmapRuntimeConfig extends MermaidConfigMap {
|
|
398
|
+
padding?: number;
|
|
399
|
+
maxNodeWidth?: number;
|
|
400
|
+
}
|
|
401
|
+
/** Wired GitGraph presentation and replay fields. */
|
|
402
|
+
interface GitGraphRuntimeConfig extends MermaidConfigMap {
|
|
403
|
+
showBranches?: boolean;
|
|
404
|
+
showCommitLabel?: boolean;
|
|
405
|
+
mainBranchName?: string;
|
|
406
|
+
mainBranchOrder?: number;
|
|
407
|
+
parallelCommits?: boolean;
|
|
408
|
+
rotateCommitLabel?: boolean;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Mermaid's documented classDiagram config shape (wire-or-warn, P4):
|
|
412
|
+
* nodeSpacing/rankSpacing are wired into the ELK layout
|
|
413
|
+
* (src/class/layout.ts resolveClassRenderOptions); every other documented
|
|
414
|
+
* 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).
|
|
416
|
+
*/
|
|
417
|
+
interface ClassRuntimeConfig extends MermaidConfigMap {
|
|
418
|
+
nodeSpacing?: number;
|
|
419
|
+
rankSpacing?: number;
|
|
420
|
+
titleTopMargin?: number;
|
|
421
|
+
arrowMarkerAbsolute?: boolean;
|
|
422
|
+
dividerMargin?: number;
|
|
423
|
+
padding?: number;
|
|
424
|
+
textHeight?: number;
|
|
425
|
+
defaultRenderer?: string;
|
|
426
|
+
diagramPadding?: number;
|
|
427
|
+
htmlLabels?: boolean;
|
|
428
|
+
hideEmptyMembersBox?: boolean;
|
|
429
|
+
hierarchicalNamespaces?: boolean;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Mermaid's documented er config shape (wire-or-warn, P4): layoutDirection +
|
|
433
|
+
* nodeSpacing/rankSpacing are wired (src/er/layout.ts
|
|
434
|
+
* applyErFrontmatterConfig); the rest emit INEFFECTIVE_CONFIG
|
|
435
|
+
* (ER_NOOP_CONFIG_FIELDS in src/agent/verify.ts).
|
|
436
|
+
*/
|
|
437
|
+
interface ErRuntimeConfig extends MermaidConfigMap {
|
|
438
|
+
layoutDirection?: string;
|
|
439
|
+
nodeSpacing?: number;
|
|
440
|
+
rankSpacing?: number;
|
|
441
|
+
titleTopMargin?: number;
|
|
442
|
+
diagramPadding?: number;
|
|
443
|
+
minEntityWidth?: number;
|
|
444
|
+
minEntityHeight?: number;
|
|
445
|
+
entityPadding?: number;
|
|
446
|
+
stroke?: string;
|
|
447
|
+
fill?: string;
|
|
448
|
+
fontSize?: number;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Mermaid's documented architecture config shape (wire-or-warn, P4): padding,
|
|
452
|
+
* iconSize, fontSize, nodeSeparation, and idealEdgeLengthMultiplier are wired
|
|
453
|
+
* (src/architecture/config.ts); the fcose simulation knobs — edgeElasticity,
|
|
454
|
+
* 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).
|
|
457
|
+
*/
|
|
458
|
+
interface ArchitectureRuntimeConfig extends MermaidConfigMap {
|
|
459
|
+
padding?: number;
|
|
460
|
+
iconSize?: number;
|
|
461
|
+
fontSize?: number;
|
|
462
|
+
nodeSeparation?: number;
|
|
463
|
+
idealEdgeLengthMultiplier?: number;
|
|
464
|
+
edgeElasticity?: number;
|
|
465
|
+
numIter?: number;
|
|
466
|
+
seed?: number;
|
|
467
|
+
randomize?: boolean;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Mermaid's documented flowchart config shape (wire-or-warn, P4):
|
|
471
|
+
* nodeSpacing/rankSpacing/wrappingWidth are wired
|
|
472
|
+
* (src/flowchart-config.ts resolveFlowchartRenderOptions); every other
|
|
473
|
+
* 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).
|
|
476
|
+
*/
|
|
477
|
+
interface FlowchartRuntimeConfig extends MermaidConfigMap {
|
|
478
|
+
nodeSpacing?: number;
|
|
479
|
+
rankSpacing?: number;
|
|
480
|
+
wrappingWidth?: number;
|
|
481
|
+
titleTopMargin?: number;
|
|
482
|
+
subGraphTitleMargin?: MermaidConfigMap;
|
|
483
|
+
arrowMarkerAbsolute?: boolean;
|
|
484
|
+
diagramPadding?: number;
|
|
485
|
+
htmlLabels?: boolean;
|
|
486
|
+
curve?: string;
|
|
487
|
+
padding?: number;
|
|
488
|
+
defaultRenderer?: string;
|
|
489
|
+
inheritDir?: boolean;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Mermaid's documented sequence config shape (wire-or-warn, P4): actorMargin,
|
|
493
|
+
* width, height, diagramMarginX/Y, messageMargin, noteMargin, activationWidth,
|
|
494
|
+
* and showSequenceNumbers are wired (src/sequence/config.ts
|
|
495
|
+
* resolveSequenceConfig → src/sequence/layout.ts); every other documented key
|
|
496
|
+
* 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).
|
|
499
|
+
*/
|
|
500
|
+
interface SequenceRuntimeConfig extends MermaidConfigMap {
|
|
501
|
+
actorMargin?: number;
|
|
502
|
+
width?: number;
|
|
503
|
+
height?: number;
|
|
504
|
+
diagramMarginX?: number;
|
|
505
|
+
diagramMarginY?: number;
|
|
506
|
+
messageMargin?: number;
|
|
507
|
+
noteMargin?: number;
|
|
508
|
+
activationWidth?: number;
|
|
509
|
+
showSequenceNumbers?: boolean;
|
|
510
|
+
boxMargin?: number;
|
|
511
|
+
boxTextMargin?: number;
|
|
512
|
+
messageAlign?: 'left' | 'center' | 'right';
|
|
513
|
+
mirrorActors?: boolean;
|
|
514
|
+
bottomMarginAdj?: number;
|
|
515
|
+
rightAngles?: boolean;
|
|
516
|
+
wrap?: boolean;
|
|
517
|
+
wrapPadding?: number;
|
|
518
|
+
labelBoxWidth?: number;
|
|
519
|
+
labelBoxHeight?: number;
|
|
520
|
+
hideUnusedParticipants?: boolean;
|
|
521
|
+
forceMenus?: boolean;
|
|
522
|
+
arrowMarkerAbsolute?: boolean;
|
|
523
|
+
noteAlign?: 'left' | 'center' | 'right';
|
|
524
|
+
actorFontSize?: string | number;
|
|
525
|
+
actorFontFamily?: string;
|
|
526
|
+
actorFontWeight?: string | number;
|
|
527
|
+
noteFontSize?: string | number;
|
|
528
|
+
noteFontFamily?: string;
|
|
529
|
+
noteFontWeight?: string | number;
|
|
530
|
+
messageFontSize?: string | number;
|
|
531
|
+
messageFontFamily?: string;
|
|
532
|
+
messageFontWeight?: string | number;
|
|
533
|
+
}
|
|
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;
|
|
596
|
+
}
|
|
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
|
+
|
|
790
|
+
interface ArchitectureVisualConfig {
|
|
791
|
+
groupHeaderHeight: number;
|
|
792
|
+
groupFontSize: number;
|
|
793
|
+
groupFontWeight: number;
|
|
794
|
+
groupLetterSpacing: number;
|
|
795
|
+
groupFont?: string;
|
|
796
|
+
groupTextTransform?: TextTransform;
|
|
797
|
+
groupPaddingX: number;
|
|
798
|
+
groupPaddingY: number;
|
|
799
|
+
groupLabelPaddingX: number;
|
|
800
|
+
groupCornerRadius: number;
|
|
801
|
+
groupLineWidth: number;
|
|
802
|
+
groupText?: string;
|
|
803
|
+
serviceFontSize: number;
|
|
804
|
+
serviceFontWeight: number;
|
|
805
|
+
serviceLetterSpacing: number;
|
|
806
|
+
serviceTextTransform?: TextTransform;
|
|
807
|
+
servicePaddingX: number;
|
|
808
|
+
servicePaddingY: number;
|
|
809
|
+
serviceCornerRadius: number;
|
|
810
|
+
serviceLineWidth: number;
|
|
811
|
+
serviceText?: string;
|
|
812
|
+
edgeFontSize: number;
|
|
813
|
+
edgeFontWeight: number;
|
|
814
|
+
edgeLetterSpacing: number;
|
|
815
|
+
edgeTextTransform?: TextTransform;
|
|
816
|
+
edgeLineWidth: number;
|
|
817
|
+
edgeBendRadius: number;
|
|
818
|
+
edgeStroke?: string;
|
|
819
|
+
edgeText?: string;
|
|
820
|
+
iconSize: number;
|
|
821
|
+
serviceIconSize: number;
|
|
822
|
+
junctionOuterRadius: number;
|
|
823
|
+
junctionInnerRadius: number;
|
|
824
|
+
groupSurface?: string;
|
|
825
|
+
groupHeaderSurface?: string;
|
|
826
|
+
groupBorder?: string;
|
|
827
|
+
serviceSurface?: string;
|
|
828
|
+
serviceBorder?: string;
|
|
829
|
+
}
|
|
830
|
+
/** Sparse public input merged over the complete request-resolved visual
|
|
831
|
+
* configuration. Callers can change one metric without copying internal
|
|
832
|
+
* defaults; renderers continue to consume ArchitectureVisualConfig only. */
|
|
833
|
+
type ArchitectureVisualOverrides = Partial<ArchitectureVisualConfig>;
|
|
834
|
+
|
|
835
|
+
type TextTransform = 'uppercase' | 'lowercase' | 'capitalize';
|
|
836
|
+
/** A deterministic warning for accepted configuration that cannot affect output. */
|
|
837
|
+
interface ConfigDiagnostic {
|
|
838
|
+
code: 'INEFFECTIVE_CONFIG';
|
|
839
|
+
/** Fully-qualified config path, for example `state.titleTopMargin`. */
|
|
840
|
+
field: string;
|
|
841
|
+
message: string;
|
|
842
|
+
}
|
|
843
|
+
interface RenderOptions {
|
|
844
|
+
/** Background color → CSS variable --bg. Default: '#FFFFFF' */
|
|
845
|
+
bg?: string;
|
|
846
|
+
/** Foreground / primary text color → CSS variable --fg. Default: '#27272A' */
|
|
847
|
+
fg?: string;
|
|
848
|
+
/** Edge/connector color → CSS variable --line */
|
|
849
|
+
line?: string;
|
|
850
|
+
/** Arrow heads, highlights → CSS variable --accent */
|
|
851
|
+
accent?: string;
|
|
852
|
+
/** Secondary text, edge labels → CSS variable --muted */
|
|
853
|
+
muted?: string;
|
|
854
|
+
/** Node/box fill tint → CSS variable --surface */
|
|
855
|
+
surface?: string;
|
|
856
|
+
/** Node/group stroke color → CSS variable --border */
|
|
857
|
+
border?: string;
|
|
858
|
+
/** Font family for all text. Default: 'Inter' */
|
|
859
|
+
font?: string;
|
|
860
|
+
/**
|
|
861
|
+
* How the diagram looks: a registered style name ('hand-drawn',
|
|
862
|
+
* 'tufte', or any registered Palette input name like 'dracula'),
|
|
863
|
+
* an inline StyleSpec, or a STACK
|
|
864
|
+
* of either merged left-to-right ({ style: ['hand-drawn', 'dracula'] } is
|
|
865
|
+
* hand-drawn geometry with the dracula palette). A colors-only style is a
|
|
866
|
+
* palette.
|
|
867
|
+
* Precedence: defaults < style stack < themeVariables < explicit color
|
|
868
|
+
* options. Unknown names throw. Unset (or 'crisp') = the default renderer.
|
|
869
|
+
*/
|
|
870
|
+
style?: StyleInput | StyleInput[];
|
|
871
|
+
/** Canvas padding in px. Default: 40 */
|
|
872
|
+
padding?: number;
|
|
873
|
+
/** Horizontal spacing between sibling nodes. Default: 24 */
|
|
874
|
+
nodeSpacing?: number;
|
|
875
|
+
/** Vertical spacing between layers. Default: 40 */
|
|
876
|
+
layerSpacing?: number;
|
|
877
|
+
/**
|
|
878
|
+
* Flowchart-only: measured-pixel auto-wrap budget for node labels (mermaid's
|
|
879
|
+
* `flowchart.wrappingWidth`). Unset = no wrapping for regular labels;
|
|
880
|
+
* markdown-string labels always wrap at the upstream default of 200.
|
|
881
|
+
* Explicit option wins over frontmatter config. Other families ignore it.
|
|
882
|
+
*/
|
|
883
|
+
wrappingWidth?: number;
|
|
884
|
+
/** Spacing between disconnected components. Default: nodeSpacing (24) */
|
|
885
|
+
componentSpacing?: number;
|
|
886
|
+
/** Render with transparent background (no background style on SVG). Default: false */
|
|
887
|
+
transparent?: boolean;
|
|
888
|
+
/** Enable hover tooltips on chart data points (xychart, quadrant, and pie). Default: false */
|
|
889
|
+
interactive?: boolean;
|
|
890
|
+
/** Optional explicit drop shadows on node shapes. Default: false */
|
|
891
|
+
shadow?: boolean;
|
|
892
|
+
/** Family-specific class-diagram options. */
|
|
893
|
+
class?: {
|
|
894
|
+
/** Nest namespace compounds (default true); false lays them out compactly as siblings. */
|
|
895
|
+
hierarchicalNamespaces?: boolean;
|
|
896
|
+
};
|
|
897
|
+
/** Family-specific SVG renderer options for architecture-beta diagrams. */
|
|
898
|
+
architecture?: {
|
|
899
|
+
visual?: ArchitectureVisualOverrides;
|
|
900
|
+
};
|
|
901
|
+
/** Family-specific layout options for timeline diagrams. */
|
|
902
|
+
timeline?: {
|
|
903
|
+
/**
|
|
904
|
+
* Best-effort width budget (px) for HORIZONTAL timelines: when the chart
|
|
905
|
+
* would exceed it, the per-column wrap caps compress proportionally so
|
|
906
|
+
* labels wrap tighter instead of the canvas growing (13 periods stop
|
|
907
|
+
* rendering 2,400+px wide). No-op when the chart already fits — the
|
|
908
|
+
* default layout stays byte-identical — and ignored in `timeline TD`
|
|
909
|
+
* mode (vertical timelines are inherently narrow). Unbreakable tokens
|
|
910
|
+
* and extra-wide section headers can still exceed the budget.
|
|
911
|
+
*/
|
|
912
|
+
maxWidth?: number;
|
|
913
|
+
};
|
|
914
|
+
/** Family-specific SVG renderer options for user-journey diagrams. */
|
|
915
|
+
journey?: {
|
|
916
|
+
/**
|
|
917
|
+
* Draw the experience-curve line connecting score markers in task order.
|
|
918
|
+
* Default: `true`. Set `false` for the marker-only Mermaid-classic look.
|
|
919
|
+
*/
|
|
920
|
+
experienceCurve?: boolean;
|
|
921
|
+
};
|
|
922
|
+
/** Family-specific SVG renderer options for gantt diagrams. */
|
|
923
|
+
gantt?: {
|
|
924
|
+
/**
|
|
925
|
+
* Draw dependency connectors — deterministic elbow arrows from each
|
|
926
|
+
* predecessor bar's end to its successor bar's start — for every
|
|
927
|
+
* `after`/`until` reference. No new Mermaid syntax: the edges come from
|
|
928
|
+
* the scheduler's dependency graph. Default: `false`.
|
|
929
|
+
*/
|
|
930
|
+
dependencyArrows?: boolean;
|
|
931
|
+
/**
|
|
932
|
+
* Emphasize the critical path from the scheduler's analysis
|
|
933
|
+
* (GanttScheduleAnalysis.criticalPathTaskIds): stronger stroke on
|
|
934
|
+
* critical-path bars/milestones and, when `dependencyArrows` is also on,
|
|
935
|
+
* on the connectors along the path. Default: `false`.
|
|
936
|
+
*/
|
|
937
|
+
criticalPath?: boolean;
|
|
938
|
+
};
|
|
939
|
+
/** Optional Mermaid-style runtime config (analogous to initialize/frontmatter config). */
|
|
940
|
+
mermaidConfig?: MermaidRuntimeConfig;
|
|
941
|
+
/**
|
|
942
|
+
* Receives warnings for explicit config that cannot affect output. Installing
|
|
943
|
+
* a collector never changes SVG bytes. Without one, explicit ineffective
|
|
944
|
+
* config is reported through `console.warn` rather than accepted silently.
|
|
945
|
+
*/
|
|
946
|
+
onConfigDiagnostic?: (diagnostic: ConfigDiagnostic) => void;
|
|
947
|
+
/**
|
|
948
|
+
* Whether to embed the Google Fonts `@import` line in the SVG `<style>` block.
|
|
949
|
+
* Default: `false`; opt in only when the target permits a network font import.
|
|
950
|
+
*
|
|
951
|
+
* CLI / PNG paths set `false` explicitly to render offline / CSP-friendly.
|
|
952
|
+
* The CSS variable `--font` is always emitted on the SVG root regardless,
|
|
953
|
+
* so the family stays overridable post-render even when the @import is gone.
|
|
954
|
+
*/
|
|
955
|
+
embedFontImport?: boolean;
|
|
956
|
+
/**
|
|
957
|
+
* Compact SVG output. Default `false`. When true:
|
|
958
|
+
* - Formatting newlines between structural SVG elements are collapsed.
|
|
959
|
+
* - Geometry, authored text, accessibility content, attribute boundaries,
|
|
960
|
+
* and whitespace inside `<style>` are preserved exactly.
|
|
961
|
+
* - `data-*` and `class=` attributes are preserved (agent inspection hooks).
|
|
962
|
+
*
|
|
963
|
+
* Useful for the PNG render path (no need for human-readable indentation)
|
|
964
|
+
* and for bandwidth-sensitive consumers without changing diagram semantics.
|
|
965
|
+
*/
|
|
966
|
+
compact?: boolean;
|
|
967
|
+
/**
|
|
968
|
+
* Namespace prefix for all generated SVG def ids (markers, filters) and
|
|
969
|
+
* their `url(#…)` references. Omit it to leave ids unprefixed. Set a distinct
|
|
970
|
+
* non-empty prefix per diagram when rendering
|
|
971
|
+
* multiple diagrams onto one HTML page so their `<defs>` don't collide
|
|
972
|
+
* (e.g. two `arrowhead` markers — the browser dedupes by id and the second
|
|
973
|
+
* diagram's arrows break). `am batch` auto-assigns per-line prefixes.
|
|
974
|
+
* Must be deterministic per call site to preserve render determinism.
|
|
975
|
+
*/
|
|
976
|
+
idPrefix?: string;
|
|
977
|
+
/**
|
|
978
|
+
* Security posture for the rendered output. Default `'default'`.
|
|
979
|
+
* `'strict'` (agent / untrusted-diagram mode): guarantees no external-fetch
|
|
980
|
+
* references in the SVG — forces `embedFontImport` off (no Google Fonts
|
|
981
|
+
* `@import`), so the SVG renders with no network calls. The `--font` CSS
|
|
982
|
+
* variable still declares the family. Use `verifyNoExternalRefs(svg)` to
|
|
983
|
+
* assert the guarantee. Agent/untrusted SVG callers should opt into strict
|
|
984
|
+
* mode explicitly. See SECURITY.md.
|
|
985
|
+
*/
|
|
986
|
+
security?: 'default' | 'strict';
|
|
987
|
+
/**
|
|
988
|
+
* Explicit "today" for the Gantt `todayMarker` (a date in the diagram's
|
|
989
|
+
* `dateFormat`, or ISO `YYYY-MM-DD`). Gantt rendering never reads the wall
|
|
990
|
+
* clock; without this value the today marker is simply not drawn, and
|
|
991
|
+
* `todayMarker off` disables it even when a clock is supplied.
|
|
992
|
+
*/
|
|
993
|
+
ganttToday?: string;
|
|
994
|
+
/**
|
|
995
|
+
* Deterministic re-roll seed for stochastic styles.
|
|
996
|
+
* The same source + options + seed always produces identical bytes; it
|
|
997
|
+
* re-rolls ink wobble only — layout never moves. The crisp path ignores
|
|
998
|
+
* it. Default 0.
|
|
999
|
+
*/
|
|
1000
|
+
seed?: number;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
declare class BrowserFamilyDetectionError extends Error {
|
|
1004
|
+
readonly code = "UNSUPPORTED_FAMILY";
|
|
1005
|
+
constructor(firstLine: string);
|
|
1006
|
+
}
|
|
1007
|
+
/** Render SVG while downloading only the selected diagram family on demand.
|
|
1008
|
+
* The classic synchronous `agentic-mermaid/browser` entry remains available
|
|
1009
|
+
* for script-tag consumers that prefer one all-in-one file. */
|
|
1010
|
+
declare function renderMermaidSVGAsync(source: string, options?: RenderOptions): Promise<string>;
|
|
1011
|
+
|
|
1012
|
+
export { BrowserFamilyDetectionError, type RenderOptions, renderMermaidSVGAsync };
|