@runeya/runeya 2.0.93 → 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 (267) hide show
  1. package/agent/index.js +213 -161
  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-6Y24763Y.js → chunk-HX3ZIWHM.js} +83 -1926
  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-DiMqQfDk.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-Bi1br5gY.js → EditorIcon-CzgSjXLk.js} +2 -2
  40. package/web/assets/EnvironmentForm-DmdDIJHv.js +108 -0
  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-DgnpYxXh.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-BKcxRTQg.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-CFCpVybl.js → autocomplete-B-t_B26t.js} +3 -3
  71. package/web/assets/{basic-shape-diamond.svg-1nuR3NBd.js → basic-shape-diamond.svg-BFWFQIZl.js} +1 -1
  72. package/web/assets/{basic-shape-hexagon.svg-Be-pZrVb.js → basic-shape-hexagon.svg-CXsvZPky.js} +1 -1
  73. package/web/assets/{basic-shape-primary-circle-ellipse-round.svg-9-zHtg8B.js → basic-shape-primary-circle-ellipse-round.svg-BVg6oDS7.js} +1 -1
  74. package/web/assets/{basic-shape-primary-square-rectangle.svg-CRTdnGnv.js → basic-shape-primary-square-rectangle.svg-jiLWQSQV.js} +1 -1
  75. package/web/assets/{basic-shape-shield.svg-D9JPqU4l.js → basic-shape-shield.svg-CEybfnew.js} +1 -1
  76. package/web/assets/{browser-BdPlaU7e.js → browser-BfO6Jws3.js} +1 -1
  77. package/web/assets/{browser-B6dstq4l.js → browser-C7Qh0u0N.js} +1 -1
  78. package/web/assets/card-CWgnvlKH.js +32 -0
  79. package/web/assets/{checkbox-C_jx73WS.js → checkbox-CKzrAJQv.js} +3 -3
  80. package/web/assets/{chip-CQdqiw0W.js → chip-Bu5HllmO.js} +2 -2
  81. package/web/assets/{client-B_gN8XJ7.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-CGh6MdTp.js → computer-device-desktop-monitor.svg-DO-9EDqA.js} +1 -1
  86. package/web/assets/{computer-device-desktop.svg-CSnagCeX.js → computer-device-desktop.svg-U_EIk7jo.js} +1 -1
  87. package/web/assets/{computer-device-laptop.svg-BI_ZVURQ.js → computer-device-laptop.svg-nvbz6sjk.js} +1 -1
  88. package/web/assets/{computer-device-mobile-phone-android-samsung-back.svg-DM3ubsFX.js → computer-device-mobile-phone-android-samsung-back.svg-Cs34LunN.js} +1 -1
  89. package/web/assets/{computer-device-mobile-phone-android-samsung.svg-CzDW3wBE.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-B41GuLoA.js → computer-device-mobile-phone-iphone-x-back.svg-Du0pDh9L.js} +1 -1
  91. package/web/assets/{computer-device-mobile-phone-iphone-x.svg-Cd1cIH5V.js → computer-device-mobile-phone-iphone-x.svg-CUgXFf2r.js} +1 -1
  92. package/web/assets/{computer-device-mobile-tablet-touch.svg-rLuvpYQb.js → computer-device-mobile-tablet-touch.svg-CKdx-iUf.js} +1 -1
  93. package/web/assets/{computer-device-mobile-tablet.svg-DjBMAEhJ.js → computer-device-mobile-tablet.svg-BTvPzs5h.js} +1 -1
  94. package/web/assets/{computer-device-network-ethernet-cat6.svg-BeYjyXJh.js → computer-device-network-ethernet-cat6.svg-Cway8Bfw.js} +1 -1
  95. package/web/assets/{computer-device-network-lan-www.svg-DIR2TMun.js → computer-device-network-lan-www.svg-iuTZVSKE.js} +1 -1
  96. package/web/assets/{computer-device-network-wifi-connection.svg-DhI5VT5g.js → computer-device-network-wifi-connection.svg-DEemVGZq.js} +1 -1
  97. package/web/assets/{computer-device-network-wifi-router.svg-BO0V5pTE.js → computer-device-network-wifi-router.svg-BH2ASeRD.js} +1 -1
  98. package/web/assets/{cssMode-CdzA9M1t.js → cssMode-BHBdzmoS.js} +1 -1
  99. package/web/assets/{divider-Cijz8TDb.js → divider-kwmULX2U.js} +2 -2
  100. package/web/assets/{docx-preview-B8bBf__c.js → docx-preview-CxXKUxi7.js} +1 -1
  101. package/web/assets/{ecology-science-erlenmeyer-flask.svg-BuQW5h4a.js → ecology-science-erlenmeyer-flask.svg-9yLzulSu.js} +1 -1
  102. package/web/assets/{fieldset-DnZ-YI4V.js → fieldset-DE0sJS29.js} +2 -2
  103. package/web/assets/{freemarker2-Bp9032QT.js → freemarker2-CpcoAmNk.js} +1 -1
  104. package/web/assets/{handlebars-CdVx92lU.js → handlebars-D6DR-MoZ.js} +1 -1
  105. package/web/assets/{html-CkCZL9gx.js → html-Dx3QwrZR.js} +1 -1
  106. package/web/assets/{htmlMode-CW62-ie1.js → htmlMode-KSJ_gFzK.js} +1 -1
  107. package/web/assets/{image-flash-lightning.svg-DeCuJWFT.js → image-flash-lightning.svg-O9m-H64P.js} +1 -1
  108. package/web/assets/{image-picture-flower.svg-2ZzZbPy5.js → image-picture-flower.svg--rWVVuqu.js} +1 -1
  109. package/web/assets/index-B4UWj2Kz.css +1 -0
  110. package/web/assets/{index-DXGQcaBP.js → index-pLefgbhx.js} +284 -284
  111. package/web/assets/{interface-alert-exclamation-diamond.svg-D9th7CAp.js → interface-alert-exclamation-diamond.svg-CVeV0ecY.js} +1 -1
  112. package/web/assets/{interface-alert-exclamation-triangle-warning.svg-Dq9CWWQ3.js → interface-alert-exclamation-triangle-warning.svg-MIboYRzH.js} +1 -1
  113. package/web/assets/{interface-alert-information-circle.svg-FaG159xA.js → interface-alert-information-circle.svg-BlkHMxfH.js} +1 -1
  114. package/web/assets/{interface-award-crown.svg-B_-NjgUX.js → interface-award-crown.svg-C_Z3sLuP.js} +1 -1
  115. package/web/assets/{interface-bookmark.svg--yRnhMMQ.js → interface-bookmark-tag.svg-ClOZOhfV.js} +1 -1
  116. package/web/assets/{interface-bookmark-tag.svg-CKjw2WEc.js → interface-bookmark.svg-CVpTNe3u.js} +1 -1
  117. package/web/assets/{interface-calendar-date-one.svg-BCrvSyS9.js → interface-calendar-date-one.svg-BvG92AQi.js} +1 -1
  118. package/web/assets/{interface-content-book-open-pages.svg-BGIlAwyt.js → interface-content-book-open-pages.svg-aXXXkj7d.js} +1 -1
  119. package/web/assets/{interface-content-book-page.svg-DeLfK2OR.js → interface-content-book-page.svg-BE0nQJw_.js} +1 -1
  120. package/web/assets/{interface-content-file.svg-DUdYkC8Y.js → interface-content-file.svg-DYonyE7J.js} +1 -1
  121. package/web/assets/{interface-content-folder.svg-Ccx-IYD-.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-DIR-oOPG.js → interface-copy-clipboard.svg-sAixmHqz.js} +1 -1
  124. package/web/assets/{interface-edit-attachment.svg-B9CSuzCn.js → interface-edit-attachment.svg-DsSzCN6U.js} +1 -1
  125. package/web/assets/{interface-edit-binocular.svg-6WTqf985.js → interface-edit-binocular.svg-Bheco9Gv.js} +1 -1
  126. package/web/assets/{interface-edit-magic-wand.svg-BiB-GwoX.js → interface-edit-magic-wand.svg-C73TY2iI.js} +1 -1
  127. package/web/assets/{interface-edit-tool-paint-roller.svg-Dh0uneh4.js → interface-edit-tool-paint-roller.svg-D2OSqY3g.js} +1 -1
  128. package/web/assets/{interface-edit-tool-pencil.svg-C9HQOHce.js → interface-edit-tool-pencil.svg-CdY316cw.js} +1 -1
  129. package/web/assets/{interface-favorite-award.svg-Cj_1Qy9M.js → interface-favorite-award.svg-DfA-EhHI.js} +1 -1
  130. package/web/assets/{interface-favorite-flag.svg-BniwQaep.js → interface-favorite-flag.svg-BnmSaveE.js} +1 -1
  131. package/web/assets/{interface-favorite-heart.svg-CYJO0Ggb.js → interface-favorite-heart.svg-28i7lMzG.js} +1 -1
  132. package/web/assets/{interface-favorite-star.svg-CeFb37gO.js → interface-favorite-star.svg-u8xOEB4S.js} +1 -1
  133. package/web/assets/{interface-favorite-stars-sparkles.svg-CGeIzi4_.js → interface-favorite-stars-sparkles.svg-D5UHf8ar.js} +1 -1
  134. package/web/assets/{interface-hierarchy-flowchart.svg-Bd0q_y82.js → interface-hierarchy-flowchart.svg-BmjWTh4K.js} +1 -1
  135. package/web/assets/{interface-home-house.svg-BqSaaLzz.js → interface-home-house.svg-DJ5Ae65N.js} +1 -1
  136. package/web/assets/{interface-hyperlink.svg-DTtVOw8L.js → interface-hyperlink.svg-HdHKY_g6.js} +1 -1
  137. package/web/assets/{interface-lighting-brightness.svg-CVNVwF9w.js → interface-lighting-brightness.svg-BDELfqMb.js} +1 -1
  138. package/web/assets/{interface-lock-closed.svg-CKiXr8tU.js → interface-lock-closed.svg-BcDwDHkS.js} +1 -1
  139. package/web/assets/{interface-lock-open-unlock.svg-DU7sOeAE.js → interface-lock-open-unlock.svg-DNESCRC1.js} +1 -1
  140. package/web/assets/{interface-login-key.svg-tuWEt_tn.js → interface-login-key.svg-BOEot3yk.js} +1 -1
  141. package/web/assets/{interface-search.svg-CMDkllvr.js → interface-search.svg-CFsy7ant.js} +1 -1
  142. package/web/assets/{interface-setting-cog.svg-BRM5rRrt.js → interface-setting-cog.svg-B7Zk0iyr.js} +1 -1
  143. package/web/assets/{interface-share-megaphone-bullhorn.svg-BgC_SP2r.js → interface-share-megaphone-bullhorn.svg-DvG0IjMM.js} +1 -1
  144. package/web/assets/{interface-share-rocket.svg-C-XkIKh-.js → interface-share-rocket.svg-gvaeTB8G.js} +1 -1
  145. package/web/assets/{interface-share-satellite.svg-BKE0N18S.js → interface-share-satellite.svg-B5pXJ0kU.js} +1 -1
  146. package/web/assets/{interface-share-space-ship.svg-B8QuVt2r.js → interface-share-space-ship.svg-B0k0J-VQ.js} +1 -1
  147. package/web/assets/{interface-share.svg-bp3wJyGc.js → interface-share.svg-ZDsCvjRe.js} +1 -1
  148. package/web/assets/{interface-signal-square.svg-D8XH70Ue.js → interface-signal-square.svg-DBkJ1ire.js} +1 -1
  149. package/web/assets/{interface-time-clock-circle.svg-2DN-SbMe.js → interface-time-clock-circle.svg-BheUirew.js} +1 -1
  150. package/web/assets/{interface-time-hour-glass.svg-l0_r1j5d.js → interface-time-hour-glass.svg-iORrebF8.js} +1 -1
  151. package/web/assets/{interface-users-multiple.svg-RRlj9uIH.js → interface-users-multiple.svg-DMqedSUQ.js} +1 -1
  152. package/web/assets/{interface-weather-moon.svg-BmdUGPZe.js → interface-weather-moon.svg-DyPBHRw4.js} +1 -1
  153. package/web/assets/{javascript-edU55dwl.js → javascript-B1Y6a5s6.js} +1 -1
  154. package/web/assets/{jsonMode-CdE3cdJ3.js → jsonMode-Vj2pUgcF.js} +2 -2
  155. package/web/assets/{liquid-DCimUdoJ.js → liquid-lb0ImGEW.js} +1 -1
  156. package/web/assets/{lspLanguageFeatures-BKbLLFFb.js → lspLanguageFeatures-sh8ggL5N.js} +3 -3
  157. package/web/assets/{mail-chat-bubble-square.svg-VF1duUdO.js → mail-chat-bubble-square.svg-D_Lx6uBc.js} +1 -1
  158. package/web/assets/{mail-send-email-paper-airplane.svg-CdSpwALk.js → mail-send-email-paper-airplane.svg-B6FGKBZu.js} +1 -1
  159. package/web/assets/{mail-send-envelope.svg-DZVjejiO.js → mail-send-envelope.svg-Dtm4h_xw.js} +1 -1
  160. package/web/assets/{mdx-Hv_NSA7I.js → mdx-BbFPcqiD.js} +1 -1
  161. package/web/assets/{minus-CQh_GdvM.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-CWHgfD-x.js → money-cashier-receipt.svg-VpEb8Ewv.js} +1 -1
  165. package/web/assets/{money-currency-dollar-pay.svg-XPcb5aF0.js → money-currency-dollar-pay.svg-vo8FP9z4.js} +1 -1
  166. package/web/assets/{money-graph-arrow-increase.svg-DhPujH9x.js → money-graph-arrow-increase.svg-CNcLQGOf.js} +1 -1
  167. package/web/assets/{money-graph-bar-chart-increase.svg-BPOlqEDC.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-DZNsVAVa.js → nature-ecology-leaf.svg-0y4pBUlD.js} +1 -1
  170. package/web/assets/{password-DlR3LzLg.js → password-TyT4zuky.js} +4 -4
  171. package/web/assets/{phone-telephone.svg-B7vr6N8Z.js → phone-telephone.svg-BdWhV2vz.js} +1 -1
  172. package/web/assets/{plus-BDDTopKC.js → plus-4Z2iFfO2.js} +6 -6
  173. package/web/assets/process.store-DsGpeQnV.js +1 -0
  174. package/web/assets/{programming-bug.svg-DzlGVlKX.js → programming-bug.svg-DXDJVNeQ.js} +1 -1
  175. package/web/assets/{programming-cloud.svg-QHMLI7Md.js → programming-cloud.svg-qWtq6fXG.js} +1 -1
  176. package/web/assets/{programming-computer-database-server.svg-CjsFgYWn.js → programming-computer-database-server.svg-DnlJHfH5.js} +1 -1
  177. package/web/assets/{programming-computer-database.svg-vah-tira.js → programming-computer-database.svg-Bl73TDXc.js} +1 -1
  178. package/web/assets/{programming-module-four-layout.svg-Cpk_lyys.js → programming-module-four-layout.svg-CGkj0OdH.js} +1 -1
  179. package/web/assets/{programming-module-three.svg-DPfLaBLh.js → programming-module-three.svg-Bsk_vaHc.js} +1 -1
  180. package/web/assets/{programming-module.svg-X3KTc78b.js → programming-module.svg-D0Yng9wS.js} +1 -1
  181. package/web/assets/{programming-script-code.svg-Btq5sYVs.js → programming-script-code.svg-DTHMCNnF.js} +1 -1
  182. package/web/assets/{python-7W62NPSS.js → python-HImlMuYG.js} +1 -1
  183. package/web/assets/{razor-B-cp1S_J.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-DvVMtpRN.js → settings.store-CZ9jrl3S.js} +1 -1
  187. package/web/assets/{shopping-cart.svg-CrAdOGHj.js → shopping-cart.svg-Cx50mrFm.js} +1 -1
  188. package/web/assets/{shopping-gift-present.svg-D6lzCq46.js → shopping-gift-present.svg-DGOO6qNg.js} +1 -1
  189. package/web/assets/{shopping-shipping-box-parcel-package.svg-CvE0Deq6.js → shopping-shipping-box-parcel-package.svg-C96i4g3q.js} +1 -1
  190. package/web/assets/src-CGoYw9sv.css +1 -0
  191. package/web/assets/src-DRjytMUo.js +1 -0
  192. package/web/assets/{src-KOvSDAsA.js → src-DzMKqnGu.js} +13 -13
  193. package/web/assets/{tabpanel-DnsLaWEk.js → tabpanel-BW8I76pY.js} +3 -3
  194. package/web/assets/{tag-new-circle.svg-K7X6DVeY.js → tag-new-circle.svg-CV5DN0Db.js} +1 -1
  195. package/web/assets/{toggleswitch-BIl5_ynN.js → toggleswitch-D4Evlg2b.js} +2 -2
  196. package/web/assets/{travel-map-earth-globe.svg-CGHyssIY.js → travel-map-earth-globe.svg-CWvuO_Hb.js} +1 -1
  197. package/web/assets/trpc-BbC62Ymt.js +1 -0
  198. package/web/assets/{tsMode-Ch-xMRFe.js → tsMode-BqKPHyIc.js} +6 -6
  199. package/web/assets/{typescript-DaR3W1ZS.js → typescript-Bme6ns4u.js} +1 -1
  200. package/web/assets/useAiChatDrawer-BG8t5Thc.js +1 -0
  201. package/web/assets/{useCloudOrg-CZ_ZOAVy.css → useCloudOrg-CkiFdVCe.css} +1 -1
  202. package/web/assets/useCloudOrg-D2LTbk-G.js +572 -0
  203. package/web/assets/useProjectCatalog-nlAZuu5X.js +1 -0
  204. package/web/assets/{xml-DGHPJrA4.js → xml-zsImRVNc.js} +1 -1
  205. package/web/assets/{yaml-Bt6S3avV.js → yaml-VubzWJpP.js} +1 -1
  206. package/web/index.html +2 -2
  207. package/agent-manager-WEFGEFRT.js +0 -7
  208. package/chunk-6Y24763Y.js.map +0 -1
  209. package/src-QDQ5AT4C.js +0 -18369
  210. package/src-QDQ5AT4C.js.map +0 -1
  211. package/web/assets/AgentScalarChatInterface.vue-BlRhaFfk.js +0 -13
  212. package/web/assets/AgentTerminalPage-Bgz6cN1-.js +0 -1
  213. package/web/assets/AiChatPage-B2ZLntQV.js +0 -1
  214. package/web/assets/AppLayout-CwaLgkBP.js +0 -1
  215. package/web/assets/AuditPage-qw3Fsus7.js +0 -1
  216. package/web/assets/CloudAccountPage-BLOaK1nf.js +0 -1
  217. package/web/assets/CloudAccountPage-DTs4O-ua.js +0 -1
  218. package/web/assets/CloudMessagingPage-Cz1EQr91.js +0 -2
  219. package/web/assets/DashboardPage-B5HHqw9m.js +0 -1
  220. package/web/assets/DirectoryPickerDialog-DjpBVTYW.js +0 -1
  221. package/web/assets/EnvironmentForm-C9NbiSRH.js +0 -108
  222. package/web/assets/EnvironmentFormPage-DWbL-D3Z.js +0 -1
  223. package/web/assets/EnvironmentListPage-rdeHc34g.js +0 -1
  224. package/web/assets/KanbanBoardPage-CbHeyK8M.js +0 -4
  225. package/web/assets/KanbanListPage-xIqiBmTe.js +0 -1
  226. package/web/assets/LaunchProjectPage-D04ok35N.js +0 -1
  227. package/web/assets/LaunchServicesPage-Bkhxe7Ko.js +0 -1
  228. package/web/assets/LogViewer-BHlGDB4l.js +0 -3
  229. package/web/assets/OrgKeyPrompt-CnIY4K5s.js +0 -1
  230. package/web/assets/ProcessControls-BOkCKqGc.js +0 -1
  231. package/web/assets/ProcessDetailPage-BQCvKU0O.js +0 -1
  232. package/web/assets/ProjectDetailPage-Cjf4eBYS.js +0 -1
  233. package/web/assets/ProjectListPage-DQH1VC3U.js +0 -1
  234. package/web/assets/RandomJobTestPage-BMc4Qb-3.js +0 -2
  235. package/web/assets/ScenarioEditorPage-ClH3vxG9.js +0 -14
  236. package/web/assets/SendToChatDialog-5TxDHf96.js +0 -1
  237. package/web/assets/ServiceControlsBar-D0nrwVz7.js +0 -1
  238. package/web/assets/ServiceDetailPage-DLTZ2bjR.js +0 -2
  239. package/web/assets/ServiceFormPage-BoUHidR5.js +0 -1
  240. package/web/assets/SettingsPage-B6jM9W4h.js +0 -2063
  241. package/web/assets/UnlockPage-boIYvNg3.js +0 -1
  242. package/web/assets/VariablesTable-Eyqi7OJN.js +0 -1
  243. package/web/assets/VaultMigrationPage-CqKla89B.js +0 -1
  244. package/web/assets/VersionBadge-CnU3z5Rl.js +0 -1
  245. package/web/assets/WikiPage-Cbdxhr9G.js +0 -1
  246. package/web/assets/WikiView-BeWVPGaR.js +0 -1
  247. package/web/assets/add-scalar-classes-CG8bn7uZ.js +0 -387
  248. package/web/assets/auth-errors-CZibvB1j.js +0 -1
  249. package/web/assets/card-D8XCM024.js +0 -32
  250. package/web/assets/cloud-chat.store-BB8XNnvp.js +0 -1
  251. package/web/assets/cloud-session-f2IzlmYY.js +0 -1
  252. package/web/assets/column-BaNiShA4.js +0 -907
  253. package/web/assets/index-Cz0azMVO.css +0 -1
  254. package/web/assets/interface-content-folder.svg-C0OEvuKX.js +0 -1
  255. package/web/assets/modal-BO4YZ0Od.js +0 -1
  256. package/web/assets/modal-DUYd78Dq.js +0 -5
  257. package/web/assets/multiselect-DJ80nRN0.js +0 -251
  258. package/web/assets/process.store-Dq6j8zkt.js +0 -1
  259. package/web/assets/router-BzVLWWlf.js +0 -1
  260. package/web/assets/settings-scope-B2XSViBz.js +0 -1
  261. package/web/assets/src-DB1mNeZv.js +0 -1
  262. package/web/assets/src-DIxcn8ra.css +0 -1
  263. package/web/assets/trpc-BT4fWDYZ.js +0 -1
  264. package/web/assets/useAiChatDrawer-Bn5BBHr2.js +0 -1
  265. package/web/assets/useCloudOrg-CCXszfIX.js +0 -572
  266. package/web/assets/useProjectCatalog-CHgbaNsn.js +0 -1
  267. /package/{agent-manager-WEFGEFRT.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 z23 } 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,1553 +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/utils/crypto.ts
