@runeya/runeya 2.0.66 → 2.0.67

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 (199) hide show
  1. package/agent/index.js +13 -8
  2. package/agent/index.js.map +1 -1
  3. package/index.js +4 -1
  4. package/index.js.map +1 -1
  5. package/mcp-server/index.js +11 -5
  6. package/mcp-server/index.js.map +1 -1
  7. package/node-QABM22GF.js +78 -0
  8. package/node-QABM22GF.js.map +1 -0
  9. package/package.json +1 -1
  10. package/{src-ETRPQHFP.js → src-QP5LALGR.js} +1187 -1019
  11. package/src-QP5LALGR.js.map +1 -0
  12. package/web/assets/{AgentScalarChatInterface.vue-Zqu9sSBH.js → AgentScalarChatInterface.vue-DVn9R6UA.js} +1 -1
  13. package/web/assets/{AgentTerminalPage-Bm3kpbcU.js → AgentTerminalPage-C66ptjgH.js} +1 -1
  14. package/web/assets/AiChatPage-Bh3ugfp4.js +1 -0
  15. package/web/assets/AppLayout-B0n34XKU.js +1 -0
  16. package/web/assets/{AppLayout-Cx7ccwgc.css → AppLayout-BqXoW05V.css} +1 -1
  17. package/web/assets/{AuditPage-DUSwJfVK.js → AuditPage-CbkmlJeq.js} +1 -1
  18. package/web/assets/{CloudAccountPage-Ye5gyp-a.js → CloudAccountPage-CqMO-gQ1.js} +1 -1
  19. package/web/assets/CloudAccountPage-DuTsra7v.js +1 -0
  20. package/web/assets/{CloudMessagingPage-D2bQQJYt.js → CloudMessagingPage-D8Y4KWWS.js} +1 -1
  21. package/web/assets/{DashboardPage-CHU-AVBl.js → DashboardPage-B7BrLHKh.js} +1 -1
  22. package/web/assets/{DirectoryPickerDialog-DWBd-8G-.js → DirectoryPickerDialog-DiXqygSc.js} +1 -1
  23. package/web/assets/{EditorIcon-CCXptJPw.js → EditorIcon-ChiKZey2.js} +1 -1
  24. package/web/assets/{EnvironmentForm-PHlewheL.js → EnvironmentForm-C_Vb13xF.js} +1 -1
  25. package/web/assets/{EnvironmentFormPage-D38aMov8.js → EnvironmentFormPage-BaMwL4YK.js} +1 -1
  26. package/web/assets/{EnvironmentListPage-DdQ4q79B.js → EnvironmentListPage-DAKszj2p.js} +1 -1
  27. package/web/assets/{KanbanBoardPage-BQixRj2E.js → KanbanBoardPage-DVfCJ09e.js} +3 -3
  28. package/web/assets/{KanbanListPage-CZbGUlKe.js → KanbanListPage-CAUPVG3x.js} +1 -1
  29. package/web/assets/{LaunchProjectPage-DCECoi2W.js → LaunchProjectPage-DboQPHhM.js} +1 -1
  30. package/web/assets/{LaunchServicesPage-Igch4OkU.js → LaunchServicesPage-CjM0FUsg.js} +1 -1
  31. package/web/assets/{LogViewer-CJ7eJWSJ.js → LogViewer-CV4UKjXg.js} +1 -1
  32. package/web/assets/{OrgKeyPrompt-Beh4oSZo.js → OrgKeyPrompt-B-Ob1wQo.js} +1 -1
  33. package/web/assets/{ProcessControls-C338q9mk.js → ProcessControls-DAciBoSD.js} +1 -1
  34. package/web/assets/{ProcessDetailPage-nOQRTRxC.js → ProcessDetailPage-DtFb-qaA.js} +1 -1
  35. package/web/assets/{ProcessMetrics-2zeVTtwB.js → ProcessMetrics--iokpCM-.js} +1 -1
  36. package/web/assets/{ProjectDetailPage-_KWEJ7Rf.js → ProjectDetailPage-DKwgJnBb.js} +1 -1
  37. package/web/assets/{ProjectListPage-BpjpOa0B.js → ProjectListPage-Dxb9S6la.js} +1 -1
  38. package/web/assets/{RandomJobTestPage-C2P7Of7m.js → RandomJobTestPage-Rjvqbre2.js} +1 -1
  39. package/web/assets/{ScenarioEditorPage-CLZfBdRV.js → ScenarioEditorPage-Diue0rEv.js} +1 -1
  40. package/web/assets/{SendToChatDialog-CVk67rVP.js → SendToChatDialog-DZm9rbYQ.js} +1 -1
  41. package/web/assets/{ServiceControlsBar-Bj8W6_zq.js → ServiceControlsBar-CqH5T0Bt.js} +1 -1
  42. package/web/assets/{ServiceDetailPage-BQLxNRdV.js → ServiceDetailPage-yYY05Ofq.js} +1 -1
  43. package/web/assets/{ServiceFormPage-D6xyXhpD.js → ServiceFormPage-DLDyDff6.js} +1 -1
  44. package/web/assets/{SettingsPage-DgoltSoU.js → SettingsPage-iHIqmfyf.js} +4 -4
  45. package/web/assets/{UnlockPage-CGvHLoeU.js → UnlockPage-DQ34l5l1.js} +1 -1
  46. package/web/assets/{VariablesTable-yUXhkoTa.js → VariablesTable-WVZfP2VG.js} +1 -1
  47. package/web/assets/{VaultMigrationPage-COgPnndp.js → VaultMigrationPage-DqKJ_shK.js} +1 -1
  48. package/web/assets/{VersionBadge-D0-TBwlH.js → VersionBadge-zIjq4iAX.js} +1 -1
  49. package/web/assets/WikiPage-BsY9YXHO.js +1 -0
  50. package/web/assets/{WikiView-BSJ7xirc.js → WikiView-BnCFtAdF.js} +1 -1
  51. package/web/assets/{add-scalar-classes-CmUab9yH.js → add-scalar-classes-CjgwfCIh.js} +3 -3
  52. package/web/assets/auth-errors-DBBrz53D.js +1 -0
  53. package/web/assets/{autocomplete-BoVkCZ3N.js → autocomplete-D-6FU1t-.js} +1 -1
  54. package/web/assets/{basic-shape-diamond.svg-BAFkGVp0.js → basic-shape-diamond.svg-DE3LO5SU.js} +1 -1
  55. package/web/assets/{basic-shape-hexagon.svg-CXBYrKDq.js → basic-shape-hexagon.svg-DHCVACA2.js} +1 -1
  56. package/web/assets/{basic-shape-primary-circle-ellipse-round.svg-BGIUk5JU.js → basic-shape-primary-circle-ellipse-round.svg-BGztJOjy.js} +1 -1
  57. package/web/assets/{basic-shape-primary-square-rectangle.svg-Cs7aJCXJ.js → basic-shape-primary-square-rectangle.svg-BNvakQwI.js} +1 -1
  58. package/web/assets/{basic-shape-shield.svg-D0zGJ-AS.js → basic-shape-shield.svg-D0xk91H_.js} +1 -1
  59. package/web/assets/{browser-ew4T6Wak.js → browser-BivKTyTv.js} +1 -1
  60. package/web/assets/{browser-DM2Khq4B.js → browser-bzX9Nao0.js} +1 -1
  61. package/web/assets/{card-DEwOdoy7.js → card-wjkfdMj0.js} +1 -1
  62. package/web/assets/{checkbox-7RxjiveI.js → checkbox-IknS1FQn.js} +1 -1
  63. package/web/assets/{chip-DIaKFEgA.js → chip-Boe0Xov3.js} +1 -1
  64. package/web/assets/{client-C7GCqCio.js → client-BSU8WE5S.js} +1 -1
  65. package/web/assets/{cloud-chat.store-Dyj5VOAR.js → cloud-chat.store-XQdrKrub.js} +1 -1
  66. package/web/assets/{cloud-session-BlHm1AAi.js → cloud-session-BwiZNDmW.js} +1 -1
  67. package/web/assets/{column-BaYEu-Xp.js → column-B7tQz83B.js} +1 -1
  68. package/web/assets/{computer-device-desktop-monitor.svg-HxK5c6Pq.js → computer-device-desktop-monitor.svg-CnYkVG-R.js} +1 -1
  69. package/web/assets/{computer-device-desktop.svg-g9vb_5N-.js → computer-device-desktop.svg-XlBIDLoz.js} +1 -1
  70. package/web/assets/{computer-device-laptop.svg-BMMBociB.js → computer-device-laptop.svg-DaLHuxcg.js} +1 -1
  71. package/web/assets/{computer-device-mobile-phone-android-samsung-back.svg-Czfpjn43.js → computer-device-mobile-phone-android-samsung-back.svg-qHWgnNNS.js} +1 -1
  72. package/web/assets/{computer-device-mobile-phone-android-samsung.svg-pUCOHsgN.js → computer-device-mobile-phone-android-samsung.svg-CtxJbuqe.js} +1 -1
  73. package/web/assets/{computer-device-mobile-phone-iphone-x-back.svg-Dix3VORS.js → computer-device-mobile-phone-iphone-x-back.svg-BQiGDxzt.js} +1 -1
  74. package/web/assets/{computer-device-mobile-phone-iphone-x.svg-p2gbl1TW.js → computer-device-mobile-phone-iphone-x.svg-CgAytTCm.js} +1 -1
  75. package/web/assets/{computer-device-mobile-tablet-touch.svg-DnE6hC8T.js → computer-device-mobile-tablet-touch.svg-CAqOIQYV.js} +1 -1
  76. package/web/assets/{computer-device-mobile-tablet.svg-BlCJk_bJ.js → computer-device-mobile-tablet.svg-DQpw8q67.js} +1 -1
  77. package/web/assets/{computer-device-network-ethernet-cat6.svg-830kQkxi.js → computer-device-network-ethernet-cat6.svg-CBRhWnOl.js} +1 -1
  78. package/web/assets/{computer-device-network-lan-www.svg-C8QS39hd.js → computer-device-network-lan-www.svg-Cv-QFYIZ.js} +1 -1
  79. package/web/assets/{computer-device-network-wifi-connection.svg-Cq9SMwuS.js → computer-device-network-wifi-connection.svg-BBsVDFRE.js} +1 -1
  80. package/web/assets/{computer-device-network-wifi-router.svg-Co3SwsJB.js → computer-device-network-wifi-router.svg-BK2DsNKU.js} +1 -1
  81. package/web/assets/{cssMode-BmpKaBWz.js → cssMode-B4oj4WYQ.js} +1 -1
  82. package/web/assets/{divider-BbEJbTN0.js → divider-_mB7RWpZ.js} +1 -1
  83. package/web/assets/{ecology-science-erlenmeyer-flask.svg-Di0Wf0dY.js → ecology-science-erlenmeyer-flask.svg-CA-I1J40.js} +1 -1
  84. package/web/assets/{fieldset-BrjmZWof.js → fieldset-DxE1RM8v.js} +1 -1
  85. package/web/assets/{freemarker2-22AUFDyO.js → freemarker2-DjWzSYtR.js} +1 -1
  86. package/web/assets/{handlebars-BSkOvV0L.js → handlebars-CrIRV8P_.js} +1 -1
  87. package/web/assets/{html-hlHaQZ73.js → html-FZ2bNZkn.js} +1 -1
  88. package/web/assets/{htmlMode-BRTwjwpU.js → htmlMode-C4UY3uXX.js} +1 -1
  89. package/web/assets/{image-flash-lightning.svg-dkqSucku.js → image-flash-lightning.svg-BESGut9z.js} +1 -1
  90. package/web/assets/{image-picture-flower.svg-DZnDd7_J.js → image-picture-flower.svg-DFFw77B4.js} +1 -1
  91. package/web/assets/{index-DQD0hOgi.js → index-ChHZJigw.js} +5 -5
  92. package/web/assets/{interface-alert-exclamation-diamond.svg-C401SWye.js → interface-alert-exclamation-diamond.svg-C0_oVqKd.js} +1 -1
  93. package/web/assets/{interface-alert-exclamation-triangle-warning.svg-COovlb0i.js → interface-alert-exclamation-triangle-warning.svg-CT57udnb.js} +1 -1
  94. package/web/assets/{interface-alert-information-circle.svg-BwNbo0yM.js → interface-alert-information-circle.svg-feXGxf07.js} +1 -1
  95. package/web/assets/{interface-award-crown.svg-C-w5fwti.js → interface-award-crown.svg-Dzcgb2OZ.js} +1 -1
  96. package/web/assets/{interface-bookmark.svg-D0m1qU6o.js → interface-bookmark-tag.svg-DYObw7kI.js} +1 -1
  97. package/web/assets/{interface-bookmark-tag.svg-6ZIfhpAK.js → interface-bookmark.svg-D29YXcId.js} +1 -1
  98. package/web/assets/{interface-calendar-date-one.svg-D8GMSKK4.js → interface-calendar-date-one.svg-B6LAQ50v.js} +1 -1
  99. package/web/assets/{interface-content-book-open-pages.svg-DQVGr6Tp.js → interface-content-book-open-pages.svg-BlpLjyAs.js} +1 -1
  100. package/web/assets/{interface-content-book-page.svg-Burs9T5l.js → interface-content-book-page.svg-D8zFMaud.js} +1 -1
  101. package/web/assets/{interface-content-file.svg-QMaR0bu1.js → interface-content-file.svg-Bu9ZoTup.js} +1 -1
  102. package/web/assets/{interface-content-folder.svg-DmjHF_FL.js → interface-content-folder.svg-C7xURsse.js} +1 -1
  103. package/web/assets/interface-content-folder.svg-ZuNlhEM9.js +1 -0
  104. package/web/assets/{interface-copy-clipboard.svg-lgdNoQUH.js → interface-copy-clipboard.svg-pk2ijV65.js} +1 -1
  105. package/web/assets/{interface-edit-attachment.svg-DkWZed8H.js → interface-edit-attachment.svg-Bcr20hoB.js} +1 -1
  106. package/web/assets/{interface-edit-binocular.svg-C_luoo2V.js → interface-edit-binocular.svg-COIP_m1k.js} +1 -1
  107. package/web/assets/{interface-edit-magic-wand.svg-mfDVPLMa.js → interface-edit-magic-wand.svg-D_m1zeUL.js} +1 -1
  108. package/web/assets/{interface-edit-tool-paint-roller.svg-DCBpOYQu.js → interface-edit-tool-paint-roller.svg-BeVeFbeH.js} +1 -1
  109. package/web/assets/{interface-edit-tool-pencil.svg-fqyQWL5k.js → interface-edit-tool-pencil.svg-dsW53gC1.js} +1 -1
  110. package/web/assets/{interface-favorite-award.svg-DgUlQfKG.js → interface-favorite-award.svg-3BNGOKWw.js} +1 -1
  111. package/web/assets/{interface-favorite-flag.svg--8SQf4C2.js → interface-favorite-flag.svg-D48-u5Nr.js} +1 -1
  112. package/web/assets/{interface-favorite-heart.svg-Bk03QjU6.js → interface-favorite-heart.svg-CKvRWS8p.js} +1 -1
  113. package/web/assets/{interface-favorite-star.svg-BmYbWrQE.js → interface-favorite-star.svg-CxMLBraT.js} +1 -1
  114. package/web/assets/{interface-favorite-stars-sparkles.svg-BEYyPTqH.js → interface-favorite-stars-sparkles.svg-Cy14KCtV.js} +1 -1
  115. package/web/assets/{interface-hierarchy-flowchart.svg-C0J6xzvI.js → interface-hierarchy-flowchart.svg-Lg00w7YV.js} +1 -1
  116. package/web/assets/{interface-home-house.svg-yWpAesCb.js → interface-home-house.svg-CsvIh8II.js} +1 -1
  117. package/web/assets/{interface-hyperlink.svg-COfqwBSx.js → interface-hyperlink.svg-BuFqr9k_.js} +1 -1
  118. package/web/assets/{interface-lighting-brightness.svg-C_ACQ4IE.js → interface-lighting-brightness.svg-C1Me4yCs.js} +1 -1
  119. package/web/assets/{interface-lock-closed.svg-CznsvqCi.js → interface-lock-closed.svg-DVhklYLb.js} +1 -1
  120. package/web/assets/{interface-lock-open-unlock.svg-BFpG7swb.js → interface-lock-open-unlock.svg-Day60scV.js} +1 -1
  121. package/web/assets/{interface-login-key.svg-ByQoPb-O.js → interface-login-key.svg-DYEI5voM.js} +1 -1
  122. package/web/assets/{interface-search.svg-DXFtCXpT.js → interface-search.svg-DwsHXg2v.js} +1 -1
  123. package/web/assets/{interface-setting-cog.svg-CaV3Cp60.js → interface-setting-cog.svg-CeNdjOvF.js} +1 -1
  124. package/web/assets/{interface-share-megaphone-bullhorn.svg-By8aY7RU.js → interface-share-megaphone-bullhorn.svg-C8ZC1W-n.js} +1 -1
  125. package/web/assets/{interface-share-rocket.svg-DNohy-ip.js → interface-share-rocket.svg-gmRwyR-9.js} +1 -1
  126. package/web/assets/{interface-share-satellite.svg-BavAgRbB.js → interface-share-satellite.svg-BfcRjFbw.js} +1 -1
  127. package/web/assets/{interface-share-space-ship.svg-BgJFQkJk.js → interface-share-space-ship.svg-CEjN-mXM.js} +1 -1
  128. package/web/assets/{interface-share.svg-Bg-xjVsD.js → interface-share.svg-CPspWlPa.js} +1 -1
  129. package/web/assets/{interface-signal-square.svg-Bss2X0FB.js → interface-signal-square.svg-DxhbfEQv.js} +1 -1
  130. package/web/assets/{interface-time-clock-circle.svg-CJjbqmaM.js → interface-time-clock-circle.svg-Ck0G0rmI.js} +1 -1
  131. package/web/assets/{interface-time-hour-glass.svg-DVqPtXUm.js → interface-time-hour-glass.svg-C-mRKciT.js} +1 -1
  132. package/web/assets/{interface-users-multiple.svg-wdqJgfZm.js → interface-users-multiple.svg-DYmB6Rbf.js} +1 -1
  133. package/web/assets/{interface-weather-moon.svg-BKrQgzTa.js → interface-weather-moon.svg-Cvj6_eNh.js} +1 -1
  134. package/web/assets/{javascript-DSFf_YjS.js → javascript-CY5caZva.js} +1 -1
  135. package/web/assets/{jsonMode-B2P8l1pU.js → jsonMode-rh9HaZkf.js} +1 -1
  136. package/web/assets/{liquid-B7MQ4Fsk.js → liquid-DlLRGYKU.js} +1 -1
  137. package/web/assets/{lspLanguageFeatures-C3FF6vUy.js → lspLanguageFeatures-CRnhy4bG.js} +1 -1
  138. package/web/assets/{mail-chat-bubble-square.svg-BloaVfp-.js → mail-chat-bubble-square.svg-BObGty59.js} +1 -1
  139. package/web/assets/{mail-send-email-paper-airplane.svg-B6ZIXm5P.js → mail-send-email-paper-airplane.svg-B5czr-hw.js} +1 -1
  140. package/web/assets/{mail-send-envelope.svg-DY5COScs.js → mail-send-envelope.svg-C37J2sdc.js} +1 -1
  141. package/web/assets/{mdx-C_WgJhu_.js → mdx-B3a8uTpN.js} +1 -1
  142. package/web/assets/{message-BHo4LcuI.js → message-CD325uOm.js} +1 -1
  143. package/web/assets/{minus-B_o0inoM.js → minus-Cl1s4nDX.js} +1 -1
  144. package/web/assets/{modal-DquH5DEK.js → modal-CU6Bnd1J.js} +1 -1
  145. package/web/assets/modal-DEWMc9tx.js +1 -0
  146. package/web/assets/{money-cashier-receipt.svg-oseoAVlB.js → money-cashier-receipt.svg-Cc8n6S0T.js} +1 -1
  147. package/web/assets/{money-currency-dollar-pay.svg-DcGijgHE.js → money-currency-dollar-pay.svg-C0_3kvpL.js} +1 -1
  148. package/web/assets/{money-graph-arrow-increase.svg-3ZRKzQXX.js → money-graph-arrow-increase.svg-woD8qioO.js} +1 -1
  149. package/web/assets/{money-graph-bar-chart-increase.svg-BrHE0FOy.js → money-graph-bar-chart-increase.svg-CSw1VAAV.js} +1 -1
  150. package/web/assets/{multiselect-CZCZtbEb.js → multiselect-BRGZ5fql.js} +1 -1
  151. package/web/assets/{nature-ecology-leaf.svg-DUFviPEE.js → nature-ecology-leaf.svg-CQP_HptW.js} +1 -1
  152. package/web/assets/{password-BTw05sQ2.js → password-CT6KZaXX.js} +1 -1
  153. package/web/assets/{phone-telephone.svg-NChbl8AZ.js → phone-telephone.svg-DdIEcJda.js} +1 -1
  154. package/web/assets/{plus-CYFRbMfZ.js → plus-CNb4vtRF.js} +1 -1
  155. package/web/assets/process.store-DS0H00M6.js +1 -0
  156. package/web/assets/{programming-bug.svg-BQnBdCsT.js → programming-bug.svg-b2e0hwhB.js} +1 -1
  157. package/web/assets/{programming-cloud.svg-CFurS7YD.js → programming-cloud.svg-2k-_lY2R.js} +1 -1
  158. package/web/assets/{programming-computer-database-server.svg-BCVSLupS.js → programming-computer-database-server.svg-CsVPAAB9.js} +1 -1
  159. package/web/assets/{programming-computer-database.svg-Durcs657.js → programming-computer-database.svg-CzCJ-cUE.js} +1 -1
  160. package/web/assets/{programming-module-four-layout.svg-C2j6c2b3.js → programming-module-four-layout.svg-D3tAGvjg.js} +1 -1
  161. package/web/assets/{programming-module-three.svg-Dl1mzila.js → programming-module-three.svg-Cgtxdkq9.js} +1 -1
  162. package/web/assets/{programming-module.svg-Ru5EdTBU.js → programming-module.svg-B1uuFp4W.js} +1 -1
  163. package/web/assets/{programming-script-code.svg-DcVa8zJ9.js → programming-script-code.svg-B4FKnqTv.js} +1 -1
  164. package/web/assets/{python-BykhsxRP.js → python-BObWJ8Hq.js} +1 -1
  165. package/web/assets/{razor-D_mR8RkO.js → razor-COigQ7gt.js} +1 -1
  166. package/web/assets/router-Di7VfiOq.js +1 -0
  167. package/web/assets/settings-scope-D3a6G9-2.js +1 -0
  168. package/web/assets/{settings.store-DOfmiAcW.js → settings.store-Dxshs2VQ.js} +1 -1
  169. package/web/assets/{shopping-cart.svg-B3H5uLw5.js → shopping-cart.svg-BuRDYcqM.js} +1 -1
  170. package/web/assets/{shopping-gift-present.svg-Iqn37pBP.js → shopping-gift-present.svg-h10DhCw1.js} +1 -1
  171. package/web/assets/{shopping-shipping-box-parcel-package.svg-BLFpdcWA.js → shopping-shipping-box-parcel-package.svg-Cj8fvF6E.js} +1 -1
  172. package/web/assets/{src-C_rj6jTS.js → src-CeD-dzB5.js} +1 -1
  173. package/web/assets/{src-BYh7ThU0.js → src-D83niZVs.js} +1 -1
  174. package/web/assets/{tabpanel-Bv4fRZzp.js → tabpanel-DguHvr4k.js} +1 -1
  175. package/web/assets/{tag-new-circle.svg-DIeLhows.js → tag-new-circle.svg-Zn07CrZt.js} +1 -1
  176. package/web/assets/{toggleswitch-BceT7a4p.js → toggleswitch-BGTO0eH4.js} +1 -1
  177. package/web/assets/{travel-map-earth-globe.svg-ZeztXqnU.js → travel-map-earth-globe.svg-B4LvrGwp.js} +1 -1
  178. package/web/assets/trpc-B3z_V0Ei.js +1 -0
  179. package/web/assets/{tsMode-SvRa8C_f.js → tsMode-Hh_YkITa.js} +1 -1
  180. package/web/assets/{typescript-CWqZ6okb.js → typescript-C9fyq61g.js} +1 -1
  181. package/web/assets/useAiChatDrawer-DvkZ7XYr.js +1 -0
  182. package/web/assets/{useCloudOrg-DdUm6wvu.js → useCloudOrg-Cn9VivVr.js} +1 -1
  183. package/web/assets/{useProjectCatalog-CvcCqyU7.js → useProjectCatalog-BTfFgYwA.js} +1 -1
  184. package/web/assets/{xml-CBOHM5vV.js → xml-DGE9ZlpR.js} +1 -1
  185. package/web/assets/{yaml-Ck5vZTNH.js → yaml-D4ibnYJa.js} +1 -1
  186. package/web/index.html +1 -1
  187. package/src-ETRPQHFP.js.map +0 -1
  188. package/web/assets/AiChatPage-B14vDmO-.js +0 -1
  189. package/web/assets/AppLayout-Cwizg1FV.js +0 -1
  190. package/web/assets/CloudAccountPage-CpSBW_If.js +0 -1
  191. package/web/assets/WikiPage-BnqPhEQ9.js +0 -1
  192. package/web/assets/auth-errors-DHq-tg-I.js +0 -1
  193. package/web/assets/interface-content-folder.svg-DiUdq9Xr.js +0 -1
  194. package/web/assets/modal-B-Sy97Tr.js +0 -1
  195. package/web/assets/process.store-ClHfDEKC.js +0 -1
  196. package/web/assets/router-DBBbiuoP.js +0 -1
  197. package/web/assets/settings-scope-BliiOU7-.js +0 -1
  198. package/web/assets/trpc-CilSj96H.js +0 -1
  199. package/web/assets/useAiChatDrawer-BWCsxZJK.js +0 -1
