unspaghettit 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/build/client/_app/immutable/assets/0.DSctqr5I.css +1 -0
  2. package/build/client/_app/immutable/assets/0.DSctqr5I.css.br +0 -0
  3. package/build/client/_app/immutable/assets/0.DSctqr5I.css.gz +0 -0
  4. package/build/client/_app/immutable/assets/BehaviorGraph.Bk0xQRZk.css +1 -0
  5. package/build/client/_app/immutable/assets/BehaviorGraph.Bk0xQRZk.css.br +0 -0
  6. package/build/client/_app/immutable/assets/BehaviorGraph.Bk0xQRZk.css.gz +0 -0
  7. package/build/client/_app/immutable/chunks/9nXQ5qrY2.js +1 -0
  8. package/build/client/_app/immutable/chunks/9nXQ5qrY2.js.br +0 -0
  9. package/build/client/_app/immutable/chunks/9nXQ5qrY2.js.gz +0 -0
  10. package/build/client/_app/immutable/chunks/B439_FLv.js +1 -0
  11. package/build/client/_app/immutable/chunks/B439_FLv.js.br +0 -0
  12. package/build/client/_app/immutable/chunks/B439_FLv.js.gz +0 -0
  13. package/build/client/_app/immutable/chunks/BCEY79Dw.js +1 -0
  14. package/build/client/_app/immutable/chunks/BCEY79Dw.js.br +2 -0
  15. package/build/client/_app/immutable/chunks/BCEY79Dw.js.gz +0 -0
  16. package/build/client/_app/immutable/chunks/{DBJWcC6Y.js → BYIrIC5L.js} +1 -1
  17. package/build/client/_app/immutable/chunks/BYIrIC5L.js.br +0 -0
  18. package/build/client/_app/immutable/chunks/BYIrIC5L.js.gz +0 -0
  19. package/build/client/_app/immutable/chunks/B_9TWPrx2.js +1 -0
  20. package/build/client/_app/immutable/chunks/B_9TWPrx2.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/B_9TWPrx2.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/BvOhVtZg.js +1 -0
  23. package/build/client/_app/immutable/chunks/BvOhVtZg.js.br +1 -0
  24. package/build/client/_app/immutable/chunks/BvOhVtZg.js.gz +0 -0
  25. package/build/client/_app/immutable/chunks/CY3em1ma2.js +1 -0
  26. package/build/client/_app/immutable/chunks/CY3em1ma2.js.br +0 -0
  27. package/build/client/_app/immutable/chunks/CY3em1ma2.js.gz +0 -0
  28. package/build/client/_app/immutable/chunks/CgdRZPgI.js +1 -0
  29. package/build/client/_app/immutable/chunks/CgdRZPgI.js.br +0 -0
  30. package/build/client/_app/immutable/chunks/CgdRZPgI.js.gz +0 -0
  31. package/build/client/_app/immutable/chunks/D5speDV82.js +908 -0
  32. package/build/client/_app/immutable/chunks/D5speDV82.js.br +0 -0
  33. package/build/client/_app/immutable/chunks/D5speDV82.js.gz +0 -0
  34. package/build/client/_app/immutable/chunks/DkxwAIfJ2.js +1 -0
  35. package/build/client/_app/immutable/chunks/DkxwAIfJ2.js.br +0 -0
  36. package/build/client/_app/immutable/chunks/DkxwAIfJ2.js.gz +0 -0
  37. package/build/client/_app/immutable/chunks/{DatGSObE.js → OJscNS3T.js} +1 -1
  38. package/build/client/_app/immutable/chunks/OJscNS3T.js.br +0 -0
  39. package/build/client/_app/immutable/chunks/OJscNS3T.js.gz +0 -0
  40. package/build/client/_app/immutable/chunks/U9p9CtKG2.js +2 -0
  41. package/build/client/_app/immutable/chunks/U9p9CtKG2.js.br +0 -0
  42. package/build/client/_app/immutable/chunks/U9p9CtKG2.js.gz +0 -0
  43. package/build/client/_app/immutable/entry/app.Cd4S3giu.js +2 -0
  44. package/build/client/_app/immutable/entry/app.Cd4S3giu.js.br +0 -0
  45. package/build/client/_app/immutable/entry/app.Cd4S3giu.js.gz +0 -0
  46. package/build/client/_app/immutable/entry/start.C3xXQVkq.js +1 -0
  47. package/build/client/_app/immutable/entry/start.C3xXQVkq.js.br +0 -0
  48. package/build/client/_app/immutable/entry/start.C3xXQVkq.js.gz +0 -0
  49. package/build/client/_app/immutable/nodes/0.dIOlQ-0y.js +4 -0
  50. package/build/client/_app/immutable/nodes/0.dIOlQ-0y.js.br +0 -0
  51. package/build/client/_app/immutable/nodes/0.dIOlQ-0y.js.gz +0 -0
  52. package/build/client/_app/immutable/nodes/{1.KYdA6ppX.js → 1.Dyte3Ggf.js} +1 -1
  53. package/build/client/_app/immutable/nodes/1.Dyte3Ggf.js.br +2 -0
  54. package/build/client/_app/immutable/nodes/1.Dyte3Ggf.js.gz +0 -0
  55. package/build/client/_app/immutable/nodes/10.ivxAosDg.js +2 -0
  56. package/build/client/_app/immutable/nodes/10.ivxAosDg.js.br +0 -0
  57. package/build/client/_app/immutable/nodes/10.ivxAosDg.js.gz +0 -0
  58. package/build/client/_app/immutable/nodes/{9.CMW6a2Lg.js → 11.wvMfJKC2.js} +1 -1
  59. package/build/client/_app/immutable/nodes/11.wvMfJKC2.js.br +0 -0
  60. package/build/client/_app/immutable/nodes/11.wvMfJKC2.js.gz +0 -0
  61. package/build/client/_app/immutable/nodes/{2.DBz20KgG.js → 2.CmPPom9Z.js} +1 -1
  62. package/build/client/_app/immutable/nodes/2.CmPPom9Z.js.br +0 -0
  63. package/build/client/_app/immutable/nodes/2.CmPPom9Z.js.gz +0 -0
  64. package/build/client/_app/immutable/nodes/3.D-iCGCEx.js +1 -0
  65. package/build/client/_app/immutable/nodes/3.D-iCGCEx.js.br +0 -0
  66. package/build/client/_app/immutable/nodes/3.D-iCGCEx.js.gz +0 -0
  67. package/build/client/_app/immutable/nodes/{4.BvMzqBJj.js → 4.DbfAvO8Z.js} +1 -1
  68. package/build/client/_app/immutable/nodes/4.DbfAvO8Z.js.br +0 -0
  69. package/build/client/_app/immutable/nodes/4.DbfAvO8Z.js.gz +0 -0
  70. package/build/client/_app/immutable/nodes/5.CC5Q7lVw.js +42 -0
  71. package/build/client/_app/immutable/nodes/5.CC5Q7lVw.js.br +0 -0
  72. package/build/client/_app/immutable/nodes/5.CC5Q7lVw.js.gz +0 -0
  73. package/build/client/_app/immutable/nodes/6.CHIjlzpO.js +1 -0
  74. package/build/client/_app/immutable/nodes/6.CHIjlzpO.js.br +0 -0
  75. package/build/client/_app/immutable/nodes/6.CHIjlzpO.js.gz +0 -0
  76. package/build/client/_app/immutable/nodes/{6.BOHISqs-.js → 7.Ejs18ZUc.js} +1 -1
  77. package/build/client/_app/immutable/nodes/7.Ejs18ZUc.js.br +0 -0
  78. package/build/client/_app/immutable/nodes/7.Ejs18ZUc.js.gz +0 -0
  79. package/build/client/_app/immutable/nodes/{7.CemgNJfw.js → 8.B-HweAc8.js} +1 -1
  80. package/build/client/_app/immutable/nodes/8.B-HweAc8.js.br +0 -0
  81. package/build/client/_app/immutable/nodes/8.B-HweAc8.js.gz +0 -0
  82. package/build/client/_app/immutable/nodes/9.CKPeM6tx.js +5 -0
  83. package/build/client/_app/immutable/nodes/9.CKPeM6tx.js.br +0 -0
  84. package/build/client/_app/immutable/nodes/9.CKPeM6tx.js.gz +0 -0
  85. package/build/client/_app/version.json +1 -1
  86. package/build/client/_app/version.json.br +0 -0
  87. package/build/client/_app/version.json.gz +0 -0
  88. package/build/client/lyriks_logo.svg +148 -0
  89. package/build/client/lyriks_logo.svg.br +0 -0
  90. package/build/client/lyriks_logo.svg.gz +0 -0
  91. package/build/server/chunks/{0-C_o0oz-N.js → 0-Co8kcANG.js} +4 -4
  92. package/build/server/chunks/{0-C_o0oz-N.js.map → 0-Co8kcANG.js.map} +1 -1
  93. package/build/server/chunks/1-BSUItTig.js +9 -0
  94. package/build/server/chunks/{1-DPpKAKXV.js.map → 1-BSUItTig.js.map} +1 -1
  95. package/build/server/chunks/10-BygvxrZp.js +9 -0
  96. package/build/server/chunks/10-BygvxrZp.js.map +1 -0
  97. package/build/server/chunks/11-DRx0tRx2.js +9 -0
  98. package/build/server/chunks/11-DRx0tRx2.js.map +1 -0
  99. package/build/server/chunks/{2-AlfFqtL1.js → 2-BQT3m1vc.js} +3 -3
  100. package/build/server/chunks/{2-AlfFqtL1.js.map → 2-BQT3m1vc.js.map} +1 -1
  101. package/build/server/chunks/{3-vbjUt_51.js → 3-DPZ9BquJ.js} +3 -3
  102. package/build/server/chunks/{3-vbjUt_51.js.map → 3-DPZ9BquJ.js.map} +1 -1
  103. package/build/server/chunks/{4-BNow4x6D.js → 4-DHo47YX6.js} +3 -3
  104. package/build/server/chunks/{4-BNow4x6D.js.map → 4-DHo47YX6.js.map} +1 -1
  105. package/build/server/chunks/5-Cp9evBAG.js +9 -0
  106. package/build/server/chunks/5-Cp9evBAG.js.map +1 -0
  107. package/build/server/chunks/6-DiBq3bOV.js +9 -0
  108. package/build/server/chunks/6-DiBq3bOV.js.map +1 -0
  109. package/build/server/chunks/{6-QQ7r8Rd5.js → 7-C4hmS0dG.js} +3 -3
  110. package/build/server/chunks/{6-QQ7r8Rd5.js.map → 7-C4hmS0dG.js.map} +1 -1
  111. package/build/server/chunks/{7-CbPLGaIG.js → 8-CFFuDzBC.js} +4 -4
  112. package/build/server/chunks/{7-CbPLGaIG.js.map → 8-CFFuDzBC.js.map} +1 -1
  113. package/build/server/chunks/9-nhhKZJrs.js +9 -0
  114. package/build/server/chunks/9-nhhKZJrs.js.map +1 -0
  115. package/build/server/chunks/BehaviorGraph-m5kYj5HH.js +757 -0
  116. package/build/server/chunks/BehaviorGraph-m5kYj5HH.js.map +1 -0
  117. package/build/server/chunks/{FeatureCard-BQOY6gJQ.js → FeatureCard-CfbXNYe8.js} +2 -2
  118. package/build/server/chunks/{FeatureCard-BQOY6gJQ.js.map → FeatureCard-CfbXNYe8.js.map} +1 -1
  119. package/build/server/chunks/{ProgressBar-CfhccQ83.js → ProgressBar-DDoQJ_C9.js} +2 -2
  120. package/build/server/chunks/ProgressBar-DDoQJ_C9.js.map +1 -0
  121. package/build/server/chunks/{ProjectsIndex-CoDrvRya.js → ProjectsIndex-DUVJ3hyL.js} +2 -2
  122. package/build/server/chunks/{ProjectsIndex-CoDrvRya.js.map → ProjectsIndex-DUVJ3hyL.js.map} +1 -1
  123. package/build/server/chunks/TransitionCatalog-B8zHs-2E.js +271 -0
  124. package/build/server/chunks/TransitionCatalog-B8zHs-2E.js.map +1 -0
  125. package/build/server/chunks/{_layout.svelte-BREws55o.js → _layout.svelte-CLTmk0xU.js} +66 -15
  126. package/build/server/chunks/_layout.svelte-CLTmk0xU.js.map +1 -0
  127. package/build/server/chunks/{_page.svelte-De508ek8.js → _page.svelte-B1nG3PKn.js} +4 -4
  128. package/build/server/chunks/{_page.svelte-De508ek8.js.map → _page.svelte-B1nG3PKn.js.map} +1 -1
  129. package/build/server/chunks/{_page.svelte-Zf9H4KOP.js → _page.svelte-BW_nbAAH.js} +11 -315
  130. package/build/server/chunks/_page.svelte-BW_nbAAH.js.map +1 -0
  131. package/build/server/chunks/{_page.svelte-BqSC-1vK.js → _page.svelte-Caq7J0jU.js} +91 -47
  132. package/build/server/chunks/_page.svelte-Caq7J0jU.js.map +1 -0
  133. package/build/server/chunks/{_page.svelte-B7hT3P8E.js → _page.svelte-Cham-dsM.js} +4 -4
  134. package/build/server/chunks/{_page.svelte-B7hT3P8E.js.map → _page.svelte-Cham-dsM.js.map} +1 -1
  135. package/build/server/chunks/_page.svelte-Dhwjwph_.js +41 -0
  136. package/build/server/chunks/_page.svelte-Dhwjwph_.js.map +1 -0
  137. package/build/server/chunks/{_page.svelte-BKKCa9H5.js → _page.svelte-DlFVT40-.js} +3 -3
  138. package/build/server/chunks/{_page.svelte-BKKCa9H5.js.map → _page.svelte-DlFVT40-.js.map} +1 -1
  139. package/build/server/chunks/{_page.svelte-BtI2zZ_Z.js → _page.svelte-NVT2dzpG.js} +176 -327
  140. package/build/server/chunks/_page.svelte-NVT2dzpG.js.map +1 -0
  141. package/build/server/chunks/{_page.svelte-BKTveFAj.js → _page.svelte-Oj-W7G5s.js} +5 -5
  142. package/build/server/chunks/{_page.svelte-BKTveFAj.js.map → _page.svelte-Oj-W7G5s.js.map} +1 -1
  143. package/build/server/chunks/_page.svelte-Z_kK2lHY.js +68 -0
  144. package/build/server/chunks/_page.svelte-Z_kK2lHY.js.map +1 -0
  145. package/build/server/chunks/{builderModeStore.svelte-ihupr-3p.js → builderModeStore.svelte-BpRIU_zP.js} +217 -6
  146. package/build/server/chunks/builderModeStore.svelte-BpRIU_zP.js.map +1 -0
  147. package/build/server/chunks/client-DeX3TC3s.js +51 -0
  148. package/build/server/chunks/{client-DfpLcAZ9.js.map → client-DeX3TC3s.js.map} +1 -1
  149. package/build/server/chunks/{error.svelte-C35KOpru.js → error.svelte-Cdjeq3L2.js} +4 -4
  150. package/build/server/chunks/{error.svelte-C35KOpru.js.map → error.svelte-Cdjeq3L2.js.map} +1 -1
  151. package/build/server/chunks/featureStore.svelte-DIYgPBVm.js +161 -0
  152. package/build/server/chunks/featureStore.svelte-DIYgPBVm.js.map +1 -0
  153. package/build/server/chunks/{hooks.server-Rv301GTB.js → hooks.server-y3jdg_sB.js} +6 -2
  154. package/build/server/chunks/hooks.server-y3jdg_sB.js.map +1 -0
  155. package/build/server/chunks/{internal-BPKrFkK1.js → internal-KYK0WpL7.js} +4 -4
  156. package/build/server/chunks/{internal-BPKrFkK1.js.map → internal-KYK0WpL7.js.map} +1 -1
  157. package/build/server/chunks/projectFeaturesStore.svelte-2o-72_vr.js +313 -0
  158. package/build/server/chunks/projectFeaturesStore.svelte-2o-72_vr.js.map +1 -0
  159. package/build/server/chunks/{reconcile-Dv7jS3C8.js → reconcile-B5xqb6-s.js} +3 -272
  160. package/build/server/chunks/reconcile-B5xqb6-s.js.map +1 -0
  161. package/build/server/chunks/registry-DqAn_hVE.js +21 -0
  162. package/build/server/chunks/registry-DqAn_hVE.js.map +1 -0
  163. package/build/server/chunks/{state-CpLVNZq7.js → state-DBjl9lhV.js} +2 -2
  164. package/build/server/chunks/{state-CpLVNZq7.js.map → state-DBjl9lhV.js.map} +1 -1
  165. package/build/server/index.js +1 -1
  166. package/build/server/index.js.map +1 -1
  167. package/build/server/manifest.js +33 -17
  168. package/build/server/manifest.js.map +1 -1
  169. package/cli/commands/dashboard.ts +14 -0
  170. package/cli/commands/init.ts +26 -0
  171. package/cli/commands/theme.ts +62 -0
  172. package/cli/unspa.ts +38 -2
  173. package/cli/util/context-files.ts +5 -0
  174. package/cli/util/theme.ts +34 -0
  175. package/mcp-server/sync-notifier.ts +88 -35
  176. package/package.json +2 -1
  177. package/src/app.css +187 -0
  178. package/src/app.html +15 -1
  179. package/src/features/behavior-model/domain/services/BehaviorGraphModel.ts +531 -0
  180. package/src/features/behavior-model/presentation/adapters/VisBehaviorGraphRenderer.ts +492 -0
  181. package/src/features/behavior-model/presentation/components/BehaviorGraph.svelte +370 -0
  182. package/src/features/behavior-model/presentation/components/FeatureHeader.svelte +13 -5
  183. package/src/features/behavior-model/presentation/view-models/BehaviorGraphTheme.ts +43 -0
  184. package/src/features/builder-mode/domain/BuilderModeDashboard.ts +7 -1
  185. package/src/features/builder-mode/presentation/components/BuilderModeDashboard.svelte +78 -16
  186. package/src/features/builder-mode/presentation/components/BuilderTagChips.svelte +25 -0
  187. package/src/features/builder-mode/presentation/stores/builderModeStore.svelte.ts +247 -3
  188. package/src/features/projects/presentation/components/ProjectEditor.svelte +7 -0
  189. package/src/features/simulator/application/use-cases/RunScenarios.ts +15 -1
  190. package/src/hooks.server.ts +11 -1
  191. package/src/lib/theme/registry.ts +77 -0
  192. package/src/lib/theme/themeStore.svelte.ts +64 -0
  193. package/src/routes/+layout.svelte +184 -30
  194. package/src/routes/features/[id]/graph/+page.svelte +34 -0
  195. package/src/routes/projects/[id]/graph/+page.svelte +79 -0
  196. package/src/shared/presentation/components/ProgressBar.svelte +1 -1
  197. package/src/shared/presentation/toast/SyncToast.svelte +14 -3
  198. package/src/shared/presentation/toast/viewLinkResolver.ts +32 -0
  199. package/static/lyriks_logo.svg +148 -0
  200. package/build/client/_app/immutable/assets/0.DFMDYAU9.css +0 -1
  201. package/build/client/_app/immutable/assets/0.DFMDYAU9.css.br +0 -0
  202. package/build/client/_app/immutable/assets/0.DFMDYAU9.css.gz +0 -0
  203. package/build/client/_app/immutable/chunks/BO66rBOa2.js +0 -1
  204. package/build/client/_app/immutable/chunks/BO66rBOa2.js.br +0 -0
  205. package/build/client/_app/immutable/chunks/BO66rBOa2.js.gz +0 -0
  206. package/build/client/_app/immutable/chunks/DBJWcC6Y.js.br +0 -0
  207. package/build/client/_app/immutable/chunks/DBJWcC6Y.js.gz +0 -0
  208. package/build/client/_app/immutable/chunks/DHoA038D.js +0 -1
  209. package/build/client/_app/immutable/chunks/DHoA038D.js.br +0 -2
  210. package/build/client/_app/immutable/chunks/DHoA038D.js.gz +0 -0
  211. package/build/client/_app/immutable/chunks/DatGSObE.js.br +0 -0
  212. package/build/client/_app/immutable/chunks/DatGSObE.js.gz +0 -0
  213. package/build/client/_app/immutable/chunks/DjWKKtqp.js +0 -1
  214. package/build/client/_app/immutable/chunks/DjWKKtqp.js.br +0 -1
  215. package/build/client/_app/immutable/chunks/DjWKKtqp.js.gz +0 -0
  216. package/build/client/_app/immutable/chunks/Dq0DUAz1.js +0 -1
  217. package/build/client/_app/immutable/chunks/Dq0DUAz1.js.br +0 -0
  218. package/build/client/_app/immutable/chunks/Dq0DUAz1.js.gz +0 -0
  219. package/build/client/_app/immutable/chunks/iQu0D9Ux.js +0 -1
  220. package/build/client/_app/immutable/chunks/iQu0D9Ux.js.br +0 -0
  221. package/build/client/_app/immutable/chunks/iQu0D9Ux.js.gz +0 -0
  222. package/build/client/_app/immutable/entry/app.CLgh6Mx_.js +0 -2
  223. package/build/client/_app/immutable/entry/app.CLgh6Mx_.js.br +0 -0
  224. package/build/client/_app/immutable/entry/app.CLgh6Mx_.js.gz +0 -0
  225. package/build/client/_app/immutable/entry/start.D5GPCQZD.js +0 -1
  226. package/build/client/_app/immutable/entry/start.D5GPCQZD.js.br +0 -0
  227. package/build/client/_app/immutable/entry/start.D5GPCQZD.js.gz +0 -0
  228. package/build/client/_app/immutable/nodes/0.BOoI-hsu.js +0 -4
  229. package/build/client/_app/immutable/nodes/0.BOoI-hsu.js.br +0 -0
  230. package/build/client/_app/immutable/nodes/0.BOoI-hsu.js.gz +0 -0
  231. package/build/client/_app/immutable/nodes/1.KYdA6ppX.js.br +0 -2
  232. package/build/client/_app/immutable/nodes/1.KYdA6ppX.js.gz +0 -0
  233. package/build/client/_app/immutable/nodes/2.DBz20KgG.js.br +0 -0
  234. package/build/client/_app/immutable/nodes/2.DBz20KgG.js.gz +0 -0
  235. package/build/client/_app/immutable/nodes/3.19DIoFtw.js +0 -1
  236. package/build/client/_app/immutable/nodes/3.19DIoFtw.js.br +0 -0
  237. package/build/client/_app/immutable/nodes/3.19DIoFtw.js.gz +0 -0
  238. package/build/client/_app/immutable/nodes/4.BvMzqBJj.js.br +0 -0
  239. package/build/client/_app/immutable/nodes/4.BvMzqBJj.js.gz +0 -0
  240. package/build/client/_app/immutable/nodes/5.Dq6obSGG.js +0 -42
  241. package/build/client/_app/immutable/nodes/5.Dq6obSGG.js.br +0 -0
  242. package/build/client/_app/immutable/nodes/5.Dq6obSGG.js.gz +0 -0
  243. package/build/client/_app/immutable/nodes/6.BOHISqs-.js.br +0 -0
  244. package/build/client/_app/immutable/nodes/6.BOHISqs-.js.gz +0 -0
  245. package/build/client/_app/immutable/nodes/7.CemgNJfw.js.br +0 -0
  246. package/build/client/_app/immutable/nodes/7.CemgNJfw.js.gz +0 -0
  247. package/build/client/_app/immutable/nodes/8.DejSfIYh.js +0 -5
  248. package/build/client/_app/immutable/nodes/8.DejSfIYh.js.br +0 -0
  249. package/build/client/_app/immutable/nodes/8.DejSfIYh.js.gz +0 -0
  250. package/build/client/_app/immutable/nodes/9.CMW6a2Lg.js.br +0 -0
  251. package/build/client/_app/immutable/nodes/9.CMW6a2Lg.js.gz +0 -0
  252. package/build/server/chunks/1-DPpKAKXV.js +0 -9
  253. package/build/server/chunks/5-D7OCJpxD.js +0 -9
  254. package/build/server/chunks/5-D7OCJpxD.js.map +0 -1
  255. package/build/server/chunks/8-CVO-E-sf.js +0 -9
  256. package/build/server/chunks/8-CVO-E-sf.js.map +0 -1
  257. package/build/server/chunks/9-DxT1baO5.js +0 -9
  258. package/build/server/chunks/9-DxT1baO5.js.map +0 -1
  259. package/build/server/chunks/ProgressBar-CfhccQ83.js.map +0 -1
  260. package/build/server/chunks/_layout.svelte-BREws55o.js.map +0 -1
  261. package/build/server/chunks/_page.svelte-BqSC-1vK.js.map +0 -1
  262. package/build/server/chunks/_page.svelte-BtI2zZ_Z.js.map +0 -1
  263. package/build/server/chunks/_page.svelte-Zf9H4KOP.js.map +0 -1
  264. package/build/server/chunks/builderModeStore.svelte-ihupr-3p.js.map +0 -1
  265. package/build/server/chunks/client-DfpLcAZ9.js +0 -24
  266. package/build/server/chunks/hooks.server-Rv301GTB.js.map +0 -1
  267. package/build/server/chunks/reconcile-Dv7jS3C8.js.map +0 -1
  268. /package/build/client/_app/immutable/assets/{9.nv0I59TU.css → 11.nv0I59TU.css} +0 -0
  269. /package/build/client/_app/immutable/assets/{9.nv0I59TU.css.br → 11.nv0I59TU.css.br} +0 -0
  270. /package/build/client/_app/immutable/assets/{9.nv0I59TU.css.gz → 11.nv0I59TU.css.gz} +0 -0