1933
- import { createCipheriv as createCipheriv3, createDecipheriv as createDecipheriv3, randomBytes as randomBytes3, pbkdf2Sync } from "crypto";
1934
-
1935
- // ../../packages/shared/src/native-parsers.ts
1936
- var epoch = /* @__PURE__ */ new Date("2025-01-01T00:00:00Z");
1937
- var nativeParsers = [
1938
- {
1939
- id: "native:json",
1940
- name: "JSON Log Parser",
1941
- description: "Parses JSON log lines and extracts level, message, timestamp, metadata, and the full parsed object.",
1942
- code: `(line) => {
1943
- var trimmed = line.message.trim();
1944
- if (!trimmed.startsWith('{')) return line;
1945
- try {
1946
- var obj = JSON.parse(trimmed);
1947
- var level = (obj.level || obj.severity || obj.loglevel || '').toString().toLowerCase();
1948
- var levelMap = { trace: 'debug', debug: 'debug', info: 'info', warn: 'warn', warning: 'warn', error: 'error', fatal: 'fatal', err: 'error' };
1949
- var mappedLevel = levelMap[level] || line.level;
1950
- var message = obj.message || obj.msg || obj.text || trimmed;
1951
- var metadata = {};
1952
- for (var k in obj) {
1953
- if (['level','severity','loglevel','message','msg','text','timestamp','time','ts'].indexOf(k) !== -1) continue;
1954
- metadata[k] = typeof obj[k] === 'string' ? obj[k] : JSON.stringify(obj[k]);
1955
- }
1956
- var merged = {};
1957
- for (var mk in line.metadata) merged[mk] = line.metadata[mk];
1958
- for (var nk in metadata) merged[nk] = metadata[nk];
1959
- 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 };
1960
- } catch (e) { return line; }
1961
- }`,
1962
- enabled: true,
1963
- builtin: true,
1964
- createdAt: epoch,
1965
- updatedAt: epoch
1966
- },
1967
- {
1968
- id: "native:debug",
1969
- name: "Runeya Debug Parser",
1970
- description: 'Detects Runeya internal debug logs emitted as JSON arrays: ["runeya", payload]. Marks them as debug level.',
1971
- code: `(line) => {
1972
- var trimmed = line.message.trim();
1973
- if (!trimmed.startsWith('[')) return line;
1974
- try {
1975
- var parsed = JSON.parse(trimmed);
1976
- if (!Array.isArray(parsed) || parsed[0] !== 'runeya') return line;
1977
- var debug = parsed.length === 2 ? parsed[1] : parsed.slice(1);
1978
- var message = typeof debug === 'string' ? debug : JSON.stringify(debug);
1979
- var merged = {};
1980
- for (var k in line.metadata) merged[k] = line.metadata[k];
1981
- merged.runeya_debug = JSON.stringify(debug);
1982
- return { raw: line.raw, stream: line.stream, level: 'debug', message: message, hidden: line.hidden, metadata: merged, jsonHeader: line.jsonHeader };
1983
- } catch (e) { return line; }
1984
- }`,
1985
- enabled: true,
1986
- builtin: true,
1987
- createdAt: epoch,
1988
- updatedAt: epoch
1989
- },
1990
- {
1991
- id: "native:links",
1992
- name: "Link Detector",
1993
- description: "Detects URLs in plain-text log lines and exposes them in metadata.links for frontend rendering.",
1994
- code: `(line) => {
1995
- var urlRegex = /(https?|ftp):\\/\\/[\\w_-]+(?:\\.[\\w_-]+)+([\\w.,@?^=%&:/~+#-]*[\\w@?^=%&/~+#-])?/gi;
1996
- var urls = line.message.match(urlRegex);
1997
- if (!urls || urls.length === 0) return line;
1998
- var merged = {};
1999
- for (var k in line.metadata) merged[k] = line.metadata[k];
2000
- merged.links = urls.join(' ');
2001
- return { raw: line.raw, stream: line.stream, level: line.level, message: line.message, hidden: line.hidden, metadata: merged, jsonHeader: line.jsonHeader };
2002
- }`,
2003
- enabled: true,
2004
- builtin: true,
2005
- createdAt: epoch,
2006
- updatedAt: epoch
2007
- }
2008
- ];
2009
-
2010
- // ../../packages/shared/src/js-log-parser.ts
2011
- import vm from "vm";
2012
- var VALID_LEVELS = /* @__PURE__ */ new Set(["debug", "info", "warn", "error", "fatal"]);
2013
- var PARSE_TIMEOUT_MS = 50;
2014
- var MAX_CONSECUTIVE_TIMEOUTS = 10;
2015
- var JSLogParser = class {
2016
- parsers = [];
2017
- constructor(definitions = []) {
2018
- this.setParsers(definitions);
2019
- }
2020
- setParsers(definitions) {
2021
- this.parsers = [];
2022
- for (const def of definitions) {
2023
- if (!def.enabled) continue;
2024
- try {
2025
- const compiled = this.compileParser(def);
2026
- this.parsers.push({
2027
- id: def.id,
2028
- name: def.name,
2029
- enabled: true,
2030
- fn: compiled
2031
- });
2032
- } catch (err) {
2033
- console.warn(
2034
- `[js-log-parser] Failed to compile parser "${def.name}" (${def.id}): ${err instanceof Error ? err.message : String(err)}`
2035
- );
2036
- }
2037
- }
2038
- }
2039
- parse(line) {
2040
- let current = line;
2041
- for (const parser of this.parsers) {
2042
- try {
2043
- current = parser.fn(current);
2044
- } catch (err) {
2045
- console.warn(
2046
- `[js-log-parser] Parser "${parser.name}" threw error: ${err instanceof Error ? err.message : String(err)}`
2047
- );
2048
- }
2049
- }
2050
- return this.sanitize(current);
2051
- }
2052
- /**
2053
- * Compile le code utilisateur en une fonction bornée en temps.
2054
- *
2055
- * Le `timeout` de `runInNewContext` ne couvre que l'évaluation de la factory :
2056
- * la closure retournée s'exécutait ensuite ligne par ligne directement sur
2057
- * l'event loop, sans aucune borne. Une regex à backtracking exponentiel
2058
- * fournie par l'utilisateur figeait donc l'agent entier — logs, statuts et
2059
- * métriques de *tous* les services. Chaque invocation repasse maintenant par
2060
- * la vm, avec son propre budget.
2061
- */
2062
- compileParser(def) {
2063
- const forbidden = ["require(", "import ", "eval("];
2064
- for (const pat of forbidden) {
2065
- if (def.code.includes(pat)) {
2066
- throw new Error("Code contains forbidden patterns (require, import, eval)");
2067
- }
2068
- }
2069
- const sandbox = {
2070
- RegExp,
2071
- String,
2072
- Object,
2073
- Array,
2074
- JSON,
2075
- Math,
2076
- Date,
2077
- undefined: void 0,
2078
- null: null
2079
- };
2080
- let script;
2081
- try {
2082
- script = new vm.Script(`(${def.code})`, { filename: `parser-${def.id}.js` });
2083
- } catch (err) {
2084
- throw new Error(`Compilation failed: ${err instanceof Error ? err.message : String(err)}`);
2085
- }
2086
- const context = vm.createContext({ ...sandbox, __line: null, __result: null });
2087
- let parserFn;
2088
- try {
2089
- parserFn = script.runInContext(context, { timeout: 100 });
2090
- } catch (err) {
2091
- throw new Error(`Execution failed: ${err instanceof Error ? err.message : String(err)}`);
2092
- }
2093
- if (typeof parserFn !== "function") {
2094
- throw new Error("Parser code must export a function");
2095
- }
2096
- context["__parserFn"] = parserFn;
2097
- const callScript = new vm.Script("__result = __parserFn(__line);", {
2098
- filename: `parser-${def.id}-call.js`
2099
- });
2100
- let consecutiveTimeouts = 0;
2101
- let disabled = false;
2102
- return (line) => {
2103
- if (disabled) return line;
2104
- const ctx = context;
2105
- ctx["__line"] = line;
2106
- ctx["__result"] = null;
2107
- try {
2108
- callScript.runInContext(context, { timeout: PARSE_TIMEOUT_MS });
2109
- consecutiveTimeouts = 0;
2110
- } catch (err) {
2111
- const e = err;
2112
- const timedOut = !!e && (e.code === "ERR_SCRIPT_EXECUTION_TIMEOUT" || typeof e.message === "string" && /execution timed out/i.test(e.message));
2113
- if (!timedOut) throw err;
2114
- consecutiveTimeouts += 1;
2115
- if (consecutiveTimeouts >= MAX_CONSECUTIVE_TIMEOUTS) {
2116
- disabled = true;
2117
- console.warn(
2118
- `[js-log-parser] Parser "${def.name}" (${def.id}) disabled after ${MAX_CONSECUTIVE_TIMEOUTS} consecutive timeouts`
2119
- );
2120
- }
2121
- return line;
2122
- }
2123
- const result = ctx["__result"];
2124
- if (result === null || result === void 0 || typeof result !== "object") {
2125
- return line;
2126
- }
2127
- return result;
2128
- };
2129
- }
2130
- /** Sanitize the final LogLine: truncate message, limit metadata, validate level */
2131
- sanitize(line) {
2132
- let { message, metadata, level } = line;
2133
- if (message.length > 16384) {
2134
- message = message.substring(0, 16384) + "...[truncated]";
2135
- }
2136
- metadata = metadata ?? {};
2137
- const metaKeys = Object.keys(metadata);
2138
- if (metaKeys.length > 100) {
2139
- const limited = {};
2140
- for (let i = 0; i < 100; i++) {
2141
- limited[metaKeys[i]] = metadata[metaKeys[i]];
2142
- }
2143
- metadata = limited;
2144
- }
2145
- if (!VALID_LEVELS.has(level)) {
2146
- level = "info";
2147
- }
2148
- if (message !== line.message || metadata !== line.metadata || level !== line.level) {
2149
- return { ...line, message, metadata, level };
2150
- }
2151
- return line;
2152
- }
2153
- };
2154
-
2155
- // ../../packages/shared/src/builtins.ts
2156
- var BUILTIN_VARIABLES = [
2157
- // ── Le service ───────────────────────────────────────────────────────────
2158
- { name: "service.NAME", scope: "server", descriptionKey: "serviceName" },
2159
- { name: "service.ID", scope: "server", descriptionKey: "serviceId" },
2160
- { name: "service.PORT", scope: "server", descriptionKey: "servicePort" },
2161
- { name: "service.URL", scope: "server", descriptionKey: "serviceUrl" },
2162
- { name: "service.BASE_URL", scope: "server", descriptionKey: "serviceBaseUrl" },
2163
- { name: "service.CWD", scope: "agent", descriptionKey: "serviceCwd" },
2164
- // ── Le projet et l'environnement actif ───────────────────────────────────
2165
- { name: "project.NAME", scope: "server", descriptionKey: "projectName" },
2166
- { name: "runeya.ENV_NAME", scope: "server", descriptionKey: "envName" },
2167
- // ── Le serveur Runeya ────────────────────────────────────────────────────
2168
- // `service.HOST` a toujours désigné l'adresse d'écoute du SERVEUR, pas une
2169
- // propriété du service : le nom trompait, il devient un alias.
2170
- { name: "runeya.HOST", scope: "server", descriptionKey: "runeyaHost", deprecatedAlias: "service.HOST" },
2171
- // ── La machine qui exécute ───────────────────────────────────────────────
2172
- { name: "agent.HOST_LAN", scope: "agent", descriptionKey: "agentHostLan", deprecatedAlias: "service.HOST_LAN" },
2173
- // Le NOM de l'agent est une étiquette de la configuration du serveur, pas
2174
- // une propriété de la machine : c'est le serveur qui le connaît et le résout.
2175
- { name: "agent.NAME", scope: "server", descriptionKey: "agentName" },
2176
- { name: "agent.OS", scope: "agent", descriptionKey: "agentOs" },
2177
- { name: "agent.HOME", scope: "agent", descriptionKey: "agentHome" }
2178
- ];
2179
- var BUILTIN_REFERENCE_RE = /\{\{([A-Za-z][A-Za-z0-9_.-]*)\}\}/g;
2180
- var ENVIRONMENT_NAMESPACE = "environment.";
2181
- function interpolateBuiltins(text, values) {
2182
- return text.replace(BUILTIN_REFERENCE_RE, (match, name) => {
2183
- if (name.startsWith(ENVIRONMENT_NAMESPACE)) return match;
2184
- return values[name] ?? match;
2185
- });
2186
- }
2187
- function interpolateBuiltinsInEnv(env2, values) {
2188
- const out = {};
2189
- for (const [key, value] of Object.entries(env2)) {
2190
- out[key] = interpolateBuiltins(value, values);
2191
- }
2192
- return out;
2193
- }
2194
- function withDeprecatedAliases(values) {
2195
- const out = { ...values };
2196
- for (const builtin of BUILTIN_VARIABLES) {
2197
- if (builtin.deprecatedAlias && out[builtin.name] !== void 0) {
2198
- out[builtin.deprecatedAlias] = out[builtin.name];
2199
- }
2200
- }
2201
- return out;
2202
- }
2203
- function serviceSlug(name) {
2204
- return name.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
2205
- }
2206
- function servicePortValues(ports, prefix = "service") {
2207
- const values = {};
2208
- (ports ?? []).forEach((port, i) => {
2209
- values[i === 0 ? `${prefix}.PORT` : `${prefix}.PORT_${i + 1}`] = String(port);
2210
- });
2211
- return values;
2212
- }
2213
- function isWildcardHost(host) {
2214
- const h = host.trim();
2215
- return h === "" || h === "0.0.0.0" || h === "::" || h === "[::]";
2216
- }
2217
- function isLoopbackHost(host) {
2218
- const h = host.trim();
2219
- return h === "127.0.0.1" || h === "::1" || h === "[::1]";
2220
- }
2221
- function urlHostFor(host) {
2222
- if (isWildcardHost(host)) return null;
2223
- return isLoopbackHost(host) ? "localhost" : host.trim();
2224
- }
2225
- function serviceUrlValues(service, host, prefix = "service") {
2226
- const domainByPort = new Map((service.localUrls ?? []).map((lu) => [lu.port, lu.url]));
2227
- const ports = [...service.ports ?? []];
2228
- for (const local of service.localUrls ?? []) {
2229
- if (!ports.includes(local.port)) ports.push(local.port);
2230
- }
2231
- const values = {};
2232
- ports.forEach((port, i) => {
2233
- const domain = domainByPort.get(port);
2234
- values[i === 0 ? `${prefix}.URL` : `${prefix}.URL_${i + 1}`] = domain ? `http://${domain}` : `http://${host}:${port}`;
2235
- });
2236
- return values;
2237
- }
2238
- function crossServiceValues(service, host) {
2239
- const slug = serviceSlug(service.name);
2240
- if (!slug) return {};
2241
- return {
2242
- [`services.${slug}.NAME`]: service.name,
2243
- [`services.${slug}.ID`]: service.id,
2244
- ...servicePortValues(service.ports, `services.${slug}`),
2245
- ...serviceUrlValues(service, host, `services.${slug}`),
2246
- ...service.url ? { [`services.${slug}.BASE_URL`]: service.url } : {}
2247
- };
2248
- }
2249
-
2250
- // ../../packages/shared/src/constants/intervals.ts
2251
- var AGENT_HEALTH_POLL_INTERVAL = 15e3;
2252
-
2253
- // ../../packages/shared/src/constants/buffers.ts
2254
- var LOG_BUFFER_SIZE = 5e3;
2255
-
2256
- // ../../packages/shared/src/constants/timeouts.ts
2257
- var GRACE_PERIOD = 1e4;
2258
- var AGENT_FETCH_TIMEOUT = 1e4;
2259
- var AGENT_LONG_FETCH_TIMEOUT = 6e5;
2260
- var AGENT_STOP_FETCH_TIMEOUT = GRACE_PERIOD + 15e3;
2261
- var PASSPHRASE_TIMEOUT = 3e4;
2262
- var WS_RECONNECT_MIN = 1e3;
2263
- var WS_RECONNECT_MAX = 15e3;
2264
-
2265
- // ../../packages/shared/src/constants/editors.ts
2266
- var SUPPORTED_EDITORS = [
2267
- { key: "vscode", name: "Visual Studio Code", command: "code" },
2268
- { key: "cursor", name: "Cursor", command: "cursor" },
2269
- { key: "windsurf", name: "Windsurf", command: "windsurf" },
2270
- { key: "sublime", name: "Sublime Text", command: "subl" },
2271
- { key: "atom", name: "Atom", command: "atom" },
2272
- { key: "antigravity", name: "Antigravity", command: "antigravity" },
2273
- { key: "intellij", name: "IntelliJ IDEA", command: "idea" },
2274
- { key: "android-studio", name: "Android Studio", command: "studio" },
2275
- { key: "webstorm", name: "WebStorm", command: "webstorm" },
2276
- { key: "zed", name: "Zed", command: "zed" },
2277
- { key: "neovim", name: "Neovim", command: "nvim" },
2278
- { key: "vim", name: "Vim", command: "vim" },
2279
- { key: "emacs", name: "Emacs", command: "emacs" },
2280
- { key: "fleet", name: "Fleet", command: "fleet" }
2281
- ];
2282
- var EDITOR_BY_KEY = new Map(
2283
- SUPPORTED_EDITORS.map((e) => [e.key, e])
2284
- );
2285
-
2286
- // ../../packages/shared/src/sync/json-crdt.ts
2287
- import * as Y from "yjs";
2288
- function normalize(value) {
2289
- return JSON.parse(JSON.stringify(value ?? null));
2290
- }
2291
- function isPlainObject(v) {
2292
- return typeof v === "object" && v !== null && !Array.isArray(v);
2293
- }
2294
- function toPlain(value) {
2295
- if (value instanceof Y.Map) {
2296
- const out = {};
2297
- for (const [k, v] of value.entries()) out[k] = toPlain(v);
2298
- return out;
2299
- }
2300
- if (value instanceof Y.Array) return value.toArray().map(toPlain);
2301
- return value ?? null;
2302
- }
2303
- function identityOf(value) {
2304
- if (isPlainObject(value) && typeof value["id"] === "string") return `id:${value["id"]}`;
2305
- return `v:${JSON.stringify(value)}`;
2306
- }
2307
- function identityOfY(value) {
2308
- if (value instanceof Y.Map) {
2309
- const id = value.get("id");
2310
- if (typeof id === "string") return `id:${id}`;
2311
- }
2312
- return `v:${JSON.stringify(toPlain(value))}`;
2313
- }
2314
- function toY(value) {
2315
- if (Array.isArray(value)) {
2316
- const arr = new Y.Array();
2317
- if (value.length > 0) arr.insert(0, value.map(toY));
2318
- return arr;
2319
- }
2320
- if (isPlainObject(value)) {
2321
- const map = new Y.Map();
2322
- for (const [k, v] of Object.entries(value)) map.set(k, toY(v));
2323
- return map;
2324
- }
2325
- return value;
2326
- }
2327
- function applyToMap(map, next) {
2328
- for (const key of Array.from(map.keys())) {
2329
- if (!(key in next)) map.delete(key);
2330
- }
2331
- for (const [key, value] of Object.entries(next)) {
2332
- const current = map.get(key);
2333
- if (Array.isArray(value)) {
2334
- if (!(current instanceof Y.Array)) map.set(key, toY(value));
2335
- else applyToArray(current, value);
2336
- } else if (isPlainObject(value)) {
2337
- if (!(current instanceof Y.Map)) map.set(key, toY(value));
2338
- else applyToMap(current, value);
2339
- } else if (current instanceof Y.Map || current instanceof Y.Array || current !== value) {
2340
- map.set(key, value);
2341
- }
2342
- }
2343
- }
2344
- function applyToArray(arr, next) {
2345
- const wanted = next.map(identityOf);
2346
- const wantedCount = /* @__PURE__ */ new Map();
2347
- for (const k of wanted) wantedCount.set(k, (wantedCount.get(k) ?? 0) + 1);
2348
- const seen2 = /* @__PURE__ */ new Map();
2349
- for (let i = arr.length - 1; i >= 0; i--) {
2350
- const key = identityOfY(arr.get(i));
2351
- const used = seen2.get(key) ?? 0;
2352
- if (used >= (wantedCount.get(key) ?? 0)) arr.delete(i, 1);
2353
- else seen2.set(key, used + 1);
2354
- }
2355
- for (let j = 0; j < next.length; j++) {
2356
- const key = wanted[j];
2357
- if (j < arr.length && identityOfY(arr.get(j)) === key) {
2358
- const current = arr.get(j);
2359
- const value = next[j];
2360
- if (current instanceof Y.Map && isPlainObject(value)) applyToMap(current, value);
2361
- else if (current instanceof Y.Array && Array.isArray(value)) applyToArray(current, value);
2362
- continue;
2363
- }
2364
- let found = -1;
2365
- for (let k = j + 1; k < arr.length; k++) {
2366
- if (identityOfY(arr.get(k)) === key) {
2367
- found = k;
2368
- break;
2369
- }
2370
- }
2371
- if (found !== -1) {
2372
- const moved = toPlain(arr.get(found));
2373
- arr.delete(found, 1);
2374
- arr.insert(j, [toY(moved)]);
2375
- } else {
2376
- arr.insert(j, [toY(next[j])]);
2377
- }
2378
- }
2379
- }
2380
- function getCollection(doc, name) {
2381
- return doc.getMap(name);
2382
- }
2383
- function readEntity(collection, id) {
2384
- const entity = collection.get(id);
2385
- if (!(entity instanceof Y.Map)) return null;
2386
- const plain = toPlain(entity);
2387
- return isPlainObject(plain) ? plain : null;
2388
- }
2389
- function writeEntity(collection, id, entity) {
2390
- const next = normalize(entity);
2391
- if (!isPlainObject(next)) return;
2392
- const current = collection.get(id);
2393
- if (!(current instanceof Y.Map)) {
2394
- collection.set(id, toY(next));
2395
- return;
2396
- }
2397
- applyToMap(current, next);
2398
- }
2399
-
2400
621
  // ../server/src/services/environment-store.ts
