@legionworks/facet 1.9.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.
Files changed (327) hide show
  1. package/LICENSE-APACHE +202 -0
  2. package/LICENSE-MIT +23 -0
  3. package/README.md +158 -0
  4. package/dist/gallery/chunk-4g8rem85.css +656 -0
  5. package/dist/gallery/chunk-c6s9k9ty.js +5970 -0
  6. package/dist/gallery/frame/artifact.css +8424 -0
  7. package/dist/gallery/frame/chunks/abnfDiagram-N423BO3Z-jj74szbm.js +155 -0
  8. package/dist/gallery/frame/chunks/architecture-TIHT7OUA-cvdjn7dt.js +10 -0
  9. package/dist/gallery/frame/chunks/architectureDiagram-T3A2C74G-n4z77eg6.js +8675 -0
  10. package/dist/gallery/frame/chunks/blockDiagram-VBNYF7ZC-7xsqzrd1.js +3529 -0
  11. package/dist/gallery/frame/chunks/c4Diagram-5PPSVZJV-z2zjs7wx.js +2413 -0
  12. package/dist/gallery/frame/chunks/classDiagram-JCYQIIEL-ve8rngqp.js +47 -0
  13. package/dist/gallery/frame/chunks/classDiagram-v2-OCEON4UE-8cfaxb8z.js +47 -0
  14. package/dist/gallery/frame/chunks/cose-bilkent-JH36ORCC-sn92qexx.js +4822 -0
  15. package/dist/gallery/frame/chunks/cynefin-VYW2F7L2-tqjv913d.js +10 -0
  16. package/dist/gallery/frame/chunks/cynefinDiagram-MW4NZA55-c1c0dj12.js +500 -0
  17. package/dist/gallery/frame/chunks/dagre-VZM6K2ZE-7tyg4yt2.js +476 -0
  18. package/dist/gallery/frame/chunks/diagram-7IWD3JNH-y4eng9sc.js +526 -0
  19. package/dist/gallery/frame/chunks/diagram-B4RE2ZJO-rn3p7j5h.js +673 -0
  20. package/dist/gallery/frame/chunks/diagram-LBJQPF4R-w4a2cm9q.js +255 -0
  21. package/dist/gallery/frame/chunks/diagram-Q27KOJAE-aqc2v7wy.js +575 -0
  22. package/dist/gallery/frame/chunks/diagram-UB23O5K3-xncy8nyd.js +355 -0
  23. package/dist/gallery/frame/chunks/ebnfDiagram-BXEA7PRR-acwgxz16.js +175 -0
  24. package/dist/gallery/frame/chunks/erDiagram-JOGREHBK-mzp5nswt.js +1332 -0
  25. package/dist/gallery/frame/chunks/eventmodeling-45OFAUF4-sg07qr0c.js +10 -0
  26. package/dist/gallery/frame/chunks/flowDiagram-UKHOOZJN-2e5ygs44.js +29 -0
  27. package/dist/gallery/frame/chunks/ganttDiagram-PKOTCBZU-p2hhh7hr.js +2620 -0
  28. package/dist/gallery/frame/chunks/gitGraph-TEB2WS4Q-j6kw0naa.js +10 -0
  29. package/dist/gallery/frame/chunks/gitGraphDiagram-DS77QQ5N-4z9z8wjm.js +1347 -0
  30. package/dist/gallery/frame/chunks/info-DKCQHKI2-mpt80jd3.js +10 -0
  31. package/dist/gallery/frame/chunks/infoDiagram-6WML65LV-5rqm3mgg.js +65 -0
  32. package/dist/gallery/frame/chunks/ishikawaDiagram-WSZJBQD7-b51z96jy.js +975 -0
  33. package/dist/gallery/frame/chunks/journeyDiagram-NVQOT4AX-9jbfp0pk.js +1272 -0
  34. package/dist/gallery/frame/chunks/kanban-definition-27J2QSJJ-4x0vx4se.js +1116 -0
  35. package/dist/gallery/frame/chunks/katex-xfgk95tv.js +14034 -0
  36. package/dist/gallery/frame/chunks/markdown-1s5vwkf2.js +9 -0
  37. package/dist/gallery/frame/chunks/markdown-2h6bwsms.js +3239 -0
  38. package/dist/gallery/frame/chunks/markdown-2x113yh8.js +107 -0
  39. package/dist/gallery/frame/chunks/markdown-30b7rwmp.js +1943 -0
  40. package/dist/gallery/frame/chunks/markdown-356bfj4g.js +2031 -0
  41. package/dist/gallery/frame/chunks/markdown-44n9ea69.js +2406 -0
  42. package/dist/gallery/frame/chunks/markdown-56enrf2r.js +39 -0
  43. package/dist/gallery/frame/chunks/markdown-5avymm8t.js +725 -0
  44. package/dist/gallery/frame/chunks/markdown-6r4svars.js +33 -0
  45. package/dist/gallery/frame/chunks/markdown-6zz8efx2.js +24 -0
  46. package/dist/gallery/frame/chunks/markdown-7jp6prnb.js +19 -0
  47. package/dist/gallery/frame/chunks/markdown-809k7q41.js +55 -0
  48. package/dist/gallery/frame/chunks/markdown-82xmzhzd.js +1076 -0
  49. package/dist/gallery/frame/chunks/markdown-92n37gd4.js +7627 -0
  50. package/dist/gallery/frame/chunks/markdown-ag2sssf8.js +36 -0
  51. package/dist/gallery/frame/chunks/markdown-b4s7ntq2.js +19 -0
  52. package/dist/gallery/frame/chunks/markdown-c9k0fvp1.js +100 -0
  53. package/dist/gallery/frame/chunks/markdown-ceefymn8.js +125 -0
  54. package/dist/gallery/frame/chunks/markdown-d1wfbs70.js +243 -0
  55. package/dist/gallery/frame/chunks/markdown-dy5sgjhc.js +11022 -0
  56. package/dist/gallery/frame/chunks/markdown-dz3z5w30.js +30868 -0
  57. package/dist/gallery/frame/chunks/markdown-eg6ngz7y.js +30340 -0
  58. package/dist/gallery/frame/chunks/markdown-ff5wvb43.js +1149 -0
  59. package/dist/gallery/frame/chunks/markdown-ffg06nfz.js +86 -0
  60. package/dist/gallery/frame/chunks/markdown-fvfncadf.js +472 -0
  61. package/dist/gallery/frame/chunks/markdown-gvyszqpv.js +19 -0
  62. package/dist/gallery/frame/chunks/markdown-gx1p0ew0.js +88 -0
  63. package/dist/gallery/frame/chunks/markdown-gxye5frz.js +65 -0
  64. package/dist/gallery/frame/chunks/markdown-h7pzv34e.js +105 -0
  65. package/dist/gallery/frame/chunks/markdown-hab789t9.js +47 -0
  66. package/dist/gallery/frame/chunks/markdown-hjp6sj8t.js +125 -0
  67. package/dist/gallery/frame/chunks/markdown-jka64qgp.js +1993 -0
  68. package/dist/gallery/frame/chunks/markdown-k8xkn8mw.js +56 -0
  69. package/dist/gallery/frame/chunks/markdown-m7frq8x8.js +112 -0
  70. package/dist/gallery/frame/chunks/markdown-p740v4qm.js +36 -0
  71. package/dist/gallery/frame/chunks/markdown-pxfeh231.js +57 -0
  72. package/dist/gallery/frame/chunks/markdown-pzgd8z3s.js +87 -0
  73. package/dist/gallery/frame/chunks/markdown-qx3cngz2.js +1673 -0
  74. package/dist/gallery/frame/chunks/markdown-rawhfvvc.js +85 -0
  75. package/dist/gallery/frame/chunks/markdown-rd8w0ng9.js +49 -0
  76. package/dist/gallery/frame/chunks/markdown-rm2yxfjj.js +2773 -0
  77. package/dist/gallery/frame/chunks/markdown-s1jatrnk.js +993 -0
  78. package/dist/gallery/frame/chunks/markdown-sgfg5vvq.js +59 -0
  79. package/dist/gallery/frame/chunks/markdown-t4ethv9d.js +409 -0
  80. package/dist/gallery/frame/chunks/markdown-tnmabqvz.js +36 -0
  81. package/dist/gallery/frame/chunks/markdown-tvdpppw8.js +5292 -0
  82. package/dist/gallery/frame/chunks/markdown-v0x27twr.js +22 -0
  83. package/dist/gallery/frame/chunks/markdown-v14td68x.js +36 -0
  84. package/dist/gallery/frame/chunks/markdown-w6sgd54z.js +36 -0
  85. package/dist/gallery/frame/chunks/markdown-xw8dsk8b.js +2125 -0
  86. package/dist/gallery/frame/chunks/markdown-y18mve73.js +85 -0
  87. package/dist/gallery/frame/chunks/markdown-yengsms5.js +427 -0
  88. package/dist/gallery/frame/chunks/markdown-z1wc0v0d.js +1826 -0
  89. package/dist/gallery/frame/chunks/markdown-zazx9h4n.js +329 -0
  90. package/dist/gallery/frame/chunks/mermaid-de7p4v0x.js +30 -0
  91. package/dist/gallery/frame/chunks/mindmap-definition-FAOFIHXS-ra44cbem.js +1216 -0
  92. package/dist/gallery/frame/chunks/packet-7NZHBO7P-xppm5913.js +10 -0
  93. package/dist/gallery/frame/chunks/pegDiagram-VL7TDLO6-a2a4wg03.js +163 -0
  94. package/dist/gallery/frame/chunks/pie-RZYD4A2V-hnbxk152.js +10 -0
  95. package/dist/gallery/frame/chunks/pieDiagram-7S7Q4E2Y-f1vxjtmx.js +311 -0
  96. package/dist/gallery/frame/chunks/quadrantDiagram-CIZ2JOQS-ywafa6kh.js +1390 -0
  97. package/dist/gallery/frame/chunks/radar-I7S5WNFK-ewqd27se.js +10 -0
  98. package/dist/gallery/frame/chunks/railroad-3IZDKUUU-5hy4bdx3.js +10 -0
  99. package/dist/gallery/frame/chunks/railroad-abnf-AHOZXSZD-bh5sxz0d.js +10 -0
  100. package/dist/gallery/frame/chunks/railroad-ebnf-EBAXGLYW-6b9c3zeh.js +10 -0
  101. package/dist/gallery/frame/chunks/railroad-peg-LSFZ7HO6-avc8v39s.js +10 -0
  102. package/dist/gallery/frame/chunks/railroadDiagram-AXF67PYL-qc61wax4.js +131 -0
  103. package/dist/gallery/frame/chunks/requirementDiagram-LRYGKXZP-9bs4786c.js +1295 -0
  104. package/dist/gallery/frame/chunks/sankeyDiagram-W5VNT64P-awt1em8b.js +1339 -0
  105. package/dist/gallery/frame/chunks/sequenceDiagram-SI44F4Z6-qaf9mz3t.js +4324 -0
  106. package/dist/gallery/frame/chunks/sizeCapture-X5ZJPWSS-9fq685xd.js +64 -0
  107. package/dist/gallery/frame/chunks/stateDiagram-OKZ733FA-vx7a7hh0.js +456 -0
  108. package/dist/gallery/frame/chunks/stateDiagram-v2-UEYNNEHI-x4m6ws5t.js +46 -0
  109. package/dist/gallery/frame/chunks/swimlanes-SLNWSIFB-e4mxm1gh.js +8287 -0
  110. package/dist/gallery/frame/chunks/swimlanesDiagram-ULZ7WXOC-0h93e2qq.js +42 -0
  111. package/dist/gallery/frame/chunks/timeline-definition-Z64GVDOM-wp0bhbzg.js +1549 -0
  112. package/dist/gallery/frame/chunks/treeView-QDETBFTQ-hcx7n0vt.js +10 -0
  113. package/dist/gallery/frame/chunks/treemap-6X3UGDF4-av02skdw.js +10 -0
  114. package/dist/gallery/frame/chunks/vennDiagram-T6HMQDX7-pmvk1p7n.js +2566 -0
  115. package/dist/gallery/frame/chunks/wardley-OPB4EBWU-njsp6e40.js +10 -0
  116. package/dist/gallery/frame/chunks/wardleyDiagram-T6FBY63Y-eggmnv4z.js +979 -0
  117. package/dist/gallery/frame/chunks/xychartDiagram-ELKLHX3M-q40tnpe5.js +1954 -0
  118. package/dist/gallery/frame/frame.css +183 -0
  119. package/dist/gallery/frame/runtime/chart.js +42744 -0
  120. package/dist/gallery/frame/runtime/html.js +14 -0
  121. package/dist/gallery/frame/runtime/markdown.js +1403 -0
  122. package/dist/gallery/frame/runtime/mermaid.js +32 -0
  123. package/dist/gallery/frame/runtime/svg.js +14 -0
  124. package/dist/gallery/frame/runtime/tsx.js +52 -0
  125. package/dist/gallery/index.html +104 -0
  126. package/docs/reference/cli.md +163 -0
  127. package/docs/reference/export.md +106 -0
  128. package/docs/reference/html.md +215 -0
  129. package/docs/reference/http.md +85 -0
  130. package/docs/reference/mcp.md +78 -0
  131. package/docs/reference/security.md +119 -0
  132. package/docs/reference/storage.md +93 -0
  133. package/docs/reference/tsx.md +101 -0
  134. package/docs/reference/validation.md +212 -0
  135. package/package.json +89 -0
  136. package/scripts/build-gallery.ts +127 -0
  137. package/scripts/launch-netns.sh +67 -0
  138. package/skills/facet/SKILL.md +100 -0
  139. package/src/cli/client.ts +311 -0
  140. package/src/cli/commands/create.ts +49 -0
  141. package/src/cli/commands/doctor.ts +249 -0
  142. package/src/cli/commands/export.ts +179 -0
  143. package/src/cli/commands/instantiate.ts +35 -0
  144. package/src/cli/commands/list.ts +49 -0
  145. package/src/cli/commands/open.ts +75 -0
  146. package/src/cli/commands/pin.ts +39 -0
  147. package/src/cli/commands/promote.ts +49 -0
  148. package/src/cli/commands/publish.ts +122 -0
  149. package/src/cli/commands/read-back.ts +56 -0
  150. package/src/cli/commands/status.ts +114 -0
  151. package/src/cli/commands/watch.ts +146 -0
  152. package/src/cli/main.ts +522 -0
  153. package/src/cli/output.ts +106 -0
  154. package/src/cli/parser.ts +376 -0
  155. package/src/cli/presenter.ts +212 -0
  156. package/src/cli/service-metadata.ts +134 -0
  157. package/src/cli/spawn-service.ts +326 -0
  158. package/src/css.d.ts +4 -0
  159. package/src/gallery-web/app.ts +1581 -0
  160. package/src/gallery-web/export-menu.ts +121 -0
  161. package/src/gallery-web/export.ts +112 -0
  162. package/src/gallery-web/favicon.ts +54 -0
  163. package/src/gallery-web/frame/entries/chart.ts +6 -0
  164. package/src/gallery-web/frame/entries/html.ts +6 -0
  165. package/src/gallery-web/frame/entries/markdown.ts +6 -0
  166. package/src/gallery-web/frame/entries/mermaid.ts +6 -0
  167. package/src/gallery-web/frame/entries/svg.ts +6 -0
  168. package/src/gallery-web/frame/entries/tsx.ts +6 -0
  169. package/src/gallery-web/frame/frame-payload.ts +91 -0
  170. package/src/gallery-web/frame/renderer-validation.ts +13 -0
  171. package/src/gallery-web/frame/renderers/chart.ts +182 -0
  172. package/src/gallery-web/frame/renderers/dompurify-shim.ts +112 -0
  173. package/src/gallery-web/frame/renderers/html.ts +48 -0
  174. package/src/gallery-web/frame/renderers/markdown.ts +81 -0
  175. package/src/gallery-web/frame/renderers/mermaid.ts +120 -0
  176. package/src/gallery-web/frame/renderers/registry.ts +260 -0
  177. package/src/gallery-web/frame/renderers/svg.ts +393 -0
  178. package/src/gallery-web/frame/renderers/tsx.ts +61 -0
  179. package/src/gallery-web/frame/runtime.ts +501 -0
  180. package/src/gallery-web/frame/styles/artifact.css +8424 -0
  181. package/src/gallery-web/frame/styles/frame.css +183 -0
  182. package/src/gallery-web/frame/styles/html-source.css +23 -0
  183. package/src/gallery-web/frame/view-box.ts +33 -0
  184. package/src/gallery-web/frame-html.ts +72 -0
  185. package/src/gallery-web/index.html +104 -0
  186. package/src/gallery-web/session.ts +107 -0
  187. package/src/gallery-web/sse-client.ts +212 -0
  188. package/src/gallery-web/styles/app.css +420 -0
  189. package/src/gallery-web/styles/tokens.css +112 -0
  190. package/src/gallery-web/styles/verdict.css +186 -0
  191. package/src/gallery-web/swap.ts +64 -0
  192. package/src/gallery-web/theme.ts +40 -0
  193. package/src/gallery-web/view-state.ts +93 -0
  194. package/src/harness-adapters/claude-code/README.md +10 -0
  195. package/src/harness-adapters/claude-code/facet.sh +4 -0
  196. package/src/harness-adapters/codex/README.md +10 -0
  197. package/src/harness-adapters/codex/facet.sh +4 -0
  198. package/src/harness-adapters/mcp/README.md +13 -0
  199. package/src/harness-adapters/mcp/cli-bridge.ts +216 -0
  200. package/src/harness-adapters/mcp/main.ts +15 -0
  201. package/src/harness-adapters/mcp/server.ts +164 -0
  202. package/src/harness-adapters/mcp/tool-schemas.ts +53 -0
  203. package/src/harness-adapters/opencode/README.md +10 -0
  204. package/src/harness-adapters/opencode/facet.sh +4 -0
  205. package/src/runtime/compiled-entrypoints.ts +69 -0
  206. package/src/service/dispatcher.ts +717 -0
  207. package/src/service/export.ts +218 -0
  208. package/src/service/http-utils.ts +55 -0
  209. package/src/service/lexical/expectations.ts +210 -0
  210. package/src/service/lifecycle/idle-controller.ts +125 -0
  211. package/src/service/lifecycle/orphan-cleanup.ts +128 -0
  212. package/src/service/lifecycle/process-lock.ts +235 -0
  213. package/src/service/main.ts +136 -0
  214. package/src/service/process.ts +240 -0
  215. package/src/service/router-guards.ts +239 -0
  216. package/src/service/router.ts +627 -0
  217. package/src/service/security/auth.ts +168 -0
  218. package/src/service/security/host-origin.ts +138 -0
  219. package/src/service/security/http-guards.ts +13 -0
  220. package/src/service/security/leases.ts +182 -0
  221. package/src/service/security/token-store.ts +138 -0
  222. package/src/service/server.ts +356 -0
  223. package/src/service/store/database.ts +61 -0
  224. package/src/service/store/evidence-retention.ts +234 -0
  225. package/src/service/store/migrations.ts +167 -0
  226. package/src/service/store/repository-lifecycle.ts +121 -0
  227. package/src/service/store/repository.ts +732 -0
  228. package/src/service/store/schema.ts +218 -0
  229. package/src/service/stored-verdict.ts +97 -0
  230. package/src/service/stream.ts +301 -0
  231. package/src/service/verdict-enrichment.ts +45 -0
  232. package/src/shared/build/frame-bundle-plugins.ts +61 -0
  233. package/src/shared/build-mode.ts +28 -0
  234. package/src/shared/config/evidence-read.ts +98 -0
  235. package/src/shared/config/limits.ts +56 -0
  236. package/src/shared/config/paths.ts +96 -0
  237. package/src/shared/contracts/artifact-types.ts +2 -0
  238. package/src/shared/contracts/artifact.ts +98 -0
  239. package/src/shared/contracts/commands/_shared.ts +59 -0
  240. package/src/shared/contracts/commands/guards.ts +86 -0
  241. package/src/shared/contracts/commands/index.ts +204 -0
  242. package/src/shared/contracts/commands/names.ts +35 -0
  243. package/src/shared/contracts/commands/requests.ts +149 -0
  244. package/src/shared/contracts/commands/results.ts +200 -0
  245. package/src/shared/contracts/envelope.ts +140 -0
  246. package/src/shared/contracts/events.ts +41 -0
  247. package/src/shared/contracts/observed-counts.ts +19 -0
  248. package/src/shared/contracts/renderers.ts +6 -0
  249. package/src/shared/contracts/validation.ts +296 -0
  250. package/src/shared/errors/facet-error.ts +127 -0
  251. package/src/shared/errors/store-error.ts +68 -0
  252. package/src/shared/evidence-image.ts +37 -0
  253. package/src/shared/export.ts +31 -0
  254. package/src/shared/html/policy.ts +108 -0
  255. package/src/shared/html/style-vocabulary.ts +352 -0
  256. package/src/shared/logging/logger.ts +108 -0
  257. package/src/shared/logging/redact.ts +49 -0
  258. package/src/shared/security/frozen-csp.ts +13 -0
  259. package/src/shared/storage-version.ts +2 -0
  260. package/src/shared/tsx/execution.ts +29 -0
  261. package/src/shared/tsx/import-policy.ts +94 -0
  262. package/src/shared/util/dir-permissions.ts +94 -0
  263. package/src/shared/util/mermaid-nodes.ts +230 -0
  264. package/src/shared/util/process.ts +67 -0
  265. package/src/shared/util/time.ts +21 -0
  266. package/src/shared/version.ts +3 -0
  267. package/src/validation/sandbox/limits.ts +41 -0
  268. package/src/validation/sandbox/netns.ts +177 -0
  269. package/src/validation/tier0/chart.ts +177 -0
  270. package/src/validation/tier0/dom-shim.ts +54 -0
  271. package/src/validation/tier0/html.ts +408 -0
  272. package/src/validation/tier0/markdown.ts +285 -0
  273. package/src/validation/tier0/mermaid.ts +98 -0
  274. package/src/validation/tier0/runner.ts +504 -0
  275. package/src/validation/tier0/svg.ts +321 -0
  276. package/src/validation/tier0/tsx/allowlist-resolver.ts +77 -0
  277. package/src/validation/tier0/tsx/ast-policy-capabilities.ts +238 -0
  278. package/src/validation/tier0/tsx/ast-policy-shared.ts +71 -0
  279. package/src/validation/tier0/tsx/ast-policy.ts +181 -0
  280. package/src/validation/tier0/tsx/compiler.ts +156 -0
  281. package/src/validation/tier0/worker-dispatch.ts +211 -0
  282. package/src/validation/tier0/worker-entry.ts +96 -0
  283. package/src/validation/tier0/worker-input.ts +75 -0
  284. package/src/validation/tier1/browser-process.ts +147 -0
  285. package/src/validation/tier1/cdp-pipe.ts +281 -0
  286. package/src/validation/tier1/entries/chart.ts +5 -0
  287. package/src/validation/tier1/entries/html.ts +6 -0
  288. package/src/validation/tier1/entries/markdown.ts +5 -0
  289. package/src/validation/tier1/entries/mermaid.ts +5 -0
  290. package/src/validation/tier1/entries/svg.ts +5 -0
  291. package/src/validation/tier1/entries/tsx.ts +5 -0
  292. package/src/validation/tier1/frame-target.ts +162 -0
  293. package/src/validation/tier1/harness-entry.ts +261 -0
  294. package/src/validation/tier1/harness.ts +215 -0
  295. package/src/validation/tier1/isolated-probe.ts +94 -0
  296. package/src/validation/tier1/launcher.ts +177 -0
  297. package/src/validation/tier1/limits.ts +80 -0
  298. package/src/validation/tier1/nonce.ts +17 -0
  299. package/src/validation/tier1/protocol-probe.ts +519 -0
  300. package/src/validation/tier1/runner.ts +1122 -0
  301. package/src/validation/tier1/verdict.ts +246 -0
  302. package/src/validation/tier1/webp.ts +69 -0
  303. package/templates/README.md +88 -0
  304. package/templates/bar-compare.vl.json +63 -0
  305. package/templates/capacity-report.tsx +102 -0
  306. package/templates/decision-record.md +24 -0
  307. package/templates/deployment-state.mmd +40 -0
  308. package/templates/exemplar.md +91 -0
  309. package/templates/facet-story.tsx +799 -0
  310. package/templates/fleet-dashboard.html +141 -0
  311. package/templates/html-release-ledger.html +91 -0
  312. package/templates/html-status-report.html +114 -0
  313. package/templates/incident-console.tsx +147 -0
  314. package/templates/legion-boundaries.mmd +23 -0
  315. package/templates/legion-flow.mmd +15 -0
  316. package/templates/legion-sequence.mmd +14 -0
  317. package/templates/legion-state.mmd +7 -0
  318. package/templates/metric-card.svg +29 -0
  319. package/templates/observability-map.svg +101 -0
  320. package/templates/pipeline-audit.md +108 -0
  321. package/templates/release-metrics.vl.json +98 -0
  322. package/templates/service-topology.mmd +47 -0
  323. package/templates/status-report.md +32 -0
  324. package/templates/system-map.svg +53 -0
  325. package/templates/timeseries.vl.json +71 -0
  326. package/templates/tsx-interactive-counter.tsx +19 -0
  327. package/templates/tsx-status-report.tsx +31 -0
