@runeya/runeya 2.0.102 → 2.0.103

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 (276) hide show
  1. package/agent-manager-OWHTBG46.js +9 -0
  2. package/assets/icon-alert.ico +0 -0
  3. package/assets/icon-alert.png +0 -0
  4. package/assets/icon-alert.svg +19 -0
  5. package/{chat-OXRRBDB3.js → chat-JZ4UQDWV.js} +8 -7
  6. package/chunk-KY6KYSOU.js +279 -0
  7. package/chunk-KY6KYSOU.js.map +1 -0
  8. package/{chunk-PSTMO7EE.js → chunk-NZNIWJDT.js} +18 -16
  9. package/{chunk-PSTMO7EE.js.map → chunk-NZNIWJDT.js.map} +1 -1
  10. package/chunk-PH4E5WDN.js +137 -0
  11. package/chunk-PH4E5WDN.js.map +1 -0
  12. package/{chunk-BHLCBARP.js → chunk-QIBUMYR6.js} +29 -11
  13. package/chunk-QIBUMYR6.js.map +1 -0
  14. package/{chunk-NDO5VFZY.js → chunk-QRMG6GMX.js} +694 -917
  15. package/chunk-QRMG6GMX.js.map +1 -0
  16. package/{chunk-BDVQB5RK.js → chunk-UYOWIH4R.js} +23 -21
  17. package/{chunk-BDVQB5RK.js.map → chunk-UYOWIH4R.js.map} +1 -1
  18. package/{chunk-F3HKV5AU.js → chunk-Z67WBWKD.js} +7 -5
  19. package/{chunk-F3HKV5AU.js.map → chunk-Z67WBWKD.js.map} +1 -1
  20. package/{companion-JQGNL4U7.js → companion-6J6NK7H7.js} +5 -4
  21. package/{desktop-launcher-FHNURZA7.js → desktop-launcher-N7WRF3LC.js} +11 -17
  22. package/desktop-launcher-N7WRF3LC.js.map +1 -0
  23. package/index.js +64 -2
  24. package/index.js.map +1 -1
  25. package/instances-command-KZ5UGXOR.js +17 -0
  26. package/package.json +4 -1
  27. package/settings-manager-NZV26BC3.js +9 -0
  28. package/settings-manager-NZV26BC3.js.map +1 -0
  29. package/{src-HZ2XO6TV.js → src-V7DPPFCF.js} +447 -254
  30. package/src-V7DPPFCF.js.map +1 -0
  31. package/tray-TRWZNOUD.js +291 -0
  32. package/tray-TRWZNOUD.js.map +1 -0
  33. package/web/assets/AgentScalarChatInterface.vue-CvG5ha3R.js +13 -0
  34. package/web/assets/AgentTerminalPage-DcGppuzO.js +1 -0
  35. package/web/assets/AiChatPage-BDr5tG0A.js +1 -0
  36. package/web/assets/{AppLayout-DeWqCLuK.css → AppLayout-CYQBjQBU.css} +1 -1
  37. package/web/assets/AppLayout-Dv3ViAk2.js +1 -0
  38. package/web/assets/AuditPage-Bc2jlgZJ.js +1 -0
  39. package/web/assets/CloudAccountPage-4BLXSOix.js +1 -0
  40. package/web/assets/CloudAccountPage-B3MX6DNn.js +1 -0
  41. package/web/assets/CloudMessagingPage-CVzUalxx.js +2 -0
  42. package/web/assets/DashboardPage-Bo51pbzt.js +1 -0
  43. package/web/assets/DirectoryPickerDialog-CIVjWKUm.js +1 -0
  44. package/web/assets/{EditorIcon-C9XKLhc7.js → EditorIcon-BguaWtZg.js} +2 -2
  45. package/web/assets/{EnvironmentForm-bS48MK8k.js → EnvironmentForm-D8dq0ffR.js} +2 -2
  46. package/web/assets/EnvironmentFormPage-d8p3q8Yt.js +1 -0
  47. package/web/assets/EnvironmentListPage-DWo2lWjE.js +1 -0
  48. package/web/assets/KanbanBoardPage-DkwIz3J1.js +4 -0
  49. package/web/assets/KanbanListPage-xIQRLcrS.js +1 -0
  50. package/web/assets/LaunchProjectPage-CXWixUmf.js +1 -0
  51. package/web/assets/LaunchServicesPage-nv-chYgX.js +1 -0
  52. package/web/assets/LogViewer-DLupfjjf.js +3 -0
  53. package/web/assets/OrgKeyPrompt-DePcB-8f.js +1 -0
  54. package/web/assets/ProcessControls-D3zTnHb2.js +1 -0
  55. package/web/assets/ProcessDetailPage-CgVGzRoJ.js +1 -0
  56. package/web/assets/{ProcessMetrics-CBPR5ozp.js → ProcessMetrics-Dwd5lzqY.js} +2 -2
  57. package/web/assets/ProjectDetailPage-HR20KyJ3.js +1 -0
  58. package/web/assets/ProjectListPage-DcH4uTTX.js +1 -0
  59. package/web/assets/RandomJobTestPage-BYTkVcdE.js +2 -0
  60. package/web/assets/ScenarioEditorPage-zRxR03Ud.js +14 -0
  61. package/web/assets/SendToChatDialog-Cm5eKBOb.js +1 -0
  62. package/web/assets/ServiceControlsBar-oBpAP9yX.js +1 -0
  63. package/web/assets/ServiceDetailPage-CahBi-or.js +2 -0
  64. package/web/assets/ServiceFormPage-DfmPM_mI.js +1 -0
  65. package/web/assets/SettingsPage-CDMXFJ4k.js +2063 -0
  66. package/web/assets/SettingsPage-Dw6tbcbw.css +1 -0
  67. package/web/assets/UnlockPage-BUyBEPzQ.js +1 -0
  68. package/web/assets/VariablesTable-Dc6CyVQW.js +1 -0
  69. package/web/assets/VaultMigrationPage-BUmzyDXN.js +1 -0
  70. package/web/assets/VersionBadge-Dx_67FtC.js +1 -0
  71. package/web/assets/WikiPage-DEMJLDpD.js +1 -0
  72. package/web/assets/WikiView-CcrQ2ySx.js +1 -0
  73. package/web/assets/add-scalar-classes-M_EBdf4f.js +387 -0
  74. package/web/assets/{autocomplete-CtIxw1IN.js → autocomplete-QtPLLzzV.js} +3 -3
  75. package/web/assets/{basic-shape-diamond.svg-BErisM9Y.js → basic-shape-diamond.svg-Dyx8FJkS.js} +1 -1
  76. package/web/assets/{basic-shape-hexagon.svg-yC7RoYpa.js → basic-shape-hexagon.svg-1RKdVP3_.js} +1 -1
  77. package/web/assets/{basic-shape-primary-circle-ellipse-round.svg-DRmanUIO.js → basic-shape-primary-circle-ellipse-round.svg-CSa69hok.js} +1 -1
  78. package/web/assets/{basic-shape-primary-square-rectangle.svg-DxuoouSj.js → basic-shape-primary-square-rectangle.svg-B9TXktd4.js} +1 -1
  79. package/web/assets/{basic-shape-shield.svg-Cy_Frn-W.js → basic-shape-shield.svg-BZvKXoiw.js} +1 -1
  80. package/web/assets/{browser-h0mxWbci.js → browser-CYeKc8Uo.js} +1 -1
  81. package/web/assets/{browser-Dj3qxJqB.js → browser-VlhbsseI.js} +1 -1
  82. package/web/assets/card-tEWfv-Op.js +32 -0
  83. package/web/assets/{checkbox-CTw-YDe_.js → checkbox-CyPqKR6H.js} +3 -3
  84. package/web/assets/{chip-DwSSTlaC.js → chip-wM0gJ_FI.js} +2 -2
  85. package/web/assets/client-B919VgbS.js +24 -0
  86. package/web/assets/cloud-chat.store-C-A9nIqG.js +1 -0
  87. package/web/assets/cloud-session-g6ewm0UI.js +1 -0
  88. package/web/assets/column-DihIO4Zd.js +907 -0
  89. package/web/assets/{computer-device-desktop-monitor.svg-TLZAKrIM.js → computer-device-desktop-monitor.svg-ClbIVuot.js} +1 -1
  90. package/web/assets/{computer-device-desktop.svg-YRcL_Qxn.js → computer-device-desktop.svg-CXpOovTP.js} +1 -1
  91. package/web/assets/{computer-device-laptop.svg-CZUEbqra.js → computer-device-laptop.svg-C9sY1wZv.js} +1 -1
  92. package/web/assets/{computer-device-mobile-phone-android-samsung-back.svg-CcsmeFGb.js → computer-device-mobile-phone-android-samsung-back.svg-CPWC2QHX.js} +1 -1
  93. package/web/assets/{computer-device-mobile-phone-android-samsung.svg-CXjVvTBT.js → computer-device-mobile-phone-android-samsung.svg-B0H-mnfh.js} +1 -1
  94. package/web/assets/{computer-device-mobile-phone-iphone-x-back.svg-BQQXUoZZ.js → computer-device-mobile-phone-iphone-x-back.svg-BbIunxoN.js} +1 -1
  95. package/web/assets/{computer-device-mobile-phone-iphone-x.svg-CG8VbAP-.js → computer-device-mobile-phone-iphone-x.svg-qLGK_oVA.js} +1 -1
  96. package/web/assets/{computer-device-mobile-tablet-touch.svg-DDMUt0S4.js → computer-device-mobile-tablet-touch.svg-BDpuB6SD.js} +1 -1
  97. package/web/assets/{computer-device-mobile-tablet.svg-CBXtF47n.js → computer-device-mobile-tablet.svg-44THWP9E.js} +1 -1
  98. package/web/assets/{computer-device-network-ethernet-cat6.svg-ObjUhwds.js → computer-device-network-ethernet-cat6.svg-tlgWltl_.js} +1 -1
  99. package/web/assets/{computer-device-network-lan-www.svg-NGYEGuba.js → computer-device-network-lan-www.svg-Bd7Ch4QN.js} +1 -1
  100. package/web/assets/{computer-device-network-wifi-connection.svg-CSnNdKGm.js → computer-device-network-wifi-connection.svg-D_XjoY-a.js} +1 -1
  101. package/web/assets/{computer-device-network-wifi-router.svg-CG7iHt_n.js → computer-device-network-wifi-router.svg-BRpuwgUx.js} +1 -1
  102. package/web/assets/{cssMode-Bclh_xI1.js → cssMode-D0M5mbRd.js} +1 -1
  103. package/web/assets/{divider-Bb31-CFf.js → divider-gPnMjjpJ.js} +2 -2
  104. package/web/assets/{docx-preview-seOy1U3d.js → docx-preview-CBPtwrA0.js} +1 -1
  105. package/web/assets/{ecology-science-erlenmeyer-flask.svg-B8emvJ_p.js → ecology-science-erlenmeyer-flask.svg-CZ3uUeBT.js} +1 -1
  106. package/web/assets/{fieldset-Czp1Leik.js → fieldset-BSGgRmpr.js} +2 -2
  107. package/web/assets/{freemarker2-D87vjb6-.js → freemarker2-BWsK2SIi.js} +1 -1
  108. package/web/assets/{handlebars-CjY4u0vA.js → handlebars-CHNB1gG0.js} +1 -1
  109. package/web/assets/{html-C5pOjLe-.js → html-COwA9Dtl.js} +1 -1
  110. package/web/assets/{htmlMode-CunB4Bjm.js → htmlMode-gZ2_PUDA.js} +1 -1
  111. package/web/assets/{image-flash-lightning.svg-7dRFt_k5.js → image-flash-lightning.svg-Iiwm_7-K.js} +1 -1
  112. package/web/assets/{image-picture-flower.svg-ATG6mf9B.js → image-picture-flower.svg-BP9U6YP8.js} +1 -1
  113. package/web/assets/{index-BMuqGGPP.js → index-mBPGEldp.js} +285 -285
  114. package/web/assets/{interface-alert-exclamation-diamond.svg-DuAtIVtT.js → interface-alert-exclamation-diamond.svg-BYWgnbUp.js} +1 -1
  115. package/web/assets/{interface-alert-exclamation-triangle-warning.svg-Bg9-FBLP.js → interface-alert-exclamation-triangle-warning.svg-CWGfXHx_.js} +1 -1
  116. package/web/assets/{interface-alert-information-circle.svg-C5etvhA3.js → interface-alert-information-circle.svg-88Bga8qr.js} +1 -1
  117. package/web/assets/{interface-award-crown.svg-zuAFLs7y.js → interface-award-crown.svg-3hO77oiy.js} +1 -1
  118. package/web/assets/{interface-bookmark.svg-CfBz0NE3.js → interface-bookmark-tag.svg-DcHwQsr0.js} +1 -1
  119. package/web/assets/{interface-bookmark-tag.svg-C3EKMHOq.js → interface-bookmark.svg-SfHcE95h.js} +1 -1
  120. package/web/assets/{interface-calendar-date-one.svg-DGYz2Prk.js → interface-calendar-date-one.svg-DdXOM9VZ.js} +1 -1
  121. package/web/assets/{interface-content-book-open-pages.svg-DGiJpxy1.js → interface-content-book-open-pages.svg-DD7QTDn_.js} +1 -1
  122. package/web/assets/{interface-content-book-page.svg-DydK46P0.js → interface-content-book-page.svg-Dd45mFzB.js} +1 -1
  123. package/web/assets/{interface-content-file.svg-D0pUOvAN.js → interface-content-file.svg-slPoMF5K.js} +1 -1
  124. package/web/assets/interface-content-folder.svg-D90zbTLh.js +1 -0
  125. package/web/assets/{interface-content-folder.svg-DiJ3Pfaa.js → interface-content-folder.svg-cSgXwhRh.js} +1 -1
  126. package/web/assets/{interface-copy-clipboard.svg-Dl3aROYy.js → interface-copy-clipboard.svg-DNy0VeWx.js} +1 -1
  127. package/web/assets/{interface-edit-attachment.svg-UmDFMIt5.js → interface-edit-attachment.svg-VyCAm1jc.js} +1 -1
  128. package/web/assets/{interface-edit-binocular.svg-Bp_8Pfer.js → interface-edit-binocular.svg-DA6QB2sn.js} +1 -1
  129. package/web/assets/{interface-edit-magic-wand.svg-B2A8V7mt.js → interface-edit-magic-wand.svg-D0uagBk7.js} +1 -1
  130. package/web/assets/{interface-edit-tool-paint-roller.svg-DKjdsVsS.js → interface-edit-tool-paint-roller.svg-ConlubSG.js} +1 -1
  131. package/web/assets/{interface-edit-tool-pencil.svg-DuUybI4h.js → interface-edit-tool-pencil.svg-BgNzCwXf.js} +1 -1
  132. package/web/assets/{interface-favorite-award.svg-DHeTFQv8.js → interface-favorite-award.svg-MLL88pIy.js} +1 -1
  133. package/web/assets/{interface-favorite-flag.svg-kKzUSQkq.js → interface-favorite-flag.svg-ZhM_9XJZ.js} +1 -1
  134. package/web/assets/{interface-favorite-heart.svg-CqMgA2mm.js → interface-favorite-heart.svg-Cqq1PV9O.js} +1 -1
  135. package/web/assets/{interface-favorite-star.svg-CuLj8HV6.js → interface-favorite-star.svg-YumblcRD.js} +1 -1
  136. package/web/assets/{interface-favorite-stars-sparkles.svg-lFQTnGOR.js → interface-favorite-stars-sparkles.svg-BH5BXXOe.js} +1 -1
  137. package/web/assets/{interface-hierarchy-flowchart.svg-CBbliSZq.js → interface-hierarchy-flowchart.svg-CEfCPIyC.js} +1 -1
  138. package/web/assets/{interface-home-house.svg-BoFlxzre.js → interface-home-house.svg-DJE_g94c.js} +1 -1
  139. package/web/assets/{interface-hyperlink.svg-DcKs1Vcm.js → interface-hyperlink.svg-BFhnDXDD.js} +1 -1
  140. package/web/assets/{interface-lighting-brightness.svg-BSNKEyEg.js → interface-lighting-brightness.svg-NwOV0KEv.js} +1 -1
  141. package/web/assets/{interface-lock-closed.svg-DSP-B9Ze.js → interface-lock-closed.svg-qVkplX0W.js} +1 -1
  142. package/web/assets/{interface-lock-open-unlock.svg-Bzg-oBHY.js → interface-lock-open-unlock.svg-D18OlPEP.js} +1 -1
  143. package/web/assets/{interface-login-key.svg-DG61Q1lR.js → interface-login-key.svg-CccXX7_b.js} +1 -1
  144. package/web/assets/{interface-search.svg-CODjdPxd.js → interface-search.svg-C6ncELaU.js} +1 -1
  145. package/web/assets/{interface-setting-cog.svg-CgiaBO1E.js → interface-setting-cog.svg-5LrIeBav.js} +1 -1
  146. package/web/assets/{interface-share-megaphone-bullhorn.svg-DM0PsgtH.js → interface-share-megaphone-bullhorn.svg-C-qB4VYi.js} +1 -1
  147. package/web/assets/{interface-share-rocket.svg-B0geTs35.js → interface-share-rocket.svg-Citzuyng.js} +1 -1
  148. package/web/assets/{interface-share-satellite.svg-v9Q6QwAp.js → interface-share-satellite.svg-BldpdKdo.js} +1 -1
  149. package/web/assets/{interface-share-space-ship.svg-CLdqgzgZ.js → interface-share-space-ship.svg-B_Ni34rB.js} +1 -1
  150. package/web/assets/{interface-share.svg-Cx3VhLuj.js → interface-share.svg-FAt7Kgad.js} +1 -1
  151. package/web/assets/{interface-signal-square.svg-By_pQLw8.js → interface-signal-square.svg-DeBP6Pim.js} +1 -1
  152. package/web/assets/{interface-time-clock-circle.svg-Co3P-TM3.js → interface-time-clock-circle.svg-dQfNY8BC.js} +1 -1
  153. package/web/assets/{interface-time-hour-glass.svg-BYSOzVeD.js → interface-time-hour-glass.svg-ylbFnlwY.js} +1 -1
  154. package/web/assets/{interface-users-multiple.svg-moFZaev3.js → interface-users-multiple.svg-DXts3WMC.js} +1 -1
  155. package/web/assets/{interface-weather-moon.svg-DhyTNivv.js → interface-weather-moon.svg-BG6mjCih.js} +1 -1
  156. package/web/assets/{javascript-B1fZNcy6.js → javascript-C_ENjImO.js} +1 -1
  157. package/web/assets/{jsonMode-BxZ6OjkS.js → jsonMode-Bt-LEknD.js} +2 -2
  158. package/web/assets/{liquid-B58z0z3s.js → liquid-CVshgHmY.js} +1 -1
  159. package/web/assets/{lspLanguageFeatures-VksJLqpV.js → lspLanguageFeatures-D1e-RcOs.js} +3 -3
  160. package/web/assets/{mail-chat-bubble-square.svg-DU4TDENX.js → mail-chat-bubble-square.svg-RUMLqiUI.js} +1 -1
  161. package/web/assets/{mail-send-email-paper-airplane.svg-jk90Puk3.js → mail-send-email-paper-airplane.svg-JDe3yqOH.js} +1 -1
  162. package/web/assets/{mail-send-envelope.svg-CrEPc3pm.js → mail-send-envelope.svg-CCzWaeO-.js} +1 -1
  163. package/web/assets/{mdx-l-DSKi30.js → mdx-D9G2-Bj8.js} +1 -1
  164. package/web/assets/{minus-CjETE6Jb.js → minus-BMxEQL_C.js} +2 -2
  165. package/web/assets/modal-CZ7zYg5t.js +1 -0
  166. package/web/assets/modal-CmpFIC5N.js +5 -0
  167. package/web/assets/{money-cashier-receipt.svg-veUsiwvj.js → money-cashier-receipt.svg-DfbOr89U.js} +1 -1
  168. package/web/assets/{money-currency-dollar-pay.svg-C5PNkn4j.js → money-currency-dollar-pay.svg-DY7fQ7jz.js} +1 -1
  169. package/web/assets/{money-graph-arrow-increase.svg-BkCcnTWU.js → money-graph-arrow-increase.svg-jewlEZEL.js} +1 -1
  170. package/web/assets/{money-graph-bar-chart-increase.svg-BDiFSuKt.js → money-graph-bar-chart-increase.svg-BChD8dZv.js} +1 -1
  171. package/web/assets/multiselect-CoRzeHvy.js +251 -0
  172. package/web/assets/{nature-ecology-leaf.svg-CHyv9oDB.js → nature-ecology-leaf.svg-AQimnw3F.js} +1 -1
  173. package/web/assets/{password-BYosjMhB.js → password-4Ykb_Ejn.js} +4 -4
  174. package/web/assets/{phone-telephone.svg-Ce1dgyK9.js → phone-telephone.svg-BdkwIhmo.js} +1 -1
  175. package/web/assets/{plus-CVoE_j-e.js → plus-CYVYZlQL.js} +6 -6
  176. package/web/assets/process.store-CtXpHndZ.js +1 -0
  177. package/web/assets/{programming-bug.svg-D87My2Ok.js → programming-bug.svg-DzT817WD.js} +1 -1
  178. package/web/assets/{programming-cloud.svg-jUe8apKw.js → programming-cloud.svg-eKZD46YP.js} +1 -1
  179. package/web/assets/{programming-computer-database-server.svg-D4etrIBX.js → programming-computer-database-server.svg-BXOhjcQy.js} +1 -1
  180. package/web/assets/{programming-computer-database.svg-BtfkmLTx.js → programming-computer-database.svg-DUzhimFY.js} +1 -1
  181. package/web/assets/{programming-module-four-layout.svg-BkzsDKDq.js → programming-module-four-layout.svg-CYGX7Rlj.js} +1 -1
  182. package/web/assets/{programming-module-three.svg-CpzTvjGS.js → programming-module-three.svg-BhQr1m-R.js} +1 -1
  183. package/web/assets/{programming-module.svg-wyvB3tSR.js → programming-module.svg-Bik697Ne.js} +1 -1
  184. package/web/assets/{programming-script-code.svg-Dek4khNq.js → programming-script-code.svg-BaTanEvH.js} +1 -1
  185. package/web/assets/{python-IeHrvMxp.js → python-wDvaXe-V.js} +1 -1
  186. package/web/assets/{razor-CMgDmoNn.js → razor-C-cEFJP1.js} +1 -1
  187. package/web/assets/router-CqYmBKhe.js +1 -0
  188. package/web/assets/settings-scope-DD7SbjFz.js +1 -0
  189. package/web/assets/settings.store-DcQmvBBv.js +1 -0
  190. package/web/assets/{shopping-cart.svg-DeBhxyDX.js → shopping-cart.svg-BwUFrGEq.js} +1 -1
  191. package/web/assets/{shopping-gift-present.svg-Bt0oKBk9.js → shopping-gift-present.svg-Bs4b94QF.js} +1 -1
  192. package/web/assets/{shopping-shipping-box-parcel-package.svg-BEQNmjMi.js → shopping-shipping-box-parcel-package.svg-DhVaYapE.js} +1 -1
  193. package/web/assets/{src-C3dPv05m.js → src-CpoqK21I.js} +13 -13
  194. package/web/assets/src-De5rZb3_.js +1 -0
  195. package/web/assets/src-NB2ZR0ON.js +572 -0
  196. package/web/assets/tabpanel-DMt8G5AA.js +150 -0
  197. package/web/assets/{tag-new-circle.svg-B1i0Y1yt.js → tag-new-circle.svg-B4Z8uL1_.js} +1 -1
  198. package/web/assets/{toggleswitch-CcQEgLiT.js → toggleswitch-CawhRFb7.js} +2 -2
  199. package/web/assets/{travel-map-earth-globe.svg-CB5sqhKh.js → travel-map-earth-globe.svg-D0s5cc-W.js} +1 -1
  200. package/web/assets/trpc-B17uPEkC.js +1 -0
  201. package/web/assets/{tsMode-DoUs-yH0.js → tsMode-NHDuTjcd.js} +5 -5
  202. package/web/assets/{typescript-fw9OMJ0N.js → typescript-DGkgFTtn.js} +1 -1
  203. package/web/assets/useAiChatDrawer-BxE6EYFc.js +1 -0
  204. package/web/assets/{useCloudOrg-CRpEZ-iE.js → useCloudOrg-BJTjZPZ9.js} +1 -1
  205. package/web/assets/useProjectCatalog-DifZyVY5.js +1 -0
  206. package/web/assets/useProjectCloudOrg-EvyyjH6E.js +1 -0
  207. package/web/assets/{xml-Df6_yGan.js → xml-CJaXEqLW.js} +1 -1
  208. package/web/assets/{yaml-LMvM57fn.js → yaml-bl8i8xOf.js} +1 -1
  209. package/web/index.html +1 -1
  210. package/agent-manager-SNVPZNLC.js +0 -8
  211. package/chunk-BHLCBARP.js.map +0 -1
  212. package/chunk-NDO5VFZY.js.map +0 -1
  213. package/desktop-launcher-FHNURZA7.js.map +0 -1
  214. package/settings-manager-YHQ5YHUH.js +0 -8
  215. package/src-HZ2XO6TV.js.map +0 -1
  216. package/web/assets/AgentScalarChatInterface.vue-CxmPaQaj.js +0 -13
  217. package/web/assets/AgentTerminalPage-Bbx4zyQY.js +0 -1
  218. package/web/assets/AiChatPage-GPPQggxZ.js +0 -1
  219. package/web/assets/AppLayout-BuwGeA1p.js +0 -1
  220. package/web/assets/AuditPage-CDsJsoKA.js +0 -1
  221. package/web/assets/CloudAccountPage-BCP8icYZ.js +0 -1
  222. package/web/assets/CloudAccountPage-DzpS3_gc.js +0 -1
  223. package/web/assets/CloudMessagingPage-01hLQzZ5.js +0 -2
  224. package/web/assets/DashboardPage-CKo-sf8A.js +0 -1
  225. package/web/assets/DirectoryPickerDialog-B1tSWoOM.js +0 -1
  226. package/web/assets/EnvironmentFormPage-9yxN-uI3.js +0 -1
  227. package/web/assets/EnvironmentListPage-BbfptXAU.js +0 -1
  228. package/web/assets/KanbanBoardPage-BWkqTc1a.js +0 -4
  229. package/web/assets/KanbanListPage-GxI1nlON.js +0 -1
  230. package/web/assets/LaunchProjectPage-DKMoGXIC.js +0 -1
  231. package/web/assets/LaunchServicesPage-6dfxPQMB.js +0 -1
  232. package/web/assets/LogViewer-DAzGy_T2.js +0 -3
  233. package/web/assets/OrgKeyPrompt-CQ087D4g.js +0 -1
  234. package/web/assets/ProcessControls-D8uc4x7M.js +0 -1
  235. package/web/assets/ProcessDetailPage-BPxLPGeh.js +0 -1
  236. package/web/assets/ProjectDetailPage-CnZ_CpVU.js +0 -1
  237. package/web/assets/ProjectListPage-D8Svc5e3.js +0 -1
  238. package/web/assets/RandomJobTestPage-BdEiEnSi.js +0 -2
  239. package/web/assets/ScenarioEditorPage-COrL715B.js +0 -14
  240. package/web/assets/SendToChatDialog-D8YB5RM6.js +0 -1
  241. package/web/assets/ServiceControlsBar-BKwvqgHw.js +0 -1
  242. package/web/assets/ServiceDetailPage-BmPRfQN6.js +0 -2
  243. package/web/assets/ServiceFormPage-rVvnwWkb.js +0 -1
  244. package/web/assets/SettingsPage-C-OfBHjn.css +0 -1
  245. package/web/assets/SettingsPage-DmQB6t1_.js +0 -2063
  246. package/web/assets/UnlockPage-BgVF3XMO.js +0 -1
  247. package/web/assets/VariablesTable-D4_sssPN.js +0 -1
  248. package/web/assets/VaultMigrationPage-BRZJnfVg.js +0 -1
  249. package/web/assets/VersionBadge-Df7iJWvF.js +0 -1
  250. package/web/assets/WikiPage-UkaH8BqR.js +0 -1
  251. package/web/assets/WikiView-BQqP4b9A.js +0 -1
  252. package/web/assets/add-scalar-classes-B9WxxjAm.js +0 -387
  253. package/web/assets/card-nJdNoKgd.js +0 -32
  254. package/web/assets/client-DYNnTrNm.js +0 -24
  255. package/web/assets/cloud-chat.store-_qILavCL.js +0 -1
  256. package/web/assets/cloud-session-Ml5g5J1-.js +0 -1
  257. package/web/assets/column-Bc4-F_tF.js +0 -907
  258. package/web/assets/interface-content-folder.svg-bb6GV0G0.js +0 -1
  259. package/web/assets/modal-D2-cZ2mf.js +0 -5
  260. package/web/assets/modal-DmgVDXcS.js +0 -1
  261. package/web/assets/multiselect-CDBfo7-0.js +0 -251
  262. package/web/assets/process.store-BsCJ-VuI.js +0 -1
  263. package/web/assets/router-KIdzwvCZ.js +0 -1
  264. package/web/assets/settings-scope-D8l1sq9K.js +0 -1
  265. package/web/assets/settings.store-VVqF8QkO.js +0 -1
  266. package/web/assets/src-CJFQ3yWc.js +0 -1
  267. package/web/assets/src-Cgn_TWXn.js +0 -572
  268. package/web/assets/tabpanel-B8oBjoSG.js +0 -150
  269. package/web/assets/trpc-B1bTQz_t.js +0 -1
  270. package/web/assets/useAiChatDrawer-BpR9XWop.js +0 -1
  271. package/web/assets/useProjectCatalog-mk8A95KQ.js +0 -1
  272. package/web/assets/useProjectCloudOrg-CKgvcUWI.js +0 -1
  273. /package/{agent-manager-SNVPZNLC.js.map → agent-manager-OWHTBG46.js.map} +0 -0
  274. /package/{chat-OXRRBDB3.js.map → chat-JZ4UQDWV.js.map} +0 -0
  275. /package/{companion-JQGNL4U7.js.map → companion-6J6NK7H7.js.map} +0 -0
  276. /package/{settings-manager-YHQ5YHUH.js.map → instances-command-KZ5UGXOR.js.map} +0 -0
