@runeya/runeya 2.0.94 → 2.0.95

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 (261) hide show
  1. package/agent/index.js +22 -1
  2. package/agent/index.js.map +1 -1
  3. package/agent-manager-QQPKKLKY.js +8 -0
  4. package/chat-LPMGV2VS.js +18 -0
  5. package/chat-LPMGV2VS.js.map +1 -0
  6. package/chunk-3MJLS5UY.js +1944 -0
  7. package/chunk-3MJLS5UY.js.map +1 -0
  8. package/chunk-72LQC3YC.js +152 -0
  9. package/chunk-72LQC3YC.js.map +1 -0
  10. package/{chunk-4PQXBTV6.js → chunk-HX3ZIWHM.js} +82 -1959
  11. package/chunk-HX3ZIWHM.js.map +1 -0
  12. package/chunk-MD3VW4HQ.js +160 -0
  13. package/chunk-MD3VW4HQ.js.map +1 -0
  14. package/chunk-R23UUB5R.js +7285 -0
  15. package/chunk-R23UUB5R.js.map +1 -0
  16. package/chunk-WAC56HS4.js +1842 -0
  17. package/chunk-WAC56HS4.js.map +1 -0
  18. package/codex-thread-db-LE5FYDDA.js +27 -0
  19. package/codex-thread-db-LE5FYDDA.js.map +1 -0
  20. package/companion-VPYVGTRU.js +42 -0
  21. package/companion-VPYVGTRU.js.map +1 -0
  22. package/index.js +1 -1
  23. package/package.json +1 -1
  24. package/settings-manager-6FKHBLIV.js +8 -0
  25. package/settings-manager-6FKHBLIV.js.map +1 -0
  26. package/src-NEPDGULO.js +10087 -0
  27. package/src-NEPDGULO.js.map +1 -0
  28. package/web/assets/AgentScalarChatInterface.vue-DCnwgzWk.js +13 -0
  29. package/web/assets/AgentTerminalPage-D6iEzvyz.js +1 -0
  30. package/web/assets/AiChatPage-DDr9XEv8.js +1 -0
  31. package/web/assets/AppLayout-B2mreJVA.js +1 -0
  32. package/web/assets/{AppLayout-Sk3Qnkr-.css → AppLayout-nrP0jOZ1.css} +1 -1
  33. package/web/assets/AuditPage-CSPHdf0m.js +1 -0
  34. package/web/assets/CloudAccountPage-BAkTRH4E.js +1 -0
  35. package/web/assets/CloudAccountPage-C35O8Pcb.js +1 -0
  36. package/web/assets/CloudMessagingPage-5KYELXQI.js +2 -0
  37. package/web/assets/DashboardPage-Dl9Sg1av.js +1 -0
  38. package/web/assets/DirectoryPickerDialog-DLL3-GoW.js +1 -0
  39. package/web/assets/{EditorIcon-CdvuLNAP.js → EditorIcon-CzgSjXLk.js} +2 -2
  40. package/web/assets/{EnvironmentForm-BiWvLVax.js → EnvironmentForm-DmdDIJHv.js} +2 -2
  41. package/web/assets/EnvironmentFormPage-CV7Uq6Ah.js +1 -0
  42. package/web/assets/EnvironmentListPage-Cfo9RA_g.js +1 -0
  43. package/web/assets/KanbanBoardPage-DL1WwMBP.js +4 -0
  44. package/web/assets/KanbanListPage-CSAnUfp3.js +1 -0
  45. package/web/assets/LaunchProjectPage-vNUoulGP.js +1 -0
  46. package/web/assets/LaunchServicesPage-CkWZxZ-v.js +1 -0
  47. package/web/assets/LogViewer-CW-bBjZF.js +3 -0
  48. package/web/assets/OrgKeyPrompt-CHoMbQhn.js +1 -0
  49. package/web/assets/ProcessControls-WS6BjS5H.js +1 -0
  50. package/web/assets/ProcessDetailPage-DEvZSNER.js +1 -0
  51. package/web/assets/{ProcessMetrics-_FGC-0hm.js → ProcessMetrics-DmhwoKrE.js} +2 -2
  52. package/web/assets/ProjectDetailPage-DanRrWb4.js +1 -0
  53. package/web/assets/ProjectListPage--l9HsQ9u.js +1 -0
  54. package/web/assets/RandomJobTestPage-BMatxc2G.js +2 -0
  55. package/web/assets/ScenarioEditorPage-D_rJyudb.js +14 -0
  56. package/web/assets/SendToChatDialog-D-pDvIjD.js +1 -0
  57. package/web/assets/ServiceControlsBar-BSU25sZZ.js +1 -0
  58. package/web/assets/ServiceDetailPage-B1oRlnId.js +2 -0
  59. package/web/assets/ServiceFormPage-D-DmI0fF.js +1 -0
  60. package/web/assets/SettingsPage-Bi72zdhb.js +2063 -0
  61. package/web/assets/{SettingsPage-CX1EAjNK.css → SettingsPage-D6-jpORY.css} +1 -1
  62. package/web/assets/UnlockPage-BtunlGnX.js +1 -0
  63. package/web/assets/VariablesTable-D3HpHlKY.js +1 -0
  64. package/web/assets/VaultMigrationPage-DrrFR1I-.js +1 -0
  65. package/web/assets/VersionBadge-DqcS34oJ.js +1 -0
  66. package/web/assets/WikiPage-BH8A-IB_.js +1 -0
  67. package/web/assets/WikiView-BasNZv2A.js +1 -0
  68. package/web/assets/add-scalar-classes-_PYrgVvq.js +387 -0
  69. package/web/assets/auth-errors-CwswzwYV.js +1 -0
  70. package/web/assets/{autocomplete-tNXsUW-e.js → autocomplete-B-t_B26t.js} +3 -3
  71. package/web/assets/{basic-shape-diamond.svg-BgNul67K.js → basic-shape-diamond.svg-BFWFQIZl.js} +1 -1
  72. package/web/assets/{basic-shape-hexagon.svg-CILNnZwG.js → basic-shape-hexagon.svg-CXsvZPky.js} +1 -1
  73. package/web/assets/{basic-shape-primary-circle-ellipse-round.svg-OXklrBAn.js → basic-shape-primary-circle-ellipse-round.svg-BVg6oDS7.js} +1 -1
  74. package/web/assets/{basic-shape-primary-square-rectangle.svg-DYF4zyUj.js → basic-shape-primary-square-rectangle.svg-jiLWQSQV.js} +1 -1
  75. package/web/assets/{basic-shape-shield.svg-CQbzQswT.js → basic-shape-shield.svg-CEybfnew.js} +1 -1
  76. package/web/assets/{browser-CDtVZzm0.js → browser-BfO6Jws3.js} +1 -1
  77. package/web/assets/{browser-CdTGBSDI.js → browser-C7Qh0u0N.js} +1 -1
  78. package/web/assets/card-CWgnvlKH.js +32 -0
  79. package/web/assets/{checkbox-CTopTVtp.js → checkbox-CKzrAJQv.js} +3 -3
  80. package/web/assets/{chip-Cw38kJ50.js → chip-Bu5HllmO.js} +2 -2
  81. package/web/assets/{client-Bjn9AL4v.js → client-CM-a2QU7.js} +2 -2
  82. package/web/assets/cloud-chat.store-Cjbzzy1s.js +1 -0
  83. package/web/assets/cloud-session-Bs6siQ-Y.js +1 -0
  84. package/web/assets/column-pXrOxKc1.js +907 -0
  85. package/web/assets/{computer-device-desktop-monitor.svg-ByBKx1CQ.js → computer-device-desktop-monitor.svg-DO-9EDqA.js} +1 -1
  86. package/web/assets/{computer-device-desktop.svg-BPvzT4sF.js → computer-device-desktop.svg-U_EIk7jo.js} +1 -1
  87. package/web/assets/{computer-device-laptop.svg-saGCSB2c.js → computer-device-laptop.svg-nvbz6sjk.js} +1 -1
  88. package/web/assets/{computer-device-mobile-phone-android-samsung-back.svg-Bo-eisU4.js → computer-device-mobile-phone-android-samsung-back.svg-Cs34LunN.js} +1 -1
  89. package/web/assets/{computer-device-mobile-phone-android-samsung.svg-Bavaieis.js → computer-device-mobile-phone-android-samsung.svg-CDJgG-4L.js} +1 -1
  90. package/web/assets/{computer-device-mobile-phone-iphone-x-back.svg-BQK9BRXi.js → computer-device-mobile-phone-iphone-x-back.svg-Du0pDh9L.js} +1 -1
  91. package/web/assets/{computer-device-mobile-phone-iphone-x.svg-C24hCDuI.js → computer-device-mobile-phone-iphone-x.svg-CUgXFf2r.js} +1 -1
  92. package/web/assets/{computer-device-mobile-tablet-touch.svg-CUHV3zSo.js → computer-device-mobile-tablet-touch.svg-CKdx-iUf.js} +1 -1
  93. package/web/assets/{computer-device-mobile-tablet.svg-C8SRYMmI.js → computer-device-mobile-tablet.svg-BTvPzs5h.js} +1 -1
  94. package/web/assets/{computer-device-network-ethernet-cat6.svg-Ds4kUid3.js → computer-device-network-ethernet-cat6.svg-Cway8Bfw.js} +1 -1
  95. package/web/assets/{computer-device-network-lan-www.svg-BwIieS6h.js → computer-device-network-lan-www.svg-iuTZVSKE.js} +1 -1
  96. package/web/assets/{computer-device-network-wifi-connection.svg-Q7Mxb3eP.js → computer-device-network-wifi-connection.svg-DEemVGZq.js} +1 -1
  97. package/web/assets/{computer-device-network-wifi-router.svg-B0PMuY1x.js → computer-device-network-wifi-router.svg-BH2ASeRD.js} +1 -1
  98. package/web/assets/{cssMode-8lAGHoa8.js → cssMode-BHBdzmoS.js} +1 -1
  99. package/web/assets/{divider-DRKb8XBY.js → divider-kwmULX2U.js} +2 -2
  100. package/web/assets/{docx-preview-K0JOmyAw.js → docx-preview-CxXKUxi7.js} +1 -1
  101. package/web/assets/{ecology-science-erlenmeyer-flask.svg-D5wbPwU2.js → ecology-science-erlenmeyer-flask.svg-9yLzulSu.js} +1 -1
  102. package/web/assets/{fieldset-jU8x6yyO.js → fieldset-DE0sJS29.js} +2 -2
  103. package/web/assets/{freemarker2-BmTZDOK9.js → freemarker2-CpcoAmNk.js} +1 -1
  104. package/web/assets/{handlebars-DM-mBhq3.js → handlebars-D6DR-MoZ.js} +1 -1
  105. package/web/assets/{html-BohxI4Ke.js → html-Dx3QwrZR.js} +1 -1
  106. package/web/assets/{htmlMode-vqRVK3v5.js → htmlMode-KSJ_gFzK.js} +1 -1
  107. package/web/assets/{image-flash-lightning.svg-s-LoyOp-.js → image-flash-lightning.svg-O9m-H64P.js} +1 -1
  108. package/web/assets/{image-picture-flower.svg-CofKZT5Q.js → image-picture-flower.svg--rWVVuqu.js} +1 -1
  109. package/web/assets/{index-Da38OOd8.css → index-B4UWj2Kz.css} +1 -1
  110. package/web/assets/{index-DHr5P6pq.js → index-pLefgbhx.js} +287 -287
  111. package/web/assets/{interface-alert-exclamation-diamond.svg-C4C4i4oQ.js → interface-alert-exclamation-diamond.svg-CVeV0ecY.js} +1 -1
  112. package/web/assets/{interface-alert-exclamation-triangle-warning.svg-C-ogsTXk.js → interface-alert-exclamation-triangle-warning.svg-MIboYRzH.js} +1 -1
  113. package/web/assets/{interface-alert-information-circle.svg-BFpBDkj5.js → interface-alert-information-circle.svg-BlkHMxfH.js} +1 -1
  114. package/web/assets/{interface-award-crown.svg-DfHdQ8rJ.js → interface-award-crown.svg-C_Z3sLuP.js} +1 -1
  115. package/web/assets/{interface-bookmark.svg-qCQ3v5rM.js → interface-bookmark-tag.svg-ClOZOhfV.js} +1 -1
  116. package/web/assets/{interface-bookmark-tag.svg-DkfXcRMe.js → interface-bookmark.svg-CVpTNe3u.js} +1 -1
  117. package/web/assets/{interface-calendar-date-one.svg-D2ssTK7X.js → interface-calendar-date-one.svg-BvG92AQi.js} +1 -1
  118. package/web/assets/{interface-content-book-open-pages.svg-CH1BmaVm.js → interface-content-book-open-pages.svg-aXXXkj7d.js} +1 -1
  119. package/web/assets/{interface-content-book-page.svg-BU6m1d9-.js → interface-content-book-page.svg-BE0nQJw_.js} +1 -1
  120. package/web/assets/{interface-content-file.svg-DbsUtWTI.js → interface-content-file.svg-DYonyE7J.js} +1 -1
  121. package/web/assets/{interface-content-folder.svg-8IvlkKzB.js → interface-content-folder.svg-DKc7vKrm.js} +1 -1
  122. package/web/assets/interface-content-folder.svg-FcNZvOjy.js +1 -0
  123. package/web/assets/{interface-copy-clipboard.svg-D8ev9OtX.js → interface-copy-clipboard.svg-sAixmHqz.js} +1 -1
  124. package/web/assets/{interface-edit-attachment.svg-dl-nfI3P.js → interface-edit-attachment.svg-DsSzCN6U.js} +1 -1
  125. package/web/assets/{interface-edit-binocular.svg-Box_OuXH.js → interface-edit-binocular.svg-Bheco9Gv.js} +1 -1
  126. package/web/assets/{interface-edit-magic-wand.svg-DIhMw--x.js → interface-edit-magic-wand.svg-C73TY2iI.js} +1 -1
  127. package/web/assets/{interface-edit-tool-paint-roller.svg-COUefijc.js → interface-edit-tool-paint-roller.svg-D2OSqY3g.js} +1 -1
  128. package/web/assets/{interface-edit-tool-pencil.svg-BNmSspcl.js → interface-edit-tool-pencil.svg-CdY316cw.js} +1 -1
  129. package/web/assets/{interface-favorite-award.svg-Cy-XeB8N.js → interface-favorite-award.svg-DfA-EhHI.js} +1 -1
  130. package/web/assets/{interface-favorite-flag.svg-BVBisei8.js → interface-favorite-flag.svg-BnmSaveE.js} +1 -1
  131. package/web/assets/{interface-favorite-heart.svg-BkVO2jBo.js → interface-favorite-heart.svg-28i7lMzG.js} +1 -1
  132. package/web/assets/{interface-favorite-star.svg-Bxe8dqRi.js → interface-favorite-star.svg-u8xOEB4S.js} +1 -1
  133. package/web/assets/{interface-favorite-stars-sparkles.svg-MkrYfhIz.js → interface-favorite-stars-sparkles.svg-D5UHf8ar.js} +1 -1
  134. package/web/assets/{interface-hierarchy-flowchart.svg-De7TQhr3.js → interface-hierarchy-flowchart.svg-BmjWTh4K.js} +1 -1
  135. package/web/assets/{interface-home-house.svg-D_qOil1N.js → interface-home-house.svg-DJ5Ae65N.js} +1 -1
  136. package/web/assets/{interface-hyperlink.svg-5S7ugTcP.js → interface-hyperlink.svg-HdHKY_g6.js} +1 -1
  137. package/web/assets/{interface-lighting-brightness.svg-vJA95mbx.js → interface-lighting-brightness.svg-BDELfqMb.js} +1 -1
  138. package/web/assets/{interface-lock-closed.svg-DVL32yBG.js → interface-lock-closed.svg-BcDwDHkS.js} +1 -1
  139. package/web/assets/{interface-lock-open-unlock.svg-C7DBYFPn.js → interface-lock-open-unlock.svg-DNESCRC1.js} +1 -1
  140. package/web/assets/{interface-login-key.svg-CEq51fI1.js → interface-login-key.svg-BOEot3yk.js} +1 -1
  141. package/web/assets/{interface-search.svg-CkP-JMXm.js → interface-search.svg-CFsy7ant.js} +1 -1
  142. package/web/assets/{interface-setting-cog.svg-CgR9wxJN.js → interface-setting-cog.svg-B7Zk0iyr.js} +1 -1
  143. package/web/assets/{interface-share-megaphone-bullhorn.svg-C_VIGsI0.js → interface-share-megaphone-bullhorn.svg-DvG0IjMM.js} +1 -1
  144. package/web/assets/{interface-share-rocket.svg-aseIyfXq.js → interface-share-rocket.svg-gvaeTB8G.js} +1 -1
  145. package/web/assets/{interface-share-satellite.svg-CzkX6PJ2.js → interface-share-satellite.svg-B5pXJ0kU.js} +1 -1
  146. package/web/assets/{interface-share-space-ship.svg-Df1jdZi5.js → interface-share-space-ship.svg-B0k0J-VQ.js} +1 -1
  147. package/web/assets/{interface-share.svg-CioS2p8V.js → interface-share.svg-ZDsCvjRe.js} +1 -1
  148. package/web/assets/{interface-signal-square.svg-VUtTXd8G.js → interface-signal-square.svg-DBkJ1ire.js} +1 -1
  149. package/web/assets/{interface-time-clock-circle.svg-DWh2OWyC.js → interface-time-clock-circle.svg-BheUirew.js} +1 -1
  150. package/web/assets/{interface-time-hour-glass.svg-BCqCfi9r.js → interface-time-hour-glass.svg-iORrebF8.js} +1 -1
  151. package/web/assets/{interface-users-multiple.svg-Edac3LOs.js → interface-users-multiple.svg-DMqedSUQ.js} +1 -1
  152. package/web/assets/{interface-weather-moon.svg-BrK0lmKX.js → interface-weather-moon.svg-DyPBHRw4.js} +1 -1
  153. package/web/assets/{javascript-ByDc_p54.js → javascript-B1Y6a5s6.js} +1 -1
  154. package/web/assets/{jsonMode-Cm2EOOd4.js → jsonMode-Vj2pUgcF.js} +2 -2
  155. package/web/assets/{liquid-z9Tc1tTM.js → liquid-lb0ImGEW.js} +1 -1
  156. package/web/assets/{lspLanguageFeatures-D6O0oAJj.js → lspLanguageFeatures-sh8ggL5N.js} +3 -3
  157. package/web/assets/{mail-chat-bubble-square.svg-obHuGV3I.js → mail-chat-bubble-square.svg-D_Lx6uBc.js} +1 -1
  158. package/web/assets/{mail-send-email-paper-airplane.svg-I-JVbCkD.js → mail-send-email-paper-airplane.svg-B6FGKBZu.js} +1 -1
  159. package/web/assets/{mail-send-envelope.svg-CcYcXCe5.js → mail-send-envelope.svg-Dtm4h_xw.js} +1 -1
  160. package/web/assets/{mdx-B8bePw34.js → mdx-BbFPcqiD.js} +1 -1
  161. package/web/assets/{minus-k3R4JOtO.js → minus-Bxw18Xk6.js} +2 -2
  162. package/web/assets/modal-D-InjkVP.js +1 -0
  163. package/web/assets/modal-DLY8nKW-.js +5 -0
  164. package/web/assets/{money-cashier-receipt.svg-BIKxMBIH.js → money-cashier-receipt.svg-VpEb8Ewv.js} +1 -1
  165. package/web/assets/{money-currency-dollar-pay.svg-B-HfkTCE.js → money-currency-dollar-pay.svg-vo8FP9z4.js} +1 -1
  166. package/web/assets/{money-graph-arrow-increase.svg-CnXoTtSD.js → money-graph-arrow-increase.svg-CNcLQGOf.js} +1 -1
  167. package/web/assets/{money-graph-bar-chart-increase.svg-Dt7ly9Tz.js → money-graph-bar-chart-increase.svg-BHAccBVA.js} +1 -1
  168. package/web/assets/multiselect-Crs0miOE.js +251 -0
  169. package/web/assets/{nature-ecology-leaf.svg-TjKZfobq.js → nature-ecology-leaf.svg-0y4pBUlD.js} +1 -1
  170. package/web/assets/{password-dyrMCyHO.js → password-TyT4zuky.js} +4 -4
  171. package/web/assets/{phone-telephone.svg-CCMqAIP_.js → phone-telephone.svg-BdWhV2vz.js} +1 -1
  172. package/web/assets/{plus-Dg2E4ggP.js → plus-4Z2iFfO2.js} +6 -6
  173. package/web/assets/process.store-DsGpeQnV.js +1 -0
  174. package/web/assets/{programming-bug.svg-yyshFuq4.js → programming-bug.svg-DXDJVNeQ.js} +1 -1
  175. package/web/assets/{programming-cloud.svg-DPyoJVZM.js → programming-cloud.svg-qWtq6fXG.js} +1 -1
  176. package/web/assets/{programming-computer-database-server.svg-D7pShcvh.js → programming-computer-database-server.svg-DnlJHfH5.js} +1 -1
  177. package/web/assets/{programming-computer-database.svg-CErKDQrw.js → programming-computer-database.svg-Bl73TDXc.js} +1 -1
  178. package/web/assets/{programming-module-four-layout.svg-B26pG3Bb.js → programming-module-four-layout.svg-CGkj0OdH.js} +1 -1
  179. package/web/assets/{programming-module-three.svg-CnoN59HX.js → programming-module-three.svg-Bsk_vaHc.js} +1 -1
  180. package/web/assets/{programming-module.svg-C02rn1I7.js → programming-module.svg-D0Yng9wS.js} +1 -1
  181. package/web/assets/{programming-script-code.svg-D0sPjoPV.js → programming-script-code.svg-DTHMCNnF.js} +1 -1
  182. package/web/assets/{python-1623Ut7s.js → python-HImlMuYG.js} +1 -1
  183. package/web/assets/{razor-CyTiWHYX.js → razor-CTFKddzv.js} +1 -1
  184. package/web/assets/router-DTzqrUba.js +1 -0
  185. package/web/assets/settings-scope-CdxhnRbI.js +1 -0
  186. package/web/assets/{settings.store-BPAoJA_7.js → settings.store-CZ9jrl3S.js} +1 -1
  187. package/web/assets/{shopping-cart.svg-Cusya5ZE.js → shopping-cart.svg-Cx50mrFm.js} +1 -1
  188. package/web/assets/{shopping-gift-present.svg-DuhD1jDX.js → shopping-gift-present.svg-DGOO6qNg.js} +1 -1
  189. package/web/assets/{shopping-shipping-box-parcel-package.svg-mUJnCOxq.js → shopping-shipping-box-parcel-package.svg-C96i4g3q.js} +1 -1
  190. package/web/assets/src-DRjytMUo.js +1 -0
  191. package/web/assets/{src-HsHwQ5rW.js → src-DzMKqnGu.js} +13 -13
  192. package/web/assets/{tabpanel-D-R0gqbm.js → tabpanel-BW8I76pY.js} +3 -3
  193. package/web/assets/{tag-new-circle.svg-DFYYOM3s.js → tag-new-circle.svg-CV5DN0Db.js} +1 -1
  194. package/web/assets/{toggleswitch-Bv2Y60nl.js → toggleswitch-D4Evlg2b.js} +2 -2
  195. package/web/assets/{travel-map-earth-globe.svg-D1KtAG5P.js → travel-map-earth-globe.svg-CWvuO_Hb.js} +1 -1
  196. package/web/assets/trpc-BbC62Ymt.js +1 -0
  197. package/web/assets/{tsMode-DarxEDX3.js → tsMode-BqKPHyIc.js} +6 -6
  198. package/web/assets/{typescript-Bp83QY3R.js → typescript-Bme6ns4u.js} +1 -1
  199. package/web/assets/useAiChatDrawer-BG8t5Thc.js +1 -0
  200. package/web/assets/useCloudOrg-D2LTbk-G.js +572 -0
  201. package/web/assets/{useProjectCatalog-ClgttEEn.js → useProjectCatalog-nlAZuu5X.js} +1 -1
  202. package/web/assets/{xml-CieK61bI.js → xml-zsImRVNc.js} +1 -1
  203. package/web/assets/{yaml-Dd4h-bcV.js → yaml-VubzWJpP.js} +1 -1
  204. package/web/index.html +2 -2
  205. package/agent-manager-3KSS7BHP.js +0 -7
  206. package/chunk-4PQXBTV6.js.map +0 -1
  207. package/src-GGPKDQGD.js +0 -18433
  208. package/src-GGPKDQGD.js.map +0 -1
  209. package/web/assets/AgentScalarChatInterface.vue-CR0iWJNr.js +0 -13
  210. package/web/assets/AgentTerminalPage-DZj9UulV.js +0 -1
  211. package/web/assets/AiChatPage-D4h76hus.js +0 -1
  212. package/web/assets/AppLayout-DusPXiZn.js +0 -1
  213. package/web/assets/AuditPage-BBEa6MYr.js +0 -1
  214. package/web/assets/CloudAccountPage-DKgXvPS1.js +0 -1
  215. package/web/assets/CloudAccountPage-DopITrxL.js +0 -1
  216. package/web/assets/CloudMessagingPage-BNIbysEO.js +0 -2
  217. package/web/assets/DashboardPage-CTGAGY7X.js +0 -1
  218. package/web/assets/DirectoryPickerDialog-BKI9vxkG.js +0 -1
  219. package/web/assets/EnvironmentFormPage-RReX9Ijr.js +0 -1
  220. package/web/assets/EnvironmentListPage-BW5PlOxl.js +0 -1
  221. package/web/assets/KanbanBoardPage-BFYgHGl0.js +0 -4
  222. package/web/assets/KanbanListPage-BAcgRh8Z.js +0 -1
  223. package/web/assets/LaunchProjectPage-CpiyvCBv.js +0 -1
  224. package/web/assets/LaunchServicesPage-ChEXnYIi.js +0 -1
  225. package/web/assets/LogViewer-iTxXl8YQ.js +0 -3
  226. package/web/assets/OrgKeyPrompt-KRyXRMw7.js +0 -1
  227. package/web/assets/ProcessControls-DynA7Ock.js +0 -1
  228. package/web/assets/ProcessDetailPage-BpgGTkXx.js +0 -1
  229. package/web/assets/ProjectDetailPage-B49_-83N.js +0 -1
  230. package/web/assets/ProjectListPage-CFoEPT2F.js +0 -1
  231. package/web/assets/RandomJobTestPage-CALSR3WS.js +0 -2
  232. package/web/assets/ScenarioEditorPage-DxyzCjhy.js +0 -14
  233. package/web/assets/SendToChatDialog-CeFdMciG.js +0 -1
  234. package/web/assets/ServiceControlsBar-CI1_piqu.js +0 -1
  235. package/web/assets/ServiceDetailPage-CVT68kTt.js +0 -2
  236. package/web/assets/ServiceFormPage-nLRxtrOu.js +0 -1
  237. package/web/assets/SettingsPage-DDYegVxd.js +0 -2063
  238. package/web/assets/UnlockPage-D9_ZbMR_.js +0 -1
  239. package/web/assets/VariablesTable-ClL6KuSo.js +0 -1
  240. package/web/assets/VaultMigrationPage-rc5OA9Xt.js +0 -1
  241. package/web/assets/VersionBadge-K5UQnfc6.js +0 -1
  242. package/web/assets/WikiPage-VeQCqO9Z.js +0 -1
  243. package/web/assets/WikiView-XCwSa_R7.js +0 -1
  244. package/web/assets/add-scalar-classes-CvhyJKCs.js +0 -387
  245. package/web/assets/auth-errors-Cmx-4mn3.js +0 -1
  246. package/web/assets/card-BfEdnBhU.js +0 -32
  247. package/web/assets/cloud-chat.store-BPoTzBeD.js +0 -1
  248. package/web/assets/cloud-session-D0ue5Z97.js +0 -1
  249. package/web/assets/column-BtLe8qbf.js +0 -907
  250. package/web/assets/interface-content-folder.svg-nRYFY3NY.js +0 -1
  251. package/web/assets/modal-CVWJd9ZI.js +0 -5
  252. package/web/assets/modal-Ccn3uciU.js +0 -1
  253. package/web/assets/multiselect-BsCXwmy0.js +0 -251
  254. package/web/assets/process.store-CHdSS5Et.js +0 -1
  255. package/web/assets/router-DWhykW-F.js +0 -1
  256. package/web/assets/settings-scope-9i3_Io9Z.js +0 -1
  257. package/web/assets/src-BiD62eGr.js +0 -1
  258. package/web/assets/trpc-4Nls70HO.js +0 -1
  259. package/web/assets/useAiChatDrawer-BYR24v6F.js +0 -1
  260. package/web/assets/useCloudOrg-B1BakNYp.js +0 -572
  261. /package/{agent-manager-3KSS7BHP.js.map → agent-manager-QQPKKLKY.js.map} +0 -0