package/index.js CHANGED
@@ -270,7 +270,10 @@ function listenWithRetry(server, port, host, wss, maxRetries = 20, delay = 500)
270
270
  });
271
271
  }
272
272
  async function main() {
273
- const { createLocalServer, pullEnv, PullEnvError, registerInstance } = await import("./src-ETRPQHFP.js");
273
+ const { ensureNodeBinOnPath, ensureUserBinsOnPath } = await import("./node-QABM22GF.js");
274
+ ensureNodeBinOnPath();
275
+ await ensureUserBinsOnPath();
276
+ const { createLocalServer, pullEnv, PullEnvError, registerInstance } = await import("./src-QP5LALGR.js");
274
277
  if (isPullEnv) {
275
278
  if (!serviceArg) {
276
279
  console.error("Error: --service (-s) is required with --pull-env");
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/port-resolution.ts"],"sourcesContent":["#!/usr/bin/env node\nimport type { Server } from 'node:http';\nimport type { WebSocketServer } from 'ws';\nimport type { Request, Response } from 'express';\nimport { fileURLToPath, URL as NodeURL } from 'node:url';\nimport { dirname, join, resolve } from 'node:path';\nimport { readFileSync } from 'node:fs';\nimport express from 'express';\nimport dotenv from 'dotenv'\nimport open from 'open';\nimport { resolvePort } from './port-resolution.js';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst { version } = JSON.parse(\n readFileSync(new NodeURL('./package.json', import.meta.url), 'utf8'),\n) as { version: string };\n\nfunction printStartupTable(port: number, appUrl: string): void {\n const rows: [string, string][] = [\n ['Version', version],\n ['Port', String(port)],\n ['Url', appUrl],\n ];\n\n const col0 = Math.max(...rows.map(([k]) => k.length));\n const col1 = Math.max(...rows.map(([, v]) => v.length));\n\n const pad = (s: string, n: number) => s.padEnd(n);\n const hr = (l: string, m: string, r: string, f: string) =>\n l + f.repeat(col0 + 2) + m + f.repeat(col1 + 2) + r;\n\n console.log('');\n console.log(hr('┌', '┬', '┐', '─'));\n for (const [key, value] of rows) {\n console.log(`│ ${pad(key, col0)} │ ${pad(value, col1)} │`);\n }\n console.log(hr('└', '┴', '┘', '─'));\n console.log('');\n}\n\n// Parse CLI flags\nconst args = process.argv.slice(2);\n\n/**\n * Set by the desktop launcher. It means nobody is watching a terminal, so a\n * startup failure has to be reported through a window of its own.\n */\nconst isFromDesktop = args.includes('--from-desktop');\n\n// Capture must start before anything logs, hence this early import.\nconst startupFailure = isFromDesktop ? await import('./startup-failure.js') : null;\nstartupFailure?.captureOutput();\n\nfunction getFlagValue(flags: string[]): string | undefined {\n for (const flag of flags) {\n const idx = args.indexOf(flag);\n if (idx !== -1 && idx + 1 < args.length) return args[idx + 1];\n }\n return undefined;\n}\n\n/**\n * Flags that mirror a RUNEYA_* environment variable. The flag always wins over\n * the variable, and both are equivalent otherwise.\n *\n * Secrets (RUNEYA_ENCRYPTION_KEY, RUNEYA_MASTER_PASSWORD) deliberately have no\n * flag: process arguments are world-readable through `ps` on most systems.\n */\nconst ENV_FLAGS: { flag: string; env: string }[] = [\n { flag: '--host', env: 'RUNEYA_HOST' },\n { flag: '--agent-port', env: 'RUNEYA_AGENT_PORT' },\n { flag: '--agent-host', env: 'RUNEYA_AGENT_HOST' },\n { flag: '--agent-binary-path', env: 'RUNEYA_AGENT_BINARY_PATH' },\n { flag: '--data-dir', env: 'RUNEYA_DATA_DIR' },\n { flag: '--mode', env: 'RUNEYA_MODE' },\n { flag: '--cloud-url', env: 'RUNEYA_CLOUD_URL' },\n { flag: '--cloud-app-url', env: 'RUNEYA_CLOUD_APP_URL' },\n { flag: '--cors-origin', env: 'RUNEYA_CORS_ORIGIN' },\n { flag: '--claude-pty', env: 'RUNEYA_CLAUDE_PTY' },\n];\n\n// Flags taking a value — needed so their value is not mistaken for the target directory\nconst flagsWithValues = new Set([\n '--port',\n '--name',\n '-e', '--environment',\n '-s', '--service',\n ...ENV_FLAGS.map((f) => f.flag),\n]);\n\n// Apply value flags to their env var (flag wins over an already-set variable).\n// Done before dotenv so a .env file can never override an explicit flag.\nfor (const { flag, env: key } of ENV_FLAGS) {\n const value = getFlagValue([flag]);\n if (value !== undefined) process.env[key] = value;\n}\n// --debug is a boolean shortcut for RUNEYA_DEBUG=1\nif (args.includes('--debug')) process.env['RUNEYA_DEBUG'] = '1';\n\n/**\n * `install-desktop` / `uninstall-desktop` — handled before anything else so the\n * sub-command name is never mistaken for a target directory, and so the current\n * working directory is still the user's when we capture it.\n *\n * Bare on a TTY it opens a wizard; any flag that pre-answers a question skips\n * straight to the action so scripts stay unattended.\n */\nconst subCommand = args[0];\nif (subCommand === 'install-desktop' || subCommand === 'uninstall-desktop') {\n const { installDesktopLauncher, uninstallDesktopLauncher, deriveIdentity } =\n await import('./desktop-launcher.js');\n const { shouldRunWizard, runInstallWizard, printInstallReport, printUninstallReport } =\n await import('./desktop-wizard.js');\n\n const { parsePort } = await import('./free-port.js');\n\n const rest = args.slice(1);\n // Every flag of this sub-command that takes a value: without this, the value\n // itself (a port number, a name) is mistaken for the target directory.\n const subFlagsWithValues = new Set(['--name', '--port', '--agent-port']);\n const positional = rest.find((a, i) => !a.startsWith('-') && !subFlagsWithValues.has(rest[i - 1] ?? ''));\n const nameFlag = getFlagValue(['--name']);\n\n // Ports baked into the shortcut. Null means \"follow Runeya's default\", so a\n // launcher created without them keeps tracking the default if it changes.\n const portFlagRaw = getFlagValue(['--port']);\n const agentPortFlagRaw = getFlagValue(['--agent-port']);\n for (const [flag, raw] of [['--port', portFlagRaw], ['--agent-port', agentPortFlagRaw]] as const) {\n if (raw !== undefined && parsePort(raw) === null) {\n console.error(`Erreur : ${flag} attend un entier entre 1 et 65535 (reçu ${JSON.stringify(raw)}).`);\n process.exit(1);\n }\n }\n let port = parsePort(portFlagRaw);\n let agentPort = parsePort(agentPortFlagRaw);\n\n // The data directory is resolved from the working directory, so a launcher\n // that does not pin one would start Runeya in the desktop's cwd (usually the\n // home directory) and create a stray .runeya there. Pin the cwd by default.\n let workingDir = rest.includes('--no-cwd') ? null : resolve(positional ?? process.cwd());\n let displayName = nameFlag;\n\n if (subCommand === 'install-desktop' && shouldRunWizard(rest, positional !== undefined)) {\n const answers = await runInstallWizard(process.cwd());\n if (!answers) process.exit(130); // aborted with Ctrl+C\n workingDir = answers.workingDir;\n displayName = answers.name;\n port = answers.port;\n agentPort = answers.agentPort;\n }\n\n const { name, id } = deriveIdentity(displayName, workingDir);\n\n try {\n if (subCommand === 'install-desktop') {\n const result = await installDesktopLauncher({\n nodePath: process.execPath,\n cliEntry: fileURLToPath(import.meta.url),\n distDir: __dirname,\n workingDir,\n name,\n id,\n port,\n agentPort,\n });\n printInstallReport({ name, workingDir, nodePath: process.execPath, port, agentPort, result });\n } else {\n printUninstallReport(name, await uninstallDesktopLauncher(name, id));\n }\n process.exit(0);\n } catch (err) {\n console.error(`Erreur : ${(err as Error).message}`);\n process.exit(1);\n }\n}\n\n// Resolve target directory (first positional arg, skipping flag values)\nconst targetDir = args.find((a, i) => !a.startsWith('-') && !flagsWithValues.has(args[i - 1] ?? ''));\nif (targetDir) {\n const resolved = resolve(targetDir);\n process.chdir(resolved);\n console.log(`[cli] Working directory: ${resolved}`);\n} else if (process.env['RUNEYA_DATA_DIR']) {\n const resolved = resolve(process.env['RUNEYA_DATA_DIR'], '..');\n process.chdir(resolved);\n console.log(`[cli] Working directory: ${resolved} (from RUNEYA_DATA_DIR)`);\n}\n\ndotenv.config({ quiet: true });\n\nif (args.includes('--help') || args.includes('-h')) {\n console.log(`Usage: runeya [path-to-your-stack] [options]\n\nCommands:\n install-desktop [path] Create a desktop/menu launcher for this machine\n Bare on a terminal, this opens a short wizard.\n uninstall-desktop Remove a launcher created by install-desktop\n --name <label> Launcher name (default: \"Runeya — <folder>\")\n --no-cwd Global launcher — do not pin a working directory\n --port <n> Port baked into the launcher (default: Runeya's own)\n --agent-port <n> Agent port baked in (default: launcher port + 1)\n -y, --yes Skip the wizard and take the defaults\n --from-desktop Set by desktop launchers: report startup failures\n in a browser window instead of a silent exit\n\nOptions:\n --version Show version number\n --pe, --pull-env Print env vars for a service to stdout (requires -e and -s)\n -e, --environment <n> Environment name or id\n -s, --service <name> Service name or id\n --lan Expose server on the local network (shortcut for --host 0.0.0.0)\n --no-open Do not open browser on startup\n --agent Run as agent only (no server, no UI) — for remote machines\n -h, --help Show this help message\n\nConfiguration:\n Each setting has a flag and an equivalent RUNEYA_ environment variable; the\n flag wins. Variables are prefixed so they cannot collide with those of the\n services you manage. A .env file in the working directory is loaded\n automatically, but never overrides a flag.\n\n Flag Environment variable Default\n --port <n> RUNEYA_HTTP_PORT 4000\n (binds the agent instead when --agent is used)\n --host <address> RUNEYA_HOST 127.0.0.1\n --agent-port <n> RUNEYA_AGENT_PORT server port + 1\n --agent-host <address> RUNEYA_AGENT_HOST 127.0.0.1\n --agent-binary-path <path> RUNEYA_AGENT_BINARY_PATH bundled with the CLI\n --data-dir <path> RUNEYA_DATA_DIR <cwd>/.runeya\n --mode <mode> RUNEYA_MODE local-simple\n 'local-simple' | 'cloud'\n --cloud-url <url> RUNEYA_CLOUD_URL —\n --cloud-app-url <url> RUNEYA_CLOUD_APP_URL —\n --cors-origin <origin> RUNEYA_CORS_ORIGIN —\n --lan RUNEYA_LAN_PROXY false\n --debug RUNEYA_DEBUG false\n --claude-pty <0|1> RUNEYA_CLAUDE_PTY 1\n PTY mode for the Claude Code runner\n\n Secrets have no flag — process arguments are readable by other users via 'ps':\n RUNEYA_ENCRYPTION_KEY 64-char hex key for CI/CD — unlocks secrets without a\n master password AND disables tRPC authentication.\n Never set this on a machine reachable by others.\n RUNEYA_MASTER_PASSWORD Master password used by --pull-env instead of prompting\n\n Standard variables Runeya also honours: NODE_ENV, CI (skips opening the browser).\n`);\n process.exit(0);\n}\n\nif (args.includes('--version')) {\n console.log(version);\n process.exit(0);\n}\n\nconst noOpen =\n args.includes('--no-open') ||\n !!process.env['VITEST'] ||\n !!process.env['CI'] ||\n process.env['NODE_ENV'] === 'test';\n\n// --pull-env flag — detect early so we can silence stdout before any log\nconst isPullEnv = args.includes('--pull-env') || args.includes('--pe');\n\n// In pull-env mode, redirect console.log/info to stderr so only KEY=VALUE goes to stdout\nif (isPullEnv) {\n const toStderr = (...a: unknown[]) => process.stderr.write(a.join(' ') + '\\n');\n console.log = toStderr;\n console.info = toStderr;\n}\n\nconst serviceArg = getFlagValue(['-s', '--service']);\nconst environmentArg = getFlagValue(['-e', '--environment']);\n\n// Configure environment BEFORE importing server (env is parsed at module load)\n// --agent mode: run as standalone agent only (no server, no UI)\nconst isAgentOnly = args.includes('--agent');\n\n// --port targets the server, except in agent mode where it binds the agent\nconst portFlag = getFlagValue(['--port']);\nif (portFlag) {\n process.env[isAgentOnly ? 'RUNEYA_AGENT_PORT' : 'RUNEYA_HTTP_PORT'] = portFlag;\n}\n\n// --lan binds to 0.0.0.0. As an explicit flag it outranks RUNEYA_HOST; coming\n// from RUNEYA_LAN_PROXY it only fills in a host nobody else set.\nconst hostFlag = getFlagValue(['--host']);\nconst isLan = args.includes('--lan');\nconst isLanProxy = isLan || process.env.RUNEYA_LAN_PROXY === 'true' || process.env.RUNEYA_LAN_PROXY === '1';\nif (isLanProxy) {\n process.env.RUNEYA_LAN_PROXY = 'true';\n if (!hostFlag && isLan) process.env.RUNEYA_HOST = '0.0.0.0';\n else process.env.RUNEYA_HOST ??= '0.0.0.0';\n}\n\n// In agent mode --host binds the agent rather than the server\nif (isAgentOnly) {\n if (hostFlag) {\n process.env.RUNEYA_AGENT_HOST = hostFlag;\n } else if (isLan) {\n process.env.RUNEYA_AGENT_HOST = '0.0.0.0';\n } else if (isLanProxy) {\n process.env.RUNEYA_AGENT_HOST ??= '0.0.0.0';\n }\n}\n\n// Agent binary shipped inside the CLI dist — overridable via --agent-binary-path\nprocess.env.RUNEYA_AGENT_BINARY_PATH ??= join(__dirname, 'agent/index.js');\n// Expose CLI version to server\nprocess.env.RUNEYA_VERSION = version;\n// Tell the server it was launched from a shortcut, so the UI can say so\nif (isFromDesktop) process.env.RUNEYA_FROM_DESKTOP = '1';\n// Data directory defaults to CWD/.runeya (server env.ts default)\n// so Runeya data lives alongside the target project.\n\n/**\n * Listen with retry for EADDRINUSE — handles the race condition when the CLI\n * restarts the server before the old process has fully released the port.\n *\n * The `wss` parameter is needed because the `ws` library re-emits HTTP server\n * errors on the WebSocketServer — without a handler the error becomes unhandled.\n */\nfunction listenWithRetry(\n server: Server,\n port: number,\n host: string,\n wss?: WebSocketServer,\n maxRetries = 20,\n delay = 500,\n): Promise<void> {\n return new Promise((resolve, reject) => {\n let attempts = 0;\n\n // Absorb EADDRINUSE errors re-emitted by the ws library on the WSS\n // during the retry window. Without this, Node.js crashes on unhandled error.\n const wssErrorHandler = () => { /* absorbed — handled via server 'error' */ };\n wss?.on('error', wssErrorHandler);\n\n const tryListen = () => {\n const onError = (err: NodeJS.ErrnoException) => {\n // Clean up the 'listening' callback that server.listen() registered\n server.removeAllListeners('listening');\n\n if (err.code === 'EADDRINUSE' && attempts < maxRetries) {\n attempts++;\n console.log(`[cli] Port ${port} in use, retrying in ${delay}ms (${attempts}/${maxRetries})...`);\n setTimeout(tryListen, delay);\n } else {\n wss?.removeListener('error', wssErrorHandler);\n reject(err);\n }\n };\n\n server.once('error', onError);\n server.listen(port, host, () => {\n server.removeListener('error', onError);\n wss?.removeListener('error', wssErrorHandler);\n resolve();\n });\n };\n\n tryListen();\n });\n}\n\nasync function main() {\n // Dynamic import ensures env is parsed AFTER we configure it\n const { createLocalServer, pullEnv, PullEnvError, registerInstance } = await import('@runeya/apps-server');\n\n // Handle --pull-env mode: resolve env vars and print, then exit\n if (isPullEnv) {\n if (!serviceArg) {\n console.error('Error: --service (-s) is required with --pull-env');\n process.exit(1);\n }\n if (!environmentArg) {\n console.error('Error: --environment (-e) is required with --pull-env');\n process.exit(1);\n }\n try {\n const output = await pullEnv({ service: serviceArg, environment: environmentArg });\n if (output) process.stdout.write(output + '\\n');\n process.exit(0);\n } catch (err: unknown) {\n if (err instanceof PullEnvError) {\n console.error(`Error: ${err.message}`);\n process.exit(err.exitCode);\n }\n throw err;\n }\n }\n\n // --agent mode: standalone agent, no server, no UI\n if (isAgentOnly) {\n const { spawn } = await import('node:child_process');\n const agentBin = join(__dirname, 'agent/index.js');\n const child = spawn(process.execPath, [agentBin], { stdio: 'inherit' });\n child.on('exit', (code) => process.exit(code ?? 0));\n // SIGINT is already delivered to the child by the terminal (same process group).\n // Intercept it here only to suppress Node's default exit so we stay alive\n // until the child finishes its graceful shutdown.\n process.on('SIGINT', () => { /* wait for child to exit */ });\n process.on('SIGTERM', () => child.kill('SIGTERM'));\n return;\n }\n\n /**\n * A shortcut clicked twice must not fail.\n *\n * Starting a second instance on a port a Runeya already holds ends in\n * EADDRINUSE after ten seconds of retries — and from a launcher there is no\n * terminal to read that in. So the port is asked first: if Runeya answers,\n * the right move is to bring up the window that already exists.\n *\n * Only for launcher starts. From a terminal, `runeya` twice on one port is a\n * mistake worth reporting, not one worth papering over.\n */\n if (isFromDesktop) {\n const port = resolvePort();\n const { probeRuneya } = await import('./free-port.js');\n const existing = await probeRuneya(port);\n if (existing) {\n const url = `http://localhost:${port}`;\n console.log(`[cli] Runeya v${existing.version} déjà en cours sur le port ${port} — ouverture de ${url}`);\n if (!noOpen) await open(url);\n return;\n }\n }\n\n console.log('[cli] Starting Runeya...');\n\n // Create server (automatically spawns local agent)\n const { app, server, wss, shutdown } = await createLocalServer();\n\n // Serve static files from web frontend (embedded in CLI dist during build)\n const webDistPath = join(__dirname, 'web');\n app.use(express.static(webDistPath));\n\n // Fallback to index.html for client-side routing (Vue Router)\n // Express 5 requires explicit path patterns (not '*')\n app.use((_req: Request, res: Response) => {\n res.sendFile(join(webDistPath, 'index.html'));\n });\n\n const port = resolvePort();\n const host = process.env.RUNEYA_HOST ?? '127.0.0.1';\n\n await listenWithRetry(server, port, host, wss);\n\n // Announce this instance now that the port is really ours, so the settings\n // panel of any Runeya on this machine can list it.\n await registerInstance();\n\n const appUrl = `http://${host}:${port}`;\n\n if (!noOpen) {\n await open(appUrl);\n }\n\n console.log('\\n🚀 Runeya is running!');\n if (isLanProxy) {\n console.log('🌐 LAN mode: server and service ports exposed on local network');\n }\n printStartupTable(port, appUrl);\n console.log('[cli] Press Ctrl+C to stop');\n\n let shuttingDown = false;\n const gracefulShutdown = async (signal: string) => {\n if (shuttingDown) {\n console.log(`[cli] Forced exit (second ${signal})`);\n process.exit(1);\n }\n shuttingDown = true;\n console.log(`\\n[cli] Received ${signal}, shutting down gracefully...`);\n\n // In dev, exit immediately — ports are freed on process death,\n // and the 'exit' handler in agent-spawner SIGKILLs the agent.\n if (process.env.NODE_ENV === 'development') {\n process.exit(0);\n }\n\n await shutdown();\n console.log('[cli] Shutdown complete');\n process.exit(0);\n };\n\n process.on('SIGTERM', () => gracefulShutdown('SIGTERM'));\n process.on('SIGINT', () => gracefulShutdown('SIGINT'));\n}\n\nmain().catch(async (err) => {\n console.error('[cli] Fatal error:', err);\n\n // With a terminal, the message above is the report. Without one, it goes\n // nowhere: serve it as a page and open it in the browser instead.\n if (startupFailure) {\n try {\n const { diagnose, renderFailurePage, capturedLines, showStartupFailure } = startupFailure;\n const html = renderFailurePage(\n diagnose(err, resolvePort()),\n capturedLines(),\n {\n 'Version': version,\n 'Dossier de travail': process.cwd(),\n 'Node': process.execPath,\n 'Runeya': fileURLToPath(import.meta.url),\n },\n );\n await showStartupFailure(html);\n } catch (reportErr) {\n console.error('[cli] Impossible d\\'afficher le rapport d\\'erreur:', reportErr);\n }\n }\n\n process.exit(1);\n});\n","/**\n * Resolve the HTTP port Runeya should listen on.\n *\n * Only RUNEYA_HTTP_PORT is read (default 4000) — the generic PORT variable is\n * intentionally ignored so it can stay reserved for the user's own services.\n *\n * Throws if the resolved value is not an integer in [1, 65535].\n */\nexport function resolvePort(): number {\n const raw = process.env.RUNEYA_HTTP_PORT;\n if (raw === undefined) return 4000;\n\n const port = Number(raw);\n if (!Number.isInteger(port) || port < 1 || port > 65535) {\n throw new Error(\n `Invalid port: ${JSON.stringify(raw)}. Must be an integer between 1 and 65535.`,\n );\n }\n return port;\n}\n"],"mappings":";;;AAIA,SAAS,eAAe,OAAO,eAAe;AAC9C,SAAS,SAAS,MAAM,eAAe;AACvC,SAAS,oBAAoB;AAC7B,OAAO,aAAa;AACpB,OAAO,YAAY;AACnB,OAAO,UAAU;;;ACDV,SAAS,cAAsB;AACpC,QAAM,MAAM,QAAQ,IAAI;AACxB,MAAI,QAAQ,OAAW,QAAO;AAE9B,QAAM,OAAO,OAAO,GAAG;AACvB,MAAI,CAAC,OAAO,UAAU,IAAI,KAAK,OAAO,KAAK,OAAO,OAAO;AACvD,UAAM,IAAI;AAAA,MACR,iBAAiB,KAAK,UAAU,GAAG,CAAC;AAAA,IACtC;AAAA,EACF;AACA,SAAO;AACT;;;ADPA,IAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AAExD,IAAM,EAAE,QAAQ,IAAI,KAAK;AAAA,EACvB,aAAa,IAAI,QAAQ,kBAAkB,YAAY,GAAG,GAAG,MAAM;AACrE;AAEA,SAAS,kBAAkB,MAAc,QAAsB;AAC7D,QAAM,OAA2B;AAAA,IAC/B,CAAC,WAAW,OAAO;AAAA,IACnB,CAAC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,IAAI,iCAA0B;AACtC,MAAI,YAAY;AACd,YAAQ,IAAI,wEAAiE;AAAA,EAC/E;AACA,oBAAkB,MAAM,MAAM;AAC9B,UAAQ,IAAI,4BAA4B;AAExC,MAAI,eAAe;AACnB,QAAM,mBAAmB,OAAO,WAAmB;AACjD,QAAI,cAAc;AAChB,cAAQ,IAAI,6BAA6B,MAAM,GAAG;AAClD,cAAQ,KAAK,CAAC;AAAA,IAChB;AACA,mBAAe;AACf,YAAQ,IAAI;AAAA,iBAAoB,MAAM,+BAA+B;AAIrE,QAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,UAAM,SAAS;AACf,YAAQ,IAAI,yBAAyB;AACrC,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,UAAQ,GAAG,WAAW,MAAM,iBAAiB,SAAS,CAAC;AACvD,UAAQ,GAAG,UAAU,MAAM,iBAAiB,QAAQ,CAAC;AACvD;AAEA,KAAK,EAAE,MAAM,OAAO,QAAQ;AAC1B,UAAQ,MAAM,sBAAsB,GAAG;AAIvC,MAAI,gBAAgB;AAClB,QAAI;AACF,YAAM,EAAE,UAAU,mBAAmB,eAAe,mBAAmB,IAAI;AAC3E,YAAM,OAAO;AAAA,QACX,SAAS,KAAK,YAAY,CAAC;AAAA,QAC3B,cAAc;AAAA,QACd;AAAA,UACE,WAAW;AAAA,UACX,sBAAsB,QAAQ,IAAI;AAAA,UAClC,QAAQ,QAAQ;AAAA,UAChB,UAAU,cAAc,YAAY,GAAG;AAAA,QACzC;AAAA,MACF;AACA,YAAM,mBAAmB,IAAI;AAAA,IAC/B,SAAS,WAAW;AAClB,cAAQ,MAAM,oDAAsD,SAAS;AAAA,IAC/E;AAAA,EACF;AAEA,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["resolve","port"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/port-resolution.ts"],"sourcesContent":["#!/usr/bin/env node\nimport type { Server } from 'node:http';\nimport type { WebSocketServer } from 'ws';\nimport type { Request, Response } from 'express';\nimport { fileURLToPath, URL as NodeURL } from 'node:url';\nimport { dirname, join, resolve } from 'node:path';\nimport { readFileSync } from 'node:fs';\nimport express from 'express';\nimport dotenv from 'dotenv'\nimport open from 'open';\nimport { resolvePort } from './port-resolution.js';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst { version } = JSON.parse(\n readFileSync(new NodeURL('./package.json', import.meta.url), 'utf8'),\n) as { version: string };\n\nfunction printStartupTable(port: number, appUrl: string): void {\n const rows: [string, string][] = [\n ['Version', version],\n ['Port', String(port)],\n ['Url', appUrl],\n ];\n\n const col0 = Math.max(...rows.map(([k]) => k.length));\n const col1 = Math.max(...rows.map(([, v]) => v.length));\n\n const pad = (s: string, n: number) => s.padEnd(n);\n const hr = (l: string, m: string, r: string, f: string) =>\n l + f.repeat(col0 + 2) + m + f.repeat(col1 + 2) + r;\n\n console.log('');\n console.log(hr('┌', '┬', '┐', '─'));\n for (const [key, value] of rows) {\n console.log(`│ ${pad(key, col0)} │ ${pad(value, col1)} │`);\n }\n console.log(hr('└', '┴', '┘', '─'));\n console.log('');\n}\n\n// Parse CLI flags\nconst args = process.argv.slice(2);\n\n/**\n * Set by the desktop launcher. It means nobody is watching a terminal, so a\n * startup failure has to be reported through a window of its own.\n */\nconst isFromDesktop = args.includes('--from-desktop');\n\n// Capture must start before anything logs, hence this early import.\nconst startupFailure = isFromDesktop ? await import('./startup-failure.js') : null;\nstartupFailure?.captureOutput();\n\nfunction getFlagValue(flags: string[]): string | undefined {\n for (const flag of flags) {\n const idx = args.indexOf(flag);\n if (idx !== -1 && idx + 1 < args.length) return args[idx + 1];\n }\n return undefined;\n}\n\n/**\n * Flags that mirror a RUNEYA_* environment variable. The flag always wins over\n * the variable, and both are equivalent otherwise.\n *\n * Secrets (RUNEYA_ENCRYPTION_KEY, RUNEYA_MASTER_PASSWORD) deliberately have no\n * flag: process arguments are world-readable through `ps` on most systems.\n */\nconst ENV_FLAGS: { flag: string; env: string }[] = [\n { flag: '--host', env: 'RUNEYA_HOST' },\n { flag: '--agent-port', env: 'RUNEYA_AGENT_PORT' },\n { flag: '--agent-host', env: 'RUNEYA_AGENT_HOST' },\n { flag: '--agent-binary-path', env: 'RUNEYA_AGENT_BINARY_PATH' },\n { flag: '--data-dir', env: 'RUNEYA_DATA_DIR' },\n { flag: '--mode', env: 'RUNEYA_MODE' },\n { flag: '--cloud-url', env: 'RUNEYA_CLOUD_URL' },\n { flag: '--cloud-app-url', env: 'RUNEYA_CLOUD_APP_URL' },\n { flag: '--cors-origin', env: 'RUNEYA_CORS_ORIGIN' },\n { flag: '--claude-pty', env: 'RUNEYA_CLAUDE_PTY' },\n];\n\n// Flags taking a value — needed so their value is not mistaken for the target directory\nconst flagsWithValues = new Set([\n '--port',\n '--name',\n '-e', '--environment',\n '-s', '--service',\n ...ENV_FLAGS.map((f) => f.flag),\n]);\n\n// Apply value flags to their env var (flag wins over an already-set variable).\n// Done before dotenv so a .env file can never override an explicit flag.\nfor (const { flag, env: key } of ENV_FLAGS) {\n const value = getFlagValue([flag]);\n if (value !== undefined) process.env[key] = value;\n}\n// --debug is a boolean shortcut for RUNEYA_DEBUG=1\nif (args.includes('--debug')) process.env['RUNEYA_DEBUG'] = '1';\n\n/**\n * `install-desktop` / `uninstall-desktop` — handled before anything else so the\n * sub-command name is never mistaken for a target directory, and so the current\n * working directory is still the user's when we capture it.\n *\n * Bare on a TTY it opens a wizard; any flag that pre-answers a question skips\n * straight to the action so scripts stay unattended.\n */\nconst subCommand = args[0];\nif (subCommand === 'install-desktop' || subCommand === 'uninstall-desktop') {\n const { installDesktopLauncher, uninstallDesktopLauncher, deriveIdentity } =\n await import('./desktop-launcher.js');\n const { shouldRunWizard, runInstallWizard, printInstallReport, printUninstallReport } =\n await import('./desktop-wizard.js');\n\n const { parsePort } = await import('./free-port.js');\n\n const rest = args.slice(1);\n // Every flag of this sub-command that takes a value: without this, the value\n // itself (a port number, a name) is mistaken for the target directory.\n const subFlagsWithValues = new Set(['--name', '--port', '--agent-port']);\n const positional = rest.find((a, i) => !a.startsWith('-') && !subFlagsWithValues.has(rest[i - 1] ?? ''));\n const nameFlag = getFlagValue(['--name']);\n\n // Ports baked into the shortcut. Null means \"follow Runeya's default\", so a\n // launcher created without them keeps tracking the default if it changes.\n const portFlagRaw = getFlagValue(['--port']);\n const agentPortFlagRaw = getFlagValue(['--agent-port']);\n for (const [flag, raw] of [['--port', portFlagRaw], ['--agent-port', agentPortFlagRaw]] as const) {\n if (raw !== undefined && parsePort(raw) === null) {\n console.error(`Erreur : ${flag} attend un entier entre 1 et 65535 (reçu ${JSON.stringify(raw)}).`);\n process.exit(1);\n }\n }\n let port = parsePort(portFlagRaw);\n let agentPort = parsePort(agentPortFlagRaw);\n\n // The data directory is resolved from the working directory, so a launcher\n // that does not pin one would start Runeya in the desktop's cwd (usually the\n // home directory) and create a stray .runeya there. Pin the cwd by default.\n let workingDir = rest.includes('--no-cwd') ? null : resolve(positional ?? process.cwd());\n let displayName = nameFlag;\n\n if (subCommand === 'install-desktop' && shouldRunWizard(rest, positional !== undefined)) {\n const answers = await runInstallWizard(process.cwd());\n if (!answers) process.exit(130); // aborted with Ctrl+C\n workingDir = answers.workingDir;\n displayName = answers.name;\n port = answers.port;\n agentPort = answers.agentPort;\n }\n\n const { name, id } = deriveIdentity(displayName, workingDir);\n\n try {\n if (subCommand === 'install-desktop') {\n const result = await installDesktopLauncher({\n nodePath: process.execPath,\n cliEntry: fileURLToPath(import.meta.url),\n distDir: __dirname,\n workingDir,\n name,\n id,\n port,\n agentPort,\n });\n printInstallReport({ name, workingDir, nodePath: process.execPath, port, agentPort, result });\n } else {\n printUninstallReport(name, await uninstallDesktopLauncher(name, id));\n }\n process.exit(0);\n } catch (err) {\n console.error(`Erreur : ${(err as Error).message}`);\n process.exit(1);\n }\n}\n\n// Resolve target directory (first positional arg, skipping flag values)\nconst targetDir = args.find((a, i) => !a.startsWith('-') && !flagsWithValues.has(args[i - 1] ?? ''));\nif (targetDir) {\n const resolved = resolve(targetDir);\n process.chdir(resolved);\n console.log(`[cli] Working directory: ${resolved}`);\n} else if (process.env['RUNEYA_DATA_DIR']) {\n const resolved = resolve(process.env['RUNEYA_DATA_DIR'], '..');\n process.chdir(resolved);\n console.log(`[cli] Working directory: ${resolved} (from RUNEYA_DATA_DIR)`);\n}\n\ndotenv.config({ quiet: true });\n\nif (args.includes('--help') || args.includes('-h')) {\n console.log(`Usage: runeya [path-to-your-stack] [options]\n\nCommands:\n install-desktop [path] Create a desktop/menu launcher for this machine\n Bare on a terminal, this opens a short wizard.\n uninstall-desktop Remove a launcher created by install-desktop\n --name <label> Launcher name (default: \"Runeya — <folder>\")\n --no-cwd Global launcher — do not pin a working directory\n --port <n> Port baked into the launcher (default: Runeya's own)\n --agent-port <n> Agent port baked in (default: launcher port + 1)\n -y, --yes Skip the wizard and take the defaults\n --from-desktop Set by desktop launchers: report startup failures\n in a browser window instead of a silent exit\n\nOptions:\n --version Show version number\n --pe, --pull-env Print env vars for a service to stdout (requires -e and -s)\n -e, --environment <n> Environment name or id\n -s, --service <name> Service name or id\n --lan Expose server on the local network (shortcut for --host 0.0.0.0)\n --no-open Do not open browser on startup\n --agent Run as agent only (no server, no UI) — for remote machines\n -h, --help Show this help message\n\nConfiguration:\n Each setting has a flag and an equivalent RUNEYA_ environment variable; the\n flag wins. Variables are prefixed so they cannot collide with those of the\n services you manage. A .env file in the working directory is loaded\n automatically, but never overrides a flag.\n\n Flag Environment variable Default\n --port <n> RUNEYA_HTTP_PORT 4000\n (binds the agent instead when --agent is used)\n --host <address> RUNEYA_HOST 127.0.0.1\n --agent-port <n> RUNEYA_AGENT_PORT server port + 1\n --agent-host <address> RUNEYA_AGENT_HOST 127.0.0.1\n --agent-binary-path <path> RUNEYA_AGENT_BINARY_PATH bundled with the CLI\n --data-dir <path> RUNEYA_DATA_DIR <cwd>/.runeya\n --mode <mode> RUNEYA_MODE local-simple\n 'local-simple' | 'cloud'\n --cloud-url <url> RUNEYA_CLOUD_URL —\n --cloud-app-url <url> RUNEYA_CLOUD_APP_URL —\n --cors-origin <origin> RUNEYA_CORS_ORIGIN —\n --lan RUNEYA_LAN_PROXY false\n --debug RUNEYA_DEBUG false\n --claude-pty <0|1> RUNEYA_CLAUDE_PTY 1\n PTY mode for the Claude Code runner\n\n Secrets have no flag — process arguments are readable by other users via 'ps':\n RUNEYA_ENCRYPTION_KEY 64-char hex key for CI/CD — unlocks secrets without a\n master password AND disables tRPC authentication.\n Never set this on a machine reachable by others.\n RUNEYA_MASTER_PASSWORD Master password used by --pull-env instead of prompting\n\n Standard variables Runeya also honours: NODE_ENV, CI (skips opening the browser).\n`);\n process.exit(0);\n}\n\nif (args.includes('--version')) {\n console.log(version);\n process.exit(0);\n}\n\nconst noOpen =\n args.includes('--no-open') ||\n !!process.env['VITEST'] ||\n !!process.env['CI'] ||\n process.env['NODE_ENV'] === 'test';\n\n// --pull-env flag — detect early so we can silence stdout before any log\nconst isPullEnv = args.includes('--pull-env') || args.includes('--pe');\n\n// In pull-env mode, redirect console.log/info to stderr so only KEY=VALUE goes to stdout\nif (isPullEnv) {\n const toStderr = (...a: unknown[]) => process.stderr.write(a.join(' ') + '\\n');\n console.log = toStderr;\n console.info = toStderr;\n}\n\nconst serviceArg = getFlagValue(['-s', '--service']);\nconst environmentArg = getFlagValue(['-e', '--environment']);\n\n// Configure environment BEFORE importing server (env is parsed at module load)\n// --agent mode: run as standalone agent only (no server, no UI)\nconst isAgentOnly = args.includes('--agent');\n\n// --port targets the server, except in agent mode where it binds the agent\nconst portFlag = getFlagValue(['--port']);\nif (portFlag) {\n process.env[isAgentOnly ? 'RUNEYA_AGENT_PORT' : 'RUNEYA_HTTP_PORT'] = portFlag;\n}\n\n// --lan binds to 0.0.0.0. As an explicit flag it outranks RUNEYA_HOST; coming\n// from RUNEYA_LAN_PROXY it only fills in a host nobody else set.\nconst hostFlag = getFlagValue(['--host']);\nconst isLan = args.includes('--lan');\nconst isLanProxy = isLan || process.env.RUNEYA_LAN_PROXY === 'true' || process.env.RUNEYA_LAN_PROXY === '1';\nif (isLanProxy) {\n process.env.RUNEYA_LAN_PROXY = 'true';\n if (!hostFlag && isLan) process.env.RUNEYA_HOST = '0.0.0.0';\n else process.env.RUNEYA_HOST ??= '0.0.0.0';\n}\n\n// In agent mode --host binds the agent rather than the server\nif (isAgentOnly) {\n if (hostFlag) {\n process.env.RUNEYA_AGENT_HOST = hostFlag;\n } else if (isLan) {\n process.env.RUNEYA_AGENT_HOST = '0.0.0.0';\n } else if (isLanProxy) {\n process.env.RUNEYA_AGENT_HOST ??= '0.0.0.0';\n }\n}\n\n// Agent binary shipped inside the CLI dist — overridable via --agent-binary-path\nprocess.env.RUNEYA_AGENT_BINARY_PATH ??= join(__dirname, 'agent/index.js');\n// Expose CLI version to server\nprocess.env.RUNEYA_VERSION = version;\n// Tell the server it was launched from a shortcut, so the UI can say so\nif (isFromDesktop) process.env.RUNEYA_FROM_DESKTOP = '1';\n// Data directory defaults to CWD/.runeya (server env.ts default)\n// so Runeya data lives alongside the target project.\n\n/**\n * Listen with retry for EADDRINUSE — handles the race condition when the CLI\n * restarts the server before the old process has fully released the port.\n *\n * The `wss` parameter is needed because the `ws` library re-emits HTTP server\n * errors on the WebSocketServer — without a handler the error becomes unhandled.\n */\nfunction listenWithRetry(\n server: Server,\n port: number,\n host: string,\n wss?: WebSocketServer,\n maxRetries = 20,\n delay = 500,\n): Promise<void> {\n return new Promise((resolve, reject) => {\n let attempts = 0;\n\n // Absorb EADDRINUSE errors re-emitted by the ws library on the WSS\n // during the retry window. Without this, Node.js crashes on unhandled error.\n const wssErrorHandler = () => { /* absorbed — handled via server 'error' */ };\n wss?.on('error', wssErrorHandler);\n\n const tryListen = () => {\n const onError = (err: NodeJS.ErrnoException) => {\n // Clean up the 'listening' callback that server.listen() registered\n server.removeAllListeners('listening');\n\n if (err.code === 'EADDRINUSE' && attempts < maxRetries) {\n attempts++;\n console.log(`[cli] Port ${port} in use, retrying in ${delay}ms (${attempts}/${maxRetries})...`);\n setTimeout(tryListen, delay);\n } else {\n wss?.removeListener('error', wssErrorHandler);\n reject(err);\n }\n };\n\n server.once('error', onError);\n server.listen(port, host, () => {\n server.removeListener('error', onError);\n wss?.removeListener('error', wssErrorHandler);\n resolve();\n });\n };\n\n tryListen();\n });\n}\n\nasync function main() {\n // Avant tout : ce que ce process hérite ici, le serveur, l'agent local et\n // chaque service lancé ensuite en héritent à leur tour. Un raccourci de bureau\n // reçoit le PATH de la session graphique, où ni les gestionnaires de version\n // ni les binaires installés par l'utilisateur (claude, codex) ne figurent.\n const { ensureNodeBinOnPath, ensureUserBinsOnPath } = await import('@runeya/packages-shared/node');\n ensureNodeBinOnPath();\n await ensureUserBinsOnPath();\n\n // Dynamic import ensures env is parsed AFTER we configure it\n const { createLocalServer, pullEnv, PullEnvError, registerInstance } = await import('@runeya/apps-server');\n\n // Handle --pull-env mode: resolve env vars and print, then exit\n if (isPullEnv) {\n if (!serviceArg) {\n console.error('Error: --service (-s) is required with --pull-env');\n process.exit(1);\n }\n if (!environmentArg) {\n console.error('Error: --environment (-e) is required with --pull-env');\n process.exit(1);\n }\n try {\n const output = await pullEnv({ service: serviceArg, environment: environmentArg });\n if (output) process.stdout.write(output + '\\n');\n process.exit(0);\n } catch (err: unknown) {\n if (err instanceof PullEnvError) {\n console.error(`Error: ${err.message}`);\n process.exit(err.exitCode);\n }\n throw err;\n }\n }\n\n // --agent mode: standalone agent, no server, no UI\n if (isAgentOnly) {\n const { spawn } = await import('node:child_process');\n const agentBin = join(__dirname, 'agent/index.js');\n const child = spawn(process.execPath, [agentBin], { stdio: 'inherit' });\n child.on('exit', (code) => process.exit(code ?? 0));\n // SIGINT is already delivered to the child by the terminal (same process group).\n // Intercept it here only to suppress Node's default exit so we stay alive\n // until the child finishes its graceful shutdown.\n process.on('SIGINT', () => { /* wait for child to exit */ });\n process.on('SIGTERM', () => child.kill('SIGTERM'));\n return;\n }\n\n /**\n * A shortcut clicked twice must not fail.\n *\n * Starting a second instance on a port a Runeya already holds ends in\n * EADDRINUSE after ten seconds of retries — and from a launcher there is no\n * terminal to read that in. So the port is asked first: if Runeya answers,\n * the right move is to bring up the window that already exists.\n *\n * Only for launcher starts. From a terminal, `runeya` twice on one port is a\n * mistake worth reporting, not one worth papering over.\n */\n if (isFromDesktop) {\n const port = resolvePort();\n const { probeRuneya } = await import('./free-port.js');\n const existing = await probeRuneya(port);\n if (existing) {\n const url = `http://localhost:${port}`;\n console.log(`[cli] Runeya v${existing.version} déjà en cours sur le port ${port} — ouverture de ${url}`);\n if (!noOpen) await open(url);\n return;\n }\n }\n\n console.log('[cli] Starting Runeya...');\n\n // Create server (automatically spawns local agent)\n const { app, server, wss, shutdown } = await createLocalServer();\n\n // Serve static files from web frontend (embedded in CLI dist during build)\n const webDistPath = join(__dirname, 'web');\n app.use(express.static(webDistPath));\n\n // Fallback to index.html for client-side routing (Vue Router)\n // Express 5 requires explicit path patterns (not '*')\n app.use((_req: Request, res: Response) => {\n res.sendFile(join(webDistPath, 'index.html'));\n });\n\n const port = resolvePort();\n const host = process.env.RUNEYA_HOST ?? '127.0.0.1';\n\n await listenWithRetry(server, port, host, wss);\n\n // Announce this instance now that the port is really ours, so the settings\n // panel of any Runeya on this machine can list it.\n await registerInstance();\n\n const appUrl = `http://${host}:${port}`;\n\n if (!noOpen) {\n await open(appUrl);\n }\n\n console.log('\\n🚀 Runeya is running!');\n if (isLanProxy) {\n console.log('🌐 LAN mode: server and service ports exposed on local network');\n }\n printStartupTable(port, appUrl);\n console.log('[cli] Press Ctrl+C to stop');\n\n let shuttingDown = false;\n const gracefulShutdown = async (signal: string) => {\n if (shuttingDown) {\n console.log(`[cli] Forced exit (second ${signal})`);\n process.exit(1);\n }\n shuttingDown = true;\n console.log(`\\n[cli] Received ${signal}, shutting down gracefully...`);\n\n // In dev, exit immediately — ports are freed on process death,\n // and the 'exit' handler in agent-spawner SIGKILLs the agent.\n if (process.env.NODE_ENV === 'development') {\n process.exit(0);\n }\n\n await shutdown();\n console.log('[cli] Shutdown complete');\n process.exit(0);\n };\n\n process.on('SIGTERM', () => gracefulShutdown('SIGTERM'));\n process.on('SIGINT', () => gracefulShutdown('SIGINT'));\n}\n\nmain().catch(async (err) => {\n console.error('[cli] Fatal error:', err);\n\n // With a terminal, the message above is the report. Without one, it goes\n // nowhere: serve it as a page and open it in the browser instead.\n if (startupFailure) {\n try {\n const { diagnose, renderFailurePage, capturedLines, showStartupFailure } = startupFailure;\n const html = renderFailurePage(\n diagnose(err, resolvePort()),\n capturedLines(),\n {\n 'Version': version,\n 'Dossier de travail': process.cwd(),\n 'Node': process.execPath,\n 'Runeya': fileURLToPath(import.meta.url),\n },\n );\n await showStartupFailure(html);\n } catch (reportErr) {\n console.error('[cli] Impossible d\\'afficher le rapport d\\'erreur:', reportErr);\n }\n }\n\n process.exit(1);\n});\n","/**\n * Resolve the HTTP port Runeya should listen on.\n *\n * Only RUNEYA_HTTP_PORT is read (default 4000) — the generic PORT variable is\n * intentionally ignored so it can stay reserved for the user's own services.\n *\n * Throws if the resolved value is not an integer in [1, 65535].\n */\nexport function resolvePort(): number {\n const raw = process.env.RUNEYA_HTTP_PORT;\n if (raw === undefined) return 4000;\n\n const port = Number(raw);\n if (!Number.isInteger(port) || port < 1 || port > 65535) {\n throw new Error(\n `Invalid port: ${JSON.stringify(raw)}. Must be an integer between 1 and 65535.`,\n );\n }\n return port;\n}\n"],"mappings":";;;AAIA,SAAS,eAAe,OAAO,eAAe;AAC9C,SAAS,SAAS,MAAM,eAAe;AACvC,SAAS,oBAAoB;AAC7B,OAAO,aAAa;AACpB,OAAO,YAAY;AACnB,OAAO,UAAU;;;ACDV,SAAS,cAAsB;AACpC,QAAM,MAAM,QAAQ,IAAI;AACxB,MAAI,QAAQ,OAAW,QAAO;AAE9B,QAAM,OAAO,OAAO,GAAG;AACvB,MAAI,CAAC,OAAO,UAAU,IAAI,KAAK,OAAO,KAAK,OAAO,OAAO;AACvD,UAA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AA,QACX,SAAS,KAAK,YAAY,CAAC;AAAA,QAC3B,cAAc;AAAA,QACd;AAAA,UACE,WAAW;AAAA,UACX,sBAAsB,QAAQ,IAAI;AAAA,UAClC,QAAQ,QAAQ;AAAA,UAChB,UAAU,cAAc,YAAY,GAAG;AAAA,QACzC;AAAA,MACF;AACA,YAAM,mBAAmB,IAAI;AAAA,IAC/B,SAAS,WAAW;AAClB,cAAQ,MAAM,oDAAsD,SAAS;AAAA,IAC/E;AAAA,EACF;AAEA,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["resolve","port"]}
@@ -88,13 +88,17 @@ var RUNEYA_CAPABILITIES = [
88
88
  // ─── Kanban ───────────────────────────────────────────────────────────────
89
89
  {
90
90
  name: "kanban_list_boards",
91
- description: "List the kanban boards of the organization. Returns the boardId to use in the other kanban tools, plus column and card counts. Cards themselves are not included \u2014 use kanban_get_board for those.",
91
+ description: "List the kanban boards of the organization. Returns the organizationId actually queried, the boardId to use in the other kanban tools, plus column and card counts. Cards themselves are not included \u2014 use kanban_get_board for those. An empty list means that organization really has no board: a failure to reach the cloud is reported as an error instead, never as an empty list.",
92
92
  route: "kanban.listBoards",
93
93
  method: "GET",
94
94
  params: [
95
- { name: "includeArchived", description: 'Set to "true" to include archived boards. Default: false.', required: false }
95
+ { name: "includeArchived", description: 'Set to "true" to include archived boards. Default: false.', required: false },
96
+ { name: "organizationId", description: "Which organization to read. Optional: needed only when the account belongs to several and the error message asks for it.", required: false }
96
97
  ],
97
- buildInput: (p) => ({ includeArchived: p.includeArchived === "true" })
98
+ buildInput: (p) => ({
99
+ includeArchived: p.includeArchived === "true",
100
+ ...p.organizationId ? { organizationId: p.organizationId } : {}
101
+ })
98
102
  },
99
103
  {
100
104
  name: "kanban_get_board",
@@ -131,12 +135,14 @@ var RUNEYA_CAPABILITIES = [
131
135
  params: [
132
136
  { name: "query", description: "Text to look for in card titles and bodies", required: true },
133
137
  { name: "boardId", description: "Restrict the search to this board. Omit to search all boards.", required: false },
134
- { name: "limit", description: "Maximum number of cards to return (1-100). Default: 25.", required: false }
138
+ { name: "limit", description: "Maximum number of cards to return (1-100). Default: 25.", required: false },
139
+ { name: "organizationId", description: "Which organization to search. Optional: needed only when the account belongs to several and the error message asks for it.", required: false }
135
140
  ],
136
141
  buildInput: (p) => ({
137
142
  query: p.query,
138
143
  ...p.boardId ? { boardId: p.boardId } : {},
139
- ...p.limit ? { limit: Number(p.limit) } : {}
144
+ ...p.limit ? { limit: Number(p.limit) } : {},
145
+ ...p.organizationId ? { organizationId: p.organizationId } : {}
140
146
  })
141
147
  },
142
148
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../../ai-capabilities/src/capabilities.ts","../../ai-capabilities/src/adapters/anthropic.ts","../../ai-capabilities/src/adapters/openai.ts","../../ai-capabilities/src/adapters/prompt.ts","../../ai-capabilities/src/trpc-caller.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { z } from 'zod';\nimport { RUNEYA_CAPABILITIES, callTrpc } from '@runeya/packages-ai-capabilities';\n\nconst BASE_URL = process.env['RUNEYA_BASE_URL'] ?? 'http://localhost:4000';\nconst CONVERSATION_ID = process.env['RUNEYA_CONVERSATION_ID'] ?? '';\nconst INTERNAL_TOKEN = process.env['RUNEYA_INTERNAL_TOKEN'] ?? '';\nconst ENV_TOKEN = process.env['RUNEYA_API_TOKEN'] ?? '';\n\nconst server = new McpServer({ name: 'runeya', version: '1.0.0' });\n\n// ─── Register each capability as an MCP tool ─────────────────────────────────\n\nfor (const cap of RUNEYA_CAPABILITIES) {\n const zodShape: Record<string, z.ZodTypeAny> = {};\n\n for (const param of cap.params) {\n const base = z.string().describe(param.description);\n zodShape[param.name] = param.required ? base : base.optional();\n }\n\n // authToken is MCP-specific: CLI runners pass the JWT here\n zodShape['authToken'] = z.string().describe('Bearer token for authentication').optional();\n\n server.tool(cap.name, cap.description, zodShape, async (input) => {\n try {\n const raw = (input as Record<string, string | undefined>).authToken;\n const authToken = (raw && !raw.startsWith('$')) ? raw : (ENV_TOKEN || INTERNAL_TOKEN || undefined);\n if (!authToken) throw new Error('No auth token available');\n\n const params = input as Record<string, string | undefined>;\n const result = await callTrpc(BASE_URL, cap.route, cap.method, cap.buildInput(params), authToken);\n return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] };\n } catch (err) {\n return {\n content: [{ type: 'text' as const, text: `Error: ${(err as Error).message}` }],\n isError: true,\n };\n }\n });\n}\n\n// ─── ask_user tool (scenario mode only) ─────────────────────────────────────\n\nif (CONVERSATION_ID && INTERNAL_TOKEN) {\n server.tool(\n 'ask_user',\n 'Ask the user a question and wait for their reply. Use this when you need clarification or input from the user to proceed.',\n { question: z.string().describe('The question to ask the user') },\n async ({ question }) => {\n try {\n const res = await fetch(`${BASE_URL}/api/trpc/scenario.requestInput`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${INTERNAL_TOKEN}`,\n },\n body: JSON.stringify({ conversationId: CONVERSATION_ID, question }),\n signal: AbortSignal.timeout(300_000), // 5 min\n });\n const json = await res.json() as Record<string, unknown>;\n const result = (json['result'] as Record<string, unknown> | undefined)?.['data'] ?? json;\n const text = typeof result === 'string' ? result : JSON.stringify(result);\n return { content: [{ type: 'text' as const, text }] };\n } catch (err) {\n return { content: [{ type: 'text' as const, text: `Error: ${(err as Error).message}` }], isError: true };\n }\n },\n );\n}\n\n// ─── Start the stdio transport ───────────────────────────────────────────────\n\nconst transport = new StdioServerTransport();\nawait server.connect(transport);\n","// ─── Runeya AI Capabilities — Single Source of Truth ─────────────────────────\n//\n// Adding a new capability:\n// 1. Add an entry to RUNEYA_CAPABILITIES below.\n// 2. Done. Anthropic tools, OpenAI tools, runner prompt docs, and MCP routes\n// are all generated automatically from this list.\n\nexport interface CapabilityParam {\n name: string;\n description: string;\n required: boolean;\n}\n\nexport interface RuneyaCapability {\n /** Tool name (snake_case, used as function name by LLMs). */\n name: string;\n /** Human-readable description shown to the LLM. */\n description: string;\n /** tRPC route segment, e.g. \"service.list\" or \"process.start\". */\n route: string;\n /** HTTP method for the tRPC call. */\n method: 'GET' | 'POST';\n /** Input parameters exposed to the LLM. */\n params: CapabilityParam[];\n /** Build the tRPC input object from raw LLM params. */\n buildInput: (params: Record<string, string | undefined>) => Record<string, unknown> | undefined;\n /** If true, safety instructions will warn the LLM to require explicit user intent. */\n destructive?: boolean;\n /**\n * Optional usage hint injected into the system prompt so the LLM knows when to use this tool.\n * Example: '\"wait 5s\" or \"pause for 10 seconds\" → call wait'\n */\n usageHint?: string;\n}\n\nexport const RUNEYA_CAPABILITIES: RuneyaCapability[] = [\n {\n name: 'list_services',\n description: 'List all available services. Returns serviceId and agentId for each — use these exact fields in other calls.',\n route: 'service.list',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'get_service_status',\n description: 'Get the current status (running, stopped, etc.) of a service.',\n route: 'process.get',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'The service ID', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, id: p.serviceId }),\n },\n {\n name: 'get_logs',\n description: 'Get the recent buffered logs for a service.',\n route: 'process.logs',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'The service ID', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId }),\n },\n {\n name: 'start_service',\n description: 'Start a service on an agent.',\n route: 'process.start',\n method: 'POST',\n params: [\n { name: 'serviceId', description: 'The service ID to start', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId }),\n destructive: true,\n },\n {\n name: 'stop_service',\n description: 'Stop a running service on an agent.',\n route: 'process.stop',\n method: 'POST',\n params: [\n { name: 'serviceId', description: 'The service ID to stop', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId }),\n destructive: true,\n },\n {\n name: 'restart_service',\n description: 'Restart a service on an agent (stop → redeploy → start).',\n route: 'process.restart',\n method: 'POST',\n params: [\n { name: 'serviceId', description: 'The service ID to restart', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId }),\n destructive: true,\n },\n\n // ─── Utility ─────────────────────────────────────────────────────────────\n\n {\n name: 'wait',\n description: 'Wait for a given number of milliseconds before continuing.',\n route: 'utility.wait',\n method: 'POST',\n params: [\n { name: 'ms', description: 'Number of MILLISECONDS to wait. Convert from seconds: 1s=1000, 10s=10000, 1min=60000. Max 300000.', required: true },\n ],\n buildInput: (p) => ({ ms: Number(p.ms) }),\n usageHint: '\"wait 5s\" → wait(ms=5000), \"pause 10 seconds\" → wait(ms=10000), \"attends 3 secondes\" → wait(ms=3000). Always convert to milliseconds.',\n },\n\n // ─── Kanban ───────────────────────────────────────────────────────────────\n\n {\n name: 'kanban_list_boards',\n description: 'List the kanban boards of the organization. Returns the boardId to use in the other kanban tools, plus column and card counts. Cards themselves are not included — use kanban_get_board for those.',\n route: 'kanban.listBoards',\n method: 'GET',\n params: [\n { name: 'includeArchived', description: 'Set to \"true\" to include archived boards. Default: false.', required: false },\n ],\n buildInput: (p) => ({ includeArchived: p.includeArchived === 'true' }),\n },\n {\n name: 'kanban_get_board',\n description: 'Read one kanban board: its columns, and the cards in each (id, title, markdown body, assignees, comment count, and attachment metadata — use kanban_download_attachment to fetch the bytes of a file). Use the exact column names it returns when moving or adding a card.',\n route: 'kanban.getBoard',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID, from kanban_list_boards', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId }),\n },\n {\n name: 'kanban_get_card_comments',\n description: \"Read the comment thread of one kanban card, newest last: who wrote each comment (ai or user, with the person's name), when, its text, and its attachments. The comments in your task context are a snapshot taken when the task started — call this to see anything written since, whenever someone tells you a comment was added or kanban_get_board reports a higher commentCount than you have.\",\n route: 'kanban.getCardComments',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID whose comments to read', required: true },\n { name: 'limit', description: 'How many of the most recent comments to return (1-200). Default: 50.', required: false },\n ],\n buildInput: (p) => ({\n boardId: p.boardId,\n cardId: p.cardId,\n ...(p.limit ? { limit: Number(p.limit) } : {}),\n }),\n usageHint: '\"le support a ajouté un commentaire\" / \"regarde les nouveaux commentaires\" → kanban_get_card_comments(boardId, cardId). Never answer from the snapshot in your context when fresh comments are mentioned.',\n },\n {\n name: 'kanban_search_cards',\n description: 'Search kanban cards by free text, matched against their title and body (accent- and case-insensitive). Searches every board of the organization unless boardId narrows it down.',\n route: 'kanban.searchCards',\n method: 'GET',\n params: [\n { name: 'query', description: 'Text to look for in card titles and bodies', required: true },\n { name: 'boardId', description: 'Restrict the search to this board. Omit to search all boards.', required: false },\n { name: 'limit', description: 'Maximum number of cards to return (1-100). Default: 25.', required: false },\n ],\n buildInput: (p) => ({\n query: p.query,\n ...(p.boardId ? { boardId: p.boardId } : {}),\n ...(p.limit ? { limit: Number(p.limit) } : {}),\n }),\n },\n {\n name: 'kanban_download_attachment',\n description: 'Download a kanban card attachment (image, PDF, any file) onto this machine and return its local path, so it can be opened with file-reading tools. Attachment ids come from the card context, from kanban_get_board, or from kanban_get_card_comments — a file attached to a comment downloads exactly like one attached to the card.',\n route: 'kanban.downloadAttachment',\n method: 'POST',\n params: [\n { name: 'attachmentId', description: 'The attachment ID, as listed on the card', required: true },\n ],\n buildInput: (p) => ({ attachmentId: p.attachmentId }),\n },\n {\n name: 'kanban_move_card',\n description: 'Move a kanban card to another column. Use the exact column name.',\n route: 'kanban.moveCard',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID to move', required: true },\n { name: 'targetColumn', description: 'Exact name of the target column', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId, targetColumn: p.targetColumn }),\n },\n {\n name: 'kanban_add_comment',\n description: 'Add a comment to a kanban card.',\n route: 'kanban.addComment',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID', required: true },\n { name: 'comment', description: 'The comment text (markdown supported)', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId, comment: p.comment }),\n },\n {\n name: 'kanban_get_card_links',\n description: 'Read the filiation of a board: which card depends on which. Returns one entry per link (child card ↔ parent card), plus the title, board, column, assignees and comment count of any linked card living on another board. Use it when a card context says it has a parent or sub-cards and you need their ids to read them.',\n route: 'kanban.getCardLinks',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID whose links to read', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId }),\n },\n {\n name: 'kanban_set_card_parent',\n description: 'Link a kanban card to a parent card, or detach it. The parent is the card the other one depends on — an epic and its tasks, a bug and its follow-ups. A card has at most one parent, and setting a new one replaces it. Omit parentCardId to detach. kanban_get_board reports the current filiation as parentCardId / childCardIds on each card.',\n route: 'kanban.setCardParent',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID of the card being linked', required: true },\n { name: 'cardId', description: 'The card that depends on the parent (the child)', required: true },\n { name: 'parentCardId', description: 'The parent card ID. Omit to detach the card from its parent.', required: false },\n { name: 'parentBoardId', description: \"The parent's board, when it lives on another board of the same organization. Defaults to boardId.\", required: false },\n ],\n buildInput: (p) => ({\n boardId: p.boardId,\n cardId: p.cardId,\n ...(p.parentCardId ? { parentCardId: p.parentCardId } : {}),\n ...(p.parentBoardId ? { parentBoardId: p.parentBoardId } : {}),\n }),\n },\n {\n name: 'kanban_add_card',\n description: 'Add a new card to a kanban column.',\n route: 'kanban.addCard',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'column', description: 'Exact name of the target column', required: true },\n { name: 'title', description: 'Card title', required: true },\n { name: 'content', description: 'Card content in markdown', required: false },\n ],\n buildInput: (p) => ({ boardId: p.boardId, column: p.column, title: p.title, content: p.content }),\n },\n];\n","import type { RuneyaCapability } from '../capabilities.js';\n\nexport interface AnthropicTool {\n name: string;\n description: string;\n input_schema: {\n type: 'object';\n properties: Record<string, { type: string; description: string }>;\n required: string[];\n [k: string]: unknown;\n };\n}\n\nexport function buildAnthropicTools(capabilities: RuneyaCapability[]): AnthropicTool[] {\n return capabilities.map(cap => ({\n name: cap.name,\n description: cap.description,\n input_schema: {\n type: 'object' as const,\n properties: Object.fromEntries(\n cap.params.map(p => [p.name, { type: 'string', description: p.description }]),\n ),\n required: cap.params.filter(p => p.required).map(p => p.name),\n },\n }));\n}\n","import type { RuneyaCapability } from '../capabilities.js';\n\nexport interface OpenAITool {\n type: 'function';\n function: {\n name: string;\n description: string;\n parameters: {\n type: 'object';\n properties: Record<string, { type: string; description: string }>;\n required: string[];\n };\n };\n}\n\nexport function buildOpenAITools(capabilities: RuneyaCapability[]): OpenAITool[] {\n return capabilities.map(cap => ({\n type: 'function' as const,\n function: {\n name: cap.name,\n description: cap.description,\n parameters: {\n type: 'object' as const,\n properties: Object.fromEntries(\n cap.params.map(p => [p.name, { type: 'string', description: p.description }]),\n ),\n required: cap.params.filter(p => p.required).map(p => p.name),\n },\n },\n }));\n}\n","import type { RuneyaCapability } from '../capabilities.js';\nexport type { RuneyaCapability };\n\n/**\n * Build the tool safety instruction block injected into cloud provider system prompts.\n * Generated from capabilities so it stays in sync automatically.\n */\nexport function buildToolSafetyInstruction(capabilities: RuneyaCapability[]): string {\n const destructive = capabilities.filter(c => c.destructive).map(c => c.name);\n const withHints = capabilities.filter(c => c.usageHint);\n\n const lines = ['## Tool use safety rules'];\n\n if (destructive.length > 0) {\n lines.push(`CRITICAL: Never call ${destructive.join(', ')} unless the user has EXPLICITLY and UNAMBIGUOUSLY requested it.`);\n lines.push(`- Only call destructive tools (${destructive.join(', ')}) when the user explicitly uses action words for a specific service.`);\n }\n\n if (withHints.length > 0) {\n lines.push('');\n lines.push('## Tool usage hints');\n for (const cap of withHints) {\n lines.push(`- ${cap.usageHint}`);\n }\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Build a markdown documentation block injected into runner system prompts.\n * Runners (ClaudeCodeRunner, CodexRunner) use this to know how to call the Runeya API.\n *\n * The generated doc is the single source of truth for all runner-facing API docs —\n * no need to maintain a separate runeya-api-docs.ts.\n */\nexport function buildPromptDocs(baseUrl: string, token: string, capabilities: RuneyaCapability[]): string {\n if (!token) return '';\n\n const lines: string[] = [\n '## Runeya API',\n '',\n `Tu peux interagir avec Runeya via l'API HTTP tRPC ci-dessous.`,\n `Base URL : ${baseUrl}/api/trpc`,\n 'Auth header : Authorization: Bearer $RUNEYA_API_TOKEN',\n '',\n ];\n\n const gets = capabilities.filter(c => c.method === 'GET');\n const posts = capabilities.filter(c => c.method === 'POST');\n\n if (gets.length > 0) {\n lines.push('### GET routes (paramètres en query string ?input=<JSON encodé>)', '');\n for (const cap of gets) {\n const example = cap.params.length > 0\n ? `?input=${JSON.stringify(Object.fromEntries(cap.params.map(p => [p.name === 'serviceId' ? 'id' : p.name, '...'])))}`\n : '';\n lines.push(`- \\`${cap.route}${example}\\` — ${cap.description}`);\n }\n lines.push('');\n }\n\n if (posts.length > 0) {\n lines.push('### POST routes (body JSON)', '');\n for (const cap of posts) {\n const bodyExample = cap.params.length > 0\n ? JSON.stringify(Object.fromEntries(cap.params.map(p => [p.name === 'serviceId' ? 'processId' : p.name, '...'])))\n : '{}';\n lines.push(`- \\`${cap.route}\\` — \\`${bodyExample}\\``);\n }\n lines.push('');\n }\n\n const hints = capabilities.filter(c => c.usageHint);\n if (hints.length > 0) {\n lines.push('### Usage hints', '');\n for (const cap of hints) {\n lines.push(`- ${cap.usageHint}`);\n }\n lines.push('');\n }\n\n lines.push(\n '### Exemple curl',\n '',\n '```bash',\n `curl -H \"Authorization: Bearer $RUNEYA_API_TOKEN\" \\\\`,\n ` \"${baseUrl}/api/trpc/service.list\"`,\n '',\n `curl -X POST -H \"Authorization: Bearer $RUNEYA_API_TOKEN\" \\\\`,\n ' -H \"Content-Type: application/json\" \\\\',\n ` -d '{\"agentId\":\"local\",\"processId\":\"my-service\"}' \\\\`,\n ` \"${baseUrl}/api/trpc/process.start\"`,\n '```',\n '',\n 'La réponse est de la forme `{\"result\":{\"data\":<résultat>}}`.',\n );\n\n return lines.join('\\n');\n}\n","/**\n * Shared tRPC HTTP caller used by:\n * - Server-side cloud tool executor (proxies cloud LLM tool calls to local tRPC)\n * - MCP server (calls tRPC on behalf of CLI runners)\n */\nexport async function callTrpc(\n baseUrl: string,\n route: string,\n method: 'GET' | 'POST',\n input: Record<string, unknown> | undefined,\n authToken: string,\n): Promise<unknown> {\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${authToken}`,\n };\n\n const url = method === 'GET' && input\n ? `${baseUrl}/api/trpc/${route}?input=${encodeURIComponent(JSON.stringify(input))}`\n : `${baseUrl}/api/trpc/${route}`;\n\n const res = await fetch(url, {\n method,\n headers,\n ...(method === 'POST' ? { body: JSON.stringify(input ?? {}) } : {}),\n signal: AbortSignal.timeout(15_000),\n });\n\n const json = await res.json() as Record<string, unknown>;\n if (json['error']) throw new Error(JSON.stringify(json['error']));\n const result = json['result'] as Record<string, unknown> | undefined;\n return result?.['data'] ?? result ?? json;\n}\n"],"mappings":";;;AACA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,SAAS;;;ACgCX,IAAM,sBAA0C;EACrD;IACE,MAAM;IACN,aAAa;IACb,OAAO;IACP,QAAQ;IACR,QAAQ,CAAC;IACT,YAAY,MAAM;EACpB;EACA;IACE,MAAM;IACN,aAAa;IACb,OAAO;IACP,QAAQ;IACR,QAAQ;MACN,EAAE,MAAM,aAAa,a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AAE,OAAO,EAAE,SAAS,8BAA8B,EAAE;AAAA,IAChE,OAAO,EAAE,SAAS,MAAM;AACtB,UAAI;AACF,cAAM,MAAM,MAAM,MAAM,GAAG,QAAQ,mCAAmC;AAAA,UACpE,QAAQ;AAAA,UACR,SAAS;AAAA,YACP,gBAAgB;AAAA,YAChB,iBAAiB,UAAU,cAAc;AAAA,UAC3C;AAAA,UACA,MAAM,KAAK,UAAU,EAAE,gBAAgB,iBAAiB,SAAS,CAAC;AAAA,UAClE,QAAQ,YAAY,QAAQ,GAAO;AAAA;AAAA,QACrC,CAAC;AACD,cAAM,OAAO,MAAM,IAAI,KAAK;AAC5B,cAAM,SAAU,KAAK,QAAQ,IAA4C,MAAM,KAAK;AACpF,cAAM,OAAO,OAAO,WAAW,WAAW,SAAS,KAAK,UAAU,MAAM;AACxE,eAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAiB,KAAK,CAAC,EAAE;AAAA,MACtD,SAAS,KAAK;AACZ,eAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,UAAW,IAAc,OAAO,GAAG,CAAC,GAAG,SAAS,KAAK;AAAA,MACzG;AAAA,IACF;AAAA,EACF;AACF;AAIA,IAAM,YAAY,IAAI,qBAAqB;AAC3C,MAAM,OAAO,QAAQ,SAAS;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../../ai-capabilities/src/capabilities.ts","../../ai-capabilities/src/adapters/anthropic.ts","../../ai-capabilities/src/adapters/openai.ts","../../ai-capabilities/src/adapters/prompt.ts","../../ai-capabilities/src/trpc-caller.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { z } from 'zod';\nimport { RUNEYA_CAPABILITIES, callTrpc } from '@runeya/packages-ai-capabilities';\n\nconst BASE_URL = process.env['RUNEYA_BASE_URL'] ?? 'http://localhost:4000';\nconst CONVERSATION_ID = process.env['RUNEYA_CONVERSATION_ID'] ?? '';\nconst INTERNAL_TOKEN = process.env['RUNEYA_INTERNAL_TOKEN'] ?? '';\nconst ENV_TOKEN = process.env['RUNEYA_API_TOKEN'] ?? '';\n\nconst server = new McpServer({ name: 'runeya', version: '1.0.0' });\n\n// ─── Register each capability as an MCP tool ─────────────────────────────────\n\nfor (const cap of RUNEYA_CAPABILITIES) {\n const zodShape: Record<string, z.ZodTypeAny> = {};\n\n for (const param of cap.params) {\n const base = z.string().describe(param.description);\n zodShape[param.name] = param.required ? base : base.optional();\n }\n\n // authToken is MCP-specific: CLI runners pass the JWT here\n zodShape['authToken'] = z.string().describe('Bearer token for authentication').optional();\n\n server.tool(cap.name, cap.description, zodShape, async (input) => {\n try {\n const raw = (input as Record<string, string | undefined>).authToken;\n const authToken = (raw && !raw.startsWith('$')) ? raw : (ENV_TOKEN || INTERNAL_TOKEN || undefined);\n if (!authToken) throw new Error('No auth token available');\n\n const params = input as Record<string, string | undefined>;\n const result = await callTrpc(BASE_URL, cap.route, cap.method, cap.buildInput(params), authToken);\n return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] };\n } catch (err) {\n return {\n content: [{ type: 'text' as const, text: `Error: ${(err as Error).message}` }],\n isError: true,\n };\n }\n });\n}\n\n// ─── ask_user tool (scenario mode only) ─────────────────────────────────────\n\nif (CONVERSATION_ID && INTERNAL_TOKEN) {\n server.tool(\n 'ask_user',\n 'Ask the user a question and wait for their reply. Use this when you need clarification or input from the user to proceed.',\n { question: z.string().describe('The question to ask the user') },\n async ({ question }) => {\n try {\n const res = await fetch(`${BASE_URL}/api/trpc/scenario.requestInput`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${INTERNAL_TOKEN}`,\n },\n body: JSON.stringify({ conversationId: CONVERSATION_ID, question }),\n signal: AbortSignal.timeout(300_000), // 5 min\n });\n const json = await res.json() as Record<string, unknown>;\n const result = (json['result'] as Record<string, unknown> | undefined)?.['data'] ?? json;\n const text = typeof result === 'string' ? result : JSON.stringify(result);\n return { content: [{ type: 'text' as const, text }] };\n } catch (err) {\n return { content: [{ type: 'text' as const, text: `Error: ${(err as Error).message}` }], isError: true };\n }\n },\n );\n}\n\n// ─── Start the stdio transport ───────────────────────────────────────────────\n\nconst transport = new StdioServerTransport();\nawait server.connect(transport);\n","// ─── Runeya AI Capabilities — Single Source of Truth ─────────────────────────\n//\n// Adding a new capability:\n// 1. Add an entry to RUNEYA_CAPABILITIES below.\n// 2. Done. Anthropic tools, OpenAI tools, runner prompt docs, and MCP routes\n// are all generated automatically from this list.\n\nexport interface CapabilityParam {\n name: string;\n description: string;\n required: boolean;\n}\n\nexport interface RuneyaCapability {\n /** Tool name (snake_case, used as function name by LLMs). */\n name: string;\n /** Human-readable description shown to the LLM. */\n description: string;\n /** tRPC route segment, e.g. \"service.list\" or \"process.start\". */\n route: string;\n /** HTTP method for the tRPC call. */\n method: 'GET' | 'POST';\n /** Input parameters exposed to the LLM. */\n params: CapabilityParam[];\n /** Build the tRPC input object from raw LLM params. */\n buildInput: (params: Record<string, string | undefined>) => Record<string, unknown> | undefined;\n /** If true, safety instructions will warn the LLM to require explicit user intent. */\n destructive?: boolean;\n /**\n * Optional usage hint injected into the system prompt so the LLM knows when to use this tool.\n * Example: '\"wait 5s\" or \"pause for 10 seconds\" → call wait'\n */\n usageHint?: string;\n}\n\nexport const RUNEYA_CAPABILITIES: RuneyaCapability[] = [\n {\n name: 'list_services',\n description: 'List all available services. Returns serviceId and agentId for each — use these exact fields in other calls.',\n route: 'service.list',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'get_service_status',\n description: 'Get the current status (running, stopped, etc.) of a service.',\n route: 'process.get',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'The service ID', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, id: p.serviceId }),\n },\n {\n name: 'get_logs',\n description: 'Get the recent buffered logs for a service.',\n route: 'process.logs',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'The service ID', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId }),\n },\n {\n name: 'start_service',\n description: 'Start a service on an agent.',\n route: 'process.start',\n method: 'POST',\n params: [\n { name: 'serviceId', description: 'The service ID to start', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId }),\n destructive: true,\n },\n {\n name: 'stop_service',\n description: 'Stop a running service on an agent.',\n route: 'process.stop',\n method: 'POST',\n params: [\n { name: 'serviceId', description: 'The service ID to stop', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId }),\n destructive: true,\n },\n {\n name: 'restart_service',\n description: 'Restart a service on an agent (stop → redeploy → start).',\n route: 'process.restart',\n method: 'POST',\n params: [\n { name: 'serviceId', description: 'The service ID to restart', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId }),\n destructive: true,\n },\n\n // ─── Utility ─────────────────────────────────────────────────────────────\n\n {\n name: 'wait',\n description: 'Wait for a given number of milliseconds before continuing.',\n route: 'utility.wait',\n method: 'POST',\n params: [\n { name: 'ms', description: 'Number of MILLISECONDS to wait. Convert from seconds: 1s=1000, 10s=10000, 1min=60000. Max 300000.', required: true },\n ],\n buildInput: (p) => ({ ms: Number(p.ms) }),\n usageHint: '\"wait 5s\" → wait(ms=5000), \"pause 10 seconds\" → wait(ms=10000), \"attends 3 secondes\" → wait(ms=3000). Always convert to milliseconds.',\n },\n\n // ─── Kanban ───────────────────────────────────────────────────────────────\n\n {\n name: 'kanban_list_boards',\n description: 'List the kanban boards of the organization. Returns the organizationId actually queried, the boardId to use in the other kanban tools, plus column and card counts. Cards themselves are not included — use kanban_get_board for those. An empty list means that organization really has no board: a failure to reach the cloud is reported as an error instead, never as an empty list.',\n route: 'kanban.listBoards',\n method: 'GET',\n params: [\n { name: 'includeArchived', description: 'Set to \"true\" to include archived boards. Default: false.', required: false },\n { name: 'organizationId', description: 'Which organization to read. Optional: needed only when the account belongs to several and the error message asks for it.', required: false },\n ],\n buildInput: (p) => ({\n includeArchived: p.includeArchived === 'true',\n ...(p.organizationId ? { organizationId: p.organizationId } : {}),\n }),\n },\n {\n name: 'kanban_get_board',\n description: 'Read one kanban board: its columns, and the cards in each (id, title, markdown body, assignees, comment count, and attachment metadata — use kanban_download_attachment to fetch the bytes of a file). Use the exact column names it returns when moving or adding a card.',\n route: 'kanban.getBoard',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID, from kanban_list_boards', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId }),\n },\n {\n name: 'kanban_get_card_comments',\n description: \"Read the comment thread of one kanban card, newest last: who wrote each comment (ai or user, with the person's name), when, its text, and its attachments. The comments in your task context are a snapshot taken when the task started — call this to see anything written since, whenever someone tells you a comment was added or kanban_get_board reports a higher commentCount than you have.\",\n route: 'kanban.getCardComments',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID whose comments to read', required: true },\n { name: 'limit', description: 'How many of the most recent comments to return (1-200). Default: 50.', required: false },\n ],\n buildInput: (p) => ({\n boardId: p.boardId,\n cardId: p.cardId,\n ...(p.limit ? { limit: Number(p.limit) } : {}),\n }),\n usageHint: '\"le support a ajouté un commentaire\" / \"regarde les nouveaux commentaires\" → kanban_get_card_comments(boardId, cardId). Never answer from the snapshot in your context when fresh comments are mentioned.',\n },\n {\n name: 'kanban_search_cards',\n description: 'Search kanban cards by free text, matched against their title and body (accent- and case-insensitive). Searches every board of the organization unless boardId narrows it down.',\n route: 'kanban.searchCards',\n method: 'GET',\n params: [\n { name: 'query', description: 'Text to look for in card titles and bodies', required: true },\n { name: 'boardId', description: 'Restrict the search to this board. Omit to search all boards.', required: false },\n { name: 'limit', description: 'Maximum number of cards to return (1-100). Default: 25.', required: false },\n { name: 'organizationId', description: 'Which organization to search. Optional: needed only when the account belongs to several and the error message asks for it.', required: false },\n ],\n buildInput: (p) => ({\n query: p.query,\n ...(p.boardId ? { boardId: p.boardId } : {}),\n ...(p.limit ? { limit: Number(p.limit) } : {}),\n ...(p.organizationId ? { organizationId: p.organizationId } : {}),\n }),\n },\n {\n name: 'kanban_download_attachment',\n description: 'Download a kanban card attachment (image, PDF, any file) onto this machine and return its local path, so it can be opened with file-reading tools. Attachment ids come from the card context, from kanban_get_board, or from kanban_get_card_comments — a file attached to a comment downloads exactly like one attached to the card.',\n route: 'kanban.downloadAttachment',\n method: 'POST',\n params: [\n { name: 'attachmentId', description: 'The attachment ID, as listed on the card', required: true },\n ],\n buildInput: (p) => ({ attachmentId: p.attachmentId }),\n },\n {\n name: 'kanban_move_card',\n description: 'Move a kanban card to another column. Use the exact column name.',\n route: 'kanban.moveCard',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID to move', required: true },\n { name: 'targetColumn', description: 'Exact name of the target column', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId, targetColumn: p.targetColumn }),\n },\n {\n name: 'kanban_add_comment',\n description: 'Add a comment to a kanban card.',\n route: 'kanban.addComment',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID', required: true },\n { name: 'comment', description: 'The comment text (markdown supported)', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId, comment: p.comment }),\n },\n {\n name: 'kanban_get_card_links',\n description: 'Read the filiation of a board: which card depends on which. Returns one entry per link (child card ↔ parent card), plus the title, board, column, assignees and comment count of any linked card living on another board. Use it when a card context says it has a parent or sub-cards and you need their ids to read them.',\n route: 'kanban.getCardLinks',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID whose links to read', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId }),\n },\n {\n name: 'kanban_set_card_parent',\n description: 'Link a kanban card to a parent card, or detach it. The parent is the card the other one depends on — an epic and its tasks, a bug and its follow-ups. A card has at most one parent, and setting a new one replaces it. Omit parentCardId to detach. kanban_get_board reports the current filiation as parentCardId / childCardIds on each card.',\n route: 'kanban.setCardParent',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID of the card being linked', required: true },\n { name: 'cardId', description: 'The card that depends on the parent (the child)', required: true },\n { name: 'parentCardId', description: 'The parent card ID. Omit to detach the card from its parent.', required: false },\n { name: 'parentBoardId', description: \"The parent's board, when it lives on another board of the same organization. Defaults to boardId.\", required: false },\n ],\n buildInput: (p) => ({\n boardId: p.boardId,\n cardId: p.cardId,\n ...(p.parentCardId ? { parentCardId: p.parentCardId } : {}),\n ...(p.parentBoardId ? { parentBoardId: p.parentBoardId } : {}),\n }),\n },\n {\n name: 'kanban_add_card',\n description: 'Add a new card to a kanban column.',\n route: 'kanban.addCard',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'column', description: 'Exact name of the target column', required: true },\n { name: 'title', description: 'Card title', required: true },\n { name: 'content', description: 'Card content in markdown', required: false },\n ],\n buildInput: (p) => ({ boardId: p.boardId, column: p.column, title: p.title, content: p.content }),\n },\n];\n","import type { RuneyaCapability } from '../capabilities.js';\n\nexport interface AnthropicTool {\n name: string;\n description: string;\n input_schema: {\n type: 'object';\n properties: Record<string, { type: string; description: string }>;\n required: string[];\n [k: string]: unknown;\n };\n}\n\nexport function buildAnthropicTools(capabilities: RuneyaCapability[]): AnthropicTool[] {\n return capabilities.map(cap => ({\n name: cap.name,\n description: cap.description,\n input_schema: {\n type: 'object' as const,\n properties: Object.fromEntries(\n cap.params.map(p => [p.name, { type: 'string', description: p.description }]),\n ),\n required: cap.params.filter(p => p.required).map(p => p.name),\n },\n }));\n}\n","import type { RuneyaCapability } from '../capabilities.js';\n\nexport interface OpenAITool {\n type: 'function';\n function: {\n name: string;\n description: string;\n parameters: {\n type: 'object';\n properties: Record<string, { type: string; description: string }>;\n required: string[];\n };\n };\n}\n\nexport function buildOpenAITools(capabilities: RuneyaCapability[]): OpenAITool[] {\n return capabilities.map(cap => ({\n type: 'function' as const,\n function: {\n name: cap.name,\n description: cap.description,\n parameters: {\n type: 'object' as const,\n properties: Object.fromEntries(\n cap.params.map(p => [p.name, { type: 'string', description: p.description }]),\n ),\n required: cap.params.filter(p => p.required).map(p => p.name),\n },\n },\n }));\n}\n","import type { RuneyaCapability } from '../capabilities.js';\nexport type { RuneyaCapability };\n\n/**\n * Build the tool safety instruction block injected into cloud provider system prompts.\n * Generated from capabilities so it stays in sync automatically.\n */\nexport function buildToolSafetyInstruction(capabilities: RuneyaCapability[]): string {\n const destructive = capabilities.filter(c => c.destructive).map(c => c.name);\n const withHints = capabilities.filter(c => c.usageHint);\n\n const lines = ['## Tool use safety rules'];\n\n if (destructive.length > 0) {\n lines.push(`CRITICAL: Never call ${destructive.join(', ')} unless the user has EXPLICITLY and UNAMBIGUOUSLY requested it.`);\n lines.push(`- Only call destructive tools (${destructive.join(', ')}) when the user explicitly uses action words for a specific service.`);\n }\n\n if (withHints.length > 0) {\n lines.push('');\n lines.push('## Tool usage hints');\n for (const cap of withHints) {\n lines.push(`- ${cap.usageHint}`);\n }\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Build a markdown documentation block injected into runner system prompts.\n * Runners (ClaudeCodeRunner, CodexRunner) use this to know how to call the Runeya API.\n *\n * The generated doc is the single source of truth for all runner-facing API docs —\n * no need to maintain a separate runeya-api-docs.ts.\n */\nexport function buildPromptDocs(baseUrl: string, token: string, capabilities: RuneyaCapability[]): string {\n if (!token) return '';\n\n const lines: string[] = [\n '## Runeya API',\n '',\n `Tu peux interagir avec Runeya via l'API HTTP tRPC ci-dessous.`,\n `Base URL : ${baseUrl}/api/trpc`,\n 'Auth header : Authorization: Bearer $RUNEYA_API_TOKEN',\n '',\n ];\n\n const gets = capabilities.filter(c => c.method === 'GET');\n const posts = capabilities.filter(c => c.method === 'POST');\n\n if (gets.length > 0) {\n lines.push('### GET routes (paramètres en query string ?input=<JSON encodé>)', '');\n for (const cap of gets) {\n const example = cap.params.length > 0\n ? `?input=${JSON.stringify(Object.fromEntries(cap.params.map(p => [p.name === 'serviceId' ? 'id' : p.name, '...'])))}`\n : '';\n lines.push(`- \\`${cap.route}${example}\\` — ${cap.description}`);\n }\n lines.push('');\n }\n\n if (posts.length > 0) {\n lines.push('### POST routes (body JSON)', '');\n for (const cap of posts) {\n const bodyExample = cap.params.length > 0\n ? JSON.stringify(Object.fromEntries(cap.params.map(p => [p.name === 'serviceId' ? 'processId' : p.name, '...'])))\n : '{}';\n lines.push(`- \\`${cap.route}\\` — \\`${bodyExample}\\``);\n }\n lines.push('');\n }\n\n const hints = capabilities.filter(c => c.usageHint);\n if (hints.length > 0) {\n lines.push('### Usage hints', '');\n for (const cap of hints) {\n lines.push(`- ${cap.usageHint}`);\n }\n lines.push('');\n }\n\n lines.push(\n '### Exemple curl',\n '',\n '```bash',\n `curl -H \"Authorization: Bearer $RUNEYA_API_TOKEN\" \\\\`,\n ` \"${baseUrl}/api/trpc/service.list\"`,\n '',\n `curl -X POST -H \"Authorization: Bearer $RUNEYA_API_TOKEN\" \\\\`,\n ' -H \"Content-Type: application/json\" \\\\',\n ` -d '{\"agentId\":\"local\",\"processId\":\"my-service\"}' \\\\`,\n ` \"${baseUrl}/api/trpc/process.start\"`,\n '```',\n '',\n 'La réponse est de la forme `{\"result\":{\"data\":<résultat>}}`.',\n );\n\n return lines.join('\\n');\n}\n","/**\n * Shared tRPC HTTP caller used by:\n * - Server-side cloud tool executor (proxies cloud LLM tool calls to local tRPC)\n * - MCP server (calls tRPC on behalf of CLI runners)\n */\nexport async function callTrpc(\n baseUrl: string,\n route: string,\n method: 'GET' | 'POST',\n input: Record<string, unknown> | undefined,\n authToken: string,\n): Promise<unknown> {\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${authToken}`,\n };\n\n const url = method === 'GET' && input\n ? `${baseUrl}/api/trpc/${route}?input=${encodeURIComponent(JSON.stringify(input))}`\n : `${baseUrl}/api/trpc/${route}`;\n\n const res = await fetch(url, {\n method,\n headers,\n ...(method === 'POST' ? { body: JSON.stringify(input ?? {}) } : {}),\n signal: AbortSignal.timeout(15_000),\n });\n\n const json = await res.json() as Record<string, unknown>;\n if (json['error']) throw new Error(JSON.stringify(json['error']));\n const result = json['result'] as Record<string, unknown> | undefined;\n return result?.['data'] ?? result ?? json;\n}\n"],"mappings":";;;AACA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,SAAS;;;ACgCX,IAAM,sBAA0C;EACrD;IACE,MAAM;IACN,aAAa;IACb,OAAO;IACP,QAAQ;IACR,QAAQ,CAAC;IACT,YAAY,MAAM;EACpB;EACA;IACE,MAAM;IACN,aAAa;IACb,OAAO;IACP,QAAQ;IACR,QAAQ;MACN,EAAE,MAAM,aAAa,aAAa,kBAAkB,UAAU,KAAK;MACnE,EAAE,MAAM,WAAW,aAAa,qCAAqC,UAAU,KAAK;IACtF;IACA,YAAY,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,IAAI,EAAE,UAAU;EAC5D;EACA;IACE,MAAM;IACN,aAAa;IACb,OAAO;IACP,QAAQ;IACR,QAAQ;MACN,EAAE,MAAM,aAAa,aAAa,kBAAkB,UAAU,KAAK;MACnE,EAAE,MAAM,WAAW,aAAa,qCAAqC,UAAU,KAAK;IACtF;IACA,YAAY,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,WAAW,EAAE,UAAU;EACnE;EACA;IACE,MAAM;IACN,aAAa;IACb,OAAO;IACP,QAAQ;IACR,QAAQ;MACN,EAAE,MAAM,aAAa,aAAa,2BAA2B,UAAU,KAAK;MAC5E,EAAE,MAAM,WAAW,aAAa,qCA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A,UAClE,QAAQ,YAAY,QAAQ,GAAO;AAAA;AAAA,QACrC,CAAC;AACD,cAAM,OAAO,MAAM,IAAI,KAAK;AAC5B,cAAM,SAAU,KAAK,QAAQ,IAA4C,MAAM,KAAK;AACpF,cAAM,OAAO,OAAO,WAAW,WAAW,SAAS,KAAK,UAAU,MAAM;AACxE,eAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAiB,KAAK,CAAC,EAAE;AAAA,MACtD,SAAS,KAAK;AACZ,eAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,UAAW,IAAc,OAAO,GAAG,CAAC,GAAG,SAAS,KAAK;AAAA,MACzG;AAAA,IACF;AAAA,EACF;AACF;AAIA,IAAM,YAAY,IAAI,qBAAqB;AAC3C,MAAM,OAAO,QAAQ,SAAS;","names":[]}
@@ -0,0 +1,78 @@
1
+ // ../../packages/shared/src/node/node-path.ts
2
+ import { dirname, delimiter } from "path";
3
+ function ensureNodeBinOnPath(environment = process.env) {
4
+ appendToPath(dirname(process.execPath), environment);
5
+ }
6
+ function appendToPath(dir, environment = process.env) {
7
+ if (!dir) return;
8
+ const current = environment["PATH"] ?? "";
9
+ const entries = current.split(delimiter).filter(Boolean);
10
+ if (entries.includes(dir)) return;
11
+ environment["PATH"] = entries.length > 0 ? `${current}${delimiter}${dir}` : dir;
12
+ }
13
+
14
+ // ../../packages/shared/src/node/user-path.ts
15
+ import { execFile } from "child_process";
16
+ import { promisify } from "util";
17
+ import { homedir } from "os";
18
+ import { existsSync, statSync } from "fs";
19
+ import { join, delimiter as delimiter2 } from "path";
20
+ var execFileAsync = promisify(execFile);
21
+ var MARKER = "__RUNEYA_PATH__";
22
+ var SHELL_TIMEOUT_MS = 3e3;
23
+ function commonUserBins(home) {
24
+ return [
25
+ join(home, ".local", "bin"),
26
+ join(home, "bin"),
27
+ join(home, ".npm-global", "bin"),
28
+ join(home, ".bun", "bin"),
29
+ join(home, ".cargo", "bin"),
30
+ "/opt/homebrew/bin",
31
+ "/usr/local/bin"
32
+ ];
33
+ }
34
+ async function readLoginShellPath() {
35
+ if (process.platform === "win32") return null;
36
+ const shell = process.env["SHELL"];
37
+ if (!shell || !existsSync(shell)) return null;
38
+ try {
39
+ const { stdout } = await execFileAsync(shell, ["-l", "-i", "-c", `echo "${MARKER}$PATH"`], {
40
+ timeout: SHELL_TIMEOUT_MS,
41
+ shell: false,
42
+ encoding: "utf8",
43
+ maxBuffer: 1024 * 1024,
44
+ env: { ...process.env, TERM: "dumb" }
45
+ });
46
+ const line = stdout.split("\n").find((l) => l.includes(MARKER));
47
+ if (!line) return null;
48
+ const value = line.slice(line.indexOf(MARKER) + MARKER.length).trim();
49
+ return value.length > 0 ? value : null;
50
+ } catch {
51
+ return null;
52
+ }
53
+ }
54
+ async function ensureUserBinsOnPath(environment = process.env, home = homedir()) {
55
+ const shellPath = await readLoginShellPath();
56
+ if (shellPath) {
57
+ for (const entry of shellPath.split(delimiter2).filter(Boolean)) {
58
+ appendToPath(entry, environment);
59
+ }
60
+ }
61
+ for (const dir of commonUserBins(home)) {
62
+ if (isDirectory(dir)) appendToPath(dir, environment);
63
+ }
64
+ }
65
+ function isDirectory(path) {
66
+ try {
67
+ return statSync(path).isDirectory();
68
+ } catch {
69
+ return false;
70
+ }
71
+ }
72
+ export {
73
+ appendToPath,
74
+ ensureNodeBinOnPath,
75
+ ensureUserBinsOnPath,
76
+ readLoginShellPath
77
+ };
78
+ //# sourceMappingURL=node-QABM22GF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../packages/shared/src/node/node-path.ts","../../../packages/shared/src/node/user-path.ts"],"sourcesContent":["import { dirname, delimiter } from 'node:path';\n\n/**\n * Garantit que le répertoire du binaire Node est dans le `PATH` des services.\n *\n * Un raccourci de bureau n'hérite pas du `PATH` d'un shell de connexion : il\n * reçoit celui de la session graphique, où les gestionnaires de version (n, nvm,\n * fnm, volta, brew) ne figurent pas. Node, lui, est lancé par chemin absolu et\n * démarre très bien — mais `npm`, `npx`, `yarn` et `corepack`, qui vivent à côté\n * de lui, deviennent introuvables. Un service échoue alors sur un message qui ne\n * dit rien de sa cause : « cannot find package manager binary ».\n *\n * Le répertoire est ajouté en QUEUE : ce que la machine a déjà choisi de mettre\n * devant garde la main, et un `PATH` déjà complet ne change pas.\n */\nexport function ensureNodeBinOnPath(environment: NodeJS.ProcessEnv = process.env): void {\n appendToPath(dirname(process.execPath), environment);\n}\n\n/**\n * Ajoute un répertoire en queue du `PATH`, sans doublon ni séparateur vide.\n */\nexport function appendToPath(dir: string, environment: NodeJS.ProcessEnv = process.env): void {\n if (!dir) return;\n const current = environment['PATH'] ?? '';\n const entries = current.split(delimiter).filter(Boolean);\n if (entries.includes(dir)) return;\n environment['PATH'] = entries.length > 0 ? `${current}${delimiter}${dir}` : dir;\n}\n","import { execFile } from 'node:child_process';\nimport { promisify } from 'node:util';\nimport { homedir } from 'node:os';\nimport { existsSync, statSync } from 'node:fs';\nimport { join, delimiter } from 'node:path';\nimport { appendToPath } from './node-path.js';\n\nconst execFileAsync = promisify(execFile);\n\n/**\n * Marqueur : un `.zshrc` interactif écrit volontiers sur stdout (bannières,\n * gestionnaires de version, `motd`). Sans balise, on ne sait pas quelle ligne\n * est le `PATH`.\n */\nconst MARKER = '__RUNEYA_PATH__';\n\n/** Le profil de l'utilisateur peut être long à charger — mais pas éternel. */\nconst SHELL_TIMEOUT_MS = 3000;\n\n/**\n * Emplacements où un CLI utilisateur s'installe sans passer par le système.\n * Filet de sécurité quand le shell de connexion n'a rien donné : on ne devine\n * pas les gestionnaires de version (chemins versionnés), seulement le banal.\n */\nfunction commonUserBins(home: string): string[] {\n return [\n join(home, '.local', 'bin'),\n join(home, 'bin'),\n join(home, '.npm-global', 'bin'),\n join(home, '.bun', 'bin'),\n join(home, '.cargo', 'bin'),\n '/opt/homebrew/bin',\n '/usr/local/bin',\n ];\n}\n\n/**\n * Demande son `PATH` au shell de connexion de l'utilisateur.\n *\n * Un raccourci de bureau reçoit le `PATH` de la session graphique, pas celui du\n * shell : `~/.local/bin`, nvm, fnm, volta, mise, asdf… n'y figurent pas. Le CLI\n * installé par l'utilisateur devient alors introuvable, et l'agent le déclare\n * simplement « non disponible ».\n *\n * Renvoie `null` en cas d'échec (Windows, pas de `SHELL`, timeout, profil qui\n * plante) : l'absence de réponse ne doit jamais empêcher l'agent de démarrer.\n */\nexport async function readLoginShellPath(): Promise<string | null> {\n if (process.platform === 'win32') return null;\n\n const shell = process.env['SHELL'];\n if (!shell || !existsSync(shell)) return null;\n\n try {\n // `-l -i` : le `PATH` d'un utilisateur vit aussi bien dans le profil de\n // connexion que dans le fichier interactif (`.zshrc`, `.bashrc`).\n // `shell: false` : le shell EST le programme lancé, pas l'interpréteur.\n const { stdout } = await execFileAsync(shell, ['-l', '-i', '-c', `echo \"${MARKER}$PATH\"`], {\n timeout: SHELL_TIMEOUT_MS,\n shell: false,\n encoding: 'utf8',\n maxBuffer: 1024 * 1024,\n env: { ...process.env, TERM: 'dumb' },\n });\n\n const line = stdout.split('\\n').find(l => l.includes(MARKER));\n if (!line) return null;\n\n const value = line.slice(line.indexOf(MARKER) + MARKER.length).trim();\n return value.length > 0 ? value : null;\n } catch {\n return null;\n }\n}\n\n/**\n * Complète le `PATH` de l'agent avec ce que le shell de connexion connaît, puis\n * avec les emplacements utilisateur usuels qui existent réellement sur disque.\n *\n * Tout est ajouté EN QUEUE, comme pour Node : ce que la machine a déjà mis\n * devant garde la main, et un `PATH` déjà complet ne change pas.\n */\nexport async function ensureUserBinsOnPath(\n environment: NodeJS.ProcessEnv = process.env,\n home: string = homedir(),\n): Promise<void> {\n const shellPath = await readLoginShellPath();\n if (shellPath) {\n for (const entry of shellPath.split(delimiter).filter(Boolean)) {\n appendToPath(entry, environment);\n }\n }\n\n for (const dir of commonUserBins(home)) {\n if (isDirectory(dir)) appendToPath(dir, environment);\n }\n}\n\nfunction isDirectory(path: string): boolean {\n try {\n return statSync(path).isDirectory();\n } catch {\n return false;\n }\n}\n"],"mappings":";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G,QAAQ,KAAK,MAAM,OAAO;AAAA,IACtC,CAAC;AAED,UAAM,OAAO,OAAO,MAAM,IAAI,EAAE,KAAK,OAAK,EAAE,SAAS,MAAM,CAAC;AAC5D,QAAI,CAAC,KAAM,QAAO;AAElB,UAAM,QAAQ,KAAK,MAAM,KAAK,QAAQ,MAAM,IAAI,OAAO,MAAM,EAAE,KAAK;AACpE,WAAO,MAAM,SAAS,IAAI,QAAQ;AAAA,EACpC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AASA,eAAsB,qBACpB,cAAiC,QAAQ,KACzC,OAAe,QAAQ,GACR;AACf,QAAM,YAAY,MAAM,mBAAmB;AAC3C,MAAI,WAAW;AACb,eAAW,SAAS,UAAU,MAAMC,UAAS,EAAE,OAAO,OAAO,GAAG;AAC9D,mBAAa,OAAO,WAAW;AAAA,IACjC;AAAA,EACF;AAEA,aAAW,OAAO,eAAe,IAAI,GAAG;AACtC,QAAI,YAAY,GAAG,EAAG,cAAa,KAAK,WAAW;AAAA,EACrD;AACF;AAEA,SAAS,YAAY,MAAuB;AAC1C,MAAI;AACF,WAAO,SAAS,IAAI,EAAE,YAAY;AAAA,EACpC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;","names":["delimiter","delimiter"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runeya/runeya",
3
- "version": "2.0.66",
3
+ "version": "2.0.67",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "runeya": "./index.js"