agentic-mermaid 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/agent-core.d.ts +8 -3
  3. package/dist/agent-core.js +2 -2
  4. package/dist/agent.d.ts +2 -2
  5. package/dist/agent.js +4 -4
  6. package/dist/agentic-mermaid-mcp.js +5 -5
  7. package/dist/am.js +6 -6
  8. package/dist/browser-lazy/chunks/architecture-3CGEU363.js +31 -0
  9. package/dist/browser-lazy/chunks/chunk-2U4EUPSI.js +4 -0
  10. package/dist/browser-lazy/chunks/chunk-4IUBLBJJ.js +11 -0
  11. package/dist/browser-lazy/chunks/chunk-4U2TVB2S.js +1 -0
  12. package/dist/browser-lazy/chunks/chunk-5Q4S74UO.js +1 -0
  13. package/dist/browser-lazy/chunks/chunk-6UT2VTFI.js +1 -0
  14. package/dist/browser-lazy/chunks/chunk-7D24ZLOV.js +1 -0
  15. package/dist/browser-lazy/chunks/chunk-A7L4WWVW.js +143 -0
  16. package/dist/browser-lazy/chunks/chunk-CTVVJPMX.js +24 -0
  17. package/dist/browser-lazy/chunks/chunk-DPSSG7LR.js +4 -0
  18. package/dist/browser-lazy/chunks/chunk-EPFMQPXX.js +1 -0
  19. package/dist/browser-lazy/chunks/chunk-FFOHLPDA.js +2 -0
  20. package/dist/browser-lazy/chunks/chunk-FLD63DXE.js +2 -0
  21. package/dist/browser-lazy/chunks/chunk-FXBBGAMJ.js +46 -0
  22. package/dist/browser-lazy/chunks/chunk-GRXCKTHX.js +0 -0
  23. package/dist/browser-lazy/chunks/chunk-HZ4ADQMK.js +1 -0
  24. package/dist/browser-lazy/chunks/chunk-I6VE56S7.js +1 -0
  25. package/dist/browser-lazy/chunks/chunk-JX5ZZY3T.js +1 -0
  26. package/dist/browser-lazy/chunks/chunk-KJVNXJ5Y.js +1 -0
  27. package/dist/browser-lazy/chunks/chunk-KTTWXSIX.js +1 -0
  28. package/dist/browser-lazy/chunks/chunk-M6BT2HIP.js +1 -0
  29. package/dist/browser-lazy/chunks/chunk-MMWVZP6M.js +1 -0
  30. package/dist/browser-lazy/chunks/chunk-OFRMKQA6.js +1 -0
  31. package/dist/browser-lazy/chunks/chunk-P7HMSKHJ.js +1 -0
  32. package/dist/browser-lazy/chunks/chunk-PXRUFH7U.js +1 -0
  33. package/dist/browser-lazy/chunks/chunk-PZEWZT35.js +1 -0
  34. package/dist/browser-lazy/chunks/chunk-RVO6J7S3.js +1 -0
  35. package/dist/browser-lazy/chunks/chunk-STQRDZ67.js +1 -0
  36. package/dist/browser-lazy/chunks/chunk-T7IJ6V4B.js +3 -0
  37. package/dist/browser-lazy/chunks/chunk-VDTSULBU.js +7 -0
  38. package/dist/browser-lazy/chunks/chunk-WEUWIFG3.js +1 -0
  39. package/dist/browser-lazy/chunks/class-B3AVLSIF.js +9 -0
  40. package/dist/browser-lazy/chunks/er-AF4BKKKC.js +9 -0
  41. package/dist/browser-lazy/chunks/flowchart-BE6BQZLZ.js +4 -0
  42. package/dist/browser-lazy/chunks/gantt-U4BMMSEL.js +28 -0
  43. package/dist/browser-lazy/chunks/gitgraph-UPSWNFRP.js +8 -0
  44. package/dist/browser-lazy/chunks/journey-PDZ7FDJR.js +40 -0
  45. package/dist/browser-lazy/chunks/mindmap-BFEUURLS.js +9 -0
  46. package/dist/browser-lazy/chunks/pie-ZFYW5JZO.js +19 -0
  47. package/dist/browser-lazy/chunks/quadrant-XJVEYYXK.js +24 -0
  48. package/dist/browser-lazy/chunks/radar-OVXFNRNC.js +32 -0
  49. package/dist/browser-lazy/chunks/render-core-R4ZGGEFS.js +12 -0
  50. package/dist/browser-lazy/chunks/sequence-AWY6JCSB.js +12 -0
  51. package/dist/browser-lazy/chunks/state-TCE4DXKR.js +4 -0
  52. package/dist/browser-lazy/chunks/timeline-W4ZVT3FF.js +20 -0
  53. package/dist/browser-lazy/chunks/xychart-K3QQACKS.js +36 -0
  54. package/dist/browser-lazy/index.d.ts +1012 -0
  55. package/dist/browser-lazy/index.js +1 -0
  56. package/dist/browser.global.js +778 -0
  57. package/dist/{chunk-MYPDVZCO.js → chunk-BSVM3VMO.js} +18 -5
  58. package/dist/{chunk-2P5FKUQC.js → chunk-FGO3J7RA.js} +7 -7
  59. package/dist/{chunk-2SILJDW2.js → chunk-JJ7JRYZV.js} +2 -2
  60. package/dist/{chunk-2S3VSS6I.js → chunk-KQMJ37OY.js} +4 -4
  61. package/dist/{chunk-FDM43XU7.js → chunk-MBIR6S3B.js} +2 -2
  62. package/dist/{chunk-BJYMBT4I.js → chunk-XVY324NY.js} +47701 -47630
  63. package/dist/{index-DWPa2MJs.d.ts → index-Do8z5rPq.d.ts} +5409 -5391
  64. package/dist/index.d.ts +1 -1
  65. package/dist/index.js +1 -1
  66. package/dist/mcp-cli-7FLGTEG3.js +17 -0
  67. package/docs/README.md +1 -0
  68. package/docs/browser.md +491 -0
  69. package/docs/fork-differences.md +33 -0
  70. package/docs/style-authoring.md +1 -1
  71. package/package.json +19 -5
  72. package/server.json +2 -2
  73. package/dist/mcp-cli-5J47WEY3.js +0 -17