@@ -1,266 +1,34 @@
1
+ import {
2
+ AGENT_FETCH_TIMEOUT,
3
+ AGENT_HEALTH_POLL_INTERVAL,
4
+ CreateEnvironmentSchema,
5
+ EnvironmentSchema,
6
+ PASSPHRASE_TIMEOUT,
7
+ ServiceConfigSchema,
8
+ TraefikConfigSchema,
9
+ WS_RECONNECT_MAX,
10
+ WS_RECONNECT_MIN,
11
+ allVaultRoots,
12
+ env,
13
+ keyedFilePath,
14
+ legacyMachineFilePath,
15
+ listOrgVaults,
16
+ localVaultRoot,
17
+ machineRoot,
18
+ orgVaultRoot,
19
+ vaultFor,
20
+ vaultIdOfRoot
21
+ } from "./chunk-3MJLS5UY.js";
22
+
1
23
  // ../server/src/services/agent-manager.ts
2
24
  import { EventEmitter as EventEmitter2 } from "events";
3
25
  import WebSocket2 from "ws";
4
- import { z as z24 } from "zod";
26
+ import { z as z2 } from "zod";
5
27
 
6
28
  // ../server/src/services/agent-store.ts
7
29
  import { randomUUID, randomBytes, createCipheriv, createDecipheriv } from "crypto";