@@ -57,7 +57,11 @@ import {
57
57
  shutdownCodexAppServer,
58
58
  startCliSession,
59
59
  vaultOfProject
60
- } from "./chunk-BDVQB5RK.js";
60
+ } from "./chunk-UYOWIH4R.js";
61
+ import {
62
+ resolveCliInvocation,
63
+ whichCommand
64
+ } from "./chunk-B7MABGQN.js";
61
65
  import {
62
66
  LocalProjectExistsError,
63
67
  activeSessionRegistry,
@@ -76,12 +80,7 @@ import {
76
80
  stopClaudeTranscriptWatcher,
77
81
  stopCodexTranscriptWatcher,
78
82
  verifyJwt
79
- } from "./chunk-PSTMO7EE.js";
80
- import "./chunk-MD3VW4HQ.js";
81
- import {
82
- resolveCliInvocation,
83
- whichCommand
84
- } from "./chunk-B7MABGQN.js";
83
+ } from "./chunk-NZNIWJDT.js";
85
84
  import {
86
85
  agentManager,
87
86
  agentSpawner,
@@ -107,6 +106,7 @@ import {
107
106
  listInstances,
108
107
  loadFromEnv,
109
108
  markVaultLocked,
109
+ onVaultUnlocked,
110
110
  projectKey,
111
111
  registerInstance,
112
112
  restartInstance,
@@ -118,10 +118,29 @@ import {
118
118
  stableEncryptValue,
119
119
  traefikManager,
120
120
  unregisterInstance
121
- } from "./chunk-BHLCBARP.js";
121
+ } from "./chunk-QIBUMYR6.js";
122
122
  import {
123
123
  settingsManager
124
- } from "./chunk-F3HKV5AU.js";
124
+ } from "./chunk-Z67WBWKD.js";
125
+ import {
126
+ env,
127
+ forgetOrgLogo,
128
+ keyRoot,
129
+ legacyMachineFilePath,
130
+ legacyVaultRoot,
131
+ listCloudVaults,
132
+ listOrgVaults,
133
+ machineFilePath,
134
+ machineRoot,
135
+ orgVaultRoot,
136
+ projectVaultRoot,
137
+ readOrgClouds,
138
+ readOrgLogos,
139
+ readOrgNames,
140
+ rememberOrgLogo,
141
+ rememberOrgName,
142
+ stampOrgCloud
143
+ } from "./chunk-KY6KYSOU.js";
125
144
  import {
126
145
  AGENT_LONG_FETCH_TIMEOUT,
127
146
  AGENT_STOP_FETCH_TIMEOUT,
@@ -145,28 +164,14 @@ import {
145
164
  UpdateEnvironmentSchema,
146
165
  VariableOverrideSchema,
147
166
  VariableSchema,
148
- env,
149
- forgetOrgLogo,
167
+ deriveLauncherIdentity,
150
168
  getCollection,
151
- keyRoot,
152
- legacyMachineFilePath,
153
- legacyVaultRoot,
154
- listCloudVaults,
155
- listOrgVaults,
156
- machineFilePath,
157
- machineRoot,
158
169
  nativeParsers,
159
- orgVaultRoot,
160
- projectVaultRoot,
170
+ primaryServiceLink,
161
171
  readEntity,
162
- readOrgClouds,
163
- readOrgLogos,
164
- readOrgNames,
165
- rememberOrgLogo,
166
- rememberOrgName,
167
- stampOrgCloud,
168
172
  writeEntity
169
- } from "./chunk-NDO5VFZY.js";
173
+ } from "./chunk-QRMG6GMX.js";
174
+ import "./chunk-MD3VW4HQ.js";
170
175
 
