kennel 0.2.3 → 0.2.5

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 (237) hide show
  1. package/README.md +23 -13
  2. package/dist/cli/dispatch.js +16 -3
  3. package/dist/cli/src/cli/dispatch.js +16 -3
  4. package/dist/cli/src/cli/usage.js +1 -1
  5. package/dist/cli/src/core/command.js +1 -0
  6. package/dist/cli/src/core/init.js +5 -5
  7. package/dist/cli/src/plugins/external.d.ts +28 -2
  8. package/dist/cli/src/plugins/external.js +75 -21
  9. package/dist/cli/src/site/server-plugins.d.ts +2 -7
  10. package/dist/cli/src/site/viewer.js +1 -0
  11. package/dist/cli/usage.js +1 -1
  12. package/dist/core/command.js +1 -0
  13. package/dist/core/init.js +5 -5
  14. package/dist/core/runtime.js +357 -3207
  15. package/dist/package/preview.js +1232 -5113
  16. package/dist/plugins/external.d.ts +28 -2
  17. package/dist/plugins/external.js +75 -21
  18. package/dist/site/server-plugins.d.ts +2 -7
  19. package/dist/site/server-plugins.js +552 -10447
  20. package/dist/site/viewer.js +1 -0
  21. package/kernel/apps/web/package.json +1 -5
  22. package/kernel/apps/web/scripts/dev.mjs +53 -0
  23. package/kernel/apps/web/src/app.css +0 -3
  24. package/kernel/apps/web/src/main.tsx +0 -1
  25. package/kernel/apps/web/src/plugins.ts +0 -30
  26. package/kernel/apps/web/tsconfig.json +1 -2
  27. package/kernel/apps/web/vite.config.ts +31 -13
  28. package/kernel/packages/api/package.json +0 -4
  29. package/kernel/packages/api/src/server/folder-metadata-plugin.ts +13 -38
  30. package/kernel/packages/api/src/server/index.ts +0 -1
  31. package/kernel/packages/api/src/server/plugins.ts +49 -16
  32. package/kernel/packages/api/test/core.test.ts +13 -25
  33. package/kernel/packages/markdown/README.md +1 -1
  34. package/package.json +1 -1
  35. package/web/assets/{abnfDiagram-VRR7QNED-Bgfb1nEB.js → abnfDiagram-VRR7QNED-xd_g1uK3.js} +1 -1
  36. package/web/assets/app-CX20nNIa.js +2 -0
  37. package/web/assets/{app-options-D-RJiQ-X.js → app-options-CkPJE5ep.js} +1 -1
  38. package/web/assets/{app-view-header-BLvLq02T.js → app-view-header-CNk5KnA-.js} +1 -1
  39. package/web/assets/{arc-Dk_KI36B.js → arc-B0u5yBJA.js} +1 -1
  40. package/web/assets/{architectureDiagram-ZJ3FMSHR-NR_KhRCf.js → architectureDiagram-ZJ3FMSHR-DfxOAo8P.js} +1 -1
  41. package/web/assets/{ask-tray-TzeTcO6-.js → ask-tray-SscJecDY.js} +1 -1
  42. package/web/assets/{blockDiagram-677ZJIJ3-CkLkwx9C.js → blockDiagram-677ZJIJ3-Ci3Usxh6.js} +1 -1
  43. package/web/assets/{c4Diagram-LMCZKHZV-CFCUH8e_.js → c4Diagram-LMCZKHZV-BqgwIVgh.js} +1 -1
  44. package/web/assets/channel-X7WHyxxT.js +1 -0
  45. package/web/assets/{chunk-2Q5K7J3B-B_BPLWsW.js → chunk-2Q5K7J3B-CfX69l2U.js} +1 -1
  46. package/web/assets/{chunk-32BRIVSS-B1VB1hOy.js → chunk-32BRIVSS-CuFlzZkl.js} +1 -1
  47. package/web/assets/{chunk-5VM5RSS4-KFcYr8Co.js → chunk-5VM5RSS4-DidCMlJa.js} +1 -1
  48. package/web/assets/{chunk-EX3LRPZG-CpBX3kuK.js → chunk-EX3LRPZG-B5CDm1dS.js} +1 -1
  49. package/web/assets/{chunk-JWPE2WC7-BPSl40wG.js → chunk-JWPE2WC7-D5fGV_sH.js} +1 -1
  50. package/web/assets/{chunk-MOJQB5TN-D2RcYmoU.js → chunk-MOJQB5TN-ayhH5Q-H.js} +1 -1
  51. package/web/assets/{chunk-RYQCIY6F-m7Gyn-t3.js → chunk-RYQCIY6F-C4BfOOZn.js} +1 -1
  52. package/web/assets/{chunk-V7JOEXUC-TDvdopxS.js → chunk-V7JOEXUC-DpUEIM9V.js} +1 -1
  53. package/web/assets/{chunk-VR4S4FIN-DZTsG51a.js → chunk-VR4S4FIN-DoQuFFRh.js} +1 -1
  54. package/web/assets/{chunk-XXDRQBXY-Dp0--RE2.js → chunk-XXDRQBXY-CI9eiLwn.js} +1 -1
  55. package/web/assets/classDiagram-OUVF2IWQ-BjsLQ3dz.js +1 -0
  56. package/web/assets/classDiagram-v2-EOCWNBFH-BjsLQ3dz.js +1 -0
  57. package/web/assets/client-7OWw5kW2.js +6 -0
  58. package/web/assets/client-DYj_td4Q.js +17 -0
  59. package/web/assets/{client-j2kQmxsO.js → client-Dk-NBvJR.js} +4 -4
  60. package/web/assets/command-zkzH4hVz.js +38 -0
  61. package/web/assets/{copy-context-C0Uqsp-3.js → copy-context-D5oiWrYC.js} +1 -1
  62. package/web/assets/{cose-bilkent-JH36ORCC-CPu3PI8h.js → cose-bilkent-JH36ORCC-BHRk1mO3.js} +1 -1
  63. package/web/assets/{cynefin-VYW2F7L2-DWxftYAm.js → cynefin-VYW2F7L2-C1B09TRE.js} +1 -1
  64. package/web/assets/{cynefinDiagram-TSTJHNR4-DsmN2V-p.js → cynefinDiagram-TSTJHNR4-B27qXQbv.js} +1 -1
  65. package/web/assets/{dagre-VKFMJZFB-COEbApyY.js → dagre-VKFMJZFB-B1qEi32g.js} +1 -1
  66. package/web/assets/{diagram-FQU43EPY-0O9WGWKB.js → diagram-FQU43EPY-BMkkgADD.js} +1 -1
  67. package/web/assets/{diagram-G47NLZAW-CutEdMVh.js → diagram-G47NLZAW-Cb8_g1A5.js} +1 -1
  68. package/web/assets/{diagram-NH7WQ7WH-C9KZc3B2.js → diagram-NH7WQ7WH-B51wuc5m.js} +1 -1
  69. package/web/assets/{diagram-OA4YK3LP-D8kkPXbY.js → diagram-OA4YK3LP-xnsecbbI.js} +1 -1
  70. package/web/assets/{diagram-WEI45ONY-_YqiTaGP.js → diagram-WEI45ONY-DSZdyaAV.js} +1 -1
  71. package/web/assets/{document-Dgt5eZFj.js → document-Dc2dftTW.js} +3 -3
  72. package/web/assets/{ebnfDiagram-CCIWWBDH-JO-zQh6g.js → ebnfDiagram-CCIWWBDH-aTHmcUGy.js} +1 -1
  73. package/web/assets/{entities-C3wz7FCx.js → entities-CCUtpskY.js} +1 -1
  74. package/web/assets/{erDiagram-Q63AITRT-9UjQwJ4P.js → erDiagram-Q63AITRT-CUUPBcvo.js} +1 -1
  75. package/web/assets/{file-viewer-DZJ8nYnl.js → file-viewer-DJ3rsmef.js} +1 -1
  76. package/web/assets/{flowDiagram-23GEKE2U-Ca08tnYM.js → flowDiagram-23GEKE2U-aTQXx2Mh.js} +1 -1
  77. package/web/assets/{folder-image-BfGgxo7i.js → folder-image-Bnv43tzP.js} +1 -1
  78. package/web/assets/{folder-landing-qUKBCnG-.js → folder-landing-DCnzYXXY.js} +1 -1
  79. package/web/assets/{folder-list-BfFjv7rR.js → folder-list-DvVkVjiR.js} +1 -1
  80. package/web/assets/{folder-metadata-DCw8xzHk.js → folder-metadata-C9hMMzIH.js} +1 -1
  81. package/web/assets/{folder-mobile-bar-Ubz4babf.js → folder-mobile-bar-VoTL1GS0.js} +1 -1
  82. package/web/assets/folder-plugin-view-Cvd804ZU.js +6 -0
  83. package/web/assets/{ganttDiagram-NO4QXBWP-KnHzX5W3.js → ganttDiagram-NO4QXBWP-DiwdUp7u.js} +1 -1
  84. package/web/assets/{gitGraphDiagram-IHSO6WYX-Cm8woNtK.js → gitGraphDiagram-IHSO6WYX-BL2gG_IS.js} +1 -1
  85. package/web/assets/{index-CNyy98F8.js → index-CUTtMSyJ.js} +2 -2
  86. package/web/assets/index-CegvVQ1C.js +1 -0
  87. package/web/assets/index-Dwhf8F_U.css +1 -0
  88. package/web/assets/{infoDiagram-FWYZ7A6U-yyqmUtIb.js → infoDiagram-FWYZ7A6U-B3n0zZpt.js} +1 -1
  89. package/web/assets/{ishikawaDiagram-FXEZZL3T-BfvR_Zy4.js → ishikawaDiagram-FXEZZL3T-D7YytbEv.js} +1 -1
  90. package/web/assets/{journeyDiagram-5HDEW3XC-BKuw06HM.js → journeyDiagram-5HDEW3XC-BYwqEl3C.js} +1 -1
  91. package/web/assets/{kanban-definition-HUTT4EX6-n0010rmQ.js → kanban-definition-HUTT4EX6-BQHNJgXZ.js} +1 -1
  92. package/web/assets/{linear-C0d0lT8O.js → linear-BPiQCLNk.js} +1 -1
  93. package/web/assets/{mermaid.core-BDVbShyO.js → mermaid.core-CD-KvBjV.js} +4 -4
  94. package/web/assets/{metadata-KV0dpp4G.js → metadata-COJ7fZul.js} +1 -1
  95. package/web/assets/{mindmap-definition-LN4V7U3C--_0ks3GF.js → mindmap-definition-LN4V7U3C-C1L_gyoj.js} +1 -1
  96. package/web/assets/{pegDiagram-2B236MQR-CBoNIpKR.js → pegDiagram-2B236MQR-BDAfItqS.js} +1 -1
  97. package/web/assets/{pieDiagram-ENE6RG2P-MA5tkYh5.js → pieDiagram-ENE6RG2P-CkZYH3Vz.js} +1 -1
  98. package/web/assets/{popover-DBD7FF-W.js → popover-0oA2lLUV.js} +2 -2
  99. package/web/assets/{project-search-dialog-DM1IkSZu.js → project-search-dialog-B2oqMT6h.js} +1 -1
  100. package/web/assets/{quadrantDiagram-ABIIQ3AL-CWT1ryqF.js → quadrantDiagram-ABIIQ3AL-Dy8Al3YZ.js} +1 -1
  101. package/web/assets/{railroadDiagram-RFXS5EU6-ZiLB5FGi.js → railroadDiagram-RFXS5EU6-Dd9_yo7B.js} +1 -1
  102. package/web/assets/{requirementDiagram-TGXJPOKE-CQq9uneq.js → requirementDiagram-TGXJPOKE-DPhIUsbs.js} +1 -1
  103. package/web/assets/{sankeyDiagram-HTMAVEWB-qDG-0JqI.js → sankeyDiagram-HTMAVEWB-B2QkYtub.js} +1 -1
  104. package/web/assets/{search-DNrQA5fF.js → search-C1J0-xiB.js} +1 -1
  105. package/web/assets/select-CtXC_PLC.js +30 -0
  106. package/web/assets/{selection-popup-DmtTeRs2.js → selection-popup-qhlUFzGq.js} +1 -1
  107. package/web/assets/{sequenceDiagram-DBY2YBRQ-CiApurLO.js → sequenceDiagram-DBY2YBRQ-Bx7fcZDx.js} +1 -1
  108. package/web/assets/{sizeCapture-X5ZJPWSS-DZSR5QXm.js → sizeCapture-X5ZJPWSS-CIXIhl_A.js} +1 -1
  109. package/web/assets/{stateDiagram-2N3HPSRC-CjJJR9_z.js → stateDiagram-2N3HPSRC-DCrdAflB.js} +1 -1
  110. package/web/assets/stateDiagram-v2-6OUMAXLB-0KCFLYeQ.js +1 -0
  111. package/web/assets/{swimlanes-5IMT3BWC-CKmo1sg6.js → swimlanes-5IMT3BWC-DA2vc7iZ.js} +2 -2
  112. package/web/assets/swimlanesDiagram-G3AALYLV-CAw3AV84.js +8 -0
  113. package/web/assets/{timeline-definition-FHXFAJF6-D-NMwS3y.js → timeline-definition-FHXFAJF6-lKfJiV9V.js} +1 -1
  114. package/web/assets/{vennDiagram-L72KCM5P-CfL6LBWw.js → vennDiagram-L72KCM5P-DO1q2KzG.js} +1 -1
  115. package/web/assets/{view-context-gyDl_p2V.js → view-context-DXKM3-l1.js} +4 -4
  116. package/web/assets/{viewer-capabilities-Bpp8Uvcg.js → viewer-capabilities-Cig_xM9u.js} +1 -1
  117. package/web/assets/{wardleyDiagram-EHGQE667-DgldMxaj.js → wardleyDiagram-EHGQE667-Dal9LkuZ.js} +1 -1
  118. package/web/assets/{xychartDiagram-FW5EYKEG-CIoAIFX8.js → xychartDiagram-FW5EYKEG-B3dPLPII.js} +1 -1
  119. package/web/index.html +2 -2
  120. package/kernel/packages/api/test/partial-loading.test.ts +0 -43
  121. package/kernel/plugins/calendar/SKILL.md +0 -173
  122. package/kernel/plugins/calendar/eslint.config.js +0 -10
  123. package/kernel/plugins/calendar/package.json +0 -73
  124. package/kernel/plugins/calendar/schema.json +0 -137
  125. package/kernel/plugins/calendar/src/calendar.tsx +0 -328
  126. package/kernel/plugins/calendar/src/client.tsx +0 -139
  127. package/kernel/plugins/calendar/src/context.ts +0 -48
  128. package/kernel/plugins/calendar/src/copy-button.tsx +0 -66
  129. package/kernel/plugins/calendar/src/event-dialog.tsx +0 -270
  130. package/kernel/plugins/calendar/src/index.ts +0 -4
  131. package/kernel/plugins/calendar/src/manifest.ts +0 -7
  132. package/kernel/plugins/calendar/src/parse.ts +0 -610
  133. package/kernel/plugins/calendar/src/server.ts +0 -160
  134. package/kernel/plugins/calendar/src/utils.ts +0 -80
  135. package/kernel/plugins/calendar/src/views.tsx +0 -418
  136. package/kernel/plugins/calendar/test/context.test.mjs +0 -60
  137. package/kernel/plugins/calendar/test/package.test.mjs +0 -43
  138. package/kernel/plugins/calendar/test/parse.test.mjs +0 -392
  139. package/kernel/plugins/calendar/test/server.test.mjs +0 -126
  140. package/kernel/plugins/calendar/tsconfig.json +0 -17
  141. package/kernel/plugins/mail/SKILL.md +0 -97
  142. package/kernel/plugins/mail/eslint.config.js +0 -10
  143. package/kernel/plugins/mail/package.json +0 -79
  144. package/kernel/plugins/mail/src/api.ts +0 -359
  145. package/kernel/plugins/mail/src/bun-ffi.d.ts +0 -14
  146. package/kernel/plugins/mail/src/client.tsx +0 -14
  147. package/kernel/plugins/mail/src/flock.ts +0 -137
  148. package/kernel/plugins/mail/src/folders.ts +0 -37
  149. package/kernel/plugins/mail/src/history.ts +0 -485
  150. package/kernel/plugins/mail/src/index.ts +0 -3
  151. package/kernel/plugins/mail/src/mail-card.tsx +0 -123
  152. package/kernel/plugins/mail/src/mail-conversation.tsx +0 -153
  153. package/kernel/plugins/mail/src/mail-detail-page.tsx +0 -467
  154. package/kernel/plugins/mail/src/mail-hooks.ts +0 -252
  155. package/kernel/plugins/mail/src/mail-page.tsx +0 -109
  156. package/kernel/plugins/mail/src/mail-request.ts +0 -78
  157. package/kernel/plugins/mail/src/mail-send-box.tsx +0 -175
  158. package/kernel/plugins/mail/src/mailos.ts +0 -723
  159. package/kernel/plugins/mail/src/manifest.ts +0 -7
  160. package/kernel/plugins/mail/src/node.ts +0 -171
  161. package/kernel/plugins/mail/src/parse.ts +0 -139
  162. package/kernel/plugins/mail/src/server.ts +0 -125
  163. package/kernel/plugins/mail/src/types.ts +0 -10
  164. package/kernel/plugins/mail/src/viewer.tsx +0 -147
  165. package/kernel/plugins/mail/test/flock.test.mjs +0 -156
  166. package/kernel/plugins/mail/test/folders.test.mjs +0 -138
  167. package/kernel/plugins/mail/test/history.test.mjs +0 -460
  168. package/kernel/plugins/mail/test/mailos.test.mjs +0 -752
  169. package/kernel/plugins/mail/test/node.test.mjs +0 -207
  170. package/kernel/plugins/mail/test/package.test.mjs +0 -54
  171. package/kernel/plugins/mail/test/parse.test.mjs +0 -32
  172. package/kernel/plugins/mail/test/server.test.mjs +0 -116
  173. package/kernel/plugins/mail/test/viewer.test.mjs +0 -192
  174. package/kernel/plugins/mail/tsconfig.json +0 -17
  175. package/kernel/plugins/projects/SKILL.md +0 -73
  176. package/kernel/plugins/projects/eslint.config.js +0 -10
  177. package/kernel/plugins/projects/package.json +0 -70
  178. package/kernel/plugins/projects/src/client.tsx +0 -17
  179. package/kernel/plugins/projects/src/data/model.ts +0 -129
  180. package/kernel/plugins/projects/src/index.ts +0 -17
  181. package/kernel/plugins/projects/src/manifest.ts +0 -7
  182. package/kernel/plugins/projects/src/project-context.ts +0 -41
  183. package/kernel/plugins/projects/src/server.ts +0 -276
  184. package/kernel/plugins/projects/src/ui/project-card.tsx +0 -61
  185. package/kernel/plugins/projects/src/ui/projects-page.tsx +0 -102
  186. package/kernel/plugins/projects/test/package.test.mjs +0 -51
  187. package/kernel/plugins/projects/tsconfig.json +0 -17
  188. package/kernel/plugins/tasks/SKILL.md +0 -341
  189. package/kernel/plugins/tasks/eslint.config.js +0 -10
  190. package/kernel/plugins/tasks/package.json +0 -74
  191. package/kernel/plugins/tasks/schema.json +0 -939
  192. package/kernel/plugins/tasks/src/api.ts +0 -212
  193. package/kernel/plugins/tasks/src/client.tsx +0 -23
  194. package/kernel/plugins/tasks/src/data/parse.ts +0 -544
  195. package/kernel/plugins/tasks/src/data/task-id.ts +0 -56
  196. package/kernel/plugins/tasks/src/data/todo-model.ts +0 -795
  197. package/kernel/plugins/tasks/src/index.ts +0 -34
  198. package/kernel/plugins/tasks/src/manifest.ts +0 -7
  199. package/kernel/plugins/tasks/src/pages/task-detail.tsx +0 -48
  200. package/kernel/plugins/tasks/src/pages/task-list.tsx +0 -88
  201. package/kernel/plugins/tasks/src/server.ts +0 -447
  202. package/kernel/plugins/tasks/src/styles.css +0 -9
  203. package/kernel/plugins/tasks/src/ui/compact-todo-list.tsx +0 -372
  204. package/kernel/plugins/tasks/src/ui/error-details.tsx +0 -78
  205. package/kernel/plugins/tasks/src/ui/task-page.tsx +0 -392
  206. package/kernel/plugins/tasks/src/ui/todo-agent-filter.tsx +0 -36
  207. package/kernel/plugins/tasks/src/ui/todo-filter-bar.tsx +0 -66
  208. package/kernel/plugins/tasks/src/ui/todo-item.tsx +0 -494
  209. package/kernel/plugins/tasks/src/ui/todo-status-filter.tsx +0 -60
  210. package/kernel/plugins/tasks/src/ui/todo-tag-filter.tsx +0 -48
  211. package/kernel/plugins/tasks/src/ui/todo-warnings.tsx +0 -106
  212. package/kernel/plugins/tasks/test/api.test.mjs +0 -99
  213. package/kernel/plugins/tasks/test/folder-sources.test.mjs +0 -46
  214. package/kernel/plugins/tasks/test/package.test.mjs +0 -54
  215. package/kernel/plugins/tasks/test/parse.test.mjs +0 -225
  216. package/kernel/plugins/tasks/test/server.test.mjs +0 -386
  217. package/kernel/plugins/tasks/tsconfig.json +0 -17
  218. package/web/assets/app-DoGr2Zi7.js +0 -2
  219. package/web/assets/channel-uMEjV8qc.js +0 -1
  220. package/web/assets/classDiagram-OUVF2IWQ-fbZocVor.js +0 -1
  221. package/web/assets/classDiagram-v2-EOCWNBFH-fbZocVor.js +0 -1
  222. package/web/assets/client-C6Nxdfif.js +0 -2
  223. package/web/assets/client-CXYfBko5.js +0 -17
  224. package/web/assets/client-CoKtOq-X.js +0 -7
  225. package/web/assets/client-DyRQz5RU.js +0 -53
  226. package/web/assets/client-OY6HUzuD.js +0 -98
  227. package/web/assets/client-YOYWZIFi.js +0 -34
  228. package/web/assets/command-BugZBGXE.js +0 -38
  229. package/web/assets/folder-plugin-view-DsWR1zmQ.js +0 -6
  230. package/web/assets/index-BaRnbYRw.js +0 -1
  231. package/web/assets/index-BexmLxIP.css +0 -1
  232. package/web/assets/index-DDirZMgx.js +0 -1
  233. package/web/assets/note-card-DBfX6gW1.js +0 -6
  234. package/web/assets/select-D8cqNgcp.js +0 -30
  235. package/web/assets/stateDiagram-v2-6OUMAXLB-BpeGSCu9.js +0 -1
  236. package/web/assets/swimlanesDiagram-G3AALYLV-D9RjLKb9.js +0 -8
  237. package/web/assets/use-folder-filter-LQyXns5Q.js +0 -1