8
- import { readFile as readFile2, writeFile as writeFile2, rename, mkdir as mkdir2, chmod } from "fs/promises";
9
- import { dirname, join as join2 } from "path";
10
-
11
- // ../server/src/services/vault-resolver.ts
12
- import { join, sep } from "path";
13
- import { homedir } from "os";
14
- import { readdir, mkdir, access, readFile, writeFile, unlink } from "fs/promises";
15
- import { existsSync } from "fs";
16
-
17
- // ../server/src/config/env.ts
18
- import { z } from "zod";
19
- import { resolve as resolvePath } from "path";
20
- var serverPort = z.coerce.number().int().min(1).max(65535).default(4e3).parse(process.env.RUNEYA_HTTP_PORT);
21
- var defaultAgentPort = process.env.RUNEYA_AGENT_PORT ? z.coerce.number().int().min(1).max(65535).parse(process.env.RUNEYA_AGENT_PORT) : serverPort + 1;
22
- var EnvSchema = z.object({
23
- RUNEYA_HTTP_PORT: z.coerce.number().int().min(1).max(65535).default(4e3),
24
- RUNEYA_HOST: z.string().default("127.0.0.1"),
25
- RUNEYA_AGENT_PORT: z.coerce.number().int().min(1).max(65535).default(defaultAgentPort),
26
- RUNEYA_AGENT_HOST: z.string().default("127.0.0.1"),
27
- RUNEYA_AGENT_BINARY_PATH: z.string().nullable().default(null),
28
- RUNEYA_DATA_DIR: z.preprocess((v) => typeof v === "string" && v.length > 0 ? v : void 0, z.string().default(".runeya")),
29
- // Home holding the cloud vaults (`<home>/.runeya/orgs/...`). Defaults to the
30
- // user's home directory; overridden by tests so they never write to the real
31
- // one, and usable to relocate the vaults on a shared machine.
32
- RUNEYA_HOME: z.preprocess((v) => typeof v === "string" && v.length > 0 ? v : void 0, z.string().nullable().default(null)),
33
- RUNEYA_CLOUD_URL: z.string().url().nullable().default(null),
34
- // Cloud front-end (landing) URL — used by the web app for the registration /
35
- // onboarding flow. Configured on the server at launch; the web fetches it.
36
- RUNEYA_CLOUD_APP_URL: z.string().url().nullable().default(null),
37
- RUNEYA_MODE: z.enum(["local-simple", "cloud"]).default("local-simple"),
38
- RUNEYA_CORS_ORIGIN: z.string().nullable().default(null),
39
- RUNEYA_LAN_PROXY: z.preprocess((v) => v === "true" || v === "1", z.boolean()).default(false),
40
- // Set by the CLI when it was started from a desktop launcher rather than a
41
- // terminal. The web app surfaces it so the user knows which Runeya they are
42
- // looking at when several are running.
43
- RUNEYA_FROM_DESKTOP: z.preprocess((v) => v === "true" || v === "1", z.boolean()).default(false),
44
- // Label shown for this machine in the cloud's "linked machines" screen.
45
- // Defaults to the hostname (see `getDeviceName`); set it explicitly when a
46
- // single host runs several instances and you want to tell them apart.
47
- RUNEYA_DEVICE_NAME: z.preprocess(
48
- (v) => typeof v === "string" && v.trim().length > 0 ? v.trim() : void 0,
49
- z.string().max(64).nullable().default(null)
50
- )
51
- }).transform((data) => ({
52
- ...data,
53
- // Short aliases used throughout the server code
54
- PORT: data.RUNEYA_HTTP_PORT,
55
- HOST: data.RUNEYA_HOST,
56
- MODE: data.RUNEYA_MODE,
57
- /**
58
- * Absolute from the start, resolved once against the launch directory.
59
- *
60
- * It defaults to a relative `.runeya`, and every caller used to re-resolve it
61
- * against whatever the process's cwd happened to be. A vault that moves when
62
- * the process changes directory is a vault that can be silently written to the
63
- * wrong place — so the answer is fixed here, at boot, and never recomputed.
64
- */
65
- DATA_DIR: resolvePath(data.RUNEYA_DATA_DIR),
66
- HOME_DIR: data.RUNEYA_HOME,
67
- CLOUD_URL: data.RUNEYA_CLOUD_URL,
68
- CLOUD_APP_URL: data.RUNEYA_CLOUD_APP_URL,
69
- CORS_ORIGIN: data.RUNEYA_CORS_ORIGIN,
70
- AGENT_BINARY_PATH: data.RUNEYA_AGENT_BINARY_PATH,
71
- DEVICE_NAME: data.RUNEYA_DEVICE_NAME,
72
- FROM_DESKTOP: data.RUNEYA_FROM_DESKTOP
73
- }));
74
- var env = EnvSchema.parse(process.env);
75
-
76
- // ../server/src/services/vault-resolver.ts
77
- var SAFE_ID = /^[A-Za-z0-9._-]{1,128}$/;
78
- function assertSafeId(kind, id) {
79
- if (!SAFE_ID.test(id) || id === "." || id === "..") {
80
- throw new Error(`Invalid ${kind} id for a vault path: ${JSON.stringify(id)}`);
81
- }
82
- }
83
- function machineRoot() {
84
- const override = process.env["RUNEYA_HOME"];
85
- return join(override && override.length > 0 ? override : homedir(), ".runeya");
86
- }
87
- function localVaultRoot() {
88
- return env.DATA_DIR;
89
- }
90
- function orgVaultRoot(orgId) {
91
- assertSafeId("organization", orgId);
92
- return join(machineRoot(), "orgs", orgId);
93
- }
94
- function projectVaultRoot(orgId, projectId) {
95
- assertSafeId("project", projectId);
96
- return join(orgVaultRoot(orgId), "projects", projectId);
97
- }
98
- function orgIdOfRoot(root) {
99
- const marker = join(machineRoot(), "orgs") + sep;
100
- if (!root.startsWith(marker)) return null;
101
- const [orgId] = root.slice(marker.length).split(sep);
102
- return orgId && SAFE_ID.test(orgId) ? orgId : null;
103
- }
104
- function vaultIdOfRoot(root) {
105
- return orgIdOfRoot(root) ?? void 0;
106
- }
107
- function vaultFor(target) {
108
- if (!target.orgId) return { root: localVaultRoot() };
109
- return { root: projectVaultRoot(target.orgId, target.id) };
110
- }
111
- var ORG_CLOUD_FILE = "cloud.json";
112
- async function stampOrgCloud(orgId, cloudUrl, name) {
113
- const root = orgVaultRoot(orgId);
114
- await mkdir(root, { recursive: true });
115
- const known = name ?? (await readOrgNames())[orgId];
116
- const stamp = known ? { cloudUrl, name: known } : { cloudUrl };
117
- await writeFile(join(root, ORG_CLOUD_FILE), JSON.stringify(stamp, null, 2), "utf-8");
118
- }
119
- async function rememberOrgName(orgId, name) {
120
- const root = orgVaultRoot(orgId);
121
- if (!existsSync(root)) return;
122
- const file = join(root, ORG_CLOUD_FILE);
123
- let stamp = {};
124
- try {
125
- stamp = JSON.parse(await readFile(file, "utf-8"));
126
- } catch {
127
- }
128
- if (stamp["name"] === name) return;
129
- await writeFile(file, JSON.stringify({ ...stamp, name }, null, 2), "utf-8");
130
- }
131
- async function readOrgNames() {
132
- const out = {};
133
- for (const orgId of await listOrgVaults()) {
134
- try {
135
- const raw = await readFile(join(orgVaultRoot(orgId), ORG_CLOUD_FILE), "utf-8");
136
- const name = JSON.parse(raw).name;
137
- if (typeof name === "string" && name) out[orgId] = name;
138
- } catch {
139
- }
140
- }
141
- return out;
142
- }
143
- var ORG_LOGO_FILE = "logo.json";
144
- var LOGO_TYPES = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/webp", "image/gif"]);
145
- async function rememberOrgLogo(orgId, contentType, base64) {
146
- if (!LOGO_TYPES.has(contentType)) return;
147
- const root = orgVaultRoot(orgId);
148
- const stored = { contentType, base64, fetchedAt: (/* @__PURE__ */ new Date()).toISOString() };
149
- await mkdir(root, { recursive: true });
150
- await writeFile(join(root, ORG_LOGO_FILE), JSON.stringify(stored), "utf-8");
151
- }
152
- async function forgetOrgLogo(orgId) {
153
- try {
154
- await unlink(join(orgVaultRoot(orgId), ORG_LOGO_FILE));
155
- } catch {
156
- }
157
- }
158
- async function readOrgLogos() {
159
- const out = {};
160
- for (const orgId of await listOrgVaults()) {
161
- try {
162
- const raw = await readFile(join(orgVaultRoot(orgId), ORG_LOGO_FILE), "utf-8");
163
- const { contentType, base64 } = JSON.parse(raw);
164
- if (typeof contentType !== "string" || !LOGO_TYPES.has(contentType)) continue;
165
- if (typeof base64 !== "string" || !base64) continue;
166
- out[orgId] = `data:${contentType};base64,${base64}`;
167
- } catch {
168
- }
169
- }
170
- return out;
171
- }
172
- async function readOrgClouds() {
173
- const orgsDir = join(machineRoot(), "orgs");
174
- const out = {};
175
- let orgIds;
176
- try {
177
- orgIds = (await readdir(orgsDir, { withFileTypes: true })).filter((e) => e.isDirectory() && SAFE_ID.test(e.name)).map((e) => e.name);
178
- } catch {
179
- return out;
180
- }
181
- for (const orgId of orgIds) {
182
- try {
183
- const raw = await readFile(join(orgsDir, orgId, ORG_CLOUD_FILE), "utf-8");
184
- const url = JSON.parse(raw).cloudUrl;
185
- if (typeof url === "string" && url) out[orgId] = url;
186
- } catch {
187
- }
188
- }
189
- return out;
190
- }
191
- async function listOrgVaults() {
192
- const orgsDir = join(machineRoot(), "orgs");
193
- try {
194
- return (await readdir(orgsDir, { withFileTypes: true })).filter((e) => e.isDirectory() && SAFE_ID.test(e.name)).map((e) => e.name);
195
- } catch {
196
- return [];
197
- }
198
- }
199
- async function listCloudVaults() {
200
- const orgsDir = join(machineRoot(), "orgs");
201
- const found = [];
202
- let orgIds;
203
- try {
204
- orgIds = (await readdir(orgsDir, { withFileTypes: true })).filter((e) => e.isDirectory() && SAFE_ID.test(e.name)).map((e) => e.name);
205
- } catch {
206
- return found;
207
- }
208
- for (const orgId of orgIds) {
209
- const projectsDir = join(orgsDir, orgId, "projects");
210
- try {
211
- for (const entry of await readdir(projectsDir, { withFileTypes: true })) {
212
- if (!entry.isDirectory() || !SAFE_ID.test(entry.name)) continue;
213
- const root = join(projectsDir, entry.name);
214
- if (!await access(join(root, "project.json")).then(() => true, () => false)) continue;
215
- found.push({ orgId, projectId: entry.name, root });
216
- }
217
- } catch {
218
- }
219
- }
220
- return found;
221
- }
222
- async function allVaultRoots() {
223
- const cloud = await listCloudVaults();
224
- return [localVaultRoot(), ...cloud.map((v) => v.root)];
225
- }
226
- function machineFilePath(filename) {
227
- return join(machineRoot(), filename);
228
- }
229
- async function keyedFilePath(filename) {
230
- return join(await keyRoot(), filename);
231
- }
232
- function legacyMachineFilePath(filename) {
233
- return join(localVaultRoot(), filename);
234
- }
235
- async function ensureLocalVault() {
236
- const root = localVaultRoot();
237
- await mkdir(root, { recursive: true });
238
- return root;
239
- }
240
- var KEY_FILES = [".encryption.key.enc", ".runeya-verify"];
241
- var keyRootPromise = null;
242
- async function holdsKey(root) {
243
- for (const filename of KEY_FILES) {
244
- try {
245
- await access(join(root, filename));
246
- return true;
247
- } catch {
248
- }
249
- }
250
- return false;
251
- }
252
- function keyRoot() {
253
- keyRootPromise ??= (async () => {
254
- if (await holdsKey(machineRoot())) return machineRoot();
255
- return await holdsKey(localVaultRoot()) ? localVaultRoot() : machineRoot();
256
- })();
257
- return keyRootPromise;
258
- }
259
- async function legacyVaultRoot() {
260
- const local = localVaultRoot();
261
- if (await keyRoot() === local) return null;
262
- return await holdsKey(local) ? local : null;
263
- }
30
+ import { readFile, writeFile, rename, mkdir, chmod } from "fs/promises";
31
+ import { dirname, join } from "path";
264
32
 
265
33
  // ../server/src/utils/encryption-key.ts
266
34
  import { createHash } from "crypto";
@@ -407,7 +175,7 @@ var AgentStore = class {
407
175
  }
408
176
  filePathFor(owner) {
409
177
  if (owner === null) return keyedFilePath(FILENAME);
410
- return Promise.resolve(join2(orgVaultRoot(owner), FILENAME));
178
+ return Promise.resolve(join(orgVaultRoot(owner), FILENAME));
411
179
  }
412
180
  /** Where older versions kept it — read only, so an older Runeya keeps working. */