171
176
  // ../server/src/create-server.ts
172
177
  import express from "express";
@@ -319,8 +324,8 @@ function resolveNpm() {
319
324
  // Unix : node est dans `bin/`, npm sous `lib/node_modules/`.
320
325
  join(nodeDir, "..", "lib", "node_modules", "npm", "bin", "npm-cli.js")
321
326
  ];
322
- for (const cli of candidates) {
323
- if (existsSync(cli)) return { command: process.execPath, args: [cli], shell: false };
327
+ for (const cli2 of candidates) {
328
+ if (existsSync(cli2)) return { command: process.execPath, args: [cli2], shell: false };
324
329
  }
325
330
  return process.platform === "win32" ? { command: "npm.cmd", args: [], shell: true } : { command: "npm", args: [], shell: false };
326
331
  }
@@ -484,6 +489,27 @@ var changelogRouter = router({
484
489
  import { z as z4 } from "zod";
485
490
  import { TRPCError as TRPCError2 } from "@trpc/server";
486
491
 
492
+ // ../server/src/services/current-project.ts
493
+ var current = null;
494
+ var listeners = /* @__PURE__ */ new Set();
495
+ function getCurrentProject() {
496
+ return current;
497
+ }
498
+ function setCurrentProject(next) {
499
+ if (current?.id === next?.id && current?.orgId === next?.orgId) return;
500
+ current = next;
501
+ for (const listener of listeners) {
502
+ try {
503
+ listener();
504
+ } catch {
505
+ }
506
+ }
507
+ }
508
+ function onCurrentProjectChanged(listener) {
509
+ listeners.add(listener);
510
+ return () => listeners.delete(listener);
511
+ }
512
+
487
513
  // ../server/src/services/org-keys.ts
488
514
  import { mkdir } from "fs/promises";
489
515
 
@@ -974,6 +1000,18 @@ var projectRouter = router({
974
1000
  * machine, and the cloud sync pushes projects wholesale — a path stored on the
975
1001
  * project itself would travel with it.
976
1002
  */
1003
+ /**
1004
+ * Le projet que cet onglet regarde.
1005
+ *
1006
+ * Le choix vit dans le navigateur ; le serveur ne le connaîtrait pas sans
1007
+ * cette annonce. Il n'en fait rien de persistant — seule l'icône de barre
1008
+ * système s'en sert, pour montrer les services du projet ouvert plutôt que
1009
+ * ceux de toute la machine.
1010
+ */
1011
+ setCurrent: protectedProcedure.input(z4.object({ id: z4.string().max(128), orgId: z4.string().max(128).nullable().default(null) }).nullable()).mutation(({ input }) => {
1012
+ setCurrentProject(input ? { id: input.id, orgId: input.orgId } : null);
1013
+ return { ok: true };
1014
+ }),
977
1015
  localPaths: protectedProcedure.query(async () => {
978
1016
  return projectPathStore.all();
979
1017
  }),
@@ -1180,7 +1218,93 @@ var agentRouter = router({
1180
1218
 
1181
1219
  // ../server/src/trpc/routers/process.ts
1182
1220
  import { z as z6 } from "zod";
1221
+ import { TRPCError as TRPCError5 } from "@trpc/server";
1222
+
1223
+ // ../server/src/services/process-control.ts
1183
1224
  import { TRPCError as TRPCError4 } from "@trpc/server";
1225
+ async function resolveTarget(processId, fallbackAgentId) {
1226
+ const service = await serviceStore.get(processId) ?? null;
1227
+ const agentId = (service ? await resolveEffectiveAgentId(service) : null) ?? fallbackAgentId ?? null;
1228
+ if (!agentId) {
1229
+ throw new TRPCError4({
1230
+ code: "BAD_REQUEST",
1231
+ message: "No agent assigned to this service. Set an agent on the service or on the active environment."
1232
+ });
1233
+ }
1234
+ return { agentId, service };
1235
+ }
1236
+ async function deployBefore(processId, agentId, service, step) {
1237
+ if (service) {
1238
+ try {
1239
+ const resolved = await resolveServiceVariables(service);
1240
+ await agentManager.agentMutation(agentId, "process.deploy", resolved);
1241
+ } catch (err) {
1242
+ console.debug(`[process-control] Failed to deploy before ${step} for`, processId + ":", err.message);
1243
+ }
1244
+ }
1245
+ if (service?.clearLogsOnStart) {
1246
+ try {
1247
+ await agentManager.agentMutation(agentId, "process.clearLogBuffer", { id: processId });
1248
+ agentManager.emit("process:log", { agentId, batch: [{ processId, __clearLogBuffer: true }] });
1249
+ } catch (err) {
1250
+ console.debug(`[process-control] Failed to clear logs before ${step} for`, processId + ":", err.message);
1251
+ }
1252
+ }
1253
+ }
1254
+ async function startProcess(processId, fallbackAgentId) {
1255
+ const { agentId, service } = await resolveTarget(processId, fallbackAgentId);
1256
+ await deployBefore(processId, agentId, service, "start");
1257
+ let result;
1258
+ try {
1259
+ result = await agentManager.agentMutation(agentId, "process.start", { id: processId });
1260
+ } catch (err) {
1261
+ const err_ = err;
1262
+ const isFetchError = err_?.cause?.code === "ECONNREFUSED" || err_?.message === "fetch failed" || err_?.name === "TypeError";
1263
+ throw new TRPCError4({
1264
+ code: "INTERNAL_SERVER_ERROR",
1265
+ message: isFetchError ? `Cannot reach agent \u2014 make sure the agent is running` : err_?.message ?? "Failed to start process"
1266
+ });
1267
+ }
1268
+ await auditService.log({ userId: "local", action: "start", entityType: "process", entityId: processId, metadata: { agentId } });
1269
+ return { ...result, agentId };
1270
+ }
1271
+ async function stopProcess(processId, agentId) {
1272
+ const result = await agentManager.agentMutation(
1273
+ agentId,
1274
+ "process.stop",
1275
+ { id: processId },
1276
+ AGENT_STOP_FETCH_TIMEOUT
1277
+ );
1278
+ await auditService.log({ userId: "local", action: "stop", entityType: "process", entityId: processId, metadata: { agentId } });
1279
+ return { ...result, agentId };
1280
+ }
1281
+ async function restartProcess(processId, fallbackAgentId) {
1282
+ const { agentId, service } = await resolveTarget(processId, fallbackAgentId);
1283
+ try {
1284
+ await agentManager.agentMutation(agentId, "process.stop", { id: processId }, AGENT_STOP_FETCH_TIMEOUT);
1285
+ } catch (err) {
1286
+ console.debug("[process-control] Stop before restart ignored (process not found on agent?):", err.message);
1287
+ }
1288
+ await deployBefore(processId, agentId, service, "restart");
1289
+ const result = await agentManager.agentMutation(agentId, "process.start", { id: processId });
1290
+ await auditService.log({ userId: "local", action: "restart", entityType: "process", entityId: processId, metadata: { agentId } });
1291
+ return { ...result, agentId };
1292
+ }
1293
+ async function listAllProcesses() {
1294
+ const results = [];
1295
+ await Promise.allSettled(
1296
+ agentManager.listAgents().filter((a) => a.status.connected).map(async (a) => {
1297
+ try {
1298
+ const processes = await agentManager.agentQuery(a.config.id, "process.list");
1299
+ for (const proc of processes) results.push({ ...proc, agentId: a.config.id });
1300
+ } catch {
1301
+ }
1302
+ })
1303
+ );
1304
+ return results;
1305
+ }
1306
+
1307
+ // ../server/src/trpc/routers/process.ts
1184
1308
  var SUBSCRIPTION_QUEUE_MAX2 = LOG_BUFFER_SIZE;
1185
1309
  async function* forwardEvents(eventName, filter) {
1186
1310
  const queue = [];
@@ -1242,28 +1366,13 @@ async function* forwardLogBatches(agentId, processId) {
1242
1366
  }
1243
1367
  var processRouter = router({
1244
1368
  /** List all processes across all connected agents */
1245
- list: protectedProcedure.meta({ openapi: { method: "GET", path: "/processes", tags: ["processes"], summary: "List all processes", protect: true } }).output(z6.any()).query(async () => {
1246
- const agents = agentManager.listAgents();
1247
- const results = [];
1248
- await Promise.allSettled(
1249
- agents.filter((a) => a.status.connected).map(async (a) => {
1250
- try {
1251
- const processes = await agentManager.agentQuery(a.config.id, "process.list");
1252
- for (const proc of processes) {
1253
- results.push({ ...proc, agentId: a.config.id });
1254
- }
1255
- } catch {
1256
- }
1257
- })
1258
- );
1259
- return results;
1260
- }),
1369
+ list: protectedProcedure.meta({ openapi: { method: "GET", path: "/processes", tags: ["processes"], summary: "List all processes", protect: true } }).output(z6.any()).query(() => listAllProcesses()),
1261
1370
  /** Get a single process from a specific agent */
1262
1371
  get: protectedProcedure.meta({ openapi: { method: "GET", path: "/processes/{agentId}/{id}", tags: ["processes"], summary: "Get a process by agent and ID", protect: true } }).input(z6.object({ agentId: z6.string().max(128), id: z6.string().max(128) })).output(z6.any()).query(async ({ input, ctx }) => {
1263
1372
  requireServiceAction(ctx, input.id, "service:read");
1264
1373
  const status = agentManager.getStatus(input.agentId);
1265
1374
  if (!status) {
1266
- throw new TRPCError4({ code: "NOT_FOUND", message: `Agent ${input.agentId} not found` });
1375
+ throw new TRPCError5({ code: "NOT_FOUND", message: `Agent ${input.agentId} not found` });
1267
1376
  }
1268
1377
  const proc = await agentManager.agentQuery(input.agentId, "process.get", { id: input.id });
1269
1378
  return { ...proc, agentId: input.agentId };
@@ -1275,82 +1384,19 @@ var processRouter = router({
1275
1384
  * The deploy call is idempotent — creates the process if missing, updates config if it exists. */
1276
1385
  start: protectedProcedure.meta({ openapi: { method: "POST", path: "/processes/{agentId}/{processId}/start", tags: ["processes"], summary: "Start a process", protect: true } }).input(z6.object({ agentId: z6.string().max(128).optional(), processId: z6.string().max(128) })).output(z6.any()).mutation(async ({ input, ctx }) => {
1277
1386
  requireServiceAction(ctx, input.processId, "service:start");
1278
- const service = await serviceStore.get(input.processId);
1279
- const effectiveAgentId = (service ? await resolveEffectiveAgentId(service) : null) ?? input.agentId ?? null;
1280
- if (!effectiveAgentId) {
1281
- throw new TRPCError4({ code: "BAD_REQUEST", message: "No agent assigned to this service. Set an agent on the service or on the active environment." });
1282
- }
1283
- if (service) {
1284
- try {
1285
- const resolved = await resolveServiceVariables(service);
1286
- await agentManager.agentMutation(effectiveAgentId, "process.deploy", resolved);
1287
- } catch (err) {
1288
- console.debug("[process-router] Failed to deploy before start for", input.processId + ":", err.message);
1289
- }
1290
- }
1291
- if (service?.clearLogsOnStart) {
1292
- try {
1293
- await agentManager.agentMutation(effectiveAgentId, "process.clearLogBuffer", { id: input.processId });
1294
- agentManager.emit("process:log", { agentId: effectiveAgentId, batch: [{ processId: input.processId, __clearLogBuffer: true }] });
1295
- } catch (err) {
1296
- console.debug("[process-router] Failed to clear logs before start for", input.processId + ":", err.message);
1297
- }
1298
- }
1299
- let result;
1300
- try {
1301
- result = await agentManager.agentMutation(effectiveAgentId, "process.start", { id: input.processId });
1302
- } catch (err) {
1303
- const err_ = err;
1304
- const isFetchError = err_?.cause?.code === "ECONNREFUSED" || err_?.message === "fetch failed" || err_?.name === "TypeError";
1305
- throw new TRPCError4({
1306
- code: "INTERNAL_SERVER_ERROR",
1307
- message: isFetchError ? `Cannot reach agent \u2014 make sure the agent is running` : err_?.message ?? "Failed to start process"
1308
- });
1309
- }
1310
- await auditService.log({ userId: "local", action: "start", entityType: "process", entityId: input.processId, metadata: { agentId: effectiveAgentId } });
1311
- return { ...result, agentId: effectiveAgentId };
1387
+ return startProcess(input.processId, input.agentId);
1312
1388
  }),
1313
1389
  /** Stop a process on an agent */
1314
1390
  stop: protectedProcedure.meta({ openapi: { method: "POST", path: "/processes/{agentId}/{processId}/stop", tags: ["processes"], summary: "Stop a process", protect: true } }).input(z6.object({ agentId: z6.string().max(128), processId: z6.string().max(128) })).output(z6.any()).mutation(async ({ input, ctx }) => {
1315
1391
  requireServiceAction(ctx, input.processId, "service:stop");
1316
- const result = await agentManager.agentMutation(input.agentId, "process.stop", { id: input.processId }, AGENT_STOP_FETCH_TIMEOUT);
1317
- await auditService.log({ userId: "local", action: "stop", entityType: "process", entityId: input.processId, metadata: { agentId: input.agentId } });
1318
- return { ...result, agentId: input.agentId };
1392
+ return stopProcess(input.processId, input.agentId);
1319
1393
  }),
1320
1394
  /** Restart a process on an agent.
1321
1395
  * Sends stop → deploy (latest resolved config) → start so that
1322
1396
  * config/variable changes take effect. Same lazy deploy pattern as start. */
1323
1397
  restart: protectedProcedure.meta({ openapi: { method: "POST", path: "/processes/{agentId}/{processId}/restart", tags: ["processes"], summary: "Restart a process", protect: true } }).input(z6.object({ agentId: z6.string().max(128).optional(), processId: z6.string().max(128) })).output(z6.any()).mutation(async ({ input, ctx }) => {
1324
1398
  requireServiceAction(ctx, input.processId, "service:restart");
1325
- const service = await serviceStore.get(input.processId);
1326
- const effectiveAgentId = (service ? await resolveEffectiveAgentId(service) : null) ?? input.agentId ?? null;
1327
- if (!effectiveAgentId) {
1328
- throw new TRPCError4({ code: "BAD_REQUEST", message: "No agent assigned to this service. Set an agent on the service or on the active environment." });
1329
- }
1330
- try {
1331
- await agentManager.agentMutation(effectiveAgentId, "process.stop", { id: input.processId }, AGENT_STOP_FETCH_TIMEOUT);
1332
- } catch (err) {
1333
- console.debug("[process-router] Stop before restart ignored (process not found on agent?):", err.message);
1334
- }
1335
- if (service) {
1336
- try {
1337
- const resolved = await resolveServiceVariables(service);
1338
- await agentManager.agentMutation(effectiveAgentId, "process.deploy", resolved);
1339
- } catch (err) {
1340
- console.debug("[process-router] Failed to deploy before restart for", input.processId + ":", err.message);
1341
- }
1342
- }
1343
- if (service?.clearLogsOnStart) {
1344
- try {
1345
- await agentManager.agentMutation(effectiveAgentId, "process.clearLogBuffer", { id: input.processId });
1346
- agentManager.emit("process:log", { agentId: effectiveAgentId, batch: [{ processId: input.processId, __clearLogBuffer: true }] });
1347
- } catch (err) {
1348
- console.debug("[process-router] Failed to clear logs before restart for", input.processId + ":", err.message);
1349
- }
1350
- }
1351
- const result = await agentManager.agentMutation(effectiveAgentId, "process.start", { id: input.processId });
1352
- await auditService.log({ userId: "local", action: "restart", entityType: "process", entityId: input.processId, metadata: { agentId: effectiveAgentId } });
1353
- return { ...result, agentId: effectiveAgentId };
1399
+ return restartProcess(input.processId, input.agentId);
1354
1400
  }),
1355
1401
  /** Get buffered logs for a process from an agent */
1356
1402
  logs: protectedProcedure.meta({ openapi: { method: "GET", path: "/processes/{agentId}/{processId}/logs", tags: ["processes"], summary: "Get buffered logs for a process", protect: true } }).input(z6.object({ agentId: z6.string().max(128), processId: z6.string().max(128) })).output(z6.any()).query(async ({ input, ctx }) => {
@@ -1680,7 +1726,7 @@ var setupRouter = router({
1680
1726
 
1681
1727
  // ../server/src/trpc/routers/environment.ts
1682
1728
  import { z as z9 } from "zod";
1683
- import { TRPCError as TRPCError5 } from "@trpc/server";
1729
+ import { TRPCError as TRPCError6 } from "@trpc/server";
1684
1730
  var environmentRouter = router({
1685
1731
  list: protectedProcedure.input(z9.object({
1686
1732
  projectId: z9.string().max(128),
@@ -1690,7 +1736,7 @@ var environmentRouter = router({
1690
1736
  }),
1691
1737
  get: protectedProcedure.input(z9.object({ id: z9.string().max(128) })).query(async ({ input }) => {
1692
1738
  const env2 = await environmentStore.get(input.id);
1693
- if (!env2) throw new TRPCError5({ code: "NOT_FOUND", message: `Environment ${input.id} not found` });
1739
+ if (!env2) throw new TRPCError6({ code: "NOT_FOUND", message: `Environment ${input.id} not found` });
1694
1740
  return env2;
1695
1741
  }),
1696
1742
  listByScope: protectedProcedure.input(z9.object({
@@ -1740,9 +1786,9 @@ var environmentRouter = router({
1740
1786
  }),
1741
1787
  update: protectedProcedure.input(UpdateEnvironmentSchema).mutation(async ({ input }) => {
1742
1788
  const existing = await environmentStore.get(input.id);
1743
- if (!existing) throw new TRPCError5({ code: "NOT_FOUND", message: `Environment ${input.id} not found` });
1789
+ if (!existing) throw new TRPCError6({ code: "NOT_FOUND", message: `Environment ${input.id} not found` });
1744
1790
  const env2 = await environmentStore.update(input);
1745
- if (!env2) throw new TRPCError5({ code: "NOT_FOUND", message: `Environment ${input.id} not found` });
1791
+ if (!env2) throw new TRPCError6({ code: "NOT_FOUND", message: `Environment ${input.id} not found` });
1746
1792
  if (env2.scope === "global" && input.name && input.name !== existing.name) {
1747
1793
  const project = await projectStore.get(environmentStore.projectRefOf(env2) ?? env2.projectId);
1748
1794
  if (project) {
@@ -1758,22 +1804,22 @@ var environmentRouter = router({
1758
1804
  }),
1759
1805
  delete: protectedProcedure.input(z9.object({ id: z9.string().max(128) })).mutation(async ({ input }) => {
1760
1806
  const env2 = await environmentStore.get(input.id);
1761
- if (!env2) throw new TRPCError5({ code: "NOT_FOUND", message: `Environment ${input.id} not found` });
1807
+ if (!env2) throw new TRPCError6({ code: "NOT_FOUND", message: `Environment ${input.id} not found` });
1762
1808
  if (env2.immutable) {
1763
- throw new TRPCError5({ code: "FORBIDDEN", message: "Cannot delete immutable environment" });
1809
+ throw new TRPCError6({ code: "FORBIDDEN", message: "Cannot delete immutable environment" });
1764
1810
  }
1765
1811
  if (env2.scope === "global") {
1766
1812
  await environmentStore.deleteByActivateOn(input.id);
1767
1813
  }
1768
1814
  const deleted = await environmentStore.delete(input.id);
1769
- if (!deleted) throw new TRPCError5({ code: "INTERNAL_SERVER_ERROR", message: "Failed to delete environment" });
1815
+ if (!deleted) throw new TRPCError6({ code: "INTERNAL_SERVER_ERROR", message: "Failed to delete environment" });
1770
1816
  await projectStore.removeEnvironment(environmentStore.projectRefOf(env2) ?? env2.projectId, input.id);
1771
1817
  return { success: true };
1772
1818
  }),
1773
1819
  resolve: protectedProcedure.input(z9.object({ environmentId: z9.string().max(128) })).query(async ({ input, ctx }) => {
1774
1820
  const { includeSecrets } = requireEnvAction(ctx, input.environmentId, "env:read");
1775
1821
  const env2 = await environmentStore.get(input.environmentId);
1776
- if (!env2) throw new TRPCError5({ code: "NOT_FOUND", message: `Environment ${input.environmentId} not found` });
1822
+ if (!env2) throw new TRPCError6({ code: "NOT_FOUND", message: `Environment ${input.environmentId} not found` });
1777
1823
  const resolved = await environmentResolver.resolveEnvironmentWithSources(input.environmentId);
1778
1824
  if (!includeSecrets) {
1779
1825
  const sanitized = { ...resolved };
@@ -1792,7 +1838,7 @@ var environmentRouter = router({
1792
1838
  resolveFlat: protectedProcedure.meta({ openapi: { method: "GET", path: "/environments/{environmentId}/resolve-flat", tags: ["environments"], summary: "Resolve environment variables as a flat key-value map", protect: true } }).input(z9.object({ environmentId: z9.string().max(128) })).output(z9.record(z9.string(), z9.string())).query(async ({ input, ctx }) => {
1793
1839
  const { includeSecrets } = requireEnvAction(ctx, input.environmentId, "env:read");
1794
1840
  const env2 = await environmentStore.get(input.environmentId);
1795
- if (!env2) throw new TRPCError5({ code: "NOT_FOUND", message: `Environment ${input.environmentId} not found` });
1841
+ if (!env2) throw new TRPCError6({ code: "NOT_FOUND", message: `Environment ${input.environmentId} not found` });
1796
1842
  const { env: resolved, envSecrets } = await environmentResolver.resolveEnvironment(input.environmentId);
1797
1843
  const result = {};
1798
1844
  for (const [key, value] of Object.entries(resolved)) {
@@ -1830,9 +1876,9 @@ var environmentRouter = router({
1830
1876
  })).mutation(async ({ input, ctx }) => {
1831
1877
  requireEnvAction(ctx, input.environmentId, "env:write");
1832
1878
  const env2 = await environmentStore.get(input.environmentId);
1833
- if (!env2) throw new TRPCError5({ code: "NOT_FOUND", message: `Environment ${input.environmentId} not found` });
1879
+ if (!env2) throw new TRPCError6({ code: "NOT_FOUND", message: `Environment ${input.environmentId} not found` });
1834
1880
  const result = await environmentStore.upsertVariable(input.environmentId, input.variableId, input.variable);
1835
- if (!result) throw new TRPCError5({ code: "INTERNAL_SERVER_ERROR", message: "Failed to update variable" });
1881
+ if (!result) throw new TRPCError6({ code: "INTERNAL_SERVER_ERROR", message: "Failed to update variable" });
1836
1882
  return result;
1837
1883
  }),
1838
1884
  /**
@@ -1907,9 +1953,9 @@ var environmentRouter = router({
1907
1953
  variableId: z9.string().max(128)
1908
1954
  })).mutation(async ({ input }) => {
1909
1955
  const env2 = await environmentStore.get(input.environmentId);
1910
- if (!env2) throw new TRPCError5({ code: "NOT_FOUND", message: `Environment ${input.environmentId} not found` });
1956
+ if (!env2) throw new TRPCError6({ code: "NOT_FOUND", message: `Environment ${input.environmentId} not found` });
1911
1957
  const result = await environmentStore.removeVariable(input.environmentId, input.variableId);
1912
- if (!result) throw new TRPCError5({ code: "INTERNAL_SERVER_ERROR", message: "Failed to remove variable" });
1958
+ if (!result) throw new TRPCError6({ code: "INTERNAL_SERVER_ERROR", message: "Failed to remove variable" });
1913
1959
  return result;
1914
1960
  })
1915
1961
  });
@@ -1917,7 +1963,7 @@ var environmentRouter = router({
1917
1963
  // ../server/src/trpc/routers/settings.ts
1918
1964
  import { promises as dns } from "dns";
1919
1965
  import { z as z10 } from "zod";
1920
- import { TRPCError as TRPCError6 } from "@trpc/server";
1966
+ import { TRPCError as TRPCError7 } from "@trpc/server";
1921
1967
  var NotificationPreferencesPatchSchema = NotificationPreferencesSchema.partial().strict();
1922
1968
  function listWithOrigin(parsers, vault) {
1923
1969
  return [
@@ -1973,7 +2019,7 @@ var settingsRouter = router({
1973
2019
  try {
1974
2020
  return await setLanMode(input.enabled);
1975
2021
  } catch (err) {
1976
- throw new TRPCError6({
2022
+ throw new TRPCError7({
1977
2023
  code: "INTERNAL_SERVER_ERROR",
1978
2024
  message: `Impossible de changer l'adresse d'\xE9coute : ${err.message}`
1979
2025
  });
@@ -1983,9 +2029,9 @@ var settingsRouter = router({
1983
2029
  * Update settings (mode, cloudUrl)
1984
2030
  */
1985
2031
  update: protectedProcedure.input(SettingsSchema.pick({ mode: true, cloudUrl: true, globalDocsPath: true }).partial()).mutation(async ({ input }) => {
1986
- const current = await settingsManager.getSettings();
2032
+ const current2 = await settingsManager.getSettings();
1987
2033
  const updated = {
1988
- ...current,
2034
+ ...current2,
1989
2035
  ...input
1990
2036
  };
1991
2037
  await settingsManager.saveSettings(updated);
@@ -2075,7 +2121,7 @@ var settingsRouter = router({
2075
2121
  getParser: protectedProcedure.input(z10.object({ id: z10.string().max(128), ...ScopeShape })).query(async ({ input }) => {
2076
2122
  const parser = await logParserStore.get(input.id, await scopeOf(input));
2077
2123
  if (!parser) {
2078
- throw new TRPCError6({ code: "NOT_FOUND", message: `Parser not found: ${input.id}` });
2124
+ throw new TRPCError7({ code: "NOT_FOUND", message: `Parser not found: ${input.id}` });
2079
2125
  }
2080
2126
  return parser;
2081
2127
  }),
@@ -2091,7 +2137,7 @@ var settingsRouter = router({
2091
2137
  ).mutation(async ({ input }) => {
2092
2138
  const { orgId, projectId, ...fields } = input;
2093
2139
  if (!fields.code.trim()) {
2094
- throw new TRPCError6({ code: "BAD_REQUEST", message: "Parser code cannot be empty" });
2140
+ throw new TRPCError7({ code: "BAD_REQUEST", message: "Parser code cannot be empty" });
2095
2141
  }
2096
2142
  return logParserStore.create(fields, await scopeOf({ orgId, projectId }));
2097
2143
  }),
@@ -2106,14 +2152,14 @@ var settingsRouter = router({
2106
2152
  ).mutation(async ({ input }) => {
2107
2153
  const { id, orgId, projectId, ...patch } = input;
2108
2154
  if (id.startsWith("native:")) {
2109
- throw new TRPCError6({ code: "FORBIDDEN", message: "Cannot modify built-in parsers" });
2155
+ throw new TRPCError7({ code: "FORBIDDEN", message: "Cannot modify built-in parsers" });
2110
2156
  }
2111
2157
  if (patch.code !== void 0 && !patch.code.trim()) {
2112
- throw new TRPCError6({ code: "BAD_REQUEST", message: "Parser code cannot be empty" });
2158
+ throw new TRPCError7({ code: "BAD_REQUEST", message: "Parser code cannot be empty" });
2113
2159
  }
2114
2160
  const updated = await logParserStore.update(id, patch, await scopeOf({ orgId, projectId }));
2115
2161
  if (!updated) {
2116
- throw new TRPCError6({ code: "NOT_FOUND", message: `Parser not found: ${id}` });
2162
+ throw new TRPCError7({ code: "NOT_FOUND", message: `Parser not found: ${id}` });
2117
2163
  }
2118
2164
  return updated;
2119
2165
  }),
@@ -2122,11 +2168,11 @@ var settingsRouter = router({
2122
2168
  */
2123
2169
  deleteParser: protectedProcedure.input(z10.object({ id: z10.string().max(128), ...ScopeShape })).mutation(async ({ input }) => {
2124
2170
  if (input.id.startsWith("native:")) {
2125
- throw new TRPCError6({ code: "FORBIDDEN", message: "Cannot delete built-in parsers" });
2171
+ throw new TRPCError7({ code: "FORBIDDEN", message: "Cannot delete built-in parsers" });
2126
2172
  }
2127
2173
  const deleted = await logParserStore.delete(input.id, await scopeOf(input));
2128
2174
  if (!deleted) {
2129
- throw new TRPCError6({ code: "NOT_FOUND", message: `Parser not found: ${input.id}` });
2175
+ throw new TRPCError7({ code: "NOT_FOUND", message: `Parser not found: ${input.id}` });
2130
2176
  }
2131
2177
  return { deleted: true };
2132
2178
  }),
@@ -2165,15 +2211,15 @@ var settingsRouter = router({
2165
2211
  prompt: z10.string().max(2e4).optional()
2166
2212
  })).mutation(async ({ input }) => {
2167
2213
  const settings = await settingsManager.getSettings();
2168
- const current = settings.companion ?? { enabledByDefault: false };
2214
+ const current2 = settings.companion ?? { enabledByDefault: false };
2169
2215
  const prompt = input.prompt?.trim();
2170
2216
  await settingsManager.saveSettings({
2171
2217
  ...settings,
2172
2218
  companion: {
2173
- enabledByDefault: input.enabledByDefault ?? current.enabledByDefault ?? false,
2219
+ enabledByDefault: input.enabledByDefault ?? current2.enabledByDefault ?? false,
2174
2220
  // Vide = « celles de Runeya » : on efface le réglage plutôt que d'y
2175
2221
  // ranger une chaîne vide qui signifierait « aucune consigne ».
2176
- ...input.prompt === void 0 ? current.prompt ? { prompt: current.prompt } : {} : prompt ? { prompt } : {}
2222
+ ...input.prompt === void 0 ? current2.prompt ? { prompt: current2.prompt } : {} : prompt ? { prompt } : {}
2177
2223
  }
2178
2224
  });
2179
2225
  return { ok: true };
@@ -2208,7 +2254,7 @@ var settingsRouter = router({
2208
2254
  ...ScopeShape
2209
2255
  })).mutation(async ({ input }) => {
2210
2256
  if (input.provider !== "ollama" && !input.apiKey?.trim()) {
2211
- throw new TRPCError6({ code: "BAD_REQUEST", message: "Une cl\xE9 API est requise pour ce provider." });
2257
+ throw new TRPCError7({ code: "BAD_REQUEST", message: "Une cl\xE9 API est requise pour ce provider." });
2212
2258
  }
2213
2259
  const vault = await scopeOf(input);
2214
2260
  const priv = await settingsManager.getPrivateSettings(vault);
@@ -2249,7 +2295,7 @@ var settingsRouter = router({
2249
2295
  const priv = await settingsManager.getPrivateSettings(vault);
2250
2296
  const providers = priv.aiProviders ?? [];
2251
2297
  const idx = providers.findIndex((p) => p.id === input.id);
2252
- if (idx === -1) throw new TRPCError6({ code: "NOT_FOUND", message: `AI provider not found: ${input.id}` });
2298
+ if (idx === -1) throw new TRPCError7({ code: "NOT_FOUND", message: `AI provider not found: ${input.id}` });
2253
2299
  const existing = providers[idx];
2254
2300
  const encryptedApiKey = input.apiKey ? stableEncryptValue(input.apiKey, existing.encryptedApiKey, vault) : existing.encryptedApiKey;
2255
2301
  const updated = {
@@ -2280,7 +2326,7 @@ var settingsRouter = router({
2280
2326
  const priv = await settingsManager.getPrivateSettings(vault);
2281
2327
  const providers = priv.aiProviders ?? [];
2282
2328
  const filtered = providers.filter((p) => p.id !== input.id);
2283
- if (filtered.length === providers.length) throw new TRPCError6({ code: "NOT_FOUND", message: `AI provider not found: ${input.id}` });
2329
+ if (filtered.length === providers.length) throw new TRPCError7({ code: "NOT_FOUND", message: `AI provider not found: ${input.id}` });
2284
2330
  const deletedWasActive = providers.find((p) => p.id === input.id)?.active ?? false;
2285
2331
  if (deletedWasActive && filtered.length > 0) filtered[0].active = true;
2286
2332
  await settingsManager.savePrivateSettings({ ...priv, aiProviders: filtered }, vault);
@@ -2294,7 +2340,7 @@ var settingsRouter = router({
2294
2340
  const priv = await settingsManager.getPrivateSettings(vault);
2295
2341
  const providers = priv.aiProviders ?? [];
2296
2342
  const idx = providers.findIndex((p) => p.id === input.id);
2297
- if (idx === -1) throw new TRPCError6({ code: "NOT_FOUND", message: `AI provider not found: ${input.id}` });
2343
+ if (idx === -1) throw new TRPCError7({ code: "NOT_FOUND", message: `AI provider not found: ${input.id}` });
2298
2344
  const updated = providers.map((p) => ({ ...p, active: p.id === input.id }));
2299
2345
  await settingsManager.savePrivateSettings({ ...priv, aiProviders: updated }, vault);
2300
2346
  return { id: input.id, active: true };
@@ -2416,7 +2462,7 @@ var settingsRouter = router({
2416
2462
  const raw = agentStore.getTraefikConfig(input.agentId);
2417
2463
  const parsed = raw ? TraefikConfigSchema.safeParse(raw) : null;
2418
2464
  const config = parsed?.success ? parsed.data : null;
2419
- if (!config?.enabled) throw new TRPCError6({ code: "BAD_REQUEST", message: "Traefik non activ\xE9 sur cet agent" });
2465
+ if (!config?.enabled) throw new TRPCError7({ code: "BAD_REQUEST", message: "Traefik non activ\xE9 sur cet agent" });
2420
2466
  const decrypted = { ...config, dnsCredentials: traefikManager.decryptDnsCredentials(config.dnsCredentials ?? {}) };
2421
2467
  await agentManager.agentMutation(input.agentId, "config.initTraefikConfig", decrypted, 5e3);
2422
2468
  await agentManager.agentMutation(input.agentId, "config.restartTraefik", void 0, 3e4);
@@ -2429,7 +2475,7 @@ var settingsRouter = router({
2429
2475
  const raw = agentStore.getTraefikConfig(input.agentId);
2430
2476
  const parsed = raw ? TraefikConfigSchema.safeParse(raw) : null;
2431
2477
  const config = parsed?.success ? parsed.data : null;
2432
- if (!config?.enabled) throw new TRPCError6({ code: "BAD_REQUEST", message: "Traefik non activ\xE9 sur cet agent" });
2478
+ if (!config?.enabled) throw new TRPCError7({ code: "BAD_REQUEST", message: "Traefik non activ\xE9 sur cet agent" });
2433
2479
  const decrypted = { ...config, dnsCredentials: traefikManager.decryptDnsCredentials(config.dnsCredentials ?? {}) };
2434
2480
  await agentManager.agentMutation(input.agentId, "config.initTraefikConfig", decrypted, 5e3);
2435
2481
  await agentManager.agentMutation(input.agentId, "config.renewTraefikCert", void 0, 3e4);
@@ -2561,7 +2607,7 @@ var settingsRouter = router({
2561
2607
  updatedAt: /* @__PURE__ */ new Date()
2562
2608
  }]);
2563
2609
  } catch (err) {
2564
- throw new TRPCError6({
2610
+ throw new TRPCError7({
2565
2611
  code: "BAD_REQUEST",
2566
2612
  message: err instanceof Error ? err.message : String(err)
2567
2613
  });
@@ -2590,7 +2636,7 @@ var settingsRouter = router({
2590
2636
 
2591
2637
  // ../server/src/trpc/routers/editor.ts
2592
2638
  import { z as z12 } from "zod";
2593
- import { TRPCError as TRPCError7 } from "@trpc/server";
2639
+ import { TRPCError as TRPCError8 } from "@trpc/server";
2594
2640
  import { execFile as execFile3, spawn as spawn2 } from "child_process";
2595
2641
  import { stat as stat2 } from "fs/promises";
2596
2642
  import { resolve, join as join4 } from "path";
@@ -2683,7 +2729,7 @@ async function getServiceCwd(serviceId) {
2683
2729
  const services = await serviceStore.list();
2684
2730
  const service = services.find((s) => s.id === serviceId);
2685
2731
  if (!service) {
2686
- throw new TRPCError7({ code: "NOT_FOUND", message: "Service not found" });
2732
+ throw new TRPCError8({ code: "NOT_FOUND", message: "Service not found" });
2687
2733
  }
2688
2734
  return resolveCwd(await resolveWorkspaceCwd({ serviceId }));
2689
2735
  }
@@ -2716,7 +2762,7 @@ var editorRouter = router({
2716
2762
  editorKey: z12.string().max(64)
2717
2763
  })).mutation(async ({ input }) => {
2718
2764
  if (!EDITOR_BY_KEY.has(input.editorKey)) {
2719
- throw new TRPCError7({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2765
+ throw new TRPCError8({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2720
2766
  }
2721
2767
  await userConfigManager.setEditorPreference(
2722
2768
  { id: input.projectId, orgId: input.orgId },
@@ -2732,7 +2778,7 @@ var editorRouter = router({
2732
2778
  editorKey: z12.string().max(64)
2733
2779
  })).mutation(async ({ input }) => {
2734
2780
  if (!EDITOR_BY_KEY.has(input.editorKey)) {
2735
- throw new TRPCError7({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2781
+ throw new TRPCError8({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2736
2782
  }
2737
2783
  await userConfigManager.setEditorPreference(
2738
2784
  { id: input.projectId, orgId: input.orgId },
@@ -2758,15 +2804,15 @@ var editorRouter = router({
2758
2804
  })).mutation(async ({ input }) => {
2759
2805
  const editor = EDITOR_BY_KEY.get(input.editorKey);
2760
2806
  if (!editor) {
2761
- throw new TRPCError7({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2807
+ throw new TRPCError8({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2762
2808
  }
2763
2809
  const expanded = input.path.replace(/^~(\/|$)/, `${process.env["HOME"] ?? "/tmp"}$1`).replace(/\$\{(\w+)\}|\$(\w+)/g, (_, a, b) => process.env[a || b] ?? "");
2764
2810
  const resolvedPath = resolve(expanded || ".");
2765
2811
  try {
2766
2812
  await stat2(resolvedPath);
2767
2813
  } catch (err) {
2768
- if (err instanceof TRPCError7) throw err;
2769
- throw new TRPCError7({ code: "BAD_REQUEST", message: `Path does not exist: ${resolvedPath}` });
2814
+ if (err instanceof TRPCError8) throw err;
2815
+ throw new TRPCError8({ code: "BAD_REQUEST", message: `Path does not exist: ${resolvedPath}` });
2770
2816
  }
2771
2817
  const invocation = resolveCliInvocation(editor.command, [resolvedPath]);
2772
2818
  const child = spawn2(invocation.command, invocation.args, {
@@ -2785,17 +2831,17 @@ var editorRouter = router({
2785
2831
  })).mutation(async ({ input }) => {
2786
2832
  const editor = EDITOR_BY_KEY.get(input.editorKey);
2787
2833
  if (!editor) {
2788
- throw new TRPCError7({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2834
+ throw new TRPCError8({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2789
2835
  }
2790
2836
  const cwd = await getServiceCwd(input.serviceId);
2791
2837
  const filePath = join4(cwd, input.relativePath);
2792
2838
  if (!filePath.startsWith(cwd)) {
2793
- throw new TRPCError7({ code: "BAD_REQUEST", message: "Path traversal not allowed" });
2839
+ throw new TRPCError8({ code: "BAD_REQUEST", message: "Path traversal not allowed" });
2794
2840
  }
2795
2841
  try {
2796
2842
  await stat2(filePath);
2797
2843
  } catch {
2798
- throw new TRPCError7({ code: "BAD_REQUEST", message: `File does not exist: ${filePath}` });
2844
+ throw new TRPCError8({ code: "BAD_REQUEST", message: `File does not exist: ${filePath}` });
2799
2845
  }
2800
2846
  const invocation = resolveCliInvocation(editor.command, [filePath]);
2801
2847
  const child = spawn2(invocation.command, invocation.args, {
@@ -2811,7 +2857,7 @@ var editorRouter = router({
2811
2857
 
2812
2858
  // ../server/src/trpc/routers/api-keys.ts
2813
2859
  import { z as z13 } from "zod";
2814
- import { TRPCError as TRPCError8 } from "@trpc/server";
2860
+ import { TRPCError as TRPCError9 } from "@trpc/server";
2815
2861
  import { mkdir as mkdir3, writeFile as writeFile3 } from "fs/promises";
2816
2862
  import { join as join5, dirname as dirname2 } from "path";
2817
2863
  var ALLOWED_SKILL_PATHS = /* @__PURE__ */ new Set([
@@ -2835,22 +2881,22 @@ var apiKeysRouter = router({
2835
2881
  */
2836
2882
  reveal: protectedProcedure.input(z13.object({ id: z13.string().max(128) })).query(async ({ input }) => {
2837
2883
  const key = await apiKeyStore.reveal(input.id);
2838
- if (!key) throw new TRPCError8({ code: "NOT_FOUND", message: "API key not found" });
2884
+ if (!key) throw new TRPCError9({ code: "NOT_FOUND", message: "API key not found" });
2839
2885
  return { key };
2840
2886
  }),
2841
2887
  update: protectedProcedure.input(KeyInputSchema.extend({ id: z13.string().max(128) })).mutation(async ({ input }) => {
2842
2888
  const updated = await apiKeyStore.update(input.id, input.name, input.scopes, input.isPublic);
2843
- if (!updated) throw new TRPCError8({ code: "NOT_FOUND", message: "API key not found" });
2889
+ if (!updated) throw new TRPCError9({ code: "NOT_FOUND", message: "API key not found" });
2844
2890
  return maskApiKey(updated);
2845
2891
  }),
2846
2892
  remove: protectedProcedure.input(z13.object({ id: z13.string().max(128) })).mutation(async ({ input }) => {
2847
2893
  const removed = await apiKeyStore.remove(input.id);
2848
- if (!removed) throw new TRPCError8({ code: "NOT_FOUND", message: "API key not found" });
2894
+ if (!removed) throw new TRPCError9({ code: "NOT_FOUND", message: "API key not found" });
2849
2895
  return { success: true };
2850
2896
  }),
2851
2897
  renewKey: protectedProcedure.input(z13.object({ id: z13.string().max(128) })).mutation(async ({ input }) => {
2852
2898
  const renewed = await apiKeyStore.renewKey(input.id);
2853
- if (!renewed) throw new TRPCError8({ code: "NOT_FOUND", message: "API key not found" });
2899
+ if (!renewed) throw new TRPCError9({ code: "NOT_FOUND", message: "API key not found" });
2854
2900
  return renewed;
2855
2901
  }),
2856
2902
  writeSkillFile: protectedProcedure.input(z13.object({
@@ -2858,7 +2904,7 @@ var apiKeysRouter = router({
2858
2904
  content: z13.string().max(32768)
2859
2905
  })).mutation(async ({ input }) => {
2860
2906
  if (!ALLOWED_SKILL_PATHS.has(input.relativePath)) {
2861
- throw new TRPCError8({ code: "BAD_REQUEST", message: "Chemin non autoris\xE9" });
2907
+ throw new TRPCError9({ code: "BAD_REQUEST", message: "Chemin non autoris\xE9" });
2862
2908
  }
2863
2909
  const abs = join5(await resolveWorkspaceCwd({}), input.relativePath);
2864
2910
  await mkdir3(dirname2(abs), { recursive: true });
@@ -2869,7 +2915,7 @@ var apiKeysRouter = router({
2869
2915
 
2870
2916
  // ../server/src/trpc/routers/git.ts
2871
2917
  import { z as z14 } from "zod";
2872
- import { TRPCError as TRPCError9 } from "@trpc/server";
2918
+ import { TRPCError as TRPCError10 } from "@trpc/server";
2873
2919
  import Anthropic from "@anthropic-ai/sdk";
2874
2920
  import OpenAI from "openai";
2875
2921
  var SERVICE_ID_SCHEMA = z14.string().max(128);
@@ -2881,11 +2927,11 @@ var BRANCH_SCHEMA = z14.string().min(1).max(256).regex(/^[a-zA-Z0-9._\-/]+$/);
2881
2927
  async function resolveServiceContext(serviceId) {
2882
2928
  const service = await serviceStore.get(serviceId);
2883
2929
  if (!service) {
2884
- throw new TRPCError9({ code: "NOT_FOUND", message: "Service not found" });
2930
+ throw new TRPCError10({ code: "NOT_FOUND", message: "Service not found" });
2885
2931
  }
2886
2932
  const agentId = await resolveEffectiveAgentId(service);
2887
2933
  if (!agentId) {
2888
- throw new TRPCError9({ code: "BAD_REQUEST", message: "No agent configured for this service" });
2934
+ throw new TRPCError10({ code: "BAD_REQUEST", message: "No agent configured for this service" });
2889
2935
  }
2890
2936
  return { agentId, cwd: await resolveWorkspaceCwd({ serviceId }) };
2891
2937
  }
@@ -2901,7 +2947,7 @@ async function resolveGitContext(input) {
2901
2947
  if (input.serviceId) return resolveServiceContext(input.serviceId);
2902
2948
  const agentId = input.agentId ?? agentManager.getDefaultAgentId();
2903
2949
  if (!agentId) {
2904
- throw new TRPCError9({ code: "BAD_REQUEST", message: "No agent available" });
2950
+ throw new TRPCError10({ code: "BAD_REQUEST", message: "No agent available" });
2905
2951
  }
2906
2952
  const cwd = await resolveAgentCwd({ projectId: input.projectId, orgId: input.orgId }) ?? ".";
2907
2953
  return { agentId, cwd };
@@ -2987,14 +3033,14 @@ var gitRouter = router({
2987
3033
  const { agentId, cwd } = await resolveGitContext(input);
2988
3034
  const { diff } = await agentManager.agentQuery(agentId, "git.stagedDiff", { cwd });
2989
3035
  if (!diff.trim()) {
2990
- throw new TRPCError9({ code: "BAD_REQUEST", message: "No staged changes to generate a commit message from" });
3036
+ throw new TRPCError10({ code: "BAD_REQUEST", message: "No staged changes to generate a commit message from" });
2991
3037
  }
2992
3038
  const active = await getActiveProvider(
2993
3039
  input.providerId,
2994
3040
  input.orgId ?? await vaultOfProject(input.projectId)
2995
3041
  );
2996
3042
  if (!active) {
2997
- throw new TRPCError9({ code: "BAD_REQUEST", message: "No AI provider configured" });
3043
+ throw new TRPCError10({ code: "BAD_REQUEST", message: "No AI provider configured" });
2998
3044
  }
2999
3045
  const systemPrompt = `You are a git commit message generator. Given a git diff, write a concise and meaningful conventional commit message (e.g. feat:, fix:, refactor:, chore:, docs:, style:, test:).
3000
3046
  Rules:
@@ -3027,7 +3073,7 @@ Rules:
3027
3073
  });
3028
3074
  return { message: res.choices[0]?.message?.content?.trim() ?? "" };
3029
3075
  }
3030
- throw new TRPCError9({ code: "BAD_REQUEST", message: "Unsupported AI provider" });
3076
+ throw new TRPCError10({ code: "BAD_REQUEST", message: "Unsupported AI provider" });
3031
3077
  }),
3032
3078
  /** Merge a branch into the current branch */
3033
3079
  merge: protectedProcedure.input(z14.object({ ...gitTargetShape, branch: BRANCH_SCHEMA, noFf: z14.boolean().default(false) })).mutation(async ({ input }) => {
@@ -3092,7 +3138,7 @@ Rules:
3092
3138
  }
3093
3139
  );
3094
3140
  } catch (err) {
3095
- throw new TRPCError9({
3141
+ throw new TRPCError10({
3096
3142
  code: "BAD_REQUEST",
3097
3143
  message: `Cannot subscribe to git status: ${err.message}`
3098
3144
  });
@@ -3120,41 +3166,41 @@ Rules:
3120
3166
 
3121
3167
  // ../server/src/trpc/routers/scenario.ts
3122
3168
  import { randomUUID as randomUUID2 } from "crypto";
3123
- import { TRPCError as TRPCError12 } from "@trpc/server";
3169
+ import { TRPCError as TRPCError13 } from "@trpc/server";
3124
3170
  import { z as z15 } from "zod";
3125
3171
 
3126
3172
  // ../server/src/trpc/crud-procedure-utils.ts
3127
- import { TRPCError as TRPCError10 } from "@trpc/server";
3173
+ import { TRPCError as TRPCError11 } from "@trpc/server";
3128
3174
  async function getOrNotFound(getter, notFoundMessage) {
3129
3175
  const entity = await getter();
3130
- if (!entity) throw new TRPCError10({ code: "NOT_FOUND", message: notFoundMessage });
3176
+ if (!entity) throw new TRPCError11({ code: "NOT_FOUND", message: notFoundMessage });
3131
3177
  return entity;
3132
3178
  }
3133
3179
  async function createOrBadRequest(creator) {
3134
3180
  try {
3135
3181
  return await creator();
3136
3182
  } catch (err) {
3137
- throw new TRPCError10({ code: "BAD_REQUEST", message: err.message });
3183
+ throw new TRPCError11({ code: "BAD_REQUEST", message: err.message });
3138
3184
  }
3139
3185
  }
3140
3186
  async function updateOrThrow(updater, notFoundMessage) {
3141
3187
  try {
3142
3188
  const entity = await updater();
3143
- if (!entity) throw new TRPCError10({ code: "NOT_FOUND", message: notFoundMessage });
3189
+ if (!entity) throw new TRPCError11({ code: "NOT_FOUND", message: notFoundMessage });
3144
3190
  return entity;
3145
3191
  } catch (err) {
3146
- if (err instanceof TRPCError10) throw err;
3147
- throw new TRPCError10({ code: "BAD_REQUEST", message: err.message });
3192
+ if (err instanceof TRPCError11) throw err;
3193
+ throw new TRPCError11({ code: "BAD_REQUEST", message: err.message });
3148
3194
  }
3149
3195
  }
3150
3196
  async function deleteOrNotFound(deleter, notFoundMessage) {
3151
3197
  const deleted = await deleter();
3152
- if (!deleted) throw new TRPCError10({ code: "NOT_FOUND", message: notFoundMessage });
3198
+ if (!deleted) throw new TRPCError11({ code: "NOT_FOUND", message: notFoundMessage });
3153
3199
  return { ok: true };
3154
3200
  }
3155
3201
 
3156
3202
  // ../server/src/trpc/ai-generation-procedure-utils.ts
3157
- import { TRPCError as TRPCError11 } from "@trpc/server";
3203
+ import { TRPCError as TRPCError12 } from "@trpc/server";
3158
3204
 
3159
3205
  // ../server/src/services/ai-generation.ts
3160
3206
  import Anthropic2 from "@anthropic-ai/sdk";
@@ -3210,7 +3256,7 @@ async function* streamProviderText(input) {
3210
3256
  // ../server/src/trpc/ai-generation-procedure-utils.ts
3211
3257
  async function* streamWithActiveProvider(opts) {
3212
3258
  const active = await getActiveProvider(opts.providerId, opts.vault);
3213
- if (!active) throw new TRPCError11({ code: "BAD_REQUEST", message: "Aucun fournisseur IA configur\xE9" });
3259
+ if (!active) throw new TRPCError12({ code: "BAD_REQUEST", message: "Aucun fournisseur IA configur\xE9" });
3214
3260
  const { provider, plaintextKey } = active;
3215
3261
  const model = opts.model || provider.model || DEFAULT_MODELS[provider.provider] || "";
3216
3262
  try {
@@ -3228,7 +3274,7 @@ async function* streamWithActiveProvider(opts) {
3228
3274
  yield { type: "done", text: "" };
3229
3275
  } catch (err) {
3230
3276
  if (String(err?.message ?? "").startsWith("Unsupported provider:")) {
3231
- throw new TRPCError11({ code: "BAD_REQUEST", message: `Fournisseur non support\xE9: ${provider.provider}` });
3277
+ throw new TRPCError12({ code: "BAD_REQUEST", message: `Fournisseur non support\xE9: ${provider.provider}` });
3232
3278
  }
3233
3279
  throw err;
3234
3280
  }
@@ -4708,10 +4754,10 @@ Rules:
4708
4754
  - Groups: position spaced 400px apart (e.g. x=0, x=400, x=800). width >= 300, height >= 200.
4709
4755
  - Nodes positions are relative to their group: x/y in 30-260 range.
4710
4756
  - The "prompt" field must be detailed: role, responsibilities, communication style, expected outputs.`;
4711
- function buildScenarioUserMessage(userPrompt, current) {
4712
- if (current && (current.groups.length > 0 || current.nodes.length > 0)) {
4757
+ function buildScenarioUserMessage(userPrompt, current2) {
4758
+ if (current2 && (current2.groups.length > 0 || current2.nodes.length > 0)) {
4713
4759
  return `Current scenario:
4714
- ${JSON.stringify(current, null, 2)}
4760
+ ${JSON.stringify(current2, null, 2)}
4715
4761
 
4716
4762
  User request: ${userPrompt}
4717
4763
 
@@ -4805,7 +4851,7 @@ var scenarioRouter = router({
4805
4851
  resume: z15.boolean().optional()
4806
4852
  })).subscription(async function* ({ input, signal }) {
4807
4853
  const scenario = await scenarioStore.get(input.scenarioId, await scopeOf2(input));
4808
- if (!scenario) throw new TRPCError12({ code: "NOT_FOUND", message: "Scenario not found" });
4854
+ if (!scenario) throw new TRPCError13({ code: "NOT_FOUND", message: "Scenario not found" });
4809
4855
  const canStart = input.userRequest.trim().length > 0 || !!input.resume;
4810
4856
  if (!isScenarioRunning(input.conversationId) && canStart) {
4811
4857
  let userRequest = input.userRequest;
@@ -4832,7 +4878,7 @@ var scenarioRouter = router({
4832
4878
  text: z15.string().min(1).max(1e5)
4833
4879
  })).mutation(({ input }) => {
4834
4880
  const resolved = resolveNodeInput(input.conversationId, input.nodeId, input.text);
4835
- if (!resolved) throw new TRPCError12({ code: "NOT_FOUND", message: "No pending input request for this node" });
4881
+ if (!resolved) throw new TRPCError13({ code: "NOT_FOUND", message: "No pending input request for this node" });
4836
4882
  return { ok: true };
4837
4883
  }),
4838
4884
  isRunning: protectedProcedure.input(z15.object({ conversationId: ConversationIdSchema })).query(({ input }) => ({ running: isScenarioRunning(input.conversationId) })),
@@ -4892,14 +4938,14 @@ var scenarioRouter = router({
4892
4938
  listPresets: protectedProcedure.query(() => listPresets()),
4893
4939
  getPreset: protectedProcedure.input(z15.object({ id: Id128Schema })).query(({ input }) => {
4894
4940
  const preset = getPreset(input.id);
4895
- if (!preset) throw new TRPCError12({ code: "NOT_FOUND", message: "Preset not found" });
4941
+ if (!preset) throw new TRPCError13({ code: "NOT_FOUND", message: "Preset not found" });
4896
4942
  return preset;
4897
4943
  })
4898
4944
  });
4899
4945
 
4900
4946
  // ../server/src/trpc/routers/debug.ts
4901
4947
  import { randomUUID as randomUUID3 } from "crypto";
4902
- import { TRPCError as TRPCError13 } from "@trpc/server";
4948
+ import { TRPCError as TRPCError14 } from "@trpc/server";
4903
4949
  import { z as z16 } from "zod";
4904
4950
  var MAX_BUFFER2 = 300;
4905
4951
  var jobs = /* @__PURE__ */ new Map();
@@ -4972,17 +5018,17 @@ var debugRouter = router({
4972
5018
  tick: 0,
4973
5019
  done: false,
4974
5020
  timer: setInterval(() => {
4975
- const current = jobs.get(jobId);
4976
- if (!current || current.done) return;
4977
- current.tick += 1;
4978
- publish(current, {
5021
+ const current2 = jobs.get(jobId);
5022
+ if (!current2 || current2.done) return;
5023
+ current2.tick += 1;
5024
+ publish(current2, {
4979
5025
  type: "tick",
4980
5026
  jobId,
4981
- index: current.tick,
5027
+ index: current2.tick,
4982
5028
  value: Math.random(),
4983
5029
  at: Date.now()
4984
5030
  });
4985
- if (current.tick >= current.maxTicks) {
5031
+ if (current2.tick >= current2.maxTicks) {
4986
5032
  stopJob(jobId, "max_ticks");
4987
5033
  }
4988
5034
  }, intervalMs),
@@ -4996,7 +5042,7 @@ var debugRouter = router({
4996
5042
  streamRandomJob: protectedProcedure.input(z16.object({ jobId: z16.string().max(128) })).subscription(async function* ({ input, signal }) {
4997
5043
  const job = jobs.get(input.jobId);
4998
5044
  if (!job) {
4999
- throw new TRPCError13({ code: "NOT_FOUND", message: "Random job not found" });
5045
+ throw new TRPCError14({ code: "NOT_FOUND", message: "Random job not found" });
5000
5046
  }
5001
5047
  yield* tapJob(job, signal ?? new AbortController().signal);
5002
5048
  }),
@@ -5012,7 +5058,7 @@ var debugRouter = router({
5012
5058
 
5013
5059
  // ../server/src/trpc/routers/diagnostics.ts
5014
5060
  import { z as z17 } from "zod";
5015
- import { TRPCError as TRPCError14 } from "@trpc/server";
5061
+ import { TRPCError as TRPCError15 } from "@trpc/server";
5016
5062
 
5017
5063
  // ../server/src/services/log-buffer.ts
5018
5064
  import { EventEmitter } from "events";
@@ -5132,12 +5178,12 @@ var diagnosticsRouter = router({
5132
5178
  } catch (err) {
5133
5179
  const reason = err.message;
5134
5180
  if (reason === "instance-not-found") {
5135
- throw new TRPCError14({ code: "NOT_FOUND", message: "No live Runeya instance with this pid." });
5181
+ throw new TRPCError15({ code: "NOT_FOUND", message: "No live Runeya instance with this pid." });
5136
5182
  }
5137
5183
  if (reason === "instance-is-current") {
5138
- throw new TRPCError14({ code: "BAD_REQUEST", message: "This instance cannot stop itself." });
5184
+ throw new TRPCError15({ code: "BAD_REQUEST", message: "This instance cannot stop itself." });
5139
5185
  }
5140
- throw new TRPCError14({ code: "INTERNAL_SERVER_ERROR", message: reason });
5186
+ throw new TRPCError15({ code: "INTERNAL_SERVER_ERROR", message: reason });
5141
5187
  }
5142
5188
  }),
5143
5189
  /**
@@ -5164,15 +5210,15 @@ var diagnosticsRouter = router({
5164
5210
  } catch (err) {
5165
5211
  const reason = err.message;
5166
5212
  if (reason === "instance-not-found") {
5167
- throw new TRPCError14({ code: "NOT_FOUND", message: "No live Runeya instance with this pid." });
5213
+ throw new TRPCError15({ code: "NOT_FOUND", message: "No live Runeya instance with this pid." });
5168
5214
  }
5169
5215
  if (reason.startsWith("instance-not-restartable:")) {
5170
- throw new TRPCError14({
5216
+ throw new TRPCError15({
5171
5217
  code: "BAD_REQUEST",
5172
5218
  message: `This instance cannot be restarted (${reason.split(":")[1]}).`
5173
5219
  });
5174
5220
  }
5175
- throw new TRPCError14({ code: "INTERNAL_SERVER_ERROR", message: reason });
5221
+ throw new TRPCError15({ code: "INTERNAL_SERVER_ERROR", message: reason });
5176
5222
  }
5177
5223
  })
5178
5224
  });
@@ -5435,7 +5481,7 @@ import { createHash } from "crypto";
5435
5481
  import { tmpdir } from "os";
5436
5482
  import { join as join7 } from "path";
5437
5483
  import { z as z19 } from "zod";
5438
- import { TRPCError as TRPCError15 } from "@trpc/server";
5484
+ import { TRPCError as TRPCError16 } from "@trpc/server";
5439
5485
  function summarizeCard(card, boardId, columnTitle) {
5440
5486
  return {
5441
5487
  boardId,
@@ -5506,7 +5552,7 @@ async function storeAttachment(id, name, body, dirs = attachmentCacheDirs()) {
5506
5552
  refusals.push(`${dir} (${err instanceof Error ? err.message : String(err)})`);
5507
5553
  }
5508
5554
  }
5509
- throw new TRPCError15({
5555
+ throw new TRPCError16({
5510
5556
  code: "INTERNAL_SERVER_ERROR",
5511
5557
  message: `Impossible d'\xE9crire la pi\xE8ce jointe sur cette machine. Emplacements essay\xE9s : ${refusals.join(" ; ")}. V\xE9rifiez les droits d'\xE9criture, ou l'espace disque.`
5512
5558
  });
@@ -5657,7 +5703,7 @@ var kanbanRouter = router({
5657
5703
  input.parentCardId ? { boardId: input.parentBoardId ?? input.boardId, cardId: input.parentCardId } : null
5658
5704
  );
5659
5705
  if (!ok) {
5660
- throw new TRPCError15({ code: "BAD_REQUEST", message: "The cloud refused the link (unknown card, or a cycle)." });
5706
+ throw new TRPCError16({ code: "BAD_REQUEST", message: "The cloud refused the link (unknown card, or a cycle)." });
5661
5707
  }
5662
5708
  return { ok: true };
5663
5709
  }),
@@ -5756,25 +5802,25 @@ var kanbanRouter = router({
5756
5802
  downloadAttachment: protectedProcedure.input(z19.object({ attachmentId: z19.string().max(128) })).mutation(async ({ input }) => {
5757
5803
  const id = input.attachmentId;
5758
5804
  if (!ATTACHMENT_ID_REGEX.test(id)) {
5759
- throw new TRPCError15({ code: "BAD_REQUEST", message: "Invalid attachment id" });
5805
+ throw new TRPCError16({ code: "BAD_REQUEST", message: "Invalid attachment id" });
5760
5806
  }
5761
5807
  const res = await cloudFetch2(`/api/kanban/file/${id}`, { timeoutMs: 12e4 });
5762
5808
  if (res.status === 404) {
5763
- throw new TRPCError15({ code: "NOT_FOUND", message: `Attachment ${id} not found` });
5809
+ throw new TRPCError16({ code: "NOT_FOUND", message: `Attachment ${id} not found` });
5764
5810
  }
5765
5811
  if (!res.ok) {
5766
- throw new TRPCError15({
5812
+ throw new TRPCError16({
5767
5813
  code: res.status === 403 ? "FORBIDDEN" : "INTERNAL_SERVER_ERROR",
5768
5814
  message: `Cloud refused the attachment (HTTP ${res.status})`
5769
5815
  });
5770
5816
  }
5771
5817
  const declared = Number(res.headers.get("content-length") ?? 0);
5772
5818
  if (declared > MAX_ATTACHMENT_BYTES) {
5773
- throw new TRPCError15({ code: "PAYLOAD_TOO_LARGE", message: "Attachment too large to download" });
5819
+ throw new TRPCError16({ code: "PAYLOAD_TOO_LARGE", message: "Attachment too large to download" });
5774
5820
  }
5775
5821
  const body = Buffer.from(await res.arrayBuffer());
5776
5822
  if (body.length > MAX_ATTACHMENT_BYTES) {
5777
- throw new TRPCError15({ code: "PAYLOAD_TOO_LARGE", message: "Attachment too large to download" });
5823
+ throw new TRPCError16({ code: "PAYLOAD_TOO_LARGE", message: "Attachment too large to download" });
5778
5824
  }
5779
5825
  const contentType = res.headers.get("content-type") ?? "application/octet-stream";
5780
5826
  const disposition = res.headers.get("content-disposition") ?? "";
@@ -5787,7 +5833,7 @@ var kanbanRouter = router({
5787
5833
 
5788
5834
  // ../server/src/trpc/routers/terminal.ts
5789
5835
  import { z as z20 } from "zod";
5790
- import { TRPCError as TRPCError16 } from "@trpc/server";
5836
+ import { TRPCError as TRPCError17 } from "@trpc/server";
5791
5837
  var terminalRouter = router({
5792
5838
  /** Create a PTY shell session on the target agent */
5793
5839
  create: protectedProcedure.input(z20.object({
@@ -5911,7 +5957,7 @@ var terminalRouter = router({
5911
5957
  }
5912
5958
  );
5913
5959
  } catch (err) {
5914
- throw new TRPCError16({
5960
+ throw new TRPCError17({
5915
5961
  code: "BAD_REQUEST",
5916
5962
  message: `Cannot subscribe to terminal: ${err.message}`
5917
5963
  });
@@ -5946,7 +5992,7 @@ var utilityRouter = router({
5946
5992
 
5947
5993
  // ../server/src/trpc/routers/wiki.ts
5948
5994
  import { z as z22 } from "zod";
5949
- import { TRPCError as TRPCError17 } from "@trpc/server";
5995
+ import { TRPCError as TRPCError18 } from "@trpc/server";
5950
5996
  import { readFile as readFile3, readdir as readdir2, stat as stat4, realpath, writeFile as writeFile5, mkdir as mkdir6, rename as rename3, rm as rm2 } from "fs/promises";
5951
5997
  import { resolve as resolvePath, join as join8, relative, sep, dirname as dirname3 } from "path";
5952
5998
  var SCOPE_SCHEMA = z22.union([
@@ -5982,27 +6028,27 @@ async function resolveScope(scope) {
5982
6028
  const settings = await settingsManager.getSettings();
5983
6029
  const sub = (settings.globalDocsPath?.trim() || "wiki").replace(/^[\\/]+|[\\/]+$/g, "");
5984
6030
  if (sub.includes("..") || sub.includes("\0")) {
5985
- throw new TRPCError17({ code: "BAD_REQUEST", message: "Sous-chemin invalide" });
6031
+ throw new TRPCError18({ code: "BAD_REQUEST", message: "Sous-chemin invalide" });
5986
6032
  }
5987
6033
  const dataDirAbs = resolvePath(env.DATA_DIR);
5988
6034
  await mkdir6(dataDirAbs, { recursive: true });
5989
6035
  const base = dirname3(await realpath(dataDirAbs));
5990
6036
  const target = resolvePath(base, sub);
5991
6037
  if (target !== base && !(target + sep).startsWith(base + sep)) {
5992
- throw new TRPCError17({ code: "FORBIDDEN", message: "Hors du dossier de donn\xE9es du serveur" });
6038
+ throw new TRPCError18({ code: "FORBIDDEN", message: "Hors du dossier de donn\xE9es du serveur" });
5993
6039
  }
5994
6040
  await mkdir6(target, { recursive: true });
5995
6041
  const root = await realpath(target);
5996
6042
  if (root !== base && !(root + sep).startsWith(base + sep)) {
5997
- throw new TRPCError17({ code: "FORBIDDEN", message: "Le dossier wiki r\xE9sout hors du dossier de donn\xE9es" });
6043
+ throw new TRPCError18({ code: "FORBIDDEN", message: "Le dossier wiki r\xE9sout hors du dossier de donn\xE9es" });
5998
6044
  }
5999
6045
  return { mode: "local", root };
6000
6046
  }
6001
6047
  const serviceId = scope.slice("service:".length);
6002
6048
  const service = await serviceStore.get(serviceId);
6003
- if (!service) throw new TRPCError17({ code: "NOT_FOUND", message: "Service introuvable" });
6049
+ if (!service) throw new TRPCError18({ code: "NOT_FOUND", message: "Service introuvable" });
6004
6050
  const agentId = await resolveEffectiveAgentId(service);
6005
- if (!agentId) throw new TRPCError17({ code: "BAD_REQUEST", message: "Aucun agent configur\xE9 pour ce service" });
6051
+ if (!agentId) throw new TRPCError18({ code: "BAD_REQUEST", message: "Aucun agent configur\xE9 pour ce service" });
6006
6052
  const cwd = await resolveWorkspaceCwd({ serviceId, override: service.docsPath?.trim() || void 0 });
6007
6053
  return { mode: "agent", agentId, cwd };
6008
6054
  }
@@ -6037,7 +6083,7 @@ async function walkLocal(root, dir, depth, counter) {
6037
6083
  }
6038
6084
  async function resolveSafeLocal(root, relPath, requireExist) {
6039
6085
  if (relPath.includes("..") || relPath.startsWith("/")) {
6040
- throw new TRPCError17({ code: "BAD_REQUEST", message: "Chemin invalide" });
6086
+ throw new TRPCError18({ code: "BAD_REQUEST", message: "Chemin invalide" });
6041
6087
  }
6042
6088
  const target = resolvePath(root, relPath);
6043
6089
  if (requireExist) {
@@ -6045,10 +6091,10 @@ async function resolveSafeLocal(root, relPath, requireExist) {
6045
6091
  try {
6046
6092
  real = await realpath(target);
6047
6093
  } catch {
6048
- throw new TRPCError17({ code: "NOT_FOUND", message: "Chemin introuvable" });
6094
+ throw new TRPCError18({ code: "NOT_FOUND", message: "Chemin introuvable" });
6049
6095
  }
6050
6096
  if (real !== root && !(real + sep).startsWith(root + sep)) {
6051
- throw new TRPCError17({ code: "FORBIDDEN", message: "Hors du dossier autoris\xE9" });
6097
+ throw new TRPCError18({ code: "FORBIDDEN", message: "Hors du dossier autoris\xE9" });
6052
6098
  }
6053
6099
  return real;
6054
6100
  }
@@ -6060,7 +6106,7 @@ async function resolveSafeLocal(root, relPath, requireExist) {
6060
6106
  realParent = parent;
6061
6107
  }
6062
6108
  if (realParent !== root && !(realParent + sep).startsWith(root + sep)) {
6063
- throw new TRPCError17({ code: "FORBIDDEN", message: "Hors du dossier autoris\xE9" });
6109
+ throw new TRPCError18({ code: "FORBIDDEN", message: "Hors du dossier autoris\xE9" });
6064
6110
  }
6065
6111
  return resolvePath(realParent, target.slice(parent.length).replace(/^[\\/]+/, ""));
6066
6112
  }
@@ -6076,7 +6122,7 @@ var wikiRouter = router({
6076
6122
  }),
6077
6123
  read: protectedProcedure.input(z22.object({ scope: SCOPE_SCHEMA, path: REL_PATH_SCHEMA })).output(z22.object({ path: z22.string(), content: z22.string() })).query(async ({ input }) => {
6078
6124
  if (!/\.(md|markdown)$/i.test(input.path)) {
6079
- throw new TRPCError17({ code: "BAD_REQUEST", message: "Seuls les .md/.markdown sont autoris\xE9s" });
6125
+ throw new TRPCError18({ code: "BAD_REQUEST", message: "Seuls les .md/.markdown sont autoris\xE9s" });
6080
6126
  }
6081
6127
  const target = await resolveScope(input.scope);
6082
6128
  if (target.mode === "agent") {
@@ -6084,14 +6130,14 @@ var wikiRouter = router({
6084
6130
  }
6085
6131
  const file = await resolveSafeLocal(target.root, input.path, true);
6086
6132
  const s = await stat4(file);
6087
- if (!s.isFile()) throw new TRPCError17({ code: "BAD_REQUEST", message: "Pas un fichier" });
6088
- if (s.size > MAX_FILE_BYTES) throw new TRPCError17({ code: "PAYLOAD_TOO_LARGE", message: "Fichier trop volumineux" });
6133
+ if (!s.isFile()) throw new TRPCError18({ code: "BAD_REQUEST", message: "Pas un fichier" });
6134
+ if (s.size > MAX_FILE_BYTES) throw new TRPCError18({ code: "PAYLOAD_TOO_LARGE", message: "Fichier trop volumineux" });
6089
6135
  const content = await readFile3(file, "utf-8");
6090
6136
  return { path: input.path, content };
6091
6137
  }),
6092
6138
  write: protectedProcedure.input(z22.object({ scope: SCOPE_SCHEMA, path: REL_PATH_SCHEMA, content: z22.string().max(5e6) })).mutation(async ({ input }) => {
6093
6139
  if (!/\.(md|markdown)$/i.test(input.path)) {
6094
- throw new TRPCError17({ code: "BAD_REQUEST", message: "Seuls les .md/.markdown sont autoris\xE9s" });
6140
+ throw new TRPCError18({ code: "BAD_REQUEST", message: "Seuls les .md/.markdown sont autoris\xE9s" });
6095
6141
  }
6096
6142
  const target = await resolveScope(input.scope);
6097
6143
  if (target.mode === "agent") {
@@ -6104,7 +6150,7 @@ var wikiRouter = router({
6104
6150
  }),
6105
6151
  createFile: protectedProcedure.input(z22.object({ scope: SCOPE_SCHEMA, path: REL_PATH_SCHEMA })).mutation(async ({ input }) => {
6106
6152
  if (!/\.(md|markdown)$/i.test(input.path)) {
6107
- throw new TRPCError17({ code: "BAD_REQUEST", message: "Seuls les .md/.markdown sont autoris\xE9s" });
6153
+ throw new TRPCError18({ code: "BAD_REQUEST", message: "Seuls les .md/.markdown sont autoris\xE9s" });
6108
6154
  }
6109
6155
  const target = await resolveScope(input.scope);
6110
6156
  if (target.mode === "agent") {
@@ -6113,9 +6159,9 @@ var wikiRouter = router({
6113
6159
  const file = await resolveSafeLocal(target.root, input.path, false);
6114
6160
  try {
6115
6161
  await stat4(file);
6116
- throw new TRPCError17({ code: "CONFLICT", message: "Fichier d\xE9j\xE0 existant" });
6162
+ throw new TRPCError18({ code: "CONFLICT", message: "Fichier d\xE9j\xE0 existant" });
6117
6163
  } catch (err) {
6118
- if (err instanceof TRPCError17) throw err;
6164
+ if (err instanceof TRPCError18) throw err;
6119
6165
  }
6120
6166
  await mkdir6(dirname3(file), { recursive: true });
6121
6167
  await writeFile5(file, "", "utf-8");
@@ -6139,9 +6185,9 @@ var wikiRouter = router({
6139
6185
  const to = await resolveSafeLocal(target.root, input.toPath, false);
6140
6186
  try {
6141
6187
  await stat4(to);
6142
- throw new TRPCError17({ code: "CONFLICT", message: "La cible existe d\xE9j\xE0" });
6188
+ throw new TRPCError18({ code: "CONFLICT", message: "La cible existe d\xE9j\xE0" });
6143
6189
  } catch (err) {
6144
- if (err instanceof TRPCError17) throw err;
6190
+ if (err instanceof TRPCError18) throw err;
6145
6191
  }
6146
6192
  await mkdir6(dirname3(to), { recursive: true });
6147
6193
  await rename3(from, to);
@@ -6154,9 +6200,9 @@ var wikiRouter = router({
6154
6200
  }
6155
6201
  const serviceId = input.scope.slice("service:".length);
6156
6202
  const service = await serviceStore.get(serviceId);
6157
- if (!service) throw new TRPCError17({ code: "NOT_FOUND", message: "Service introuvable" });
6203
+ if (!service) throw new TRPCError18({ code: "NOT_FOUND", message: "Service introuvable" });
6158
6204
  const agentId = await resolveEffectiveAgentId(service);
6159
- if (!agentId) throw new TRPCError17({ code: "BAD_REQUEST", message: "Aucun agent configur\xE9" });
6205
+ if (!agentId) throw new TRPCError18({ code: "BAD_REQUEST", message: "Aucun agent configur\xE9" });
6160
6206
  const cwd = await resolveWorkspaceCwd({ serviceId, override: service.docsPath?.trim() || void 0 });
6161
6207
  return agentManager.agentMutation(agentId, "wiki.ensureRoot", { cwd });
6162
6208
  }),
@@ -6166,7 +6212,7 @@ var wikiRouter = router({
6166
6212
  return agentManager.agentMutation(target.agentId, "wiki.deletePath", { cwd: target.cwd, path: input.path });
6167
6213
  }
6168
6214
  const fp = await resolveSafeLocal(target.root, input.path, true);
6169
- if (fp === target.root) throw new TRPCError17({ code: "FORBIDDEN", message: "Impossible de supprimer la racine" });
6215
+ if (fp === target.root) throw new TRPCError18({ code: "FORBIDDEN", message: "Impossible de supprimer la racine" });
6170
6216
  await rm2(fp, { recursive: true, force: true });
6171
6217
  return { path: input.path, ok: true };
6172
6218
  })
@@ -6187,7 +6233,7 @@ var configRouter = router({
6187
6233
 
6188
6234
  // ../server/src/trpc/routers/cloud-sync.ts
6189
6235
  import { z as z23 } from "zod";
6190
- import { TRPCError as TRPCError18 } from "@trpc/server";
6236
+ import { TRPCError as TRPCError19 } from "@trpc/server";
6191
6237
 
6192
6238
  // ../server/src/services/org-sync-scope.ts
6193
6239
  import { access } from "fs/promises";
@@ -7319,7 +7365,7 @@ async function assertOrgReadable(orgId) {
7319
7365
  await assertOrgVaultReadable(orgId);
7320
7366
  } catch (err) {
7321
7367
  if (err instanceof OrgVaultUnreadableError) {
7322
- throw new TRPCError18({ code: "FORBIDDEN", message: err.message });
7368
+ throw new TRPCError19({ code: "FORBIDDEN", message: err.message });
7323
7369
  }
7324
7370
  throw err;
7325
7371
  }
@@ -7329,10 +7375,10 @@ async function assertOrgKey(orgId) {
7329
7375
  await reconcileOrgCanary(orgId);
7330
7376
  } catch (err) {
7331
7377
  if (err instanceof OrgKeyMismatchError) {
7332
- throw new TRPCError18({ code: "FORBIDDEN", message: err.message });
7378
+ throw new TRPCError19({ code: "FORBIDDEN", message: err.message });
7333
7379
  }
7334
7380
  if (err instanceof CanaryUnavailableError) {
7335
- throw new TRPCError18({ code: "PRECONDITION_FAILED", message: err.message });
7381
+ throw new TRPCError19({ code: "PRECONDITION_FAILED", message: err.message });
7336
7382
  }
7337
7383
  throw err;
7338
7384
  }
@@ -7371,7 +7417,7 @@ var cloudSyncRouter = router({
7371
7417
  return { pulled, state: syncState(input.orgId), heldBy: await syncLockHolder(input.orgId) };
7372
7418
  } catch (err) {
7373
7419
  if (err instanceof ProjectHeldElsewhereError) {
7374
- throw new TRPCError18({ code: "CONFLICT", message: err.code, cause: err });
7420
+ throw new TRPCError19({ code: "CONFLICT", message: err.code, cause: err });
7375
7421
  }
7376
7422
  throw err;
7377
7423
  }
@@ -7398,10 +7444,10 @@ var cloudSyncRouter = router({
7398
7444
  ).mutation(async ({ input }) => {
7399
7445
  const local = await projectStore.get({ id: input.projectId, orgId: null });
7400
7446
  if (!local) {
7401
- throw new TRPCError18({ code: "NOT_FOUND", message: "PROJECT_NOT_LOCAL" });
7447
+ throw new TRPCError19({ code: "NOT_FOUND", message: "PROJECT_NOT_LOCAL" });
7402
7448
  }
7403
7449
  if (await projectStore.get({ id: input.projectId, orgId: input.orgId })) {
7404
- throw new TRPCError18({ code: "CONFLICT", message: "PROJECT_ALREADY_IN_ORG" });
7450
+ throw new TRPCError19({ code: "CONFLICT", message: "PROJECT_ALREADY_IN_ORG" });
7405
7451
  }
7406
7452
  await assertOrgReadable(input.orgId);
7407
7453
  const connected = cloudSyncBridge.states().some((s) => s.orgId === input.orgId);
@@ -7420,7 +7466,7 @@ var cloudSyncRouter = router({
7420
7466
  await cloudSyncBridge.followProject(input.orgId, input.projectId);
7421
7467
  } catch (err) {
7422
7468
  if (err instanceof ProjectHeldElsewhereError) {
7423
- throw new TRPCError18({ code: "CONFLICT", message: err.code, cause: err });
7469
+ throw new TRPCError19({ code: "CONFLICT", message: err.code, cause: err });
7424
7470
  }
7425
7471
  throw err;
7426
7472
  }
@@ -7443,7 +7489,7 @@ var cloudSyncRouter = router({
7443
7489
  { method: "GET" }
7444
7490
  );
7445
7491
  if (!res.ok) {
7446
- throw new TRPCError18({ code: "BAD_GATEWAY", message: await cloudMessage(res) || `CANARY_READ_FAILED (${res.status})` });
7492
+ throw new TRPCError19({ code: "BAD_GATEWAY", message: await cloudMessage(res) || `CANARY_READ_FAILED (${res.status})` });
7447
7493
  }
7448
7494
  const { canary } = await res.json();
7449
7495
  if (typeof canary !== "string") return { matches: false, published: false };
@@ -7510,7 +7556,7 @@ var cloudSyncRouter = router({
7510
7556
  resetOrgKey: protectedProcedure.input(z23.object({ orgId: z23.string().min(1).max(128) })).mutation(async ({ input }) => {
7511
7557
  const canary = await readVerifyFile(orgVaultRoot(input.orgId)) ?? await readVerifyFile(await keyRoot());
7512
7558
  if (!canary) {
7513
- throw new TRPCError18({
7559
+ throw new TRPCError19({
7514
7560
  code: "PRECONDITION_FAILED",
7515
7561
  message: "Cette machine n'a pas encore de cl\xE9 de chiffrement."
7516
7562
  });
@@ -7521,7 +7567,7 @@ var cloudSyncRouter = router({
7521
7567
  });
7522
7568
  if (!res.ok) {
7523
7569
  const detail = await cloudMessage(res);
7524
- throw new TRPCError18({
7570
+ throw new TRPCError19({
7525
7571
  code: res.status === 403 ? "FORBIDDEN" : "BAD_GATEWAY",
7526
7572
  message: detail || `ORG_KEY_RESET_FAILED (${res.status})`
7527
7573
  });
@@ -7567,8 +7613,8 @@ var cloudSyncRouter = router({
7567
7613
  body: { organizationId: input.orgId, projectId: input.projectId }
7568
7614
  });
7569
7615
  } catch (err) {
7570
- if (err instanceof TRPCError18 && err.code === "PRECONDITION_FAILED") {
7571
- throw new TRPCError18({ code: "PRECONDITION_FAILED", message: "CLOUD_NOT_LINKED" });
7616
+ if (err instanceof TRPCError19 && err.code === "PRECONDITION_FAILED") {
7617
+ throw new TRPCError19({ code: "PRECONDITION_FAILED", message: "CLOUD_NOT_LINKED" });
7572
7618
  }
7573
7619
  throw err;
7574
7620
  }
@@ -7576,12 +7622,12 @@ var cloudSyncRouter = router({
7576
7622
  const detail = await cloudMessage(res);
7577
7623
  if (res.status === 403) {
7578
7624
  const code = /not a member/i.test(detail) ? "PROJECT_NOT_MEMBER" : "PROJECT_DELETE_FORBIDDEN";
7579
- throw new TRPCError18({ code: "FORBIDDEN", message: code, cause: new Error(detail) });
7625
+ throw new TRPCError19({ code: "FORBIDDEN", message: code, cause: new Error(detail) });
7580
7626
  }
7581
7627
  if (res.status === 404) {
7582
- throw new TRPCError18({ code: "NOT_FOUND", message: "PROJECT_NOT_IN_ORG", cause: new Error(detail) });
7628
+ throw new TRPCError19({ code: "NOT_FOUND", message: "PROJECT_NOT_IN_ORG", cause: new Error(detail) });
7583
7629
  }
7584
- throw new TRPCError18({
7630
+ throw new TRPCError19({
7585
7631
  code: "BAD_GATEWAY",
7586
7632
  message: detail || `PROJECT_DELETE_FAILED (${res.status})`
7587
7633
  });
@@ -7777,6 +7823,97 @@ var filesystemRouter = router({
7777
7823
  })
7778
7824
  });
7779
7825
 
7826
+ // ../server/src/trpc/routers/desktop.ts
7827
+ import { z as z25 } from "zod";
7828
+ import { isAbsolute as isAbsolute3 } from "path";
7829
+ import { TRPCError as TRPCError20 } from "@trpc/server";
7830
+
7831
+ // ../server/src/services/desktop-launcher.ts
7832
+ import { execFile as execFile4 } from "child_process";
7833
+ import { isAbsolute as isAbsolute2 } from "path";
7834
+ import { promisify as promisify3 } from "util";
7835
+ var exec = promisify3(execFile4);
7836
+ var INSTALL_TIMEOUT_MS2 = 3e4;
7837
+ var cli = null;
7838
+ function registerCli(location) {
7839
+ cli = location;
7840
+ }
7841
+ function suggestLauncher() {
7842
+ const workingDir = process.cwd();
7843
+ return {
7844
+ available: cli !== null,
7845
+ fromDesktop: env.FROM_DESKTOP,
7846
+ workingDir,
7847
+ name: deriveLauncherIdentity(void 0, workingDir).name,
7848
+ port: env.PORT,
7849
+ agentPort: env.RUNEYA_AGENT_PORT
7850
+ };
7851
+ }
7852
+ async function installLauncher(input) {
7853
+ if (!cli) throw new Error("launcher-unavailable");
7854
+ if (input.workingDir !== null && !isAbsolute2(input.workingDir)) {
7855
+ throw new Error("launcher-working-dir-not-absolute");
7856
+ }
7857
+ const args = [
7858
+ cli.cliEntry,
7859
+ "install-desktop",
7860
+ ...input.workingDir === null ? ["--no-cwd"] : [input.workingDir],
7861
+ "--name",
7862
+ input.name,
7863
+ "--port",
7864
+ String(input.port),
7865
+ "--agent-port",
7866
+ String(input.agentPort)
7867
+ ];
7868
+ const { stdout, stderr } = await exec(cli.execPath, args, {
7869
+ timeout: INSTALL_TIMEOUT_MS2,
7870
+ windowsHide: true,
7871
+ // Le rapport tient en quelques lignes ; au-delà, quelque chose a dérapé.
7872
+ maxBuffer: 1024 * 1024,
7873
+ // Sans terminal, le CLI n'ajoute pas de couleurs : la sortie est lisible telle quelle.
7874
+ env: { ...process.env, NO_COLOR: "1" }
7875
+ });
7876
+ return { name: input.name, output: [stdout, stderr].filter((s) => s.trim()).join("\n").trim() };
7877
+ }
7878
+
7879
+ // ../server/src/trpc/routers/desktop.ts
7880
+ var desktopRouter = router({
7881
+ /** Ce que le CLI demanderait, prérempli avec l'instance en cours. */
7882
+ suggestLauncher: protectedProcedure.query(() => suggestLauncher()),
7883
+ installLauncher: protectedProcedure.input(z25.object({
7884
+ name: z25.string().trim().min(1).max(120),
7885
+ /**
7886
+ * `null` : raccourci global, sans dossier épinglé. Sinon un chemin
7887
+ * absolu, refusé autrement : le dossier devient un argument positionnel
7888
+ * du CLI, où une valeur commençant par un tiret passerait pour un drapeau.
7889
+ */
7890
+ workingDir: z25.string().max(4096).refine(isAbsolute3, {
7891
+ message: "Le dossier de travail doit \xEAtre un chemin absolu."
7892
+ }).nullable(),
7893
+ port: z25.number().int().min(1).max(65535),
7894
+ agentPort: z25.number().int().min(1).max(65535)
7895
+ })).mutation(async ({ input }) => {
7896
+ try {
7897
+ return await installLauncher(input);
7898
+ } catch (err) {
7899
+ const message = err.message;
7900
+ if (message === "launcher-working-dir-not-absolute") {
7901
+ throw new TRPCError20({
7902
+ code: "BAD_REQUEST",
7903
+ message: "Le dossier de travail doit \xEAtre un chemin absolu."
7904
+ });
7905
+ }
7906
+ if (message === "launcher-unavailable") {
7907
+ throw new TRPCError20({
7908
+ code: "PRECONDITION_FAILED",
7909
+ message: "Cette Runeya ne sait pas o\xF9 trouver son CLI : cr\xE9ez le raccourci avec `runeya install-desktop`."
7910
+ });
7911
+ }
7912
+ throw new TRPCError20({ code: "INTERNAL_SERVER_ERROR", message });
7913
+ }
7914
+ })
7915
+ });
7916
+
7780
7917
  // ../server/src/trpc/router.ts
7781
7918
  var appRouter = router({
7782
7919
  health: healthRouter,
@@ -7805,7 +7942,8 @@ var appRouter = router({
7805
7942
  config: configRouter,
7806
7943
  cloudSync: cloudSyncRouter,
7807
7944
  cloudAuth: cloudAuthRouter,
7808
- filesystem: filesystemRouter
7945
+ filesystem: filesystemRouter,
7946
+ desktop: desktopRouter
7809
7947
  });
7810
7948
 
7811
7949
  // ../server/src/middleware/error-handler.ts
@@ -9347,6 +9485,9 @@ async function createLocalServer() {
9347
9485
  console.warn("[server] Failed to start Claude transcript watcher:", err);
9348
9486
  });
9349
9487
  startCodexTranscriptWatcher();
9488
+ await serviceStore.list().catch((err) => {
9489
+ console.warn("[server] Failed to preload services:", err);
9490
+ });
9350
9491
  cloudSyncBridge.start().catch((err) => {
9351
9492
  console.warn("[server] Failed to start cloud sync bridge:", err);
9352
9493
  });
@@ -9939,7 +10080,7 @@ async function createLocalServer() {
9939
10080
  ]);
9940
10081
  console.log("[server] Shutdown complete");
9941
10082
  };
9942
- const { initCompanion } = await import("./companion-JQGNL4U7.js");
10083
+ const { initCompanion } = await import("./companion-6J6NK7H7.js");
9943
10084
  initCompanion();
9944
10085
  return { app, server, wss, shutdown };
9945
10086
  }
@@ -10026,6 +10167,46 @@ async function pullEnv(opts) {
10026
10167
  return Object.entries(env2).map(([key, value]) => `${key}=${value}`).join("\n");
10027
10168
  }
10028
10169
 
10170
+ // ../server/src/services/tray-services.ts
10171
+ async function listTrayServices() {
10172
+ const [all, processes] = await Promise.all([serviceStore.list(), listAllProcesses()]);
10173
+ const byServiceId = new Map(processes.map((p) => [p.serviceId, p]));
10174
+ const services = all.map((service) => {
10175
+ const status = byServiceId.get(service.id);
10176
+ return {
10177
+ id: service.id,
10178
+ name: service.name,
10179
+ agentId: status?.agentId ?? service.agentId ?? null,
10180
+ running: status?.state === "running" || status?.state === "starting",
10181
+ failed: status?.state === "errored" || status?.healthStatus === "unhealthy",
10182
+ url: primaryServiceLink(service, "localhost")
10183
+ };
10184
+ });
10185
+ const owned = await currentProjectServiceIds();
10186
+ if (owned) return services.filter((service) => owned.has(service.id));
10187
+ return services.filter((service) => service.running || service.failed);
10188
+ }
10189
+ async function currentProjectServiceIds() {
10190
+ const ref = getCurrentProject();
10191
+ if (!ref) return null;
10192
+ const project = await projectStore.get(ref);
10193
+ if (!project) return null;
10194
+ return new Set(project.serviceIds);
10195
+ }
10196
+ function onTrayServicesChanged(listener) {
10197
+ const onStatus = () => listener();
10198
+ agentManager.on("process:status", onStatus);
10199
+ const offServices = serviceStore.onChange(onStatus);
10200
+ const offUnlock = onVaultUnlocked(onStatus);
10201
+ const offProject = onCurrentProjectChanged(onStatus);
10202
+ return () => {
10203
+ agentManager.off("process:status", onStatus);
10204
+ offServices();
10205
+ offUnlock();
10206
+ offProject();
10207
+ };
10208
+ }
10209
+
10029
10210
  // ../server/src/index.ts
10030
10211
  dotenv.config({ quiet: true });
10031
10212
  if (process.env["RUNEYA_DATA_DIR"]) {
@@ -10103,7 +10284,19 @@ if (import.meta.url === `file://${process.argv[1]}`) {
10103
10284
  export {
10104
10285
  PullEnvError,
10105
10286
  createLocalServer,
10287
+ killInstance,
10288
+ listInstances,
10289
+ listTrayServices,
10290
+ networkInfo,
10291
+ onTrayServicesChanged,
10106
10292
  pullEnv,
10107
- registerInstance
10293
+ registerCli as registerCliLocation,
10294
+ registerInstance,
10295
+ restartInstance,
10296
+ restartProcess,
10297
+ scheduleSelfRestart,
10298
+ setLanMode,
10299
+ startProcess,
10300
+ stopProcess
10108
10301
  };
10109
- //# sourceMappingURL=src-HZ2XO6TV.js.map
10302
+ //# sourceMappingURL=src-V7DPPFCF.js.map