@@ -93,7 +93,7 @@ import {
93
93
  visualWidth,
94
94
  wcagCssContrastRatio,
95
95
  wrapperPrefix
96
- } from "./chunk-BJYMBT4I.js";
96
+ } from "./chunk-XVY324NY.js";
97
97
 
98
98
  // src/agent/trace-log.ts
99
99
  var appendFn;
@@ -685,10 +685,11 @@ function applyOneMutation(d, op) {
685
685
  if (!r.ok) return r;
686
686
  const bodyAccessibility = accessibilityFromBody(r.value);
687
687
  const meta = bodyAccessibility === void 0 ? d.meta : { ...d.meta, accessibility: bodyAccessibility };
688
- const canonicalSource = wrapperPrefix(meta) + ensureAccessibilityLines(
688
+ const bodySource = ensureAccessibilityLines(
689
689
  plugin.serialize(r.value),
690
690
  meta.accessibility
691
691
  );
692
+ const canonicalSource = wrapperPrefix(meta, "verbatim", bodySource) + bodySource;
692
693
  const reparsed = parseRegisteredMermaid(canonicalSource);
693
694
  if (!reparsed.ok) {
694
695
  return err({
@@ -696,7 +697,19 @@ function applyOneMutation(d, op) {
696
697
  message: `Mutation produced source that could not be reparsed: ${reparsed.error.map((error) => error.message).join("; ")}`
697
698
  });
698
699
  }
699
- return ok({ ...d, body: r.value, meta, canonicalSource, source: reparsed.value.source });
700
+ return ok({
701
+ ...d,
702
+ body: r.value,
703
+ meta: {
704
+ ...reparsed.value.meta,
705
+ // This receipt describes loss from the originally parsed artifact.
706
+ // Reparsing the already-canonical mutation output cannot rediscover a
707
+ // comment that structured serialization intentionally omitted.
708
+ ...d.meta.droppedComments ? { droppedComments: d.meta.droppedComments } : {}
709
+ },
710
+ canonicalSource,
711
+ source: reparsed.value.source
712
+ });
700
713
  }
701
714
  return err({ code: "INVALID_OP", message: `Unsupported mutable diagram kind: ${d.kind}` });
702
715
  }
@@ -1179,7 +1192,7 @@ function evaluateBrandConstraints(scene, request) {
1179
1192
  // src/agent/verify.ts
1180
1193
  function familyConfigShapeWarnings(d) {
1181
1194
  const roots = [d.meta.frontmatter, ...d.meta.initDirectives.map((directive) => directive.parsed)];
1182
- return familyConfigDiagnostics(d.kind, roots);
1195
+ return familyConfigDiagnostics(d.kind, roots, getFamily(d.kind)?.config);
1183
1196
  }
1184
1197
  var KNOWN_SHAPES = /* @__PURE__ */ new Set([
1185
1198
  "rectangle",
@@ -4699,4 +4712,4 @@ export {
4699
4712
  layoutMermaidWithReceipt,
4700
4713
  layoutMermaid
4701
4714
  };
4702
- //# sourceMappingURL=chunk-MYPDVZCO.js.map
4715
+ //# sourceMappingURL=chunk-BSVM3VMO.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  projectKnownRenderErrorDiagnostic,
3
3
  projectRenderErrorDiagnostic
4
- } from "./chunk-2SILJDW2.js";
4
+ } from "./chunk-JJ7JRYZV.js";
5
5
  import {
6
6
  renderMermaidPNG,
7
7
  renderMermaidPNGWithReceipt
8
- } from "./chunk-FDM43XU7.js";
8
+ } from "./chunk-MBIR6S3B.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-MYPDVZCO.js";
34
+ } from "./chunk-BSVM3VMO.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-BJYMBT4I.js";
74
+ } from "./chunk-XVY324NY.js";
75
75
 
