@runeya/runeya 2.0.101 → 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 (287) hide show
  1. package/agent/index.js +170 -161
  2. package/agent/index.js.map +1 -1
  3. package/agent-manager-OWHTBG46.js +9 -0
  4. package/assets/icon-alert.ico +0 -0
  5. package/assets/icon-alert.png +0 -0
  6. package/assets/icon-alert.svg +19 -0
  7. package/chat-JZ4UQDWV.js +20 -0
  8. package/{node-B4T3JMM3.js → chunk-B7MABGQN.js} +51 -4
  9. package/chunk-B7MABGQN.js.map +1 -0
  10. package/chunk-KY6KYSOU.js +279 -0
  11. package/chunk-KY6KYSOU.js.map +1 -0
  12. package/{chunk-TNBMCKQX.js → chunk-NZNIWJDT.js} +226 -23
  13. package/chunk-NZNIWJDT.js.map +1 -0
  14. package/chunk-PH4E5WDN.js +137 -0
  15. package/chunk-PH4E5WDN.js.map +1 -0
  16. package/{chunk-BHLCBARP.js → chunk-QIBUMYR6.js} +29 -11
  17. package/chunk-QIBUMYR6.js.map +1 -0
  18. package/{chunk-NDO5VFZY.js → chunk-QRMG6GMX.js} +694 -917
  19. package/chunk-QRMG6GMX.js.map +1 -0
  20. package/{chunk-SP3IC2TR.js → chunk-UYOWIH4R.js} +39 -221
  21. package/chunk-UYOWIH4R.js.map +1 -0
  22. package/{chunk-F3HKV5AU.js → chunk-Z67WBWKD.js} +7 -5
  23. package/{chunk-F3HKV5AU.js.map → chunk-Z67WBWKD.js.map} +1 -1
  24. package/{companion-QNW7XA6X.js → companion-6J6NK7H7.js} +7 -4
  25. package/{desktop-launcher-FHNURZA7.js → desktop-launcher-N7WRF3LC.js} +11 -17
  26. package/desktop-launcher-N7WRF3LC.js.map +1 -0
  27. package/index.js +65 -3
  28. package/index.js.map +1 -1
  29. package/instances-command-KZ5UGXOR.js +17 -0
  30. package/node-ILM6MV56.js +21 -0
  31. package/node-ILM6MV56.js.map +1 -0
  32. package/package.json +4 -1
  33. package/settings-manager-NZV26BC3.js +9 -0
  34. package/settings-manager-NZV26BC3.js.map +1 -0
  35. package/{src-PF23DMAB.js → src-V7DPPFCF.js} +454 -255
  36. package/src-V7DPPFCF.js.map +1 -0
  37. package/tray-TRWZNOUD.js +291 -0
  38. package/tray-TRWZNOUD.js.map +1 -0
  39. package/web/assets/AgentScalarChatInterface.vue-CvG5ha3R.js +13 -0
  40. package/web/assets/AgentTerminalPage-DcGppuzO.js +1 -0
  41. package/web/assets/AiChatPage-BDr5tG0A.js +1 -0
  42. package/web/assets/{AppLayout-DeWqCLuK.css → AppLayout-CYQBjQBU.css} +1 -1
  43. package/web/assets/AppLayout-Dv3ViAk2.js +1 -0
  44. package/web/assets/AuditPage-Bc2jlgZJ.js +1 -0
  45. package/web/assets/CloudAccountPage-4BLXSOix.js +1 -0
  46. package/web/assets/CloudAccountPage-B3MX6DNn.js +1 -0
  47. package/web/assets/CloudMessagingPage-CVzUalxx.js +2 -0
  48. package/web/assets/DashboardPage-Bo51pbzt.js +1 -0
  49. package/web/assets/DirectoryPickerDialog-CIVjWKUm.js +1 -0
  50. package/web/assets/{EditorIcon-BXS2-yX1.js → EditorIcon-BguaWtZg.js} +2 -2
  51. package/web/assets/{EnvironmentForm--y9zfCDt.js → EnvironmentForm-D8dq0ffR.js} +2 -2
  52. package/web/assets/EnvironmentFormPage-d8p3q8Yt.js +1 -0
  53. package/web/assets/EnvironmentListPage-DWo2lWjE.js +1 -0
  54. package/web/assets/KanbanBoardPage-DkwIz3J1.js +4 -0
  55. package/web/assets/KanbanListPage-xIQRLcrS.js +1 -0
  56. package/web/assets/LaunchProjectPage-CXWixUmf.js +1 -0
  57. package/web/assets/LaunchServicesPage-nv-chYgX.js +1 -0
  58. package/web/assets/LogViewer-DLupfjjf.js +3 -0
  59. package/web/assets/OrgKeyPrompt-DePcB-8f.js +1 -0
  60. package/web/assets/ProcessControls-D3zTnHb2.js +1 -0
  61. package/web/assets/ProcessDetailPage-CgVGzRoJ.js +1 -0
  62. package/web/assets/{ProcessMetrics-fCxhXJgd.js → ProcessMetrics-Dwd5lzqY.js} +2 -2
  63. package/web/assets/ProjectDetailPage-HR20KyJ3.js +1 -0
  64. package/web/assets/ProjectListPage-DcH4uTTX.js +1 -0
  65. package/web/assets/RandomJobTestPage-BYTkVcdE.js +2 -0
  66. package/web/assets/ScenarioEditorPage-zRxR03Ud.js +14 -0
  67. package/web/assets/SendToChatDialog-Cm5eKBOb.js +1 -0
  68. package/web/assets/ServiceControlsBar-oBpAP9yX.js +1 -0
  69. package/web/assets/ServiceDetailPage-CahBi-or.js +2 -0
  70. package/web/assets/ServiceFormPage-DfmPM_mI.js +1 -0
  71. package/web/assets/SettingsPage-CDMXFJ4k.js +2063 -0
  72. package/web/assets/SettingsPage-Dw6tbcbw.css +1 -0
  73. package/web/assets/UnlockPage-BUyBEPzQ.js +1 -0
  74. package/web/assets/VariablesTable-Dc6CyVQW.js +1 -0
  75. package/web/assets/VaultMigrationPage-BUmzyDXN.js +1 -0
  76. package/web/assets/VersionBadge-Dx_67FtC.js +1 -0
  77. package/web/assets/WikiPage-DEMJLDpD.js +1 -0
  78. package/web/assets/WikiView-CcrQ2ySx.js +1 -0
  79. package/web/assets/add-scalar-classes-M_EBdf4f.js +387 -0
  80. package/web/assets/{autocomplete-AALxfd-8.js → autocomplete-QtPLLzzV.js} +3 -3
  81. package/web/assets/{basic-shape-diamond.svg-C4c3Deqh.js → basic-shape-diamond.svg-Dyx8FJkS.js} +1 -1
  82. package/web/assets/{basic-shape-hexagon.svg-DrH21BpW.js → basic-shape-hexagon.svg-1RKdVP3_.js} +1 -1
  83. package/web/assets/{basic-shape-primary-circle-ellipse-round.svg-DqIU3Cmf.js → basic-shape-primary-circle-ellipse-round.svg-CSa69hok.js} +1 -1
  84. package/web/assets/{basic-shape-primary-square-rectangle.svg-B3gDug6x.js → basic-shape-primary-square-rectangle.svg-B9TXktd4.js} +1 -1
  85. package/web/assets/{basic-shape-shield.svg-DdNJhKim.js → basic-shape-shield.svg-BZvKXoiw.js} +1 -1
  86. package/web/assets/{browser-DlwaOVwW.js → browser-CYeKc8Uo.js} +1 -1
  87. package/web/assets/{browser-IqQiUipW.js → browser-VlhbsseI.js} +1 -1
  88. package/web/assets/card-tEWfv-Op.js +32 -0
  89. package/web/assets/{checkbox-BP6nucdt.js → checkbox-CyPqKR6H.js} +3 -3
  90. package/web/assets/{chip-zQCMXVbm.js → chip-wM0gJ_FI.js} +2 -2
  91. package/web/assets/client-B919VgbS.js +24 -0
  92. package/web/assets/cloud-chat.store-C-A9nIqG.js +1 -0
  93. package/web/assets/cloud-session-g6ewm0UI.js +1 -0
  94. package/web/assets/column-DihIO4Zd.js +907 -0
  95. package/web/assets/{computer-device-desktop-monitor.svg-D28gfKH3.js → computer-device-desktop-monitor.svg-ClbIVuot.js} +1 -1
  96. package/web/assets/{computer-device-desktop.svg-BierhytR.js → computer-device-desktop.svg-CXpOovTP.js} +1 -1
  97. package/web/assets/{computer-device-laptop.svg-Buh46ofO.js → computer-device-laptop.svg-C9sY1wZv.js} +1 -1
  98. package/web/assets/{computer-device-mobile-phone-android-samsung-back.svg-DWgP259U.js → computer-device-mobile-phone-android-samsung-back.svg-CPWC2QHX.js} +1 -1
  99. package/web/assets/{computer-device-mobile-phone-android-samsung.svg-BlulLqG-.js → computer-device-mobile-phone-android-samsung.svg-B0H-mnfh.js} +1 -1
  100. package/web/assets/{computer-device-mobile-phone-iphone-x-back.svg-CwAgL_XU.js → computer-device-mobile-phone-iphone-x-back.svg-BbIunxoN.js} +1 -1
  101. package/web/assets/{computer-device-mobile-phone-iphone-x.svg-CGZk25hI.js → computer-device-mobile-phone-iphone-x.svg-qLGK_oVA.js} +1 -1
  102. package/web/assets/{computer-device-mobile-tablet-touch.svg-BW41ZuCA.js → computer-device-mobile-tablet-touch.svg-BDpuB6SD.js} +1 -1
  103. package/web/assets/{computer-device-mobile-tablet.svg-BXG04cxV.js → computer-device-mobile-tablet.svg-44THWP9E.js} +1 -1
  104. package/web/assets/{computer-device-network-ethernet-cat6.svg-BKUwbZI3.js → computer-device-network-ethernet-cat6.svg-tlgWltl_.js} +1 -1
  105. package/web/assets/{computer-device-network-lan-www.svg-o3B9PLqQ.js → computer-device-network-lan-www.svg-Bd7Ch4QN.js} +1 -1
  106. package/web/assets/{computer-device-network-wifi-connection.svg-CWz616VA.js → computer-device-network-wifi-connection.svg-D_XjoY-a.js} +1 -1
  107. package/web/assets/{computer-device-network-wifi-router.svg-C_Uxv8x_.js → computer-device-network-wifi-router.svg-BRpuwgUx.js} +1 -1
  108. package/web/assets/{cssMode-trDHQWjr.js → cssMode-D0M5mbRd.js} +1 -1
  109. package/web/assets/{divider-ER7evOrG.js → divider-gPnMjjpJ.js} +2 -2
  110. package/web/assets/{docx-preview-DaBMrB0t.js → docx-preview-CBPtwrA0.js} +1 -1
  111. package/web/assets/{ecology-science-erlenmeyer-flask.svg-TilKtHh2.js → ecology-science-erlenmeyer-flask.svg-CZ3uUeBT.js} +1 -1
  112. package/web/assets/{fieldset-BK4Kpi7y.js → fieldset-BSGgRmpr.js} +2 -2
  113. package/web/assets/{freemarker2-CPBy2gHY.js → freemarker2-BWsK2SIi.js} +1 -1
  114. package/web/assets/{handlebars-sFv_MRko.js → handlebars-CHNB1gG0.js} +1 -1
  115. package/web/assets/{html-CvDf5B_n.js → html-COwA9Dtl.js} +1 -1
  116. package/web/assets/{htmlMode-CKhs4g6W.js → htmlMode-gZ2_PUDA.js} +1 -1
  117. package/web/assets/{image-flash-lightning.svg-CkgasY6E.js → image-flash-lightning.svg-Iiwm_7-K.js} +1 -1
  118. package/web/assets/{image-picture-flower.svg-Csk-7jkE.js → image-picture-flower.svg-BP9U6YP8.js} +1 -1
  119. package/web/assets/{index-BmdsyJ54.css → index-DWQLzWm4.css} +1 -1
  120. package/web/assets/{index-CdghDQiK.js → index-mBPGEldp.js} +285 -285
  121. package/web/assets/{interface-alert-exclamation-diamond.svg-rH1JAriw.js → interface-alert-exclamation-diamond.svg-BYWgnbUp.js} +1 -1
  122. package/web/assets/{interface-alert-exclamation-triangle-warning.svg-BuZLBc2z.js → interface-alert-exclamation-triangle-warning.svg-CWGfXHx_.js} +1 -1
  123. package/web/assets/{interface-alert-information-circle.svg-D6i0hGVN.js → interface-alert-information-circle.svg-88Bga8qr.js} +1 -1
  124. package/web/assets/{interface-award-crown.svg-7Wu9-VKO.js → interface-award-crown.svg-3hO77oiy.js} +1 -1
  125. package/web/assets/{interface-bookmark.svg-CkLVcfT6.js → interface-bookmark-tag.svg-DcHwQsr0.js} +1 -1
  126. package/web/assets/{interface-bookmark-tag.svg-CPiMqQ77.js → interface-bookmark.svg-SfHcE95h.js} +1 -1
  127. package/web/assets/{interface-calendar-date-one.svg-CFSXAk1b.js → interface-calendar-date-one.svg-DdXOM9VZ.js} +1 -1
  128. package/web/assets/{interface-content-book-open-pages.svg-CC4c9Opt.js → interface-content-book-open-pages.svg-DD7QTDn_.js} +1 -1
  129. package/web/assets/{interface-content-book-page.svg-DxpVNOOq.js → interface-content-book-page.svg-Dd45mFzB.js} +1 -1
  130. package/web/assets/{interface-content-file.svg-CTaWk4im.js → interface-content-file.svg-slPoMF5K.js} +1 -1
  131. package/web/assets/interface-content-folder.svg-D90zbTLh.js +1 -0
  132. package/web/assets/{interface-content-folder.svg-uVUoz9w-.js → interface-content-folder.svg-cSgXwhRh.js} +1 -1
  133. package/web/assets/{interface-copy-clipboard.svg-BZIxAN3r.js → interface-copy-clipboard.svg-DNy0VeWx.js} +1 -1
  134. package/web/assets/{interface-edit-attachment.svg-DDzPxeNm.js → interface-edit-attachment.svg-VyCAm1jc.js} +1 -1
  135. package/web/assets/{interface-edit-binocular.svg-CZsgbA--.js → interface-edit-binocular.svg-DA6QB2sn.js} +1 -1
  136. package/web/assets/{interface-edit-magic-wand.svg-qmz7k4l6.js → interface-edit-magic-wand.svg-D0uagBk7.js} +1 -1
  137. package/web/assets/{interface-edit-tool-paint-roller.svg-DWE25KT2.js → interface-edit-tool-paint-roller.svg-ConlubSG.js} +1 -1
  138. package/web/assets/{interface-edit-tool-pencil.svg-DpK1C2tO.js → interface-edit-tool-pencil.svg-BgNzCwXf.js} +1 -1
  139. package/web/assets/{interface-favorite-award.svg-CLHMWnh1.js → interface-favorite-award.svg-MLL88pIy.js} +1 -1
  140. package/web/assets/{interface-favorite-flag.svg-CHGIAa-e.js → interface-favorite-flag.svg-ZhM_9XJZ.js} +1 -1
  141. package/web/assets/{interface-favorite-heart.svg-ymL9Qidy.js → interface-favorite-heart.svg-Cqq1PV9O.js} +1 -1
  142. package/web/assets/{interface-favorite-star.svg-C4JDKdUr.js → interface-favorite-star.svg-YumblcRD.js} +1 -1
  143. package/web/assets/{interface-favorite-stars-sparkles.svg-DRixMNWJ.js → interface-favorite-stars-sparkles.svg-BH5BXXOe.js} +1 -1
  144. package/web/assets/{interface-hierarchy-flowchart.svg-DozpERYh.js → interface-hierarchy-flowchart.svg-CEfCPIyC.js} +1 -1
  145. package/web/assets/{interface-home-house.svg-DpUEVY7I.js → interface-home-house.svg-DJE_g94c.js} +1 -1
  146. package/web/assets/{interface-hyperlink.svg-BI9P67ny.js → interface-hyperlink.svg-BFhnDXDD.js} +1 -1
  147. package/web/assets/{interface-lighting-brightness.svg-B6WWS4kG.js → interface-lighting-brightness.svg-NwOV0KEv.js} +1 -1
  148. package/web/assets/{interface-lock-closed.svg-BBQ9XM_j.js → interface-lock-closed.svg-qVkplX0W.js} +1 -1
  149. package/web/assets/{interface-lock-open-unlock.svg-GkTO8GmV.js → interface-lock-open-unlock.svg-D18OlPEP.js} +1 -1
  150. package/web/assets/{interface-login-key.svg--v2ZJH3Q.js → interface-login-key.svg-CccXX7_b.js} +1 -1
  151. package/web/assets/{interface-search.svg-CidqkApV.js → interface-search.svg-C6ncELaU.js} +1 -1
  152. package/web/assets/{interface-setting-cog.svg-DVZePAV3.js → interface-setting-cog.svg-5LrIeBav.js} +1 -1
  153. package/web/assets/{interface-share-megaphone-bullhorn.svg-BFn_RMqc.js → interface-share-megaphone-bullhorn.svg-C-qB4VYi.js} +1 -1
  154. package/web/assets/{interface-share-rocket.svg-BvWSz0s2.js → interface-share-rocket.svg-Citzuyng.js} +1 -1
  155. package/web/assets/{interface-share-satellite.svg-tqNCB74Z.js → interface-share-satellite.svg-BldpdKdo.js} +1 -1
  156. package/web/assets/{interface-share-space-ship.svg-BmB824fS.js → interface-share-space-ship.svg-B_Ni34rB.js} +1 -1
  157. package/web/assets/{interface-share.svg-CBZLrrF9.js → interface-share.svg-FAt7Kgad.js} +1 -1
  158. package/web/assets/{interface-signal-square.svg-C088p9NZ.js → interface-signal-square.svg-DeBP6Pim.js} +1 -1
  159. package/web/assets/{interface-time-clock-circle.svg-DubKvXWQ.js → interface-time-clock-circle.svg-dQfNY8BC.js} +1 -1
  160. package/web/assets/{interface-time-hour-glass.svg-6GComyAL.js → interface-time-hour-glass.svg-ylbFnlwY.js} +1 -1
  161. package/web/assets/{interface-users-multiple.svg-ja6OEhK_.js → interface-users-multiple.svg-DXts3WMC.js} +1 -1
  162. package/web/assets/{interface-weather-moon.svg-BnfLL03K.js → interface-weather-moon.svg-BG6mjCih.js} +1 -1
  163. package/web/assets/{javascript-DMRS72rt.js → javascript-C_ENjImO.js} +1 -1
  164. package/web/assets/{jsonMode--8QdTWx_.js → jsonMode-Bt-LEknD.js} +2 -2
  165. package/web/assets/{liquid-OaGt-c-G.js → liquid-CVshgHmY.js} +1 -1
  166. package/web/assets/{lspLanguageFeatures-B6AaNVcR.js → lspLanguageFeatures-D1e-RcOs.js} +3 -3
  167. package/web/assets/{mail-chat-bubble-square.svg-D0WUmEWq.js → mail-chat-bubble-square.svg-RUMLqiUI.js} +1 -1
  168. package/web/assets/{mail-send-email-paper-airplane.svg--9oR8FgG.js → mail-send-email-paper-airplane.svg-JDe3yqOH.js} +1 -1
  169. package/web/assets/{mail-send-envelope.svg-D7zYusS0.js → mail-send-envelope.svg-CCzWaeO-.js} +1 -1
  170. package/web/assets/{mdx-ChDcRRYd.js → mdx-D9G2-Bj8.js} +1 -1
  171. package/web/assets/{minus-lcNwQ3xr.js → minus-BMxEQL_C.js} +2 -2
  172. package/web/assets/modal-CZ7zYg5t.js +1 -0
  173. package/web/assets/modal-CmpFIC5N.js +5 -0
  174. package/web/assets/{money-cashier-receipt.svg-DzX-iwUT.js → money-cashier-receipt.svg-DfbOr89U.js} +1 -1
  175. package/web/assets/{money-currency-dollar-pay.svg-BFX_YTDc.js → money-currency-dollar-pay.svg-DY7fQ7jz.js} +1 -1
  176. package/web/assets/{money-graph-arrow-increase.svg-C16MfYnR.js → money-graph-arrow-increase.svg-jewlEZEL.js} +1 -1
  177. package/web/assets/{money-graph-bar-chart-increase.svg-BGG0yv-f.js → money-graph-bar-chart-increase.svg-BChD8dZv.js} +1 -1
  178. package/web/assets/multiselect-CoRzeHvy.js +251 -0
  179. package/web/assets/{nature-ecology-leaf.svg-DiIaC6NX.js → nature-ecology-leaf.svg-AQimnw3F.js} +1 -1
  180. package/web/assets/{password-BZlCIV8S.js → password-4Ykb_Ejn.js} +4 -4
  181. package/web/assets/{phone-telephone.svg-udmmRh0q.js → phone-telephone.svg-BdkwIhmo.js} +1 -1
  182. package/web/assets/{plus-CwmVHUki.js → plus-CYVYZlQL.js} +6 -6
  183. package/web/assets/process.store-CtXpHndZ.js +1 -0
  184. package/web/assets/{programming-bug.svg-xc1RtL3c.js → programming-bug.svg-DzT817WD.js} +1 -1
  185. package/web/assets/{programming-cloud.svg-axQALbJB.js → programming-cloud.svg-eKZD46YP.js} +1 -1
  186. package/web/assets/{programming-computer-database-server.svg-BVTqxH42.js → programming-computer-database-server.svg-BXOhjcQy.js} +1 -1
  187. package/web/assets/{programming-computer-database.svg-B-CECn7V.js → programming-computer-database.svg-DUzhimFY.js} +1 -1
  188. package/web/assets/{programming-module-four-layout.svg-icO9mDmE.js → programming-module-four-layout.svg-CYGX7Rlj.js} +1 -1
  189. package/web/assets/{programming-module-three.svg-D2zllUcw.js → programming-module-three.svg-BhQr1m-R.js} +1 -1
  190. package/web/assets/{programming-module.svg-gs4eO8gC.js → programming-module.svg-Bik697Ne.js} +1 -1
  191. package/web/assets/{programming-script-code.svg-BGMrS9je.js → programming-script-code.svg-BaTanEvH.js} +1 -1
  192. package/web/assets/{python-C1ZGhTnT.js → python-wDvaXe-V.js} +1 -1
  193. package/web/assets/{razor-Dxwwpjwp.js → razor-C-cEFJP1.js} +1 -1
  194. package/web/assets/router-CqYmBKhe.js +1 -0
  195. package/web/assets/settings-scope-DD7SbjFz.js +1 -0
  196. package/web/assets/settings.store-DcQmvBBv.js +1 -0
  197. package/web/assets/{shopping-cart.svg-DajW_J8z.js → shopping-cart.svg-BwUFrGEq.js} +1 -1
  198. package/web/assets/{shopping-gift-present.svg-yAHWXZYl.js → shopping-gift-present.svg-Bs4b94QF.js} +1 -1
  199. package/web/assets/{shopping-shipping-box-parcel-package.svg-BmpCCkbe.js → shopping-shipping-box-parcel-package.svg-DhVaYapE.js} +1 -1
  200. package/web/assets/{src-CabNenEM.js → src-CpoqK21I.js} +13 -13
  201. package/web/assets/src-De5rZb3_.js +1 -0
  202. package/web/assets/src-NB2ZR0ON.js +572 -0
  203. package/web/assets/tabpanel-DMt8G5AA.js +150 -0
  204. package/web/assets/{tag-new-circle.svg-BHHc5iei.js → tag-new-circle.svg-B4Z8uL1_.js} +1 -1
  205. package/web/assets/{toggleswitch-CJCNFliH.js → toggleswitch-CawhRFb7.js} +2 -2
  206. package/web/assets/{travel-map-earth-globe.svg-CHj70cli.js → travel-map-earth-globe.svg-D0s5cc-W.js} +1 -1
  207. package/web/assets/trpc-B17uPEkC.js +1 -0
  208. package/web/assets/{tsMode-DHXchBsw.js → tsMode-NHDuTjcd.js} +5 -5
  209. package/web/assets/{typescript-BVTudzDT.js → typescript-DGkgFTtn.js} +1 -1
  210. package/web/assets/useAiChatDrawer-BxE6EYFc.js +1 -0
  211. package/web/assets/{useCloudOrg-BN-OgVim.js → useCloudOrg-BJTjZPZ9.js} +1 -1
  212. package/web/assets/useProjectCatalog-DifZyVY5.js +1 -0
  213. package/web/assets/useProjectCloudOrg-EvyyjH6E.js +1 -0
  214. package/web/assets/{xml-5T1ybYUZ.js → xml-CJaXEqLW.js} +1 -1
  215. package/web/assets/{yaml-w_H4D4RN.js → yaml-bl8i8xOf.js} +1 -1
  216. package/web/index.html +2 -2
  217. package/agent-manager-SNVPZNLC.js +0 -8
  218. package/chat-RWOZHXBX.js +0 -18
  219. package/chunk-BHLCBARP.js.map +0 -1
  220. package/chunk-NDO5VFZY.js.map +0 -1
  221. package/chunk-SP3IC2TR.js.map +0 -1
  222. package/chunk-TNBMCKQX.js.map +0 -1
  223. package/desktop-launcher-FHNURZA7.js.map +0 -1
  224. package/node-B4T3JMM3.js.map +0 -1
  225. package/settings-manager-YHQ5YHUH.js +0 -8
  226. package/src-PF23DMAB.js.map +0 -1
  227. package/web/assets/AgentScalarChatInterface.vue-CpCuXAXu.js +0 -13
  228. package/web/assets/AgentTerminalPage-D8nMHtlG.js +0 -1
  229. package/web/assets/AiChatPage-C1FbL-Tb.js +0 -1
  230. package/web/assets/AppLayout-Dq-1shm9.js +0 -1
  231. package/web/assets/AuditPage-BjeeYf1P.js +0 -1
  232. package/web/assets/CloudAccountPage-BWcXUmZ3.js +0 -1
  233. package/web/assets/CloudAccountPage-CsNnjZQN.js +0 -1
  234. package/web/assets/CloudMessagingPage-CN-Hkvzf.js +0 -2
  235. package/web/assets/DashboardPage-30yBzA9Y.js +0 -1
  236. package/web/assets/DirectoryPickerDialog-BsYJrTG4.js +0 -1
  237. package/web/assets/EnvironmentFormPage-BETc1RGi.js +0 -1
  238. package/web/assets/EnvironmentListPage-CC0Sj1bx.js +0 -1
  239. package/web/assets/KanbanBoardPage-BdM0Op1M.js +0 -4
  240. package/web/assets/KanbanListPage-DM7RJqhx.js +0 -1
  241. package/web/assets/LaunchProjectPage-DXqYYycZ.js +0 -1
  242. package/web/assets/LaunchServicesPage-DCgwv5Pt.js +0 -1
  243. package/web/assets/LogViewer-CFSU-CNC.js +0 -3
  244. package/web/assets/OrgKeyPrompt-DQGyKSjb.js +0 -1
  245. package/web/assets/ProcessControls-98bxX4aW.js +0 -1
  246. package/web/assets/ProcessDetailPage-Bb_3RScY.js +0 -1
  247. package/web/assets/ProjectDetailPage-BNmbecE0.js +0 -1
  248. package/web/assets/ProjectListPage-v0JqfkPz.js +0 -1
  249. package/web/assets/RandomJobTestPage-D8q-EREO.js +0 -2
  250. package/web/assets/ScenarioEditorPage-D3EuMMBn.js +0 -14
  251. package/web/assets/SendToChatDialog-D-x5Pn3F.js +0 -1
  252. package/web/assets/ServiceControlsBar-7zKkkVxM.js +0 -1
  253. package/web/assets/ServiceDetailPage-jzYoqD5E.js +0 -2
  254. package/web/assets/ServiceFormPage-DjvOpPyE.js +0 -1
  255. package/web/assets/SettingsPage-C-OfBHjn.css +0 -1
  256. package/web/assets/SettingsPage-DKCbzYvF.js +0 -2063
  257. package/web/assets/UnlockPage-Cb43bz4p.js +0 -1
  258. package/web/assets/VariablesTable-C3syeLAl.js +0 -1
  259. package/web/assets/VaultMigrationPage-Cp-au3d7.js +0 -1
  260. package/web/assets/VersionBadge-CXX3tlKI.js +0 -1
  261. package/web/assets/WikiPage-D1at3ltm.js +0 -1
  262. package/web/assets/WikiView-ClZwZbal.js +0 -1
  263. package/web/assets/add-scalar-classes-D3kr5_fn.js +0 -387
  264. package/web/assets/card-q6s0jc6V.js +0 -32
  265. package/web/assets/client-BC-o8Mr9.js +0 -24
  266. package/web/assets/cloud-chat.store-387arRb5.js +0 -1
  267. package/web/assets/cloud-session-yejC3TfS.js +0 -1
  268. package/web/assets/column-ClizzdF5.js +0 -907
  269. package/web/assets/interface-content-folder.svg-BYgaYshM.js +0 -1
  270. package/web/assets/modal-4qFfZ_TY.js +0 -1
  271. package/web/assets/modal-TVJrDDCj.js +0 -5
  272. package/web/assets/multiselect-DcAoSG6S.js +0 -251
  273. package/web/assets/process.store-C8qfdRYx.js +0 -1
  274. package/web/assets/router-HZS_HREn.js +0 -1
  275. package/web/assets/settings-scope-DUmfNusx.js +0 -1
  276. package/web/assets/settings.store-Da4jL17l.js +0 -1
  277. package/web/assets/src-C-5koINO.js +0 -1
  278. package/web/assets/src-LFVDgykP.js +0 -572
  279. package/web/assets/tabpanel-D8XwziwN.js +0 -150
  280. package/web/assets/trpc-BeVJWlZK.js +0 -1
  281. package/web/assets/useAiChatDrawer-CFqm3BZi.js +0 -1
  282. package/web/assets/useProjectCatalog-sUfCxDEh.js +0 -1
  283. package/web/assets/useProjectCloudOrg-D1GcLai_.js +0 -1
  284. /package/{agent-manager-SNVPZNLC.js.map → agent-manager-OWHTBG46.js.map} +0 -0
  285. /package/{chat-RWOZHXBX.js.map → chat-JZ4UQDWV.js.map} +0 -0
  286. /package/{companion-QNW7XA6X.js.map → companion-6J6NK7H7.js.map} +0 -0
  287. /package/{settings-manager-YHQ5YHUH.js.map → instances-command-KZ5UGXOR.js.map} +0 -0