2401
622
  var FILENAME2 = "environments.json";
2402
623
  var EnvironmentStore = class {
@@ -2474,7 +695,7 @@ var EnvironmentStore = class {
2474
695
  return out;
2475
696
  }
2476
697
  getFilePath(root) {
2477
- return join3(root, FILENAME2);
698
+ return join2(root, FILENAME2);
2478
699
  }
2479
700
  /**
2480
701
  * The vault an environment must be written to: its project's.
@@ -2615,7 +836,7 @@ var EnvironmentStore = class {
2615
836
  }
2616
837
  for (const root of await allVaultRoots()) {
2617
838
  try {
2618
- const raw = await readFile3(this.getFilePath(root), "utf-8");
839
+ const raw = await readFile2(this.getFilePath(root), "utf-8");
2619
840
  await rememberFile(this.getFilePath(root));
2620
841
  const data = JSON.parse(raw);
2621
842
  const clash = data.find((e) => this.environments.has(e.id) && this.roots.get(e.id) !== root);
@@ -2683,9 +904,9 @@ var EnvironmentStore = class {
2683
904
  });
2684
905
  continue;
2685
906
  }
2686
- await mkdir3(root, { recursive: true });
907
+ await mkdir2(root, { recursive: true });
2687
908
  const tmpPath = filePath + ".tmp";
2688
- await writeFile3(tmpPath, JSON.stringify(environments, null, 2), "utf-8");
909
+ await writeFile2(tmpPath, JSON.stringify(environments, null, 2), "utf-8");
2689
910
  await rename2(tmpPath, filePath);
2690
911
  await chmod2(filePath, 384);
2691
912
  await rememberFile(filePath);
@@ -3066,7 +1287,7 @@ var ServiceStore = class {
3066
1287
  this.notify();
3067
1288
  }
3068
1289
  getFilePath(root) {
3069
- return join4(root, FILENAME3);
1290
+ return join3(root, FILENAME3);
3070
1291
  }
3071
1292
  /**
3072
1293
  * The vault a service must be written to: the one of the project owning it.
@@ -3095,7 +1316,7 @@ var ServiceStore = class {
3095
1316
  await ensureProjectsLoaded();
3096
1317
  for (const root of await allVaultRoots()) {
3097
1318
  try {
3098
- const raw = await readFile4(this.getFilePath(root), "utf-8");
1319
+ const raw = await readFile3(this.getFilePath(root), "utf-8");
3099
1320
  const data = JSON.parse(raw);
3100
1321
  const clash = data.find((s) => this.services.has(s.id) && this.roots.get(s.id) !== root);
3101
1322
  if (clash) {
@@ -3149,9 +1370,9 @@ var ServiceStore = class {
3149
1370
  });
3150
1371
  continue;
3151
1372
  }
3152
- await mkdir4(root, { recursive: true });
1373
+ await mkdir3(root, { recursive: true });
3153
1374
  const tmpPath = filePath + ".tmp";
3154
- await writeFile4(tmpPath, JSON.stringify(services, null, 2), "utf-8");
1375
+ await writeFile3(tmpPath, JSON.stringify(services, null, 2), "utf-8");
3155
1376
  await rename3(tmpPath, filePath);
3156
1377
  await chmod3(filePath, 384);
3157
1378
  }
@@ -3361,18 +1582,18 @@ var serviceStore = new ServiceStore();
3361
1582
  import { spawn as spawn2 } from "child_process";
3362
1583
  import { createInterface } from "readline";
3363
1584
  import { watch } from "fs";
3364
- import { dirname as dirname2, join as join6 } from "path";
1585
+ import { dirname as dirname2, join as join5 } from "path";
3365
1586
  import { fileURLToPath } from "url";
3366
1587
 
3367
1588
  // ../server/src/services/instance-registry.ts
3368
- 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";
3369
1590
  import { readFileSync } from "fs";
3370
1591
  import dotenv from "dotenv";
3371
1592
  import { spawn } from "child_process";
3372
- import { join as join5 } from "path";
3373
- import { z as z22 } from "zod";
3374
- var InstanceFileSchema = z22.object({
3375
- pid: z22.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(),
3376
1597
  /**
3377
1598
  * The agent this server spawned, when it has one.
3378
1599
  *
@@ -3380,14 +1601,14 @@ var InstanceFileSchema = z22.object({
3380
1601
  * it, and because the agent may not be up yet — or at all, when the
3381
1602
  * encryption key is missing. Absent means « unknown », never « none ».
3382
1603
  */
3383
- agentPid: z22.number().int().positive().optional(),
3384
- port: z22.number().int().min(1).max(65535),
3385
- agentPort: z22.number().int().min(1).max(65535),
3386
- cwd: z22.string().max(4096),
3387
- dataDir: z22.string().max(4096),
3388
- version: z22.string().max(64),
3389
- fromDesktop: z22.boolean(),
3390
- startedAt: z22.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(),
3391
1612
  /**
3392
1613
  * De quoi relancer ce lancement à l'identique : l'exécutable, ses arguments,
3393
1614
  * et les `RUNEYA_*` de son environnement. Le `cwd` ci-dessus complète le
@@ -3397,9 +1618,9 @@ var InstanceFileSchema = z22.object({
3397
1618
  * écrit pas. Elle reste listée et arrêtable, simplement pas redémarrable —
3398
1619
  * un redémarrage approximatif serait pire qu'un bouton absent.
3399
1620
  */
3400
- execPath: z22.string().max(4096).optional(),
3401
- argv: z22.array(z22.string().max(4096)).max(128).optional(),
3402
- env: z22.record(z22.string().max(64), z22.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(),
3403
1624
  /**
3404
1625
  * L'instance tient un secret (`RUNEYA_ENCRYPTION_KEY`,
3405
1626
  * `RUNEYA_MASTER_PASSWORD`) que le relancement ne retrouverait pas. Le
@@ -3410,13 +1631,13 @@ var InstanceFileSchema = z22.object({
3410
1631
  * Un secret posé dans le `.env` de la pile ne compte pas : `dotenv` le relit
3411
1632
  * au démarrage depuis le même répertoire. Voir `secretsAreReproducible()`.
3412
1633
  */
3413
- needsSecretEnv: z22.boolean().optional()
1634
+ needsSecretEnv: z.boolean().optional()
3414
1635
  });
