@cyberismo/backend 1.1.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (510) hide show
  1. package/README.md +21 -0
  2. package/dist/app.d.ts +5 -15
  3. package/dist/app.js +46 -44
  4. package/dist/app.js.map +1 -1
  5. package/dist/auth/index.d.ts +1 -13
  6. package/dist/auth/index.js +3 -13
  7. package/dist/auth/index.js.map +1 -1
  8. package/dist/auth/keycloak.d.ts +2 -15
  9. package/dist/auth/keycloak.js +8 -12
  10. package/dist/auth/keycloak.js.map +1 -1
  11. package/dist/auth/mock.d.ts +12 -20
  12. package/dist/auth/mock.js +121 -43
  13. package/dist/auth/mock.js.map +1 -1
  14. package/dist/auth/types.d.ts +7 -13
  15. package/dist/auth/types.js +2 -12
  16. package/dist/auth/types.js.map +1 -1
  17. package/dist/common/errors.d.ts +12 -0
  18. package/dist/common/errors.js +31 -0
  19. package/dist/common/errors.js.map +1 -0
  20. package/dist/common/validationSchemas.d.ts +0 -12
  21. package/dist/common/validationSchemas.js +2 -12
  22. package/dist/common/validationSchemas.js.map +1 -1
  23. package/dist/domain/auth/index.d.ts +0 -12
  24. package/dist/domain/auth/index.js +2 -12
  25. package/dist/domain/auth/index.js.map +1 -1
  26. package/dist/domain/calculations/index.d.ts +0 -12
  27. package/dist/domain/calculations/index.js +4 -14
  28. package/dist/domain/calculations/index.js.map +1 -1
  29. package/dist/domain/calculations/schema.d.ts +0 -12
  30. package/dist/domain/calculations/schema.js +2 -12
  31. package/dist/domain/calculations/schema.js.map +1 -1
  32. package/dist/domain/calculations/service.d.ts +2 -14
  33. package/dist/domain/calculations/service.js +7 -17
  34. package/dist/domain/calculations/service.js.map +1 -1
  35. package/dist/domain/cardTypes/index.d.ts +0 -12
  36. package/dist/domain/cardTypes/index.js +10 -20
  37. package/dist/domain/cardTypes/index.js.map +1 -1
  38. package/dist/domain/cardTypes/schema.d.ts +0 -12
  39. package/dist/domain/cardTypes/schema.js +2 -12
  40. package/dist/domain/cardTypes/schema.js.map +1 -1
  41. package/dist/domain/cardTypes/service.d.ts +4 -16
  42. package/dist/domain/cardTypes/service.js +17 -25
  43. package/dist/domain/cardTypes/service.js.map +1 -1
  44. package/dist/domain/cards/index.d.ts +0 -12
  45. package/dist/domain/cards/index.js +120 -175
  46. package/dist/domain/cards/index.js.map +1 -1
  47. package/dist/domain/cards/lib.d.ts +6 -23
  48. package/dist/domain/cards/lib.js +7 -135
  49. package/dist/domain/cards/lib.js.map +1 -1
  50. package/dist/domain/cards/mermaid.d.ts +8 -0
  51. package/dist/domain/cards/mermaid.js +23 -0
  52. package/dist/domain/cards/mermaid.js.map +1 -0
  53. package/dist/domain/cards/schema.d.ts +6 -12
  54. package/dist/domain/cards/schema.js +15 -15
  55. package/dist/domain/cards/schema.js.map +1 -1
  56. package/dist/domain/cards/service.d.ts +29 -36
  57. package/dist/domain/cards/service.js +119 -90
  58. package/dist/domain/cards/service.js.map +1 -1
  59. package/dist/domain/connectors/index.d.ts +0 -12
  60. package/dist/domain/connectors/index.js +4 -14
  61. package/dist/domain/connectors/index.js.map +1 -1
  62. package/dist/domain/connectors/service.d.ts +2 -14
  63. package/dist/domain/connectors/service.js +4 -14
  64. package/dist/domain/connectors/service.js.map +1 -1
  65. package/dist/domain/events/events-by-project.d.ts +19 -0
  66. package/dist/domain/events/events-by-project.js +57 -0
  67. package/dist/domain/events/events-by-project.js.map +1 -0
  68. package/dist/domain/events/index.d.ts +3 -0
  69. package/dist/domain/events/index.js +84 -0
  70. package/dist/domain/events/index.js.map +1 -0
  71. package/dist/domain/events/lifetime.d.ts +2 -0
  72. package/dist/domain/events/lifetime.js +15 -0
  73. package/dist/domain/events/lifetime.js.map +1 -0
  74. package/dist/domain/events/project-events.d.ts +63 -0
  75. package/dist/domain/events/project-events.js +204 -0
  76. package/dist/domain/events/project-events.js.map +1 -0
  77. package/dist/domain/events/schema.d.ts +10 -0
  78. package/dist/domain/events/schema.js +10 -0
  79. package/dist/domain/events/schema.js.map +1 -0
  80. package/dist/domain/fieldTypes/index.d.ts +0 -12
  81. package/dist/domain/fieldTypes/index.js +6 -16
  82. package/dist/domain/fieldTypes/index.js.map +1 -1
  83. package/dist/domain/fieldTypes/schema.d.ts +0 -12
  84. package/dist/domain/fieldTypes/schema.js +2 -12
  85. package/dist/domain/fieldTypes/schema.js.map +1 -1
  86. package/dist/domain/fieldTypes/service.d.ts +4 -16
  87. package/dist/domain/fieldTypes/service.js +7 -17
  88. package/dist/domain/fieldTypes/service.js.map +1 -1
  89. package/dist/domain/graphModels/index.d.ts +0 -12
  90. package/dist/domain/graphModels/index.js +4 -14
  91. package/dist/domain/graphModels/index.js.map +1 -1
  92. package/dist/domain/graphModels/schema.d.ts +0 -12
  93. package/dist/domain/graphModels/schema.js +2 -12
  94. package/dist/domain/graphModels/schema.js.map +1 -1
  95. package/dist/domain/graphModels/service.d.ts +2 -14
  96. package/dist/domain/graphModels/service.js +4 -14
  97. package/dist/domain/graphModels/service.js.map +1 -1
  98. package/dist/domain/graphViews/index.d.ts +0 -12
  99. package/dist/domain/graphViews/index.js +4 -14
  100. package/dist/domain/graphViews/index.js.map +1 -1
  101. package/dist/domain/graphViews/schema.js +2 -0
  102. package/dist/domain/graphViews/schema.js.map +1 -1
  103. package/dist/domain/graphViews/service.d.ts +2 -14
  104. package/dist/domain/graphViews/service.js +4 -14
  105. package/dist/domain/graphViews/service.js.map +1 -1
  106. package/dist/domain/labels/index.d.ts +0 -12
  107. package/dist/domain/labels/index.js +4 -14
  108. package/dist/domain/labels/index.js.map +1 -1
  109. package/dist/domain/labels/service.d.ts +3 -15
  110. package/dist/domain/labels/service.js +5 -15
  111. package/dist/domain/labels/service.js.map +1 -1
  112. package/dist/domain/linkTypes/index.d.ts +0 -12
  113. package/dist/domain/linkTypes/index.js +6 -16
  114. package/dist/domain/linkTypes/index.js.map +1 -1
  115. package/dist/domain/linkTypes/schema.d.ts +0 -12
  116. package/dist/domain/linkTypes/schema.js +2 -12
  117. package/dist/domain/linkTypes/schema.js.map +1 -1
  118. package/dist/domain/linkTypes/service.d.ts +3 -15
  119. package/dist/domain/linkTypes/service.js +7 -17
  120. package/dist/domain/linkTypes/service.js.map +1 -1
  121. package/dist/domain/logicPrograms/index.d.ts +0 -12
  122. package/dist/domain/logicPrograms/index.js +4 -14
  123. package/dist/domain/logicPrograms/index.js.map +1 -1
  124. package/dist/domain/logicPrograms/service.d.ts +2 -14
  125. package/dist/domain/logicPrograms/service.js +5 -3
  126. package/dist/domain/logicPrograms/service.js.map +1 -1
  127. package/dist/domain/mcp/index.d.ts +3 -15
  128. package/dist/domain/mcp/index.js +27 -21
  129. package/dist/domain/mcp/index.js.map +1 -1
  130. package/dist/domain/project/index.d.ts +0 -12
  131. package/dist/domain/project/index.js +41 -39
  132. package/dist/domain/project/index.js.map +1 -1
  133. package/dist/domain/project/schema.d.ts +8 -12
  134. package/dist/domain/project/schema.js +36 -18
  135. package/dist/domain/project/schema.js.map +1 -1
  136. package/dist/domain/project/service.d.ts +20 -28
  137. package/dist/domain/project/service.js +56 -60
  138. package/dist/domain/project/service.js.map +1 -1
  139. package/dist/domain/projects/index.d.ts +2 -14
  140. package/dist/domain/projects/index.js +23 -36
  141. package/dist/domain/projects/index.js.map +1 -1
  142. package/dist/domain/projects/schema.d.ts +1 -12
  143. package/dist/domain/projects/schema.js +3 -12
  144. package/dist/domain/projects/schema.js.map +1 -1
  145. package/dist/domain/projects/service.d.ts +9 -35
  146. package/dist/domain/projects/service.js +12 -48
  147. package/dist/domain/projects/service.js.map +1 -1
  148. package/dist/domain/reports/index.d.ts +0 -12
  149. package/dist/domain/reports/index.js +4 -14
  150. package/dist/domain/reports/index.js.map +1 -1
  151. package/dist/domain/reports/schema.d.ts +0 -12
  152. package/dist/domain/reports/schema.js +2 -12
  153. package/dist/domain/reports/schema.js.map +1 -1
  154. package/dist/domain/reports/service.d.ts +2 -14
  155. package/dist/domain/reports/service.js +4 -14
  156. package/dist/domain/reports/service.js.map +1 -1
  157. package/dist/domain/resources/index.d.ts +0 -12
  158. package/dist/domain/resources/index.js +91 -26
  159. package/dist/domain/resources/index.js.map +1 -1
  160. package/dist/domain/resources/schema.d.ts +8 -2
  161. package/dist/domain/resources/schema.js +8 -1
  162. package/dist/domain/resources/schema.js.map +1 -1
  163. package/dist/domain/resources/service.d.ts +23 -23
  164. package/dist/domain/resources/service.js +83 -51
  165. package/dist/domain/resources/service.js.map +1 -1
  166. package/dist/domain/skills/index.d.ts +3 -0
  167. package/dist/domain/skills/index.js +42 -0
  168. package/dist/domain/skills/index.js.map +1 -0
  169. package/dist/domain/skills/schema.d.ts +4 -0
  170. package/dist/domain/skills/schema.js +8 -0
  171. package/dist/domain/skills/schema.js.map +1 -0
  172. package/dist/domain/skills/service.d.ts +2 -0
  173. package/dist/domain/skills/service.js +6 -0
  174. package/dist/domain/skills/service.js.map +1 -0
  175. package/dist/domain/templates/index.d.ts +0 -12
  176. package/dist/domain/templates/index.js +8 -18
  177. package/dist/domain/templates/index.js.map +1 -1
  178. package/dist/domain/templates/schema.d.ts +0 -12
  179. package/dist/domain/templates/schema.js +2 -12
  180. package/dist/domain/templates/schema.js.map +1 -1
  181. package/dist/domain/templates/service.d.ts +4 -16
  182. package/dist/domain/templates/service.js +8 -18
  183. package/dist/domain/templates/service.js.map +1 -1
  184. package/dist/domain/tree/index.d.ts +0 -12
  185. package/dist/domain/tree/index.js +4 -14
  186. package/dist/domain/tree/index.js.map +1 -1
  187. package/dist/domain/tree/service.d.ts +3 -15
  188. package/dist/domain/tree/service.js +8 -15
  189. package/dist/domain/tree/service.js.map +1 -1
  190. package/dist/domain/workflows/index.d.ts +0 -12
  191. package/dist/domain/workflows/index.js +4 -14
  192. package/dist/domain/workflows/index.js.map +1 -1
  193. package/dist/domain/workflows/schema.d.ts +0 -12
  194. package/dist/domain/workflows/schema.js +2 -12
  195. package/dist/domain/workflows/schema.js.map +1 -1
  196. package/dist/domain/workflows/service.d.ts +2 -14
  197. package/dist/domain/workflows/service.js +4 -14
  198. package/dist/domain/workflows/service.js.map +1 -1
  199. package/dist/export.d.ts +8 -21
  200. package/dist/export.js +71 -66
  201. package/dist/export.js.map +1 -1
  202. package/dist/index.d.ts +3 -4
  203. package/dist/index.js +20 -41
  204. package/dist/index.js.map +1 -1
  205. package/dist/main.js +36 -32
  206. package/dist/main.js.map +1 -1
  207. package/dist/middleware/auth.d.ts +5 -12
  208. package/dist/middleware/auth.js +22 -16
  209. package/dist/middleware/auth.js.map +1 -1
  210. package/dist/middleware/commandManager.d.ts +17 -20
  211. package/dist/middleware/commandManager.js +27 -35
  212. package/dist/middleware/commandManager.js.map +1 -1
  213. package/dist/middleware/tree.js +2 -0
  214. package/dist/middleware/tree.js.map +1 -1
  215. package/dist/middleware/zvalidator.js +2 -0
  216. package/dist/middleware/zvalidator.js.map +1 -1
  217. package/dist/overlay.d.ts +33 -0
  218. package/dist/overlay.js +162 -0
  219. package/dist/overlay.js.map +1 -0
  220. package/dist/public/THIRD-PARTY.txt +1892 -688
  221. package/dist/public/assets/__vite-browser-external-DGgK3jMU.js +1 -0
  222. package/dist/public/assets/abnfDiagram-WEYOIA3C-B3qq7PKv.js +1 -0
  223. package/dist/public/assets/architecture-WOLXFQ4H-Bzau2LI0.js +1 -0
  224. package/dist/public/assets/architectureDiagram-ZHVYKT53-Bg0cUwdb.js +36 -0
  225. package/dist/public/assets/blockDiagram-RJAE7QA3-0RJB-ra-.js +140 -0
  226. package/dist/public/assets/c4Diagram-XDPPPE54-BzoQcLvf.js +38 -0
  227. package/dist/public/assets/channel-6BNdw4Ax.js +1 -0
  228. package/dist/public/assets/{chunk-MOJQB5TN-D1shKbMs.js → chunk-2E7WHVMD-6aqPk-Hk.js} +4 -4
  229. package/dist/public/assets/chunk-4EMNKR2T-vovNSAaE.js +1 -0
  230. package/dist/public/assets/chunk-55XCU76K-DXkKnt2y.js +1 -0
  231. package/dist/public/assets/chunk-7S6XSTFO-B9bfO0l3.js +2 -0
  232. package/dist/public/assets/chunk-AQDTSKZB-ilLy_cYP.js +72 -0
  233. package/dist/public/assets/chunk-DSNLSHJZ-DAudglXu.js +129 -0
  234. package/dist/public/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
  235. package/dist/public/assets/chunk-HAGFOTED-CSKFgs6b.js +62 -0
  236. package/dist/public/assets/chunk-HNE4Q36P-Cu5gPBVk.js +1 -0
  237. package/dist/public/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
  238. package/dist/public/assets/chunk-NGNAAXSQ-DI_UYJZ4.js +136 -0
  239. package/dist/public/assets/chunk-NQOKRVIF-Bpcvhq1n.js +213 -0
  240. package/dist/public/assets/chunk-UHW7PFBP-BDjvOaTH.js +1 -0
  241. package/dist/public/assets/chunk-VQ5W62QI-DHTcO93W.js +1 -0
  242. package/dist/public/assets/chunk-WQQL4CDK-H6nAhuck.js +10 -0
  243. package/dist/public/assets/chunk-XXDRQBXY-BUghdEVl.js +1 -0
  244. package/dist/public/assets/chunk-YZO67HFG-D13E0_Yh.js +1 -0
  245. package/dist/public/assets/chunk-ZAUX2LTX-Dp5y-2wt.js +1 -0
  246. package/dist/public/assets/chunk-ZCHMQSOR-RJjlln1D.js +2 -0
  247. package/dist/public/assets/classDiagram-v2-4MYWR3UA-CAqiFCSv.js +217 -0
  248. package/dist/public/assets/cose-bilkent-JH36ORCC-C_VOHzoP.js +1 -0
  249. package/dist/public/assets/cynefin-EF2NZ3EQ-Dyk4ZPjK.js +1 -0
  250. package/dist/public/assets/cynefinDiagram-WF24UDRP-b_Ia8gQX.js +62 -0
  251. package/dist/public/assets/cytoscape.esm-GRKmfDkD.js +321 -0
  252. package/dist/public/assets/dagre-NK4GIZVX-CH1K1yF8.js +4 -0
  253. package/dist/public/assets/diagram-CBK3MWTC-OaKd5avy.js +24 -0
  254. package/dist/public/assets/diagram-I5XIIV2D-Cmu5z1ad.js +24 -0
  255. package/dist/public/assets/diagram-ODIL2UCW-Cz1kkDDX.js +30 -0
  256. package/dist/public/assets/diagram-PFBEJUXE-faMkmqUW.js +3 -0
  257. package/dist/public/assets/diagram-RJA3I4VV-nycvfte-.js +41 -0
  258. package/dist/public/assets/diagram-TYUNFSNR-CjEv5QCm.js +200 -0
  259. package/dist/public/assets/dist-DGs_yUrP.js +1 -0
  260. package/dist/public/assets/ebnfDiagram-V4P3TTPT-DN-IIxCy.js +1 -0
  261. package/dist/public/assets/elk-QONTBCTQ-Bsam88GP.js +27 -0
  262. package/dist/public/assets/erDiagram-KYQIGQAA-DEU_qqNK.js +99 -0
  263. package/dist/public/assets/eventmodeling-K75KTNOO-Bl6NCM9E.js +1 -0
  264. package/dist/public/assets/flowDiagram-IUGLLWBU-Cl4qZ-36.js +1 -0
  265. package/dist/public/assets/ganttDiagram-R7GPNTJY-BmMd4aGi.js +292 -0
  266. package/dist/public/assets/gitGraph-VSP46ZUC-Q0H2PWek.js +1 -0
  267. package/dist/public/assets/gitGraphDiagram-PDYL7XHY-BlCTBYTj.js +106 -0
  268. package/dist/public/assets/index-CuBJ0hof.css +1 -0
  269. package/dist/public/assets/index-D6WqGtsG.js +27876 -0
  270. package/dist/public/assets/index-D701BZPh.js +2219 -0
  271. package/dist/public/assets/info-OHQRW6UA-D0TMPJxW.js +1 -0
  272. package/dist/public/assets/infoDiagram-MVDRKAX5-CljbtJXu.js +2 -0
  273. package/dist/public/assets/{ishikawaDiagram-FXEZZL3T-CiLpASIW.js → ishikawaDiagram-HPEHV2GE-_Y3Fr0hu.js} +6 -6
  274. package/dist/public/assets/journeyDiagram-BOSHW7O7-Bo55jJ4m.js +139 -0
  275. package/dist/public/assets/kanban-definition-FNSA4HC5-Cd-10MtF.js +89 -0
  276. package/dist/public/assets/katex-MEuSR36T.js +257 -0
  277. package/dist/public/assets/line-BDmh4sWC.js +1 -0
  278. package/dist/public/assets/linear-Dt7xjMrI.js +1 -0
  279. package/dist/public/assets/mermaid-parser.core-BJ1yyzvV.js +7 -0
  280. package/dist/public/assets/mindmap-definition-6OY57UG3-CRgumPuN.js +98 -0
  281. package/dist/public/assets/packet-JDAUHWVQ-DsTMT3Kw.js +1 -0
  282. package/dist/public/assets/path-B_0haWDX.js +1 -0
  283. package/dist/public/assets/pegDiagram-ECIUJNBX-BEGI5k3m.js +1 -0
  284. package/dist/public/assets/pie-XZMESJXO-COyqzA3N.js +1 -0
  285. package/dist/public/assets/pieDiagram-GNMPY74T-CrLJhZJJ.js +39 -0
  286. package/dist/public/assets/{quadrantDiagram-ABIIQ3AL-B3czMbdS.js → quadrantDiagram-D57K4MC3-Fl7HMHxK.js} +6 -6
  287. package/dist/public/assets/radar-ABXABTNO-DeXHKowk.js +1 -0
  288. package/dist/public/assets/railroad-I3PHUGI6-CUjKUdPz.js +1 -0
  289. package/dist/public/assets/railroad-abnf-LNEFI6M7-B1aEgHE6.js +1 -0
  290. package/dist/public/assets/railroad-ebnf-DWYD2UWJ-DmmI3Voz.js +1 -0
  291. package/dist/public/assets/railroad-peg-JR7BVNR7-BHzi9m7r.js +1 -0
  292. package/dist/public/assets/railroadDiagram-Y72NRBL7-D1oeE5fy.js +1 -0
  293. package/dist/public/assets/requirementDiagram-EQYSW5RA-BJDKK1aS.js +84 -0
  294. package/dist/public/assets/rolldown-runtime-BCiCTKAo.js +1 -0
  295. package/dist/public/assets/{rough.esm-By172zw-.js → rough.esm-Dy-Kn_BL.js} +1 -1
  296. package/dist/public/assets/sankeyDiagram-SY24JHO5-C4g0OwZ9.js +40 -0
  297. package/dist/public/assets/sequenceDiagram-BLEHNHQU-CEvy4P-b.js +169 -0
  298. package/dist/public/assets/sizeCapture-INFHLROL-3uHXrFqA.js +1 -0
  299. package/dist/public/assets/src-MPsEqXxq.js +1 -0
  300. package/dist/public/assets/stateDiagram-v2-A6IESKWZ-BFhvw4Gl.js +291 -0
  301. package/dist/public/assets/swimlanes-B3ENRKFQ-BIl_Q-FM.js +1 -0
  302. package/dist/public/assets/swimlanesDiagram-AYQRV4AK-rvDbKEHQ.js +8 -0
  303. package/dist/public/assets/timeline-definition-JXYKGLGB-qAoWTH4N.js +120 -0
  304. package/dist/public/assets/treeView-D4JQ5SDB-vq16JKkJ.js +1 -0
  305. package/dist/public/assets/treemap-SAJKECNS-C0IZTaDk.js +1 -0
  306. package/dist/public/assets/usecaseDiagram-WPOLBNNX-Dq8iz49r.js +328 -0
  307. package/dist/public/assets/vennDiagram-Q3Y3IDCW-Br4JmRjM.js +34 -0
  308. package/dist/public/assets/wardley-7MLQ67FV-CEPlAQ79.js +1 -0
  309. package/dist/public/assets/wardleyDiagram-IVAIDKWA-DURB7Ue6.js +78 -0
  310. package/dist/public/assets/xychartDiagram-4URNHDU4-BiZywfhy.js +7 -0
  311. package/dist/public/index.html +27 -28
  312. package/dist/public/sbom.cdx.json +1 -0
  313. package/dist/types.d.ts +0 -12
  314. package/dist/types.js +2 -12
  315. package/dist/types.js.map +1 -1
  316. package/dist/utils.d.ts +12 -5
  317. package/dist/utils.js +18 -43
  318. package/dist/utils.js.map +1 -1
  319. package/package.json +14 -14
  320. package/src/app.ts +51 -49
  321. package/src/auth/index.ts +3 -13
  322. package/src/auth/keycloak.ts +10 -15
  323. package/src/auth/mock.ts +144 -48
  324. package/src/auth/types.ts +10 -13
  325. package/src/common/errors.ts +45 -0
  326. package/src/common/validationSchemas.ts +3 -12
  327. package/src/domain/auth/index.ts +2 -12
  328. package/src/domain/calculations/index.ts +4 -14
  329. package/src/domain/calculations/schema.ts +2 -12
  330. package/src/domain/calculations/service.ts +8 -21
  331. package/src/domain/cardTypes/index.ts +10 -20
  332. package/src/domain/cardTypes/schema.ts +3 -12
  333. package/src/domain/cardTypes/service.ts +22 -29
  334. package/src/domain/cards/index.ts +158 -218
  335. package/src/domain/cards/lib.ts +9 -173
  336. package/src/domain/cards/mermaid.ts +25 -0
  337. package/src/domain/cards/schema.ts +19 -15
  338. package/src/domain/cards/service.ts +166 -134
  339. package/src/domain/connectors/index.ts +5 -14
  340. package/src/domain/connectors/service.ts +5 -20
  341. package/src/domain/events/events-by-project.ts +59 -0
  342. package/src/domain/events/index.ts +102 -0
  343. package/src/domain/events/lifetime.ts +17 -0
  344. package/src/domain/events/project-events.ts +266 -0
  345. package/src/domain/events/schema.ts +11 -0
  346. package/src/domain/fieldTypes/index.ts +6 -16
  347. package/src/domain/fieldTypes/schema.ts +3 -12
  348. package/src/domain/fieldTypes/service.ts +9 -21
  349. package/src/domain/graphModels/index.ts +4 -14
  350. package/src/domain/graphModels/schema.ts +3 -12
  351. package/src/domain/graphModels/service.ts +5 -18
  352. package/src/domain/graphViews/index.ts +4 -14
  353. package/src/domain/graphViews/schema.ts +3 -0
  354. package/src/domain/graphViews/service.ts +5 -18
  355. package/src/domain/labels/index.ts +4 -14
  356. package/src/domain/labels/service.ts +6 -16
  357. package/src/domain/linkTypes/index.ts +6 -16
  358. package/src/domain/linkTypes/schema.ts +2 -12
  359. package/src/domain/linkTypes/service.ts +8 -21
  360. package/src/domain/logicPrograms/index.ts +5 -17
  361. package/src/domain/logicPrograms/service.ts +7 -16
  362. package/src/domain/mcp/index.ts +33 -24
  363. package/src/domain/project/index.ts +59 -37
  364. package/src/domain/project/schema.ts +41 -18
  365. package/src/domain/project/service.ts +81 -71
  366. package/src/domain/projects/index.ts +38 -50
  367. package/src/domain/projects/schema.ts +3 -12
  368. package/src/domain/projects/service.ts +18 -88
  369. package/src/domain/reports/index.ts +4 -14
  370. package/src/domain/reports/schema.ts +2 -12
  371. package/src/domain/reports/service.ts +5 -18
  372. package/src/domain/resources/index.ts +102 -30
  373. package/src/domain/resources/schema.ts +15 -2
  374. package/src/domain/resources/service.ts +98 -81
  375. package/src/domain/skills/index.ts +51 -0
  376. package/src/domain/skills/schema.ts +9 -0
  377. package/src/domain/skills/service.ts +8 -0
  378. package/src/domain/templates/index.ts +8 -18
  379. package/src/domain/templates/schema.ts +2 -12
  380. package/src/domain/templates/service.ts +9 -22
  381. package/src/domain/tree/index.ts +4 -14
  382. package/src/domain/tree/service.ts +10 -21
  383. package/src/domain/workflows/index.ts +4 -14
  384. package/src/domain/workflows/schema.ts +2 -12
  385. package/src/domain/workflows/service.ts +5 -18
  386. package/src/export.ts +82 -73
  387. package/src/index.ts +30 -46
  388. package/src/main.ts +45 -37
  389. package/src/middleware/auth.ts +25 -16
  390. package/src/middleware/commandManager.ts +37 -49
  391. package/src/middleware/tree.ts +3 -0
  392. package/src/middleware/zvalidator.ts +3 -0
  393. package/src/overlay.ts +185 -0
  394. package/src/types.ts +2 -12
  395. package/src/utils.ts +26 -46
  396. package/dist/domain/cards/presence.d.ts +0 -50
  397. package/dist/domain/cards/presence.js +0 -93
  398. package/dist/domain/cards/presence.js.map +0 -1
  399. package/dist/project-registry.d.ts +0 -57
  400. package/dist/project-registry.js +0 -93
  401. package/dist/project-registry.js.map +0 -1
  402. package/dist/public/assets/abnfDiagram-VRR7QNED-Djr4KJ5E.js +0 -1
  403. package/dist/public/assets/arc-DrR4k_H-.js +0 -1
  404. package/dist/public/assets/architecture-TIHT7OUA-XL6N-4o9.js +0 -1
  405. package/dist/public/assets/architectureDiagram-ZJ3FMSHR-DsMU2Uwa.js +0 -36
  406. package/dist/public/assets/blockDiagram-677ZJIJ3-DRBmQUQJ.js +0 -132
  407. package/dist/public/assets/c4Diagram-LMCZKHZV-E0rM02LD.js +0 -10
  408. package/dist/public/assets/channel-D5fnImJy.js +0 -1
  409. package/dist/public/assets/chunk-32BRIVSS-BnDY0aSV.js +0 -1
  410. package/dist/public/assets/chunk-52WLFC77-N5YugKaZ.js +0 -10
  411. package/dist/public/assets/chunk-5FCAYU7R-I3_t_Ic_.js +0 -1
  412. package/dist/public/assets/chunk-5HE753X5-Dxz40rzH.js +0 -1
  413. package/dist/public/assets/chunk-5JV3BV7I-CNwCKRLH.js +0 -1
  414. package/dist/public/assets/chunk-5TONJI2A-ezWQ_Z2j.js +0 -2
  415. package/dist/public/assets/chunk-7BUUIJ7U-Bb538aSH.js +0 -1
  416. package/dist/public/assets/chunk-BIQX33UG-DS132-R_.js +0 -1
  417. package/dist/public/assets/chunk-C7G6YPKG-BN-cNjoj.js +0 -1
  418. package/dist/public/assets/chunk-CQNSW5MT-D8Mn1I73.js +0 -1
  419. package/dist/public/assets/chunk-CYSBUYHQ-Dc64Dwdo.js +0 -1
  420. package/dist/public/assets/chunk-EMLP6XTP-aIK0V8GX.js +0 -1
  421. package/dist/public/assets/chunk-EX3LRPZG-Db0XYyxy.js +0 -231
  422. package/dist/public/assets/chunk-FWX5IMBZ-BF_P2-Do.js +0 -2
  423. package/dist/public/assets/chunk-HOUHSVGY-L35GPy9G.js +0 -1
  424. package/dist/public/assets/chunk-ICXQ74PX-Bb8zaHde.js +0 -2
  425. package/dist/public/assets/chunk-JG7HCLWE-BtAXK3iQ.js +0 -2
  426. package/dist/public/assets/chunk-KEIR6QF5-DEvma7oi.js +0 -161
  427. package/dist/public/assets/chunk-MOZMSUNE-5FIqIBsY.js +0 -1
  428. package/dist/public/assets/chunk-OGEWGWER-BVIFy9xz.js +0 -1
  429. package/dist/public/assets/chunk-OSBZ3O6U-Cfd7kf1R.js +0 -1
  430. package/dist/public/assets/chunk-PUDLZKDR-Db3FSNR9.js +0 -156
  431. package/dist/public/assets/chunk-Q4XR5HBZ-BuKFRUzR.js +0 -70
  432. package/dist/public/assets/chunk-QBLGF6JB-DUGZXFh-.js +0 -1
  433. package/dist/public/assets/chunk-R7FJI6CG-D7mUd-qN.js +0 -1
  434. package/dist/public/assets/chunk-RYQCIY6F-C_3rESBd.js +0 -1
  435. package/dist/public/assets/chunk-U6XO7XAA-C3UhlwA1.js +0 -2
  436. package/dist/public/assets/chunk-V7JOEXUC-71b0ABpv.js +0 -206
  437. package/dist/public/assets/chunk-VAUOI2AC-C-GBw18h.js +0 -1
  438. package/dist/public/assets/chunk-VR4S4FIN-tUhbELKr.js +0 -1
  439. package/dist/public/assets/chunk-WYO6CB5R-BQoO62-B.js +0 -127
  440. package/dist/public/assets/chunk-XXDRQBXY-Co8n4ZHT.js +0 -1
  441. package/dist/public/assets/chunk-YOTPTUD7-DhCRKU1A.js +0 -1
  442. package/dist/public/assets/chunk-ZGVPDNZ5-hpz2Ryq5.js +0 -62
  443. package/dist/public/assets/chunk-ZIRB5QZD-BpeS1aZ7.js +0 -32
  444. package/dist/public/assets/classDiagram-OUVF2IWQ-CXdVorPK.js +0 -1
  445. package/dist/public/assets/classDiagram-v2-EOCWNBFH-CXdVorPK.js +0 -1
  446. package/dist/public/assets/colors-Cg5Vh3br.js +0 -1
  447. package/dist/public/assets/cose-bilkent-JH36ORCC-4GoRbloS.js +0 -1
  448. package/dist/public/assets/cynefin-VYW2F7L2-BPH-25fI.js +0 -1
  449. package/dist/public/assets/cynefinDiagram-TSTJHNR4-PEf16euv.js +0 -62
  450. package/dist/public/assets/cytoscape.esm-C3UvhD5t.js +0 -321
  451. package/dist/public/assets/dagre-Buvkdvvj.js +0 -1
  452. package/dist/public/assets/dagre-VKFMJZFB-DPsCMBF1.js +0 -4
  453. package/dist/public/assets/diagram-FQU43EPY-DS-ryuRg.js +0 -3
  454. package/dist/public/assets/diagram-G47NLZAW-CzUoYkFf.js +0 -24
  455. package/dist/public/assets/diagram-NH7WQ7WH-MhGnE2fh.js +0 -24
  456. package/dist/public/assets/diagram-OA4YK3LP-CsQ9aFR_.js +0 -30
  457. package/dist/public/assets/diagram-WEI45ONY-Er3q49ew.js +0 -41
  458. package/dist/public/assets/dist-BzwexiH1.js +0 -1
  459. package/dist/public/assets/ebnfDiagram-CCIWWBDH-AnJAsk14.js +0 -1
  460. package/dist/public/assets/erDiagram-Q63AITRT-DulA16my.js +0 -85
  461. package/dist/public/assets/eventmodeling-45OFAUF4-CoIhTpHU.js +0 -1
  462. package/dist/public/assets/flowDiagram-23GEKE2U-BGMXUq18.js +0 -1
  463. package/dist/public/assets/ganttDiagram-NO4QXBWP-DAvCPT7_.js +0 -292
  464. package/dist/public/assets/gitGraph-TEB2WS4Q-BcPsZts5.js +0 -1
  465. package/dist/public/assets/gitGraphDiagram-IHSO6WYX-CksvJvsQ.js +0 -106
  466. package/dist/public/assets/index-COSSLZqt.css +0 -1
  467. package/dist/public/assets/index-Y8Ckwau7.js +0 -447
  468. package/dist/public/assets/info-DKCQHKI2-7VGzrAVB.js +0 -1
  469. package/dist/public/assets/infoDiagram-FWYZ7A6U-D_by7lSL.js +0 -2
  470. package/dist/public/assets/journeyDiagram-5HDEW3XC-DpvFmk7c.js +0 -139
  471. package/dist/public/assets/kanban-definition-HUTT4EX6-DYP_x6zD.js +0 -89
  472. package/dist/public/assets/katex-DolUETbr.js +0 -257
  473. package/dist/public/assets/line-C8Sfsgt8.js +0 -1
  474. package/dist/public/assets/linear-BWTvbP1l.js +0 -1
  475. package/dist/public/assets/map-BaFkSB1l.js +0 -1
  476. package/dist/public/assets/mermaid-parser.core--8614tkK.js +0 -4
  477. package/dist/public/assets/mindmap-definition-LN4V7U3C-3IAd4gp3.js +0 -96
  478. package/dist/public/assets/ordinal-BdBDtYTt.js +0 -1
  479. package/dist/public/assets/packet-7NZHBO7P-KYt33H0C.js +0 -1
  480. package/dist/public/assets/path-HTXttWil.js +0 -1
  481. package/dist/public/assets/pegDiagram-2B236MQR-BQNFxYz2.js +0 -1
  482. package/dist/public/assets/pie-RZYD4A2V-xKz9s9I4.js +0 -1
  483. package/dist/public/assets/pieDiagram-ENE6RG2P-Cy13tg8_.js +0 -39
  484. package/dist/public/assets/radar-I7S5WNFK-B4QTX-fX.js +0 -1
  485. package/dist/public/assets/railroad-3IZDKUUU-Co_9rPVC.js +0 -1
  486. package/dist/public/assets/railroad-abnf-AHOZXSZD-Bhy_c3ol.js +0 -1
  487. package/dist/public/assets/railroad-ebnf-EBAXGLYW-B9ENjG34.js +0 -1
  488. package/dist/public/assets/railroad-peg-LSFZ7HO6-CyJxDBsB.js +0 -1
  489. package/dist/public/assets/railroadDiagram-RFXS5EU6-M2j5SJF2.js +0 -1
  490. package/dist/public/assets/range-EplFIxc7.js +0 -1
  491. package/dist/public/assets/requirementDiagram-TGXJPOKE-CmvJWy_S.js +0 -84
  492. package/dist/public/assets/sankeyDiagram-HTMAVEWB-tAeOzMTn.js +0 -40
  493. package/dist/public/assets/sequenceDiagram-DBY2YBRQ-r0pwijM4.js +0 -162
  494. package/dist/public/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +0 -1
  495. package/dist/public/assets/src-DOh7_en_.js +0 -1
  496. package/dist/public/assets/stateDiagram-2N3HPSRC-a9IdkSQG.js +0 -1
  497. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-s2blPtZ-.js +0 -1
  498. package/dist/public/assets/swimlanes-5IMT3BWC-5w0Cdxk6.js +0 -2
  499. package/dist/public/assets/swimlanesDiagram-G3AALYLV-BWa-KRed.js +0 -8
  500. package/dist/public/assets/time-BM2d9MsQ.js +0 -1
  501. package/dist/public/assets/timeline-definition-FHXFAJF6-CvXlv_4Y.js +0 -120
  502. package/dist/public/assets/treeView-QDETBFTQ-B9cxjfpB.js +0 -1
  503. package/dist/public/assets/treemap-6X3UGDF4-BplEq4hB.js +0 -1
  504. package/dist/public/assets/treemap-BfjIY-m6.js +0 -1
  505. package/dist/public/assets/vennDiagram-L72KCM5P-ti2qNcvo.js +0 -34
  506. package/dist/public/assets/wardley-OPB4EBWU-BX2ghg5e.js +0 -1
  507. package/dist/public/assets/wardleyDiagram-EHGQE667-C8lblm8x.js +0 -78
  508. package/dist/public/assets/xychartDiagram-FW5EYKEG-US-_k5eu.js +0 -7
  509. package/src/domain/cards/presence.ts +0 -124
  510. package/src/project-registry.ts +0 -130