413
181
  getLegacyFilePath() {
@@ -419,7 +187,7 @@ var AgentStore = class {
419
187
  for (const path of paths) {
420
188
  let raw;
421
189
  try {
422
- raw = await readFile2(path, "utf-8");
190
+ raw = await readFile(path, "utf-8");
423
191
  } catch {
424
192
  continue;
425
193
  }
@@ -490,9 +258,9 @@ var AgentStore = class {
490
258
  )
491
259
  };
492
260
  const filePath = await this.filePathFor(owner);
493
- await mkdir2(dirname(filePath), { recursive: true });
261
+ await mkdir(dirname(filePath), { recursive: true });
494
262
  const tmpPath = filePath + ".tmp";
495
- await writeFile2(tmpPath, JSON.stringify(fileData, null, 2), "utf-8");
263
+ await writeFile(tmpPath, JSON.stringify(fileData, null, 2), "utf-8");
496
264
  await rename(tmpPath, filePath);
497
265
  await chmod(filePath, 384);
498
266
  }
@@ -600,8 +368,8 @@ var agentStore = new AgentStore();
600
368
 
601
369
  // ../server/src/services/service-store.ts
602
370
  import { randomUUID as randomUUID3 } from "crypto";
603
- import { readFile as readFile4, writeFile as writeFile4, rename as rename3, mkdir as mkdir4, chmod as chmod3, rm as rm2 } from "fs/promises";
604
- import { join as join4 } from "path";
371
+ import { readFile as readFile3, writeFile as writeFile3, rename as rename3, mkdir as mkdir3, chmod as chmod3, rm as rm2 } from "fs/promises";
372
+ import { join as join3 } from "path";
605
373
 
606
374
  // ../server/src/services/project-key.ts
607
375
  function projectKey(ref) {
@@ -713,8 +481,8 @@ function isVaultConflicted(root) {
713
481
 
714
482
  // ../server/src/services/environment-store.ts
715
483
  import { randomUUID as randomUUID2 } from "crypto";
716
- import { readFile as readFile3, writeFile as writeFile3, rename as rename2, mkdir as mkdir3, chmod as chmod2, rm } from "fs/promises";
717
- import { join as join3 } from "path";
484
+ import { readFile as readFile2, writeFile as writeFile2, rename as rename2, mkdir as mkdir2, chmod as chmod2, rm } from "fs/promises";
485
+ import { join as join2 } from "path";
718
486
 
719
487
  // ../server/src/services/disk-freshness.ts
720
488
  import { stat } from "fs/promises";
@@ -850,1584 +618,6 @@ function isEncryptedValue(s) {
850
618
  return parts.length === 3 && /^[0-9a-f]{32}$/i.test(parts[0]) && /^[0-9a-f]{32}$/i.test(parts[1]);
851
619
  }
852
620
 
853
- // ../../packages/shared/src/schemas/user.schema.ts
854
- import { z as z2 } from "zod";
855
- var UserSchema = z2.object({
856
- id: z2.string().max(128),
857
- email: z2.string().email().max(320),
858
- name: z2.string().min(1).max(500),
859
- avatar: z2.string().url().max(2048).nullable().optional()
860
- });
861
-
862
- // ../../packages/shared/src/schemas/org.schema.ts
863
- import { z as z3 } from "zod";
864
- var OrgSchema = z3.object({
865
- id: z3.string().max(128),
866
- name: z3.string().min(1).max(100),
867
- slug: z3.string().min(1).max(100).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/),
868
- ownerId: z3.string().max(128)
869
- });
870
- var OrgMemberSchema = z3.object({
871
- id: z3.string().max(128),
872
- orgId: z3.string().max(128),
873
- userId: z3.string().max(128),
874
- globalRole: z3.enum(["owner", "admin", "member"]),
875
- invitedAt: z3.coerce.date(),
876
- joinedAt: z3.coerce.date().nullable().optional()
877
- });
878
-
879
- // ../../packages/shared/src/schemas/project.schema.ts
880
- import { z as z4 } from "zod";
881
- var ProjectSchema = z4.object({
882
- id: z4.string().max(128),
883
- orgId: z4.string().max(128).nullable().optional(),
884
- name: z4.string().min(1).max(200),
885
- description: z4.string().max(1e4).optional().default(""),
886
- serviceIds: z4.array(z4.string().max(128)).max(1e4).default([]),
887
- // Environment support
888
- // NOTE: activeEnvironmentId is runtime-only (not persisted to JSON)
889
- // It's initialized to 'local' by default at load time
890
- activeEnvironmentId: z4.string().max(128).optional(),
891
- environmentIds: z4.array(z4.string().max(128)).max(100).default([]),
892
- // Ordre d'affichage des groupes de services dans la sidebar (noms de groupes).
893
- // Les groupes absents de cette liste sont affichés après, par ordre alphabétique.
894
- groupOrder: z4.array(z4.string().max(200)).max(100).default([])
895
- });
896
- var CreateProjectSchema = ProjectSchema.omit({ id: true }).partial().required({ name: true });
897
- var UpdateProjectSchema = ProjectSchema.partial().required({ id: true });
898
-
899
- // ../../packages/shared/src/schemas/service.schema.ts
900
- import { z as z8 } from "zod";
901
-
902
- // ../../packages/shared/src/schemas/settings.schema.ts
903
- import { z as z6 } from "zod";
904
-
905
- // ../../packages/shared/src/schemas/scenario.schema.ts
906
- import { z as z5 } from "zod";
907
- var PositionSchema = z5.object({
908
- x: z5.number(),
909
- y: z5.number()
910
- });
911
- var ScenarioGroupSchema = z5.object({
912
- id: z5.string().min(1).max(128),
913
- name: z5.string().min(1).max(200),
914
- description: z5.string().max(1e3).optional(),
915
- color: z5.string().max(32).optional(),
916
- position: PositionSchema.default({ x: 0, y: 0 }),
917
- width: z5.number().default(300),
918
- height: z5.number().default(200)
919
- });
920
- var ScenarioPresetRoleSchema = z5.object({
921
- id: z5.string().min(1).max(64),
922
- name: z5.string().min(1).max(200),
923
- systemPrompt: z5.string().max(1e4).default(""),
924
- prompt: z5.string().max(1e4).default("")
925
- });
926
- var ScenarioPresetInitialDataSchema = z5.object({
927
- leaderId: z5.string().min(1).max(128),
928
- groups: z5.array(z5.object({
929
- id: z5.string().min(1).max(128),
930
- name: z5.string().min(1).max(200),
931
- description: z5.string().max(1e3).optional(),
932
- color: z5.string().max(32).optional(),
933
- position: z5.object({ x: z5.number(), y: z5.number() }).default({ x: 0, y: 0 }),
934
- width: z5.number().default(300),
935
- height: z5.number().default(200)
936
- })).max(100).default([]),
937
- nodes: z5.array(z5.object({
938
- id: z5.string().min(1).max(128),
939
- type: z5.enum(["ai", "ask"]).default("ai"),
940
- parentIds: z5.array(z5.string().max(128)).default([]),
941
- groupId: z5.string().max(128).nullable().default(null),
942
- label: z5.string().max(240).default(""),
943
- role: z5.string().max(64).default("other"),
944
- prompt: z5.string().max(5e4).default(""),
945
- question: z5.string().max(2e3).default(""),
946
- autoGenerated: z5.boolean().default(true),
947
- canAddNode: z5.boolean().default(false),
948
- aiCli: z5.enum(["claude-code", "codex"]).default("claude-code"),
949
- model: z5.string().max(128).default("sonnet"),
950
- position: z5.object({ x: z5.number(), y: z5.number() }).default({ x: 0, y: 0 })
951
- })).min(1).max(500)
952
- });
953
- var LocalizedStringSchema = z5.record(z5.string(), z5.string().max(100));
954
- var ScenarioPresetLabelsSchema = z5.object({
955
- group: LocalizedStringSchema.optional(),
956
- node: LocalizedStringSchema.optional(),
957
- role: LocalizedStringSchema.optional(),
958
- leader: LocalizedStringSchema.optional()
959
- });
960
- var ScenarioPresetSchema = z5.object({
961
- id: z5.string().min(1).max(128),
962
- name: z5.string().min(1).max(200),
963
- icon: z5.string().max(64).optional(),
964
- defaultTraversalMode: z5.enum(["hierarchical", "topological"]).optional(),
965
- canChangeTraversalMode: z5.boolean().default(true),
966
- roles: z5.array(ScenarioPresetRoleSchema).min(1).max(100),
967
- initialData: ScenarioPresetInitialDataSchema.optional(),
968
- labels: ScenarioPresetLabelsSchema.optional()
969
- });
970
- var ScenarioNodeSchema = z5.object({
971
- id: z5.string().min(1).max(128),
972
- type: z5.enum(["ai", "ask"]).default("ai"),
973
- parentIds: z5.array(z5.string().max(128)).default([]),
974
- groupId: z5.string().max(128).nullable().default(null),
975
- label: z5.string().max(240).default(""),
976
- role: z5.string().max(64).default("other"),
977
- prompt: z5.string().max(5e4).default(""),
978
- question: z5.string().max(2e3).default(""),
979
- autoGenerated: z5.boolean().default(true),
980
- canAddNode: z5.boolean().default(false),
981
- aiCli: z5.enum(["claude-code", "codex"]).default("claude-code"),
982
- model: z5.string().max(128).default("sonnet"),
983
- position: PositionSchema.default({ x: 0, y: 0 }),
984
- injectParentOutputs: z5.boolean().default(false),
985
- injectedAncestorIds: z5.array(z5.string().max(128)).default([])
986
- });
987
- var ScenarioSchema = z5.object({
988
- id: z5.string().min(1).max(128),
989
- name: z5.string().min(1).max(200),
990
- icon: z5.string().max(64).optional(),
991
- description: z5.string().max(2e3).optional(),
992
- leaderId: z5.string().min(1).max(128),
993
- groups: z5.array(ScenarioGroupSchema).max(100).default([]),
994
- nodes: z5.array(ScenarioNodeSchema).min(1).max(500),
995
- traversalMode: z5.enum(["hierarchical", "topological"]).default("hierarchical"),
996
- presetId: z5.string().max(128).optional(),
997
- isPublished: z5.boolean().default(false),
998
- createdAt: z5.number(),
999
- updatedAt: z5.number()
1000
- });
1001
-
1002
- // ../../packages/shared/src/schemas/settings.schema.ts
1003
- var AI_PROVIDERS = ["anthropic", "openai", "mistral", "groq", "ollama"];
1004
- var AIProviderSchema = z6.object({
1005
- id: z6.string().min(1).max(128),
1006
- name: z6.string().min(1).max(200),
1007
- provider: z6.enum(AI_PROVIDERS),
1008
- encryptedApiKey: z6.string().max(2e3).default(""),
1009
- model: z6.string().max(200).optional(),
1010
- active: z6.boolean().default(false),
1011
- createdAt: z6.coerce.date(),
1012
- updatedAt: z6.coerce.date()
1013
- });
1014
- var JSLogParserSchema = z6.object({
1015
- id: z6.string().min(1).max(128),
1016
- name: z6.string().min(1).max(200),
1017
- description: z6.string().max(2e3).optional(),
1018
- code: z6.string().min(1).max(5e4).refine(
1019
- (s) => !s.includes("require(") && !s.includes("import ") && !s.includes("eval("),
1020
- { message: "Code must not contain require, import, or eval patterns" }
1021
- ),
1022
- enabled: z6.boolean().default(true),
1023
- builtin: z6.boolean().optional(),
1024
- createdAt: z6.coerce.date(),
1025
- updatedAt: z6.coerce.date()
1026
- });
1027
- var NotificationPreferencesSchema = z6.object({
1028
- scenario_waiting_input: z6.boolean().default(true),
1029
- ai_conversation_complete: z6.boolean().default(true),
1030
- ai_conversation_error: z6.boolean().default(true),
1031
- service_error_log: z6.boolean().default(true),
1032
- service_status_changed: z6.boolean().default(true),
1033
- service_health_changed: z6.boolean().default(true),
1034
- /** Service IDs excluded from error-log notifications */
1035
- service_error_log_excluded: z6.array(z6.string().max(100)).max(500).default([]),
1036
- /** Service IDs excluded from status-change notifications */
1037
- service_status_changed_excluded: z6.array(z6.string().max(100)).max(500).default([]),
1038
- /** Service IDs excluded from health-change notifications */
1039
- service_health_changed_excluded: z6.array(z6.string().max(100)).max(500).default([])
1040
- });
1041
- var SettingsSchema = z6.object({
1042
- mode: z6.enum(["local-simple", "cloud"]),
1043
- cloudUrl: z6.string().url().max(2048).nullable().optional(),
1044
- logParsers: z6.array(JSLogParserSchema).max(100).default([]),
1045
- scenarios: z6.array(ScenarioSchema).max(100).default([]),
1046
- /** Absolute path to the folder where the global wiki/docs markdown files live. Optional. */
1047
- globalDocsPath: z6.string().max(4096).optional()
1048
- });
1049
- var TraefikConfigSchema = z6.object({
1050
- enabled: z6.boolean().default(false),
1051
- acmeEmail: z6.string().email().max(256).optional(),
1052
- wildcardDomain: z6.string().max(253).optional(),
1053
- httpPort: z6.number().int().min(1).max(65535).default(80),
1054
- httpsPort: z6.number().int().min(1).max(65535).default(443),
1055
- dnsProvider: z6.string().max(64).optional(),
1056
- dnsCredentials: z6.record(z6.string().max(64), z6.string().max(2048)).default({}),
1057
- acmeStaging: z6.boolean().default(false),
1058
- encryptedCert: z6.string().max(65536).optional(),
1059
- encryptedCertKey: z6.string().max(65536).optional()
1060
- });
1061
- var SettingsPrivateSchema = z6.object({
1062
- aiProviders: z6.array(AIProviderSchema).max(50).default([]),
1063
- scenarios: z6.array(ScenarioSchema).max(100).default([]),
1064
- notifications: NotificationPreferencesSchema.default(() => ({
1065
- scenario_waiting_input: true,
1066
- ai_conversation_complete: true,
1067
- ai_conversation_error: true,
1068
- service_error_log: true,
1069
- service_status_changed: true,
1070
- service_health_changed: true,
1071
- service_error_log_excluded: [],
1072
- service_status_changed_excluded: [],
1073
- service_health_changed_excluded: []
1074
- })),
1075
- traefikConfig: TraefikConfigSchema.optional()
1076
- });
1077
- var SchemaVersionSchema = z6.object({
1078
- version: z6.number().int().positive(),
1079
- migratedAt: z6.coerce.date()
1080
- });
1081
-
1082
- // ../../packages/shared/src/schemas/log-source.schema.ts
1083
- import { z as z7 } from "zod";
1084
- var safePath = z7.string().min(1).max(4096).refine(
1085
- (p) => !p.includes("\0"),
1086
- { message: "path must not contain null bytes" }
1087
- ).refine(
1088
- (p) => !/(^|[/\\])\.\.([/\\]|$)/.test(p),
1089
- { message: "path must not contain path-traversal sequences (..)" }
1090
- );
1091
- var ConsoleLogSourceSchema = z7.object({
1092
- type: z7.literal("console")
1093
- });
1094
- var FileLogSourceSchema = z7.object({
1095
- type: z7.literal("file"),
1096
- path: safePath,
1097
- encoding: z7.string().max(32).default("utf-8"),
1098
- startFromEnd: z7.boolean().default(true),
1099
- createIfNotExists: z7.boolean().default(false)
1100
- });
1101
- var MongoLogSourceSchema = z7.object({
1102
- type: z7.literal("mongo"),
1103
- /** @sensitive — stored encrypted (AES-256-GCM) on disk */
1104
- connectionString: z7.string().min(1).max(2048),
1105
- database: z7.string().min(1).max(256),
1106
- collection: z7.string().min(1).max(256),
1107
- filter: z7.record(z7.string(), z7.unknown()).optional(),
1108
- timestampField: z7.string().max(128).default("timestamp"),
1109
- messageField: z7.string().max(128).default("message"),
1110
- levelField: z7.string().max(128).optional()
1111
- });
1112
- var MySQLLogSourceSchema = z7.object({
1113
- type: z7.literal("mysql"),
1114
- host: z7.string().min(1).max(253),
1115
- port: z7.number().int().min(1).max(65535).default(3306),
1116
- user: z7.string().min(1).max(256),
1117
- /** @sensitive — stored encrypted (AES-256-GCM) on disk */
1118
- password: z7.string().max(2048),
1119
- database: z7.string().min(1).max(256),
1120
- table: z7.string().min(1).max(256),
1121
- query: z7.string().max(8192).optional(),
1122
- timestampColumn: z7.string().max(128).default("created_at"),
1123
- messageColumn: z7.string().max(128).default("message"),
1124
- levelColumn: z7.string().max(128).optional(),
1125
- pollIntervalMs: z7.number().int().min(500).max(6e4).default(2e3)
1126
- });
1127
- var LogSourceConfigSchema = z7.discriminatedUnion("type", [
1128
- ConsoleLogSourceSchema,
1129
- FileLogSourceSchema,
1130
- MongoLogSourceSchema,
1131
- MySQLLogSourceSchema
1132
- ]);
1133
-
1134
- // ../../packages/shared/src/schemas/service.schema.ts
1135
- var HealthCheckSchema = z8.object({
1136
- type: z8.enum(["http", "command"]).default("http"),
1137
- // HTTP-specific (required when type=http)
1138
- path: z8.string().min(1).max(500).startsWith("/").optional(),
1139
- method: z8.enum(["GET", "HEAD", "POST", "PUT"]).optional().default("GET"),
1140
- expectedStatus: z8.number().int().min(100).max(599).optional().default(200),
1141
- // Command-specific (required when type=command)
1142
- command: z8.string().min(1).max(4096).optional(),
1143
- // Shared
1144
- interval: z8.number().int().positive().default(1e3),
1145
- timeout: z8.number().int().positive().default(1e3),
1146
- retries: z8.number().int().nonnegative().default(3),
1147
- initialDelay: z8.number().int().nonnegative().optional().default(0)
1148
- }).refine(
1149
- (data) => data.type === "http" ? !!data.path : !!data.command,
1150
- { message: "HTTP type requires path; command type requires command" }
1151
- );
1152
- var BootstrapCommandSchema = z8.object({
1153
- id: z8.string().min(1).max(64),
1154
- label: z8.string().max(200).default(""),
1155
- entrypoint: z8.string().max(4096).optional(),
1156
- command: z8.string().max(4096).default(""),
1157
- user: z8.string().max(256).optional()
1158
- });
1159
- var DockerConfigSchema = z8.object({
1160
- // Image mode (pull from registry) — mutually exclusive with build mode in UI
1161
- image: z8.string().min(1).max(1024).optional(),
1162
- // Build mode — Dockerfile stored inline in services.json
1163
- dockerfile: z8.string().max(65536).optional(),
1164
- buildContext: z8.string().max(4096).optional(),
1165
- buildArgs: z8.record(z8.string().max(256), z8.string().max(4096)).default({}).refine(
1166
- (obj) => Object.keys(obj).length <= 50,
1167
- { message: "Max 50 build args" }
1168
- ),
1169
- targetStage: z8.string().max(256).optional(),
1170
- // Runtime config
1171
- networkMode: z8.enum(["host", "bridge"]).default("host"),
1172
- ports: z8.array(z8.string().max(64)).max(100).default([]),
1173
- volumes: z8.array(z8.string().max(1024)).max(100).default([]),
1174
- mountRootpath: z8.boolean().default(false),
1175
- entrypoint: z8.string().max(4096).optional(),
1176
- command: z8.string().max(4096).optional(),
1177
- user: z8.string().max(256).optional(),
1178
- useNativeCommand: z8.boolean().default(false),
1179
- nativeCommandMode: z8.enum(["shared", "isolated"]).default("isolated"),
1180
- nativeShell: z8.string().max(256).default("sh"),
1181
- bootstrapCommands: z8.array(BootstrapCommandSchema).max(20).default([])
1182
- });
1183
- var RestartStrategySchema = z8.enum(["none", "on-failure", "always", "unless-stopped"]).default("none");
1184
- var ServiceShortcutSchema = z8.object({
1185
- id: z8.string().min(1).max(64),
1186
- label: z8.string().max(200).default(""),
1187
- command: z8.string().max(4096).default(""),
1188
- cwd: z8.string().max(4096).optional()
1189
- });
1190
- var ServiceCommandSchema = z8.object({
1191
- id: z8.string().min(1).max(64),
1192
- label: z8.string().max(200).default(""),
1193
- command: z8.string().max(4096).default(""),
1194
- cwd: z8.string().max(4096).optional(),
1195
- shell: z8.boolean().optional().default(true)
1196
- });
1197
- var VariableSlotSchema = z8.object({
1198
- value: z8.string().max(8192).default(""),
1199
- pre: z8.string().max(8192).default(""),
1200
- post: z8.string().max(8192).default(""),
1201
- isSecret: z8.boolean().default(false),
1202
- // When true, this variable is injected into the process environment of AI
1203
- // agents (Claude Code, Codex, …) spawned while this environment is active.
1204
- // Opt-in: defaults to false so secrets are never leaked to AI agents by default.
1205
- injectIntoAi: z8.boolean().default(false)
1206
- });
1207
- var VariableSchema = z8.object({
1208
- key: z8.string().min(1).max(256),
1209
- value: VariableSlotSchema
1210
- });
1211
- var VariablesRecordSchema = z8.record(
1212
- z8.string().max(128),
1213
- VariableSchema
1214
- ).refine(
1215
- (obj) => Object.keys(obj).length <= 200,
1216
- { message: "Max 200 variables" }
1217
- );
1218
- var VariableSlotsRecordSchema = z8.record(
1219
- z8.string().max(256),
1220
- VariableSlotSchema
1221
- ).refine(
1222
- (obj) => Object.keys(obj).length <= 200,
1223
- { message: "Max 200 variable slots" }
1224
- );
1225
- var ServiceConfigSchema = z8.object({
1226
- id: z8.string().max(128),
1227
- orgId: z8.string().max(128).nullable().optional(),
1228
- agentId: z8.string().max(128).optional(),
1229
- // Optional: if absent, inherited from active environment's agentId
1230
- name: z8.string().min(1).max(200),
1231
- commands: z8.array(ServiceCommandSchema).max(50).optional().default([]),
1232
- cwd: z8.string().max(4096).optional(),
1233
- ports: z8.array(z8.number().int().positive().max(65535)).max(20).optional().default([]),
1234
- // Metadata fields (migration from old Runeya)
1235
- groups: z8.array(z8.string().max(200)).max(20).optional().default([]),
1236
- description: z8.string().max(2e3).optional(),
1237
- /** Path (relative to service.cwd or absolute) where the service's docs/wiki markdown files live. Optional — defaults to service.cwd. */
1238
- docsPath: z8.string().max(4096).optional(),
1239
- url: z8.string().max(2048).optional(),
1240
- localUrls: z8.array(z8.object({
1241
- url: z8.string().max(253).regex(/^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/),
1242
- port: z8.number().int().min(1).max(65535)
1243
- })).max(20).optional().default([]),
1244
- openapiUrl: z8.string().max(2048).optional(),
1245
- git: z8.object({
1246
- remote: z8.string().max(2048).optional(),
1247
- home: z8.string().max(2048).optional()
1248
- }).optional(),
1249
- meta: z8.record(z8.string().max(256), z8.string().max(2e3)).optional().refine((obj) => !obj || Object.keys(obj).length <= 100, { message: "Too many meta keys (max 100)" }),
1250
- // Transient env dict (resolved by server before deployment, used directly by agent runner — NOT persisted)
1251
- env: z8.record(z8.string().max(256), z8.string().max(8192)).default({}).refine(
1252
- (obj) => Object.keys(obj).length <= 200,
1253
- { message: "Too many env vars (max 200)" }
1254
- ),
1255
- envSecrets: z8.array(z8.string().max(256)).max(200).default([]),
1256
- // Transient: resolved JS log parsers (from parserIds, resolved by server before deployment — NOT persisted)
1257
- resolvedLogParsers: z8.array(JSLogParserSchema).default([]).optional(),
1258
- // Transient: resolved working directory (cwd with env vars expanded — NOT persisted)
1259
- resolvedCwd: z8.string().optional(),
1260
- runner: z8.enum(["native", "docker"]).optional().default("native"),
1261
- dockerConfig: DockerConfigSchema.optional(),
1262
- healthCheck: HealthCheckSchema.optional(),
1263
- parserIds: z8.array(z8.string().max(128)).max(50).default([]),
1264
- shortcuts: z8.array(ServiceShortcutSchema).max(50).optional().default([]),
1265
- autoRestart: z8.boolean().optional().default(false),
1266
- clearLogsOnStart: z8.boolean().optional().default(false),
1267
- restartStrategy: RestartStrategySchema.optional(),
1268
- maxRestarts: z8.number().int().nonnegative().optional(),
1269
- restartBackoffMs: z8.number().int().positive().optional().default(1e3),
1270
- // Log sources additionnelles (au-delà du stdout/stderr console par défaut)
1271
- logSources: z8.array(LogSourceConfigSchema).max(20).optional().default([])
1272
- });
1273
- var CreateServiceSchema = ServiceConfigSchema.omit({ id: true }).partial().required({ name: true });
1274
- var UpdateServiceSchema = ServiceConfigSchema.partial().required({ id: true }).extend({
1275
- agentId: z8.string().max(128).nullable().optional(),
1276
- // null = clear (inherit from env), undefined = no change
1277
- cwd: z8.string().max(4096).nullable().optional(),
1278
- git: z8.object({ remote: z8.string().max(2048).optional(), home: z8.string().max(2048).optional() }).nullable().optional(),
1279
- meta: z8.record(z8.string().max(256), z8.string().max(2e3)).nullable().optional().refine((obj) => !obj || Object.keys(obj).length <= 100, { message: "Too many meta keys (max 100)" }),
1280
- healthCheck: HealthCheckSchema.nullable().optional()
1281
- });
1282
-
1283
- // ../../packages/shared/src/schemas/process.schema.ts
1284
- import { z as z9 } from "zod";
1285
- var ProcessStateSchema = z9.enum(["starting", "running", "stopped", "errored"]);
1286
- var HealthStatusSchema = z9.enum(["healthy", "unhealthy", "unknown"]);
1287
- var ProcessStatusSchema = z9.object({
1288
- id: z9.string().max(128),
1289
- serviceId: z9.string().max(128),
1290
- agentId: z9.string().max(128),
1291
- state: ProcessStateSchema,
1292
- pid: z9.number().int().nullable().optional(),
1293
- pids: z9.array(z9.number().int()).optional().default([]),
1294
- exitCode: z9.number().int().nullable().optional(),
1295
- startedAt: z9.coerce.date().nullable().optional(),
1296
- restartCount: z9.number().int().nonnegative().default(0),
1297
- uptime: z9.number().nonnegative().default(0),
1298
- healthStatus: HealthStatusSchema.default("unknown"),
1299
- /**
1300
- * Le répertoire où le processus s'exécute VRAIMENT, absolutisé par l'agent.
1301
- *
1302
- * Rapporté par l'agent plutôt que déduit de la config : entre le `cwd` de la
1303
- * commande, celui du service, l'ancrage sur le projet et les variables que
1304
- * l'agent étend lui-même, la valeur affichée n'aurait rien prouvé. Ce qui
1305
- * intéresse quand un service tourne contre le mauvais dépôt, c'est le chemin
1306
- * final — y compris quand il retombe sur le répertoire de l'agent.
1307
- */
1308
- cwd: z9.string().max(4096).nullable().optional()
1309
- });
1310
-
1311
- // ../../packages/shared/src/schemas/log.schema.ts
1312
- import { z as z10 } from "zod";
1313
- var LogLevelSchema = z10.enum(["debug", "info", "warn", "error", "fatal"]);
1314
- var LogLineSchema = z10.object({
1315
- /** Raw log line as received from the process (immutable context) */
1316
- raw: z10.string(),
1317
- /** Source stream (immutable context) */
1318
- stream: z10.enum(["stdout", "stderr"]),
1319
- /** Severity level */
1320
- level: LogLevelSchema,
1321
- /** Parsed/enriched message to display */
1322
- message: z10.string(),
1323
- /** When true, the line is hidden from the log view */
1324
- hidden: z10.boolean(),
1325
- /** Arbitrary key/value pairs shown in the detail panel */
1326
- metadata: z10.record(z10.string().max(256), z10.unknown()).refine(
1327
- (obj) => Object.keys(obj).length <= 100,
1328
- { message: "Too many metadata keys (max 100)" }
1329
- ),
1330
- /** Full parsed JSON object when the line is JSON */
1331
- json: z10.record(z10.string(), z10.unknown()).optional(),
1332
- /** Custom header for the JSON log card (supports HTML, sanitized before display) */
1333
- jsonHeader: z10.string().max(256).optional()
1334
- });
1335
- var LogCardDirectiveSchema = z10.object({
1336
- id: z10.string().max(128),
1337
- type: z10.string().max(64),
1338
- header: z10.string().max(256),
1339
- collapsable: z10.boolean().optional(),
1340
- collapsed: z10.boolean().optional(),
1341
- state: z10.enum(["open", "append", "close", "self"])
1342
- });
1343
- var ParsedLogSchema = z10.object({
1344
- id: z10.string().max(128),
1345
- processId: z10.string().max(128),
1346
- pid: z10.number().int().nullable().optional(),
1347
- timestamp: z10.coerce.date(),
1348
- level: LogLevelSchema.default("info"),
1349
- message: z10.string().max(16384),
1350
- raw: z10.string().max(16384),
1351
- stream: z10.enum(["stdout", "stderr"]).default("stdout"),
1352
- hidden: z10.boolean().optional().default(false),
1353
- metadata: z10.record(z10.string().max(256), z10.unknown()).optional().refine(
1354
- (obj) => !obj || Object.keys(obj).length <= 100,
1355
- { message: "Too many metadata keys (max 100)" }
1356
- ),
1357
- json: z10.record(z10.string(), z10.unknown()).optional(),
1358
- logCard: LogCardDirectiveSchema.optional(),
1359
- sourceType: z10.enum(["console", "file", "mongo", "mysql"]).optional(),
1360
- sourcePath: z10.string().max(4096).optional()
1361
- });
1362
-
1363
- // ../../packages/shared/src/schemas/agent.schema.ts
1364
- import { z as z11 } from "zod";
1365
- var ENV_VAR_NAME_REGEX = /^[A-Za-z_][A-Za-z0-9_]*$/;
1366
- var AgentConfigSchema = z11.object({
1367
- id: z11.string().max(128),
1368
- name: z11.string().min(1).max(100),
1369
- url: z11.string().url().max(2048),
1370
- passphrase: z11.string().min(1).max(1024),
1371
- passthroughEnv: z11.array(
1372
- z11.string().regex(ENV_VAR_NAME_REGEX).max(256)
1373
- ).max(100).default([])
1374
- });
1375
- var AgentStatusSchema = z11.object({
1376
- connected: z11.boolean(),
1377
- lastSeen: z11.string().nullable().optional(),
1378
- uptime: z11.number().nonnegative().default(0),
1379
- runnersAvailable: z11.array(z11.enum(["native", "docker"])).default(["native"]),
1380
- lanIp: z11.string().optional(),
1381
- /**
1382
- * Ce que la machine de l'agent vaut pour les builtins de portée `agent`.
1383
- * Sert à PRÉVISUALISER — la valeur injectée reste calculée au lancement, par
1384
- * l'agent lui-même : une IP change, un agent se déconnecte, et un statut
1385
- * n'est qu'un cliché.
1386
- */
1387
- os: z11.string().max(64).optional(),
1388
- home: z11.string().max(4096).optional(),
1389
- cwd: z11.string().max(4096).optional()
1390
- });
1391
-
1392
- // ../../packages/shared/src/schemas/permission.schema.ts
1393
- import { z as z12 } from "zod";
1394
- var GlobalRoleSchema = z12.enum(["owner", "admin", "member"]);
1395
- var ProjectRoleSchema = z12.enum(["admin", "editor", "viewer"]);
1396
- var ProjectMemberRoleSchema = z12.object({
1397
- id: z12.string().max(128),
1398
- projectId: z12.string().max(128),
1399
- userId: z12.string().max(128),
1400
- role: ProjectRoleSchema
1401
- });
1402
-
1403
- // ../../packages/shared/src/schemas/sync.schema.ts
1404
- import { z as z13 } from "zod";
1405
- var ConfigVersionSchema = z13.object({
1406
- id: z13.string().max(128),
1407
- entityType: z13.enum(["project", "service"]),
1408
- entityId: z13.string().max(128),
1409
- version: z13.string().max(128),
1410
- parentVersion: z13.string().max(128),
1411
- data: z13.record(z13.string(), z13.unknown()).refine(
1412
- (obj) => Object.keys(obj).length <= 1e3,
1413
- "Too many data keys (max 1000)"
1414
- ),
1415
- patch: z13.array(z13.record(z13.string(), z13.unknown())).max(1e3),
1416
- userId: z13.string().max(128),
1417
- timestamp: z13.coerce.date(),
1418
- resolved: z13.boolean().default(false)
1419
- });
1420
- var ConfigChangeSchema = z13.object({
1421
- entityType: z13.enum(["project", "service"]),
1422
- entityId: z13.string().max(128),
1423
- version: z13.string().max(128),
1424
- parentVersion: z13.string().max(128),
1425
- data: z13.record(z13.string(), z13.unknown()).refine(
1426
- (obj) => Object.keys(obj).length <= 1e3,
1427
- "Too many data keys (max 1000)"
1428
- ),
1429
- patch: z13.array(z13.record(z13.string(), z13.unknown())).max(1e3)
1430
- });
1431
- var SyncStatusSchema = z13.object({
1432
- connected: z13.boolean(),
1433
- lastSync: z13.coerce.date().nullable().optional(),
1434
- pendingChanges: z13.number().int().nonnegative().default(0),
1435
- conflicts: z13.number().int().nonnegative().default(0)
1436
- });
1437
-
1438
- // ../../packages/shared/src/schemas/audit.schema.ts
1439
- import { z as z14 } from "zod";
1440
- var AuditActionSchema = z14.enum([
1441
- "create",
1442
- "update",
1443
- "delete",
1444
- "invite",
1445
- "remove",
1446
- "deploy",
1447
- "start",
1448
- "stop",
1449
- "roleChange"
1450
- ]);
1451
- var AuditEntityTypeSchema = z14.enum([
1452
- "org",
1453
- "project",
1454
- "service",
1455
- "member",
1456
- "permission"
1457
- ]);
1458
- var AuditLogSchema = z14.object({
1459
- id: z14.string().max(128),
1460
- orgId: z14.string().max(128),
1461
- userId: z14.string().max(128),
1462
- action: AuditActionSchema,
1463
- entityType: AuditEntityTypeSchema,
1464
- entityId: z14.string().max(128),
1465
- metadata: z14.record(z14.string().max(256), z14.unknown()).default({}).refine(
1466
- (obj) => Object.keys(obj).length <= 100,
1467
- { message: "Too many metadata keys (max 100)" }
1468
- ),
1469
- timestamp: z14.coerce.date()
1470
- });
1471
-
1472
- // ../../packages/shared/src/schemas/metrics.schema.ts
1473
- import { z as z15 } from "zod";
1474
- var ProcessMetricsSchema = z15.object({
1475
- processId: z15.string().max(128),
1476
- cpu: z15.number().nonnegative(),
1477
- memory: z15.number().int().nonnegative(),
1478
- timestamp: z15.string()
1479
- });
1480
-
1481
- // ../../packages/shared/src/schemas/environment.schema.ts
1482
- import { z as z16 } from "zod";
1483
- var EnvironmentVariablesSchema = z16.record(
1484
- z16.string().max(256),
1485
- VariableSchema
1486
- ).refine(
1487
- (obj) => Object.keys(obj).length <= 200,
1488
- { message: "Max 200 variables" }
1489
- );
1490
- var EnvironmentSchema = z16.object({
1491
- id: z16.string().max(128),
1492
- projectId: z16.string().max(128),
1493
- name: z16.string().min(1).max(200),
1494
- description: z16.string().max(2e3).optional().default(""),
1495
- parentIds: z16.array(z16.string().max(128)).max(10).default([]),
1496
- variables: EnvironmentVariablesSchema.default({}),
1497
- // Scope: 'global' = project-level env, 'service' = per-service env
1498
- scope: z16.enum(["global", "service"]).default("global"),
1499
- // When scope='service': the serviceId this env belongs to
1500
- reference: z16.string().max(128).optional(),
1501
- // When scope='service': the globalEnvId this env activates on
1502
- activateOn: z16.string().max(128).optional(),
1503
- immutable: z16.boolean().default(false),
1504
- default: z16.boolean().optional().default(false),
1505
- color: z16.string().max(20).optional(),
1506
- bgColor: z16.string().max(20).optional(),
1507
- // When scope='global': the default agent used by services that don't have an explicit agentId
1508
- agentId: z16.string().max(128).optional()
1509
- });
1510
- var ResolvedEnvironmentSchema = z16.object({
1511
- variables: z16.record(z16.string().max(256), VariableSchema).refine((obj) => Object.keys(obj).length <= 500, { message: "Max 500 resolved variables" }),
1512
- env: z16.record(z16.string().max(256), z16.string().max(8192)).refine((obj) => Object.keys(obj).length <= 500, { message: "Max 500 resolved env vars" }),
1513
- envSecrets: z16.array(z16.string().max(256)).max(500),
1514
- sources: z16.record(z16.string().max(256), z16.object({
1515
- environmentId: z16.string().max(128),
1516
- environmentName: z16.string().max(200),
1517
- overridden: z16.boolean(),
1518
- resolvedFrom: z16.object({
1519
- environmentId: z16.string().max(128),
1520
- environmentName: z16.string().max(200)
1521
- }).optional(),
1522
- // Set when a machine-local override was applied to this variable, pointing
1523
- // at the environment that carries the winning override. Distinct from
1524
- // `overridden`, which also covers "shadows an inherited variable".
1525
- overriddenBy: z16.object({
1526
- environmentId: z16.string().max(128),
1527
- environmentName: z16.string().max(200)
1528
- }).optional()
1529
- })).refine((obj) => Object.keys(obj).length <= 500, { message: "Max 500 source entries" })
1530
- });
1531
- var CreateEnvironmentSchema = EnvironmentSchema.omit({ id: true }).extend({
1532
- description: z16.string().max(2e3).optional().default(""),
1533
- parentIds: z16.array(z16.string().max(128)).max(10).optional().default([]),
1534
- variables: EnvironmentVariablesSchema.optional().default({}),
1535
- scope: z16.enum(["global", "service"]).optional().default("global"),
1536
- reference: z16.string().max(128).optional(),
1537
- activateOn: z16.string().max(128).optional(),
1538
- immutable: z16.boolean().optional().default(false)
1539
- });
1540
- var UpdateEnvironmentSchema = EnvironmentSchema.partial().required({ id: true }).extend({
1541
- description: z16.string().max(2e3).optional(),
1542
- parentIds: z16.array(z16.string().max(128)).max(10).optional(),
1543
- variables: EnvironmentVariablesSchema.optional(),
1544
- scope: z16.enum(["global", "service"]).optional(),
1545
- immutable: z16.boolean().optional(),
1546
- default: z16.boolean().optional(),
1547
- agentId: z16.string().max(128).nullable().optional()
1548
- // null = clear (no default agent)
1549
- });
1550
-
1551
- // ../../packages/shared/src/schemas/environment-overrides.schema.ts
1552
- import { z as z17 } from "zod";
1553
- var VariableOverrideSchema = z17.object({
1554
- value: VariableSlotSchema
1555
- });
1556
- var EnvironmentOverridesSchema = z17.record(
1557
- z17.string().max(128),
1558
- VariableOverrideSchema
1559
- ).refine(
1560
- (obj) => Object.keys(obj).length <= 5e3,
1561
- { message: "Max 5000 overrides" }
1562
- );
1563
-
1564
- // ../../packages/shared/src/schemas/api-key.schema.ts
1565
- import { z as z18 } from "zod";
1566
- var ApiServiceActionSchema = z18.enum([
1567
- "service:read",
1568
- "service:start",
1569
- "service:stop",
1570
- "service:restart",
1571
- "service:healthcheck",
1572
- "service:status",
1573
- "logs:read"
1574
- ]);
1575
- var ApiEnvActionSchema = z18.enum(["env:read", "env:write"]);
1576
- var ApiEnvPermSchema = z18.object({
1577
- environmentId: z18.string().max(128),
1578
- actions: z18.array(ApiEnvActionSchema).max(10).default(["env:read"]),
1579
- includeSecrets: z18.boolean().default(false)
1580
- });
1581
- var ApiServicePermSchema = z18.object({
1582
- serviceId: z18.string().max(128),
1583
- actions: z18.array(ApiServiceActionSchema).max(10).default(["service:read"]),
1584
- environments: z18.array(ApiEnvPermSchema).max(100).default([])
1585
- });
1586
- var ApiKeyScopeSchema = z18.object({
1587
- services: z18.array(ApiServicePermSchema).max(500).default([])
1588
- });
1589
- var ApiKeySchema = z18.object({
1590
- id: z18.string().max(128),
1591
- name: z18.string().min(1).max(200),
1592
- key: z18.string().regex(/^[0-9a-f]{64}$/i),
1593
- scopes: ApiKeyScopeSchema,
1594
- createdAt: z18.string().max(64),
1595
- isPublic: z18.boolean().default(false)
1596
- });
1597
- var PersistedApiKeySchema = ApiKeySchema.extend({
1598
- key: z18.string().min(1).max(4096)
1599
- });
1600
- var ApiKeysFileSchema = z18.object({
1601
- keys: z18.array(PersistedApiKeySchema).max(100)
1602
- });
1603
- var MaskedApiKeySchema = ApiKeySchema.omit({ key: true }).extend({
1604
- /** Last 4 characters of the secret, for recognising a key in a list. */
1605
- keyPreview: z18.string().max(8)
1606
- });
1607
-
1608
- // ../../packages/shared/src/schemas/image.schema.ts
1609
- import { z as z19 } from "zod";
1610
- var ALLOWED_IMAGE_MIME_TYPES = ["image/png", "image/jpeg", "image/webp", "image/gif"];
1611
- var ImagePartSchema = z19.object({
1612
- type: z19.literal("image"),
1613
- imageId: z19.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, "Must be a valid UUID"),
1614
- url: z19.string().min(1),
1615
- mimeType: z19.enum(ALLOWED_IMAGE_MIME_TYPES),
1616
- altText: z19.string().max(500).optional()
1617
- });
1618
- var ImageUploadResponseSchema = z19.object({
1619
- imageId: z19.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, "Must be a valid UUID"),
1620
- url: z19.string().min(1),
1621
- mimeType: z19.enum(ALLOWED_IMAGE_MIME_TYPES),
1622
- originalName: z19.string()
1623
- });
1624
- var ImageMetaSchema = z19.object({
1625
- imageId: z19.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, "Must be a valid UUID"),
1626
- filePath: z19.string().min(1),
1627
- mimeType: z19.enum(ALLOWED_IMAGE_MIME_TYPES),
1628
- originalName: z19.string().min(1),
1629
- createdAt: z19.number().positive(),
1630
- size: z19.number().positive().optional()
1631
- });
1632
-
1633
- // ../../packages/shared/src/schemas/kanban.schema.ts
1634
- import { z as z20 } from "zod";
1635
- var KanbanAttachmentSchema = z20.object({
1636
- /** Server-issued id, also the storage key. */
1637
- id: z20.string().max(128),
1638
- name: z20.string().max(255),
1639
- size: z20.number().int().nonnegative(),
1640
- contentType: z20.string().max(128)
1641
- });
1642
- var KanbanCardEventSchema = z20.object({
1643
- type: z20.enum(["created", "edited", "moved", "image_added", "image_removed", "title_changed", "conversation_started", "scenario_started", "comment", "archived", "unarchived"]),
1644
- timestamp: z20.string(),
1645
- /** Extra context: old/new column name, old/new title, comment text, etc. */
1646
- /**
1647
- * Le texte de l'entrée : le corps d'un commentaire, ou le contexte du geste.
1648
- *
1649
- * Borné comme le corps d'une carte (100 000), et non plus à 5 000 : un
1650
- * commentaire est de la prose comme une description, et rien de technique ne
1651
- * justifiait un écart de vingt fois. La borne étroite s'est vue à l'import
1652
- * d'un Kanbanize, où des commentaires de 12 000 caractères passaient par
1653
- * l'API publique — bornée, elle, à 20 000 — pour écrire en base une donnée que
1654
- * ce schéma déclarait invalide, et qu'aucune reprise depuis l'interface
1655
- * n'aurait ensuite pu enregistrer.
1656
- */
1657
- detail: z20.string().max(1e5).optional(),
1658
- /**
1659
- * Stable identity of the event, used to tell an edit from an insertion when a
1660
- * whole history is written back. Absent on events recorded before the field
1661
- * existed; those fall back to (type, timestamp).
1662
- */
1663
- id: z20.string().max(128).optional(),
1664
- /** Who authored this event — 'ai' or 'user'. Only set for comment events. */
1665
- author: z20.enum(["ai", "user"]).optional(),
1666
- /**
1667
- * Qui est derrière l'événement, estampillé par le serveur — jamais pris du
1668
- * client, sans quoi n'importe qui pourrait signer au nom d'un autre.
1669
- *
1670
- * Posé sur les commentaires (c'est ce qui rend « mon propre commentaire »
1671
- * répondable ; `author` ne sépare que l'IA de l'humain) et sur les
1672
- * déplacements. Absent des événements écrits avant qu'on l'estampille : un
1673
- * lecteur doit donc afficher « on ne sait pas », pas un nom vide.
1674
- *
1675
- * Pour une clé d'API, c'est le nom de la clé et non son porteur : la clé
1676
- * emprunte les droits de son créateur, pas son identité — personne ne doit
1677
- * croire qu'un humain a déplacé ce qu'un robot de CI a déplacé.
1678
- */
1679
- authorUser: z20.object({ id: z20.string().max(128), name: z20.string().max(200) }).optional(),
1680
- /** Set when the author amended their comment, so the UI can say so. */
1681
- editedAt: z20.string().optional(),
1682
- /** Files attached to a comment — same storage as a card's own attachments. */
1683
- attachments: z20.array(KanbanAttachmentSchema).max(20).optional(),
1684
- /** Conversation that produced this event (comments only). Used to navigate back to the conversation. */
1685
- conversationId: z20.string().optional()
1686
- });
1687
- var KanbanCardSchema = z20.object({
1688
- id: z20.string(),
1689
- title: z20.string().min(1).max(500),
1690
- markdown: z20.string().max(1e5).default(""),
1691
- /**
1692
- * Legacy inline images, kept so boards written before object storage still
1693
- * render. New uploads go to `attachments` instead.
1694
- */
1695
- images: z20.array(z20.string()).default([]),
1696
- /** Files attached to the card — stored out of band, referenced here. */
1697
- attachments: z20.array(KanbanAttachmentSchema).max(50).default([]),
1698
- order: z20.number().int(),
1699
- /**
1700
- * La priorité de la carte, de 1 à 10 — 10 étant le plus urgent.
1701
- *
1702
- * Facultative, et absente veut dire « pas de priorité », pas « la plus
1703
- * basse » : une carte qu'on n'a pas encore arbitrée ne doit pas se ranger
1704
- * d'office au fond de la pile.
1705
- */
1706
- priority: z20.number().int().min(1).max(10).optional(),
1707
- /**
1708
- * Les groupes de la carte — des étiquettes libres, posées par l'équipe.
1709
- *
1710
- * Rien ne les déclare ailleurs : un groupe existe parce qu'une carte le
1711
- * porte, et disparaît avec la dernière qui le portait. C'est ce qui permet
1712
- * d'en créer un en le tapant, sans passer par un écran d'administration.
1713
- */
1714
- groups: z20.array(z20.string().min(1).max(60)).max(30).optional(),
1715
- /**
1716
- * L'échéance de la carte : le jour où elle est attendue, `AAAA-MM-JJ`.
1717
- *
1718
- * Un jour, pas un instant, et c'est une décision : une équipe se dit « pour
1719
- * vendredi », jamais « pour vendredi 23:59:59 UTC ». Stocker un instant
1720
- * ferait afficher une échéance au 4 mars comme le 3 mars à qui travaille à
1721
- * l'ouest de Greenwich — la carte serait en retard d'un jour pour la moitié
1722
- * de l'équipe, et personne ne saurait pourquoi.
1723
- *
1724
- * Facultative, et absente veut dire « pas d'échéance », pas « en retard » :
1725
- * une carte qu'on n'a pas datée ne doit pas s'annoncer comme urgente.
1726
- */
1727
- deadline: z20.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
1728
- /**
1729
- * La couleur de la carte, en hexadécimal (`#RRGGBB`) — un liseré en haut de
1730
- * la carte, et rien d'autre : ce qu'elle veut dire appartient à l'équipe.
1731
- *
1732
- * Bornée à une notation stricte plutôt qu'à une chaîne libre : cette valeur
1733
- * finit dans un attribut `style`, et une couleur ne doit pouvoir contenir
1734
- * qu'une couleur. Absente sur les cartes sans couleur.
1735
- */
1736
- color: z20.string().regex(/^#[0-9a-fA-F]{6}$/).optional(),
1737
- /**
1738
- * Le journal de la carte — commentaires compris.
1739
- *
1740
- * Optionnel, et c'est tout l'intérêt : c'est la partie qui grossit sans fin
1741
- * (une IA bavarde y écrit des pages), alors les lectures de tableau ne le
1742
- * transportent plus. `undefined` veut dire « pas chargé », et une écriture
1743
- * qui l'omet laisse au serveur celui qu'il a en base — à ne pas confondre
1744
- * avec `[]`, qui demanderait bel et bien de le vider.
1745
- */
1746
- history: z20.array(KanbanCardEventSchema).optional(),
1747
- /**
1748
- * Ce que le journal absent laisse quand même dire : combien de commentaires,
1749
- * et quand fut le dernier. Posés par le serveur en lecture, ignorés en
1750
- * écriture — la carte ne les stocke pas, ils se déduisent de `history`.
1751
- */
1752
- commentCount: z20.number().int().nonnegative().optional(),
1753
- lastCommentAt: z20.string().optional(),
1754
- /**
1755
- * Les entrées de journal qui ouvrent une conversation IA. Elles restent dans
1756
- * la lecture allégée — il y en a une poignée par carte, et l'hôte s'en sert
1757
- * pour dire, sans ouvrir la carte, qu'une IA y travaille.
1758
- */
1759
- conversationEvents: z20.array(KanbanCardEventSchema).optional(),
1760
- createdAt: z20.string(),
1761
- updatedAt: z20.string(),
1762
- /**
1763
- * Quand la carte a été archivée — absente tant qu'elle est au tableau.
1764
- *
1765
- * Une carte archivée reste dans sa colonne en base : c'est la lecture qui la
1766
- * retire du tableau, jamais une écriture qui la déplace. Rien à recoller donc
1767
- * au désarchivage, et aucun cimetière où une carte pourrait se perdre.
1768
- */
1769
- archivedAt: z20.string().optional(),
1770
- /**
1771
- * La colonne d'où la carte a été archivée, telle qu'elle s'appelait alors.
1772
- *
1773
- * L'identifiant sert à l'y remettre, le titre à le dire dans l'archive même
1774
- * quand la colonne a disparu depuis — auquel cas le désarchivage repose la
1775
- * carte dans la première colonne, sans se taire sur son origine.
1776
- */
1777
- archivedFrom: z20.object({ columnId: z20.string().max(128), columnTitle: z20.string().max(200) }).optional(),
1778
- /**
1779
- * Quand la carte a été supprimée. Rien n'est effacé : la carte reste en base,
1780
- * et toutes les lectures l'écartent.
1781
- *
1782
- * Une suppression est le seul geste que rien ne rattrape — sauf à ne pas
1783
- * l'exécuter vraiment. La colonne et le tableau portent le même champ, pour
1784
- * que supprimer l'un n'emporte jamais les cartes de l'autre.
1785
- */
1786
- deletedAt: z20.string().optional(),
1787
- /**
1788
- * People assigned to the card. Names are denormalized for display; the server
1789
- * keeps only members of the owning organization, and notifies newcomers.
1790
- */
1791
- assignees: z20.array(z20.object({ id: z20.string().max(128), name: z20.string().max(200) })).max(20).default([]),
1792
- /**
1793
- * Who first created the card. Stamped by the server the first time a card id
1794
- * appears in a board write, never taken from the client — a member could
1795
- * otherwise claim any authorship. Absent on cards created before this field
1796
- * existed, so readers must treat it as unknown rather than assume.
1797
- */
1798
- createdBy: z20.object({ id: z20.string().max(128), name: z20.string().max(200) }).optional()
1799
- });
1800
- var KanbanColumnSchema = z20.object({
1801
- id: z20.string(),
1802
- title: z20.string().min(1).max(200),
1803
- order: z20.number().int(),
1804
- cards: z20.array(KanbanCardSchema).default([]),
1805
- /**
1806
- * Le regroupement auquel la colonne appartient, s'il y en a un.
1807
- *
1808
- * Un pointeur vers le parent, et rien dans l'autre sens : le groupe ne tient
1809
- * pas la liste de ses membres. Deux listes qui prétendent dire qui contient
1810
- * quoi finissent par se contredire, et un déplacement devient alors deux
1811
- * écritures au lieu d'une.
1812
- */
1813
- groupId: z20.string().optional(),
1814
- /** Supprimée, mais conservée — voir `deletedAt` sur la carte. */
1815
- deletedAt: z20.string().optional()
1816
- });
1817
- var KanbanColumnGroupSchema = z20.object({
1818
- id: z20.string(),
1819
- title: z20.string().min(1).max(200),
1820
- /** La couleur du bandeau, en hexadécimal — l'interface décide du défaut. */
1821
- color: z20.string().regex(/^#[0-9a-fA-F]{6}$/).optional(),
1822
- /** Le groupe parent, pour les regroupements imbriqués. */
1823
- parentId: z20.string().optional(),
1824
- /** Supprimé, mais conservé — comme une colonne. */
1825
- deletedAt: z20.string().optional()
1826
- });
1827
- var KanbanBoardSchema = z20.object({
1828
- id: z20.string(),
1829
- name: z20.string().min(1).max(200),
1830
- description: z20.string().max(1e4).default(""),
1831
- /**
1832
- * Le mode d'emploi du tableau, en texte libre : ce que veulent dire ses
1833
- * colonnes, quand une carte a le droit d'avancer, les conventions de
1834
- * l'équipe. Écrit par les humains, lu surtout par l'IA — il est injecté dans
1835
- * le prompt des agents pour qu'ils travaillent selon les règles du tableau
1836
- * plutôt que selon les leurs.
1837
- */
1838
- instructions: z20.string().max(2e4).default(""),
1839
- columns: z20.array(KanbanColumnSchema).default([]),
1840
- /** Les regroupements de colonnes — vide sur un tableau qui n'en a jamais eu. */
1841
- columnGroups: z20.array(KanbanColumnGroupSchema).default([]),
1842
- archived: z20.boolean().default(false),
1843
- /** Supprimé, mais conservé avec ses cartes — voir `deletedAt` sur la carte. */
1844
- deletedAt: z20.string().optional(),
1845
- createdAt: z20.string(),
1846
- updatedAt: z20.string()
1847
- });
1848
- var CreateKanbanBoardInput = z20.object({
1849
- name: z20.string().min(1).max(200),
1850
- description: z20.string().max(1e4).optional(),
1851
- instructions: z20.string().max(2e4).optional()
1852
- });
1853
- var UpdateKanbanBoardInput = z20.object({
1854
- id: z20.string(),
1855
- name: z20.string().min(1).max(200).optional(),
1856
- description: z20.string().max(1e4).optional(),
1857
- instructions: z20.string().max(2e4).optional(),
1858
- columns: z20.array(KanbanColumnSchema).optional(),
1859
- archived: z20.boolean().optional()
1860
- });
1861
- var KanbanCardLinkSchema = z20.object({
1862
- id: z20.string().max(128),
1863
- /** Le tableau et la carte qui *dépendent* de l'autre. */
1864
- childBoardId: z20.string().max(64),
1865
- childCardId: z20.string().max(128),
1866
- /** Le tableau et la carte *dont* on dépend. */
1867
- parentBoardId: z20.string().max(64),
1868
- parentCardId: z20.string().max(128),
1869
- createdAt: z20.string(),
1870
- createdBy: z20.object({ id: z20.string().max(128), name: z20.string().max(200) }).optional()
1871
- });
1872
- var KanbanCardRefSchema = z20.object({
1873
- cardId: z20.string().max(128),
1874
- boardId: z20.string().max(64),
1875
- boardName: z20.string().max(200),
1876
- columnId: z20.string().max(128),
1877
- columnTitle: z20.string().max(200),
1878
- title: z20.string().max(500),
1879
- /** Les mêmes informations qu'une ligne de tableau montre d'une carte d'ici. */
1880
- assignees: z20.array(z20.object({ id: z20.string().max(128), name: z20.string().max(200) })).default([]),
1881
- commentCount: z20.number().int().nonnegative().default(0)
1882
- });
1883
-
1884
- // ../../packages/shared/src/schemas/cloud-api-key.schema.ts
1885
- import { z as z21 } from "zod";
1886
- var CloudApiScopeSchema = z21.enum([
1887
- "kanban:read",
1888
- "kanban:write",
1889
- "kanban:comment",
1890
- "kanban:delete"
1891
- ]);
1892
- var CloudApiKeySecretSchema = z21.string().regex(/^rk_[0-9a-f]{64}$/);
1893
- var CloudApiKeySchema = z21.object({
1894
- id: z21.string().max(128),
1895
- organizationId: z21.string().max(128),
1896
- name: z21.string().min(1).max(200),
1897
- scopes: z21.array(CloudApiScopeSchema).min(1).max(10),
1898
- /**
1899
- * Les tableaux que la clé peut atteindre, ou `null` pour « tous ceux de
1900
- * l'organisation ».
1901
- *
1902
- * `null` et `[]` ne sont pas la même chose : la liste vide n'ouvre rien, et
1903
- * c'est délibéré — un tableau supprimé ne doit pas élargir une clé qui ne le
1904
- * nommait plus que lui.
1905
- */
1906
- boards: z21.array(z21.string().max(64)).max(200).nullable(),
1907
- createdAt: z21.string().max(64),
1908
- /** Dernier usage constaté, pour reconnaître une clé oubliée. */
1909
- lastUsedAt: z21.string().max(64).nullable(),
1910
- /** Qui l'a émise — une clé sans visage ne se révoque jamais sereinement. */
1911
- createdBy: z21.object({ id: z21.string().max(128), name: z21.string().max(200) }),
1912
- /** Les 4 derniers caractères du secret, pour reconnaître une clé dans une liste. */
1913
- keyPreview: z21.string().max(8)
1914
- });
1915
- var CreatedCloudApiKeySchema = z21.object({
1916
- key: CloudApiKeySchema,
1917
- secret: CloudApiKeySecretSchema
1918
- });
1919
- var CreateCloudApiKeyInput = z21.object({
1920
- organizationId: z21.string().min(1).max(128),
1921
- name: z21.string().min(1).max(200),
1922
- scopes: z21.array(CloudApiScopeSchema).min(1).max(10),
1923
- boards: z21.array(z21.string().max(64)).max(200).nullable().default(null)
1924
- });
1925
- var UpdateCloudApiKeyInput = z21.object({
1926
- id: z21.string().min(1).max(128),
1927
- name: z21.string().min(1).max(200).optional(),
1928
- scopes: z21.array(CloudApiScopeSchema).min(1).max(10).optional(),
1929
- boards: z21.array(z21.string().max(64)).max(200).nullable().optional()
1930
- });
1931
-
1932
- // ../../packages/shared/src/schemas/changelog.schema.ts
1933
- import { z as z22 } from "zod";
1934
- var ChangelogSurfaceSchema = z22.enum(["app", "cloud"]);
1935
- var ChangelogChangeKindSchema = z22.enum(["feature", "improvement", "fix", "breaking"]);
1936
- var ChangelogTextSchema = z22.object({
1937
- fr: z22.string().min(1).max(500),
1938
- en: z22.string().min(1).max(500)
1939
- });
1940
- var ChangelogChangeSchema = z22.object({
1941
- kind: ChangelogChangeKindSchema,
1942
- text: ChangelogTextSchema
1943
- });
1944
- var ChangelogDraftSchema = ChangelogChangeSchema.extend({
1945
- date: z22.string().regex(/^\d{4}-\d{2}-\d{2}$/),
1946
- title: ChangelogTextSchema.optional()
1947
- });
1948
- var ChangelogReleaseSchema = z22.object({
1949
- surface: ChangelogSurfaceSchema,
1950
- /** `1.4.2` pour l'app (version npm publiée), `2026-09-03` — ou `2026-09-03.2` — pour le cloud. */
1951
- version: z22.string().min(1).max(32).regex(/^[0-9][0-9.-]*$/),
1952
- /** Date de publication, `YYYY-MM-DD`. */
1953
- date: z22.string().regex(/^\d{4}-\d{2}-\d{2}$/),
1954
- /** Facultatif : une version peut s'annoncer par son seul numéro. */
1955
- title: ChangelogTextSchema.optional(),
1956
- /** Une version sans changement n'a rien à annoncer : elle n'a pas sa place ici. */
1957
- changes: z22.array(ChangelogChangeSchema).min(1).max(50)
1958
- });
1959
- var ChangelogIndexItemSchema = ChangelogReleaseSchema.omit({ changes: true }).extend({
1960
- changeCount: z22.number().int().nonnegative()
1961
- });
1962
-
1963
- // ../../packages/shared/src/utils/crypto.ts
1964
- import { createCipheriv as createCipheriv3, createDecipheriv as createDecipheriv3, randomBytes as randomBytes3, pbkdf2Sync } from "crypto";
1965
-
1966
- // ../../packages/shared/src/native-parsers.ts
1967
- var epoch = /* @__PURE__ */ new Date("2025-01-01T00:00:00Z");
1968
- var nativeParsers = [
1969
- {
1970
- id: "native:json",
1971
- name: "JSON Log Parser",
1972
- description: "Parses JSON log lines and extracts level, message, timestamp, metadata, and the full parsed object.",
1973
- code: `(line) => {
1974
- var trimmed = line.message.trim();
1975
- if (!trimmed.startsWith('{')) return line;
1976
- try {
1977
- var obj = JSON.parse(trimmed);
1978
- var level = (obj.level || obj.severity || obj.loglevel || '').toString().toLowerCase();
1979
- var levelMap = { trace: 'debug', debug: 'debug', info: 'info', warn: 'warn', warning: 'warn', error: 'error', fatal: 'fatal', err: 'error' };
1980
- var mappedLevel = levelMap[level] || line.level;
1981
- var message = obj.message || obj.msg || obj.text || trimmed;
1982
- var metadata = {};
1983
- for (var k in obj) {
1984
- if (['level','severity','loglevel','message','msg','text','timestamp','time','ts'].indexOf(k) !== -1) continue;
1985
- metadata[k] = typeof obj[k] === 'string' ? obj[k] : JSON.stringify(obj[k]);
1986
- }
1987
- var merged = {};
1988
- for (var mk in line.metadata) merged[mk] = line.metadata[mk];
1989
- for (var nk in metadata) merged[nk] = metadata[nk];
1990
- return { raw: line.raw, stream: line.stream, level: mappedLevel, message: String(message).slice(0, 16384), hidden: line.hidden, metadata: merged, json: obj, jsonHeader: line.jsonHeader };
1991
- } catch (e) { return line; }
1992
- }`,
1993
- enabled: true,
1994
- builtin: true,
1995
- createdAt: epoch,
1996
- updatedAt: epoch
1997
- },
1998
- {
1999
- id: "native:debug",
2000
- name: "Runeya Debug Parser",
2001
- description: 'Detects Runeya internal debug logs emitted as JSON arrays: ["runeya", payload]. Marks them as debug level.',
2002
- code: `(line) => {
2003
- var trimmed = line.message.trim();
2004
- if (!trimmed.startsWith('[')) return line;
2005
- try {
2006
- var parsed = JSON.parse(trimmed);
2007
- if (!Array.isArray(parsed) || parsed[0] !== 'runeya') return line;
2008
- var debug = parsed.length === 2 ? parsed[1] : parsed.slice(1);
2009
- var message = typeof debug === 'string' ? debug : JSON.stringify(debug);
2010
- var merged = {};
2011
- for (var k in line.metadata) merged[k] = line.metadata[k];
2012
- merged.runeya_debug = JSON.stringify(debug);
2013
- return { raw: line.raw, stream: line.stream, level: 'debug', message: message, hidden: line.hidden, metadata: merged, jsonHeader: line.jsonHeader };
2014
- } catch (e) { return line; }
2015
- }`,
2016
- enabled: true,
2017
- builtin: true,
2018
- createdAt: epoch,
2019
- updatedAt: epoch
2020
- },
2021
- {
2022
- id: "native:links",
2023
- name: "Link Detector",
2024
- description: "Detects URLs in plain-text log lines and exposes them in metadata.links for frontend rendering.",
2025
- code: `(line) => {
2026
- var urlRegex = /(https?|ftp):\\/\\/[\\w_-]+(?:\\.[\\w_-]+)+([\\w.,@?^=%&:/~+#-]*[\\w@?^=%&/~+#-])?/gi;
2027
- var urls = line.message.match(urlRegex);
2028
- if (!urls || urls.length === 0) return line;
2029
- var merged = {};
2030
- for (var k in line.metadata) merged[k] = line.metadata[k];
2031
- merged.links = urls.join(' ');
2032
- return { raw: line.raw, stream: line.stream, level: line.level, message: line.message, hidden: line.hidden, metadata: merged, jsonHeader: line.jsonHeader };
2033
- }`,
2034
- enabled: true,
2035
- builtin: true,
2036
- createdAt: epoch,
2037
- updatedAt: epoch
2038
- }
2039
- ];
2040
-
2041
- // ../../packages/shared/src/js-log-parser.ts
2042
- import vm from "vm";
2043
- var VALID_LEVELS = /* @__PURE__ */ new Set(["debug", "info", "warn", "error", "fatal"]);
2044
- var PARSE_TIMEOUT_MS = 50;
2045
- var MAX_CONSECUTIVE_TIMEOUTS = 10;
2046
- var JSLogParser = class {
2047
- parsers = [];
2048
- constructor(definitions = []) {
2049
- this.setParsers(definitions);
2050
- }
2051
- setParsers(definitions) {
2052
- this.parsers = [];
2053
- for (const def of definitions) {
2054
- if (!def.enabled) continue;
2055
- try {
2056
- const compiled = this.compileParser(def);
2057
- this.parsers.push({
2058
- id: def.id,
2059
- name: def.name,
2060
- enabled: true,
2061
- fn: compiled
2062
- });
2063
- } catch (err) {
2064
- console.warn(
2065
- `[js-log-parser] Failed to compile parser "${def.name}" (${def.id}): ${err instanceof Error ? err.message : String(err)}`
2066
- );
2067
- }
2068
- }
2069
- }
2070
- parse(line) {
2071
- let current = line;
2072
- for (const parser of this.parsers) {
2073
- try {
2074
- current = parser.fn(current);
2075
- } catch (err) {
2076
- console.warn(
2077
- `[js-log-parser] Parser "${parser.name}" threw error: ${err instanceof Error ? err.message : String(err)}`
2078
- );
2079
- }
2080
- }
2081
- return this.sanitize(current);
2082
- }
2083
- /**
2084
- * Compile le code utilisateur en une fonction bornée en temps.
2085
- *
2086
- * Le `timeout` de `runInNewContext` ne couvre que l'évaluation de la factory :
2087
- * la closure retournée s'exécutait ensuite ligne par ligne directement sur
2088
- * l'event loop, sans aucune borne. Une regex à backtracking exponentiel
2089
- * fournie par l'utilisateur figeait donc l'agent entier — logs, statuts et
2090
- * métriques de *tous* les services. Chaque invocation repasse maintenant par
2091
- * la vm, avec son propre budget.
2092
- */
2093
- compileParser(def) {
2094
- const forbidden = ["require(", "import ", "eval("];
2095
- for (const pat of forbidden) {
2096
- if (def.code.includes(pat)) {
2097
- throw new Error("Code contains forbidden patterns (require, import, eval)");
2098
- }
2099
- }
2100
- const sandbox = {
2101
- RegExp,
2102
- String,
2103
- Object,
2104
- Array,
2105
- JSON,
2106
- Math,
2107
- Date,
2108
- undefined: void 0,
2109
- null: null
2110
- };
2111
- let script;
2112
- try {
2113
- script = new vm.Script(`(${def.code})`, { filename: `parser-${def.id}.js` });
2114
- } catch (err) {
2115
- throw new Error(`Compilation failed: ${err instanceof Error ? err.message : String(err)}`);
2116
- }
2117
- const context = vm.createContext({ ...sandbox, __line: null, __result: null });
2118
- let parserFn;
2119
- try {
2120
- parserFn = script.runInContext(context, { timeout: 100 });
2121
- } catch (err) {
2122
- throw new Error(`Execution failed: ${err instanceof Error ? err.message : String(err)}`);
2123
- }
2124
- if (typeof parserFn !== "function") {
2125
- throw new Error("Parser code must export a function");
2126
- }
2127
- context["__parserFn"] = parserFn;
2128
- const callScript = new vm.Script("__result = __parserFn(__line);", {
2129
- filename: `parser-${def.id}-call.js`
2130
- });
2131
- let consecutiveTimeouts = 0;
2132
- let disabled = false;
2133
- return (line) => {
2134
- if (disabled) return line;
2135
- const ctx = context;
2136
- ctx["__line"] = line;
2137
- ctx["__result"] = null;
2138
- try {
2139
- callScript.runInContext(context, { timeout: PARSE_TIMEOUT_MS });
2140
- consecutiveTimeouts = 0;
2141
- } catch (err) {
2142
- const e = err;
2143
- const timedOut = !!e && (e.code === "ERR_SCRIPT_EXECUTION_TIMEOUT" || typeof e.message === "string" && /execution timed out/i.test(e.message));
2144
- if (!timedOut) throw err;
2145
- consecutiveTimeouts += 1;
2146
- if (consecutiveTimeouts >= MAX_CONSECUTIVE_TIMEOUTS) {
2147
- disabled = true;
2148
- console.warn(
2149
- `[js-log-parser] Parser "${def.name}" (${def.id}) disabled after ${MAX_CONSECUTIVE_TIMEOUTS} consecutive timeouts`
2150
- );
2151
- }
2152
- return line;
2153
- }
2154
- const result = ctx["__result"];
2155
- if (result === null || result === void 0 || typeof result !== "object") {
2156
- return line;
2157
- }
2158
- return result;
2159
- };
2160
- }
2161
- /** Sanitize the final LogLine: truncate message, limit metadata, validate level */
2162
- sanitize(line) {
2163
- let { message, metadata, level } = line;
2164
- if (message.length > 16384) {
2165
- message = message.substring(0, 16384) + "...[truncated]";
2166
- }
2167
- metadata = metadata ?? {};
2168
- const metaKeys = Object.keys(metadata);
2169
- if (metaKeys.length > 100) {
2170
- const limited = {};
2171
- for (let i = 0; i < 100; i++) {
2172
- limited[metaKeys[i]] = metadata[metaKeys[i]];
2173
- }
2174
- metadata = limited;
2175
- }
2176
- if (!VALID_LEVELS.has(level)) {
2177
- level = "info";
2178
- }
2179
- if (message !== line.message || metadata !== line.metadata || level !== line.level) {
2180
- return { ...line, message, metadata, level };
2181
- }
2182
- return line;
2183
- }
2184
- };
2185
-
2186
- // ../../packages/shared/src/builtins.ts
2187
- var BUILTIN_VARIABLES = [
2188
- // ── Le service ───────────────────────────────────────────────────────────
2189
- { name: "service.NAME", scope: "server", descriptionKey: "serviceName" },
2190
- { name: "service.ID", scope: "server", descriptionKey: "serviceId" },
2191
- { name: "service.PORT", scope: "server", descriptionKey: "servicePort" },
2192
- { name: "service.URL", scope: "server", descriptionKey: "serviceUrl" },
2193
- { name: "service.BASE_URL", scope: "server", descriptionKey: "serviceBaseUrl" },
2194
- { name: "service.CWD", scope: "agent", descriptionKey: "serviceCwd" },
2195
- // ── Le projet et l'environnement actif ───────────────────────────────────
2196
- { name: "project.NAME", scope: "server", descriptionKey: "projectName" },
2197
- { name: "runeya.ENV_NAME", scope: "server", descriptionKey: "envName" },
2198
- // ── Le serveur Runeya ────────────────────────────────────────────────────
2199
- // `service.HOST` a toujours désigné l'adresse d'écoute du SERVEUR, pas une
2200
- // propriété du service : le nom trompait, il devient un alias.
2201
- { name: "runeya.HOST", scope: "server", descriptionKey: "runeyaHost", deprecatedAlias: "service.HOST" },
2202
- // ── La machine qui exécute ───────────────────────────────────────────────
2203
- { name: "agent.HOST_LAN", scope: "agent", descriptionKey: "agentHostLan", deprecatedAlias: "service.HOST_LAN" },
2204
- // Le NOM de l'agent est une étiquette de la configuration du serveur, pas
2205
- // une propriété de la machine : c'est le serveur qui le connaît et le résout.
2206
- { name: "agent.NAME", scope: "server", descriptionKey: "agentName" },
2207
- { name: "agent.OS", scope: "agent", descriptionKey: "agentOs" },
2208
- { name: "agent.HOME", scope: "agent", descriptionKey: "agentHome" }
2209
- ];
2210
- var BUILTIN_REFERENCE_RE = /\{\{([A-Za-z][A-Za-z0-9_.-]*)\}\}/g;
2211
- var ENVIRONMENT_NAMESPACE = "environment.";
2212
- function interpolateBuiltins(text, values) {
2213
- return text.replace(BUILTIN_REFERENCE_RE, (match, name) => {
2214
- if (name.startsWith(ENVIRONMENT_NAMESPACE)) return match;
2215
- return values[name] ?? match;
2216
- });
2217
- }
2218
- function interpolateBuiltinsInEnv(env2, values) {
2219
- const out = {};
2220
- for (const [key, value] of Object.entries(env2)) {
2221
- out[key] = interpolateBuiltins(value, values);
2222
- }
2223
- return out;
2224
- }
2225
- function withDeprecatedAliases(values) {
2226
- const out = { ...values };
2227
- for (const builtin of BUILTIN_VARIABLES) {
2228
- if (builtin.deprecatedAlias && out[builtin.name] !== void 0) {
2229
- out[builtin.deprecatedAlias] = out[builtin.name];
2230
- }
2231
- }
2232
- return out;
2233
- }
2234
- function serviceSlug(name) {
2235
- return name.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
2236
- }
2237
- function servicePortValues(ports, prefix = "service") {
2238
- const values = {};
2239
- (ports ?? []).forEach((port, i) => {
2240
- values[i === 0 ? `${prefix}.PORT` : `${prefix}.PORT_${i + 1}`] = String(port);
2241
- });
2242
- return values;
2243
- }
2244
- function isWildcardHost(host) {
2245
- const h = host.trim();
2246
- return h === "" || h === "0.0.0.0" || h === "::" || h === "[::]";
2247
- }
2248
- function isLoopbackHost(host) {
2249
- const h = host.trim();
2250
- return h === "127.0.0.1" || h === "::1" || h === "[::1]";
2251
- }
2252
- function urlHostFor(host) {
2253
- if (isWildcardHost(host)) return null;
2254
- return isLoopbackHost(host) ? "localhost" : host.trim();
2255
- }
2256
- function serviceUrlValues(service, host, prefix = "service") {
2257
- const domainByPort = new Map((service.localUrls ?? []).map((lu) => [lu.port, lu.url]));
2258
- const ports = [...service.ports ?? []];
2259
- for (const local of service.localUrls ?? []) {
2260
- if (!ports.includes(local.port)) ports.push(local.port);
2261
- }
2262
- const values = {};
2263
- ports.forEach((port, i) => {
2264
- const domain = domainByPort.get(port);
2265
- values[i === 0 ? `${prefix}.URL` : `${prefix}.URL_${i + 1}`] = domain ? `http://${domain}` : `http://${host}:${port}`;
2266
- });
2267
- return values;
2268
- }
2269
- function crossServiceValues(service, host) {
2270
- const slug = serviceSlug(service.name);
2271
- if (!slug) return {};
2272
- return {
2273
- [`services.${slug}.NAME`]: service.name,
2274
- [`services.${slug}.ID`]: service.id,
2275
- ...servicePortValues(service.ports, `services.${slug}`),
2276
- ...serviceUrlValues(service, host, `services.${slug}`),
2277
- ...service.url ? { [`services.${slug}.BASE_URL`]: service.url } : {}
2278
- };
2279
- }
2280
-
2281
- // ../../packages/shared/src/constants/intervals.ts
2282
- var AGENT_HEALTH_POLL_INTERVAL = 15e3;
2283
-
2284
- // ../../packages/shared/src/constants/buffers.ts
2285
- var LOG_BUFFER_SIZE = 5e3;
2286
-
2287
- // ../../packages/shared/src/constants/timeouts.ts
2288
- var GRACE_PERIOD = 1e4;
2289
- var AGENT_FETCH_TIMEOUT = 1e4;
2290
- var AGENT_LONG_FETCH_TIMEOUT = 6e5;
2291
- var AGENT_STOP_FETCH_TIMEOUT = GRACE_PERIOD + 15e3;
2292
- var PASSPHRASE_TIMEOUT = 3e4;
2293
- var WS_RECONNECT_MIN = 1e3;
2294
- var WS_RECONNECT_MAX = 15e3;
2295
-
2296
- // ../../packages/shared/src/constants/editors.ts
2297
- var SUPPORTED_EDITORS = [
2298
- { key: "vscode", name: "Visual Studio Code", command: "code" },
2299
- { key: "cursor", name: "Cursor", command: "cursor" },
2300
- { key: "windsurf", name: "Windsurf", command: "windsurf" },
2301
- { key: "sublime", name: "Sublime Text", command: "subl" },
2302
- { key: "atom", name: "Atom", command: "atom" },
2303
- { key: "antigravity", name: "Antigravity", command: "antigravity" },
2304
- { key: "intellij", name: "IntelliJ IDEA", command: "idea" },
2305
- { key: "android-studio", name: "Android Studio", command: "studio" },
2306
- { key: "webstorm", name: "WebStorm", command: "webstorm" },
2307
- { key: "zed", name: "Zed", command: "zed" },
2308
- { key: "neovim", name: "Neovim", command: "nvim" },
2309
- { key: "vim", name: "Vim", command: "vim" },
2310
- { key: "emacs", name: "Emacs", command: "emacs" },
2311
- { key: "fleet", name: "Fleet", command: "fleet" }
2312
- ];
2313
- var EDITOR_BY_KEY = new Map(
2314
- SUPPORTED_EDITORS.map((e) => [e.key, e])
2315
- );
2316
-
2317
- // ../../packages/shared/src/sync/json-crdt.ts
2318
- import * as Y from "yjs";
2319
- function normalize(value) {
2320
- return JSON.parse(JSON.stringify(value ?? null));
2321
- }
2322
- function isPlainObject(v) {
2323
- return typeof v === "object" && v !== null && !Array.isArray(v);
2324
- }
2325
- function toPlain(value) {
2326
- if (value instanceof Y.Map) {
2327
- const out = {};
2328
- for (const [k, v] of value.entries()) out[k] = toPlain(v);
2329
- return out;
2330
- }
2331
- if (value instanceof Y.Array) return value.toArray().map(toPlain);
2332
- return value ?? null;
2333
- }
2334
- function identityOf(value) {
2335
- if (isPlainObject(value) && typeof value["id"] === "string") return `id:${value["id"]}`;
2336
- return `v:${JSON.stringify(value)}`;
2337
- }
2338
- function identityOfY(value) {
2339
- if (value instanceof Y.Map) {
2340
- const id = value.get("id");
2341
- if (typeof id === "string") return `id:${id}`;
2342
- }
2343
- return `v:${JSON.stringify(toPlain(value))}`;
2344
- }
2345
- function toY(value) {
2346
- if (Array.isArray(value)) {
2347
- const arr = new Y.Array();
2348
- if (value.length > 0) arr.insert(0, value.map(toY));
2349
- return arr;
2350
- }
2351
- if (isPlainObject(value)) {
2352
- const map = new Y.Map();
2353
- for (const [k, v] of Object.entries(value)) map.set(k, toY(v));
2354
- return map;
2355
- }
2356
- return value;
2357
- }
2358
- function applyToMap(map, next) {
2359
- for (const key of Array.from(map.keys())) {
2360
- if (!(key in next)) map.delete(key);
2361
- }
2362
- for (const [key, value] of Object.entries(next)) {
2363
- const current = map.get(key);
2364
- if (Array.isArray(value)) {
2365
- if (!(current instanceof Y.Array)) map.set(key, toY(value));
2366
- else applyToArray(current, value);
2367
- } else if (isPlainObject(value)) {
2368
- if (!(current instanceof Y.Map)) map.set(key, toY(value));
2369
- else applyToMap(current, value);
2370
- } else if (current instanceof Y.Map || current instanceof Y.Array || current !== value) {
2371
- map.set(key, value);
2372
- }
2373
- }
2374
- }
2375
- function applyToArray(arr, next) {
2376
- const wanted = next.map(identityOf);
2377
- const wantedCount = /* @__PURE__ */ new Map();
2378
- for (const k of wanted) wantedCount.set(k, (wantedCount.get(k) ?? 0) + 1);
2379
- const seen2 = /* @__PURE__ */ new Map();
2380
- for (let i = arr.length - 1; i >= 0; i--) {
2381
- const key = identityOfY(arr.get(i));
2382
- const used = seen2.get(key) ?? 0;
2383
- if (used >= (wantedCount.get(key) ?? 0)) arr.delete(i, 1);
2384
- else seen2.set(key, used + 1);
2385
- }
2386
- for (let j = 0; j < next.length; j++) {
2387
- const key = wanted[j];
2388
- if (j < arr.length && identityOfY(arr.get(j)) === key) {
2389
- const current = arr.get(j);
2390
- const value = next[j];
2391
- if (current instanceof Y.Map && isPlainObject(value)) applyToMap(current, value);
2392
- else if (current instanceof Y.Array && Array.isArray(value)) applyToArray(current, value);
2393
- continue;
2394
- }
2395
- let found = -1;
2396
- for (let k = j + 1; k < arr.length; k++) {
2397
- if (identityOfY(arr.get(k)) === key) {
2398
- found = k;
2399
- break;
2400
- }
2401
- }
2402
- if (found !== -1) {
2403
- const moved = toPlain(arr.get(found));
2404
- arr.delete(found, 1);
2405
- arr.insert(j, [toY(moved)]);
2406
- } else {
2407
- arr.insert(j, [toY(next[j])]);
2408
- }
2409
- }
2410
- }
2411
- function getCollection(doc, name) {
2412
- return doc.getMap(name);
2413
- }
2414
- function readEntity(collection, id) {
2415
- const entity = collection.get(id);
2416
- if (!(entity instanceof Y.Map)) return null;
2417
- const plain = toPlain(entity);
2418
- return isPlainObject(plain) ? plain : null;
2419
- }
2420
- function writeEntity(collection, id, entity) {
2421
- const next = normalize(entity);
2422
- if (!isPlainObject(next)) return;
2423
- const current = collection.get(id);
2424
- if (!(current instanceof Y.Map)) {
2425
- collection.set(id, toY(next));
2426
- return;
2427
- }
2428
- applyToMap(current, next);
2429
- }
2430
-
2431
621
  // ../server/src/services/environment-store.ts
2432
622
  var FILENAME2 = "environments.json";
2433
623
  var EnvironmentStore = class {
@@ -2505,7 +695,7 @@ var EnvironmentStore = class {
2505
695
  return out;
2506
696
  }
2507
697
  getFilePath(root) {
2508
- return join3(root, FILENAME2);
698
+ return join2(root, FILENAME2);
2509
699
  }
2510
700
  /**
2511
701
  * The vault an environment must be written to: its project's.
@@ -2646,7 +836,7 @@ var EnvironmentStore = class {
2646
836
  }
2647
837
  for (const root of await allVaultRoots()) {
2648
838
  try {
2649
- const raw = await readFile3(this.getFilePath(root), "utf-8");
839
+ const raw = await readFile2(this.getFilePath(root), "utf-8");
2650
840
  await rememberFile(this.getFilePath(root));
2651
841
  const data = JSON.parse(raw);
2652
842
  const clash = data.find((e) => this.environments.has(e.id) && this.roots.get(e.id) !== root);
@@ -2714,9 +904,9 @@ var EnvironmentStore = class {
2714
904
  });
2715
905
  continue;
2716
906
  }
2717
- await mkdir3(root, { recursive: true });
907
+ await mkdir2(root, { recursive: true });
2718
908
  const tmpPath = filePath + ".tmp";
2719
- await writeFile3(tmpPath, JSON.stringify(environments, null, 2), "utf-8");
909
+ await writeFile2(tmpPath, JSON.stringify(environments, null, 2), "utf-8");
2720
910
  await rename2(tmpPath, filePath);
2721
911
  await chmod2(filePath, 384);
2722
912
  await rememberFile(filePath);
@@ -3097,7 +1287,7 @@ var ServiceStore = class {
3097
1287
  this.notify();
3098
1288
  }
3099
1289
  getFilePath(root) {
3100
- return join4(root, FILENAME3);
1290
+ return join3(root, FILENAME3);
3101
1291
  }
3102
1292
  /**
3103
1293
  * The vault a service must be written to: the one of the project owning it.
@@ -3126,7 +1316,7 @@ var ServiceStore = class {
3126
1316
  await ensureProjectsLoaded();
3127
1317
  for (const root of await allVaultRoots()) {
3128
1318
  try {
3129
- const raw = await readFile4(this.getFilePath(root), "utf-8");
1319
+ const raw = await readFile3(this.getFilePath(root), "utf-8");
3130
1320
  const data = JSON.parse(raw);
3131
1321
  const clash = data.find((s) => this.services.has(s.id) && this.roots.get(s.id) !== root);
3132
1322
  if (clash) {
@@ -3180,9 +1370,9 @@ var ServiceStore = class {
3180
1370
  });
3181
1371
  continue;
3182
1372
  }
3183
- await mkdir4(root, { recursive: true });
1373
+ await mkdir3(root, { recursive: true });
3184
1374
  const tmpPath = filePath + ".tmp";
3185
- await writeFile4(tmpPath, JSON.stringify(services, null, 2), "utf-8");
1375
+ await writeFile3(tmpPath, JSON.stringify(services, null, 2), "utf-8");
3186
1376
  await rename3(tmpPath, filePath);
3187
1377
  await chmod3(filePath, 384);
3188
1378
  }
@@ -3392,18 +1582,18 @@ var serviceStore = new ServiceStore();
3392
1582
  import { spawn as spawn2 } from "child_process";
3393
1583
  import { createInterface } from "readline";
3394
1584
  import { watch } from "fs";
3395
- import { dirname as dirname2, join as join6 } from "path";
1585
+ import { dirname as dirname2, join as join5 } from "path";
3396
1586
  import { fileURLToPath } from "url";
3397
1587
 
3398
1588
  // ../server/src/services/instance-registry.ts
3399
- import { mkdir as mkdir5, readdir as readdir2, readFile as readFile5, writeFile as writeFile5, rm as rm3 } from "fs/promises";
1589
+ import { mkdir as mkdir4, readdir, readFile as readFile4, writeFile as writeFile4, rm as rm3 } from "fs/promises";
3400
1590
  import { readFileSync } from "fs";
3401
1591
  import dotenv from "dotenv";
3402
1592
  import { spawn } from "child_process";
3403
- import { join as join5 } from "path";
3404
- import { z as z23 } from "zod";
3405
- var InstanceFileSchema = z23.object({
3406
- pid: z23.number().int().positive(),
1593
+ import { join as join4 } from "path";
1594
+ import { z } from "zod";
1595
+ var InstanceFileSchema = z.object({
1596
+ pid: z.number().int().positive(),
3407
1597
  /**
3408
1598
  * The agent this server spawned, when it has one.
3409
1599
  *
@@ -3411,14 +1601,14 @@ var InstanceFileSchema = z23.object({
3411
1601
  * it, and because the agent may not be up yet — or at all, when the
3412
1602
  * encryption key is missing. Absent means « unknown », never « none ».
3413
1603
  */
3414
- agentPid: z23.number().int().positive().optional(),
3415
- port: z23.number().int().min(1).max(65535),
3416
- agentPort: z23.number().int().min(1).max(65535),
3417
- cwd: z23.string().max(4096),
3418
- dataDir: z23.string().max(4096),
3419
- version: z23.string().max(64),
3420
- fromDesktop: z23.boolean(),
3421
- startedAt: z23.number().int().nonnegative(),
1604
+ agentPid: z.number().int().positive().optional(),
1605
+ port: z.number().int().min(1).max(65535),
1606
+ agentPort: z.number().int().min(1).max(65535),
1607
+ cwd: z.string().max(4096),
1608
+ dataDir: z.string().max(4096),
1609
+ version: z.string().max(64),
1610
+ fromDesktop: z.boolean(),
1611
+ startedAt: z.number().int().nonnegative(),
3422
1612
  /**
3423
1613
  * De quoi relancer ce lancement à l'identique : l'exécutable, ses arguments,
3424
1614
  * et les `RUNEYA_*` de son environnement. Le `cwd` ci-dessus complète le
@@ -3428,9 +1618,9 @@ var InstanceFileSchema = z23.object({
3428
1618
  * écrit pas. Elle reste listée et arrêtable, simplement pas redémarrable —
3429
1619
  * un redémarrage approximatif serait pire qu'un bouton absent.
3430
1620
  */
3431
- execPath: z23.string().max(4096).optional(),
3432
- argv: z23.array(z23.string().max(4096)).max(128).optional(),
3433
- env: z23.record(z23.string().max(64), z23.string().max(4096)).optional(),
1621
+ execPath: z.string().max(4096).optional(),
1622
+ argv: z.array(z.string().max(4096)).max(128).optional(),
1623
+ env: z.record(z.string().max(64), z.string().max(4096)).optional(),
3434
1624
  /**
3435
1625
  * L'instance tient un secret (`RUNEYA_ENCRYPTION_KEY`,
3436
1626
  * `RUNEYA_MASTER_PASSWORD`) que le relancement ne retrouverait pas. Le
@@ -3441,13 +1631,13 @@ var InstanceFileSchema = z23.object({
3441
1631
  * Un secret posé dans le `.env` de la pile ne compte pas : `dotenv` le relit
3442
1632
  * au démarrage depuis le même répertoire. Voir `secretsAreReproducible()`.
3443
1633
  */
3444
- needsSecretEnv: z23.boolean().optional()
1634
+ needsSecretEnv: z.boolean().optional()
3445
1635
  });
3446
1636
  function registryDir() {
3447
- return join5(machineRoot(), "instances");
1637
+ return join4(machineRoot(), "instances");
3448
1638
  }
3449
1639
  function fileFor(pid) {
3450
- return join5(registryDir(), `${pid}.json`);
1640
+ return join4(registryDir(), `${pid}.json`);
3451
1641
  }
3452
1642
  var published = null;
3453
1643
  var SECRET_ENV_KEYS = ["RUNEYA_ENCRYPTION_KEY", "RUNEYA_MASTER_PASSWORD"];
@@ -3467,7 +1657,7 @@ function secretsAreReproducible() {
3467
1657
  if (present.length === 0) return true;
3468
1658
  let fromFile;
3469
1659
  try {
3470
- fromFile = dotenv.parse(readFileSync(join5(process.cwd(), ".env")));
1660
+ fromFile = dotenv.parse(readFileSync(join4(process.cwd(), ".env")));
3471
1661
  } catch {
3472
1662
  return false;
3473
1663
  }
@@ -3493,9 +1683,9 @@ function selfRecord() {
3493
1683
  }
3494
1684
  async function registerInstance() {
3495
1685
  try {
3496
- await mkdir5(registryDir(), { recursive: true });
1686
+ await mkdir4(registryDir(), { recursive: true });
3497
1687
  published = selfRecord();
3498
- await writeFile5(fileFor(process.pid), JSON.stringify(published, null, 2));
1688
+ await writeFile4(fileFor(process.pid), JSON.stringify(published, null, 2));
3499
1689
  } catch (err) {
3500
1690
  console.log("[instances] Could not register this instance:", err.message);
3501
1691
  }
@@ -3508,7 +1698,7 @@ async function setInstanceAgentPid(agentPid) {
3508
1698
  if (!published) return;
3509
1699
  published = { ...published, agentPid: agentPid ?? void 0 };
3510
1700
  try {
3511
- await writeFile5(fileFor(process.pid), JSON.stringify(published, null, 2));
1701
+ await writeFile4(fileFor(process.pid), JSON.stringify(published, null, 2));
3512
1702
  } catch {
3513
1703
  }
3514
1704
  }
@@ -3535,7 +1725,7 @@ async function probe(port) {
3535
1725
  }
3536
1726
  async function describeInstance(pid) {
3537
1727
  try {
3538
- const parsed = InstanceFileSchema.safeParse(JSON.parse(await readFile5(fileFor(pid), "utf8")));
1728
+ const parsed = InstanceFileSchema.safeParse(JSON.parse(await readFile4(fileFor(pid), "utf8")));
3539
1729
  if (!parsed.success) return null;
3540
1730
  return { pid, port: parsed.data.port, cwd: parsed.data.cwd };
3541
1731
  } catch {
@@ -3545,16 +1735,16 @@ async function describeInstance(pid) {
3545
1735
  async function listInstances() {
3546
1736
  let files;
3547
1737
  try {
3548
- files = await readdir2(registryDir());
1738
+ files = await readdir(registryDir());
3549
1739
  } catch {
3550
1740
  return [];
3551
1741
  }
3552
1742
  const found = await Promise.all(
3553
1743
  files.filter((f) => f.endsWith(".json")).map(async (name) => {
3554
- const path = join5(registryDir(), name);
1744
+ const path = join4(registryDir(), name);
3555
1745
  let record;
3556
1746
  try {
3557
- const parsed = InstanceFileSchema.safeParse(JSON.parse(await readFile5(path, "utf8")));
1747
+ const parsed = InstanceFileSchema.safeParse(JSON.parse(await readFile4(path, "utf8")));
3558
1748
  if (!parsed.success) {
3559
1749
  await rm3(path, { force: true }).catch(() => {
3560
1750
  });
@@ -3869,7 +2059,7 @@ var AgentSpawner = class {
3869
2059
  }
3870
2060
  console.log(`[agent-spawner] Spawning local agent on ${agentUrl}...`);
3871
2061
  const isDev = process.env.NODE_ENV === "development";
3872
- this.agentDistPath = env.AGENT_BINARY_PATH || join6(dirname2(fileURLToPath(import.meta.url)), "..", "..", "agent", "dist", "index.js");
2062
+ this.agentDistPath = env.AGENT_BINARY_PATH || join5(dirname2(fileURLToPath(import.meta.url)), "..", "..", "agent", "dist", "index.js");
3873
2063
  this.agentProcess = spawn2("node", [this.agentDistPath], {
3874
2064
  env: agentEnv,
3875
2065
  stdio: ["ignore", "pipe", "pipe"],
@@ -3979,7 +2169,7 @@ var AgentSpawner = class {
3979
2169
  this.fileWatcher.close();
3980
2170
  }
3981
2171
  console.log("[agent-spawner] \u{1F50D} Watching agent dist for changes (hot reload enabled)");
3982
- const distDir = join6(this.agentDistPath, "..");
2172
+ const distDir = join5(this.agentDistPath, "..");
3983
2173
  this.fileWatcher = watch(distDir, { persistent: false }, (eventType, filename) => {
3984
2174
  if ((eventType === "change" || eventType === "rename") && filename === "index.js" && !this.isRestarting) {
3985
2175
  this.isRestarting = true;
@@ -4293,16 +2483,16 @@ var AgentWSBridge = class extends EventEmitter {
4293
2483
  };
4294
2484
 
4295
2485
  // ../server/src/services/agent-manager.ts
4296
- var HealthMessageSchema = z24.object({
4297
- status: z24.string(),
4298
- uptime: z24.number(),
4299
- runnersAvailable: z24.array(z24.enum(["native", "docker"])),
4300
- processCount: z24.number(),
4301
- runningCount: z24.number(),
4302
- lanIp: z24.string().optional(),
4303
- os: z24.string().max(64).optional(),
4304
- home: z24.string().max(4096).optional(),
4305
- cwd: z24.string().max(4096).optional()
2486
+ var HealthMessageSchema = z2.object({
2487
+ status: z2.string(),
2488
+ uptime: z2.number(),
2489
+ runnersAvailable: z2.array(z2.enum(["native", "docker"])),
2490
+ processCount: z2.number(),
2491
+ runningCount: z2.number(),
2492
+ lanIp: z2.string().optional(),
2493
+ os: z2.string().max(64).optional(),
2494
+ home: z2.string().max(4096).optional(),
2495
+ cwd: z2.string().max(4096).optional()
4306
2496
  });
4307
2497
  var MIN_RECONNECT_DELAY = WS_RECONNECT_MIN;
4308
2498
  var MAX_RECONNECT_DELAY = WS_RECONNECT_MAX;
@@ -4764,7 +2954,6 @@ var AgentManager = class extends EventEmitter2 {
4764
2954
  var agentManager = new AgentManager();
4765
2955
 
4766
2956
  export {
4767
- env,
4768
2957
  isCiMode,
4769
2958
  loadFromEnv,
4770
2959
  setPendingLegacyKey,
@@ -4780,72 +2969,6 @@ export {
4780
2969
  clearVaultLock,
4781
2970
  ensureEncryptionKey,
4782
2971
  setEncryptionKey,
4783
- machineRoot,
4784
- localVaultRoot,
4785
- orgVaultRoot,
4786
- projectVaultRoot,
4787
- orgIdOfRoot,
4788
- vaultIdOfRoot,
4789
- vaultFor,
4790
- stampOrgCloud,
4791
- rememberOrgName,
4792
- readOrgNames,
4793
- rememberOrgLogo,
4794
- forgetOrgLogo,
4795
- readOrgLogos,
4796
- readOrgClouds,
4797
- listOrgVaults,
4798
- listCloudVaults,
4799
- allVaultRoots,
4800
- machineFilePath,
4801
- keyedFilePath,
4802
- legacyMachineFilePath,
4803
- ensureLocalVault,
4804
- keyRoot,
4805
- legacyVaultRoot,
4806
- ProjectSchema,
4807
- ScenarioGroupSchema,
4808
- ScenarioNodeSchema,
4809
- ScenarioSchema,
4810
- AIProviderSchema,
4811
- JSLogParserSchema,
4812
- NotificationPreferencesSchema,
4813
- SettingsSchema,
4814
- TraefikConfigSchema,
4815
- SettingsPrivateSchema,
4816
- SchemaVersionSchema,
4817
- LogSourceConfigSchema,
4818
- HealthCheckSchema,
4819
- DockerConfigSchema,
4820
- RestartStrategySchema,
4821
- ServiceShortcutSchema,
4822
- ServiceCommandSchema,
4823
- VariableSchema,
4824
- CreateEnvironmentSchema,
4825
- UpdateEnvironmentSchema,
4826
- VariableOverrideSchema,
4827
- ApiKeyScopeSchema,
4828
- ApiKeysFileSchema,
4829
- ChangelogSurfaceSchema,
4830
- ChangelogReleaseSchema,
4831
- ChangelogIndexItemSchema,
4832
- nativeParsers,
4833
- JSLogParser,
4834
- interpolateBuiltinsInEnv,
4835
- withDeprecatedAliases,
4836
- serviceSlug,
4837
- servicePortValues,
4838
- urlHostFor,
4839
- serviceUrlValues,
4840
- crossServiceValues,
4841
- LOG_BUFFER_SIZE,
4842
- AGENT_LONG_FETCH_TIMEOUT,
4843
- AGENT_STOP_FETCH_TIMEOUT,
4844
- SUPPORTED_EDITORS,
4845
- EDITOR_BY_KEY,
4846
- getCollection,
4847
- readEntity,
4848
- writeEntity,
4849
2972
  encryptValueWith,
4850
2973
  decryptValueWith,
4851
2974
  encryptValue,
@@ -4883,4 +3006,4 @@ export {
4883
3006
  traefikManager,
4884
3007
  agentManager
4885
3008
  };
4886
- //# sourceMappingURL=chunk-4PQXBTV6.js.map
3009
+ //# sourceMappingURL=chunk-HX3ZIWHM.js.map