@@ -1 +1 @@
1
- import{m as e}from"./tanstack-YzX_Mi37.js";import{a as i}from"./view-context-gyDl_p2V.js";const a={acp:!1,download:!1,hostActions:"none",local:!1,viewer:"unknown"};async function t(){return i.capabilities().catch(()=>a)}function n(){return e.useQuery({gcTime:5*6e4,queryKey:["viewer-capabilities"],queryFn:t,staleTime:6e4})}export{n as u};
1
+ import{m as e}from"./tanstack-YzX_Mi37.js";import{a as i}from"./view-context-DXKM3-l1.js";const a={acp:!1,download:!1,hostActions:"none",local:!1,viewer:"unknown"};async function t(){return i.capabilities().catch(()=>a)}function n(){return e.useQuery({gcTime:5*6e4,queryKey:["viewer-capabilities"],queryFn:t,staleTime:6e4})}export{n as u};
@@ -1,4 +1,4 @@
1
- import{p as Mt}from"./chunk-JWPE2WC7-BPSl40wG.js";import{_ as u,s as Nt,g as zt,o as Lt,n as Tt,a as At,b as Xt,E as Et,y as Yt,A as J,l as Q,D as It,e as Bt,p as Ft,c as V}from"./mermaid.core-BDVbShyO.js";import{p as Rt}from"./cynefin-VYW2F7L2-DWxftYAm.js";import"./index-CNyy98F8.js";import"./react-B9jn2M18.js";import"./markdown-Bw9RgUGR.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:Xt,getAccTitle:At,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
1
+ import{p as Mt}from"./chunk-JWPE2WC7-D5fGV_sH.js";import{_ as u,s as Nt,g as zt,o as Lt,n as Tt,a as At,b as Xt,E as Et,y as Yt,A as J,l as Q,D as It,e as Bt,p as Ft,c as V}from"./mermaid.core-CD-KvBjV.js";import{p as Rt}from"./cynefin-VYW2F7L2-C1B09TRE.js";import"./index-CUTtMSyJ.js";import"./react-B9jn2M18.js";import"./markdown-Bw9RgUGR.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:Xt,getAccTitle:At,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
2
2
  `+o);const a=jt(),d=Ht(),w=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*B,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const wt=g.axes.xLabel??"Evolution",mt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(wt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(mt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],m=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,m=f/x,P=-l/x,N=i+m*y,W=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=z(t.targetX),i=L(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,m=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(x.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();m=Math.max(m,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=m+i*2+105,W=x.length*p+i*2+P/2,X=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(X,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=z(s.x),i=L(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=`