@@ -0,0 +1,492 @@
1
+ import type {
2
+ Edge as VisEdge,
3
+ IdType,
4
+ Network,
5
+ Node as VisNode,
6
+ Options as VisOptions
7
+ } from 'vis-network/standalone';
8
+ import type { DataSet } from 'vis-data/standalone';
9
+ import type {
10
+ BehaviorGraphEdge,
11
+ BehaviorGraphEdgeKind,
12
+ BehaviorGraphView,
13
+ BehaviorGraphViewNode
14
+ } from '$features/behavior-model/domain/services/BehaviorGraphModel';
15
+ import type {
16
+ BehaviorGraphEdgeTheme,
17
+ BehaviorGraphNodeTheme
18
+ } from '$features/behavior-model/presentation/view-models/BehaviorGraphTheme';
19
+
20
+ export type VisNetworkRuntime = typeof import('vis-network/standalone');
21
+
22
+ export type BehaviorGraphRendererCallbacks = {
23
+ readonly onSelectedNodeChange?: (id: string | null) => void;
24
+ readonly onSelectedEdgeChange?: (id: string | null) => void;
25
+ readonly onStabilizationProgress?: (progress: number) => void;
26
+ readonly onSettledChange?: (settled: boolean) => void;
27
+ };
28
+
29
+ export type BehaviorGraphRendererInput = {
30
+ readonly graph: BehaviorGraphView;
31
+ readonly selectedId: string | null;
32
+ readonly selectedEdgeId: string | null;
33
+ readonly labelsVisible: boolean;
34
+ readonly nodeTheme: Record<BehaviorGraphViewNode['type'], BehaviorGraphNodeTheme>;
35
+ readonly edgeTheme: Record<BehaviorGraphEdgeKind, BehaviorGraphEdgeTheme>;
36
+ };
37
+
38
+ type HighlightSnapshot = {
39
+ readonly nodes: ReadonlySet<IdType>;
40
+ readonly edges: ReadonlySet<IdType>;
41
+ };
42
+
43
+ type NodeVisualMode = 'base' | 'dimmed' | 'highlighted' | 'selected';
44
+ type EdgeVisualMode = 'base' | 'dimmed' | 'highlighted' | 'selected';
45
+
46
+ const IMPORTANT_EDGE_KINDS = new Set<BehaviorGraphEdgeKind>(['writes', 'emits', 'transitions']);
47
+ const DIMMED_NODE_OPACITY = 0.14;
48
+ const DIMMED_EDGE_OPACITY = 0.035;
49
+
50
+ const nodeSize = (degree: number): number => Math.max(13, Math.min(38, 13 + Math.sqrt(degree) * 6));
51
+
52
+ const hexToRgba = (color: string, alpha: number): string => {
53
+ const hex = color.replace('#', '');
54
+ if (hex.length !== 6) return color;
55
+ const red = Number.parseInt(hex.slice(0, 2), 16);
56
+ const green = Number.parseInt(hex.slice(2, 4), 16);
57
+ const blue = Number.parseInt(hex.slice(4, 6), 16);
58
+ return `rgba(${red},${green},${blue},${alpha})`;
59
+ };
60
+
61
+ const contrastTextFor = (color: string): '#000000' | '#ffffff' => {
62
+ const hex = color.replace('#', '');
63
+ if (hex.length !== 6) return '#000000';
64
+ const channel = (part: string): number => {
65
+ const value = Number.parseInt(part, 16) / 255;
66
+ return value <= 0.03928 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
67
+ };
68
+ const red = channel(hex.slice(0, 2));
69
+ const green = channel(hex.slice(2, 4));
70
+ const blue = channel(hex.slice(4, 6));
71
+ const luminance = 0.2126 * red + 0.7152 * green + 0.0722 * blue;
72
+ const blackContrast = (luminance + 0.05) / 0.05;
73
+ const whiteContrast = 1.05 / (luminance + 0.05);
74
+ return blackContrast >= whiteContrast ? '#000000' : '#ffffff';
75
+ };
76
+
77
+ const iterationsFor = (nodeCount: number): number => {
78
+ if (nodeCount > 700) return 220;
79
+ if (nodeCount > 300) return 280;
80
+ return 180;
81
+ };
82
+
83
+ const stabilizationDeadlineFor = (nodeCount: number): number => {
84
+ if (nodeCount > 700) return 2600;
85
+ if (nodeCount > 300) return 3200;
86
+ return 2400;
87
+ };
88
+
89
+ export class VisBehaviorGraphRenderer {
90
+ private network: Network | null = null;
91
+ private nodes: DataSet<VisNode, 'id'> | null = null;
92
+ private edges: DataSet<VisEdge, 'id'> | null = null;
93
+ private signature = '';
94
+ private currentInput: BehaviorGraphRendererInput | null = null;
95
+ private highlightFrame: number | null = null;
96
+ private highlighted: HighlightSnapshot = { nodes: new Set(), edges: new Set() };
97
+ private selectionEventsSuppressed = false;
98
+ private stabilizeTimeout: ReturnType<typeof setTimeout> | null = null;
99
+ private readonly settle = (): void => this.freezePhysics();
100
+
101
+ constructor(
102
+ private readonly runtime: VisNetworkRuntime,
103
+ private readonly container: HTMLElement,
104
+ private readonly callbacks: BehaviorGraphRendererCallbacks = {}
105
+ ) {}
106
+
107
+ render(input: BehaviorGraphRendererInput): void {
108
+ this.currentInput = input;
109
+ const signature = this.signatureFor(input);
110
+ if (!this.network) {
111
+ this.createNetwork(input, signature);
112
+ return;
113
+ }
114
+
115
+ if (signature === this.signature) {
116
+ this.select(input.selectedId, input.selectedEdgeId, false);
117
+ return;
118
+ }
119
+
120
+ this.signature = signature;
121
+ this.clearHighlight();
122
+ this.nodes?.clear();
123
+ this.edges?.clear();
124
+ this.nodes?.add(this.toNodes(input));
125
+ this.edges?.add(this.toEdges(input));
126
+ this.startStabilization(input.graph.nodes.length);
127
+ this.select(input.selectedId, input.selectedEdgeId, false);
128
+ }
129
+
130
+ relayout(nodeCount: number): void {
131
+ if (!this.network) return;
132
+ this.clearHighlight();
133
+ this.startStabilization(nodeCount);
134
+ }
135
+
136
+ fit(): void {
137
+ this.network?.fit({ animation: { duration: 220, easingFunction: 'easeInOutQuad' } });
138
+ }
139
+
140
+ zoomBy(factor: number): void {
141
+ if (!this.network) return;
142
+ const scale = Math.max(0.04, Math.min(5, this.network.getScale() * factor));
143
+ this.network.moveTo({
144
+ scale,
145
+ animation: { duration: 120, easingFunction: 'easeInOutQuad' }
146
+ });
147
+ }
148
+
149
+ focus(nodeId: string): void {
150
+ this.network?.focus(nodeId, {
151
+ scale: 1.08,
152
+ animation: { duration: 260, easingFunction: 'easeInOutQuad' }
153
+ });
154
+ }
155
+
156
+ select(nodeId: string | null, edgeId: string | null = null, focusSelection = true): void {
157
+ if (!this.network) return;
158
+ this.selectionEventsSuppressed = true;
159
+ try {
160
+ this.network.setSelection(
161
+ { nodes: nodeId ? [nodeId] : [], edges: !nodeId && edgeId ? [edgeId] : [] },
162
+ { highlightEdges: false }
163
+ );
164
+ } finally {
165
+ this.selectionEventsSuppressed = false;
166
+ }
167
+ if (nodeId) {
168
+ this.highlightNodeNeighborhood(nodeId, focusSelection);
169
+ return;
170
+ }
171
+ if (edgeId) {
172
+ this.highlightEdgeNeighborhood(edgeId, focusSelection);
173
+ return;
174
+ }
175
+ this.clearHighlight();
176
+ }
177
+
178
+ destroy(): void {
179
+ this.clearPendingWork();
180
+ this.network?.destroy();
181
+ this.network = null;
182
+ this.nodes = null;
183
+ this.edges = null;
184
+ }
185
+
186
+ private createNetwork(input: BehaviorGraphRendererInput, signature: string): void {
187
+ const nodes = new this.runtime.DataSet<VisNode, 'id'>(this.toNodes(input));
188
+ const edges = new this.runtime.DataSet<VisEdge, 'id'>(this.toEdges(input));
189
+ this.nodes = nodes;
190
+ this.edges = edges;
191
+ const network = new this.runtime.Network(this.container, { nodes, edges }, this.options(input.graph.nodes.length));
192
+ this.network = network;
193
+ this.signature = signature;
194
+
195
+ network.on('stabilizationProgress', (params?: { iterations: number; total: number }) => {
196
+ if (!params?.total) return;
197
+ const progress = Math.min(100, Math.round((params.iterations / params.total) * 100));
198
+ this.callbacks.onStabilizationProgress?.(progress);
199
+ if (progress >= 100) {
200
+ setTimeout(() => this.freezePhysics(), 0);
201
+ }
202
+ });
203
+ network.on('selectNode', (params?: { nodes: IdType[] }) => {
204
+ if (this.selectionEventsSuppressed) return;
205
+ const id = params?.nodes?.find((node): node is string => typeof node === 'string') ?? null;
206
+ this.callbacks.onSelectedNodeChange?.(id);
207
+ this.callbacks.onSelectedEdgeChange?.(null);
208
+ if (id) this.highlightNodeNeighborhood(id, true);
209
+ });
210
+ network.on('selectEdge', (params?: { edges: IdType[] }) => {
211
+ if (this.selectionEventsSuppressed) return;
212
+ const id = params?.edges?.find((edge): edge is string => typeof edge === 'string') ?? null;
213
+ this.callbacks.onSelectedNodeChange?.(null);
214
+ this.callbacks.onSelectedEdgeChange?.(id);
215
+ if (id) this.highlightEdgeNeighborhood(id, true);
216
+ });
217
+ network.on('deselectNode', () => {
218
+ if (this.selectionEventsSuppressed) return;
219
+ if (this.network?.getSelection().edges.length) return;
220
+ this.callbacks.onSelectedNodeChange?.(null);
221
+ this.clearHighlight();
222
+ });
223
+ network.on('deselectEdge', () => {
224
+ if (this.selectionEventsSuppressed) return;
225
+ if (this.network?.getSelection().nodes.length) return;
226
+ this.callbacks.onSelectedEdgeChange?.(null);
227
+ this.clearHighlight();
228
+ });
229
+
230
+ this.startStabilization(input.graph.nodes.length);
231
+ }
232
+
233
+ private startStabilization(nodeCount: number): void {
234
+ if (!this.network) return;
235
+ this.clearStabilizationTimeout();
236
+ this.callbacks.onSettledChange?.(false);
237
+ this.callbacks.onStabilizationProgress?.(0);
238
+ this.network.off('stabilized', this.settle);
239
+ this.network.once('stabilized', this.settle);
240
+ this.network.setOptions(this.options(nodeCount));
241
+ this.network.stabilize(iterationsFor(nodeCount));
242
+ this.stabilizeTimeout = setTimeout(() => this.freezePhysics(), stabilizationDeadlineFor(nodeCount));
243
+ }
244
+
245
+ private freezePhysics(): void {
246
+ if (!this.network) return;
247
+ this.clearStabilizationTimeout();
248
+ this.network.off('stabilized', this.settle);
249
+ this.network.storePositions();
250
+ this.network.stopSimulation();
251
+ this.network.setOptions({ physics: false });
252
+ this.callbacks.onStabilizationProgress?.(100);
253
+ this.callbacks.onSettledChange?.(true);
254
+ }
255
+
256
+ private options(nodeCount: number): VisOptions {
257
+ return {
258
+ autoResize: true,
259
+ interaction: {
260
+ hover: false,
261
+ tooltipDelay: 1000000,
262
+ dragNodes: true,
263
+ dragView: true,
264
+ zoomView: true,
265
+ multiselect: false,
266
+ navigationButtons: false,
267
+ keyboard: false
268
+ },
269
+ layout: {
270
+ improvedLayout: nodeCount < 350
271
+ },
272
+ physics: {
273
+ enabled: true,
274
+ solver: 'forceAtlas2Based',
275
+ stabilization: {
276
+ enabled: true,
277
+ iterations: iterationsFor(nodeCount),
278
+ updateInterval: 40,
279
+ fit: true
280
+ },
281
+ forceAtlas2Based: {
282
+ gravitationalConstant: nodeCount > 500 ? -34 : -48,
283
+ centralGravity: 0.014,
284
+ springLength: nodeCount > 500 ? 95 : 120,
285
+ springConstant: 0.055,
286
+ damping: 0.74,
287
+ avoidOverlap: nodeCount > 500 ? 0.25 : 0.45
288
+ },
289
+ adaptiveTimestep: true,
290
+ minVelocity: 2.2,
291
+ maxVelocity: 28
292
+ },
293
+ nodes: {
294
+ chosen: true,
295
+ scaling: { min: 13, max: 42 },
296
+ shapeProperties: { borderRadius: 4 }
297
+ },
298
+ edges: {
299
+ chosen: false,
300
+ selectionWidth: 1
301
+ }
302
+ };
303
+ }
304
+
305
+ private toNodes(input: BehaviorGraphRendererInput): VisNode[] {
306
+ return input.graph.nodes.map((node) => this.nodeFor(node, input, node.id === input.selectedId ? 'selected' : 'base'));
307
+ }
308
+
309
+ private nodeFor(
310
+ node: BehaviorGraphViewNode,
311
+ input: BehaviorGraphRendererInput,
312
+ mode: NodeVisualMode
313
+ ): VisNode {
314
+ const showManyLabels = input.labelsVisible || input.graph.nodes.length < 90;
315
+ const theme = input.nodeTheme[node.type];
316
+ const dimmed = mode === 'dimmed';
317
+ const selected = mode === 'selected';
318
+ const highlighted = mode === 'highlighted' || selected;
319
+ const showLabel = !dimmed && (showManyLabels || node.degree > 5 || node.type === 'feature' || highlighted);
320
+ const hasLabelContainer = node.type !== 'feature' && showLabel;
321
+ return {
322
+ id: node.id,
323
+ label: showLabel ? node.label : '',
324
+ title: `${theme.label}: ${node.label}${node.detail ? `\n${node.detail}` : ''}`,
325
+ value: Math.max(1, node.degree),
326
+ size: nodeSize(node.degree),
327
+ shape: node.type === 'feature' || !showLabel ? 'dot' : 'box',
328
+ color: {
329
+ background: dimmed ? hexToRgba(theme.fill, DIMMED_NODE_OPACITY) : theme.fill,
330
+ border: dimmed ? hexToRgba(theme.stroke, 0.2) : selected ? '#020617' : theme.stroke,
331
+ highlight: { background: theme.fill, border: '#020617' },
332
+ hover: { background: theme.fill, border: theme.stroke }
333
+ },
334
+ borderWidth: selected ? 5 : highlighted ? 3.5 : 1.5,
335
+ font: {
336
+ color: hasLabelContainer ? contrastTextFor(theme.fill) : '#0f172a',
337
+ size: selected ? 16 : highlighted ? 13 : 12,
338
+ face: 'Inter, ui-sans-serif, system-ui, sans-serif',
339
+ strokeWidth: hasLabelContainer || dimmed ? 0 : 4,
340
+ strokeColor: 'rgba(255,255,255,0.92)'
341
+ },
342
+ margin: hasLabelContainer ? { top: 6, right: 10, bottom: 6, left: 10 } : undefined,
343
+ widthConstraint: hasLabelContainer ? { maximum: 220 } : undefined,
344
+ shadow: !dimmed && (highlighted || node.type === 'feature' || node.degree > 8)
345
+ };
346
+ }
347
+
348
+ private toEdges(input: BehaviorGraphRendererInput): VisEdge[] {
349
+ return input.graph.edges.map((edge) => this.edgeFor(edge, input.edgeTheme, 'base'));
350
+ }
351
+
352
+ private edgeFor(
353
+ edge: BehaviorGraphEdge,
354
+ edgeTheme: Record<BehaviorGraphEdgeKind, BehaviorGraphEdgeTheme>,
355
+ mode: EdgeVisualMode
356
+ ): VisEdge {
357
+ const important = IMPORTANT_EDGE_KINDS.has(edge.kind);
358
+ const opacity =
359
+ mode === 'selected' ? 0.96 : mode === 'highlighted' ? 0.82 : mode === 'dimmed' ? DIMMED_EDGE_OPACITY : important ? 0.42 : 0.18;
360
+ return {
361
+ id: edge.id,
362
+ from: edge.from,
363
+ to: edge.to,
364
+ title: edge.label ?? edgeTheme[edge.kind].label,
365
+ color: { color: edgeTheme[edge.kind].color, opacity },
366
+ width: mode === 'selected' ? 3 : mode === 'highlighted' ? 2.2 : important ? 1.5 : 0.7,
367
+ dashes: edge.kind === 'contains',
368
+ arrows: { to: { enabled: edge.kind !== 'contains', scaleFactor: 0.45 } },
369
+ smooth: false
370
+ };
371
+ }
372
+
373
+ private highlightNodeNeighborhood(nodeId: string, focusSelection: boolean): void {
374
+ if (!this.network || !this.nodes || !this.edges) return;
375
+ if (this.highlightFrame !== null) cancelAnimationFrame(this.highlightFrame);
376
+ this.highlightFrame = requestAnimationFrame(() => {
377
+ const input = this.currentInput;
378
+ if (!this.network || !this.nodes || !this.edges || !input) return;
379
+ const connectedNodes = new Set<IdType>([
380
+ nodeId,
381
+ ...this.network
382
+ .getConnectedNodes(nodeId)
383
+ .filter((id): id is IdType => typeof id === 'string' || typeof id === 'number')
384
+ ]);
385
+ const connectedEdges = new Set<IdType>(this.network.getConnectedEdges(nodeId));
386
+ this.applyFocusMask({ selectedNodeId: nodeId, highlightedNodes: connectedNodes, highlightedEdges: connectedEdges });
387
+ if (focusSelection) this.fitNeighborhood(connectedNodes);
388
+ this.highlighted = { nodes: connectedNodes, edges: connectedEdges };
389
+ this.highlightFrame = null;
390
+ });
391
+ }
392
+
393
+ private highlightEdgeNeighborhood(edgeId: string, focusSelection: boolean): void {
394
+ if (!this.network || !this.nodes || !this.edges) return;
395
+ if (this.highlightFrame !== null) cancelAnimationFrame(this.highlightFrame);
396
+ this.highlightFrame = requestAnimationFrame(() => {
397
+ const input = this.currentInput;
398
+ if (!this.network || !this.nodes || !this.edges || !input) return;
399
+ const selectedEdge = input.graph.edges.find((edge) => edge.id === edgeId);
400
+ if (!selectedEdge) return;
401
+ const connectedNodes = new Set<IdType>([selectedEdge.from, selectedEdge.to]);
402
+ const connectedEdges = new Set<IdType>([edgeId]);
403
+ for (const nodeId of [selectedEdge.from, selectedEdge.to]) {
404
+ for (const neighbor of this.network.getConnectedNodes(nodeId)) {
405
+ if (typeof neighbor === 'string' || typeof neighbor === 'number') connectedNodes.add(neighbor);
406
+ }
407
+ for (const edge of this.network.getConnectedEdges(nodeId)) connectedEdges.add(edge);
408
+ }
409
+ this.applyFocusMask({ selectedEdgeId: edgeId, highlightedNodes: connectedNodes, highlightedEdges: connectedEdges });
410
+ if (focusSelection) this.fitNeighborhood(connectedNodes);
411
+ this.highlighted = { nodes: connectedNodes, edges: connectedEdges };
412
+ this.highlightFrame = null;
413
+ });
414
+ }
415
+
416
+ private applyFocusMask({
417
+ selectedNodeId,
418
+ selectedEdgeId,
419
+ highlightedNodes,
420
+ highlightedEdges
421
+ }: {
422
+ readonly selectedNodeId?: string;
423
+ readonly selectedEdgeId?: string;
424
+ readonly highlightedNodes: ReadonlySet<IdType>;
425
+ readonly highlightedEdges: ReadonlySet<IdType>;
426
+ }): void {
427
+ if (!this.nodes || !this.edges) return;
428
+ const input = this.currentInput;
429
+ if (!input) return;
430
+ this.nodes.update(
431
+ input.graph.nodes.map((node) => {
432
+ const mode: NodeVisualMode =
433
+ node.id === selectedNodeId ? 'selected' : highlightedNodes.has(node.id) ? 'highlighted' : 'dimmed';
434
+ return this.nodeFor(node, input, mode);
435
+ })
436
+ );
437
+ this.edges.update(
438
+ input.graph.edges.map((edge) => {
439
+ const mode: EdgeVisualMode =
440
+ edge.id === selectedEdgeId ? 'selected' : highlightedEdges.has(edge.id) ? 'highlighted' : 'dimmed';
441
+ return this.edgeFor(edge, input.edgeTheme, mode);
442
+ })
443
+ );
444
+ }
445
+
446
+ private fitNeighborhood(nodeIds: ReadonlySet<IdType>): void {
447
+ if (!this.network || nodeIds.size === 0) return;
448
+ this.network.fit({
449
+ nodes: [...nodeIds],
450
+ minZoomLevel: 0.24,
451
+ maxZoomLevel: 1.18,
452
+ animation: { duration: 320, easingFunction: 'easeInOutQuad' }
453
+ });
454
+ }
455
+
456
+ private clearHighlight(): void {
457
+ this.clearPendingHighlight();
458
+ this.restoreHighlightBase();
459
+ this.highlighted = { nodes: new Set(), edges: new Set() };
460
+ }
461
+
462
+ private restoreHighlightBase(): void {
463
+ if (!this.nodes || !this.edges) return;
464
+ const input = this.currentInput;
465
+ if (!input) return;
466
+ this.nodes.update(input.graph.nodes.map((node) => this.nodeFor(node, input, node.id === input.selectedId ? 'selected' : 'base')));
467
+ this.edges.update(input.graph.edges.map((edge) => this.edgeFor(edge, input.edgeTheme, 'base')));
468
+ }
469
+
470
+ private clearPendingWork(): void {
471
+ this.clearPendingHighlight();
472
+ this.clearStabilizationTimeout();
473
+ }
474
+
475
+ private clearPendingHighlight(): void {
476
+ if (this.highlightFrame !== null) {
477
+ cancelAnimationFrame(this.highlightFrame);
478
+ this.highlightFrame = null;
479
+ }
480
+ }
481
+
482
+ private clearStabilizationTimeout(): void {
483
+ if (this.stabilizeTimeout) {
484
+ clearTimeout(this.stabilizeTimeout);
485
+ this.stabilizeTimeout = null;
486
+ }
487
+ }
488
+
489
+ private signatureFor(input: BehaviorGraphRendererInput): string {
490
+ return `${input.graph.nodes.map((node) => node.id).join('|')}::${input.graph.edges.map((edge) => edge.id).join('|')}::labels=${input.labelsVisible}`;
491
+ }
492
+ }