@@ -0,0 +1,1116 @@
1
+ import {
2
+ getIconStyles
3
+ } from "./markdown-v0x27twr.js";
4
+ import {
5
+ selectSvgElement
6
+ } from "./markdown-6zz8efx2.js";
7
+ import {
8
+ JSON_SCHEMA,
9
+ load
10
+ } from "./markdown-rm2yxfjj.js";
11
+ import {
12
+ insertCluster,
13
+ insertNode,
14
+ positionNode
15
+ } from "./markdown-tvdpppw8.js";
16
+ import"./markdown-sgfg5vvq.js";
17
+ import"./markdown-82xmzhzd.js";
18
+ import"./markdown-c9k0fvp1.js";
19
+ import"./markdown-qx3cngz2.js";
20
+ import"./markdown-yengsms5.js";
21
+ import"./markdown-ff5wvb43.js";
22
+ import"./markdown-pzgd8z3s.js";
23
+ import {
24
+ darken_default,
25
+ defaultConfig_default,
26
+ getConfig2,
27
+ is_dark_default,
28
+ lighten_default,
29
+ sanitizeText,
30
+ setupGraphViewbox
31
+ } from "./markdown-92n37gd4.js";
32
+ import {
33
+ log
34
+ } from "./markdown-xw8dsk8b.js";
35
+ import {
36
+ __name
37
+ } from "./markdown-1s5vwkf2.js";
38
+ import"./markdown-dy5sgjhc.js";
39
+ import"./markdown-809k7q41.js";
40
+
41
+ // node_modules/mermaid/dist/chunks/mermaid.core/kanban-definition-27J2QSJJ.mjs
42
+ var parser = function() {
43
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
44
+ for (o2 = o2 || {}, l = k.length;l--; o2[k[l]] = v)
45
+ ;
46
+ return o2;
47
+ }, "o"), $V0 = [1, 4], $V1 = [1, 13], $V2 = [1, 12], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 20], $V6 = [1, 19], $V7 = [6, 7, 8], $V8 = [1, 26], $V9 = [1, 24], $Va = [1, 25], $Vb = [6, 7, 11], $Vc = [1, 31], $Vd = [6, 7, 11, 24], $Ve = [1, 6, 13, 16, 17, 20, 23], $Vf = [1, 35], $Vg = [1, 36], $Vh = [1, 6, 7, 11, 13, 16, 17, 20, 23], $Vi = [1, 38];
48
+ var parser2 = {
49
+ trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
50
+ yy: {},
51
+ symbols_: { error: 2, start: 3, mindMap: 4, spaceLines: 5, SPACELINE: 6, NL: 7, KANBAN: 8, document: 9, stop: 10, EOF: 11, statement: 12, SPACELIST: 13, node: 14, shapeData: 15, ICON: 16, CLASS: 17, nodeWithId: 18, nodeWithoutId: 19, NODE_DSTART: 20, NODE_DESCR: 21, NODE_DEND: 22, NODE_ID: 23, SHAPE_DATA: 24, $accept: 0, $end: 1 },
52
+ terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "KANBAN", 11: "EOF", 13: "SPACELIST", 16: "ICON", 17: "CLASS", 20: "NODE_DSTART", 21: "NODE_DESCR", 22: "NODE_DEND", 23: "NODE_ID", 24: "SHAPE_DATA" },
53
+ productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 3], [12, 2], [12, 2], [12, 2], [12, 1], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [14, 1], [14, 1], [19, 3], [18, 1], [18, 4], [15, 2], [15, 1]],
54
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
55
+ var $0 = $$.length - 1;
56
+ switch (yystate) {
57
+ case 6:
58
+ case 7:
59
+ return yy;
60
+ break;
61
+ case 8:
62
+ yy.getLogger().trace("Stop NL ");
63
+ break;
64
+ case 9:
65
+ yy.getLogger().trace("Stop EOF ");
66
+ break;
67
+ case 11:
68
+ yy.getLogger().trace("Stop NL2 ");
69
+ break;
70
+ case 12:
71
+ yy.getLogger().trace("Stop EOF2 ");
72
+ break;
73
+ case 15:
74
+ yy.getLogger().info("Node: ", $$[$0 - 1].id);
75
+ yy.addNode($$[$0 - 2].length, $$[$0 - 1].id, $$[$0 - 1].descr, $$[$0 - 1].type, $$[$0]);
76
+ break;
77
+ case 16:
78
+ yy.getLogger().info("Node: ", $$[$0].id);
79
+ yy.addNode($$[$0 - 1].length, $$[$0].id, $$[$0].descr, $$[$0].type);
80
+ break;
81
+ case 17:
82
+ yy.getLogger().trace("Icon: ", $$[$0]);
83
+ yy.decorateNode({ icon: $$[$0] });
84
+ break;
85
+ case 18:
86
+ case 23:
87
+ yy.decorateNode({ class: $$[$0] });
88
+ break;
89
+ case 19:
90
+ yy.getLogger().trace("SPACELIST");
91
+ break;
92
+ case 20:
93
+ yy.getLogger().trace("Node: ", $$[$0 - 1].id);
94
+ yy.addNode(0, $$[$0 - 1].id, $$[$0 - 1].descr, $$[$0 - 1].type, $$[$0]);
95
+ break;
96
+ case 21:
97
+ yy.getLogger().trace("Node: ", $$[$0].id);
98
+ yy.addNode(0, $$[$0].id, $$[$0].descr, $$[$0].type);
99
+ break;
100
+ case 22:
101
+ yy.decorateNode({ icon: $$[$0] });
102
+ break;
103
+ case 27:
104
+ yy.getLogger().trace("node found ..", $$[$0 - 2]);
105
+ this.$ = { id: $$[$0 - 1], descr: $$[$0 - 1], type: yy.getType($$[$0 - 2], $$[$0]) };
106
+ break;
107
+ case 28:
108
+ this.$ = { id: $$[$0], descr: $$[$0], type: 0 };
109
+ break;
110
+ case 29:
111
+ yy.getLogger().trace("node found ..", $$[$0 - 3]);
112
+ this.$ = { id: $$[$0 - 3], descr: $$[$0 - 1], type: yy.getType($$[$0 - 2], $$[$0]) };
113
+ break;
114
+ case 30:
115
+ this.$ = $$[$0 - 1] + $$[$0];
116
+ break;
117
+ case 31:
118
+ this.$ = $$[$0];
119
+ break;
120
+ }
121
+ }, "anonymous"),
122
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: $V0 }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: $V0 }, { 6: $V1, 7: [1, 10], 9: 9, 12: 11, 13: $V2, 14: 14, 16: $V3, 17: $V4, 18: 17, 19: 18, 20: $V5, 23: $V6 }, o($V7, [2, 3]), { 1: [2, 2] }, o($V7, [2, 4]), o($V7, [2, 5]), { 1: [2, 6], 6: $V1, 12: 21, 13: $V2, 14: 14, 16: $V3, 17: $V4, 18: 17, 19: 18, 20: $V5, 23: $V6 }, { 6: $V1, 9: 22, 12: 11, 13: $V2, 14: 14, 16: $V3, 17: $V4, 18: 17, 19: 18, 20: $V5, 23: $V6 }, { 6: $V8, 7: $V9, 10: 23, 11: $Va }, o($Vb, [2, 24], { 18: 17, 19: 18, 14: 27, 16: [1, 28], 17: [1, 29], 20: $V5, 23: $V6 }), o($Vb, [2, 19]), o($Vb, [2, 21], { 15: 30, 24: $Vc }), o($Vb, [2, 22]), o($Vb, [2, 23]), o($Vd, [2, 25]), o($Vd, [2, 26]), o($Vd, [2, 28], { 20: [1, 32] }), { 21: [1, 33] }, { 6: $V8, 7: $V9, 10: 34, 11: $Va }, { 1: [2, 7], 6: $V1, 12: 21, 13: $V2, 14: 14, 16: $V3, 17: $V4, 18: 17, 19: 18, 20: $V5, 23: $V6 }, o($Ve, [2, 14], { 7: $Vf, 11: $Vg }), o($Vh, [2, 8]), o($Vh, [2, 9]), o($Vh, [2, 10]), o($Vb, [2, 16], { 15: 37, 24: $Vc }), o($Vb, [2, 17]), o($Vb, [2, 18]), o($Vb, [2, 20], { 24: $Vi }), o($Vd, [2, 31]), { 21: [1, 39] }, { 22: [1, 40] }, o($Ve, [2, 13], { 7: $Vf, 11: $Vg }), o($Vh, [2, 11]), o($Vh, [2, 12]), o($Vb, [2, 15], { 24: $Vi }), o($Vd, [2, 30]), { 22: [1, 41] }, o($Vd, [2, 27]), o($Vd, [2, 29])],
123
+ defaultActions: { 2: [2, 1], 6: [2, 2] },
124
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
125
+ if (hash.recoverable) {
126
+ this.trace(str);
127
+ } else {
128
+ var error = new Error(str);
129
+ error.hash = hash;
130
+ throw error;
131
+ }
132
+ }, "parseError"),
133
+ parse: /* @__PURE__ */ __name(function parse(input) {
134
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
135
+ var args = lstack.slice.call(arguments, 1);
136
+ var lexer2 = Object.create(this.lexer);
137
+ var sharedState = { yy: {} };
138
+ for (var k in this.yy) {
139
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
140
+ sharedState.yy[k] = this.yy[k];
141
+ }
142
+ }
143
+ lexer2.setInput(input, sharedState.yy);
144
+ sharedState.yy.lexer = lexer2;
145
+ sharedState.yy.parser = this;
146
+ if (typeof lexer2.yylloc == "undefined") {
147
+ lexer2.yylloc = {};
148
+ }
149
+ var yyloc = lexer2.yylloc;
150
+ lstack.push(yyloc);
151
+ var ranges = lexer2.options && lexer2.options.ranges;
152
+ if (typeof sharedState.yy.parseError === "function") {
153
+ this.parseError = sharedState.yy.parseError;
154
+ } else {
155
+ this.parseError = Object.getPrototypeOf(this).parseError;
156
+ }
157
+ function popStack(n) {
158
+ stack.length = stack.length - 2 * n;
159
+ vstack.length = vstack.length - n;
160
+ lstack.length = lstack.length - n;
161
+ }
162
+ __name(popStack, "popStack");
163
+ function lex() {
164
+ var token;
165
+ token = tstack.pop() || lexer2.lex() || EOF;
166
+ if (typeof token !== "number") {
167
+ if (token instanceof Array) {
168
+ tstack = token;
169
+ token = tstack.pop();
170
+ }
171
+ token = self.symbols_[token] || token;
172
+ }
173
+ return token;
174
+ }
175
+ __name(lex, "lex");
176
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
177
+ while (true) {
178
+ state = stack[stack.length - 1];
179
+ if (this.defaultActions[state]) {
180
+ action = this.defaultActions[state];
181
+ } else {
182
+ if (symbol === null || typeof symbol == "undefined") {
183
+ symbol = lex();
184
+ }
185
+ action = table[state] && table[state][symbol];
186
+ }
187
+ if (typeof action === "undefined" || !action.length || !action[0]) {
188
+ var errStr = "";
189
+ expected = [];
190
+ for (p in table[state]) {
191
+ if (this.terminals_[p] && p > TERROR) {
192
+ expected.push("'" + this.terminals_[p] + "'");
193
+ }
194
+ }
195
+ if (lexer2.showPosition) {
196
+ errStr = "Parse error on line " + (yylineno + 1) + `:
197
+ ` + lexer2.showPosition() + `
198
+ Expecting ` + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
199
+ } else {
200
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
201
+ }
202
+ this.parseError(errStr, {
203
+ text: lexer2.match,
204
+ token: this.terminals_[symbol] || symbol,
205
+ line: lexer2.yylineno,
206
+ loc: yyloc,
207
+ expected
208
+ });
209
+ }
210
+ if (action[0] instanceof Array && action.length > 1) {
211
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
212
+ }
213
+ switch (action[0]) {
214
+ case 1:
215
+ stack.push(symbol);
216
+ vstack.push(lexer2.yytext);
217
+ lstack.push(lexer2.yylloc);
218
+ stack.push(action[1]);
219
+ symbol = null;
220
+ if (!preErrorSymbol) {
221
+ yyleng = lexer2.yyleng;
222
+ yytext = lexer2.yytext;
223
+ yylineno = lexer2.yylineno;
224
+ yyloc = lexer2.yylloc;
225
+ if (recovering > 0) {
226
+ recovering--;
227
+ }
228
+ } else {
229
+ symbol = preErrorSymbol;
230
+ preErrorSymbol = null;
231
+ }
232
+ break;
233
+ case 2:
234
+ len = this.productions_[action[1]][1];
235
+ yyval.$ = vstack[vstack.length - len];
236
+ yyval._$ = {
237
+ first_line: lstack[lstack.length - (len || 1)].first_line,
238
+ last_line: lstack[lstack.length - 1].last_line,
239
+ first_column: lstack[lstack.length - (len || 1)].first_column,
240
+ last_column: lstack[lstack.length - 1].last_column
241
+ };
242
+ if (ranges) {
243
+ yyval._$.range = [
244
+ lstack[lstack.length - (len || 1)].range[0],
245
+ lstack[lstack.length - 1].range[1]
246
+ ];
247
+ }
248
+ r = this.performAction.apply(yyval, [
249
+ yytext,
250
+ yyleng,
251
+ yylineno,
252
+ sharedState.yy,
253
+ action[1],
254
+ vstack,
255
+ lstack
256
+ ].concat(args));
257
+ if (typeof r !== "undefined") {
258
+ return r;
259
+ }
260
+ if (len) {
261
+ stack = stack.slice(0, -1 * len * 2);
262
+ vstack = vstack.slice(0, -1 * len);
263
+ lstack = lstack.slice(0, -1 * len);
264
+ }
265
+ stack.push(this.productions_[action[1]][0]);
266
+ vstack.push(yyval.$);
267
+ lstack.push(yyval._$);
268
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
269
+ stack.push(newState);
270
+ break;
271
+ case 3:
272
+ return true;
273
+ }
274
+ }
275
+ return true;
276
+ }, "parse")
277
+ };
278
+ var lexer = /* @__PURE__ */ function() {
279
+ var lexer2 = {
280
+ EOF: 1,
281
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
282
+ if (this.yy.parser) {
283
+ this.yy.parser.parseError(str, hash);
284
+ } else {
285
+ throw new Error(str);
286
+ }
287
+ }, "parseError"),
288
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
289
+ this.yy = yy || this.yy || {};
290
+ this._input = input;
291
+ this._more = this._backtrack = this.done = false;
292
+ this.yylineno = this.yyleng = 0;
293
+ this.yytext = this.matched = this.match = "";
294
+ this.conditionStack = ["INITIAL"];
295
+ this.yylloc = {
296
+ first_line: 1,
297
+ first_column: 0,
298
+ last_line: 1,
299
+ last_column: 0
300
+ };
301
+ if (this.options.ranges) {
302
+ this.yylloc.range = [0, 0];
303
+ }
304
+ this.offset = 0;
305
+ return this;
306
+ }, "setInput"),
307
+ input: /* @__PURE__ */ __name(function() {
308
+ var ch = this._input[0];
309
+ this.yytext += ch;
310
+ this.yyleng++;
311
+ this.offset++;
312
+ this.match += ch;
313
+ this.matched += ch;
314
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
315
+ if (lines) {
316
+ this.yylineno++;
317
+ this.yylloc.last_line++;
318
+ } else {
319
+ this.yylloc.last_column++;
320
+ }
321
+ if (this.options.ranges) {
322
+ this.yylloc.range[1]++;
323
+ }
324
+ this._input = this._input.slice(1);
325
+ return ch;
326
+ }, "input"),
327
+ unput: /* @__PURE__ */ __name(function(ch) {
328
+ var len = ch.length;
329
+ var lines = ch.split(/(?:\r\n?|\n)/g);
330
+ this._input = ch + this._input;
331
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
332
+ this.offset -= len;
333
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
334
+ this.match = this.match.substr(0, this.match.length - 1);
335
+ this.matched = this.matched.substr(0, this.matched.length - 1);
336
+ if (lines.length - 1) {
337
+ this.yylineno -= lines.length - 1;
338
+ }
339
+ var r = this.yylloc.range;
340
+ this.yylloc = {
341
+ first_line: this.yylloc.first_line,
342
+ last_line: this.yylineno + 1,
343
+ first_column: this.yylloc.first_column,
344
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
345
+ };
346
+ if (this.options.ranges) {
347
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
348
+ }
349
+ this.yyleng = this.yytext.length;
350
+ return this;
351
+ }, "unput"),
352
+ more: /* @__PURE__ */ __name(function() {
353
+ this._more = true;
354
+ return this;
355
+ }, "more"),
356
+ reject: /* @__PURE__ */ __name(function() {
357
+ if (this.options.backtrack_lexer) {
358
+ this._backtrack = true;
359
+ } else {
360
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
361
+ ` + this.showPosition(), {
362
+ text: "",
363
+ token: null,
364
+ line: this.yylineno
365
+ });
366
+ }
367
+ return this;
368
+ }, "reject"),
369
+ less: /* @__PURE__ */ __name(function(n) {
370
+ this.unput(this.match.slice(n));
371
+ }, "less"),
372
+ pastInput: /* @__PURE__ */ __name(function() {
373
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
374
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
375
+ }, "pastInput"),
376
+ upcomingInput: /* @__PURE__ */ __name(function() {
377
+ var next = this.match;
378
+ if (next.length < 20) {
379
+ next += this._input.substr(0, 20 - next.length);
380
+ }
381
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
382
+ }, "upcomingInput"),
383
+ showPosition: /* @__PURE__ */ __name(function() {
384
+ var pre = this.pastInput();
385
+ var c = new Array(pre.length + 1).join("-");
386
+ return pre + this.upcomingInput() + `
387
+ ` + c + "^";
388
+ }, "showPosition"),
389
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
390
+ var token, lines, backup;
391
+ if (this.options.backtrack_lexer) {
392
+ backup = {
393
+ yylineno: this.yylineno,
394
+ yylloc: {
395
+ first_line: this.yylloc.first_line,
396
+ last_line: this.last_line,
397
+ first_column: this.yylloc.first_column,
398
+ last_column: this.yylloc.last_column
399
+ },
400
+ yytext: this.yytext,
401
+ match: this.match,
402
+ matches: this.matches,
403
+ matched: this.matched,
404
+ yyleng: this.yyleng,
405
+ offset: this.offset,
406
+ _more: this._more,
407
+ _input: this._input,
408
+ yy: this.yy,
409
+ conditionStack: this.conditionStack.slice(0),
410
+ done: this.done
411
+ };
412
+ if (this.options.ranges) {
413
+ backup.yylloc.range = this.yylloc.range.slice(0);
414
+ }
415
+ }
416
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
417
+ if (lines) {
418
+ this.yylineno += lines.length;
419
+ }
420
+ this.yylloc = {
421
+ first_line: this.yylloc.last_line,
422
+ last_line: this.yylineno + 1,
423
+ first_column: this.yylloc.last_column,
424
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
425
+ };
426
+ this.yytext += match[0];
427
+ this.match += match[0];
428
+ this.matches = match;
429
+ this.yyleng = this.yytext.length;
430
+ if (this.options.ranges) {
431
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
432
+ }
433
+ this._more = false;
434
+ this._backtrack = false;
435
+ this._input = this._input.slice(match[0].length);
436
+ this.matched += match[0];
437
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
438
+ if (this.done && this._input) {
439
+ this.done = false;
440
+ }
441
+ if (token) {
442
+ return token;
443
+ } else if (this._backtrack) {
444
+ for (var k in backup) {
445
+ this[k] = backup[k];
446
+ }
447
+ return false;
448
+ }
449
+ return false;
450
+ }, "test_match"),
451
+ next: /* @__PURE__ */ __name(function() {
452
+ if (this.done) {
453
+ return this.EOF;
454
+ }
455
+ if (!this._input) {
456
+ this.done = true;
457
+ }
458
+ var token, match, tempMatch, index;
459
+ if (!this._more) {
460
+ this.yytext = "";
461
+ this.match = "";
462
+ }
463
+ var rules = this._currentRules();
464
+ for (var i = 0;i < rules.length; i++) {
465
+ tempMatch = this._input.match(this.rules[rules[i]]);
466
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
467
+ match = tempMatch;
468
+ index = i;
469
+ if (this.options.backtrack_lexer) {
470
+ token = this.test_match(tempMatch, rules[i]);
471
+ if (token !== false) {
472
+ return token;
473
+ } else if (this._backtrack) {
474
+ match = false;
475
+ continue;
476
+ } else {
477
+ return false;
478
+ }
479
+ } else if (!this.options.flex) {
480
+ break;
481
+ }
482
+ }
483
+ }
484
+ if (match) {
485
+ token = this.test_match(match, rules[index]);
486
+ if (token !== false) {
487
+ return token;
488
+ }
489
+ return false;
490
+ }
491
+ if (this._input === "") {
492
+ return this.EOF;
493
+ } else {
494
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
495
+ ` + this.showPosition(), {
496
+ text: "",
497
+ token: null,
498
+ line: this.yylineno
499
+ });
500
+ }
501
+ }, "next"),
502
+ lex: /* @__PURE__ */ __name(function lex() {
503
+ var r = this.next();
504
+ if (r) {
505
+ return r;
506
+ } else {
507
+ return this.lex();
508
+ }
509
+ }, "lex"),
510
+ begin: /* @__PURE__ */ __name(function begin(condition) {
511
+ this.conditionStack.push(condition);
512
+ }, "begin"),
513
+ popState: /* @__PURE__ */ __name(function popState() {
514
+ var n = this.conditionStack.length - 1;
515
+ if (n > 0) {
516
+ return this.conditionStack.pop();
517
+ } else {
518
+ return this.conditionStack[0];
519
+ }
520
+ }, "popState"),
521
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
522
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
523
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
524
+ } else {
525
+ return this.conditions["INITIAL"].rules;
526
+ }
527
+ }, "_currentRules"),
528
+ topState: /* @__PURE__ */ __name(function topState(n) {
529
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
530
+ if (n >= 0) {
531
+ return this.conditionStack[n];
532
+ } else {
533
+ return "INITIAL";
534
+ }
535
+ }, "topState"),
536
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
537
+ this.begin(condition);
538
+ }, "pushState"),
539
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
540
+ return this.conditionStack.length;
541
+ }, "stateStackSize"),
542
+ options: { "case-insensitive": true },
543
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
544
+ var YYSTATE = YY_START;
545
+ switch ($avoiding_name_collisions) {
546
+ case 0:
547
+ this.pushState("shapeData");
548
+ yy_.yytext = "";
549
+ return 24;
550
+ break;
551
+ case 1:
552
+ this.pushState("shapeDataStr");
553
+ return 24;
554
+ break;
555
+ case 2:
556
+ this.popState();
557
+ return 24;
558
+ break;
559
+ case 3:
560
+ const re = /\n\s*/g;
561
+ yy_.yytext = yy_.yytext.replace(re, "<br/>");
562
+ return 24;
563
+ break;
564
+ case 4:
565
+ return 24;
566
+ break;
567
+ case 5:
568
+ this.popState();
569
+ break;
570
+ case 6:
571
+ yy.getLogger().trace("Found comment", yy_.yytext);
572
+ return 6;
573
+ break;
574
+ case 7:
575
+ return 8;
576
+ break;
577
+ case 8:
578
+ this.begin("CLASS");
579
+ break;
580
+ case 9:
581
+ this.popState();
582
+ return 17;
583
+ break;
584
+ case 10:
585
+ this.popState();
586
+ break;
587
+ case 11:
588
+ yy.getLogger().trace("Begin icon");
589
+ this.begin("ICON");
590
+ break;
591
+ case 12:
592
+ yy.getLogger().trace("SPACELINE");
593
+ return 6;
594
+ break;
595
+ case 13:
596
+ return 7;
597
+ break;
598
+ case 14:
599
+ return 16;
600
+ break;
601
+ case 15:
602
+ yy.getLogger().trace("end icon");
603
+ this.popState();
604
+ break;
605
+ case 16:
606
+ yy.getLogger().trace("Exploding node");
607
+ this.begin("NODE");
608
+ return 20;
609
+ break;
610
+ case 17:
611
+ yy.getLogger().trace("Cloud");
612
+ this.begin("NODE");
613
+ return 20;
614
+ break;
615
+ case 18:
616
+ yy.getLogger().trace("Explosion Bang");
617
+ this.begin("NODE");
618
+ return 20;
619
+ break;
620
+ case 19:
621
+ yy.getLogger().trace("Cloud Bang");
622
+ this.begin("NODE");
623
+ return 20;
624
+ break;
625
+ case 20:
626
+ this.begin("NODE");
627
+ return 20;
628
+ break;
629
+ case 21:
630
+ this.begin("NODE");
631
+ return 20;
632
+ break;
633
+ case 22:
634
+ this.begin("NODE");
635
+ return 20;
636
+ break;
637
+ case 23:
638
+ this.begin("NODE");
639
+ return 20;
640
+ break;
641
+ case 24:
642
+ return 13;
643
+ break;
644
+ case 25:
645
+ return 23;
646
+ break;
647
+ case 26:
648
+ return 11;
649
+ break;
650
+ case 27:
651
+ this.begin("NSTR2");
652
+ break;
653
+ case 28:
654
+ return "NODE_DESCR";
655
+ break;
656
+ case 29:
657
+ this.popState();
658
+ break;
659
+ case 30:
660
+ yy.getLogger().trace("Starting NSTR");
661
+ this.begin("NSTR");
662
+ break;
663
+ case 31:
664
+ yy.getLogger().trace("description:", yy_.yytext);
665
+ return "NODE_DESCR";
666
+ break;
667
+ case 32:
668
+ this.popState();
669
+ break;
670
+ case 33:
671
+ this.popState();
672
+ yy.getLogger().trace("node end ))");
673
+ return "NODE_DEND";
674
+ break;
675
+ case 34:
676
+ this.popState();
677
+ yy.getLogger().trace("node end )");
678
+ return "NODE_DEND";
679
+ break;
680
+ case 35:
681
+ this.popState();
682
+ yy.getLogger().trace("node end ...", yy_.yytext);
683
+ return "NODE_DEND";
684
+ break;
685
+ case 36:
686
+ this.popState();
687
+ yy.getLogger().trace("node end ((");
688
+ return "NODE_DEND";
689
+ break;
690
+ case 37:
691
+ this.popState();
692
+ yy.getLogger().trace("node end (-");
693
+ return "NODE_DEND";
694
+ break;
695
+ case 38:
696
+ this.popState();
697
+ yy.getLogger().trace("node end (-");
698
+ return "NODE_DEND";
699
+ break;
700
+ case 39:
701
+ this.popState();
702
+ yy.getLogger().trace("node end ((");
703
+ return "NODE_DEND";
704
+ break;
705
+ case 40:
706
+ this.popState();
707
+ yy.getLogger().trace("node end ((");
708
+ return "NODE_DEND";
709
+ break;
710
+ case 41:
711
+ yy.getLogger().trace("Long description:", yy_.yytext);
712
+ return 21;
713
+ break;
714
+ case 42:
715
+ yy.getLogger().trace("Long description:", yy_.yytext);
716
+ return 21;
717
+ break;
718
+ }
719
+ }, "anonymous"),
720
+ rules: [/^(?:@\{)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^\"]+)/i, /^(?:[^}^"]+)/i, /^(?:\})/i, /^(?:\s*%%.*)/i, /^(?:kanban\b)/i, /^(?::::)/i, /^(?:.+)/i, /^(?:\n)/i, /^(?:::icon\()/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[^\)]+)/i, /^(?:\))/i, /^(?:-\))/i, /^(?:\(-)/i, /^(?:\)\))/i, /^(?:\))/i, /^(?:\(\()/i, /^(?:\{\{)/i, /^(?:\()/i, /^(?:\[)/i, /^(?:[\s]+)/i, /^(?:[^\(\[\n\)\{\}@]+)/i, /^(?:$)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:[^"]+)/i, /^(?:["])/i, /^(?:[\)]\))/i, /^(?:[\)])/i, /^(?:[\]])/i, /^(?:\}\})/i, /^(?:\(-)/i, /^(?:-\))/i, /^(?:\(\()/i, /^(?:\()/i, /^(?:[^\)\]\(\}]+)/i, /^(?:.+(?!\(\())/i],
721
+ conditions: { shapeDataEndBracket: { rules: [], inclusive: false }, shapeDataStr: { rules: [2, 3], inclusive: false }, shapeData: { rules: [1, 4, 5], inclusive: false }, CLASS: { rules: [9, 10], inclusive: false }, ICON: { rules: [14, 15], inclusive: false }, NSTR2: { rules: [28, 29], inclusive: false }, NSTR: { rules: [31, 32], inclusive: false }, NODE: { rules: [27, 30, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], inclusive: false }, INITIAL: { rules: [0, 6, 7, 8, 11, 12, 13, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26], inclusive: true } }
722
+ };
723
+ return lexer2;
724
+ }();
725
+ parser2.lexer = lexer;
726
+ function Parser() {
727
+ this.yy = {};
728
+ }
729
+ __name(Parser, "Parser");
730
+ Parser.prototype = parser2;
731
+ parser2.Parser = Parser;
732
+ return new Parser;
733
+ }();
734
+ parser.parser = parser;
735
+ var kanban_default = parser;
736
+ var nodes = [];
737
+ var sections = [];
738
+ var cnt = 0;
739
+ var elements = {};
740
+ var clear = /* @__PURE__ */ __name(() => {
741
+ nodes = [];
742
+ sections = [];
743
+ cnt = 0;
744
+ elements = {};
745
+ }, "clear");
746
+ var getSection = /* @__PURE__ */ __name((level) => {
747
+ if (nodes.length === 0) {
748
+ return null;
749
+ }
750
+ const sectionLevel = nodes[0].level;
751
+ let lastSection = null;
752
+ for (let i = nodes.length - 1;i >= 0; i--) {
753
+ if (nodes[i].level === sectionLevel && !lastSection) {
754
+ lastSection = nodes[i];
755
+ }
756
+ if (nodes[i].level < sectionLevel) {
757
+ throw new Error('Items without section detected, found section ("' + nodes[i].label + '")');
758
+ }
759
+ }
760
+ if (level === lastSection?.level) {
761
+ return null;
762
+ }
763
+ return lastSection;
764
+ }, "getSection");
765
+ var getSections = /* @__PURE__ */ __name(function() {
766
+ return sections;
767
+ }, "getSections");
768
+ var getData = /* @__PURE__ */ __name(function() {
769
+ const edges = [];
770
+ const _nodes = [];
771
+ const sections2 = getSections();
772
+ const conf = getConfig2();
773
+ for (const section of sections2) {
774
+ const node = {
775
+ id: section.id,
776
+ label: sanitizeText(section.label ?? "", conf),
777
+ labelType: "markdown",
778
+ isGroup: true,
779
+ ticket: section.ticket,
780
+ shape: "kanbanSection",
781
+ level: section.level,
782
+ look: conf.look
783
+ };
784
+ _nodes.push(node);
785
+ const children = nodes.filter((n) => n.parentId === section.id);
786
+ for (const item of children) {
787
+ const childNode = {
788
+ id: item.id,
789
+ parentId: section.id,
790
+ label: sanitizeText(item.label ?? "", conf),
791
+ labelType: "markdown",
792
+ isGroup: false,
793
+ ticket: item?.ticket,
794
+ priority: item?.priority,
795
+ assigned: item?.assigned,
796
+ icon: item?.icon,
797
+ shape: "kanbanItem",
798
+ level: item.level,
799
+ rx: 5,
800
+ ry: 5,
801
+ cssStyles: ["text-align: left"]
802
+ };
803
+ _nodes.push(childNode);
804
+ }
805
+ }
806
+ return { nodes: _nodes, edges, other: {}, config: getConfig2() };
807
+ }, "getData");
808
+ var addNode = /* @__PURE__ */ __name((level, id, descr, type, shapeData) => {
809
+ const conf = getConfig2();
810
+ let padding = conf.mindmap?.padding ?? defaultConfig_default.mindmap.padding;
811
+ switch (type) {
812
+ case nodeType.ROUNDED_RECT:
813
+ case nodeType.RECT:
814
+ case nodeType.HEXAGON:
815
+ padding *= 2;
816
+ }
817
+ const node = {
818
+ id: sanitizeText(id, conf) || "kbn" + cnt++,
819
+ level,
820
+ label: sanitizeText(descr, conf),
821
+ width: conf.mindmap?.maxNodeWidth ?? defaultConfig_default.mindmap.maxNodeWidth,
822
+ padding,
823
+ isGroup: false
824
+ };
825
+ if (shapeData !== undefined) {
826
+ let yamlData;
827
+ if (!shapeData.includes(`
828
+ `)) {
829
+ yamlData = `{
830
+ ` + shapeData + `
831
+ }`;
832
+ } else {
833
+ yamlData = shapeData + `
834
+ `;
835
+ }
836
+ const doc = load(yamlData, { schema: JSON_SCHEMA });
837
+ if (doc.shape && (doc.shape !== doc.shape.toLowerCase() || doc.shape.includes("_"))) {
838
+ throw new Error(`No such shape: ${doc.shape}. Shape names should be lowercase.`);
839
+ }
840
+ if (doc?.shape && doc.shape === "kanbanItem") {
841
+ node.shape = doc?.shape;
842
+ }
843
+ if (doc?.label) {
844
+ node.label = doc?.label;
845
+ }
846
+ if (doc?.icon) {
847
+ node.icon = doc?.icon.toString();
848
+ }
849
+ if (doc?.assigned) {
850
+ node.assigned = doc?.assigned.toString();
851
+ }
852
+ if (doc?.ticket) {
853
+ node.ticket = doc?.ticket.toString();
854
+ }
855
+ if (doc?.priority) {
856
+ node.priority = doc?.priority;
857
+ }
858
+ }
859
+ const section = getSection(level);
860
+ if (section) {
861
+ node.parentId = section.id || "kbn" + cnt++;
862
+ } else {
863
+ sections.push(node);
864
+ }
865
+ nodes.push(node);
866
+ }, "addNode");
867
+ var nodeType = {
868
+ DEFAULT: 0,
869
+ NO_BORDER: 0,
870
+ ROUNDED_RECT: 1,
871
+ RECT: 2,
872
+ CIRCLE: 3,
873
+ CLOUD: 4,
874
+ BANG: 5,
875
+ HEXAGON: 6
876
+ };
877
+ var getType = /* @__PURE__ */ __name((startStr, endStr) => {
878
+ log.debug("In get type", startStr, endStr);
879
+ switch (startStr) {
880
+ case "[":
881
+ return nodeType.RECT;
882
+ case "(":
883
+ return endStr === ")" ? nodeType.ROUNDED_RECT : nodeType.CLOUD;
884
+ case "((":
885
+ return nodeType.CIRCLE;
886
+ case ")":
887
+ return nodeType.CLOUD;
888
+ case "))":
889
+ return nodeType.BANG;
890
+ case "{{":
891
+ return nodeType.HEXAGON;
892
+ default:
893
+ return nodeType.DEFAULT;
894
+ }
895
+ }, "getType");
896
+ var setElementForId = /* @__PURE__ */ __name((id, element) => {
897
+ elements[id] = element;
898
+ }, "setElementForId");
899
+ var decorateNode = /* @__PURE__ */ __name((decoration) => {
900
+ if (!decoration) {
901
+ return;
902
+ }
903
+ const config = getConfig2();
904
+ const node = nodes[nodes.length - 1];
905
+ if (decoration.icon) {
906
+ node.icon = sanitizeText(decoration.icon, config);
907
+ }
908
+ if (decoration.class) {
909
+ node.cssClasses = sanitizeText(decoration.class, config);
910
+ }
911
+ }, "decorateNode");
912
+ var type2Str = /* @__PURE__ */ __name((type) => {
913
+ switch (type) {
914
+ case nodeType.DEFAULT:
915
+ return "no-border";
916
+ case nodeType.RECT:
917
+ return "rect";
918
+ case nodeType.ROUNDED_RECT:
919
+ return "rounded-rect";
920
+ case nodeType.CIRCLE:
921
+ return "circle";
922
+ case nodeType.CLOUD:
923
+ return "cloud";
924
+ case nodeType.BANG:
925
+ return "bang";
926
+ case nodeType.HEXAGON:
927
+ return "hexgon";
928
+ default:
929
+ return "no-border";
930
+ }
931
+ }, "type2Str");
932
+ var getLogger = /* @__PURE__ */ __name(() => log, "getLogger");
933
+ var getElementById = /* @__PURE__ */ __name((id) => elements[id], "getElementById");
934
+ var db = {
935
+ clear,
936
+ addNode,
937
+ getSections,
938
+ getData,
939
+ nodeType,
940
+ getType,
941
+ setElementForId,
942
+ decorateNode,
943
+ type2Str,
944
+ getLogger,
945
+ getElementById
946
+ };
947
+ var kanbanDb_default = db;
948
+ var draw = /* @__PURE__ */ __name(async (text, id, _version, diagObj) => {
949
+ log.debug(`Rendering kanban diagram
950
+ ` + text);
951
+ const db2 = diagObj.db;
952
+ const data4Layout = db2.getData();
953
+ const conf = getConfig2();
954
+ conf.htmlLabels = false;
955
+ const svg = selectSvgElement(id);
956
+ for (const node of data4Layout.nodes) {
957
+ node.domId = `${id}-${node.id}`;
958
+ }
959
+ const sectionsElem = svg.append("g");
960
+ sectionsElem.attr("class", "sections");
961
+ const nodesElem = svg.append("g");
962
+ nodesElem.attr("class", "items");
963
+ const sections2 = data4Layout.nodes.filter((node) => node.isGroup);
964
+ let cnt2 = 0;
965
+ const padding = 10;
966
+ const sectionObjects = [];
967
+ let maxLabelHeight = 25;
968
+ for (const section of sections2) {
969
+ const WIDTH = conf?.kanban?.sectionWidth || 200;
970
+ cnt2 = cnt2 + 1;
971
+ section.x = WIDTH * cnt2 + (cnt2 - 1) * padding / 2;
972
+ section.width = WIDTH;
973
+ section.y = 0;
974
+ section.height = WIDTH * 3;
975
+ section.rx = 5;
976
+ section.ry = 5;
977
+ section.cssClasses = section.cssClasses + " section-" + cnt2;
978
+ const sectionObj = await insertCluster(sectionsElem, section);
979
+ maxLabelHeight = Math.max(maxLabelHeight, sectionObj?.labelBBox?.height);
980
+ sectionObjects.push(sectionObj);
981
+ }
982
+ let i = 0;
983
+ for (const section of sections2) {
984
+ const sectionObj = sectionObjects[i];
985
+ i = i + 1;
986
+ const WIDTH = conf?.kanban?.sectionWidth || 200;
987
+ const top = -WIDTH * 3 / 2 + maxLabelHeight;
988
+ let y = top;
989
+ const sectionItems = data4Layout.nodes.filter((node) => node.parentId === section.id);
990
+ for (const item of sectionItems) {
991
+ if (item.isGroup) {
992
+ throw new Error("Groups within groups are not allowed in Kanban diagrams");
993
+ }
994
+ item.x = section.x;
995
+ item.width = WIDTH - 1.5 * padding;
996
+ const nodeEl = await insertNode(nodesElem, item, { config: conf });
997
+ const bbox = nodeEl.node().getBBox();
998
+ item.y = y + bbox.height / 2;
999
+ await positionNode(item);
1000
+ y = item.y + bbox.height / 2 + padding / 2;
1001
+ }
1002
+ const rect = sectionObj.cluster.select("rect");
1003
+ const height = Math.max(y - top + 3 * padding, 50) + (maxLabelHeight - 25);
1004
+ rect.attr("height", height);
1005
+ }
1006
+ setupGraphViewbox(undefined, svg, conf.mindmap?.padding ?? defaultConfig_default.kanban.padding, conf.mindmap?.useMaxWidth ?? defaultConfig_default.kanban.useMaxWidth);
1007
+ }, "draw");
1008
+ var kanbanRenderer_default = {
1009
+ draw
1010
+ };
1011
+ var genSections = /* @__PURE__ */ __name((options) => {
1012
+ let sections2 = "";
1013
+ for (let i = 0;i < options.THEME_COLOR_LIMIT; i++) {
1014
+ options["lineColor" + i] = options["lineColor" + i] || options["cScaleInv" + i];
1015
+ if (is_dark_default(options["lineColor" + i])) {
1016
+ options["lineColor" + i] = lighten_default(options["lineColor" + i], 20);
1017
+ } else {
1018
+ options["lineColor" + i] = darken_default(options["lineColor" + i], 20);
1019
+ }
1020
+ }
1021
+ const adjuster = /* @__PURE__ */ __name((color, level) => options.darkMode ? darken_default(color, level) : lighten_default(color, level), "adjuster");
1022
+ for (let i = 0;i < options.THEME_COLOR_LIMIT; i++) {
1023
+ const sw = "" + (17 - 3 * i);
1024
+ sections2 += `
1025
+ .section-${i - 1} rect, .section-${i - 1} path, .section-${i - 1} circle, .section-${i - 1} polygon, .section-${i - 1} path {
1026
+ fill: ${adjuster(options["cScale" + i], 10)};
1027
+ stroke: ${adjuster(options["cScale" + i], 10)};
1028
+
1029
+ }
1030
+ .section-${i - 1} text {
1031
+ fill: ${options["cScaleLabel" + i]};
1032
+ }
1033
+ .node-icon-${i - 1} {
1034
+ font-size: 40px;
1035
+ color: ${options["cScaleLabel" + i]};
1036
+ }
1037
+ .section-edge-${i - 1}{
1038
+ stroke: ${options["cScale" + i]};
1039
+ }
1040
+ .edge-depth-${i - 1}{
1041
+ stroke-width: ${sw};
1042
+ }
1043
+ .section-${i - 1} line {
1044
+ stroke: ${options["cScaleInv" + i]} ;
1045
+ stroke-width: 3;
1046
+ }
1047
+
1048
+ .disabled, .disabled circle, .disabled text {
1049
+ fill: lightgray;
1050
+ }
1051
+ .disabled text {
1052
+ fill: #efefef;
1053
+ }
1054
+
1055
+ .node rect,
1056
+ .node circle,
1057
+ .node ellipse,
1058
+ .node polygon,
1059
+ .node path {
1060
+ fill: ${options.background};
1061
+ stroke: ${options.nodeBorder};
1062
+ stroke-width: 1px;
1063
+ }
1064
+
1065
+ .kanban-ticket-link {
1066
+ fill: ${options.background};
1067
+ stroke: ${options.nodeBorder};
1068
+ text-decoration: underline;
1069
+ }
1070
+ `;
1071
+ }
1072
+ return sections2;
1073
+ }, "genSections");
1074
+ var getStyles = /* @__PURE__ */ __name((options) => `
1075
+ .edge {
1076
+ stroke-width: 3;
1077
+ }
1078
+ ${genSections(options)}
1079
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
1080
+ fill: ${options.git0};
1081
+ }
1082
+ .section-root text {
1083
+ fill: ${options.gitBranchLabel0};
1084
+ }
1085
+ .icon-container {
1086
+ height:100%;
1087
+ display: flex;
1088
+ justify-content: center;
1089
+ align-items: center;
1090
+ }
1091
+ .edge {
1092
+ fill: none;
1093
+ }
1094
+ .cluster-label, .label {
1095
+ color: ${options.textColor};
1096
+ fill: ${options.textColor};
1097
+ }
1098
+ .kanban-label {
1099
+ dy: 1em;
1100
+ alignment-baseline: middle;
1101
+ text-anchor: middle;
1102
+ dominant-baseline: middle;
1103
+ text-align: center;
1104
+ }
1105
+ ${getIconStyles()}
1106
+ `, "getStyles");
1107
+ var styles_default = getStyles;
1108
+ var diagram = {
1109
+ db: kanbanDb_default,
1110
+ renderer: kanbanRenderer_default,
1111
+ parser: kanban_default,
1112
+ styles: styles_default
1113
+ };
1114
+ export {
1115
+ diagram
1116
+ };