@@ -11,7 +11,6 @@ import {
11
11
  NameSchema,
12
12
  OPENAI_COMPAT_BASE_URLS,
13
13
  OptionalProviderIdSchema,
14
- activeSessionRegistry,
15
14
  apiKeyStore,
16
15
  appVersion,
17
16
  applyPersistedLanMode,
@@ -58,9 +57,14 @@ import {
58
57
  shutdownCodexAppServer,
59
58
  startCliSession,
60
59
  vaultOfProject
61
- } from "./chunk-SP3IC2TR.js";
60
+ } from "./chunk-UYOWIH4R.js";
61
+ import {
62
+ resolveCliInvocation,
63
+ whichCommand
64
+ } from "./chunk-B7MABGQN.js";
62
65
  import {
63
66
  LocalProjectExistsError,
67
+ activeSessionRegistry,
64
68
  companionDefaultPrompt,
65
69
  companionSettings,
66
70
  conversationStore,
@@ -76,8 +80,7 @@ import {
76
80
  stopClaudeTranscriptWatcher,
77
81
  stopCodexTranscriptWatcher,
78
82
  verifyJwt
79
- } from "./chunk-TNBMCKQX.js";
80
- import "./chunk-MD3VW4HQ.js";
83
+ } from "./chunk-NZNIWJDT.js";
81
84
  import {
82
85
  agentManager,
83
86
  agentSpawner,
@@ -103,6 +106,7 @@ import {
103
106
  listInstances,
104
107
  loadFromEnv,
105
108
  markVaultLocked,
109
+ onVaultUnlocked,
106
110
  projectKey,
107
111
  registerInstance,
108
112
  restartInstance,
@@ -114,10 +118,29 @@ import {
114
118
  stableEncryptValue,
115
119
  traefikManager,
116
120
  unregisterInstance
117
- } from "./chunk-BHLCBARP.js";
121
+ } from "./chunk-QIBUMYR6.js";
118
122
  import {
119
123
  settingsManager
120
- } 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";
121
144
  import {
122
145
  AGENT_LONG_FETCH_TIMEOUT,
123
146
  AGENT_STOP_FETCH_TIMEOUT,
@@ -141,28 +164,14 @@ import {
141
164
  UpdateEnvironmentSchema,
142
165
  VariableOverrideSchema,
143
166
  VariableSchema,
144
- env,
145
- forgetOrgLogo,
167
+ deriveLauncherIdentity,
146
168
  getCollection,
147
- keyRoot,
148
- legacyMachineFilePath,
149
- legacyVaultRoot,
150
- listCloudVaults,
151
- listOrgVaults,
152
- machineFilePath,
153
- machineRoot,
154
169
  nativeParsers,
155
- orgVaultRoot,
156
- projectVaultRoot,
170
+ primaryServiceLink,
157
171
  readEntity,
158
- readOrgClouds,
159
- readOrgLogos,
160
- readOrgNames,
161
- rememberOrgLogo,
162
- rememberOrgName,
163
- stampOrgCloud,
164
172
  writeEntity
165
- } from "./chunk-NDO5VFZY.js";
173
+ } from "./chunk-QRMG6GMX.js";
174
+ import "./chunk-MD3VW4HQ.js";
166
175
 
167
176
  // ../server/src/create-server.ts
168
177
  import express from "express";
@@ -315,8 +324,8 @@ function resolveNpm() {
315
324
  // Unix : node est dans `bin/`, npm sous `lib/node_modules/`.
316
325
  join(nodeDir, "..", "lib", "node_modules", "npm", "bin", "npm-cli.js")
317
326
  ];
318
- for (const cli of candidates) {
319
- 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 };
320
329
  }