3415
1636
  function registryDir() {
3416
- return join5(machineRoot(), "instances");
1637
+ return join4(machineRoot(), "instances");
3417
1638
  }
3418
1639
  function fileFor(pid) {
3419
- return join5(registryDir(), `${pid}.json`);
1640
+ return join4(registryDir(), `${pid}.json`);
3420
1641
  }
3421
1642
  var published = null;
3422
1643
  var SECRET_ENV_KEYS = ["RUNEYA_ENCRYPTION_KEY", "RUNEYA_MASTER_PASSWORD"];
@@ -3436,7 +1657,7 @@ function secretsAreReproducible() {
3436
1657
  if (present.length === 0) return true;
3437
1658
  let fromFile;
3438
1659
  try {
3439
- fromFile = dotenv.parse(readFileSync(join5(process.cwd(), ".env")));
1660
+ fromFile = dotenv.parse(readFileSync(join4(process.cwd(), ".env")));
3440
1661
  } catch {
3441
1662
  return false;
3442
1663
  }
@@ -3462,9 +1683,9 @@ function selfRecord() {
3462
1683
  }
3463
1684
  async function registerInstance() {
3464
1685
  try {
3465
- await mkdir5(registryDir(), { recursive: true });
1686
+ await mkdir4(registryDir(), { recursive: true });
3466
1687
  published = selfRecord();
3467
- await writeFile5(fileFor(process.pid), JSON.stringify(published, null, 2));
1688
+ await writeFile4(fileFor(process.pid), JSON.stringify(published, null, 2));
3468
1689
  } catch (err) {
3469
1690
  console.log("[instances] Could not register this instance:", err.message);
3470
1691
  }
@@ -3477,7 +1698,7 @@ async function setInstanceAgentPid(agentPid) {
3477
1698
  if (!published) return;
3478
1699
  published = { ...published, agentPid: agentPid ?? void 0 };
3479
1700
  try {
3480
- await writeFile5(fileFor(process.pid), JSON.stringify(published, null, 2));
1701
+ await writeFile4(fileFor(process.pid), JSON.stringify(published, null, 2));
3481
1702
  } catch {
3482
1703
  }
3483
1704
  }
@@ -3504,7 +1725,7 @@ async function probe(port) {
3504
1725
  }
3505
1726
  async function describeInstance(pid) {
3506
1727
  try {
3507
- const parsed = InstanceFileSchema.safeParse(JSON.parse(await readFile5(fileFor(pid), "utf8")));
1728
+ const parsed = InstanceFileSchema.safeParse(JSON.parse(await readFile4(fileFor(pid), "utf8")));
3508
1729
  if (!parsed.success) return null;
3509
1730
  return { pid, port: parsed.data.port, cwd: parsed.data.cwd };
3510
1731
  } catch {
@@ -3514,16 +1735,16 @@ async function describeInstance(pid) {
3514
1735
  async function listInstances() {
3515
1736
  let files;
3516
1737
  try {
3517
- files = await readdir2(registryDir());
1738
+ files = await readdir(registryDir());
3518
1739
  } catch {
3519
1740
  return [];
3520
1741
  }
3521
1742
  const found = await Promise.all(
3522
1743
  files.filter((f) => f.endsWith(".json")).map(async (name) => {
3523
- const path = join5(registryDir(), name);
1744
+ const path = join4(registryDir(), name);
3524
1745
  let record;
3525
1746
  try {
3526
- const parsed = InstanceFileSchema.safeParse(JSON.parse(await readFile5(path, "utf8")));
1747
+ const parsed = InstanceFileSchema.safeParse(JSON.parse(await readFile4(path, "utf8")));
3527
1748
  if (!parsed.success) {
3528
1749
  await rm3(path, { force: true }).catch(() => {
3529
1750
  });
@@ -3623,7 +1844,7 @@ function launchOf(record) {
3623
1844
  execPath: record.execPath,
3624
1845
  argv: record.argv,
3625
1846
  cwd: record.cwd,
3626
- env: { ...env2, ...record.env ?? {} }
1847
+ env: { ...env2, ...record.env }
3627
1848
  };
3628
1849
  }
3629
1850
  var PORT_RELEASE_TIMEOUT_MS = 15e3;
@@ -3838,7 +2059,7 @@ var AgentSpawner = class {
3838
2059
  }
3839
2060
  console.log(`[agent-spawner] Spawning local agent on ${agentUrl}...`);
3840
2061
  const isDev = process.env.NODE_ENV === "development";
3841
- 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");
3842
2063
  this.agentProcess = spawn2("node", [this.agentDistPath], {
3843
2064
  env: agentEnv,
3844
2065
  stdio: ["ignore", "pipe", "pipe"],
@@ -3948,7 +2169,7 @@ var AgentSpawner = class {
3948
2169
  this.fileWatcher.close();
3949
2170
  }
3950
2171
  console.log("[agent-spawner] \u{1F50D} Watching agent dist for changes (hot reload enabled)");
3951
- const distDir = join6(this.agentDistPath, "..");
2172
+ const distDir = join5(this.agentDistPath, "..");
3952
2173
  this.fileWatcher = watch(distDir, { persistent: false }, (eventType, filename) => {
3953
2174
  if ((eventType === "change" || eventType === "rename") && filename === "index.js" && !this.isRestarting) {
3954
2175
  this.isRestarting = true;
@@ -4262,16 +2483,16 @@ var AgentWSBridge = class extends EventEmitter {
4262
2483
  };
4263
2484
 
4264
2485
  // ../server/src/services/agent-manager.ts
4265
- var HealthMessageSchema = z23.object({
4266
- status: z23.string(),
4267
- uptime: z23.number(),
4268
- runnersAvailable: z23.array(z23.enum(["native", "docker"])),
4269
- processCount: z23.number(),
4270
- runningCount: z23.number(),
4271
- lanIp: z23.string().optional(),
4272
- os: z23.string().max(64).optional(),
4273
- home: z23.string().max(4096).optional(),
4274
- cwd: z23.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()
4275
2496
  });
4276
2497
  var MIN_RECONNECT_DELAY = WS_RECONNECT_MIN;
4277
2498
  var MAX_RECONNECT_DELAY = WS_RECONNECT_MAX;
@@ -4733,7 +2954,6 @@ var AgentManager = class extends EventEmitter2 {
4733
2954
  var agentManager = new AgentManager();
4734
2955
 
4735
2956
  export {
4736
- env,
4737
2957
  isCiMode,
4738
2958
  loadFromEnv,
4739
2959
  setPendingLegacyKey,
@@ -4749,69 +2969,6 @@ export {
4749
2969
  clearVaultLock,
4750
2970
  ensureEncryptionKey,
4751
2971
  setEncryptionKey,
4752
- machineRoot,
4753
- localVaultRoot,
4754
- orgVaultRoot,
4755
- projectVaultRoot,
4756
- orgIdOfRoot,
4757
- vaultIdOfRoot,
4758
- vaultFor,
4759
- stampOrgCloud,
4760
- rememberOrgName,
4761
- readOrgNames,
4762
- rememberOrgLogo,
4763
- forgetOrgLogo,
4764
- readOrgLogos,
4765
- readOrgClouds,
4766
- listOrgVaults,
4767
- listCloudVaults,
4768
- allVaultRoots,
4769
- machineFilePath,
4770
- keyedFilePath,
4771
- legacyMachineFilePath,
4772
- ensureLocalVault,
4773
- keyRoot,
4774
- legacyVaultRoot,
4775
- ProjectSchema,
4776
- ScenarioGroupSchema,
4777
- ScenarioNodeSchema,
4778
- ScenarioSchema,
4779
- AIProviderSchema,
4780
- JSLogParserSchema,
4781
- NotificationPreferencesSchema,
4782
- SettingsSchema,
4783
- TraefikConfigSchema,
4784
- SettingsPrivateSchema,
4785
- SchemaVersionSchema,
4786
- LogSourceConfigSchema,
4787
- HealthCheckSchema,
4788
- DockerConfigSchema,
4789
- RestartStrategySchema,
4790
- ServiceShortcutSchema,
4791
- ServiceCommandSchema,
4792
- VariableSchema,
4793
- CreateEnvironmentSchema,
4794
- UpdateEnvironmentSchema,
4795
- VariableOverrideSchema,
4796
- ApiKeyScopeSchema,
4797
- ApiKeysFileSchema,
4798
- nativeParsers,
4799
- JSLogParser,
4800
- interpolateBuiltinsInEnv,
4801
- withDeprecatedAliases,
4802
- serviceSlug,
4803
- servicePortValues,
4804
- urlHostFor,
4805
- serviceUrlValues,
4806
- crossServiceValues,
4807
- LOG_BUFFER_SIZE,
4808
- AGENT_LONG_FETCH_TIMEOUT,
4809
- AGENT_STOP_FETCH_TIMEOUT,
4810
- SUPPORTED_EDITORS,
4811
- EDITOR_BY_KEY,
4812
- getCollection,
4813
- readEntity,
4814
- writeEntity,
4815
2972
  encryptValueWith,
4816
2973
  decryptValueWith,
4817
2974
  encryptValue,
@@ -4849,4 +3006,4 @@ export {
4849
3006
  traefikManager,
4850
3007
  agentManager
4851
3008
  };
4852
- //# sourceMappingURL=chunk-6Y24763Y.js.map
3009
+ //# sourceMappingURL=chunk-HX3ZIWHM.js.map