@@ -1,15 +1,5 @@
1
- /**
2
- Cyberismo
3
- Copyright © Cyberismo Ltd and contributors 2025
4
- This program is free software: you can redistribute it and/or modify it under
5
- the terms of the GNU Affero General Public License version 3 as published by
6
- the Free Software Foundation.
7
- This program is distributed in the hope that it will be useful, but WITHOUT
8
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9
- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
10
- details. You should have received a copy of the GNU Affero General Public
11
- License along with this program. If not, see <https://www.gnu.org/licenses/>.
12
- */
1
+ // SPDX-FileCopyrightText: Cyberismo Ltd and contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only
13
3
 
14
4
  import { Hono } from 'hono';
15
5
  import * as templateService from './service.js';
@@ -40,10 +30,10 @@ router.get('/', requireRole(UserRole.Reader), async (c) => {
40
30
  if (isSSGContext(c)) {
41
31
  return c.json([]);
42
32
  }
43
- const commands = c.get('commands');
33
+ const ws = c.get('ws');
44
34
 
45
35
  try {
46
- const response = await templateService.getTemplatesWithDetails(commands);
36
+ const response = await templateService.getTemplatesWithDetails(ws);
47
37
  return c.json(response);
48
38
  } catch (error) {
49
39
  return c.json(
@@ -85,10 +75,10 @@ router.post(
85
75
  requireRole(UserRole.Admin),
86
76
  zValidator('json', createTemplateSchema),
87
77
  async (c) => {
88
- const commands = c.get('commands');
78
+ const ws = c.get('ws');
89
79
  const { identifier } = c.req.valid('json');
90
80
 
91
- await templateService.createTemplate(commands, identifier);
81
+ await templateService.createTemplate(ws, identifier);
92
82
  return c.json({ message: 'Template created successfully' });
93
83
  },
94
84
  );
@@ -131,11 +121,11 @@ router.post(
131
121
  requireRole(UserRole.Admin),
132
122
  zValidator('json', addTemplateCardSchema),
133
123
  async (c) => {
134
- const commands = c.get('commands');
124
+ const ws = c.get('ws');
135
125
  const { template, cardType, parentKey, count } = c.req.valid('json');
136
126
 
137
127
  const added = await templateService.addTemplateCard(
138
- commands,
128
+ ws,
139
129
  template,
140
130
  cardType,
141
131
  parentKey,
@@ -1,15 +1,5 @@
1
- /**
2
- Cyberismo
3
- Copyright © Cyberismo Ltd and contributors 2025
4
- This program is free software: you can redistribute it and/or modify it under
5
- the terms of the GNU Affero General Public License version 3 as published by
6
- the Free Software Foundation.
7
- This program is distributed in the hope that it will be useful, but WITHOUT
8
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9
- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
10
- details. You should have received a copy of the GNU Affero General Public
11
- License along with this program. If not, see <https://www.gnu.org/licenses/>.
12
- */
1
+ // SPDX-FileCopyrightText: Cyberismo Ltd and contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only
13
3
 
14
4
  import { z } from 'zod';
15
5
  import { identifierSchema } from '../../common/validationSchemas.js';
@@ -1,36 +1,23 @@
1
- /**
2
- Cyberismo
3
- Copyright © Cyberismo Ltd and contributors 2025
4
- This program is free software: you can redistribute it and/or modify it under
5
- the terms of the GNU Affero General Public License version 3 as published by
6
- the Free Software Foundation.
7
- This program is distributed in the hope that it will be useful, but WITHOUT
8
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9
- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
10
- details. You should have received a copy of the GNU Affero General Public
11
- License along with this program. If not, see <https://www.gnu.org/licenses/>.
12
- */
1
+ // SPDX-FileCopyrightText: Cyberismo Ltd and contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only
13
3
 
14
- import type { CommandManager } from '@cyberismo/data-handler';
4
+ import type { Workspace } from '@cyberismo/data-handler';
15
5
  import { resourceName } from '@cyberismo/data-handler';
16
6
 
17
- export async function getTemplatesWithDetails(commands: CommandManager) {
18
- const response = await commands.showCmd.showTemplatesWithDetails();
7
+ export async function getTemplatesWithDetails(ws: Workspace) {
8
+ const response = await ws.resources.contents('templates');
19
9
  if (!response) {
20
10
  throw new Error('No templates found');
21
11
  }
22
12
  return response;
23
13
  }
24
14
 
25
- export async function createTemplate(
26
- commands: CommandManager,
27
- templateName: string,
28
- ) {
29
- await commands.createCmd.createTemplate(templateName, '');
15
+ export async function createTemplate(ws: Workspace, templateName: string) {
16
+ await ws.resources.create(templateName, 'templates', {});
30
17
  }
31
18
 
32
19
  export async function addTemplateCard(
33
- commands: CommandManager,
20
+ ws: Workspace,
34
21
  template: string,
35
22
  cardType: string,
36
23
  parentKey?: string,
@@ -40,7 +27,7 @@ export async function addTemplateCard(
40
27
  if (type !== 'templates') {
41
28
  throw new Error('Invalid template resource');
42
29
  }
43
- const added = await commands.createCmd.addCards(
30
+ const added = await ws.cards.addToTemplate(
44
31
  cardType,
45
32
  identifier,
46
33
  parentKey,
@@ -1,15 +1,5 @@
1
- /**
2
- Cyberismo
3
- Copyright © Cyberismo Ltd and contributors 2025
4
- This program is free software: you can redistribute it and/or modify it under
5
- the terms of the GNU Affero General Public License version 3 as published by
6
- the Free Software Foundation.
7
- This program is distributed in the hope that it will be useful, but WITHOUT
8
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9
- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
10
- details. You should have received a copy of the GNU Affero General Public
11
- License along with this program. If not, see <https://www.gnu.org/licenses/>.
12
- */
1
+ // SPDX-FileCopyrightText: Cyberismo Ltd and contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only
13
3
 
14
4
  import { Hono } from 'hono';
15
5
  import * as treeService from './service.js';
@@ -35,12 +25,12 @@ const router = new Hono();
35
25
  * description: project_path not set or other internal error
36
26
  */
37
27
  router.get('/', requireRole(UserRole.Reader), async (c: AppContext) => {
38
- const commands = c.get('commands');
28
+ const ws = c.get('ws');
39
29
  const tree = c.get('tree');
40
30
 
41
31
  try {
42
32
  const response = await treeService.getCardTree(
43
- commands,
33
+ ws,
44
34
  isSSGContext(c),
45
35
  tree?.cardKey,
46
36
  tree?.recursive,
@@ -1,35 +1,24 @@
1
- /**
2
- Cyberismo
3
- Copyright © Cyberismo Ltd and contributors 2025
4
- This program is free software: you can redistribute it and/or modify it under
5
- the terms of the GNU Affero General Public License version 3 as published by
6
- the Free Software Foundation.
7
- This program is distributed in the hope that it will be useful, but WITHOUT
8
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9
- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
10
- details. You should have received a copy of the GNU Affero General Public
11
- License along with this program. If not, see <https://www.gnu.org/licenses/>.
12
- */
1
+ // SPDX-FileCopyrightText: Cyberismo Ltd and contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only
13
3
 
14
- import type { CommandManager } from '@cyberismo/data-handler';
4
+ import type { Workspace } from '@cyberismo/data-handler';
15
5
 
16
6
  /**
17
7
  * Returns the card tree of the project
18
- * @param commands command manager used for the query
8
+ * @param ws command manager used for the query
19
9
  * @param isSsg whether the context is static site generation
20
10
  * @param cardKey optional card key to start the tree from
21
11
  * @param recursive if false, includes only the given card. Otherwise, includes all child cards recursively.
22
12
  * @returns
23
13
  */
24
14
  export async function getCardTree(
25
- commands: CommandManager,
15
+ ws: Workspace,
26
16
  isSsg: boolean,
27
17
  cardKey?: string,
28
18
  recursive?: boolean,
29
- ): ReturnType<typeof commands.calculateCmd.runQuery> {
30
- return commands.calculateCmd.runQuery(
31
- 'tree',
32
- isSsg ? 'exportedSite' : 'localApp',
33
- { cardKey, recursive },
34
- );
19
+ ): ReturnType<typeof ws.queries.runQuery> {
20
+ return ws.queries.runQuery('tree', isSsg ? 'exportedSite' : 'localApp', {
21
+ cardKey,
22
+ recursive,
23
+ });
35
24
  }
@@ -1,15 +1,5 @@
1
- /**
2
- Cyberismo
3
- Copyright © Cyberismo Ltd and contributors 2025
4
- This program is free software: you can redistribute it and/or modify it under
5
- the terms of the GNU Affero General Public License version 3 as published by
6
- the Free Software Foundation.
7
- This program is distributed in the hope that it will be useful, but WITHOUT
8
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9
- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
10
- details. You should have received a copy of the GNU Affero General Public
11
- License along with this program. If not, see <https://www.gnu.org/licenses/>.
12
- */
1
+ // SPDX-FileCopyrightText: Cyberismo Ltd and contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only
13
3
 
14
4
  import { Hono } from 'hono';
15
5
  import * as workflowService from './service.js';
@@ -50,10 +40,10 @@ router.post(
50
40
  requireRole(UserRole.Admin),
51
41
  zValidator('json', createWorkflowSchema),
52
42
  async (c) => {
53
- const commands = c.get('commands');
43
+ const ws = c.get('ws');
54
44
  const { identifier } = c.req.valid('json');
55
45
 
56
- await workflowService.createWorkflow(commands, identifier);
46
+ await workflowService.createWorkflow(ws, identifier);
57
47
  return c.json({ message: 'Workflow created successfully' });
58
48
  },
59
49
  );
@@ -1,15 +1,5 @@
1
- /**
2
- Cyberismo
3
- Copyright © Cyberismo Ltd and contributors 2025
4
- This program is free software: you can redistribute it and/or modify it under
5
- the terms of the GNU Affero General Public License version 3 as published by
6
- the Free Software Foundation.
7
- This program is distributed in the hope that it will be useful, but WITHOUT
8
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9
- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
10
- details. You should have received a copy of the GNU Affero General Public
11
- License along with this program. If not, see <https://www.gnu.org/licenses/>.
12
- */
1
+ // SPDX-FileCopyrightText: Cyberismo Ltd and contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only
13
3
 
14
4
  import { z } from 'zod';
15
5
  import { identifierSchema } from '../../common/validationSchemas.js';
@@ -1,21 +1,8 @@
1
- /**
2
- Cyberismo
3
- Copyright © Cyberismo Ltd and contributors 2025
4
- This program is free software: you can redistribute it and/or modify it under
5
- the terms of the GNU Affero General Public License version 3 as published by
6
- the Free Software Foundation.
7
- This program is distributed in the hope that it will be useful, but WITHOUT
8
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9
- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
10
- details. You should have received a copy of the GNU Affero General Public
11
- License along with this program. If not, see <https://www.gnu.org/licenses/>.
12
- */
1
+ // SPDX-FileCopyrightText: Cyberismo Ltd and contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only
13
3
 
14
- import type { CommandManager } from '@cyberismo/data-handler';
4
+ import type { Workspace } from '@cyberismo/data-handler';
15
5
 
16
- export async function createWorkflow(
17
- commands: CommandManager,
18
- workflowName: string,
19
- ) {
20
- await commands.createCmd.createWorkflow(workflowName, '');
6
+ export async function createWorkflow(ws: Workspace, workflowName: string) {
7
+ await ws.resources.create(workflowName, 'workflows', {});
21
8
  }
package/src/export.ts CHANGED
@@ -1,37 +1,33 @@
1
- /**
2
- Cyberismo
3
- Copyright © Cyberismo Ltd and contributors 2025
4
- This program is free software: you can redistribute it and/or modify it under
5
- the terms of the GNU Affero General Public License version 3 as published by
6
- the Free Software Foundation.
7
- This program is distributed in the hope that it will be useful, but WITHOUT
8
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9
- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
10
- details. You should have received a copy of the GNU Affero General Public
11
- License along with this program. If not, see <https://www.gnu.org/licenses/>.
12
- */
1
+ // SPDX-FileCopyrightText: Cyberismo Ltd and contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only
13
3
 
14
4
  import fs from 'node:fs/promises';
15
5
 
16
- import type { CommandManager } from '@cyberismo/data-handler';
6
+ import {
7
+ SYSTEM_ACTOR,
8
+ type ProjectDirectory,
9
+ type Workspace,
10
+ } from '@cyberismo/data-handler';
17
11
  import { createApp } from './app.js';
18
12
  import { MockAuthProvider } from './auth/mock.js';
19
- import type { ProjectRegistry } from './project-registry.js';
20
13
  import { cp } from 'node:fs/promises';
21
14
  import { staticFrontendDirRelative } from './utils.js';
22
- import type { QueryResult } from '@cyberismo/data-handler/types/queries';
15
+ import type { QueryResult, ProjectErrors } from '@cyberismo/model';
23
16
  import { toSSG } from 'hono/ssg';
24
17
  import type { TreeOptions } from './types.js';
25
18
  import {
26
19
  findAllCards,
27
20
  findRelevantAttachments,
28
21
  } from './domain/cards/service.js';
22
+ import { CARD_ROUTES_PER_KEY } from './domain/cards/lib.js';
29
23
 
30
24
  export interface ExportSiteOptions extends TreeOptions {
31
25
  defaultProject?: string;
32
26
  }
33
27
 
34
28
  const _cardQueryCache = new Map<string, Promise<QueryResult<'card'>[]>>();
29
+ /** Label for errors from routes that belong to no project. */
30
+ const SHARED_ROUTES = '(shared)';
35
31
  const OVERHEAD_CALLS = 6; // estimated number of overhead calls during export in addition to card exports
36
32
 
37
33
  /**
@@ -45,19 +41,19 @@ export function reset() {
45
41
  /**
46
42
  * Get the card query result for a given card key. Should only be called during
47
43
  * static site generation
48
- * @param commands - CommandManager instance for the project.
44
+ * @param ws - Handle of the project.
49
45
  * @param cardKey - Key of the card to get the query result for.
50
46
  * @returns The card query result for the given card key.
51
47
  */
52
48
  export async function getCardQueryResult(
53
- commands: CommandManager,
49
+ ws: Workspace,
54
50
  cardKey?: string,
55
51
  ): Promise<QueryResult<'card'>[]> {
56
- const prefix = commands.project.configuration.cardKeyPrefix;
52
+ const prefix = ws.settings.prefix;
57
53
  if (!_cardQueryCache.has(prefix)) {
58
54
  _cardQueryCache.set(
59
55
  prefix,
60
- commands.calculateCmd.runQuery('card', 'exportedSite', {}),
56
+ ws.queries.runQuery('card', 'exportedSite', {}),
61
57
  );
62
58
  }
63
59
  return _cardQueryCache.get(prefix)!.then((results) => {
@@ -75,21 +71,21 @@ export async function getCardQueryResult(
75
71
  /**
76
72
  * Export the site to a given directory.
77
73
  * Note: Do not call this function in parallel.
78
- * @param registry - ProjectRegistry holding all project CommandManagers.
74
+ * @param directory - Directory the exported projects are opened from.
79
75
  * @param exportDir - Directory to export to.
80
76
  * @param options - Export options.
81
77
  * @param options.recursive - Whether to export cards recursively.
82
78
  * @param options.cardKey - Key of the card to export. If not provided, all cards will be exported.
83
79
  * @param options.defaultProject - Default project prefix to write into config.json.
84
80
  * @param onProgress - Optional progress callback function.
85
- * @returns An object containing any errors that occurred during export.
81
+ * @returns Errors that occurred during export, grouped by project.
86
82
  */
87
83
  export async function exportSite(
88
- registry: ProjectRegistry,
84
+ directory: ProjectDirectory,
89
85
  exportDir?: string,
90
86
  options?: ExportSiteOptions,
91
87
  onProgress?: (current: number, total: number) => void,
92
- ): Promise<{ errors: string[] }> {
88
+ ): Promise<{ errors: ProjectErrors[] }> {
93
89
  exportDir = exportDir || 'static';
94
90
  const { defaultProject, ...treeOpts } = options ?? {};
95
91
  const opts: TreeOptions = {
@@ -97,12 +93,10 @@ export async function exportSite(
97
93
  ...treeOpts,
98
94
  };
99
95
 
100
- if (defaultProject && !registry.has(defaultProject)) {
96
+ const prefixes = (await directory.list()).map((p) => p.prefix);
97
+ if (defaultProject && !prefixes.includes(defaultProject)) {
101
98
  throw new Error(
102
- `Default project '${defaultProject}' is not in the registry. Available: ${registry
103
- .list()
104
- .map((p) => p.prefix)
105
- .join(', ')}`,
99
+ `Default project '${defaultProject}' is not in the registry. Available: ${prefixes.join(', ')}`,
106
100
  );
107
101
  }
108
102
 
@@ -110,7 +104,7 @@ export async function exportSite(
110
104
  process.env.CYBERISMO_DEFAULT_PROJECT = defaultProject;
111
105
  }
112
106
 
113
- const app = createApp(new MockAuthProvider(), registry, opts, true);
107
+ const app = createApp(new MockAuthProvider(), directory, opts, prefixes);
114
108
 
115
109
  // copy whole frontend to the same directory
116
110
  await cp(staticFrontendDirRelative, exportDir, { recursive: true });
@@ -119,56 +113,71 @@ export async function exportSite(
119
113
 
120
114
  // estimate total based on the number of cards to export across all projects
121
115
  let total = OVERHEAD_CALLS;
122
- for (const commands of registry.values()) {
123
- const cards = await findAllCards(commands, opts);
124
- const attachments = await findRelevantAttachments(commands, opts);
125
- total += cards.length + attachments.length;
116
+ for (const prefix of prefixes) {
117
+ const ws = await directory.open(prefix, SYSTEM_ACTOR);
118
+ const cards = await findAllCards(ws, opts);
119
+ const attachments = await findRelevantAttachments(ws, opts);
120
+ total += cards.length * CARD_ROUTES_PER_KEY + attachments.length;
126
121
  }
127
122
 
128
- // Actual export with progress reporting
123
+ // One pass per project so an error is attributed to the project whose route
124
+ // produced it (the response itself carries no project). Shared routes get
125
+ // their own pass so each route is emitted exactly once.
126
+ const projectOf = (pathname: string) =>
127
+ prefixes.find((p) => {
128
+ const base = `/api/projects/${p}`;
129
+ return pathname === base || pathname.startsWith(`${base}/`);
130
+ });
131
+
129
132
  let done = 0;
130
133
  onProgress?.(done, total);
131
- const errors: string[] = [];
132
- await toSSG(app, fs, {
133
- dir: exportDir,
134
- concurrency: 5,
135
- plugins: [
136
- {
137
- beforeRequestHook: (req) => {
138
- const url = new URL(req.url);
139
- // Skip MCP routes — they require session state and are not part of the static site
140
- if (url.pathname.startsWith('/mcp')) {
141
- return false;
142
- }
143
- // Skip OIDC/well-known routes — not relevant for static export
144
- if (url.pathname.startsWith('/.well-known')) {
145
- return false;
146
- }
147
- return req;
148
- },
149
- afterResponseHook: async (response) => {
150
- if (![200, 201, 204].includes(response.status)) {
151
- const error = await response.json();
152
- if (
153
- typeof error === 'object' &&
154
- error != null &&
155
- 'error' in error &&
156
- typeof error.error === 'string'
157
- ) {
158
- errors.push(error.error);
134
+ const errors: ProjectErrors[] = [];
135
+ for (const scope of [undefined, ...prefixes]) {
136
+ const scopeErrors: string[] = [];
137
+ await toSSG(app, fs, {
138
+ dir: exportDir,
139
+ concurrency: 5,
140
+ plugins: [
141
+ {
142
+ beforeRequestHook: (req) => {
143
+ const url = new URL(req.url);
144
+ // Skip MCP routes — they require session state and are not part of the static site
145
+ if (url.pathname.startsWith('/mcp')) {
146
+ return false;
147
+ }
148
+ // Skip OIDC/well-known routes — not relevant for static export
149
+ if (url.pathname.startsWith('/.well-known')) {
150
+ return false;
159
151
  }
160
- return false; // ignore route
161
- }
162
- done++;
163
- if (done > total) {
164
- total = done; // adjust total if underestimated
165
- }
166
- onProgress?.(done, total);
167
- return response;
152
+ return projectOf(url.pathname) === scope ? req : false;
153
+ },
154
+ afterResponseHook: async (response) => {
155
+ if (![200, 201, 204].includes(response.status)) {
156
+ const error = await response.json();
157
+ if (
158
+ typeof error === 'object' &&
159
+ error != null &&
160
+ 'error' in error &&
161
+ typeof error.error === 'string'
162
+ ) {
163
+ scopeErrors.push(error.error);
164
+ }
165
+ return false; // ignore route
166
+ }
167
+ done++;
168
+ if (done > total) {
169
+ total = done; // adjust total if underestimated
170
+ }
171
+ onProgress?.(done, total);
172
+ return response;
173
+ },
168
174
  },
169
- },
170
- ],
171
- });
175
+ ],
176
+ });
177
+ if (scopeErrors.length > 0) {
178
+ errors.push({ prefix: scope ?? SHARED_ROUTES, errors: scopeErrors });
179
+ }
180
+ }
172
181
  return {
173
182
  errors,
174
183
  };
package/src/index.ts CHANGED
@@ -1,33 +1,23 @@
1
- /**
2
- Cyberismo
3
- Copyright © Cyberismo Ltd and contributors 2025
4
- This program is free software: you can redistribute it and/or modify it under
5
- the terms of the GNU Affero General Public License version 3 as published by
6
- the Free Software Foundation.
7
- This program is distributed in the hope that it will be useful, but WITHOUT
8
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9
- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
10
- details. You should have received a copy of the GNU Affero General Public
11
- License along with this program. If not, see <https://www.gnu.org/licenses/>.
12
- */
13
- import { serve } from '@hono/node-server';
1
+ // SPDX-FileCopyrightText: Cyberismo Ltd and contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only
3
+
14
4
  import type { Env, Schema } from 'hono';
15
5
  import { Hono } from 'hono';
16
6
  import { serveStatic } from '@hono/node-server/serve-static';
17
7
  import path from 'node:path';
18
8
  import { readFile } from 'node:fs/promises';
19
- import { findFreePort } from './utils.js';
9
+ import { listen } from './utils.js';
10
+ import { startPolicyPolling } from './overlay.js';
20
11
  import { createApp } from './app.js';
21
12
  import type { AuthProvider } from './auth/types.js';
22
- import type { ProjectRegistry } from './project-registry.js';
13
+ import type { ProjectDirectory } from '@cyberismo/data-handler';
23
14
  export { MockAuthProvider } from './auth/mock.js';
24
15
  export type { MockUserConfig } from './auth/mock.js';
25
16
  export type { AuthProvider } from './auth/types.js';
26
17
  export { exportSite, type ExportSiteOptions } from './export.js';
27
- export { ProjectRegistry } from './project-registry.js';
28
18
 
29
19
  const DEFAULT_PORT = 3000;
30
- const DEFAULT_MAX_PORT = DEFAULT_PORT + 100;
20
+ const MAX_PORT_ATTEMPTS = 100;
31
21
 
32
22
  /**
33
23
  * Preview the exported site
@@ -45,59 +35,53 @@ export async function previewSite(dir: string, findPort: boolean = true) {
45
35
  return c.html(file.toString());
46
36
  });
47
37
 
48
- let port = parseInt(process.env.PORT || DEFAULT_PORT.toString(), 10);
49
-
50
- if (findPort) {
51
- port = await findFreePort(port, DEFAULT_MAX_PORT);
52
- }
53
- startApp(app, port);
38
+ const port = parseInt(process.env.PORT || DEFAULT_PORT.toString(), 10);
39
+ await startApp(app, port, findPort);
54
40
  }
55
41
 
56
42
  /**
57
43
  * Start the server
58
44
  * @param authProvider - Authentication provider
59
- * @param registry - ProjectRegistry holding all project CommandManagers
45
+ * @param directory - Directory the projects are opened from
60
46
  * @param findPort - If true, find a free port
61
47
  */
62
48
  export async function startServer(
63
49
  authProvider: AuthProvider,
64
- registry: ProjectRegistry,
50
+ directory: ProjectDirectory,
65
51
  findPort: boolean = true,
66
52
  multiProjectRoot?: string,
67
53
  ) {
68
54
  const useOsAssigned = process.env.CYBERISMO_E2E_OSPORT === 'true';
69
- let port = useOsAssigned
55
+ const port = useOsAssigned
70
56
  ? 0
71
57
  : parseInt(process.env.PORT || DEFAULT_PORT.toString(), 10);
72
- if (findPort && !useOsAssigned) {
73
- port = await findFreePort(port, DEFAULT_MAX_PORT);
74
- }
58
+ startPolicyPolling(async () =>
59
+ (await directory.list()).map((p) => ({ prefix: p.prefix })),
60
+ );
75
61
  const app = createApp(
76
62
  authProvider,
77
- registry,
63
+ directory,
64
+ undefined,
78
65
  undefined,
79
- false,
80
66
  multiProjectRoot,
81
67
  );
82
- startApp(app, port);
68
+ await startApp(app, port, findPort && !useOsAssigned);
83
69
  }
84
70
 
85
- function startApp<E extends Env, S extends Schema, P extends string>(
71
+ async function startApp<E extends Env, S extends Schema, P extends string>(
86
72
  app: Hono<E, S, P>,
87
73
  port: number,
74
+ findPort: boolean,
88
75
  ) {
89
- serve(
90
- {
91
- fetch: app.fetch,
92
- port: port,
93
- hostname: process.env.HOST || '127.0.0.1',
94
- },
95
- (info) => {
96
- console.log(`Running Cyberismo app on http://localhost:${info.port}`);
97
- console.log('Press Control+C to stop.');
98
- // When spawned with stdio: [..., 'ipc'], publish the bound port to the parent.
99
- // No-op in normal startup (process.send is undefined without an IPC channel).
100
- process.send?.({ type: 'listening', port: info.port });
101
- },
76
+ const bound = await listen(
77
+ app.fetch,
78
+ port,
79
+ process.env.HOST || '127.0.0.1',
80
+ findPort ? port + MAX_PORT_ATTEMPTS : port,
102
81
  );
82
+ console.log(`Running Cyberismo app on http://localhost:${bound.port}`);
83
+ console.log('Press Control+C to stop.');
84
+ // When spawned with stdio: [..., 'ipc'], publish the bound port to the parent.
85
+ // No-op in normal startup (process.send is undefined without an IPC channel).
86
+ process.send?.({ type: 'listening', port: bound.port });
103
87
  }