321
330
  return process.platform === "win32" ? { command: "npm.cmd", args: [], shell: true } : { command: "npm", args: [], shell: false };
322
331
  }
@@ -480,6 +489,27 @@ var changelogRouter = router({
480
489
  import { z as z4 } from "zod";
481
490
  import { TRPCError as TRPCError2 } from "@trpc/server";
482
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
+
483
513
  // ../server/src/services/org-keys.ts
484
514
  import { mkdir } from "fs/promises";
485
515
 
@@ -970,6 +1000,18 @@ var projectRouter = router({
970
1000
  * machine, and the cloud sync pushes projects wholesale — a path stored on the
971
1001
  * project itself would travel with it.
972
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
+ }),
973
1015
  localPaths: protectedProcedure.query(async () => {
974
1016
  return projectPathStore.all();
975
1017
  }),
@@ -1176,7 +1218,93 @@ var agentRouter = router({
1176
1218
 
1177
1219
  // ../server/src/trpc/routers/process.ts
1178
1220
  import { z as z6 } from "zod";
1221
+ import { TRPCError as TRPCError5 } from "@trpc/server";
1222
+
1223
+ // ../server/src/services/process-control.ts
1179
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
1180
1308
  var SUBSCRIPTION_QUEUE_MAX2 = LOG_BUFFER_SIZE;
1181
1309
  async function* forwardEvents(eventName, filter) {
1182
1310
  const queue = [];
@@ -1238,28 +1366,13 @@ async function* forwardLogBatches(agentId, processId) {
1238
1366
  }
1239
1367
  var processRouter = router({
1240
1368
  /** List all processes across all connected agents */
1241
- list: protectedProcedure.meta({ openapi: { method: "GET", path: "/processes", tags: ["processes"], summary: "List all processes", protect: true } }).output(z6.any()).query(async () => {
1242
- const agents = agentManager.listAgents();
1243
- const results = [];
1244
- await Promise.allSettled(
1245
- agents.filter((a) => a.status.connected).map(async (a) => {
1246
- try {
1247
- const processes = await agentManager.agentQuery(a.config.id, "process.list");
1248
- for (const proc of processes) {
1249
- results.push({ ...proc, agentId: a.config.id });
1250
- }
1251
- } catch {
1252
- }
1253
- })
1254
- );
1255
- return results;
1256
- }),
1369
+ list: protectedProcedure.meta({ openapi: { method: "GET", path: "/processes", tags: ["processes"], summary: "List all processes", protect: true } }).output(z6.any()).query(() => listAllProcesses()),
1257
1370
  /** Get a single process from a specific agent */
1258
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 }) => {
1259
1372
  requireServiceAction(ctx, input.id, "service:read");
1260
1373
  const status = agentManager.getStatus(input.agentId);
1261
1374
  if (!status) {
1262
- 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` });
1263
1376
  }
1264
1377
  const proc = await agentManager.agentQuery(input.agentId, "process.get", { id: input.id });
1265
1378
  return { ...proc, agentId: input.agentId };
@@ -1271,82 +1384,19 @@ var processRouter = router({
1271
1384
  * The deploy call is idempotent — creates the process if missing, updates config if it exists. */
1272
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 }) => {
1273
1386
  requireServiceAction(ctx, input.processId, "service:start");
1274
- const service = await serviceStore.get(input.processId);
1275
- const effectiveAgentId = (service ? await resolveEffectiveAgentId(service) : null) ?? input.agentId ?? null;
1276
- if (!effectiveAgentId) {
1277
- throw new TRPCError4({ code: "BAD_REQUEST", message: "No agent assigned to this service. Set an agent on the service or on the active environment." });
1278
- }
1279
- if (service) {
1280
- try {
1281
- const resolved = await resolveServiceVariables(service);
1282
- await agentManager.agentMutation(effectiveAgentId, "process.deploy", resolved);
1283
- } catch (err) {
1284
- console.debug("[process-router] Failed to deploy before start for", input.processId + ":", err.message);
1285
- }
1286
- }
1287
- if (service?.clearLogsOnStart) {
1288
- try {
1289
- await agentManager.agentMutation(effectiveAgentId, "process.clearLogBuffer", { id: input.processId });
1290
- agentManager.emit("process:log", { agentId: effectiveAgentId, batch: [{ processId: input.processId, __clearLogBuffer: true }] });
1291
- } catch (err) {
1292
- console.debug("[process-router] Failed to clear logs before start for", input.processId + ":", err.message);
1293
- }
1294
- }
1295
- let result;
1296
- try {
1297
- result = await agentManager.agentMutation(effectiveAgentId, "process.start", { id: input.processId });
1298
- } catch (err) {
1299
- const err_ = err;
1300
- const isFetchError = err_?.cause?.code === "ECONNREFUSED" || err_?.message === "fetch failed" || err_?.name === "TypeError";
1301
- throw new TRPCError4({
1302
- code: "INTERNAL_SERVER_ERROR",
1303
- message: isFetchError ? `Cannot reach agent \u2014 make sure the agent is running` : err_?.message ?? "Failed to start process"
1304
- });
1305
- }
1306
- await auditService.log({ userId: "local", action: "start", entityType: "process", entityId: input.processId, metadata: { agentId: effectiveAgentId } });
1307
- return { ...result, agentId: effectiveAgentId };
1387
+ return startProcess(input.processId, input.agentId);
1308
1388
  }),
1309
1389
  /** Stop a process on an agent */
1310
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 }) => {
1311
1391
  requireServiceAction(ctx, input.processId, "service:stop");
1312
- const result = await agentManager.agentMutation(input.agentId, "process.stop", { id: input.processId }, AGENT_STOP_FETCH_TIMEOUT);
1313
- await auditService.log({ userId: "local", action: "stop", entityType: "process", entityId: input.processId, metadata: { agentId: input.agentId } });
1314
- return { ...result, agentId: input.agentId };
1392
+ return stopProcess(input.processId, input.agentId);
1315
1393
  }),
1316
1394
  /** Restart a process on an agent.
1317
1395
  * Sends stop → deploy (latest resolved config) → start so that
1318
1396
  * config/variable changes take effect. Same lazy deploy pattern as start. */
1319
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 }) => {
1320
1398
  requireServiceAction(ctx, input.processId, "service:restart");
1321
- const service = await serviceStore.get(input.processId);
1322
- const effectiveAgentId = (service ? await resolveEffectiveAgentId(service) : null) ?? input.agentId ?? null;
1323
- if (!effectiveAgentId) {
1324
- throw new TRPCError4({ code: "BAD_REQUEST", message: "No agent assigned to this service. Set an agent on the service or on the active environment." });
1325
- }
1326
- try {
1327
- await agentManager.agentMutation(effectiveAgentId, "process.stop", { id: input.processId }, AGENT_STOP_FETCH_TIMEOUT);
1328
- } catch (err) {
1329
- console.debug("[process-router] Stop before restart ignored (process not found on agent?):", err.message);
1330
- }
1331
- if (service) {
1332
- try {
1333
- const resolved = await resolveServiceVariables(service);
1334
- await agentManager.agentMutation(effectiveAgentId, "process.deploy", resolved);
1335
- } catch (err) {
1336
- console.debug("[process-router] Failed to deploy before restart for", input.processId + ":", err.message);
1337
- }
1338
- }
1339
- if (service?.clearLogsOnStart) {
1340
- try {
1341
- await agentManager.agentMutation(effectiveAgentId, "process.clearLogBuffer", { id: input.processId });
1342
- agentManager.emit("process:log", { agentId: effectiveAgentId, batch: [{ processId: input.processId, __clearLogBuffer: true }] });
1343
- } catch (err) {
1344
- console.debug("[process-router] Failed to clear logs before restart for", input.processId + ":", err.message);
1345
- }
1346
- }
1347
- const result = await agentManager.agentMutation(effectiveAgentId, "process.start", { id: input.processId });
1348
- await auditService.log({ userId: "local", action: "restart", entityType: "process", entityId: input.processId, metadata: { agentId: effectiveAgentId } });
1349
- return { ...result, agentId: effectiveAgentId };
1399
+ return restartProcess(input.processId, input.agentId);
1350
1400
  }),
1351
1401
  /** Get buffered logs for a process from an agent */
1352
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 }) => {
@@ -1676,7 +1726,7 @@ var setupRouter = router({
1676
1726
 
1677
1727
  // ../server/src/trpc/routers/environment.ts
1678
1728
  import { z as z9 } from "zod";
1679
- import { TRPCError as TRPCError5 } from "@trpc/server";
1729
+ import { TRPCError as TRPCError6 } from "@trpc/server";
1680
1730
  var environmentRouter = router({
1681
1731
  list: protectedProcedure.input(z9.object({
1682
1732
  projectId: z9.string().max(128),
@@ -1686,7 +1736,7 @@ var environmentRouter = router({
1686
1736
  }),
1687
1737
  get: protectedProcedure.input(z9.object({ id: z9.string().max(128) })).query(async ({ input }) => {
1688
1738
  const env2 = await environmentStore.get(input.id);
1689
- 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` });
1690
1740
  return env2;
1691
1741
  }),
1692
1742
  listByScope: protectedProcedure.input(z9.object({
@@ -1736,9 +1786,9 @@ var environmentRouter = router({
1736
1786
  }),
1737
1787
  update: protectedProcedure.input(UpdateEnvironmentSchema).mutation(async ({ input }) => {
1738
1788
  const existing = await environmentStore.get(input.id);
1739
- 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` });
1740
1790
  const env2 = await environmentStore.update(input);
1741
- 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` });
1742
1792
  if (env2.scope === "global" && input.name && input.name !== existing.name) {
1743
1793
  const project = await projectStore.get(environmentStore.projectRefOf(env2) ?? env2.projectId);
1744
1794
  if (project) {
@@ -1754,22 +1804,22 @@ var environmentRouter = router({
1754
1804
  }),
1755
1805
  delete: protectedProcedure.input(z9.object({ id: z9.string().max(128) })).mutation(async ({ input }) => {
1756
1806
  const env2 = await environmentStore.get(input.id);
1757
- 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` });
1758
1808
  if (env2.immutable) {
1759
- throw new TRPCError5({ code: "FORBIDDEN", message: "Cannot delete immutable environment" });
1809
+ throw new TRPCError6({ code: "FORBIDDEN", message: "Cannot delete immutable environment" });
1760
1810
  }
1761
1811
  if (env2.scope === "global") {
1762
1812
  await environmentStore.deleteByActivateOn(input.id);
1763
1813
  }
1764
1814
  const deleted = await environmentStore.delete(input.id);
1765
- 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" });
1766
1816
  await projectStore.removeEnvironment(environmentStore.projectRefOf(env2) ?? env2.projectId, input.id);
1767
1817
  return { success: true };
1768
1818
  }),
1769
1819
  resolve: protectedProcedure.input(z9.object({ environmentId: z9.string().max(128) })).query(async ({ input, ctx }) => {
1770
1820
  const { includeSecrets } = requireEnvAction(ctx, input.environmentId, "env:read");
1771
1821
  const env2 = await environmentStore.get(input.environmentId);
1772
- 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` });
1773
1823
  const resolved = await environmentResolver.resolveEnvironmentWithSources(input.environmentId);
1774
1824
  if (!includeSecrets) {
1775
1825
  const sanitized = { ...resolved };
@@ -1788,7 +1838,7 @@ var environmentRouter = router({
1788
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 }) => {
1789
1839
  const { includeSecrets } = requireEnvAction(ctx, input.environmentId, "env:read");
1790
1840
  const env2 = await environmentStore.get(input.environmentId);
1791
- 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` });
1792
1842
  const { env: resolved, envSecrets } = await environmentResolver.resolveEnvironment(input.environmentId);
1793
1843
  const result = {};
1794
1844
  for (const [key, value] of Object.entries(resolved)) {
@@ -1826,9 +1876,9 @@ var environmentRouter = router({
1826
1876
  })).mutation(async ({ input, ctx }) => {
1827
1877
  requireEnvAction(ctx, input.environmentId, "env:write");
1828
1878
  const env2 = await environmentStore.get(input.environmentId);
1829
- 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` });
1830
1880
  const result = await environmentStore.upsertVariable(input.environmentId, input.variableId, input.variable);
1831
- 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" });
1832
1882
  return result;
1833
1883
  }),
1834
1884
  /**
@@ -1903,9 +1953,9 @@ var environmentRouter = router({
1903
1953
  variableId: z9.string().max(128)
1904
1954
  })).mutation(async ({ input }) => {
1905
1955
  const env2 = await environmentStore.get(input.environmentId);
1906
- 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` });
1907
1957
  const result = await environmentStore.removeVariable(input.environmentId, input.variableId);
1908
- 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" });
1909
1959
  return result;
1910
1960
  })
1911
1961
  });
@@ -1913,7 +1963,7 @@ var environmentRouter = router({
1913
1963
  // ../server/src/trpc/routers/settings.ts
1914
1964
  import { promises as dns } from "dns";
1915
1965
  import { z as z10 } from "zod";
1916
- import { TRPCError as TRPCError6 } from "@trpc/server";
1966
+ import { TRPCError as TRPCError7 } from "@trpc/server";
1917
1967
  var NotificationPreferencesPatchSchema = NotificationPreferencesSchema.partial().strict();
1918
1968
  function listWithOrigin(parsers, vault) {
1919
1969
  return [
@@ -1969,7 +2019,7 @@ var settingsRouter = router({
1969
2019
  try {
1970
2020
  return await setLanMode(input.enabled);
1971
2021
  } catch (err) {
1972
- throw new TRPCError6({
2022
+ throw new TRPCError7({
1973
2023
  code: "INTERNAL_SERVER_ERROR",
1974
2024
  message: `Impossible de changer l'adresse d'\xE9coute : ${err.message}`
1975
2025
  });
@@ -1979,9 +2029,9 @@ var settingsRouter = router({
1979
2029
  * Update settings (mode, cloudUrl)
1980
2030
  */
1981
2031
  update: protectedProcedure.input(SettingsSchema.pick({ mode: true, cloudUrl: true, globalDocsPath: true }).partial()).mutation(async ({ input }) => {
1982
- const current = await settingsManager.getSettings();
2032
+ const current2 = await settingsManager.getSettings();
1983
2033
  const updated = {
1984
- ...current,
2034
+ ...current2,
1985
2035
  ...input
1986
2036
  };
1987
2037
  await settingsManager.saveSettings(updated);
@@ -2071,7 +2121,7 @@ var settingsRouter = router({
2071
2121
  getParser: protectedProcedure.input(z10.object({ id: z10.string().max(128), ...ScopeShape })).query(async ({ input }) => {
2072
2122
  const parser = await logParserStore.get(input.id, await scopeOf(input));
2073
2123
  if (!parser) {
2074
- 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}` });
2075
2125
  }
2076
2126
  return parser;
2077
2127
  }),
@@ -2087,7 +2137,7 @@ var settingsRouter = router({
2087
2137
  ).mutation(async ({ input }) => {
2088
2138
  const { orgId, projectId, ...fields } = input;
2089
2139
  if (!fields.code.trim()) {
2090
- 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" });
2091
2141
  }
2092
2142
  return logParserStore.create(fields, await scopeOf({ orgId, projectId }));
2093
2143
  }),
@@ -2102,14 +2152,14 @@ var settingsRouter = router({
2102
2152
  ).mutation(async ({ input }) => {
2103
2153
  const { id, orgId, projectId, ...patch } = input;
2104
2154
  if (id.startsWith("native:")) {
2105
- throw new TRPCError6({ code: "FORBIDDEN", message: "Cannot modify built-in parsers" });
2155
+ throw new TRPCError7({ code: "FORBIDDEN", message: "Cannot modify built-in parsers" });
2106
2156
  }
2107
2157
  if (patch.code !== void 0 && !patch.code.trim()) {
2108
- 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" });
2109
2159
  }
2110
2160
  const updated = await logParserStore.update(id, patch, await scopeOf({ orgId, projectId }));
2111
2161
  if (!updated) {
2112
- throw new TRPCError6({ code: "NOT_FOUND", message: `Parser not found: ${id}` });
2162
+ throw new TRPCError7({ code: "NOT_FOUND", message: `Parser not found: ${id}` });
2113
2163
  }
2114
2164
  return updated;
2115
2165
  }),
@@ -2118,11 +2168,11 @@ var settingsRouter = router({
2118
2168
  */
2119
2169
  deleteParser: protectedProcedure.input(z10.object({ id: z10.string().max(128), ...ScopeShape })).mutation(async ({ input }) => {
2120
2170
  if (input.id.startsWith("native:")) {
2121
- throw new TRPCError6({ code: "FORBIDDEN", message: "Cannot delete built-in parsers" });
2171
+ throw new TRPCError7({ code: "FORBIDDEN", message: "Cannot delete built-in parsers" });
2122
2172
  }
2123
2173
  const deleted = await logParserStore.delete(input.id, await scopeOf(input));
2124
2174
  if (!deleted) {
2125
- 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}` });
2126
2176
  }
2127
2177
  return { deleted: true };
2128
2178
  }),
@@ -2161,15 +2211,15 @@ var settingsRouter = router({
2161
2211
  prompt: z10.string().max(2e4).optional()
2162
2212
  })).mutation(async ({ input }) => {
2163
2213
  const settings = await settingsManager.getSettings();
2164
- const current = settings.companion ?? { enabledByDefault: false };
2214
+ const current2 = settings.companion ?? { enabledByDefault: false };
2165
2215
  const prompt = input.prompt?.trim();
2166
2216
  await settingsManager.saveSettings({
2167
2217
  ...settings,
2168
2218
  companion: {
2169
- enabledByDefault: input.enabledByDefault ?? current.enabledByDefault ?? false,
2219
+ enabledByDefault: input.enabledByDefault ?? current2.enabledByDefault ?? false,
2170
2220
  // Vide = « celles de Runeya » : on efface le réglage plutôt que d'y
2171
2221
  // ranger une chaîne vide qui signifierait « aucune consigne ».
2172
- ...input.prompt === void 0 ? current.prompt ? { prompt: current.prompt } : {} : prompt ? { prompt } : {}
2222
+ ...input.prompt === void 0 ? current2.prompt ? { prompt: current2.prompt } : {} : prompt ? { prompt } : {}
2173
2223
  }
2174
2224
  });
2175
2225
  return { ok: true };
@@ -2204,7 +2254,7 @@ var settingsRouter = router({
2204
2254
  ...ScopeShape
2205
2255
  })).mutation(async ({ input }) => {
2206
2256
  if (input.provider !== "ollama" && !input.apiKey?.trim()) {
2207
- 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." });
2208
2258
  }
2209
2259
  const vault = await scopeOf(input);
2210
2260
  const priv = await settingsManager.getPrivateSettings(vault);
@@ -2245,7 +2295,7 @@ var settingsRouter = router({
2245
2295
  const priv = await settingsManager.getPrivateSettings(vault);
2246
2296
  const providers = priv.aiProviders ?? [];
2247
2297
  const idx = providers.findIndex((p) => p.id === input.id);
2248
- 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}` });
2249
2299
  const existing = providers[idx];
2250
2300
  const encryptedApiKey = input.apiKey ? stableEncryptValue(input.apiKey, existing.encryptedApiKey, vault) : existing.encryptedApiKey;
2251
2301
  const updated = {
@@ -2276,7 +2326,7 @@ var settingsRouter = router({
2276
2326
  const priv = await settingsManager.getPrivateSettings(vault);
2277
2327
  const providers = priv.aiProviders ?? [];
2278
2328
  const filtered = providers.filter((p) => p.id !== input.id);
2279
- 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}` });
2280
2330
  const deletedWasActive = providers.find((p) => p.id === input.id)?.active ?? false;
2281
2331
  if (deletedWasActive && filtered.length > 0) filtered[0].active = true;
2282
2332
  await settingsManager.savePrivateSettings({ ...priv, aiProviders: filtered }, vault);
@@ -2290,7 +2340,7 @@ var settingsRouter = router({
2290
2340
  const priv = await settingsManager.getPrivateSettings(vault);
2291
2341
  const providers = priv.aiProviders ?? [];
2292
2342
  const idx = providers.findIndex((p) => p.id === input.id);
2293
- 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}` });
2294
2344
  const updated = providers.map((p) => ({ ...p, active: p.id === input.id }));
2295
2345
  await settingsManager.savePrivateSettings({ ...priv, aiProviders: updated }, vault);
2296
2346
  return { id: input.id, active: true };
@@ -2412,7 +2462,7 @@ var settingsRouter = router({
2412
2462
  const raw = agentStore.getTraefikConfig(input.agentId);
2413
2463
  const parsed = raw ? TraefikConfigSchema.safeParse(raw) : null;
2414
2464
  const config = parsed?.success ? parsed.data : null;
2415
- 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" });
2416
2466
  const decrypted = { ...config, dnsCredentials: traefikManager.decryptDnsCredentials(config.dnsCredentials ?? {}) };
2417
2467
  await agentManager.agentMutation(input.agentId, "config.initTraefikConfig", decrypted, 5e3);
2418
2468
  await agentManager.agentMutation(input.agentId, "config.restartTraefik", void 0, 3e4);
@@ -2425,7 +2475,7 @@ var settingsRouter = router({
2425
2475
  const raw = agentStore.getTraefikConfig(input.agentId);
2426
2476
  const parsed = raw ? TraefikConfigSchema.safeParse(raw) : null;
2427
2477
  const config = parsed?.success ? parsed.data : null;
2428
- 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" });
2429
2479
  const decrypted = { ...config, dnsCredentials: traefikManager.decryptDnsCredentials(config.dnsCredentials ?? {}) };
2430
2480
  await agentManager.agentMutation(input.agentId, "config.initTraefikConfig", decrypted, 5e3);
2431
2481
  await agentManager.agentMutation(input.agentId, "config.renewTraefikCert", void 0, 3e4);
@@ -2557,7 +2607,7 @@ var settingsRouter = router({
2557
2607
  updatedAt: /* @__PURE__ */ new Date()
2558
2608
  }]);
2559
2609
  } catch (err) {
2560
- throw new TRPCError6({
2610
+ throw new TRPCError7({
2561
2611
  code: "BAD_REQUEST",
2562
2612
  message: err instanceof Error ? err.message : String(err)
2563
2613
  });
@@ -2586,7 +2636,7 @@ var settingsRouter = router({
2586
2636
 
2587
2637
  // ../server/src/trpc/routers/editor.ts
2588
2638
  import { z as z12 } from "zod";
2589
- import { TRPCError as TRPCError7 } from "@trpc/server";
2639
+ import { TRPCError as TRPCError8 } from "@trpc/server";
2590
2640
  import { execFile as execFile3, spawn as spawn2 } from "child_process";
2591
2641
  import { stat as stat2 } from "fs/promises";
2592
2642
  import { resolve, join as join4 } from "path";
@@ -2679,13 +2729,13 @@ async function getServiceCwd(serviceId) {
2679
2729
  const services = await serviceStore.list();
2680
2730
  const service = services.find((s) => s.id === serviceId);
2681
2731
  if (!service) {
2682
- throw new TRPCError7({ code: "NOT_FOUND", message: "Service not found" });
2732
+ throw new TRPCError8({ code: "NOT_FOUND", message: "Service not found" });
2683
2733
  }
2684
2734
  return resolveCwd(await resolveWorkspaceCwd({ serviceId }));
2685
2735
  }
2686
2736
  async function isCommandAvailable(command) {
2687
2737
  return new Promise((resolve4) => {
2688
- execFile3("which", [command], { timeout: 5e3, windowsHide: true }, (err) => {
2738
+ execFile3(whichCommand(), [command], { timeout: 5e3, windowsHide: true }, (err) => {
2689
2739
  resolve4(!err);
2690
2740
  });
2691
2741
  });
@@ -2712,7 +2762,7 @@ var editorRouter = router({
2712
2762
  editorKey: z12.string().max(64)
2713
2763
  })).mutation(async ({ input }) => {
2714
2764
  if (!EDITOR_BY_KEY.has(input.editorKey)) {
2715
- throw new TRPCError7({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2765
+ throw new TRPCError8({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2716
2766
  }
2717
2767
  await userConfigManager.setEditorPreference(
2718
2768
  { id: input.projectId, orgId: input.orgId },
@@ -2728,7 +2778,7 @@ var editorRouter = router({
2728
2778
  editorKey: z12.string().max(64)
2729
2779
  })).mutation(async ({ input }) => {
2730
2780
  if (!EDITOR_BY_KEY.has(input.editorKey)) {
2731
- throw new TRPCError7({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2781
+ throw new TRPCError8({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2732
2782
  }
2733
2783
  await userConfigManager.setEditorPreference(
2734
2784
  { id: input.projectId, orgId: input.orgId },
@@ -2754,17 +2804,18 @@ var editorRouter = router({
2754
2804
  })).mutation(async ({ input }) => {
2755
2805
  const editor = EDITOR_BY_KEY.get(input.editorKey);
2756
2806
  if (!editor) {
2757
- throw new TRPCError7({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2807
+ throw new TRPCError8({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2758
2808
  }
2759
2809
  const expanded = input.path.replace(/^~(\/|$)/, `${process.env["HOME"] ?? "/tmp"}$1`).replace(/\$\{(\w+)\}|\$(\w+)/g, (_, a, b) => process.env[a || b] ?? "");
2760
2810
  const resolvedPath = resolve(expanded || ".");
2761
2811
  try {
2762
2812
  await stat2(resolvedPath);
2763
2813
  } catch (err) {
2764
- if (err instanceof TRPCError7) throw err;
2765
- 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}` });
2766
2816
  }
2767
- const child = spawn2(editor.command, [resolvedPath], {
2817
+ const invocation = resolveCliInvocation(editor.command, [resolvedPath]);
2818
+ const child = spawn2(invocation.command, invocation.args, {
2768
2819
  shell: false,
2769
2820
  detached: true,
2770
2821
  stdio: "ignore",
@@ -2780,19 +2831,20 @@ var editorRouter = router({
2780
2831
  })).mutation(async ({ input }) => {
2781
2832
  const editor = EDITOR_BY_KEY.get(input.editorKey);
2782
2833
  if (!editor) {
2783
- throw new TRPCError7({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2834
+ throw new TRPCError8({ code: "BAD_REQUEST", message: `Unknown editor: ${input.editorKey}` });
2784
2835
  }
2785
2836
  const cwd = await getServiceCwd(input.serviceId);
2786
2837
  const filePath = join4(cwd, input.relativePath);
2787
2838
  if (!filePath.startsWith(cwd)) {
2788
- throw new TRPCError7({ code: "BAD_REQUEST", message: "Path traversal not allowed" });
2839
+ throw new TRPCError8({ code: "BAD_REQUEST", message: "Path traversal not allowed" });
2789
2840
  }
2790
2841
  try {
2791
2842
  await stat2(filePath);
2792
2843
  } catch {
2793
- 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}` });
2794
2845
  }
2795
- const child = spawn2(editor.command, [filePath], {
2846
+ const invocation = resolveCliInvocation(editor.command, [filePath]);
2847
+ const child = spawn2(invocation.command, invocation.args, {
2796
2848
  shell: false,
2797
2849
  detached: true,
2798
2850
  stdio: "ignore",
@@ -2805,7 +2857,7 @@ var editorRouter = router({
2805
2857
 
2806
2858
  // ../server/src/trpc/routers/api-keys.ts
2807
2859
  import { z as z13 } from "zod";
2808
- import { TRPCError as TRPCError8 } from "@trpc/server";
2860
+ import { TRPCError as TRPCError9 } from "@trpc/server";
2809
2861
  import { mkdir as mkdir3, writeFile as writeFile3 } from "fs/promises";
2810
2862
  import { join as join5, dirname as dirname2 } from "path";
2811
2863
  var ALLOWED_SKILL_PATHS = /* @__PURE__ */ new Set([
@@ -2829,22 +2881,22 @@ var apiKeysRouter = router({
2829
2881
  */
2830
2882
  reveal: protectedProcedure.input(z13.object({ id: z13.string().max(128) })).query(async ({ input }) => {
2831
2883
  const key = await apiKeyStore.reveal(input.id);
2832
- 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" });
2833
2885
  return { key };
2834
2886
  }),
2835
2887
  update: protectedProcedure.input(KeyInputSchema.extend({ id: z13.string().max(128) })).mutation(async ({ input }) => {
2836
2888
  const updated = await apiKeyStore.update(input.id, input.name, input.scopes, input.isPublic);
2837
- 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" });
2838
2890
  return maskApiKey(updated);
2839
2891
  }),
2840
2892
  remove: protectedProcedure.input(z13.object({ id: z13.string().max(128) })).mutation(async ({ input }) => {
2841
2893
  const removed = await apiKeyStore.remove(input.id);
2842
- 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" });
2843
2895
  return { success: true };
2844
2896
  }),
2845
2897
  renewKey: protectedProcedure.input(z13.object({ id: z13.string().max(128) })).mutation(async ({ input }) => {
2846
2898
  const renewed = await apiKeyStore.renewKey(input.id);
2847
- 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" });
2848
2900
  return renewed;
2849
2901
  }),
2850
2902
  writeSkillFile: protectedProcedure.input(z13.object({
@@ -2852,7 +2904,7 @@ var apiKeysRouter = router({
2852
2904
  content: z13.string().max(32768)
2853
2905
  })).mutation(async ({ input }) => {
2854
2906
  if (!ALLOWED_SKILL_PATHS.has(input.relativePath)) {
2855
- throw new TRPCError8({ code: "BAD_REQUEST", message: "Chemin non autoris\xE9" });
2907
+ throw new TRPCError9({ code: "BAD_REQUEST", message: "Chemin non autoris\xE9" });
2856
2908
  }
2857
2909
  const abs = join5(await resolveWorkspaceCwd({}), input.relativePath);
2858
2910
  await mkdir3(dirname2(abs), { recursive: true });
@@ -2863,7 +2915,7 @@ var apiKeysRouter = router({
2863
2915
 
2864
2916
  // ../server/src/trpc/routers/git.ts
2865
2917
  import { z as z14 } from "zod";
2866
- import { TRPCError as TRPCError9 } from "@trpc/server";
2918
+ import { TRPCError as TRPCError10 } from "@trpc/server";
2867
2919
  import Anthropic from "@anthropic-ai/sdk";
2868
2920
  import OpenAI from "openai";
2869
2921
  var SERVICE_ID_SCHEMA = z14.string().max(128);
@@ -2875,11 +2927,11 @@ var BRANCH_SCHEMA = z14.string().min(1).max(256).regex(/^[a-zA-Z0-9._\-/]+$/);
2875
2927
  async function resolveServiceContext(serviceId) {
2876
2928
  const service = await serviceStore.get(serviceId);
2877
2929
  if (!service) {
2878
- throw new TRPCError9({ code: "NOT_FOUND", message: "Service not found" });
2930
+ throw new TRPCError10({ code: "NOT_FOUND", message: "Service not found" });
2879
2931
  }
2880
2932
  const agentId = await resolveEffectiveAgentId(service);
2881
2933
  if (!agentId) {
2882
- 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" });
2883
2935
  }
2884
2936
  return { agentId, cwd: await resolveWorkspaceCwd({ serviceId }) };
2885
2937
  }
@@ -2895,7 +2947,7 @@ async function resolveGitContext(input) {
2895
2947
  if (input.serviceId) return resolveServiceContext(input.serviceId);
2896
2948
  const agentId = input.agentId ?? agentManager.getDefaultAgentId();
2897
2949
  if (!agentId) {
2898
- throw new TRPCError9({ code: "BAD_REQUEST", message: "No agent available" });
2950
+ throw new TRPCError10({ code: "BAD_REQUEST", message: "No agent available" });
2899
2951
  }
2900
2952
  const cwd = await resolveAgentCwd({ projectId: input.projectId, orgId: input.orgId }) ?? ".";
2901
2953
  return { agentId, cwd };
@@ -2981,14 +3033,14 @@ var gitRouter = router({
2981
3033
  const { agentId, cwd } = await resolveGitContext(input);
2982
3034
  const { diff } = await agentManager.agentQuery(agentId, "git.stagedDiff", { cwd });
2983
3035
  if (!diff.trim()) {
2984
- 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" });
2985
3037
  }
2986
3038
  const active = await getActiveProvider(
2987
3039
  input.providerId,
2988
3040
  input.orgId ?? await vaultOfProject(input.projectId)
2989
3041
  );
2990
3042
  if (!active) {
2991
- throw new TRPCError9({ code: "BAD_REQUEST", message: "No AI provider configured" });
3043
+ throw new TRPCError10({ code: "BAD_REQUEST", message: "No AI provider configured" });
2992
3044
  }
2993
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:).
2994
3046
  Rules:
@@ -3021,7 +3073,7 @@ Rules:
3021
3073
  });
3022
3074
  return { message: res.choices[0]?.message?.content?.trim() ?? "" };
3023
3075
  }
3024
- throw new TRPCError9({ code: "BAD_REQUEST", message: "Unsupported AI provider" });
3076
+ throw new TRPCError10({ code: "BAD_REQUEST", message: "Unsupported AI provider" });
3025
3077
  }),
3026
3078
  /** Merge a branch into the current branch */
3027
3079
  merge: protectedProcedure.input(z14.object({ ...gitTargetShape, branch: BRANCH_SCHEMA, noFf: z14.boolean().default(false) })).mutation(async ({ input }) => {
@@ -3086,7 +3138,7 @@ Rules:
3086
3138
  }
3087
3139
  );
3088
3140
  } catch (err) {
3089
- throw new TRPCError9({
3141
+ throw new TRPCError10({
3090
3142
  code: "BAD_REQUEST",
3091
3143
  message: `Cannot subscribe to git status: ${err.message}`
3092
3144
  });
@@ -3114,41 +3166,41 @@ Rules:
3114
3166
 
3115
3167
  // ../server/src/trpc/routers/scenario.ts
3116
3168
  import { randomUUID as randomUUID2 } from "crypto";
3117
- import { TRPCError as TRPCError12 } from "@trpc/server";
3169
+ import { TRPCError as TRPCError13 } from "@trpc/server";
3118
3170
  import { z as z15 } from "zod";
3119
3171
 
3120
3172
  // ../server/src/trpc/crud-procedure-utils.ts
3121
- import { TRPCError as TRPCError10 } from "@trpc/server";
3173
+ import { TRPCError as TRPCError11 } from "@trpc/server";
3122
3174
  async function getOrNotFound(getter, notFoundMessage) {
3123
3175
  const entity = await getter();
3124
- if (!entity) throw new TRPCError10({ code: "NOT_FOUND", message: notFoundMessage });
3176
+ if (!entity) throw new TRPCError11({ code: "NOT_FOUND", message: notFoundMessage });
3125
3177
  return entity;
3126
3178
  }
3127
3179
  async function createOrBadRequest(creator) {
3128
3180
  try {
3129
3181
  return await creator();
3130
3182
  } catch (err) {
3131
- throw new TRPCError10({ code: "BAD_REQUEST", message: err.message });
3183
+ throw new TRPCError11({ code: "BAD_REQUEST", message: err.message });
3132
3184
  }
3133
3185
  }
3134
3186
  async function updateOrThrow(updater, notFoundMessage) {
3135
3187
  try {
3136
3188
  const entity = await updater();
3137
- if (!entity) throw new TRPCError10({ code: "NOT_FOUND", message: notFoundMessage });
3189
+ if (!entity) throw new TRPCError11({ code: "NOT_FOUND", message: notFoundMessage });
3138
3190
  return entity;
3139
3191
  } catch (err) {
3140
- if (err instanceof TRPCError10) throw err;
3141
- 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 });
3142
3194
  }
3143
3195
  }
3144
3196
  async function deleteOrNotFound(deleter, notFoundMessage) {
3145
3197
  const deleted = await deleter();
3146
- if (!deleted) throw new TRPCError10({ code: "NOT_FOUND", message: notFoundMessage });
3198
+ if (!deleted) throw new TRPCError11({ code: "NOT_FOUND", message: notFoundMessage });
3147
3199
  return { ok: true };
3148
3200
  }
3149
3201
 
3150
3202
  // ../server/src/trpc/ai-generation-procedure-utils.ts
3151
- import { TRPCError as TRPCError11 } from "@trpc/server";
3203
+ import { TRPCError as TRPCError12 } from "@trpc/server";
3152
3204
 
3153
3205
  // ../server/src/services/ai-generation.ts
3154
3206
  import Anthropic2 from "@anthropic-ai/sdk";
@@ -3204,7 +3256,7 @@ async function* streamProviderText(input) {
3204
3256
  // ../server/src/trpc/ai-generation-procedure-utils.ts
3205
3257
  async function* streamWithActiveProvider(opts) {
3206
3258
  const active = await getActiveProvider(opts.providerId, opts.vault);
3207
- 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" });
3208
3260
  const { provider, plaintextKey } = active;
3209
3261
  const model = opts.model || provider.model || DEFAULT_MODELS[provider.provider] || "";
3210
3262
  try {
@@ -3222,7 +3274,7 @@ async function* streamWithActiveProvider(opts) {
3222
3274
  yield { type: "done", text: "" };
3223
3275
  } catch (err) {
3224
3276
  if (String(err?.message ?? "").startsWith("Unsupported provider:")) {
3225
- 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}` });
3226
3278
  }
3227
3279
  throw err;
3228
3280
  }
@@ -4702,10 +4754,10 @@ Rules:
4702
4754
  - Groups: position spaced 400px apart (e.g. x=0, x=400, x=800). width >= 300, height >= 200.
4703
4755
  - Nodes positions are relative to their group: x/y in 30-260 range.
4704
4756
  - The "prompt" field must be detailed: role, responsibilities, communication style, expected outputs.`;
4705
- function buildScenarioUserMessage(userPrompt, current) {
4706
- 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)) {
4707
4759
  return `Current scenario:
4708
- ${JSON.stringify(current, null, 2)}
4760
+ ${JSON.stringify(current2, null, 2)}
4709
4761
 
4710
4762
  User request: ${userPrompt}
4711
4763
 
@@ -4799,7 +4851,7 @@ var scenarioRouter = router({
4799
4851
  resume: z15.boolean().optional()
4800
4852
  })).subscription(async function* ({ input, signal }) {
4801
4853
  const scenario = await scenarioStore.get(input.scenarioId, await scopeOf2(input));
4802
- 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" });
4803
4855
  const canStart = input.userRequest.trim().length > 0 || !!input.resume;
4804
4856
  if (!isScenarioRunning(input.conversationId) && canStart) {
4805
4857
  let userRequest = input.userRequest;
@@ -4826,7 +4878,7 @@ var scenarioRouter = router({
4826
4878
  text: z15.string().min(1).max(1e5)
4827
4879
  })).mutation(({ input }) => {
4828
4880
  const resolved = resolveNodeInput(input.conversationId, input.nodeId, input.text);
4829
- 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" });
4830
4882
  return { ok: true };
4831
4883
  }),
4832
4884
  isRunning: protectedProcedure.input(z15.object({ conversationId: ConversationIdSchema })).query(({ input }) => ({ running: isScenarioRunning(input.conversationId) })),
@@ -4886,14 +4938,14 @@ var scenarioRouter = router({
4886
4938
  listPresets: protectedProcedure.query(() => listPresets()),
4887
4939
  getPreset: protectedProcedure.input(z15.object({ id: Id128Schema })).query(({ input }) => {
4888
4940
  const preset = getPreset(input.id);
4889
- 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" });
4890
4942
  return preset;
4891
4943
  })
4892
4944
  });
4893
4945
 
4894
4946
  // ../server/src/trpc/routers/debug.ts
4895
4947
  import { randomUUID as randomUUID3 } from "crypto";
4896
- import { TRPCError as TRPCError13 } from "@trpc/server";
4948
+ import { TRPCError as TRPCError14 } from "@trpc/server";
4897
4949
  import { z as z16 } from "zod";
4898
4950
  var MAX_BUFFER2 = 300;
4899
4951
  var jobs = /* @__PURE__ */ new Map();
@@ -4966,17 +5018,17 @@ var debugRouter = router({
4966
5018
  tick: 0,
4967
5019
  done: false,
4968
5020
  timer: setInterval(() => {
4969
- const current = jobs.get(jobId);
4970
- if (!current || current.done) return;
4971
- current.tick += 1;
4972
- publish(current, {
5021
+ const current2 = jobs.get(jobId);
5022
+ if (!current2 || current2.done) return;
5023
+ current2.tick += 1;
5024
+ publish(current2, {
4973
5025
  type: "tick",
4974
5026
  jobId,
4975
- index: current.tick,
5027
+ index: current2.tick,
4976
5028
  value: Math.random(),
4977
5029
  at: Date.now()
4978
5030
  });
4979
- if (current.tick >= current.maxTicks) {
5031
+ if (current2.tick >= current2.maxTicks) {
4980
5032
  stopJob(jobId, "max_ticks");
4981
5033
  }
4982
5034
  }, intervalMs),
@@ -4990,7 +5042,7 @@ var debugRouter = router({
4990
5042
  streamRandomJob: protectedProcedure.input(z16.object({ jobId: z16.string().max(128) })).subscription(async function* ({ input, signal }) {
4991
5043
  const job = jobs.get(input.jobId);
4992
5044
  if (!job) {
4993
- throw new TRPCError13({ code: "NOT_FOUND", message: "Random job not found" });
5045
+ throw new TRPCError14({ code: "NOT_FOUND", message: "Random job not found" });
4994
5046
  }
4995
5047
  yield* tapJob(job, signal ?? new AbortController().signal);
4996
5048
  }),
@@ -5006,7 +5058,7 @@ var debugRouter = router({
5006
5058
 
5007
5059
  // ../server/src/trpc/routers/diagnostics.ts
5008
5060
  import { z as z17 } from "zod";
5009
- import { TRPCError as TRPCError14 } from "@trpc/server";
5061
+ import { TRPCError as TRPCError15 } from "@trpc/server";
5010
5062
 
5011
5063
  // ../server/src/services/log-buffer.ts
5012
5064
  import { EventEmitter } from "events";
@@ -5126,12 +5178,12 @@ var diagnosticsRouter = router({
5126
5178
  } catch (err) {
5127
5179
  const reason = err.message;
5128
5180
  if (reason === "instance-not-found") {
5129
- 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." });
5130
5182
  }
5131
5183
  if (reason === "instance-is-current") {
5132
- 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." });
5133
5185
  }
5134
- throw new TRPCError14({ code: "INTERNAL_SERVER_ERROR", message: reason });
5186
+ throw new TRPCError15({ code: "INTERNAL_SERVER_ERROR", message: reason });
5135
5187
  }
5136
5188
  }),
5137
5189
  /**
@@ -5158,15 +5210,15 @@ var diagnosticsRouter = router({
5158
5210
  } catch (err) {
5159
5211
  const reason = err.message;
5160
5212
  if (reason === "instance-not-found") {
5161
- 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." });
5162
5214
  }
5163
5215
  if (reason.startsWith("instance-not-restartable:")) {
5164
- throw new TRPCError14({
5216
+ throw new TRPCError15({
5165
5217
  code: "BAD_REQUEST",
5166
5218
  message: `This instance cannot be restarted (${reason.split(":")[1]}).`
5167
5219
  });
5168
5220
  }
5169
- throw new TRPCError14({ code: "INTERNAL_SERVER_ERROR", message: reason });
5221
+ throw new TRPCError15({ code: "INTERNAL_SERVER_ERROR", message: reason });
5170
5222
  }
5171
5223
  })
5172
5224
  });
@@ -5429,7 +5481,7 @@ import { createHash } from "crypto";
5429
5481
  import { tmpdir } from "os";
5430
5482
  import { join as join7 } from "path";
5431
5483
  import { z as z19 } from "zod";
5432
- import { TRPCError as TRPCError15 } from "@trpc/server";
5484
+ import { TRPCError as TRPCError16 } from "@trpc/server";
5433
5485
  function summarizeCard(card, boardId, columnTitle) {
5434
5486
  return {
5435
5487
  boardId,
@@ -5500,7 +5552,7 @@ async function storeAttachment(id, name, body, dirs = attachmentCacheDirs()) {
5500
5552
  refusals.push(`${dir} (${err instanceof Error ? err.message : String(err)})`);
5501
5553
  }
5502
5554
  }
5503
- throw new TRPCError15({
5555
+ throw new TRPCError16({
5504
5556
  code: "INTERNAL_SERVER_ERROR",
5505
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.`
5506
5558
  });
@@ -5651,7 +5703,7 @@ var kanbanRouter = router({
5651
5703
  input.parentCardId ? { boardId: input.parentBoardId ?? input.boardId, cardId: input.parentCardId } : null
5652
5704
  );
5653
5705
  if (!ok) {
5654
- 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)." });
5655
5707
  }
5656
5708
  return { ok: true };
5657
5709
  }),
@@ -5750,25 +5802,25 @@ var kanbanRouter = router({
5750
5802
  downloadAttachment: protectedProcedure.input(z19.object({ attachmentId: z19.string().max(128) })).mutation(async ({ input }) => {
5751
5803
  const id = input.attachmentId;
5752
5804
  if (!ATTACHMENT_ID_REGEX.test(id)) {
5753
- throw new TRPCError15({ code: "BAD_REQUEST", message: "Invalid attachment id" });
5805
+ throw new TRPCError16({ code: "BAD_REQUEST", message: "Invalid attachment id" });
5754
5806
  }
5755
5807
  const res = await cloudFetch2(`/api/kanban/file/${id}`, { timeoutMs: 12e4 });
5756
5808
  if (res.status === 404) {
5757
- throw new TRPCError15({ code: "NOT_FOUND", message: `Attachment ${id} not found` });
5809
+ throw new TRPCError16({ code: "NOT_FOUND", message: `Attachment ${id} not found` });
5758
5810
  }
5759
5811
  if (!res.ok) {
5760
- throw new TRPCError15({
5812
+ throw new TRPCError16({
5761
5813
  code: res.status === 403 ? "FORBIDDEN" : "INTERNAL_SERVER_ERROR",
5762
5814
  message: `Cloud refused the attachment (HTTP ${res.status})`
5763
5815
  });
5764
5816
  }
5765
5817
  const declared = Number(res.headers.get("content-length") ?? 0);
5766
5818
  if (declared > MAX_ATTACHMENT_BYTES) {
5767
- 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" });
5768
5820
  }
5769
5821
  const body = Buffer.from(await res.arrayBuffer());
5770
5822
  if (body.length > MAX_ATTACHMENT_BYTES) {
5771
- 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" });
5772
5824
  }
5773
5825
  const contentType = res.headers.get("content-type") ?? "application/octet-stream";
5774
5826
  const disposition = res.headers.get("content-disposition") ?? "";
@@ -5781,7 +5833,7 @@ var kanbanRouter = router({
5781
5833
 
5782
5834
  // ../server/src/trpc/routers/terminal.ts
5783
5835
  import { z as z20 } from "zod";
5784
- import { TRPCError as TRPCError16 } from "@trpc/server";
5836
+ import { TRPCError as TRPCError17 } from "@trpc/server";
5785
5837
  var terminalRouter = router({
5786
5838
  /** Create a PTY shell session on the target agent */
5787
5839
  create: protectedProcedure.input(z20.object({
@@ -5905,7 +5957,7 @@ var terminalRouter = router({
5905
5957
  }
5906
5958
  );
5907
5959
  } catch (err) {
5908
- throw new TRPCError16({
5960
+ throw new TRPCError17({
5909
5961
  code: "BAD_REQUEST",
5910
5962
  message: `Cannot subscribe to terminal: ${err.message}`
5911
5963
  });
@@ -5940,7 +5992,7 @@ var utilityRouter = router({
5940
5992
 
5941
5993
  // ../server/src/trpc/routers/wiki.ts
5942
5994
  import { z as z22 } from "zod";
5943
- import { TRPCError as TRPCError17 } from "@trpc/server";
5995
+ import { TRPCError as TRPCError18 } from "@trpc/server";
5944
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";
5945
5997
  import { resolve as resolvePath, join as join8, relative, sep, dirname as dirname3 } from "path";
5946
5998
  var SCOPE_SCHEMA = z22.union([
@@ -5976,27 +6028,27 @@ async function resolveScope(scope) {
5976
6028
  const settings = await settingsManager.getSettings();
5977
6029
  const sub = (settings.globalDocsPath?.trim() || "wiki").replace(/^[\\/]+|[\\/]+$/g, "");
5978
6030
  if (sub.includes("..") || sub.includes("\0")) {
5979
- throw new TRPCError17({ code: "BAD_REQUEST", message: "Sous-chemin invalide" });
6031
+ throw new TRPCError18({ code: "BAD_REQUEST", message: "Sous-chemin invalide" });
5980
6032
  }
5981
6033
  const dataDirAbs = resolvePath(env.DATA_DIR);
5982
6034
  await mkdir6(dataDirAbs, { recursive: true });
5983
6035
  const base = dirname3(await realpath(dataDirAbs));
5984
6036
  const target = resolvePath(base, sub);
5985
6037
  if (target !== base && !(target + sep).startsWith(base + sep)) {
5986
- 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" });
5987
6039
  }
5988
6040
  await mkdir6(target, { recursive: true });
5989
6041
  const root = await realpath(target);
5990
6042
  if (root !== base && !(root + sep).startsWith(base + sep)) {
5991
- 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" });
5992
6044
  }
5993
6045
  return { mode: "local", root };
5994
6046
  }
5995
6047
  const serviceId = scope.slice("service:".length);
5996
6048
  const service = await serviceStore.get(serviceId);
5997
- if (!service) throw new TRPCError17({ code: "NOT_FOUND", message: "Service introuvable" });
6049
+ if (!service) throw new TRPCError18({ code: "NOT_FOUND", message: "Service introuvable" });
5998
6050
  const agentId = await resolveEffectiveAgentId(service);
5999
- 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" });
6000
6052
  const cwd = await resolveWorkspaceCwd({ serviceId, override: service.docsPath?.trim() || void 0 });
6001
6053
  return { mode: "agent", agentId, cwd };
6002
6054
  }
@@ -6031,7 +6083,7 @@ async function walkLocal(root, dir, depth, counter) {
6031
6083
  }
6032
6084
  async function resolveSafeLocal(root, relPath, requireExist) {
6033
6085
  if (relPath.includes("..") || relPath.startsWith("/")) {
6034
- throw new TRPCError17({ code: "BAD_REQUEST", message: "Chemin invalide" });
6086
+ throw new TRPCError18({ code: "BAD_REQUEST", message: "Chemin invalide" });
6035
6087
  }
6036
6088
  const target = resolvePath(root, relPath);
6037
6089
  if (requireExist) {
@@ -6039,10 +6091,10 @@ async function resolveSafeLocal(root, relPath, requireExist) {
6039
6091
  try {
6040
6092
  real = await realpath(target);
6041
6093
  } catch {
6042
- throw new TRPCError17({ code: "NOT_FOUND", message: "Chemin introuvable" });
6094
+ throw new TRPCError18({ code: "NOT_FOUND", message: "Chemin introuvable" });
6043
6095
  }
6044
6096
  if (real !== root && !(real + sep).startsWith(root + sep)) {
6045
- throw new TRPCError17({ code: "FORBIDDEN", message: "Hors du dossier autoris\xE9" });
6097
+ throw new TRPCError18({ code: "FORBIDDEN", message: "Hors du dossier autoris\xE9" });
6046
6098
  }
6047
6099
  return real;
6048
6100
  }
@@ -6054,7 +6106,7 @@ async function resolveSafeLocal(root, relPath, requireExist) {
6054
6106
  realParent = parent;
6055
6107
  }
6056
6108
  if (realParent !== root && !(realParent + sep).startsWith(root + sep)) {
6057
- throw new TRPCError17({ code: "FORBIDDEN", message: "Hors du dossier autoris\xE9" });
6109
+ throw new TRPCError18({ code: "FORBIDDEN", message: "Hors du dossier autoris\xE9" });
6058
6110
  }
6059
6111
  return resolvePath(realParent, target.slice(parent.length).replace(/^[\\/]+/, ""));
6060
6112
  }
@@ -6070,7 +6122,7 @@ var wikiRouter = router({
6070
6122
  }),
6071
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 }) => {
6072
6124
  if (!/\.(md|markdown)$/i.test(input.path)) {
6073
- 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" });
6074
6126
  }
6075
6127
  const target = await resolveScope(input.scope);
6076
6128
  if (target.mode === "agent") {
@@ -6078,14 +6130,14 @@ var wikiRouter = router({
6078
6130
  }
6079
6131
  const file = await resolveSafeLocal(target.root, input.path, true);
6080
6132
  const s = await stat4(file);
6081
- if (!s.isFile()) throw new TRPCError17({ code: "BAD_REQUEST", message: "Pas un fichier" });
6082
- 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" });
6083
6135
  const content = await readFile3(file, "utf-8");
6084
6136
  return { path: input.path, content };
6085
6137
  }),
6086
6138
  write: protectedProcedure.input(z22.object({ scope: SCOPE_SCHEMA, path: REL_PATH_SCHEMA, content: z22.string().max(5e6) })).mutation(async ({ input }) => {
6087
6139
  if (!/\.(md|markdown)$/i.test(input.path)) {
6088
- 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" });
6089
6141
  }
6090
6142
  const target = await resolveScope(input.scope);
6091
6143
  if (target.mode === "agent") {
@@ -6098,7 +6150,7 @@ var wikiRouter = router({
6098
6150
  }),
6099
6151
  createFile: protectedProcedure.input(z22.object({ scope: SCOPE_SCHEMA, path: REL_PATH_SCHEMA })).mutation(async ({ input }) => {
6100
6152
  if (!/\.(md|markdown)$/i.test(input.path)) {
6101
- 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" });
6102
6154
  }
6103
6155
  const target = await resolveScope(input.scope);
6104
6156
  if (target.mode === "agent") {
@@ -6107,9 +6159,9 @@ var wikiRouter = router({
6107
6159
  const file = await resolveSafeLocal(target.root, input.path, false);
6108
6160
  try {
6109
6161
  await stat4(file);
6110
- throw new TRPCError17({ code: "CONFLICT", message: "Fichier d\xE9j\xE0 existant" });
6162
+ throw new TRPCError18({ code: "CONFLICT", message: "Fichier d\xE9j\xE0 existant" });
6111
6163
  } catch (err) {
6112
- if (err instanceof TRPCError17) throw err;
6164
+ if (err instanceof TRPCError18) throw err;
6113
6165
  }
6114
6166
  await mkdir6(dirname3(file), { recursive: true });
6115
6167
  await writeFile5(file, "", "utf-8");
@@ -6133,9 +6185,9 @@ var wikiRouter = router({
6133
6185
  const to = await resolveSafeLocal(target.root, input.toPath, false);
6134
6186
  try {
6135
6187
  await stat4(to);
6136
- 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" });
6137
6189
  } catch (err) {
6138
- if (err instanceof TRPCError17) throw err;
6190
+ if (err instanceof TRPCError18) throw err;
6139
6191
  }
6140
6192
  await mkdir6(dirname3(to), { recursive: true });
6141
6193
  await rename3(from, to);
@@ -6148,9 +6200,9 @@ var wikiRouter = router({
6148
6200
  }
6149
6201
  const serviceId = input.scope.slice("service:".length);
6150
6202
  const service = await serviceStore.get(serviceId);
6151
- if (!service) throw new TRPCError17({ code: "NOT_FOUND", message: "Service introuvable" });
6203
+ if (!service) throw new TRPCError18({ code: "NOT_FOUND", message: "Service introuvable" });
6152
6204
  const agentId = await resolveEffectiveAgentId(service);
6153
- 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" });
6154
6206
  const cwd = await resolveWorkspaceCwd({ serviceId, override: service.docsPath?.trim() || void 0 });
6155
6207
  return agentManager.agentMutation(agentId, "wiki.ensureRoot", { cwd });
6156
6208
  }),
@@ -6160,7 +6212,7 @@ var wikiRouter = router({
6160
6212
  return agentManager.agentMutation(target.agentId, "wiki.deletePath", { cwd: target.cwd, path: input.path });
6161
6213
  }
6162
6214
  const fp = await resolveSafeLocal(target.root, input.path, true);
6163
- 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" });
6164
6216
  await rm2(fp, { recursive: true, force: true });
6165
6217
  return { path: input.path, ok: true };
6166
6218
  })
@@ -6181,7 +6233,7 @@ var configRouter = router({
6181
6233
 
6182
6234
  // ../server/src/trpc/routers/cloud-sync.ts
6183
6235
  import { z as z23 } from "zod";
6184
- import { TRPCError as TRPCError18 } from "@trpc/server";
6236
+ import { TRPCError as TRPCError19 } from "@trpc/server";
6185
6237
 
6186
6238
  // ../server/src/services/org-sync-scope.ts
6187
6239
  import { access } from "fs/promises";
@@ -7313,7 +7365,7 @@ async function assertOrgReadable(orgId) {
7313
7365
  await assertOrgVaultReadable(orgId);
7314
7366
  } catch (err) {
7315
7367
  if (err instanceof OrgVaultUnreadableError) {
7316
- throw new TRPCError18({ code: "FORBIDDEN", message: err.message });
7368
+ throw new TRPCError19({ code: "FORBIDDEN", message: err.message });
7317
7369
  }
7318
7370
  throw err;
7319
7371
  }
@@ -7323,10 +7375,10 @@ async function assertOrgKey(orgId) {
7323
7375
  await reconcileOrgCanary(orgId);
7324
7376
  } catch (err) {
7325
7377
  if (err instanceof OrgKeyMismatchError) {
7326
- throw new TRPCError18({ code: "FORBIDDEN", message: err.message });
7378
+ throw new TRPCError19({ code: "FORBIDDEN", message: err.message });
7327
7379
  }
7328
7380
  if (err instanceof CanaryUnavailableError) {
7329
- throw new TRPCError18({ code: "PRECONDITION_FAILED", message: err.message });
7381
+ throw new TRPCError19({ code: "PRECONDITION_FAILED", message: err.message });
7330
7382
  }
7331
7383
  throw err;
7332
7384
  }
@@ -7365,7 +7417,7 @@ var cloudSyncRouter = router({
7365
7417
  return { pulled, state: syncState(input.orgId), heldBy: await syncLockHolder(input.orgId) };
7366
7418
  } catch (err) {
7367
7419
  if (err instanceof ProjectHeldElsewhereError) {
7368
- throw new TRPCError18({ code: "CONFLICT", message: err.code, cause: err });
7420
+ throw new TRPCError19({ code: "CONFLICT", message: err.code, cause: err });
7369
7421
  }
7370
7422
  throw err;
7371
7423
  }
@@ -7392,10 +7444,10 @@ var cloudSyncRouter = router({
7392
7444
  ).mutation(async ({ input }) => {
7393
7445
  const local = await projectStore.get({ id: input.projectId, orgId: null });
7394
7446
  if (!local) {
7395
- throw new TRPCError18({ code: "NOT_FOUND", message: "PROJECT_NOT_LOCAL" });
7447
+ throw new TRPCError19({ code: "NOT_FOUND", message: "PROJECT_NOT_LOCAL" });
7396
7448
  }
7397
7449
  if (await projectStore.get({ id: input.projectId, orgId: input.orgId })) {
7398
- throw new TRPCError18({ code: "CONFLICT", message: "PROJECT_ALREADY_IN_ORG" });
7450
+ throw new TRPCError19({ code: "CONFLICT", message: "PROJECT_ALREADY_IN_ORG" });
7399
7451
  }
7400
7452
  await assertOrgReadable(input.orgId);
7401
7453
  const connected = cloudSyncBridge.states().some((s) => s.orgId === input.orgId);
@@ -7414,7 +7466,7 @@ var cloudSyncRouter = router({
7414
7466
  await cloudSyncBridge.followProject(input.orgId, input.projectId);
7415
7467
  } catch (err) {
7416
7468
  if (err instanceof ProjectHeldElsewhereError) {
7417
- throw new TRPCError18({ code: "CONFLICT", message: err.code, cause: err });
7469
+ throw new TRPCError19({ code: "CONFLICT", message: err.code, cause: err });
7418
7470
  }
7419
7471
  throw err;
7420
7472
  }
@@ -7437,7 +7489,7 @@ var cloudSyncRouter = router({
7437
7489
  { method: "GET" }
7438
7490
  );
7439
7491
  if (!res.ok) {
7440
- 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})` });
7441
7493
  }
7442
7494
  const { canary } = await res.json();
7443
7495
  if (typeof canary !== "string") return { matches: false, published: false };
@@ -7504,7 +7556,7 @@ var cloudSyncRouter = router({
7504
7556
  resetOrgKey: protectedProcedure.input(z23.object({ orgId: z23.string().min(1).max(128) })).mutation(async ({ input }) => {
7505
7557
  const canary = await readVerifyFile(orgVaultRoot(input.orgId)) ?? await readVerifyFile(await keyRoot());
7506
7558
  if (!canary) {
7507
- throw new TRPCError18({
7559
+ throw new TRPCError19({
7508
7560
  code: "PRECONDITION_FAILED",
7509
7561
  message: "Cette machine n'a pas encore de cl\xE9 de chiffrement."
7510
7562
  });
@@ -7515,7 +7567,7 @@ var cloudSyncRouter = router({
7515
7567
  });
7516
7568
  if (!res.ok) {
7517
7569
  const detail = await cloudMessage(res);
7518
- throw new TRPCError18({
7570
+ throw new TRPCError19({
7519
7571
  code: res.status === 403 ? "FORBIDDEN" : "BAD_GATEWAY",
7520
7572
  message: detail || `ORG_KEY_RESET_FAILED (${res.status})`
7521
7573
  });
@@ -7561,8 +7613,8 @@ var cloudSyncRouter = router({
7561
7613
  body: { organizationId: input.orgId, projectId: input.projectId }
7562
7614
  });
7563
7615
  } catch (err) {
7564
- if (err instanceof TRPCError18 && err.code === "PRECONDITION_FAILED") {
7565
- 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" });
7566
7618
  }
7567
7619
  throw err;
7568
7620
  }
@@ -7570,12 +7622,12 @@ var cloudSyncRouter = router({
7570
7622
  const detail = await cloudMessage(res);
7571
7623
  if (res.status === 403) {
7572
7624
  const code = /not a member/i.test(detail) ? "PROJECT_NOT_MEMBER" : "PROJECT_DELETE_FORBIDDEN";
7573
- throw new TRPCError18({ code: "FORBIDDEN", message: code, cause: new Error(detail) });
7625
+ throw new TRPCError19({ code: "FORBIDDEN", message: code, cause: new Error(detail) });
7574
7626
  }
7575
7627
  if (res.status === 404) {
7576
- 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) });
7577
7629
  }
7578
- throw new TRPCError18({
7630
+ throw new TRPCError19({
7579
7631
  code: "BAD_GATEWAY",
7580
7632
  message: detail || `PROJECT_DELETE_FAILED (${res.status})`
7581
7633
  });
@@ -7771,6 +7823,97 @@ var filesystemRouter = router({
7771
7823
  })
7772
7824
  });
7773
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
+
7774
7917
  // ../server/src/trpc/router.ts
7775
7918
  var appRouter = router({
7776
7919
  health: healthRouter,
@@ -7799,7 +7942,8 @@ var appRouter = router({
7799
7942
  config: configRouter,
7800
7943
  cloudSync: cloudSyncRouter,
7801
7944
  cloudAuth: cloudAuthRouter,
7802
- filesystem: filesystemRouter
7945
+ filesystem: filesystemRouter,
7946
+ desktop: desktopRouter
7803
7947
  });
7804
7948
 
7805
7949
  // ../server/src/middleware/error-handler.ts
@@ -9341,6 +9485,9 @@ async function createLocalServer() {
9341
9485
  console.warn("[server] Failed to start Claude transcript watcher:", err);
9342
9486
  });
9343
9487
  startCodexTranscriptWatcher();
9488
+ await serviceStore.list().catch((err) => {
9489
+ console.warn("[server] Failed to preload services:", err);
9490
+ });
9344
9491
  cloudSyncBridge.start().catch((err) => {
9345
9492
  console.warn("[server] Failed to start cloud sync bridge:", err);
9346
9493
  });
@@ -9933,7 +10080,7 @@ async function createLocalServer() {
9933
10080
  ]);
9934
10081
  console.log("[server] Shutdown complete");
9935
10082
  };
9936
- const { initCompanion } = await import("./companion-QNW7XA6X.js");
10083
+ const { initCompanion } = await import("./companion-6J6NK7H7.js");
9937
10084
  initCompanion();
9938
10085
  return { app, server, wss, shutdown };
9939
10086
  }
@@ -10020,6 +10167,46 @@ async function pullEnv(opts) {
10020
10167
  return Object.entries(env2).map(([key, value]) => `${key}=${value}`).join("\n");
10021
10168
  }
10022
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
+
10023
10210
  // ../server/src/index.ts
10024
10211
  dotenv.config({ quiet: true });
10025
10212
  if (process.env["RUNEYA_DATA_DIR"]) {
@@ -10056,7 +10243,7 @@ function listenWithRetry(server, port, host, wss, maxRetries = 20, delay = 500)
10056
10243
  });
10057
10244
  }
10058
10245
  async function main() {
10059
- const { ensureNodeBinOnPath, ensureUserBinsOnPath } = await import("./node-B4T3JMM3.js");
10246
+ const { ensureNodeBinOnPath, ensureUserBinsOnPath } = await import("./node-ILM6MV56.js");
10060
10247
  ensureNodeBinOnPath();
10061
10248
  await ensureUserBinsOnPath();
10062
10249
  console.log("Hello World 2");
@@ -10097,7 +10284,19 @@ if (import.meta.url === `file://${process.argv[1]}`) {
10097
10284
  export {
10098
10285
  PullEnvError,
10099
10286
  createLocalServer,
10287
+ killInstance,
10288
+ listInstances,
10289
+ listTrayServices,
10290
+ networkInfo,
10291
+ onTrayServicesChanged,
10100
10292
  pullEnv,
10101
- registerInstance
10293
+ registerCli as registerCliLocation,
10294
+ registerInstance,
10295
+ restartInstance,
10296
+ restartProcess,
10297
+ scheduleSelfRestart,
10298
+ setLanMode,
10299
+ startProcess,
10300
+ stopProcess
10102
10301
  };
10103
- //# sourceMappingURL=src-PF23DMAB.js.map
10302
+ //# sourceMappingURL=src-V7DPPFCF.js.map