76
76
  // src/mcp/server.ts
77
77
  import { randomUUID as randomUUID2 } from "crypto";
@@ -1923,8 +1923,8 @@ interface ValidDiagram {
1923
1923
  frontmatter?: Record<string, unknown>
1924
1924
  initDirectives: { raw: string; parsed: Record<string, unknown> }[]
1925
1925
  comments: { text: string; line: number }[]
1926
- wrapperSource?: string
1927
- droppedComments?: { text: string; line: number }[]
1926
+ wrapperSource?: string // exact bytes before the family header; parsed diagrams always set it, even as ''
1927
+ droppedComments?: { text: string; line: number }[] // line indexes the artifact the loss happened in, not canonicalSource
1928
1928
  accessibility: { title?: string; descr?: string }
1929
1929
  }
1930
1930
  readonly body:
@@ -3482,4 +3482,4 @@ export {
3482
3482
  parseMcpCliOptions,
3483
3483
  runMcpCli
3484
3484
  };
3485
- //# sourceMappingURL=chunk-2P5FKUQC.js.map
3485
+ //# sourceMappingURL=chunk-FGO3J7RA.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  AsciiWidthError,
3
3
  MermaidFamilyDetectionError
4
- } from "./chunk-BJYMBT4I.js";
4
+ } from "./chunk-XVY324NY.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-2SILJDW2.js.map
37
+ //# sourceMappingURL=chunk-JJ7JRYZV.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  renderMermaidPNG
3
- } from "./chunk-FDM43XU7.js";
3
+ } from "./chunk-MBIR6S3B.js";
4
4
  import {
5
5
  collectActionRecords,
6
6
  layoutMermaid,
7
7
  renderMermaidASCIIWithMeta,
8
8
  renderMermaidSVG
9
- } from "./chunk-MYPDVZCO.js";
9
+ } from "./chunk-BSVM3VMO.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-BJYMBT4I.js";
18
+ } from "./chunk-XVY324NY.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-2S3VSS6I.js.map
149
+ //# sourceMappingURL=chunk-KQMJ37OY.js.map
@@ -13,7 +13,7 @@ import {
13
13
  renderPngGraphicalProjection,
14
14
  snapshotHostBackendPolicy,
15
15
  snapshotResourceManifest
16
- } from "./chunk-BJYMBT4I.js";
16
+ } from "./chunk-XVY324NY.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-FDM43XU7.js.map
615
+ //# sourceMappingURL=chunk-MBIR6S3B.js.map