3
3
  M ${n} ${i-l/2}
4
4
  L ${n+p-f} ${i-l/2}
@@ -1,4 +1,4 @@
1
- import{_ as n,s as xi,g as di,o as Yt,n as fi,a as pi,b as mi,l as Nt,D as yi,e as bi,p as Ai,y as kt,A as Ht,B as wi,E as Ci,i as Si,az as Ri,P as Ot}from"./mermaid.core-BDVbShyO.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Cboi1Yqb.js";import{l as Wt}from"./linear-C0d0lT8O.js";import"./index-CNyy98F8.js";import"./react-B9jn2M18.js";import"./markdown-Bw9RgUGR.js";import"./defaultLocale-C4B-KCzX.js";function Ti(e,t,i){e=+e,t=+t,i=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+i;for(var s=-1,a=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(a);++s<a;)o[s]=e+s*i;return o}function wt(){var e=ki().unknown(void 0),t=e.domain,i=e.range,s=0,a=1,o,l,f=!1,d=0,k=0,T=.5;delete e.unknown;function _(){var b=t().length,E=a<s,L=E?a:s,P=E?s:a;o=(P-L)/Math.max(1,b-d+k*2),f&&(o=Math.floor(o)),L+=(P-L-o*(b-d))*T,l=o*(1-d),f&&(L=Math.round(L),l=Math.round(l));var I=Ti(b).map(function(m){return L+o*m});return i(E?I.reverse():I)}return e.domain=function(b){return arguments.length?(t(b),_()):t()},e.range=function(b){return arguments.length?([s,a]=b,s=+s,a=+a,_()):[s,a]},e.rangeRound=function(b){return[s,a]=b,s=+s,a=+a,f=!0,_()},e.bandwidth=function(){return l},e.step=function(){return o},e.round=function(b){return arguments.length?(f=!!b,_()):f},e.padding=function(b){return arguments.length?(d=Math.min(1,k=+b),_()):d},e.paddingInner=function(b){return arguments.length?(d=Math.min(1,b),_()):d},e.paddingOuter=function(b){return arguments.length?(k=+b,_()):k},e.align=function(b){return arguments.length?(T=Math.max(0,Math.min(1,b)),_()):T},e.copy=function(){return wt(t(),[s,a]).round(f).paddingInner(d).paddingOuter(k).align(T)},_i.apply(_(),arguments)}var Ct=(function(){var e=n(function(F,h,u,g){for(u=u||{},g=F.length;g--;u[F[g]]=h);return u},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],a=[1,5],o=[1,6],l=[1,7],f=[1,5,10,12,14,16,18,19,21,23,36,37,38],d=[1,25],k=[1,26],T=[1,28],_=[1,29],b=[1,30],E=[1,31],L=[1,32],P=[1,33],I=[1,34],m=[1,35],D=[1,36],c=[1,37],B=[1,43],W=[1,42],X=[1,47],Y=[1,50],S=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],A=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],w=[1,65],V=[26,28],R={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:n(function(h,u,g,x,C,r,rt){var p=r.length-1;switch(C){case 5:x.setOrientation(r[p]);break;case 9:x.setDiagramTitle(r[p].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[p]);break;case 13:x.setLineData(r[p-1],r[p]);break;case 14:x.setBarData({text:"",type:"text"},r[p]);break;case 15:x.setBarData(r[p-1],r[p]);break;case 16:this.$=r[p].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[p].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[p-1];break;case 20:case 30:this.$=[r[p-2],...r[p]];break;case 21:case 31:this.$=[r[p]];break;case 22:this.$={value:Number(r[p-1]),label:r[p]};break;case 23:this.$={value:Number(r[p]),label:""};break;case 24:x.setXAxisTitle(r[p]);break;case 25:x.setXAxisTitle(r[p-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(r[p]);break;case 28:x.setXAxisRangeData(Number(r[p-2]),Number(r[p]));break;case 29:this.$=r[p-1];break;case 32:x.setYAxisTitle(r[p]);break;case 33:x.setYAxisTitle(r[p-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(r[p-2]),Number(r[p]));break;case 39:this.$={text:r[p],type:"text"};break;case 40:this.$={text:r[p],type:"text"};break;case 41:this.$={text:r[p],type:"markdown"};break;case 42:this.$=r[p];break;case 43:this.$=r[p-1]+""+r[p];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,36:a,37:o,38:l}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,36:a,37:o,38:l}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:o,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(f,[2,36]),e(f,[2,37]),e(f,[2,38]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,36:a,37:o,38:l}),{1:[2,3]},e(f,[2,5]),e(t,[2,7],{4:22,36:a,37:o,38:l}),{11:23,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:39,13:38,24:B,29:W,30:d,31:40,32:41,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:45,15:44,29:X,30:d,35:46,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:49,17:48,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:52,17:51,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(H,[2,39],{41:55,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c}),e(H,[2,40]),e(H,[2,41]),e(A,[2,42]),e(A,[2,44]),e(A,[2,45]),e(A,[2,46]),e(A,[2,47]),e(A,[2,48]),e(A,[2,49]),e(A,[2,50]),e(A,[2,51]),e(A,[2,52]),e(A,[2,53]),e(S,[2,10]),e(S,[2,24],{32:41,31:56,24:B,29:W}),e(S,[2,26]),e(S,[2,27]),{33:[1,57]},{11:59,30:d,34:58,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,11]),e(S,[2,32],{35:60,29:X}),e(S,[2,34]),{33:[1,61]},e(S,[2,12]),{17:62,24:Y},{25:63,27:64,29:w},e(S,[2,14]),{17:66,24:Y},e(S,[2,16]),e(S,[2,17]),e(A,[2,43]),e(S,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(S,[2,33]),{29:[1,70]},e(S,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(V,[2,23],{30:[1,73]}),e(S,[2,15]),e(S,[2,28]),e(S,[2,29]),{11:59,30:d,34:74,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,35]),e(S,[2,19]),{25:75,27:64,29:w},e(V,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:n(function(h,u){if(u.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=u,g}},"parseError"),parse:n(function(h){var u=this,g=[0],x=[],C=[null],r=[],rt=this.table,p="",gt=0,Mt=0,li=2,zt=1,ci=r.slice.call(arguments,1),v=Object.create(this.lexer),U={yy:{}};for(var mt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,mt)&&(U.yy[mt]=this.yy[mt]);v.setInput(h,U.yy),U.yy.lexer=v,U.yy.parser=this,typeof v.yylloc>"u"&&(v.yylloc={});var yt=v.yylloc;r.push(yt);var ui=v.options&&v.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gi(z){g.length=g.length-2*z,C.length=C.length-z,r.length=r.length-z}n(gi,"popStack");function Bt(){var z;return z=x.pop()||v.lex()||zt,typeof z!="number"&&(z instanceof Array&&(x=z,z=x.pop()),z=u.symbols_[z]||z),z}n(Bt,"lex");for(var M,$,O,bt,G={},xt,N,Vt,dt;;){if($=g[g.length-1],this.defaultActions[$]?O=this.defaultActions[$]:((M===null||typeof M>"u")&&(M=Bt()),O=rt[$]&&rt[$][M]),typeof O>"u"||!O.length||!O[0]){var At="";dt=[];for(xt in rt[$])this.terminals_[xt]&&xt>li&&dt.push("'"+this.terminals_[xt]+"'");v.showPosition?At="Parse error on line "+(gt+1)+`:
1
+ import{_ as n,s as xi,g as di,o as Yt,n as fi,a as pi,b as mi,l as Nt,D as yi,e as bi,p as Ai,y as kt,A as Ht,B as wi,E as Ci,i as Si,az as Ri,P as Ot}from"./mermaid.core-CD-KvBjV.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Cboi1Yqb.js";import{l as Wt}from"./linear-BPiQCLNk.js";import"./index-CUTtMSyJ.js";import"./react-B9jn2M18.js";import"./markdown-Bw9RgUGR.js";import"./defaultLocale-C4B-KCzX.js";function Ti(e,t,i){e=+e,t=+t,i=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+i;for(var s=-1,a=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(a);++s<a;)o[s]=e+s*i;return o}function wt(){var e=ki().unknown(void 0),t=e.domain,i=e.range,s=0,a=1,o,l,f=!1,d=0,k=0,T=.5;delete e.unknown;function _(){var b=t().length,E=a<s,L=E?a:s,P=E?s:a;o=(P-L)/Math.max(1,b-d+k*2),f&&(o=Math.floor(o)),L+=(P-L-o*(b-d))*T,l=o*(1-d),f&&(L=Math.round(L),l=Math.round(l));var I=Ti(b).map(function(m){return L+o*m});return i(E?I.reverse():I)}return e.domain=function(b){return arguments.length?(t(b),_()):t()},e.range=function(b){return arguments.length?([s,a]=b,s=+s,a=+a,_()):[s,a]},e.rangeRound=function(b){return[s,a]=b,s=+s,a=+a,f=!0,_()},e.bandwidth=function(){return l},e.step=function(){return o},e.round=function(b){return arguments.length?(f=!!b,_()):f},e.padding=function(b){return arguments.length?(d=Math.min(1,k=+b),_()):d},e.paddingInner=function(b){return arguments.length?(d=Math.min(1,b),_()):d},e.paddingOuter=function(b){return arguments.length?(k=+b,_()):k},e.align=function(b){return arguments.length?(T=Math.max(0,Math.min(1,b)),_()):T},e.copy=function(){return wt(t(),[s,a]).round(f).paddingInner(d).paddingOuter(k).align(T)},_i.apply(_(),arguments)}var Ct=(function(){var e=n(function(F,h,u,g){for(u=u||{},g=F.length;g--;u[F[g]]=h);return u},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],a=[1,5],o=[1,6],l=[1,7],f=[1,5,10,12,14,16,18,19,21,23,36,37,38],d=[1,25],k=[1,26],T=[1,28],_=[1,29],b=[1,30],E=[1,31],L=[1,32],P=[1,33],I=[1,34],m=[1,35],D=[1,36],c=[1,37],B=[1,43],W=[1,42],X=[1,47],Y=[1,50],S=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],A=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],w=[1,65],V=[26,28],R={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:n(function(h,u,g,x,C,r,rt){var p=r.length-1;switch(C){case 5:x.setOrientation(r[p]);break;case 9:x.setDiagramTitle(r[p].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[p]);break;case 13:x.setLineData(r[p-1],r[p]);break;case 14:x.setBarData({text:"",type:"text"},r[p]);break;case 15:x.setBarData(r[p-1],r[p]);break;case 16:this.$=r[p].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[p].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[p-1];break;case 20:case 30:this.$=[r[p-2],...r[p]];break;case 21:case 31:this.$=[r[p]];break;case 22:this.$={value:Number(r[p-1]),label:r[p]};break;case 23:this.$={value:Number(r[p]),label:""};break;case 24:x.setXAxisTitle(r[p]);break;case 25:x.setXAxisTitle(r[p-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(r[p]);break;case 28:x.setXAxisRangeData(Number(r[p-2]),Number(r[p]));break;case 29:this.$=r[p-1];break;case 32:x.setYAxisTitle(r[p]);break;case 33:x.setYAxisTitle(r[p-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(r[p-2]),Number(r[p]));break;case 39:this.$={text:r[p],type:"text"};break;case 40:this.$={text:r[p],type:"text"};break;case 41:this.$={text:r[p],type:"markdown"};break;case 42:this.$=r[p];break;case 43:this.$=r[p-1]+""+r[p];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,36:a,37:o,38:l}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,36:a,37:o,38:l}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:o,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(f,[2,36]),e(f,[2,37]),e(f,[2,38]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,36:a,37:o,38:l}),{1:[2,3]},e(f,[2,5]),e(t,[2,7],{4:22,36:a,37:o,38:l}),{11:23,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:39,13:38,24:B,29:W,30:d,31:40,32:41,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:45,15:44,29:X,30:d,35:46,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:49,17:48,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:52,17:51,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(H,[2,39],{41:55,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c}),e(H,[2,40]),e(H,[2,41]),e(A,[2,42]),e(A,[2,44]),e(A,[2,45]),e(A,[2,46]),e(A,[2,47]),e(A,[2,48]),e(A,[2,49]),e(A,[2,50]),e(A,[2,51]),e(A,[2,52]),e(A,[2,53]),e(S,[2,10]),e(S,[2,24],{32:41,31:56,24:B,29:W}),e(S,[2,26]),e(S,[2,27]),{33:[1,57]},{11:59,30:d,34:58,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,11]),e(S,[2,32],{35:60,29:X}),e(S,[2,34]),{33:[1,61]},e(S,[2,12]),{17:62,24:Y},{25:63,27:64,29:w},e(S,[2,14]),{17:66,24:Y},e(S,[2,16]),e(S,[2,17]),e(A,[2,43]),e(S,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(S,[2,33]),{29:[1,70]},e(S,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(V,[2,23],{30:[1,73]}),e(S,[2,15]),e(S,[2,28]),e(S,[2,29]),{11:59,30:d,34:74,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,35]),e(S,[2,19]),{25:75,27:64,29:w},e(V,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:n(function(h,u){if(u.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=u,g}},"parseError"),parse:n(function(h){var u=this,g=[0],x=[],C=[null],r=[],rt=this.table,p="",gt=0,Mt=0,li=2,zt=1,ci=r.slice.call(arguments,1),v=Object.create(this.lexer),U={yy:{}};for(var mt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,mt)&&(U.yy[mt]=this.yy[mt]);v.setInput(h,U.yy),U.yy.lexer=v,U.yy.parser=this,typeof v.yylloc>"u"&&(v.yylloc={});var yt=v.yylloc;r.push(yt);var ui=v.options&&v.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gi(z){g.length=g.length-2*z,C.length=C.length-z,r.length=r.length-z}n(gi,"popStack");function Bt(){var z;return z=x.pop()||v.lex()||zt,typeof z!="number"&&(z instanceof Array&&(x=z,z=x.pop()),z=u.symbols_[z]||z),z}n(Bt,"lex");for(var M,$,O,bt,G={},xt,N,Vt,dt;;){if($=g[g.length-1],this.defaultActions[$]?O=this.defaultActions[$]:((M===null||typeof M>"u")&&(M=Bt()),O=rt[$]&&rt[$][M]),typeof O>"u"||!O.length||!O[0]){var At="";dt=[];for(xt in rt[$])this.terminals_[xt]&&xt>li&&dt.push("'"+this.terminals_[xt]+"'");v.showPosition?At="Parse error on line "+(gt+1)+`:
2
2
  `+v.showPosition()+`
3
3
  Expecting `+dt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":At="Parse error on line "+(gt+1)+": Unexpected "+(M==zt?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(At,{text:v.match,token:this.terminals_[M]||M,line:v.yylineno,loc:yt,expected:dt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+M);switch(O[0]){case 1:g.push(M),C.push(v.yytext),r.push(v.yylloc),g.push(O[1]),M=null,Mt=v.yyleng,p=v.yytext,gt=v.yylineno,yt=v.yylloc;break;case 2:if(N=this.productions_[O[1]][1],G.$=C[C.length-N],G._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},ui&&(G._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),bt=this.performAction.apply(G,[p,Mt,gt,U.yy,O[1],C,r].concat(ci)),typeof bt<"u")return bt;N&&(g=g.slice(0,-1*N*2),C=C.slice(0,-1*N),r=r.slice(0,-1*N)),g.push(this.productions_[O[1]][0]),C.push(G.$),r.push(G._$),Vt=rt[g[g.length-2]][g[g.length-1]],g.push(Vt);break;case 3:return!0}}return!0},"parse")},ot=(function(){var F={EOF:1,parseError:n(function(u,g){if(this.yy.parser)this.yy.parser.parseError(u,g);else throw new Error(u)},"parseError"),setInput:n(function(h,u){return this.yy=u||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:n(function(h){var u=h.length,g=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else 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).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(h){this.unput(this.match.slice(h))},"less"),pastInput:n(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var h=this.pastInput(),u=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
package/web/index.html CHANGED
@@ -9,10 +9,10 @@
9
9
  <meta name="theme-color" content="#f7f6f2" />
10
10
  <link rel="icon" href="/favicon.svg" />
11
11
  <title>Kennel</title>
12
- <script type="module" crossorigin src="/assets/index-CNyy98F8.js"></script>
12
+ <script type="module" crossorigin src="/assets/index-CUTtMSyJ.js"></script>
13
13
  <link rel="modulepreload" crossorigin href="/assets/markdown-Bw9RgUGR.js">
14
14
  <link rel="modulepreload" crossorigin href="/assets/react-B9jn2M18.js">
15
- <link rel="stylesheet" crossorigin href="/assets/index-BexmLxIP.css">
15
+ <link rel="stylesheet" crossorigin href="/assets/index-Dwhf8F_U.css">
16
16
  </head>
17
17
  <body>
18
18
  <div id="root"></div>
@@ -1,43 +0,0 @@
1
- import { expect, test } from "bun:test";
2
- import { mkdtemp, writeFile, rm } from "node:fs/promises";
3
- import { tmpdir } from "node:os";
4
- import { join } from "node:path";
5
- import { createKennelApi } from "../src/server";
6
-
7
- test("navigation and Calendar don't start linked discovery; Tasks render before it finishes and retry failure", async () => {
8
- const root = await mkdtemp(join(tmpdir(), "kennel-partial-"));
9
- await writeFile(join(root, "todo.json"), JSON.stringify({ id: "todo", title: "Local tasks", tasks: [{ id: "1", name: "Local task", done: false }] }));
10
- let fail!: (error: Error) => void;
11
- let calls = 0;
12
- const api = createKennelApi({ root, linkedFolderLoader: async () => {
13
- calls++;
14
- if (calls === 1) return new Promise((_resolve, reject) => { fail = reject; });
15
- return [];
16
- } });
17
- try {
18
- const address = await api.listen(0);
19
- if (!address || typeof address === "string") throw new Error("No server");
20
- const base = `http://127.0.0.1:${address.port}`;
21
- const get = async (url: string, retry = false) => {
22
- const response = await fetch(base + url, { signal: AbortSignal.timeout(2000), headers: retry ? { "x-kennel-retry-linked": "1" } : {} });
23
- expect(response.ok).toBe(true);
24
- return response.json();
25
- };
26
- await get("/api/metadata?part=plugins");
27
- await get("/api/plugins/calendar");
28
- expect(calls).toBe(0);
29
- const local = await get("/api/plugins/tasks");
30
- expect(local.linkedStatus).toBe("pending");
31
- expect(local.dataset.tasks.length).toBe(1);
32
- expect((await get("/api/health")).viewer).toBe("kennel-core");
33
- fail(new Error("Offline"));
34
- await new Promise(resolve => setTimeout(resolve, 0));
35
- const failed = await get("/api/plugins/tasks");
36
- expect(failed.linkedStatus).toBe("error");
37
- expect(failed.dataset.tasks.length).toBe(1);
38
- await get("/api/plugins/tasks", true);
39
- await new Promise(resolve => setTimeout(resolve, 0));
40
- expect((await get("/api/plugins/tasks")).linkedStatus).toBe("ready");
41
- expect(calls).toBe(2);
42
- } finally { fail?.(new Error("Closing")); await api.close(); await rm(root, { recursive: true, force: true }); }
43
- });
@@ -1,173 +0,0 @@
1
- ---
2
- name: kennel-calendar
3
- description: Open, read, and verify a folder's calendar in the Kennel viewer — one-time and repeating events from `calendar.json` files merged into a Calendar view, validation errors, or scaffold a starter file with `kennel init`. Use when the user asks to view a schedule or calendar for a folder, see events or agenda items, open a workspace's calendar.json collection, check what events are recorded, group or filter events by color, status, or group, create a starter calendar file, or preview a calendar document in Kennel.
4
- ---
5
-
6
- # Kennel Calendar Plugin
7
-
8
- The Calendar plugin (`@raggle-ai/calendar`) turns a folder's `calendar.json`
9
- files into a typed Calendar view in the Kennel web viewer. Any `calendar.json`
10
- anywhere under the folder is discovered recursively (hidden directories and
11
- `node_modules` are skipped), parsed leniently, and merged into one calendar —
12
- including repeating (daily/weekly/monthly) events with exclusions.
13
-
14
- This skill covers the agent-facing parts of that plugin: what content powers
15
- the view, how it is detected, and how to open and verify it. For the plugin
16
- package's implementation contract, see `plugins/README.md` in the Kennel
17
- repo.
18
-
19
- ## When to use
20
-
21
- - The user asks to open a folder's calendar, agenda, or schedule in Kennel.
22
- - The user wants to know what calendar records exist in a folder or workspace.
23
- - Preview or verification work needs the Calendar plugin tab to be available
24
- (detection) and populated for a target folder.
25
-
26
- ## Workflow
27
-
28
- 1. **Identify the folder** whose calendar the user wants. This is the root the
29
- viewer will serve; the plugin scans it recursively for `calendar.json`.
30
- 2. **Check for calendar content.** Look for `calendar.json` files under the
31
- folder (skip hidden dirs and `node_modules`), or open the folder in the
32
- viewer and confirm the **Calendar** plugin tab appears in the navigation.
33
- The tab appears when at least one `calendar.json` exists — a valid file
34
- shows a badge with the total event count, an invalid file shows a warning
35
- marker.
36
-
37
- If no `calendar.json` exists and the user wants to start a calendar, run
38
- `kennel init` (or `kennel init --plugin calendar`) in the folder to
39
- scaffold a starter file with one sample event — it passes detection
40
- immediately. Only scaffold when the user asks for it or when creating a
41
- calendar file is clearly in scope; never modify an existing file.
42
-
43
- 3. **Read the calendars.** Each `calendar.json` is a JSON document with an
44
- `events` array. Multiple files merge into one calendar: the root-level
45
- `calendar.json` (at the served folder root) provides the calendar title;
46
- events are grouped by the directory they live in, and each event's id is
47
- prefixed with its source path. When more than one folder contributes
48
- events, the view shows **folder filter chips** (like mail) — event counts
49
- per owning `calendar.json` directory, narrowing the merged calendar to
50
- one folder. Parse and summarize events from the source files themselves
51
- — read them, do not invent values.
52
- 4. **Handle validation errors.** If a tab badge is a warning marker (or the
53
- view shows the red error panel), a `calendar.json` exists but is not
54
- valid. Read the exact issues — from the view's `path: message` lines or
55
- from the API: `curl -fsS "$URL/api/plugins/calendar?path=<folder>"`
56
- returns `status: "error"` with an `issues` array where paths carry the
57
- source file (for example
58
- `calendar.json: events[1].start: could not be parsed as a date`). A
59
- broken file is excluded from the merged calendar but valid sibling files
60
- still render under the error panel; report the exact issues rather than a
61
- generic failure.
62
- 5. **Open the view.** `kennel serve <folder>` (or `kennel view <folder>` in a
63
- source checkout), then return the folder link and point at the Calendar
64
- tab. Launch, port, watch, and link-verification mechanics come from the
65
- `kennel-preview` skill — install it alongside this one so the full
66
- workflow works.
67
- 6. **Verify before reporting.** Confirm the server is alive
68
- (`curl -fsS "$URL/api/health"`), the printed URL serves the exact requested
69
- folder root, and the Calendar plugin is available for that folder (with a
70
- badge for valid files or a warning for invalid ones). If the user asked
71
- for specific events, confirm those events exist in the source
72
- `calendar.json` files and report what the view will show.
73
-
74
- ## Content shape
75
-
76
- ### Calendar document (`calendar.json`)
77
-
78
- Top level of each file (all optional except `events`):
79
-
80
- | Field | Meaning |
81
- | ----------- | ------------------------------------------------------------------------------------------------------------------------------ |
82
- | `events` | Array of events — required |
83
- | `title` | Calendar title; the root-level file's title names the merged calendar |
84
- | `group` | Group name applied to events that do not set their own |
85
- | `color` | Group color applied to events that do not set their own |
86
- | `startDate` | Optional anchor date; the Calendar view opens on it instead of today (a trip calendar can point at its own month, for example) |
87
-
88
- A bare top-level JSON array of events is also accepted. The published schema
89
- is `https://raggle.co/schemas/calendar.json` (JSON Schema draft 2020-12;
90
- `schema.json` in the plugin source mirrors it).
91
-
92
- ### Event
93
-
94
- | Field | Meaning |
95
- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
96
- | `id` | Optional; falls back to `uid`/`key`, then the event's index in the array |
97
- | `title` | Optional; falls back to `name`/`subject`/`summary`/`label`, else "Untitled" |
98
- | `start` | Required. Date or date-time: `YYYY-MM-DD`, `YYYY-MM-DDTHH:mm`, or with seconds/millis (also `startDate`, `start_date`, `date`, `begin`) |
99
- | `end` | Optional (`end`, `endDate`, `end_date`, `due`, `finish`). Defaults to start + 1 hour, or + 1 day for `allDay` events |
100
- | `allDay` | Boolean; this event spans the whole day |
101
- | `repeating` | `"daily"` \| `"weekly"` \| `"monthly"` |
102
- | `repeatUntil` | Optional end of repetition; a plain `YYYY-MM-DD` is expanded to end of day |
103
- | `excludeDates` | Array of dates to skip for repeating events |
104
- | `attendees` | Array of participant strings |
105
- | `location`, `organizer` | Strings |
106
- | `reminders` | Array of integer minutes before the event |
107
- | `status` | `"confirmed"` \| `"tentative"` \| `"cancelled"` |
108
- | `tags` | Array of strings |
109
- | `url` | `http(s)` link |
110
- | `description` | Free text (also `detail`, `notes`, `summary`, `body`) |
111
- | `color` | `"blue"` \| `"green"` \| `"red"` \| `"yellow"` \| `"purple"` \| `"orange"` (also `colour`, `calendarId`, `calendar`, `category`, `calendars`) |
112
- | `group`, `groupColor` | Per-event group override |
113
-
114
- Dates parse as ISO strings or epoch numbers. Parsing is lenient — fields with
115
- unknown values are dropped, not rejected, so a folder can still render a
116
- calendar view even when individual events carry extra metadata.
117
-
118
- ### Detection
119
-
120
- The plugin fact used for the navigation badge is the merged event count:
121
- `detect` returns the total number of events (after merging all valid
122
- `calendar.json` sources) when at least one valid file exists, `error` when a
123
- `calendar.json` exists but is invalid, and `unavailable` when none exists.
124
- The Calendar tab therefore appears only when at least one `calendar.json`
125
- exists; it shows a badge for valid calendars and a warning marker for invalid
126
- files.
127
-
128
- ### Opening date
129
-
130
- The view does not always open on today. It opens on the calendar's top-level
131
- `startDate` when set; otherwise on today when today falls inside the merged
132
- event range; otherwise on the first event date, so a calendar that sits far
133
- from today (a trip in 2027, for example) opens on its own content instead of
134
- an empty day.
135
-
136
- ### Validation errors
137
-
138
- Files that exist but are not valid show their problems instead of a generic
139
- error: the Calendar tab gets a warning badge and the view lists each issue as
140
- `path: message` lines (for example
141
- `calendar.json: events[1].start: could not be parsed as a date`). A broken
142
- file is excluded from the rendered dataset, but valid sibling files still
143
- get merged and shown under the error panel. Validation rules live in
144
- `src/parse.ts` (`validateCalendarFile` / `parseCalendarSource`, exported as
145
- `@raggle-ai/calendar/parse`); the same rules power the starter template used
146
- by the general `kennel init` command (`calendar.json` with one sample event),
147
- which then passes detection immediately.
148
-
149
- ## Verification
150
-
151
- - Server alive: `curl -fsS --connect-timeout 3 --max-time 5 "$URL/api/health"`
152
- - Folder root: request `/api/documents` and confirm `root` is the requested
153
- absolute folder.
154
- - Calendar availability: the Calendar plugin tab is present and its badge
155
- equals the merged event count of the discovered `calendar.json` files; an
156
- invalid file shows a warning marker instead of a badge.
157
- - Invalid file: `/api/plugins/calendar?path=<folder>` returns `status:
158
- "error"` with the `issues` array (paths prefixed with the source file) and
159
- valid sibling files still render; it never 404s or silently drops an
160
- existing file.
161
- - Per-event checks: `id`, `title`, `start`, `status`, `repeating`, and group
162
- values in the view match the source JSON.
163
-
164
- ## Boundaries
165
-
166
- - This plugin is read-only for the folder's calendar files: it parses and
167
- renders `calendar.json` documents; it does not create or edit them.
168
- `kennel init` scaffolds a starter `calendar.json`; afterwards, author
169
- calendar records with the repo's normal JSON conventions and reopen the
170
- view.
171
- - Do not invent events, dates, or attendees — read them from the source files.
172
- - The Calendar view only exists inside the Kennel viewer (server + web app);
173
- the `@raggle-ai/calendar` package is not a standalone CLI.
@@ -1,10 +0,0 @@
1
- import baseConfig from "@raggle-ai/eslint-config/base"
2
- import reactConfig from "@raggle-ai/eslint-config/react"
3
-
4
- export default [
5
- ...baseConfig,
6
- ...reactConfig,
7
- {
8
- ignores: ["dist/**", "**/_generated/", "vendor/**"],
9
- },
10
- ]
@@ -1,73 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/package.json",
3
- "name": "@raggle-ai/calendar",
4
- "version": "0.1.0",
5
- "description": "Calendar folder plugin: parser, detection, and React calendar view for Kennel folders.",
6
- "type": "module",
7
- "license": "MIT",
8
- "prettier": "@raggle-ai/prettier-config",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/raggle-ai/kennel.git",
12
- "directory": "plugins/calendar"
13
- },
14
- "publishConfig": {
15
- "registry": "https://registry.npmjs.org",
16
- "access": "public"
17
- },
18
- "files": [
19
- "src"
20
- ],
21
- "exports": {
22
- ".": "./src/index.ts",
23
- "./calendar": "./src/calendar.tsx",
24
- "./client": "./src/client.tsx",
25
- "./context": "./src/context.ts",
26
- "./manifest": "./src/manifest.ts",
27
- "./parse": "./src/parse.ts",
28
- "./server": "./src/server.ts"
29
- },
30
- "scripts": {
31
- "test": "bun test test/*.test.mjs",
32
- "typecheck": "tsc --noEmit",
33
- "format": "prettier . --check --cache --cache-location .cache/.prettiercache --ignore-path ../../.prettierignore",
34
- "format:fix": "prettier . --write --cache --cache-location .cache/.prettiercache --ignore-path ../../.prettierignore",
35
- "lint": "eslint . --cache --cache-location .cache/.eslintcache",
36
- "lint:fix": "eslint . --fix --cache --cache-location .cache/.eslintcache",
37
- "clean": "git clean -xdf dist node_modules .cache .turbo/cache",
38
- "pack:check": "npm pack --dry-run",
39
- "publish:public:dry-run": "npm --@raggle-ai:registry=https://registry.npmjs.org publish --dry-run --access public --registry=https://registry.npmjs.org"
40
- },
41
- "dependencies": {
42
- "@raggle-ai/folder-plugin": "workspace:*",
43
- "@raggle-ai/ui": "workspace:*",
44
- "@tanstack/react-query": "catalog:tanstack",
45
- "date-fns": "^4.1.0",
46
- "lucide-react": "^0.562.0"
47
- },
48
- "peerDependencies": {
49
- "react": ">=18.3.0"
50
- },
51
- "devDependencies": {
52
- "@eslint/compat": "catalog:eslint",
53
- "@eslint/eslintrc": "catalog:eslint",
54
- "@ianvs/prettier-plugin-sort-imports": "catalog:prettier",
55
- "@prettier/plugin-oxc": "catalog:prettier",
56
- "@raggle-ai/eslint-config": "workspace:*",
57
- "@raggle-ai/prettier-config": "workspace:*",
58
- "@raggle-ai/tsconfig": "workspace:*",
59
- "@types/node": "catalog:",
60
- "@types/react": "catalog:react19",
61
- "@types/react-dom": "catalog:react19",
62
- "eslint": "catalog:eslint",
63
- "eslint-plugin-unused-imports": "catalog:eslint",
64
- "prettier": "catalog:prettier",
65
- "prettier-plugin-classnames": "catalog:prettier",
66
- "prettier-plugin-merge": "catalog:prettier",
67
- "prettier-plugin-tailwindcss": "catalog:prettier",
68
- "react": "catalog:react19",
69
- "react-dom": "catalog:react19",
70
- "typescript": "catalog:",
71
- "typescript-eslint": "catalog:eslint"
72
- }
73
- }
@@ -1,137 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://raggle.co/schemas/calendar.json",
4
- "title": "Raggle Calendar",
5
- "description": "A calendar document with one-time and repeating events.",
6
- "type": "object",
7
- "additionalProperties": false,
8
- "required": ["events"],
9
- "properties": {
10
- "$schema": {
11
- "const": "https://raggle.co/schemas/calendar.json"
12
- },
13
- "title": {
14
- "type": "string",
15
- "minLength": 1
16
- },
17
- "group": {
18
- "type": "string",
19
- "minLength": 1
20
- },
21
- "color": {
22
- "enum": ["blue", "green", "red", "yellow", "purple", "orange"]
23
- },
24
- "startDate": {
25
- "$ref": "#/$defs/date"
26
- },
27
- "events": {
28
- "type": "array",
29
- "items": {
30
- "$ref": "#/$defs/event"
31
- }
32
- }
33
- },
34
- "$defs": {
35
- "date": {
36
- "type": "string",
37
- "anyOf": [
38
- {
39
- "format": "date-time"
40
- },
41
- {
42
- "format": "date"
43
- },
44
- {
45
- "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d{1,3})?)?$"
46
- }
47
- ]
48
- },
49
- "event": {
50
- "type": "object",
51
- "additionalProperties": false,
52
- "required": ["title", "start"],
53
- "properties": {
54
- "id": {
55
- "type": "string",
56
- "minLength": 1
57
- },
58
- "title": {
59
- "type": "string",
60
- "minLength": 1
61
- },
62
- "group": {
63
- "type": "string",
64
- "minLength": 1
65
- },
66
- "start": {
67
- "$ref": "#/$defs/date"
68
- },
69
- "end": {
70
- "$ref": "#/$defs/date"
71
- },
72
- "allDay": {
73
- "type": "boolean"
74
- },
75
- "attendees": {
76
- "type": "array",
77
- "items": {
78
- "type": "string",
79
- "minLength": 1
80
- },
81
- "uniqueItems": true
82
- },
83
- "excludeDates": {
84
- "type": "array",
85
- "items": {
86
- "$ref": "#/$defs/date"
87
- },
88
- "uniqueItems": true
89
- },
90
- "location": {
91
- "type": "string",
92
- "minLength": 1
93
- },
94
- "organizer": {
95
- "type": "string",
96
- "minLength": 1
97
- },
98
- "reminders": {
99
- "type": "array",
100
- "items": {
101
- "type": "integer",
102
- "minimum": 0
103
- },
104
- "uniqueItems": true
105
- },
106
- "repeating": {
107
- "enum": ["daily", "weekly", "monthly"]
108
- },
109
- "repeatUntil": {
110
- "$ref": "#/$defs/date"
111
- },
112
- "status": {
113
- "enum": ["confirmed", "tentative", "cancelled"]
114
- },
115
- "tags": {
116
- "type": "array",
117
- "items": {
118
- "type": "string",
119
- "minLength": 1
120
- },
121
- "uniqueItems": true
122
- },
123
- "url": {
124
- "type": "string",
125
- "format": "uri",
126
- "pattern": "^https?://"
127
- },
128
- "description": {
129
- "type": "string"
130
- },
131
- "color": {
132
- "enum": ["blue", "green", "red", "yellow", "purple", "orange"]
133
- }
134
- }
135
- }
136
- }
137
- }