agentic-mermaid 0.1.2 → 0.2.0
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/AGENT_NATIVE.md +671 -0
- package/CHANGELOG.md +19 -0
- package/Instructions_for_agents.md +89 -0
- package/README.md +8 -8
- package/assets/hero.png +0 -0
- package/dist/agent-core.d.ts +2 -2
- 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 +8 -15
- package/dist/{chunk-QKDLMOJJ.js → chunk-2P5FKUQC.js} +7 -9
- package/dist/{chunk-WN3YDOBG.js → chunk-2S3VSS6I.js} +4 -4
- package/dist/{chunk-CDPKJ2BQ.js → chunk-2SILJDW2.js} +2 -2
- package/dist/{chunk-ZYMMKQ3I.js → chunk-BJYMBT4I.js} +299 -973
- package/dist/{chunk-WI35L7IR.js → chunk-FDM43XU7.js} +2 -2
- package/dist/{chunk-4QECACIA.js → chunk-MYPDVZCO.js} +19 -19
- package/dist/{index-D54dqSdC.d.ts → index-DWPa2MJs.d.ts} +7 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp-cli-5J47WEY3.js +17 -0
- package/docs/README.md +34 -34
- package/docs/agent-api-cookbook.md +317 -0
- package/docs/agent-mutation-policy.md +104 -0
- package/docs/agent-workflow-examples.md +46 -0
- package/docs/api.md +418 -0
- package/docs/ascii.md +113 -0
- package/docs/code-mode-impact.md +214 -0
- package/docs/comparison.md +106 -0
- package/docs/computational-aesthetics-prototype-plan.md +252 -0
- package/docs/config.md +121 -0
- package/docs/custom-fonts.md +265 -0
- package/docs/custom-style-cookbook.md +275 -0
- package/docs/diagram-families.md +218 -0
- package/docs/features.md +154 -0
- package/docs/fork-differences.md +133 -0
- package/docs/getting-started.md +182 -0
- package/docs/issue-derived-test-cases.md +163 -0
- package/docs/mcp-code-mode-rationale.md +108 -0
- package/docs/mcp-http-transport.md +230 -0
- package/docs/mermaid-layout-complaints.md +851 -0
- package/docs/mutation-testing.md +285 -0
- package/docs/quality.md +224 -0
- package/docs/react.md +97 -0
- package/docs/style-authoring.md +336 -0
- package/docs/svg-semantic-contract.md +49 -0
- package/docs/testing-strategy.md +443 -0
- package/docs/theming.md +149 -0
- package/package.json +21 -6
- package/server.json +2 -2
- package/skills/agentic-mermaid-live-editor/SKILL.md +1 -1
- package/dist/mcp-cli-SBQSTJFC.js +0 -17
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
renderPngGraphicalProjection,
|
|
14
14
|
snapshotHostBackendPolicy,
|
|
15
15
|
snapshotResourceManifest
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BJYMBT4I.js";
|
|
17
17
|
|
|
18
18
|
// src/agent/png.ts
|
|
19
19
|
import { fileURLToPath } from "url";
|
|
@@ -612,4 +612,4 @@ export {
|
|
|
612
612
|
renderMermaidPNGWithReceipt,
|
|
613
613
|
createMermaidPNGRenderer
|
|
614
614
|
};
|
|
615
|
-
//# sourceMappingURL=chunk-
|
|
615
|
+
//# sourceMappingURL=chunk-FDM43XU7.js.map
|
|
@@ -52,6 +52,7 @@ import {
|
|
|
52
52
|
normalizeMermaidSource,
|
|
53
53
|
normalizeV11Shape,
|
|
54
54
|
ok,
|
|
55
|
+
parseAccessibilityDirective,
|
|
55
56
|
parseActorLinks,
|
|
56
57
|
parseClassDeclaration,
|
|
57
58
|
parseClassDiagram,
|
|
@@ -92,7 +93,7 @@ import {
|
|
|
92
93
|
visualWidth,
|
|
93
94
|
wcagCssContrastRatio,
|
|
94
95
|
wrapperPrefix
|
|
95
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-BJYMBT4I.js";
|
|
96
97
|
|
|
97
98
|
// src/agent/trace-log.ts
|
|
98
99
|
var appendFn;
|
|
@@ -2819,26 +2820,25 @@ function collectFlowchartActions(source) {
|
|
|
2819
2820
|
return out;
|
|
2820
2821
|
}
|
|
2821
2822
|
function actionSourceLines(source, maskMarkdownStrings = false) {
|
|
2822
|
-
const out = [];
|
|
2823
2823
|
const lines = source.split(/\r?\n/);
|
|
2824
|
-
|
|
2825
|
-
let inMarkdownString = false;
|
|
2824
|
+
const out = [];
|
|
2826
2825
|
for (let index = 0; index < lines.length; index++) {
|
|
2827
|
-
const
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
continue;
|
|
2826
|
+
const directive = parseAccessibilityDirective(lines, index);
|
|
2827
|
+
if (directive === void 0) break;
|
|
2828
|
+
if (directive === null) out.push({ text: lines[index].trim(), line: index + 1 });
|
|
2829
|
+
else {
|
|
2830
|
+
if (directive.suffixLine) out.push({ text: directive.suffixLine.trim(), line: directive.endIndex + 1 });
|
|
2831
|
+
index = directive.endIndex;
|
|
2834
2832
|
}
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
if (
|
|
2841
|
-
|
|
2833
|
+
}
|
|
2834
|
+
if (!maskMarkdownStrings) return out;
|
|
2835
|
+
let inMarkdownString = false;
|
|
2836
|
+
for (const sourceLine of out) {
|
|
2837
|
+
const preserveActionText = !inMarkdownString && splitFlowchartStatements(sourceLine.text).some((statement) => /^(?:click|href)\s+/i.test(statement.trim()));
|
|
2838
|
+
if (preserveActionText) continue;
|
|
2839
|
+
const masked = maskMarkdownStringContent(sourceLine.text, inMarkdownString);
|
|
2840
|
+
inMarkdownString = masked.open;
|
|
2841
|
+
sourceLine.text = masked.text.trim();
|
|
2842
2842
|
}
|
|
2843
2843
|
return out;
|
|
2844
2844
|
}
|
|
@@ -4699,4 +4699,4 @@ export {
|
|
|
4699
4699
|
layoutMermaidWithReceipt,
|
|
4700
4700
|
layoutMermaid
|
|
4701
4701
|
};
|
|
4702
|
-
//# sourceMappingURL=chunk-
|
|
4702
|
+
//# sourceMappingURL=chunk-MYPDVZCO.js.map
|
|
@@ -31,7 +31,7 @@ interface ExtensionIdentity<Kind extends string = string> {
|
|
|
31
31
|
/** Host contract versions understood by this runtime. Requirements for other
|
|
32
32
|
* namespaced contracts are retained but deliberately deferred to their owner. */
|
|
33
33
|
declare const KNOWN_EXTENSION_CONTRACT_VERSIONS: Readonly<{
|
|
34
|
-
readonly core:
|
|
34
|
+
readonly core: "0.2.0";
|
|
35
35
|
readonly scene: "2.0.0";
|
|
36
36
|
}>;
|
|
37
37
|
interface ExtensionCompatibilityResolution {
|
|
@@ -4822,6 +4822,11 @@ declare function knownFamilies(): FamilyId[];
|
|
|
4822
4822
|
declare function knownBuiltinFamilies(): BuiltinFamilyId[];
|
|
4823
4823
|
declare function detectRegisteredFamilyFromFirstLine(firstLine: string, mode?: 'strict' | 'loose'): FamilyId | null;
|
|
4824
4824
|
|
|
4825
|
+
interface MermaidAccessibility {
|
|
4826
|
+
title?: string;
|
|
4827
|
+
descr?: string;
|
|
4828
|
+
}
|
|
4829
|
+
|
|
4825
4830
|
type MermaidConfigScalar = string | number | boolean | null;
|
|
4826
4831
|
type MermaidConfigValue = MermaidConfigScalar | MermaidConfigValue[] | MermaidConfigMap;
|
|
4827
4832
|
interface MermaidConfigMap {
|
|
@@ -5134,9 +5139,7 @@ interface MermaidSourceComment {
|
|
|
5134
5139
|
text: string;
|
|
5135
5140
|
line: number;
|
|
5136
5141
|
}
|
|
5137
|
-
interface MermaidSourceAccessibility {
|
|
5138
|
-
title?: string;
|
|
5139
|
-
descr?: string;
|
|
5142
|
+
interface MermaidSourceAccessibility extends MermaidAccessibility {
|
|
5140
5143
|
}
|
|
5141
5144
|
interface NormalizedMermaidSource {
|
|
5142
5145
|
/** Original bytes supplied at the public boundary. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { g0 as ARCHITECTURE_ICON_LIMITS, g as AnyPort, r as ArchitectureVisualOverrides, s as AsciiRenderColorMode, A as AsciiRenderOptions, t as AsciiWidthError, u as AsciiWidthErrorReason, B as BACKEND_CONFORMANCE_CHECK_IDS, v as BACKEND_CONFORMANCE_FIXTURE_ID, w as BACKEND_CONFORMANCE_VERSION, x as BINDABLE_ROLE_STYLE_PROPERTIES, y as BINDABLE_SCENE_ROLES, z as BRAND_CONSTRAINT_DESCRIPTORS, C as BRAND_CONSTRAINT_KINDS, g1 as BROWSER_CANVAS_RUNTIME, G as BUILTIN_SCENE_ROLE_TRAITS, I as BackendCapabilityConformanceResult, J as BackendCapabilityConformanceStatus, K as BackendConformanceCheck, L as BackendConformanceCheckId, M as BackendConformanceReport, N as BackendDescriptor, O as BackendRegistrationOptions, Q as BindableSceneRole, S as BrandConstraint, T as BrandConstraintAction, U as BrandConstraintKind, g2 as BrowserPngDiagnostic, g3 as BrowserPngFontSource, g4 as BrowserPngRasterContext, g5 as BrowserPngRasterResult, g6 as BrowserPngRasterizer, g7 as BrowserPngRuntimeProvenance, g8 as BuiltinSceneRole, X as CAPABILITY_NEGOTIATION_VERSION, Y as CORE_CAPABILITY_OFFERS, Z as CORE_SCENE_FEATURES, _ as CORE_SCENE_OPERATIONS, $ as CORE_SCENE_PRIMITIVES, a0 as CapabilityDecision, a1 as CapabilityId, a2 as CapabilityOffer, a3 as CapabilityRequirement, a4 as CapabilityRequirementLevel, a5 as CapabilityResolution, g9 as CapabilityValidationResult, ad as CliRenderTransport, ae as CodeModeRenderTransport, ga as ConfigDiagnostic, af as ConnectorContourSemantics, gb as ConnectorDash, gc as ConnectorDirection, gd as ConnectorEndpointAnchor, ag as ConnectorEndpoints, ah as ConnectorGeometry, ai as ConnectorHitGeometry, aj as ConnectorLabelDescriptor, ak as ConnectorMark, al as ConnectorRelationship, am as ConnectorRoute, an as ConnectorStroke, ao as ConnectorSubpath, ap as ConnectorTerminalLabelProjection, aq as ConnectorTerminalMarkerPlacement, ar as ConnectorTerminalMarkerProjection, as as ConnectorTerminalProjection, at as ConnectorTerminalStrokeLoss, ge as CoreSceneFeature, gf as CoreSceneOperation, gg as CoreScenePrimitive, gh as CoreSceneRole, gi as DEFAULTS, av as DefaultBackend, gj as DiagramColors, aB as DiamondFacet, gk as DocumentMark, gl as ESSENTIAL_SCENE_PRIMITIVE_CAPABILITIES, gm as ESSENTIAL_SCENE_PRIMITIVE_OPERATIONS, aC as EXACT_ROLE_STYLE_CONTRACT, aD as EXACT_STYLE_SCENE_ROLES, aE as EXTERNAL_SCENE_API_VERSION, aG as EdgeRouteCertificate, gn as EssentialScenePrimitiveCapability, go as EssentialScenePrimitiveOperation, aO as ExactStyleSceneRole, gp as ExtensionCollisionError, gq as ExtensionCompatibility, gr as ExtensionCompatibilityDecision, gs as ExtensionCompatibilityResolution, aP as ExtensionDiagramBody, aQ as ExtensionIdentity, gt as ExtensionProvenance, gu as ExtensionRegistration, aR as ExtensionValidDiagram, aT as ExternalSceneConnector, aU as ExternalSceneConnectorGeometry, aV as ExternalSceneConnectorLabel, aW as ExternalSceneContainer, aX as ExternalSceneDataMark, aY as ExternalSceneDocument, aZ as ExternalSceneGeometry, a_ as ExternalSceneInput, a$ as ExternalSceneMarker, b0 as ExternalSceneNode, b1 as ExternalSceneNodeBase, b2 as ExternalSceneShape, b3 as ExternalSceneText, bg as FamilyDetectionDiagnostic, bh as FamilyEdgeRouteCertificate, bo as FamilyRouteCertificate, gv as Geometry, gw as GitGraphBranch, gx as GitGraphCommit, gy as GitGraphCommitType, gz as GitGraphDiagram, gA as GitGraphDuplicateCommitError, gB as GitGraphParseError, gC as GitGraphRuntimeConfig, gD as GroupMark, bJ as HOSTED_FONT_RESOURCES, H as HostBackendPolicy, gE as HostBackendSelection, gF as HostedFontFace, gG as HostedFontResource, gH as JourneyRuntimeConfig, gI as KNOWN_EXTENSION_CONTRACT_VERSIONS, bQ as LayoutRouteCertificate, bR as LayoutRouteClass, bT as LibraryRenderTransport, bU as MAX_HOSTED_PNG_BYTES, bV as MAX_HOSTED_PNG_PIXELS, bW as MAX_PNG_FONT_DIRECTORIES, bX as MAX_PNG_FONT_DIRECTORY_LENGTH, bY as MAX_PNG_PIXELS, bZ as MAX_PNG_RASTER_DIMENSION, gJ as MarkPaint, b_ as MarkerDescriptor, gK as MarkerSerializationOptions, gL as MarkerShape, gM as MermaidBrowserPNGRenderer, gN as MermaidBrowserPNGRendererHostOptions, b$ as MermaidFamilyClassification, c0 as MermaidFamilyDetectionError, gO as MermaidGraph, gP as MermaidRenderer, gQ as MermaidRendererHostOptions, gR as MermaidRuntimeConfig, gS as MermaidThemeVariables, gT as MindmapDiagram, gU as MindmapDuplicateIdError, gV as MindmapNode, gW as MindmapParseError, gX as MindmapRuntimeConfig, gY as MindmapShape, c6 as NATIVE_PNG_HOST_ONLY_OPTION_FIELDS, c7 as NATIVE_PNG_OUTPUT_POLICY_FIELDS, gZ as NamespacedSceneRole, c8 as NativePngHostOnlyOptionField, c9 as NativePngOutputPolicyField, g_ as OUTPUT_COLOR_PROFILE, g$ as OUTPUT_SECURITY_POLICY_VERSION, h0 as OutputSecurityDiagnostic, h1 as OutputSecurityMode, h2 as OutputSecurityResult, cb as PNG_DEFAULT_FONT_FAMILY, cc as PNG_DEFAULT_SCALE, cd as PNG_FONT_SOURCES, ce as PNG_NAPI_RUNTIME, cf as PNG_OUTPUT_OPTION_FIELDS, cg as PNG_OUTPUT_OPTION_FIELD_DESCRIPTORS, ch as PNG_OUTPUT_POLICY_VERSION, ci as PNG_WASM_RUNTIME, cj as PORTABLE_PNG_OUTPUT_OPTION_FIELDS, ck as PRIMITIVE_REALIZATIONS, P as ParsedDiagram, h3 as ParsedDiagramFamilyMismatchError, h4 as PieRuntimeConfig, h5 as PngColorProfileReceipt, h6 as PngDimensions, cr as PngFitTo, cs as PngFontSource, ct as PngOutputOptionField, cu as PngOutputOptionFieldDescriptor, cv as PngOutputOptionInputKind, cw as PngOutputOptionPolicyState, cx as PngOutputOptionReceiptState, cy as PngOutputOptionScope, a as PngOutputPolicyInput, cz as PngRasterDimensions, c as PngRuntimeProvenance, cA as PortSemanticRole, cB as PortSide, cC as PortablePngOutputOptionField, cD as PortablePngOutputOptions, fX as PositionedDiagram, h7 as PositionedGitGraphDiagram, h8 as PositionedGraph, h9 as PositionedMindmapDiagram, cE as PreservedDiagramBody, cF as PreservedSourceSpans, cG as PreservedValidDiagram, ha as PrimitiveCapabilityClaim, hb as PrimitiveRealization, hc as QuadrantRuntimeConfig, cM as RENDER_CONTRACT_VERSION, cN as RENDER_OUTPUTS, cO as RENDER_OUTPUT_DESCRIPTORS, cP as RESOURCE_MANIFEST, cQ as RESOURCE_MANIFEST_VERSION, cR as ROLE_STYLE_PROPERTY_DESCRIPTORS, hd as RadarRuntimeConfig, cX as RegionContainmentCertificate, cY as RenderCapabilityError, he as RenderContext, R as RenderOptions, hf as RenderOutput, cZ as RenderOutputDescriptor, c_ as RenderOutputTransports, b as RenderRequestReceipt, hg as RenderableMarkerDescriptor, c$ as RenderedAscii, hh as RenderedBrowserPng, f$ as RenderedSvg, hi as ResolvedArchitectureIcon, hj as ResolvedColors, d5 as ResolvedPngOutputPolicy, hk as ResolvedSceneRoleTraits, d6 as ResolvedTerminalOutputPolicy, hl as ResolvedTerminalStyle, hm as ResourceLicense, hn as ResourceManifest, ho as ResourceManifestEntry, d8 as RoleStyleFor, d9 as RoleStyleSpec, da as RoleStyles, db as RouteBlocker, dc as RouteCertificate, dd as RouteClass, de as RoutePortAssignment, df as SCENE_CONTRACT_VERSION, dg as SCENE_ROLE_DESCRIPTORS, dh as SCENE_VALIDATION_LIMITS, di as SCENE_VALIDATION_VERSION, dj as SEMANTIC_BINDING_CHANNELS, dk as SHARED_RENDER_OPTION_FIELDS, dl as STYLE_COLOR_TOKEN_DESCRIPTORS, dm as STYLE_SPEC_FIELD_DESCRIPTORS, dn as STYLE_SPEC_FORMAT_VERSION, hp as SceneBox, hq as SceneConnectorHit, dp as SceneDoc, hr as SceneFeature, hs as SceneMarkKind, dq as SceneNode, ht as SceneNodeBase, hu as SceneOperation, hv as ScenePoint, hw as ScenePrimitive, dr as SceneRole, hx as SceneRoleDescriptor, hy as SceneRoleTraits, hz as SceneSketchPolicy, ds as SceneValidationDiagnostic, dt as SceneValidationDiagnosticCode, du as SceneValidationError, dv as SceneValidationOptions, dw as SceneValidationResult, dx as SemanticBinding, dy as SemanticBindingChannel, dz as SemanticChannels, dA as SemanticSlots, hA as ShapeMark, dM as SourceSpan, dN as SourceSpanPoint, hB as StateRuntimeConfig, dT as StyleBackend, dU as StyleBackendContext, dV as StyleColors, dW as StyleDescriptor, dX as StyleInput, dY as StyleReferenceResolution, dZ as StyleRegistrationOptions, hC as StyleRegistryKind, d_ as StyleSpec, hD as SvgRelationSemantics, hE as SvgSemanticAccessibility, hF as SvgSemanticIdentity, d$ as TERMINAL_BOUNDED_PADDING_X, e0 as TERMINAL_DEFAULT_BOX_BORDER_PADDING, e1 as TERMINAL_DEFAULT_PADDING_X, e2 as TERMINAL_DEFAULT_PADDING_Y, e3 as TERMINAL_OUTPUT_POLICY_VERSION, hG as TERMINAL_STYLE_VERSION, e4 as TEXT_MEASUREMENT_CONTRACT, hH as TerminalConnectorProjection, hI as TerminalConnectorProjectionReceipt, e5 as TerminalOutputPolicyError, e6 as TerminalOutputPolicyInput, hJ as TerminalProjectionDiagnostic, fY as TerminalProjectionDiagnosticCode, hK as TerminalProjectionSecurityContext, hL as TextMark, e7 as TextMeasurementContract, e8 as TextMeasurementInput, e9 as TextMeasurementResult, hM as TimelineRuntimeConfig, hN as XyChartRuntimeConfig, hO as applyOutputSecurityPolicy, hP as applyPngColorProfile, hQ as architectureIconManifest, hR as architectureToMermaidGraph, eV as assertHostedPngRasterBudget, eW as assertPngRasterBudget, hS as assertRenderableMarker, eX as assertValidSceneDoc, eY as buildExternalScene, hT as canonicalExtensionId, e_ as classifyMermaidFamilyFromFirstLine, hU as connectorHitDistance, e$ as createExtensionIdentity, hV as createMermaidBrowserPNGRenderer, hW as createMermaidRenderer, hX as essentialScenePrimitiveOperation, hY as evaluateExtensionCompatibility, hZ as fromShikiTheme, f5 as getBackend, f8 as getStyle, h_ as hitTestConnector, h$ as hitTestSceneConnectors, f9 as hostedFontResource, fa as inferBackend, i0 as inlineResolvedColors, i1 as inspectPngColorProfile, i2 as inspectPngDimensions, fd as knownBackendDescriptors, fg as knownStyleDescriptors, fh as knownStyles, fi as measureText, fj as measureTextWidth, fk as negotiateCapabilities, fl as negotiateRenderCapabilities, fm as normalizePortablePngBackground, fo as omitPngOutputOptions, i3 as parseArchitectureDiagram, i4 as parseExtensionId, i5 as parseGitGraph, i6 as parseMindmap, fp as parseRegisteredMermaid, fq as parseSemVer, fr as pngNapiRuntimeProvenance, fs as pngOutputOptionsJsonSchema, ft as pngRasterDimensions, fu as prepareSvgForPngRasterization, fv as projectNativePngOutputPolicyInput, fw as projectPortablePngOutputOptions, fx as registerBackend, i7 as registerExtension, fy as registerStyle, i8 as renderContractDigest, fZ as renderMermaidASCII, i9 as renderMermaidASCIIWithReceipt, ia as renderMermaidPNGInBrowserWithReceipt, f_ as renderMermaidSVG, ib as renderMermaidSVGAsync, ic as renderMermaidSVGWithReceipt, id as resolveArchitectureIcon, ie as resolveColors, ig as resolveDiagramColors, fz as resolvePngOutputPolicy, fA as resolvePortablePngOutputPolicy, fB as resolveSceneRoleTraits, fC as resolveStyleReference, fD as resolveStyleStack, fE as resolveTerminalOutputPolicy, fF as runBackendConformance, fG as sceneRoleTraits, fH as semVerSatisfies, ih as serializeGitGraph, ii as serializeMarkerResource, ij as serializeMarkerResources, ik as serializeMindmap, fI as sharedRenderOptionsJsonSchema, il as snapshotResourceManifest, fJ as styleInputJsonSchema, fK as styleSpecJsonSchema, fL as svgIntrinsicDimensions, fM as terminalConnectorCapabilityClaims, fO as validatePrimitiveCapabilities, fP as validateResourceManifest, fQ as validateSceneDoc, fR as validateSerializableRenderOptions, fS as validateStyleSpec, fT as verifyNoExternalRefs, fU as verifyResourceBytes, im as verifySvgDocumentEnvelope } from './index-D54dqSdC.js';
|
|
1
|
+
export { g0 as ARCHITECTURE_ICON_LIMITS, g as AnyPort, r as ArchitectureVisualOverrides, s as AsciiRenderColorMode, A as AsciiRenderOptions, t as AsciiWidthError, u as AsciiWidthErrorReason, B as BACKEND_CONFORMANCE_CHECK_IDS, v as BACKEND_CONFORMANCE_FIXTURE_ID, w as BACKEND_CONFORMANCE_VERSION, x as BINDABLE_ROLE_STYLE_PROPERTIES, y as BINDABLE_SCENE_ROLES, z as BRAND_CONSTRAINT_DESCRIPTORS, C as BRAND_CONSTRAINT_KINDS, g1 as BROWSER_CANVAS_RUNTIME, G as BUILTIN_SCENE_ROLE_TRAITS, I as BackendCapabilityConformanceResult, J as BackendCapabilityConformanceStatus, K as BackendConformanceCheck, L as BackendConformanceCheckId, M as BackendConformanceReport, N as BackendDescriptor, O as BackendRegistrationOptions, Q as BindableSceneRole, S as BrandConstraint, T as BrandConstraintAction, U as BrandConstraintKind, g2 as BrowserPngDiagnostic, g3 as BrowserPngFontSource, g4 as BrowserPngRasterContext, g5 as BrowserPngRasterResult, g6 as BrowserPngRasterizer, g7 as BrowserPngRuntimeProvenance, g8 as BuiltinSceneRole, X as CAPABILITY_NEGOTIATION_VERSION, Y as CORE_CAPABILITY_OFFERS, Z as CORE_SCENE_FEATURES, _ as CORE_SCENE_OPERATIONS, $ as CORE_SCENE_PRIMITIVES, a0 as CapabilityDecision, a1 as CapabilityId, a2 as CapabilityOffer, a3 as CapabilityRequirement, a4 as CapabilityRequirementLevel, a5 as CapabilityResolution, g9 as CapabilityValidationResult, ad as CliRenderTransport, ae as CodeModeRenderTransport, ga as ConfigDiagnostic, af as ConnectorContourSemantics, gb as ConnectorDash, gc as ConnectorDirection, gd as ConnectorEndpointAnchor, ag as ConnectorEndpoints, ah as ConnectorGeometry, ai as ConnectorHitGeometry, aj as ConnectorLabelDescriptor, ak as ConnectorMark, al as ConnectorRelationship, am as ConnectorRoute, an as ConnectorStroke, ao as ConnectorSubpath, ap as ConnectorTerminalLabelProjection, aq as ConnectorTerminalMarkerPlacement, ar as ConnectorTerminalMarkerProjection, as as ConnectorTerminalProjection, at as ConnectorTerminalStrokeLoss, ge as CoreSceneFeature, gf as CoreSceneOperation, gg as CoreScenePrimitive, gh as CoreSceneRole, gi as DEFAULTS, av as DefaultBackend, gj as DiagramColors, aB as DiamondFacet, gk as DocumentMark, gl as ESSENTIAL_SCENE_PRIMITIVE_CAPABILITIES, gm as ESSENTIAL_SCENE_PRIMITIVE_OPERATIONS, aC as EXACT_ROLE_STYLE_CONTRACT, aD as EXACT_STYLE_SCENE_ROLES, aE as EXTERNAL_SCENE_API_VERSION, aG as EdgeRouteCertificate, gn as EssentialScenePrimitiveCapability, go as EssentialScenePrimitiveOperation, aO as ExactStyleSceneRole, gp as ExtensionCollisionError, gq as ExtensionCompatibility, gr as ExtensionCompatibilityDecision, gs as ExtensionCompatibilityResolution, aP as ExtensionDiagramBody, aQ as ExtensionIdentity, gt as ExtensionProvenance, gu as ExtensionRegistration, aR as ExtensionValidDiagram, aT as ExternalSceneConnector, aU as ExternalSceneConnectorGeometry, aV as ExternalSceneConnectorLabel, aW as ExternalSceneContainer, aX as ExternalSceneDataMark, aY as ExternalSceneDocument, aZ as ExternalSceneGeometry, a_ as ExternalSceneInput, a$ as ExternalSceneMarker, b0 as ExternalSceneNode, b1 as ExternalSceneNodeBase, b2 as ExternalSceneShape, b3 as ExternalSceneText, bg as FamilyDetectionDiagnostic, bh as FamilyEdgeRouteCertificate, bo as FamilyRouteCertificate, gv as Geometry, gw as GitGraphBranch, gx as GitGraphCommit, gy as GitGraphCommitType, gz as GitGraphDiagram, gA as GitGraphDuplicateCommitError, gB as GitGraphParseError, gC as GitGraphRuntimeConfig, gD as GroupMark, bJ as HOSTED_FONT_RESOURCES, H as HostBackendPolicy, gE as HostBackendSelection, gF as HostedFontFace, gG as HostedFontResource, gH as JourneyRuntimeConfig, gI as KNOWN_EXTENSION_CONTRACT_VERSIONS, bQ as LayoutRouteCertificate, bR as LayoutRouteClass, bT as LibraryRenderTransport, bU as MAX_HOSTED_PNG_BYTES, bV as MAX_HOSTED_PNG_PIXELS, bW as MAX_PNG_FONT_DIRECTORIES, bX as MAX_PNG_FONT_DIRECTORY_LENGTH, bY as MAX_PNG_PIXELS, bZ as MAX_PNG_RASTER_DIMENSION, gJ as MarkPaint, b_ as MarkerDescriptor, gK as MarkerSerializationOptions, gL as MarkerShape, gM as MermaidBrowserPNGRenderer, gN as MermaidBrowserPNGRendererHostOptions, b$ as MermaidFamilyClassification, c0 as MermaidFamilyDetectionError, gO as MermaidGraph, gP as MermaidRenderer, gQ as MermaidRendererHostOptions, gR as MermaidRuntimeConfig, gS as MermaidThemeVariables, gT as MindmapDiagram, gU as MindmapDuplicateIdError, gV as MindmapNode, gW as MindmapParseError, gX as MindmapRuntimeConfig, gY as MindmapShape, c6 as NATIVE_PNG_HOST_ONLY_OPTION_FIELDS, c7 as NATIVE_PNG_OUTPUT_POLICY_FIELDS, gZ as NamespacedSceneRole, c8 as NativePngHostOnlyOptionField, c9 as NativePngOutputPolicyField, g_ as OUTPUT_COLOR_PROFILE, g$ as OUTPUT_SECURITY_POLICY_VERSION, h0 as OutputSecurityDiagnostic, h1 as OutputSecurityMode, h2 as OutputSecurityResult, cb as PNG_DEFAULT_FONT_FAMILY, cc as PNG_DEFAULT_SCALE, cd as PNG_FONT_SOURCES, ce as PNG_NAPI_RUNTIME, cf as PNG_OUTPUT_OPTION_FIELDS, cg as PNG_OUTPUT_OPTION_FIELD_DESCRIPTORS, ch as PNG_OUTPUT_POLICY_VERSION, ci as PNG_WASM_RUNTIME, cj as PORTABLE_PNG_OUTPUT_OPTION_FIELDS, ck as PRIMITIVE_REALIZATIONS, P as ParsedDiagram, h3 as ParsedDiagramFamilyMismatchError, h4 as PieRuntimeConfig, h5 as PngColorProfileReceipt, h6 as PngDimensions, cr as PngFitTo, cs as PngFontSource, ct as PngOutputOptionField, cu as PngOutputOptionFieldDescriptor, cv as PngOutputOptionInputKind, cw as PngOutputOptionPolicyState, cx as PngOutputOptionReceiptState, cy as PngOutputOptionScope, a as PngOutputPolicyInput, cz as PngRasterDimensions, c as PngRuntimeProvenance, cA as PortSemanticRole, cB as PortSide, cC as PortablePngOutputOptionField, cD as PortablePngOutputOptions, fX as PositionedDiagram, h7 as PositionedGitGraphDiagram, h8 as PositionedGraph, h9 as PositionedMindmapDiagram, cE as PreservedDiagramBody, cF as PreservedSourceSpans, cG as PreservedValidDiagram, ha as PrimitiveCapabilityClaim, hb as PrimitiveRealization, hc as QuadrantRuntimeConfig, cM as RENDER_CONTRACT_VERSION, cN as RENDER_OUTPUTS, cO as RENDER_OUTPUT_DESCRIPTORS, cP as RESOURCE_MANIFEST, cQ as RESOURCE_MANIFEST_VERSION, cR as ROLE_STYLE_PROPERTY_DESCRIPTORS, hd as RadarRuntimeConfig, cX as RegionContainmentCertificate, cY as RenderCapabilityError, he as RenderContext, R as RenderOptions, hf as RenderOutput, cZ as RenderOutputDescriptor, c_ as RenderOutputTransports, b as RenderRequestReceipt, hg as RenderableMarkerDescriptor, c$ as RenderedAscii, hh as RenderedBrowserPng, f$ as RenderedSvg, hi as ResolvedArchitectureIcon, hj as ResolvedColors, d5 as ResolvedPngOutputPolicy, hk as ResolvedSceneRoleTraits, d6 as ResolvedTerminalOutputPolicy, hl as ResolvedTerminalStyle, hm as ResourceLicense, hn as ResourceManifest, ho as ResourceManifestEntry, d8 as RoleStyleFor, d9 as RoleStyleSpec, da as RoleStyles, db as RouteBlocker, dc as RouteCertificate, dd as RouteClass, de as RoutePortAssignment, df as SCENE_CONTRACT_VERSION, dg as SCENE_ROLE_DESCRIPTORS, dh as SCENE_VALIDATION_LIMITS, di as SCENE_VALIDATION_VERSION, dj as SEMANTIC_BINDING_CHANNELS, dk as SHARED_RENDER_OPTION_FIELDS, dl as STYLE_COLOR_TOKEN_DESCRIPTORS, dm as STYLE_SPEC_FIELD_DESCRIPTORS, dn as STYLE_SPEC_FORMAT_VERSION, hp as SceneBox, hq as SceneConnectorHit, dp as SceneDoc, hr as SceneFeature, hs as SceneMarkKind, dq as SceneNode, ht as SceneNodeBase, hu as SceneOperation, hv as ScenePoint, hw as ScenePrimitive, dr as SceneRole, hx as SceneRoleDescriptor, hy as SceneRoleTraits, hz as SceneSketchPolicy, ds as SceneValidationDiagnostic, dt as SceneValidationDiagnosticCode, du as SceneValidationError, dv as SceneValidationOptions, dw as SceneValidationResult, dx as SemanticBinding, dy as SemanticBindingChannel, dz as SemanticChannels, dA as SemanticSlots, hA as ShapeMark, dM as SourceSpan, dN as SourceSpanPoint, hB as StateRuntimeConfig, dT as StyleBackend, dU as StyleBackendContext, dV as StyleColors, dW as StyleDescriptor, dX as StyleInput, dY as StyleReferenceResolution, dZ as StyleRegistrationOptions, hC as StyleRegistryKind, d_ as StyleSpec, hD as SvgRelationSemantics, hE as SvgSemanticAccessibility, hF as SvgSemanticIdentity, d$ as TERMINAL_BOUNDED_PADDING_X, e0 as TERMINAL_DEFAULT_BOX_BORDER_PADDING, e1 as TERMINAL_DEFAULT_PADDING_X, e2 as TERMINAL_DEFAULT_PADDING_Y, e3 as TERMINAL_OUTPUT_POLICY_VERSION, hG as TERMINAL_STYLE_VERSION, e4 as TEXT_MEASUREMENT_CONTRACT, hH as TerminalConnectorProjection, hI as TerminalConnectorProjectionReceipt, e5 as TerminalOutputPolicyError, e6 as TerminalOutputPolicyInput, hJ as TerminalProjectionDiagnostic, fY as TerminalProjectionDiagnosticCode, hK as TerminalProjectionSecurityContext, hL as TextMark, e7 as TextMeasurementContract, e8 as TextMeasurementInput, e9 as TextMeasurementResult, hM as TimelineRuntimeConfig, hN as XyChartRuntimeConfig, hO as applyOutputSecurityPolicy, hP as applyPngColorProfile, hQ as architectureIconManifest, hR as architectureToMermaidGraph, eV as assertHostedPngRasterBudget, eW as assertPngRasterBudget, hS as assertRenderableMarker, eX as assertValidSceneDoc, eY as buildExternalScene, hT as canonicalExtensionId, e_ as classifyMermaidFamilyFromFirstLine, hU as connectorHitDistance, e$ as createExtensionIdentity, hV as createMermaidBrowserPNGRenderer, hW as createMermaidRenderer, hX as essentialScenePrimitiveOperation, hY as evaluateExtensionCompatibility, hZ as fromShikiTheme, f5 as getBackend, f8 as getStyle, h_ as hitTestConnector, h$ as hitTestSceneConnectors, f9 as hostedFontResource, fa as inferBackend, i0 as inlineResolvedColors, i1 as inspectPngColorProfile, i2 as inspectPngDimensions, fd as knownBackendDescriptors, fg as knownStyleDescriptors, fh as knownStyles, fi as measureText, fj as measureTextWidth, fk as negotiateCapabilities, fl as negotiateRenderCapabilities, fm as normalizePortablePngBackground, fo as omitPngOutputOptions, i3 as parseArchitectureDiagram, i4 as parseExtensionId, i5 as parseGitGraph, i6 as parseMindmap, fp as parseRegisteredMermaid, fq as parseSemVer, fr as pngNapiRuntimeProvenance, fs as pngOutputOptionsJsonSchema, ft as pngRasterDimensions, fu as prepareSvgForPngRasterization, fv as projectNativePngOutputPolicyInput, fw as projectPortablePngOutputOptions, fx as registerBackend, i7 as registerExtension, fy as registerStyle, i8 as renderContractDigest, fZ as renderMermaidASCII, i9 as renderMermaidASCIIWithReceipt, ia as renderMermaidPNGInBrowserWithReceipt, f_ as renderMermaidSVG, ib as renderMermaidSVGAsync, ic as renderMermaidSVGWithReceipt, id as resolveArchitectureIcon, ie as resolveColors, ig as resolveDiagramColors, fz as resolvePngOutputPolicy, fA as resolvePortablePngOutputPolicy, fB as resolveSceneRoleTraits, fC as resolveStyleReference, fD as resolveStyleStack, fE as resolveTerminalOutputPolicy, fF as runBackendConformance, fG as sceneRoleTraits, fH as semVerSatisfies, ih as serializeGitGraph, ii as serializeMarkerResource, ij as serializeMarkerResources, ik as serializeMindmap, fI as sharedRenderOptionsJsonSchema, il as snapshotResourceManifest, fJ as styleInputJsonSchema, fK as styleSpecJsonSchema, fL as svgIntrinsicDimensions, fM as terminalConnectorCapabilityClaims, fO as validatePrimitiveCapabilities, fP as validateResourceManifest, fQ as validateSceneDoc, fR as validateSerializableRenderOptions, fS as validateStyleSpec, fT as verifyNoExternalRefs, fU as verifyResourceBytes, im as verifySvgDocumentEnvelope } from './index-DWPa2MJs.js';
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MCP_CLI_HELP,
|
|
3
|
+
MCP_FLAG_SPECS,
|
|
4
|
+
parseMcpCliOptions,
|
|
5
|
+
runMcpCli
|
|
6
|
+
} from "./chunk-2P5FKUQC.js";
|
|
7
|
+
import "./chunk-2SILJDW2.js";
|
|
8
|
+
import "./chunk-FDM43XU7.js";
|
|
9
|
+
import "./chunk-MYPDVZCO.js";
|
|
10
|
+
import "./chunk-BJYMBT4I.js";
|
|
11
|
+
export {
|
|
12
|
+
MCP_CLI_HELP,
|
|
13
|
+
MCP_FLAG_SPECS,
|
|
14
|
+
parseMcpCliOptions,
|
|
15
|
+
runMcpCli
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=mcp-cli-5J47WEY3.js.map
|
package/docs/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agentic Mermaid documentation
|
|
2
2
|
|
|
3
|
-
This directory holds the long-form documentation. The root README is intentionally short and routes readers here.
|
|
3
|
+
This directory holds the long-form documentation. The root README is intentionally short and routes readers here. Consumer guides are included in the npm package; repository-only links use canonical GitHub URLs so this hub also works from an installed tarball.
|
|
4
4
|
|
|
5
5
|
## User docs
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ This directory holds the long-form documentation. The root README is intentional
|
|
|
12
12
|
| [`theming.md`](./theming.md) | Two-color themes, built-in themes, custom themes, Shiki import. |
|
|
13
13
|
| [`style-authoring.md`](./style-authoring.md) | Style model, stack semantics, field reference, rubric, and validation commands. |
|
|
14
14
|
| [`custom-style-cookbook.md`](./custom-style-cookbook.md) | Complete custom style JSON files, screenshots, schema usage, CLI commands, and the documentation-only Cupertino-, Vercel-, and Cloudflare Workers-inspired prototypes. |
|
|
15
|
-
| [`design/families/style-switch-contact-sheet.html`](
|
|
15
|
+
| [`design/families/style-switch-contact-sheet.html`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/families/style-switch-contact-sheet.html) | Self-contained interactive contact sheet for every registered family and every built-in Look/Palette Style resource. |
|
|
16
16
|
| [`custom-fonts.md`](./custom-fonts.md) | How custom Styles select and resolve fonts across SVG, PNG, browser, and MCP surfaces. |
|
|
17
17
|
| [`react.md`](./react.md) | Zero-flash React rendering with CSS variables. |
|
|
18
18
|
| [`ascii.md`](./ascii.md) | Terminal output, ASCII vs Unicode, color modes, XY charts. |
|
|
@@ -36,7 +36,7 @@ This directory holds the long-form documentation. The root README is intentional
|
|
|
36
36
|
| [`mcp-http-transport.md`](./mcp-http-transport.md) | Local HTTP/SSE MCP quickstart plus hosted `/mcp` call-shape notes. |
|
|
37
37
|
| [`agent-workflow-examples.md`](./agent-workflow-examples.md) | Runnable MCP/CLI and improvement-loop examples. |
|
|
38
38
|
| [`../skills/`](../skills/) | Agent-agnostic skill bundles. |
|
|
39
|
-
| [`../skill-evals/`](
|
|
39
|
+
| [`../skill-evals/`](https://github.com/adewale/agentic-mermaid/tree/main/skill-evals) | Skill eval manifest, fixtures, and benchmark instructions. |
|
|
40
40
|
|
|
41
41
|
## Contributor / project docs
|
|
42
42
|
|
|
@@ -47,26 +47,26 @@ The design docs split into two tiers — **system** (how the engine works, cross
|
|
|
47
47
|
|
|
48
48
|
| Doc | Purpose |
|
|
49
49
|
|---|---|
|
|
50
|
-
| [`project/brand-primitives-plan.md`](
|
|
51
|
-
| [`design/system/`](
|
|
52
|
-
| [`design/system/route-contracts.md`](
|
|
53
|
-
| [`design/system/layout-rubric.md`](
|
|
54
|
-
| [`design/system/source-preservation-ladder.md`](
|
|
55
|
-
| [`design/mermaid-family-fidelity-audit.md`](
|
|
56
|
-
| [`design/style-palette-compatibility.md`](
|
|
57
|
-
| [`design/system/ugly-layouts.md`](
|
|
50
|
+
| [`project/brand-primitives-plan.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/project/brand-primitives-plan.md) | Normative appearance/family-contract decision and A/B dependency/acceptance plan; live status is owned by root `TODO.md`. |
|
|
51
|
+
| [`design/system/`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/system/README.md) | **Start here.** Current resolved-request, family-descriptor, positioned-artifact, and output-security architecture overview (dogfooded, drift-proof). |
|
|
52
|
+
| [`design/system/route-contracts.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/system/route-contracts.md) | Route contracts: edge classification, direct-lane proofs, certifying straightener (issue #25). |
|
|
53
|
+
| [`design/system/layout-rubric.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/system/layout-rubric.md) | Deterministic layout-quality rubric: metrics, CI gates, and property oracles. |
|
|
54
|
+
| [`design/system/source-preservation-ladder.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/system/source-preservation-ladder.md) | The structured\|opaque family-adoption contract (levels L0–L4). |
|
|
55
|
+
| [`design/mermaid-family-fidelity-audit.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/mermaid-family-fidelity-audit.md) | Mermaid 11.16 syntax accounting and Mermaid/Wikipedia visual-metaphor audit for every registered family. |
|
|
56
|
+
| [`design/style-palette-compatibility.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/style-palette-compatibility.md) | Registry-derived exhaustive algebra plus complexity-aware variable-strength Style/Palette/family compatibility receipt. |
|
|
57
|
+
| [`design/system/ugly-layouts.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/system/ugly-layouts.md) | Ugly-layout detector: catalogued failure shapes and heuristics. |
|
|
58
58
|
|
|
59
59
|
### Per-family design notes
|
|
60
60
|
|
|
61
61
|
| Doc | Purpose |
|
|
62
62
|
|---|---|
|
|
63
|
-
| [`design/families/`](
|
|
64
|
-
| [`design/families/architecture-beta.md`](
|
|
65
|
-
| [`design/families/gantt.md`](
|
|
66
|
-
| [`design/families/gantt-research.md`](
|
|
67
|
-
| [`design/families/journey.md`](
|
|
68
|
-
| [`design/families/xychart.md`](
|
|
69
|
-
| [`design/families/flowchart-parser-conformance.md`](
|
|
63
|
+
| [`design/families/`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/families/README.md) | Per-family hub: which families have a design note, and where each family's other surfaces live. |
|
|
64
|
+
| [`design/families/architecture-beta.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/families/architecture-beta.md) | `architecture-beta` diagram-type implementation notes. |
|
|
65
|
+
| [`design/families/gantt.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/families/gantt.md) | Gantt support specification and compatibility boundaries. |
|
|
66
|
+
| [`design/families/gantt-research.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/families/gantt-research.md) | Gantt literature review and commercial UX survey. |
|
|
67
|
+
| [`design/families/journey.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/families/journey.md) | Journey diagram implementation notes. |
|
|
68
|
+
| [`design/families/xychart.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/families/xychart.md) | XY chart implementation notes. |
|
|
69
|
+
| [`design/families/flowchart-parser-conformance.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/design/families/flowchart-parser-conformance.md) | Flowchart syntax conformance catalogue and unsupported-syntax warning policy (issue #36). |
|
|
70
70
|
|
|
71
71
|
> All per-family notes live in `design/families/` and all cross-cutting notes in `design/system/`.
|
|
72
72
|
|
|
@@ -74,21 +74,21 @@ The design docs split into two tiers — **system** (how the engine works, cross
|
|
|
74
74
|
|
|
75
75
|
| Doc | Purpose |
|
|
76
76
|
|---|---|
|
|
77
|
-
| [`contributing/adding-diagram-types.md`](
|
|
78
|
-
| [`contributing/visual-review-evidence.md`](
|
|
79
|
-
| [`contributing/diagram-family-citizenship.md`](
|
|
80
|
-
| [`contributing/harvesting-upstream-tests.md`](
|
|
81
|
-
| [`contributing/releasing.md`](
|
|
82
|
-
| [`layout-characterization/README.md`](
|
|
77
|
+
| [`contributing/adding-diagram-types.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/contributing/adding-diagram-types.md) | How to add a Mermaid-supported diagram family. |
|
|
78
|
+
| [`contributing/visual-review-evidence.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/contributing/visual-review-evidence.md) | Which reproducible visual artifacts are required for layout/rendering changes. |
|
|
79
|
+
| [`contributing/diagram-family-citizenship.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/contributing/diagram-family-citizenship.md) | Enforced good-citizen checklist and matrix for family/surface drift (issue #41). |
|
|
80
|
+
| [`contributing/harvesting-upstream-tests.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/contributing/harvesting-upstream-tests.md) | How to vendor upstream/fork test suites into an executable compatibility bench. |
|
|
81
|
+
| [`contributing/releasing.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/contributing/releasing.md) | How to cut an npm release (GitHub Release → provenance publish) and flip the "published" copy. |
|
|
82
|
+
| [`layout-characterization/README.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/layout-characterization/README.md) | Layout and visual testing approach: properties, contact sheets, raster contracts, and approval artifacts. |
|
|
83
83
|
| [`svg-semantic-contract.md`](./svg-semantic-contract.md) | Typed Scene identity, geometry, references, and accessibility contract. |
|
|
84
84
|
| [`mutation-testing.md`](./mutation-testing.md) | Mutation lanes, survivor handling, and fault-sensitivity evidence. |
|
|
85
|
-
| [`project/divergences.md`](
|
|
86
|
-
| [`project/lessons-learned.md`](
|
|
87
|
-
| [`project/agent-interface-contract-audit-2026-07.md`](
|
|
88
|
-
| [`project/complexity-aware-test-portfolio-plan.md`](
|
|
89
|
-
| [`contributing/lessons-learned.md`](
|
|
90
|
-
| [`project/dogfooding-docs-strategy.md`](
|
|
91
|
-
| [`project/archive/`](
|
|
85
|
+
| [`project/divergences.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/project/divergences.md) | Deliberate divergences and guardrails. |
|
|
86
|
+
| [`project/lessons-learned.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/project/lessons-learned.md) | Evergreen engineering lessons distilled from the archived fork narrative. |
|
|
87
|
+
| [`project/agent-interface-contract-audit-2026-07.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/project/agent-interface-contract-audit-2026-07.md) | PR #162 defect provenance, review of PRs #157/#160, testing root causes, and recurrence controls. |
|
|
88
|
+
| [`project/complexity-aware-test-portfolio-plan.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/project/complexity-aware-test-portfolio-plan.md) | Implemented measured migration from overlapping family/style matrices to automatic complexity-aware conformance, variable-strength interaction coverage, and periodic contact-sheet review. |
|
|
89
|
+
| [`contributing/lessons-learned.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/contributing/lessons-learned.md) | Dated contributor process lessons (newest first). |
|
|
90
|
+
| [`project/dogfooding-docs-strategy.md`](https://github.com/adewale/agentic-mermaid/blob/main/docs/project/dogfooding-docs-strategy.md) | How we render and pin our own docs with our own tools. |
|
|
91
|
+
| [`project/archive/`](https://github.com/adewale/agentic-mermaid/tree/main/docs/project/archive) | Status-marked landing/completion evidence and frozen historical records; never live backlog authority. |
|
|
92
92
|
| [`issue-derived-test-cases.md`](./issue-derived-test-cases.md) | Issue-derived regression coverage map. |
|
|
93
93
|
| [`mermaid-layout-complaints.md`](./mermaid-layout-complaints.md) | Mermaid layout complaint catalog, root causes, and coverage scorecard. |
|
|
94
94
|
|
|
@@ -97,8 +97,8 @@ The design docs split into two tiers — **system** (how the engine works, cross
|
|
|
97
97
|
- [`../README.md`](../README.md) — landing page and quick starts.
|
|
98
98
|
- [`../CHANGELOG.md`](../CHANGELOG.md) — release notes.
|
|
99
99
|
- [`../SECURITY.md`](../SECURITY.md) — conventional security entrypoint.
|
|
100
|
-
- [`../TODO.md`](
|
|
100
|
+
- [`../TODO.md`](https://github.com/adewale/agentic-mermaid/blob/main/TODO.md) — only active backlog with unchecked boxes.
|
|
101
101
|
- [`../Instructions_for_agents.md`](../Instructions_for_agents.md) — canonical agent guide emitted by CLI.
|
|
102
102
|
- [`../AGENT_NATIVE.md`](../AGENT_NATIVE.md) — agent-native architecture/spec entrypoint.
|
|
103
|
-
- [`../PRODUCT.md`](
|
|
104
|
-
- [`../DESIGN.md`](
|
|
103
|
+
- [`../PRODUCT.md`](https://github.com/adewale/agentic-mermaid/blob/main/PRODUCT.md) — canonical product brief (brand register).
|
|
104
|
+
- [`../DESIGN.md`](https://github.com/adewale/agentic-mermaid/blob/main/DESIGN.md) — canonical website design system.
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# Agentic Mermaid agent API cookbook
|
|
2
|
+
|
|
3
|
+
This is the practical API reference for agents and agent authors. It complements the short [`Instructions_for_agents.md`](../Instructions_for_agents.md) guide and the deeper [`AGENT_NATIVE.md`](../AGENT_NATIVE.md) rationale.
|
|
4
|
+
|
|
5
|
+
## Mental model
|
|
6
|
+
|
|
7
|
+
Agentic Mermaid is not just a renderer. It is a structured edit loop:
|
|
8
|
+
|
|
9
|
+
1. **Parse** Mermaid source into a `ValidDiagram`.
|
|
10
|
+
2. **Narrow** existing structured diagrams to the family you intend to edit.
|
|
11
|
+
3. **Mutate** with typed operations instead of string-splicing source.
|
|
12
|
+
4. **Verify** before any commit point.
|
|
13
|
+
5. **Serialize** only after inspecting `verify.ok`, `verify.warnings`, and, when relevant, `verify.layout`.
|
|
14
|
+
|
|
15
|
+
For brand-new diagrams, author Mermaid source directly, then parse/verify/render. For existing modeled diagrams, prefer typed mutation so edits preserve structure and round-trip predictably.
|
|
16
|
+
|
|
17
|
+
## Pick the right channel
|
|
18
|
+
|
|
19
|
+
| Channel | Use when | Surface |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| Library | You can run TypeScript/JavaScript | `import ... from 'agentic-mermaid/agent'` |
|
|
22
|
+
| MCP Code Mode | An agent needs multi-step edits in one sandboxed call | local `agentic-mermaid-mcp`, global `mermaid.*` |
|
|
23
|
+
| Hosted MCP | No local install is available, or a client wants bounded HTTP tools | `https://agentic-mermaid.dev/mcp` tools: `execute`, render/verify/describe, `mutate`, `build` |
|
|
24
|
+
| CLI | Shell-only verification, rendering, preview, or one-shot mutation | `am ...` |
|
|
25
|
+
|
|
26
|
+
All channels expose the same core contract: parse, optionally narrow, mutate, verify, serialize/render. Agentic Mermaid outputs SVG, PNG, ASCII, Unicode, and JSON layout.
|
|
27
|
+
|
|
28
|
+
## Recipe: author a new diagram
|
|
29
|
+
|
|
30
|
+
Use direct source authoring for new diagrams. Do not construct a diagram by calling `mutate` repeatedly unless you specifically need a mutation trace.
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { parseRegisteredMermaid, verifyMermaid, renderMermaidSVG } from 'agentic-mermaid/agent'
|
|
34
|
+
|
|
35
|
+
const source = `flowchart LR
|
|
36
|
+
User --> Login
|
|
37
|
+
Login --> Dashboard`
|
|
38
|
+
|
|
39
|
+
const parsed = parseRegisteredMermaid(source)
|
|
40
|
+
if (!parsed.ok) throw new Error(parsed.error.map(e => e.message).join('\n'))
|
|
41
|
+
|
|
42
|
+
const verify = verifyMermaid(parsed.value)
|
|
43
|
+
if (!verify.ok) throw new Error(JSON.stringify(verify.warnings, null, 2))
|
|
44
|
+
|
|
45
|
+
const svg = renderMermaidSVG(parsed.value, { security: 'strict' })
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
CLI equivalent:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
am verify diagram.mmd
|
|
52
|
+
am preview diagram.mmd --security strict --open
|
|
53
|
+
am render diagram.mmd --format svg > diagram.svg
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Recipe: edit an existing flowchart safely
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { parseRegisteredMermaid, asFlowchart, mutate, verifyMermaid, serializeMermaid } from 'agentic-mermaid/agent'
|
|
60
|
+
|
|
61
|
+
const parsed = parseRegisteredMermaid('flowchart TD\n API --> DB')
|
|
62
|
+
if (!parsed.ok) throw new Error('parse failed')
|
|
63
|
+
|
|
64
|
+
const flow = asFlowchart(parsed.value)
|
|
65
|
+
if (!flow) throw new Error(`not a structured flowchart: ${parsed.value.kind}`)
|
|
66
|
+
|
|
67
|
+
const r1 = mutate(flow, { kind: 'add_node', id: 'Cache', label: 'Cache' })
|
|
68
|
+
if (!r1.ok) throw new Error(r1.error.message)
|
|
69
|
+
|
|
70
|
+
const r2 = mutate(r1.value, { kind: 'add_edge', from: 'API', to: 'Cache' })
|
|
71
|
+
if (!r2.ok) throw new Error(r2.error.message)
|
|
72
|
+
|
|
73
|
+
const verify = verifyMermaid(r2.value)
|
|
74
|
+
if (!verify.ok) throw new Error(JSON.stringify(verify.warnings, null, 2))
|
|
75
|
+
|
|
76
|
+
const source = serializeMermaid(r2.value)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
CLI equivalent:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
am mutate flow.mmd --ops '[
|
|
83
|
+
{"kind":"add_node","id":"Cache","label":"Cache"},
|
|
84
|
+
{"kind":"add_edge","from":"API","to":"Cache"}
|
|
85
|
+
]'
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`am mutate` verifies before emitting source. If verification fails, it exits `3` and omits `source`.
|
|
89
|
+
|
|
90
|
+
## Recipe: batch mutations with rollback
|
|
91
|
+
|
|
92
|
+
When applying several edits, keep the previous verified value. If a mutation or verification fails, return the last known-good diagram and the failure reason.
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
import { parseRegisteredMermaid, asFlowchart, mutate, verifyMermaid, serializeMermaid, type FlowchartMutationOp } from 'agentic-mermaid/agent'
|
|
96
|
+
|
|
97
|
+
export function applyFlowchartOps(source: string, ops: FlowchartMutationOp[]) {
|
|
98
|
+
const parsed = parseRegisteredMermaid(source)
|
|
99
|
+
if (!parsed.ok) return { ok: false as const, phase: 'parse', error: parsed.error }
|
|
100
|
+
|
|
101
|
+
let current = asFlowchart(parsed.value)
|
|
102
|
+
if (!current) return { ok: false as const, phase: 'narrow', family: parsed.value.kind }
|
|
103
|
+
|
|
104
|
+
const initialVerify = verifyMermaid(current)
|
|
105
|
+
if (!initialVerify.ok) return { ok: false as const, phase: 'initial-verify', warnings: initialVerify.warnings }
|
|
106
|
+
let lastGood = current
|
|
107
|
+
|
|
108
|
+
for (const op of ops) {
|
|
109
|
+
const next = mutate(current, op)
|
|
110
|
+
if (!next.ok) return { ok: false as const, phase: 'mutate', op, error: next.error, source: serializeMermaid(lastGood) }
|
|
111
|
+
|
|
112
|
+
const verify = verifyMermaid(next.value)
|
|
113
|
+
if (!verify.ok) {
|
|
114
|
+
return { ok: false as const, phase: 'verify', op, warnings: verify.warnings, source: serializeMermaid(lastGood) }
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
current = next.value
|
|
118
|
+
lastGood = current
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return { ok: true as const, source: serializeMermaid(current), verify: verifyMermaid(current) }
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Recipe: handle opaque fallback bodies
|
|
126
|
+
|
|
127
|
+
Every built-in renderable family has a typed mutation path when its modeled subset narrows successfully. Unmodeled syntax is preserved as an opaque fallback body: it still parses, verifies, renders, and serializes losslessly, but family narrowers return `null` for that particular body.
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
import { parseRegisteredMermaid, asFlowchart, verifyMermaid, serializeMermaid } from 'agentic-mermaid/agent'
|
|
131
|
+
|
|
132
|
+
const parsed = parseRegisteredMermaid(source)
|
|
133
|
+
if (!parsed.ok) return { phase: 'parse', errors: parsed.error }
|
|
134
|
+
|
|
135
|
+
const flow = asFlowchart(parsed.value)
|
|
136
|
+
if (!flow) {
|
|
137
|
+
return {
|
|
138
|
+
phase: 'unsupported-family',
|
|
139
|
+
family: parsed.value.kind,
|
|
140
|
+
source: serializeMermaid(parsed.value),
|
|
141
|
+
note: 'This body is opaque. Use source-level editing only if explicitly requested; then re-parse and verify.'
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const verify = verifyMermaid(flow)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
For source-level edits, preserve as much original source as possible, then run `parseRegisteredMermaid` and `verifyMermaid` again before returning it.
|
|
149
|
+
|
|
150
|
+
## Recipe: inspect quality without screenshots
|
|
151
|
+
|
|
152
|
+
`verifyMermaid` is structural. It catches reliable warning codes and returns layout JSON; it is not a subjective aesthetics score.
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
import { parseRegisteredMermaid, verifyMermaid, measureQuality, layoutMermaid, analyzeMermaid } from 'agentic-mermaid/agent'
|
|
156
|
+
|
|
157
|
+
const parsed = parseRegisteredMermaid(source)
|
|
158
|
+
if (!parsed.ok) throw new Error('parse failed')
|
|
159
|
+
|
|
160
|
+
const verify = verifyMermaid(parsed.value, { labelCharCap: 28 })
|
|
161
|
+
const quality = measureQuality(layoutMermaid(parsed.value))
|
|
162
|
+
const routes = layoutMermaid(parsed.value, { debug: true }) // opt-in route, family-edge, and region certificates
|
|
163
|
+
const analysis = analyzeMermaid(parsed.value) // feedback edges, actions, Gantt critical path/slack
|
|
164
|
+
|
|
165
|
+
return {
|
|
166
|
+
ok: verify.ok,
|
|
167
|
+
warnings: verify.warnings,
|
|
168
|
+
bounds: verify.layout.bounds,
|
|
169
|
+
quality,
|
|
170
|
+
routeCertificates: routes.edges.map(e => e.route).filter(Boolean),
|
|
171
|
+
familyCertificates: routes.certificates ?? [],
|
|
172
|
+
analysis,
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
For a unified render plus inert action regions, use
|
|
177
|
+
`renderMermaidWithActions`. ASCII and Unicode artifacts include structured
|
|
178
|
+
terminal `warnings`; an `ASCII_RENDER_FAILED` condition throws instead of
|
|
179
|
+
returning an empty output as a successful artifact. SVG actions are marked
|
|
180
|
+
`embedded-inert` only when their target metadata is present in that SVG.
|
|
181
|
+
This includes Sequence `link`/`links` actor menus as well as admitted
|
|
182
|
+
Flowchart, Class, and Gantt interactions; strict SVG removes authored href
|
|
183
|
+
metadata and reports those actions through the sidecar only.
|
|
184
|
+
|
|
185
|
+
Route, family-edge, and region certificates are opt-in; when graph-edge or family-edge certificates are present, `sourcePort`/`targetPort` are exact endpoint anchors where the family exposes them, and `sourcePortAssignment`/`targetPortAssignment` describe side, ordered slot, slot count, and semantic role for graph routes. Timeline/chart certificates use region-containment fields instead. Debug layouts also expose V1 `regions` and source-only `actions` sidecars so agents can attach UI affordances without executing Mermaid callbacks.
|
|
186
|
+
|
|
187
|
+
For a renderer-neutral hit surface, use the same API for every output:
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
import { renderMermaidWithActions } from 'agentic-mermaid/agent'
|
|
191
|
+
|
|
192
|
+
const rendered = renderMermaidWithActions(source, {
|
|
193
|
+
format: 'png',
|
|
194
|
+
options: { fitTo: { width: 1200 } },
|
|
195
|
+
})
|
|
196
|
+
// rendered.output is PNG bytes; actionSurface actions reference pixel regions.
|
|
197
|
+
for (const action of rendered.actionSurface.actions) {
|
|
198
|
+
if (action.region) console.log(action.target, action.disposition, action.region.bounds)
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Use render artifacts for human visual review:
|
|
203
|
+
|
|
204
|
+
```ts
|
|
205
|
+
import { renderMermaidSVG, renderMermaidASCII, renderMermaidPNG } from 'agentic-mermaid/agent'
|
|
206
|
+
|
|
207
|
+
const svg = renderMermaidSVG(diagram, { security: 'strict' })
|
|
208
|
+
const ascii = renderMermaidASCII(diagram, { useAscii: true, targetWidth: 80 })
|
|
209
|
+
const png = renderMermaidPNG(diagram, { fitTo: { width: 1600 }, background: '#fff' })
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Recipe: write SVG, PNG, and ASCII artifacts
|
|
213
|
+
|
|
214
|
+
Library channel:
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
import { writeFileSync } from 'node:fs'
|
|
218
|
+
import { parseRegisteredMermaid, verifyMermaid, renderMermaidSVG, renderMermaidPNG, renderMermaidASCII } from 'agentic-mermaid/agent'
|
|
219
|
+
|
|
220
|
+
const parsed = parseRegisteredMermaid(source)
|
|
221
|
+
if (!parsed.ok) throw new Error(parsed.error.map(e => e.message).join('\n'))
|
|
222
|
+
|
|
223
|
+
const verify = verifyMermaid(parsed.value)
|
|
224
|
+
if (!verify.ok) throw new Error(JSON.stringify(verify.warnings, null, 2))
|
|
225
|
+
|
|
226
|
+
writeFileSync('diagram.svg', renderMermaidSVG(parsed.value, { security: 'strict' }))
|
|
227
|
+
writeFileSync('diagram.png', renderMermaidPNG(parsed.value, { fitTo: { width: 1200 }, background: '#fff' }))
|
|
228
|
+
writeFileSync('diagram.txt', renderMermaidASCII(parsed.value, { useAscii: true }))
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
CLI channel:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
am verify diagram.mmd
|
|
235
|
+
am render diagram.mmd --format svg > diagram.svg
|
|
236
|
+
am render diagram.mmd --format png --output diagram.png
|
|
237
|
+
am render diagram.mmd --format ascii > diagram.txt
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
MCP channel:
|
|
241
|
+
|
|
242
|
+
- Local MCP: use Code Mode for parse/narrow/mutate/verify/serialize.
|
|
243
|
+
- Local MCP: use the `render_png` helper for base64 PNG bytes when the host needs a raster artifact.
|
|
244
|
+
- Local HTTP/SSE mode: use `render_png` with `output: "file"` or `output: "url"` when the host wants a managed artifact instead of inline base64.
|
|
245
|
+
- Hosted MCP: call `describe_sdk` for one family's compact op signatures or exact field schema, then use direct `render_svg`, `render_ascii`, `render_png`, `verify`, and `describe` for one-shot work; `render_ascii` accepts `targetWidth` as a hard display-cell bound and returns `ASCII_TARGET_WIDTH_IMPOSSIBLE` details when it cannot fit. Use declarative `mutate`/`build` for straightforward op-list edits; reserve hosted `execute` for logic those tools do not express.
|
|
246
|
+
- Use local library/CLI/MCP for sensitive diagrams, offline work, larger inputs, or local file/URL PNG artifacts.
|
|
247
|
+
|
|
248
|
+
## Recipe: MCP Code Mode
|
|
249
|
+
|
|
250
|
+
In MCP Code Mode, do not import. The server injects `mermaid.*` as a global. Return JSON-serializable values.
|
|
251
|
+
|
|
252
|
+
```ts
|
|
253
|
+
const parsed = mermaid.parseRegisteredMermaid('flowchart TD\n API --> DB')
|
|
254
|
+
if (!parsed.ok) return { phase: 'parse', errors: parsed.error }
|
|
255
|
+
|
|
256
|
+
const flow = mermaid.asFlowchart(parsed.value)
|
|
257
|
+
if (!flow) return { phase: 'narrow', family: parsed.value.kind }
|
|
258
|
+
|
|
259
|
+
const next = mermaid.mutate(flow, { kind: 'rename_node', from: 'DB', to: 'Database' })
|
|
260
|
+
if (!next.ok) return { phase: 'mutate', error: next.error }
|
|
261
|
+
|
|
262
|
+
const verify = mermaid.verifyMermaid(next.value)
|
|
263
|
+
if (!verify.ok) return { phase: 'verify', warnings: verify.warnings }
|
|
264
|
+
|
|
265
|
+
return { source: mermaid.serializeMermaid(next.value) }
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Code Mode constraints:
|
|
269
|
+
|
|
270
|
+
- No imports, dynamic imports, `async`/`await`, or Promise jobs.
|
|
271
|
+
- SDK-returned diagrams are read-only; edit through `mermaid.mutate`.
|
|
272
|
+
- Binary output such as PNG should usually be produced by a narrow helper or host code, not by large Code Mode payloads. `agentic-mermaid-mcp --transport http` serves managed URL artifacts from `/artifacts/<name>`.
|
|
273
|
+
|
|
274
|
+
## Mutation operation discovery
|
|
275
|
+
|
|
276
|
+
Use `am capabilities --json` for the registry-derived family roster, edit policy, narrower, and mutation-op names. In the library or Code Mode, use `describeOps(family)` or `opSignatures(family)` for exact fields, requiredness, enums, constraints, and defaults. Hosted MCP callers can request one family's schema with `describe_sdk`. These surfaces are generated from the same registry; this cookbook deliberately does not maintain another crib sheet.
|
|
277
|
+
|
|
278
|
+
Unsupported typed mutation is a stop signal, not a prompt to fake structure. Either report the unsupported family or perform explicit source-level editing followed by parse/verify.
|
|
279
|
+
|
|
280
|
+
## Warning-code crib sheet
|
|
281
|
+
|
|
282
|
+
Tier 1 warnings are reliable structural/source checks. Do not suppress Tier 1 errors unless you fully understand the consequence.
|
|
283
|
+
|
|
284
|
+
| Code | Meaning |
|
|
285
|
+
|---|---|
|
|
286
|
+
| `EMPTY_DIAGRAM` | Nothing renderable |
|
|
287
|
+
| `EDGE_MISANCHORED` | Edge endpoint is not attached to a real target |
|
|
288
|
+
| `OFF_CANVAS` | Node or edge segment lies outside canvas bounds |
|
|
289
|
+
| `GROUP_BREACH` | Member lies outside its group bounds |
|
|
290
|
+
| `UNKNOWN_SHAPE` | Shape fell back because the name is unrecognized |
|
|
291
|
+
| `LABEL_OVERFLOW` | Label exceeds `labelCharCap` |
|
|
292
|
+
| `UNRESOLVABLE_SCHEDULE` | Gantt parses but its schedule cannot resolve; render would fail |
|
|
293
|
+
| `RENDER_FAILED` | Any family: verifies structurally but the strict render parser rejects the canonical source; `reason` carries the renderer error |
|
|
294
|
+
|
|
295
|
+
Tier 2 warnings are advisory geometric checks — route tripwires for flowchart/state, plus boundary-anchor/overlap checks on class/ER entity boxes: `NODE_OVERLAP`, `ROUTE_SELF_CROSS`, and the route-contract tripwires `ROUTE_HITCH`, `ROUTE_UNEXPLAINED_BEND`, `ROUTE_LABEL_ON_SHARED_TRUNK`, `ROUTE_SELF_LOOP_OCCUPANCY`, `ROUTE_CONTAINER_MISANCHOR`, `ROUTE_SHAPE_MISANCHOR`, `ROUTE_STALE_AFTER_NODE_MOVE`.
|
|
296
|
+
|
|
297
|
+
Tier 3 covers advisory lint plus caller-selected inspect-only Brand policy: `DUPLICATE_EDGE`, `UNREACHABLE_NODE`, `DECISION_BRANCH_UNLABELED`, `COMMENT_DROPPED`, `UNSUPPORTED_SYNTAX`, `CONTENT_DROPPED_ON_ROUNDTRIP`, `INEFFECTIVE_CONFIG`, `LOW_CONTRAST`, `BRAND_CONSTRAINT_WARNING`, `BRAND_CONSTRAINT_ERROR`. `LOW_CONTRAST` preserves authored paint and reports its foreground, final opaque background, ratio, and minimum; transparent output is not measured because its host backdrop is unknown. Brand constraints inspect final contrast, accent-area, or mono-role evidence without repainting or relayout. Advisory findings do not flip `verify.ok`; `BRAND_CONSTRAINT_ERROR` does only because the caller explicitly selected `action: "error"`.
|
|
298
|
+
|
|
299
|
+
## Common anti-patterns
|
|
300
|
+
|
|
301
|
+
- Regenerating an existing structured diagram instead of mutating it.
|
|
302
|
+
- Concatenating source for an edit covered by a typed op.
|
|
303
|
+
- Serializing before reading `verify.ok` and `verify.warnings`.
|
|
304
|
+
- Treating `verify.ok` as a human aesthetics score.
|
|
305
|
+
- Calling `mutate` on opaque fallback bodies.
|
|
306
|
+
- Hiding unsupported-family results. Return them explicitly so the caller can choose a source-level path.
|
|
307
|
+
|
|
308
|
+
## Minimal decision tree
|
|
309
|
+
|
|
310
|
+
```text
|
|
311
|
+
Do you have a brand-new diagram?
|
|
312
|
+
yes → write Mermaid source → parse → verify → render/return
|
|
313
|
+
no → parse existing source
|
|
314
|
+
structured narrower exists?
|
|
315
|
+
yes → mutate → verify → serialize
|
|
316
|
+
no → preserve source; report unsupported-family unless source-level editing was requested
|
|
317
|
+
```
|