agentic-mermaid 0.2.0 → 0.3.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/CHANGELOG.md +17 -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 +6 -6
- package/dist/browser.global.js +777 -0
- package/dist/{chunk-2S3VSS6I.js → chunk-3QCXO4V6.js} +4 -4
- package/dist/{chunk-MYPDVZCO.js → chunk-AVCWKYII.js} +2 -2
- package/dist/{chunk-FDM43XU7.js → chunk-GILQUGFK.js} +2 -2
- package/dist/{chunk-2P5FKUQC.js → chunk-HFD4MALA.js} +5 -5
- package/dist/{chunk-2SILJDW2.js → chunk-UJNY65QS.js} +2 -2
- package/dist/{chunk-BJYMBT4I.js → chunk-WHYJLDYG.js} +7 -7
- package/dist/{index-DWPa2MJs.d.ts → index-CLwYn6Im.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp-cli-SJVOGRA6.js +17 -0
- package/docs/README.md +1 -0
- package/docs/browser.md +183 -0
- package/docs/fork-differences.md +33 -0
- package/docs/style-authoring.md +1 -1
- package/package.json +8 -4
- package/server.json +2 -2
- package/dist/mcp-cli-5J47WEY3.js +0 -17
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderMermaidPNG
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GILQUGFK.js";
|
|
4
4
|
import {
|
|
5
5
|
collectActionRecords,
|
|
6
6
|
layoutMermaid,
|
|
7
7
|
renderMermaidASCIIWithMeta,
|
|
8
8
|
renderMermaidSVG
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AVCWKYII.js";
|
|
10
10
|
import {
|
|
11
11
|
SHARED_RENDER_OPTION_FIELDS,
|
|
12
12
|
decodedSvgAttributeValue,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
prepareRenderInput,
|
|
16
16
|
scanSvgStartTags,
|
|
17
17
|
toFinite
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-WHYJLDYG.js";
|
|
19
19
|
|
|
20
20
|
// src/agent/index.ts
|
|
21
21
|
function sharedRenderOptions(options) {
|
|
@@ -146,4 +146,4 @@ function renderMermaidWithActions(input, request) {
|
|
|
146
146
|
export {
|
|
147
147
|
renderMermaidWithActions
|
|
148
148
|
};
|
|
149
|
-
//# sourceMappingURL=chunk-
|
|
149
|
+
//# sourceMappingURL=chunk-3QCXO4V6.js.map
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
visualWidth,
|
|
94
94
|
wcagCssContrastRatio,
|
|
95
95
|
wrapperPrefix
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-WHYJLDYG.js";
|
|
97
97
|
|
|
98
98
|
// src/agent/trace-log.ts
|
|
99
99
|
var appendFn;
|
|
@@ -4699,4 +4699,4 @@ export {
|
|
|
4699
4699
|
layoutMermaidWithReceipt,
|
|
4700
4700
|
layoutMermaid
|
|
4701
4701
|
};
|
|
4702
|
-
//# sourceMappingURL=chunk-
|
|
4702
|
+
//# sourceMappingURL=chunk-AVCWKYII.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
renderPngGraphicalProjection,
|
|
14
14
|
snapshotHostBackendPolicy,
|
|
15
15
|
snapshotResourceManifest
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WHYJLDYG.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-GILQUGFK.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
projectKnownRenderErrorDiagnostic,
|
|
3
3
|
projectRenderErrorDiagnostic
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UJNY65QS.js";
|
|
5
5
|
import {
|
|
6
6
|
renderMermaidPNG,
|
|
7
7
|
renderMermaidPNGWithReceipt
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GILQUGFK.js";
|
|
9
9
|
import {
|
|
10
10
|
analyzeMermaid,
|
|
11
11
|
analyzeMermaidSource,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
renderMermaidSVGWithReceipt,
|
|
32
32
|
verifyMermaid,
|
|
33
33
|
verifySummary
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-AVCWKYII.js";
|
|
35
35
|
import {
|
|
36
36
|
BUILTIN_FAMILY_METADATA,
|
|
37
37
|
PACKAGE_VERSION,
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
styleSpecTypeScriptDeclaration,
|
|
72
72
|
validateJsonConfigAdmission,
|
|
73
73
|
validateSerializableRenderOptions
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-WHYJLDYG.js";
|
|
75
75
|
|
|
76
76
|
// src/mcp/server.ts
|
|
77
77
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
@@ -3482,4 +3482,4 @@ export {
|
|
|
3482
3482
|
parseMcpCliOptions,
|
|
3483
3483
|
runMcpCli
|
|
3484
3484
|
};
|
|
3485
|
-
//# sourceMappingURL=chunk-
|
|
3485
|
+
//# sourceMappingURL=chunk-HFD4MALA.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AsciiWidthError,
|
|
3
3
|
MermaidFamilyDetectionError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WHYJLDYG.js";
|
|
5
5
|
|
|
6
6
|
// src/render-error-diagnostic.ts
|
|
7
7
|
function projectKnownRenderErrorDiagnostic(error) {
|
|
@@ -34,4 +34,4 @@ export {
|
|
|
34
34
|
projectKnownRenderErrorDiagnostic,
|
|
35
35
|
projectRenderErrorDiagnostic
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-UJNY65QS.js.map
|
|
@@ -1118,7 +1118,7 @@ function negotiateRenderCapabilityTuple(output, tuple) {
|
|
|
1118
1118
|
}
|
|
1119
1119
|
|
|
1120
1120
|
// src/version.ts
|
|
1121
|
-
var PACKAGE_VERSION = "0.
|
|
1121
|
+
var PACKAGE_VERSION = "0.3.0";
|
|
1122
1122
|
|
|
1123
1123
|
// src/shared/extension-identity.ts
|
|
1124
1124
|
function sameExtensionIdentity(left, right2) {
|
|
@@ -1468,7 +1468,7 @@ var SCENE_ROLE_DESCRIPTORS = Object.freeze(
|
|
|
1468
1468
|
id: `role:${role}`,
|
|
1469
1469
|
kind: "role",
|
|
1470
1470
|
version: "1.0.0",
|
|
1471
|
-
compatibility: { core: "^0.
|
|
1471
|
+
compatibility: { core: "^0.3.0", scene: "^2.0.0" },
|
|
1472
1472
|
provenance: { owner: "agentic-mermaid", source: "built-in", reference: "src/scene/roles.ts" }
|
|
1473
1473
|
}),
|
|
1474
1474
|
role,
|
|
@@ -27866,7 +27866,7 @@ ${pageRect}` : sceneNodeSerialization(part)).join("\n");
|
|
|
27866
27866
|
}
|
|
27867
27867
|
};
|
|
27868
27868
|
var CORE_BACKEND_VERSION = "1.0.0";
|
|
27869
|
-
var CORE_BACKEND_COMPATIBILITY = Object.freeze({ core: "^0.
|
|
27869
|
+
var CORE_BACKEND_COMPATIBILITY = Object.freeze({ core: "^0.3.0", scene: "^2.0.0" });
|
|
27870
27870
|
var CORE_BACKEND_PROVENANCE = Object.freeze({
|
|
27871
27871
|
owner: "agentic-mermaid",
|
|
27872
27872
|
source: "built-in",
|
|
@@ -30093,7 +30093,7 @@ var INTERNAL_STYLE_FACE_PROJECTION = Object.freeze({
|
|
|
30093
30093
|
group: Object.freeze({ sourceRole: "group", fields: Object.freeze([...INTERNAL_TEXT_FACE_FIELDS, ...INTERNAL_BOX_FACE_FIELDS, "fontFamily", "headerFillColor"]) })
|
|
30094
30094
|
});
|
|
30095
30095
|
var CORE_STYLE_VERSION = "1.0.0";
|
|
30096
|
-
var CORE_STYLE_COMPATIBILITY = Object.freeze({ core: "^0.
|
|
30096
|
+
var CORE_STYLE_COMPATIBILITY = Object.freeze({ core: "^0.3.0" });
|
|
30097
30097
|
var CORE_STYLE_PROVENANCE = Object.freeze({
|
|
30098
30098
|
owner: "agentic-mermaid",
|
|
30099
30099
|
source: "built-in",
|
|
@@ -51938,7 +51938,7 @@ var HOSTED_FONT_RESOURCES = Object.freeze(
|
|
|
51938
51938
|
id: `resource:${fontResourceLocalId(face)}`,
|
|
51939
51939
|
kind: "resource",
|
|
51940
51940
|
version: "1.0.0",
|
|
51941
|
-
compatibility: { core: "^0.
|
|
51941
|
+
compatibility: { core: "^0.3.0" },
|
|
51942
51942
|
provenance: { owner: "agentic-mermaid", source: "bundled", reference: `assets/fonts/${face.file}` }
|
|
51943
51943
|
})
|
|
51944
51944
|
}))
|
|
@@ -55913,7 +55913,7 @@ function completeBuiltinDescriptor(seed) {
|
|
|
55913
55913
|
id: `family:${seed.id}`,
|
|
55914
55914
|
kind: "family",
|
|
55915
55915
|
version: "1.0.0",
|
|
55916
|
-
compatibility: { core: "^0.
|
|
55916
|
+
compatibility: { core: "^0.3.0" },
|
|
55917
55917
|
provenance: { owner: "agentic-mermaid", source: "built-in" }
|
|
55918
55918
|
}),
|
|
55919
55919
|
collisionPriority: 100,
|
|
@@ -61960,4 +61960,4 @@ export {
|
|
|
61960
61960
|
renderMermaidSVGWithReceipt,
|
|
61961
61961
|
renderMermaidSVGAsync
|
|
61962
61962
|
};
|
|
61963
|
-
//# sourceMappingURL=chunk-
|
|
61963
|
+
//# sourceMappingURL=chunk-WHYJLDYG.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: "0.
|
|
34
|
+
readonly core: "0.3.0";
|
|
35
35
|
readonly scene: "2.0.0";
|
|
36
36
|
}>;
|
|
37
37
|
interface ExtensionCompatibilityResolution {
|
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-DWPa2MJs.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-CLwYn6Im.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-HFD4MALA.js";
|
|
7
|
+
import "./chunk-UJNY65QS.js";
|
|
8
|
+
import "./chunk-GILQUGFK.js";
|
|
9
|
+
import "./chunk-AVCWKYII.js";
|
|
10
|
+
import "./chunk-WHYJLDYG.js";
|
|
11
|
+
export {
|
|
12
|
+
MCP_CLI_HELP,
|
|
13
|
+
MCP_FLAG_SPECS,
|
|
14
|
+
parseMcpCliOptions,
|
|
15
|
+
runMcpCli
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=mcp-cli-SJVOGRA6.js.map
|
package/docs/README.md
CHANGED
|
@@ -15,6 +15,7 @@ This directory holds the long-form documentation. The root README is intentional
|
|
|
15
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
|
+
| [`browser.md`](./browser.md) | Static sites and browsers: build-time pre-rendering, and the prebuilt `<script src>` bundle. |
|
|
18
19
|
| [`ascii.md`](./ascii.md) | Terminal output, ASCII vs Unicode, color modes, XY charts. |
|
|
19
20
|
| [`config.md`](./config.md) | `mermaidConfig`, YAML frontmatter, and init directives. |
|
|
20
21
|
| [`features.md`](./features.md) | Capability inventory. |
|
package/docs/browser.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Browser and static sites
|
|
2
|
+
|
|
3
|
+
Two supported ways to get a diagram onto a web page. Pick by one question: **is
|
|
4
|
+
the diagram source known before the page is served?**
|
|
5
|
+
|
|
6
|
+
| Your case | Use | JS shipped |
|
|
7
|
+
|---|---|---|
|
|
8
|
+
| Source is fixed at publish time — blog post, docs page, README | [Pre-render at build time](#pre-render-at-build-time) | none |
|
|
9
|
+
| Source is authored or edited in the page — editor, playground, user input | [Browser bundle](#browser-bundle) | ~873 KB gzip |
|
|
10
|
+
|
|
11
|
+
Most sites are the first row. `renderMermaidSVG` is synchronous and needs no DOM,
|
|
12
|
+
so a static site never has to ship the renderer to a reader.
|
|
13
|
+
|
|
14
|
+
## Pre-render at build time
|
|
15
|
+
|
|
16
|
+
Call the library from whatever already builds your site. Emit one SVG per theme
|
|
17
|
+
and let CSS choose, so a theme toggle is instant and needs no re-render:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
// scripts/render-diagrams.ts
|
|
21
|
+
import { writeFileSync } from 'node:fs'
|
|
22
|
+
import { renderMermaidSVG } from 'agentic-mermaid'
|
|
23
|
+
|
|
24
|
+
const source = `timeline
|
|
25
|
+
title History of Social Media
|
|
26
|
+
2002 : LinkedIn
|
|
27
|
+
2004 : Facebook : Google
|
|
28
|
+
2006 : Twitter`
|
|
29
|
+
|
|
30
|
+
const light = renderMermaidSVG(source, { style: 'zinc-light' })
|
|
31
|
+
const dark = renderMermaidSVG(source, { style: 'zinc-dark' })
|
|
32
|
+
|
|
33
|
+
writeFileSync(
|
|
34
|
+
'dist/timeline.html',
|
|
35
|
+
`<div class="diagram">
|
|
36
|
+
<div class="diagram-light">${light}</div>
|
|
37
|
+
<div class="diagram-dark">${dark}</div>
|
|
38
|
+
</div>`,
|
|
39
|
+
)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```css
|
|
43
|
+
.diagram-dark { display: none }
|
|
44
|
+
.dark .diagram-light { display: none } /* `.dark` = your dark-mode class */
|
|
45
|
+
.dark .diagram-dark { display: block }
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Or from the CLI, with no build script at all:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
am render diagram.mmd --format svg --style zinc-light --output dist/diagram-light.svg
|
|
52
|
+
am render diagram.mmd --format svg --style zinc-dark --output dist/diagram-dark.svg
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Either way the reader downloads two inline SVGs rather than a renderer, so the
|
|
56
|
+
diagram still shows up with JavaScript disabled and inside an RSS reader.
|
|
57
|
+
|
|
58
|
+
## Browser bundle
|
|
59
|
+
|
|
60
|
+
When the source is not known until the page runs, load the prebuilt IIFE. The
|
|
61
|
+
ESM entry would need a bundler or an import map; this file needs neither:
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<script
|
|
65
|
+
src="https://unpkg.com/agentic-mermaid@0.3.0/dist/browser.global.js"
|
|
66
|
+
integrity="sha384-YcMQSsCGfs4ZfuWkYNET2L2z0f+YNPJftR5krUhTWrHDQ9cUcsRRp5ux5zbBYKd9"
|
|
67
|
+
crossorigin="anonymous"></script>
|
|
68
|
+
<script>
|
|
69
|
+
const svg = agenticMermaid.renderMermaidSVG('timeline\n title Roadmap\n 2026 : Ship', {
|
|
70
|
+
style: 'zinc-dark',
|
|
71
|
+
security: 'strict',
|
|
72
|
+
})
|
|
73
|
+
const parsed = new DOMParser().parseFromString(svg, 'image/svg+xml')
|
|
74
|
+
if (parsed.querySelector('parsererror') || parsed.documentElement.localName !== 'svg') {
|
|
75
|
+
throw new Error('renderer returned invalid SVG')
|
|
76
|
+
}
|
|
77
|
+
document.querySelector('#diagram').replaceChildren(
|
|
78
|
+
document.importNode(parsed.documentElement, true),
|
|
79
|
+
)
|
|
80
|
+
</script>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The global is **`agenticMermaid`** and carries the same render surface as the
|
|
84
|
+
package entry — `renderMermaidSVG`, `renderMermaidASCII`, style helpers.
|
|
85
|
+
|
|
86
|
+
Keep `security: 'strict'` for authored or user-provided source, and insert the
|
|
87
|
+
accepted result as parsed XML nodes as shown above. Do not assign renderer output
|
|
88
|
+
to `innerHTML`: strict rendering and DOM insertion are separate trust boundaries.
|
|
89
|
+
The integrity value pins the reviewed bytes as well as the version. When the
|
|
90
|
+
package version changes, recompute it with:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
openssl dgst -sha384 -binary dist/browser.global.js | openssl base64 -A
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
For a strict Content Security Policy, either self-host the bundle under
|
|
97
|
+
`script-src 'self'` or allow the pinned CDN origin (for example
|
|
98
|
+
`script-src 'self' https://unpkg.com`). Put the initializer in an external
|
|
99
|
+
same-origin file, or authorize it with a nonce or hash; do not add
|
|
100
|
+
`'unsafe-inline'` just for this example.
|
|
101
|
+
|
|
102
|
+
**The bundle ships from v0.3.0.** Earlier releases are ESM-only and have no
|
|
103
|
+
`dist/browser.global.js`, so an unversioned CDN URL 404s against them. Pin the
|
|
104
|
+
version as above rather than tracking `latest`: it fixes that, and it stops a
|
|
105
|
+
future major from changing the file under a page you are not watching.
|
|
106
|
+
|
|
107
|
+
### Browser support
|
|
108
|
+
|
|
109
|
+
**Chrome 97, Firefox 104, Safari 15.4, Edge 97** and newer.
|
|
110
|
+
|
|
111
|
+
`Array.prototype.findLast` sets that floor. It is a runtime method, so lowering
|
|
112
|
+
the build target will not help: esbuild rewrites syntax and leaves method calls
|
|
113
|
+
as they are. The bundle also calls `Array.prototype.at`, `Object.hasOwn`, and
|
|
114
|
+
`String.prototype.replaceAll`, all of which ship earlier than `findLast`. To
|
|
115
|
+
support older browsers, load polyfills for those four before the bundle.
|
|
116
|
+
|
|
117
|
+
CI runs the contract against the current Playwright Chromium, Firefox, and
|
|
118
|
+
WebKit engines. The historical version floors above are derived from runtime API
|
|
119
|
+
availability; this project does not execute those legacy browser releases in CI.
|
|
120
|
+
|
|
121
|
+
The bundle contains no WebAssembly and makes no network request at load, so it
|
|
122
|
+
works offline and needs no cross-origin isolation.
|
|
123
|
+
|
|
124
|
+
**If you already run a bundler, do not use this file.** Import the package
|
|
125
|
+
normally; your bundler will tree-shake, which the IIFE cannot:
|
|
126
|
+
|
|
127
|
+
```js
|
|
128
|
+
import { renderMermaidSVG } from 'agentic-mermaid'
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Weight
|
|
132
|
+
|
|
133
|
+
`dist/browser.global.js` is 2.85 MB raw, **873 KB gzip**. Most of that is the ELK
|
|
134
|
+
layout engine. Because a page whose diagrams never change pays that cost on every
|
|
135
|
+
cold visit for nothing, the build-time path above is the recommendation.
|
|
136
|
+
|
|
137
|
+
### Self-hosting it
|
|
138
|
+
|
|
139
|
+
unpkg and jsDelivr already do the right thing. If you serve the file yourself,
|
|
140
|
+
send `Content-Type: text/javascript; charset=utf-8`, and compress it — 2.85 MB
|
|
141
|
+
uncompressed against 873 KB gzipped is the difference your readers pay.
|
|
142
|
+
|
|
143
|
+
Declare the encoding in at least one of the two places. The bundle contains
|
|
144
|
+
non-ASCII characters inside a Unicode character class, and a classic
|
|
145
|
+
`<script src>` whose response omits `charset` is decoded using the host
|
|
146
|
+
document's encoding. If neither the response nor the page says UTF-8, the
|
|
147
|
+
browser picks a legacy encoding and the file throws
|
|
148
|
+
|
|
149
|
+
```txt
|
|
150
|
+
SyntaxError: Invalid regular expression: Range out of order in character class
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
before any of your code runs, with nothing in the stack trace pointing at the
|
|
154
|
+
encoding. A page with `<meta charset="utf-8">` is already safe; a hand-written
|
|
155
|
+
page with no `<head>` metadata is the one that breaks.
|
|
156
|
+
|
|
157
|
+
### Rolling your own bundle
|
|
158
|
+
|
|
159
|
+
You should not need to. If you do, two traps fail quietly enough to cost an
|
|
160
|
+
afternoon:
|
|
161
|
+
|
|
162
|
+
- **Do not combine `--global-name=X` with `window.X = …` in your entry file.**
|
|
163
|
+
esbuild emits `var X = (() => { … })()`, and at top-level script scope that
|
|
164
|
+
`var` *is* `window.X`. Your assignment runs first, then the IIFE's return
|
|
165
|
+
value — `undefined`, if your entry exports nothing — overwrites it. The build
|
|
166
|
+
succeeds and the global is empty. Use `export * from 'agentic-mermaid'` in the
|
|
167
|
+
entry and let `--global-name` do the work.
|
|
168
|
+
- **`dist/` is a build artifact and is not in the git repository.** Install from
|
|
169
|
+
npm, or run `bun install && bun run build` in a clone before pointing a
|
|
170
|
+
bundler at `dist/`.
|
|
171
|
+
|
|
172
|
+
## Coming from Beautiful Mermaid
|
|
173
|
+
|
|
174
|
+
Upstream's `THEMES` export does not exist here; it was replaced by the composable
|
|
175
|
+
Style/Palette system. The theme names survive as style names:
|
|
176
|
+
|
|
177
|
+
```js
|
|
178
|
+
renderMermaidSVG(src, THEMES['zinc-dark']) // upstream
|
|
179
|
+
renderMermaidSVG(src, { style: 'zinc-dark' }) // Agentic Mermaid
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
See [`fork-differences.md`](./fork-differences.md) for the full list of
|
|
183
|
+
divergences, and [`theming.md`](./theming.md) for the Style model.
|
package/docs/fork-differences.md
CHANGED
|
@@ -56,6 +56,39 @@ renderMermaidSVG(source, {
|
|
|
56
56
|
|
|
57
57
|
A style chooses the renderer treatment — for example `hand-drawn`, `watercolor`, `publication-figure`, or `ops-schematic`. A palette-only style chooses colors — for example `github-light`, `dracula`, or a custom JSON record with `colors`. Stacks merge left to right, so agents can keep visual requests out of Mermaid source while preserving deterministic geometry.
|
|
58
58
|
|
|
59
|
+
## Migrating from upstream: every export this fork does not have
|
|
60
|
+
|
|
61
|
+
Upstream Beautiful Mermaid's entry point exports 16 names. Ten are still
|
|
62
|
+
exported here with the same meaning: `renderMermaidSVG`, `renderMermaidASCII`,
|
|
63
|
+
`renderMermaidSVGAsync`, `fromShikiTheme`, `DEFAULTS`, and the `RenderOptions`,
|
|
64
|
+
`AsciiRenderOptions`, `DiagramColors`, `MermaidGraph`, and `PositionedGraph`
|
|
65
|
+
types.
|
|
66
|
+
|
|
67
|
+
These six are not, and each fails differently. `THEMES` is the one that bites
|
|
68
|
+
hardest, because destructuring it yields `undefined` rather than an import
|
|
69
|
+
error, so the failure lands later and elsewhere.
|
|
70
|
+
|
|
71
|
+
| Upstream | Replacement | Notes |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `THEMES` | `{ style: 'name' }` | Theme **names** survive as style names; the map does not. `THEMES['zinc-dark']` → `{ style: 'zinc-dark' }`. |
|
|
74
|
+
| `ThemeName` | `string`, validated by `knownStyles()` | Style names are open — custom styles register at runtime — so there is no closed union to import. |
|
|
75
|
+
| `parseMermaid` | `parseRegisteredMermaid` | **Different shape.** Upstream returns a `MermaidGraph` directly; this returns a result: `{ ok: true, value }` or `{ ok: false, error }`. Check `ok` instead of catching. |
|
|
76
|
+
| `renderMermaid` | `renderMermaidSVGAsync` | Upstream alias for the async SVG renderer. |
|
|
77
|
+
| `renderMermaidSync` | `renderMermaidSVG` | Upstream alias; `renderMermaidSVG` is already synchronous here. |
|
|
78
|
+
| `renderMermaidAscii` | `renderMermaidASCII` | Casing-only alias upstream. This fork exports the capitalised spelling only. |
|
|
79
|
+
|
|
80
|
+
So a `THEMES` port fails at runtime with `TypeError: Cannot read properties of
|
|
81
|
+
undefined (reading 'zinc-dark')`, while `parseMermaid` fails at import — and the
|
|
82
|
+
three aliases fail at import too, which is the easy case.
|
|
83
|
+
|
|
84
|
+
`zinc-light`, `zinc-dark`, `dracula`, `nord`, `tokyo-night`, and the rest of the
|
|
85
|
+
upstream theme names are all valid style names; `knownStyles()` lists every
|
|
86
|
+
registered one.
|
|
87
|
+
|
|
88
|
+
`src/__tests__/upstream-export-migration.test.ts` keeps this table honest: it
|
|
89
|
+
reads upstream's own type declarations and fails if an upstream export is
|
|
90
|
+
neither exported here nor documented above.
|
|
91
|
+
|
|
59
92
|
## Mermaid config and source wrappers
|
|
60
93
|
|
|
61
94
|
This fork supports Mermaid-style source wrappers before diagram headers, including:
|
package/docs/style-authoring.md
CHANGED
|
@@ -260,7 +260,7 @@ contract explicitly; no built-in compatibility default is borrowed by
|
|
|
260
260
|
```ts
|
|
261
261
|
registerBackend(backend, {
|
|
262
262
|
version: '1.0.0',
|
|
263
|
-
compatibility: { core: '^0.
|
|
263
|
+
compatibility: { core: '^0.3.0', scene: '^2.0.0' },
|
|
264
264
|
provenance: { owner: 'acme-diagrams', source: 'application-startup' },
|
|
265
265
|
})
|
|
266
266
|
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-mermaid",
|
|
3
3
|
"mcpName": "io.github.adewale/agentic-mermaid",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Agentic Mermaid: render, verify, and safely edit Mermaid diagrams as ASCII, PNG, SVG, or structured agent workflows — with composable styles (hand-drawn, excalidraw, watercolor, or your own as JSON).",
|
|
7
7
|
"type": "module",
|
|
@@ -23,9 +23,12 @@
|
|
|
23
23
|
"import": "./dist/agent-core.js",
|
|
24
24
|
"default": "./dist/agent-core.js"
|
|
25
25
|
},
|
|
26
|
+
"./browser": "./dist/browser.global.js",
|
|
26
27
|
"./style-spec.schema.json": "./docs/schemas/style-spec.schema.json",
|
|
27
28
|
"./package.json": "./package.json"
|
|
28
29
|
},
|
|
30
|
+
"unpkg": "./dist/browser.global.js",
|
|
31
|
+
"jsdelivr": "./dist/browser.global.js",
|
|
29
32
|
"bin": {
|
|
30
33
|
"am": "dist/am.js",
|
|
31
34
|
"agentic-mermaid": "dist/am.js",
|
|
@@ -118,14 +121,15 @@
|
|
|
118
121
|
"benchmark:palette:check": "bun run eval/palette-performance/run.ts --check",
|
|
119
122
|
"harvest:upstream": "bun run eval/mermaid-upstream-suite-bench/harvest.ts",
|
|
120
123
|
"harvest:upstream:refresh-check": "bun run eval/mermaid-upstream-suite-bench/refresh-check.ts",
|
|
121
|
-
"build": "tsup",
|
|
124
|
+
"build": "tsup && bun run build:browser",
|
|
125
|
+
"build:browser": "tsup --config tsup.browser.config.ts",
|
|
122
126
|
"build:binary": "bun build ./bin/am.ts --compile --outfile dist/am",
|
|
123
127
|
"website": "bun run website/build.ts",
|
|
124
128
|
"website:check": "bun run website/build.ts --check",
|
|
125
129
|
"website:payload:write": "bun run scripts/site/website-payload-report.ts --write",
|
|
126
130
|
"website:payload:check": "bun run scripts/site/website-payload-report.ts --check",
|
|
127
131
|
"website:dev": "cd website && WRANGLER_SEND_METRICS=false npx --yes wrangler@latest dev --port 9095 --ip 127.0.0.1",
|
|
128
|
-
"deploy": "bun run website && cd website && WRANGLER_SEND_METRICS=false npx --yes wrangler@latest deploy",
|
|
132
|
+
"deploy": "bun run build && bun run website && cd website && WRANGLER_SEND_METRICS=false npx --yes wrangler@latest deploy",
|
|
129
133
|
"prepublishOnly": "npm run build",
|
|
130
134
|
"goldens:ascii": "bun run scripts/update-ascii-goldens.ts",
|
|
131
135
|
"goldens:ascii:check": "bun run scripts/update-ascii-goldens.ts --check",
|
|
@@ -190,7 +194,7 @@
|
|
|
190
194
|
"yaml": "^2.8.3"
|
|
191
195
|
},
|
|
192
196
|
"overrides": {
|
|
193
|
-
"brace-expansion": "5.0.
|
|
197
|
+
"brace-expansion": "5.0.8",
|
|
194
198
|
"esbuild": "0.28.1",
|
|
195
199
|
"fast-uri": "3.1.4",
|
|
196
200
|
"lodash-es": "4.18.1",
|
package/server.json
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"url": "https://github.com/adewale/agentic-mermaid",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.3.0",
|
|
11
11
|
"websiteUrl": "https://agentic-mermaid.dev/",
|
|
12
12
|
"packages": [
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "agentic-mermaid",
|
|
16
|
-
"version": "0.
|
|
16
|
+
"version": "0.3.0",
|
|
17
17
|
"runtimeHint": "npx",
|
|
18
18
|
"runtimeArguments": [
|
|
19
19
|
{
|
package/dist/mcp-cli-5J47WEY3.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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
|