@runeya/runeya 2.0.95 → 2.0.97
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.
- package/agent/index.js +24 -12
- package/agent/index.js.map +1 -1
- package/agent-manager-SNVPZNLC.js +8 -0
- package/{chat-LPMGV2VS.js → chat-NSWAMXLO.js} +6 -6
- package/{chunk-R23UUB5R.js → chunk-57NU22TS.js} +905 -682
- package/chunk-57NU22TS.js.map +1 -0
- package/{chunk-WAC56HS4.js → chunk-ANGVT3MX.js} +79 -32
- package/chunk-ANGVT3MX.js.map +1 -0
- package/{chunk-HX3ZIWHM.js → chunk-BHLCBARP.js} +2 -2
- package/{chunk-72LQC3YC.js → chunk-F3HKV5AU.js} +2 -2
- package/{chunk-3MJLS5UY.js → chunk-NDO5VFZY.js} +5 -5
- package/chunk-NDO5VFZY.js.map +1 -0
- package/{companion-VPYVGTRU.js → companion-EWR2QZAB.js} +12 -4
- package/index.js +1 -1
- package/mcp-server/index.js +289 -5
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/launch.d.ts +20 -1
- package/mcp-server/launch.js +10 -5
- package/mcp-server/launch.js.map +1 -1
- package/package.json +1 -1
- package/settings-manager-YHQ5YHUH.js +8 -0
- package/{src-NEPDGULO.js → src-3IDP42KO.js} +23 -12
- package/src-3IDP42KO.js.map +1 -0
- package/web/assets/{AgentScalarChatInterface.vue-DCnwgzWk.js → AgentScalarChatInterface.vue-Cg4DrH5-.js} +1 -1
- package/web/assets/{AgentTerminalPage-D6iEzvyz.js → AgentTerminalPage-ClgOOzjC.js} +1 -1
- package/web/assets/AiChatPage-CrqIi3zp.js +1 -0
- package/web/assets/{AppLayout-B2mreJVA.js → AppLayout-tfKCrE0A.js} +1 -1
- package/web/assets/{AuditPage-CSPHdf0m.js → AuditPage-BwjVcB_e.js} +1 -1
- package/web/assets/CloudAccountPage-DJMj6rlx.js +1 -0
- package/web/assets/{CloudAccountPage-C35O8Pcb.js → CloudAccountPage-YqD1oWcl.js} +1 -1
- package/web/assets/{CloudMessagingPage-5KYELXQI.js → CloudMessagingPage-CGAN3l_2.js} +1 -1
- package/web/assets/{DashboardPage-Dl9Sg1av.js → DashboardPage-uzdaeNvE.js} +1 -1
- package/web/assets/{DirectoryPickerDialog-DLL3-GoW.js → DirectoryPickerDialog-_nki96n0.js} +1 -1
- package/web/assets/{EditorIcon-CzgSjXLk.js → EditorIcon-CN5NnRuP.js} +1 -1
- package/web/assets/{EnvironmentForm-DmdDIJHv.js → EnvironmentForm-C3XYN-u_.js} +1 -1
- package/web/assets/{EnvironmentFormPage-CV7Uq6Ah.js → EnvironmentFormPage-DzpLGPiH.js} +1 -1
- package/web/assets/{EnvironmentListPage-Cfo9RA_g.js → EnvironmentListPage-C2EfOvUQ.js} +1 -1
- package/web/assets/KanbanBoardPage-BTvn4Oks.css +1 -0
- package/web/assets/KanbanBoardPage-D62-0_x0.js +4 -0
- package/web/assets/{KanbanListPage-CSAnUfp3.js → KanbanListPage-mgJfhVzZ.js} +1 -1
- package/web/assets/{LaunchProjectPage-vNUoulGP.js → LaunchProjectPage-CRL5enYT.js} +1 -1
- package/web/assets/{LaunchServicesPage-CkWZxZ-v.js → LaunchServicesPage-BaIi1u2l.js} +1 -1
- package/web/assets/{LogViewer-CW-bBjZF.js → LogViewer-CQmf3bkB.js} +1 -1
- package/web/assets/{OrgKeyPrompt-CHoMbQhn.js → OrgKeyPrompt-x919NFZU.js} +1 -1
- package/web/assets/{ProcessControls-WS6BjS5H.js → ProcessControls-Bxuzo9xu.js} +1 -1
- package/web/assets/{ProcessDetailPage-DEvZSNER.js → ProcessDetailPage-CM4gv6qW.js} +1 -1
- package/web/assets/{ProcessMetrics-DmhwoKrE.js → ProcessMetrics-B8ReKltW.js} +1 -1
- package/web/assets/{ProjectDetailPage-DanRrWb4.js → ProjectDetailPage-DiaanTyL.js} +1 -1
- package/web/assets/{ProjectListPage--l9HsQ9u.js → ProjectListPage-eq12Vdsi.js} +1 -1
- package/web/assets/{RandomJobTestPage-BMatxc2G.js → RandomJobTestPage-CJbdpqF0.js} +1 -1
- package/web/assets/{ScenarioEditorPage-D_rJyudb.js → ScenarioEditorPage-D8xmK-aZ.js} +1 -1
- package/web/assets/{SendToChatDialog-D-pDvIjD.js → SendToChatDialog-B0m5-H1l.js} +1 -1
- package/web/assets/{ServiceControlsBar-BSU25sZZ.js → ServiceControlsBar-BdT0XYtF.js} +1 -1
- package/web/assets/{ServiceDetailPage-B1oRlnId.js → ServiceDetailPage-DGojuDKp.js} +1 -1
- package/web/assets/{ServiceFormPage-D-DmI0fF.js → ServiceFormPage-6aPMUBjp.js} +1 -1
- package/web/assets/SettingsPage-DisZogYn.js +2063 -0
- package/web/assets/{SettingsPage-D6-jpORY.css → SettingsPage-GKnTN75s.css} +1 -1
- package/web/assets/{UnlockPage-BtunlGnX.js → UnlockPage-QEUvn5MU.js} +1 -1
- package/web/assets/{VariablesTable-D3HpHlKY.js → VariablesTable-B9UiC69p.js} +1 -1
- package/web/assets/{VaultMigrationPage-DrrFR1I-.js → VaultMigrationPage-BKammxdb.js} +1 -1
- package/web/assets/{VersionBadge-DqcS34oJ.js → VersionBadge-B5SmMtZS.js} +1 -1
- package/web/assets/WikiPage-ChtHYLsn.js +1 -0
- package/web/assets/{WikiView-BasNZv2A.js → WikiView-Brud4K4u.js} +1 -1
- package/web/assets/{add-scalar-classes-_PYrgVvq.js → add-scalar-classes-CF1ZlVmT.js} +3 -3
- package/web/assets/auth-errors-1gmtFIpl.js +1 -0
- package/web/assets/{autocomplete-B-t_B26t.js → autocomplete-eQhMihkm.js} +1 -1
- package/web/assets/{basic-shape-diamond.svg-BFWFQIZl.js → basic-shape-diamond.svg-B79z96pk.js} +1 -1
- package/web/assets/{basic-shape-hexagon.svg-CXsvZPky.js → basic-shape-hexagon.svg-DAlWXIQS.js} +1 -1
- package/web/assets/{basic-shape-primary-circle-ellipse-round.svg-BVg6oDS7.js → basic-shape-primary-circle-ellipse-round.svg-C5OZu4mS.js} +1 -1
- package/web/assets/{basic-shape-primary-square-rectangle.svg-jiLWQSQV.js → basic-shape-primary-square-rectangle.svg-BykiIk1Y.js} +1 -1
- package/web/assets/{basic-shape-shield.svg-CEybfnew.js → basic-shape-shield.svg-BVcBjIsG.js} +1 -1
- package/web/assets/{browser-BfO6Jws3.js → browser-2YDfpiMy.js} +1 -1
- package/web/assets/{browser-C7Qh0u0N.js → browser-BeUKu6QW.js} +1 -1
- package/web/assets/{card-CWgnvlKH.js → card-BAlWlIgX.js} +1 -1
- package/web/assets/{checkbox-CKzrAJQv.js → checkbox-CmaD3L1T.js} +1 -1
- package/web/assets/{chip-Bu5HllmO.js → chip-CRmYXa8f.js} +1 -1
- package/web/assets/{client-CM-a2QU7.js → client-Bv9-b6hD.js} +1 -1
- package/web/assets/{cloud-chat.store-Cjbzzy1s.js → cloud-chat.store-D9e_ZoEW.js} +1 -1
- package/web/assets/{cloud-session-Bs6siQ-Y.js → cloud-session-CfIHVKlU.js} +1 -1
- package/web/assets/{column-pXrOxKc1.js → column-C9854MaP.js} +1 -1
- package/web/assets/{computer-device-desktop-monitor.svg-DO-9EDqA.js → computer-device-desktop-monitor.svg-DgYmz8if.js} +1 -1
- package/web/assets/{computer-device-desktop.svg-U_EIk7jo.js → computer-device-desktop.svg-CN3hxMSt.js} +1 -1
- package/web/assets/{computer-device-laptop.svg-nvbz6sjk.js → computer-device-laptop.svg-LDsA7kc5.js} +1 -1
- package/web/assets/{computer-device-mobile-phone-android-samsung-back.svg-Cs34LunN.js → computer-device-mobile-phone-android-samsung-back.svg-BDfCASg6.js} +1 -1
- package/web/assets/{computer-device-mobile-phone-android-samsung.svg-CDJgG-4L.js → computer-device-mobile-phone-android-samsung.svg-BMMyDOdR.js} +1 -1
- package/web/assets/{computer-device-mobile-phone-iphone-x-back.svg-Du0pDh9L.js → computer-device-mobile-phone-iphone-x-back.svg-BMcE4PZg.js} +1 -1
- package/web/assets/{computer-device-mobile-phone-iphone-x.svg-CUgXFf2r.js → computer-device-mobile-phone-iphone-x.svg-DCaO9pra.js} +1 -1
- package/web/assets/{computer-device-mobile-tablet-touch.svg-CKdx-iUf.js → computer-device-mobile-tablet-touch.svg-CL-ZgWuC.js} +1 -1
- package/web/assets/{computer-device-mobile-tablet.svg-BTvPzs5h.js → computer-device-mobile-tablet.svg-DDOk54bt.js} +1 -1
- package/web/assets/{computer-device-network-ethernet-cat6.svg-Cway8Bfw.js → computer-device-network-ethernet-cat6.svg-BlCpBZ1-.js} +1 -1
- package/web/assets/{computer-device-network-lan-www.svg-iuTZVSKE.js → computer-device-network-lan-www.svg-BnDixCMz.js} +1 -1
- package/web/assets/{computer-device-network-wifi-connection.svg-DEemVGZq.js → computer-device-network-wifi-connection.svg-CVBp6RTa.js} +1 -1
- package/web/assets/{computer-device-network-wifi-router.svg-BH2ASeRD.js → computer-device-network-wifi-router.svg-DC_hG81D.js} +1 -1
- package/web/assets/{cssMode-BHBdzmoS.js → cssMode-CvjBWwcj.js} +1 -1
- package/web/assets/{divider-kwmULX2U.js → divider-DtkApHDJ.js} +1 -1
- package/web/assets/{docx-preview-CxXKUxi7.js → docx-preview-D-0_AO3N.js} +1 -1
- package/web/assets/{ecology-science-erlenmeyer-flask.svg-9yLzulSu.js → ecology-science-erlenmeyer-flask.svg-Dou8Xul9.js} +1 -1
- package/web/assets/{fieldset-DE0sJS29.js → fieldset-CaTLOGqs.js} +1 -1
- package/web/assets/{freemarker2-CpcoAmNk.js → freemarker2-DS7rB38N.js} +1 -1
- package/web/assets/{handlebars-D6DR-MoZ.js → handlebars-D_6N9S4t.js} +1 -1
- package/web/assets/{html-Dx3QwrZR.js → html-aq8_YJ2V.js} +1 -1
- package/web/assets/{htmlMode-KSJ_gFzK.js → htmlMode-CVlBX1og.js} +1 -1
- package/web/assets/{image-flash-lightning.svg-O9m-H64P.js → image-flash-lightning.svg-DIcyUXwz.js} +1 -1
- package/web/assets/{image-picture-flower.svg--rWVVuqu.js → image-picture-flower.svg-CZjlyM5Y.js} +1 -1
- package/web/assets/{index-B4UWj2Kz.css → index-BBYieFBt.css} +1 -1
- package/web/assets/{index-pLefgbhx.js → index-BPOeXMH7.js} +287 -287
- package/web/assets/{interface-alert-exclamation-diamond.svg-CVeV0ecY.js → interface-alert-exclamation-diamond.svg-yMZPAslx.js} +1 -1
- package/web/assets/{interface-alert-exclamation-triangle-warning.svg-MIboYRzH.js → interface-alert-exclamation-triangle-warning.svg-B-t1Ml9l.js} +1 -1
- package/web/assets/{interface-alert-information-circle.svg-BlkHMxfH.js → interface-alert-information-circle.svg-B8HdecEH.js} +1 -1
- package/web/assets/{interface-award-crown.svg-C_Z3sLuP.js → interface-award-crown.svg-DDbSGaEo.js} +1 -1
- package/web/assets/{interface-bookmark.svg-CVpTNe3u.js → interface-bookmark-tag.svg-C5dS6Wy_.js} +1 -1
- package/web/assets/{interface-bookmark-tag.svg-ClOZOhfV.js → interface-bookmark.svg-BZwwsorn.js} +1 -1
- package/web/assets/{interface-calendar-date-one.svg-BvG92AQi.js → interface-calendar-date-one.svg-B_lSSDJQ.js} +1 -1
- package/web/assets/{interface-content-book-open-pages.svg-aXXXkj7d.js → interface-content-book-open-pages.svg-CPjHk5dC.js} +1 -1
- package/web/assets/{interface-content-book-page.svg-BE0nQJw_.js → interface-content-book-page.svg-DLBNBM0O.js} +1 -1
- package/web/assets/{interface-content-file.svg-DYonyE7J.js → interface-content-file.svg-dZo-oryw.js} +1 -1
- package/web/assets/interface-content-folder.svg-CeaK9A2u.js +1 -0
- package/web/assets/{interface-content-folder.svg-DKc7vKrm.js → interface-content-folder.svg-D3PMAR0L.js} +1 -1
- package/web/assets/{interface-copy-clipboard.svg-sAixmHqz.js → interface-copy-clipboard.svg-hGQ6TIiI.js} +1 -1
- package/web/assets/{interface-edit-attachment.svg-DsSzCN6U.js → interface-edit-attachment.svg-r3GzouWU.js} +1 -1
- package/web/assets/{interface-edit-binocular.svg-Bheco9Gv.js → interface-edit-binocular.svg-Cfv2KJGW.js} +1 -1
- package/web/assets/{interface-edit-magic-wand.svg-C73TY2iI.js → interface-edit-magic-wand.svg-DgdmCAUF.js} +1 -1
- package/web/assets/{interface-edit-tool-paint-roller.svg-D2OSqY3g.js → interface-edit-tool-paint-roller.svg-D9b8KTHm.js} +1 -1
- package/web/assets/{interface-edit-tool-pencil.svg-CdY316cw.js → interface-edit-tool-pencil.svg-6EZF-4AD.js} +1 -1
- package/web/assets/{interface-favorite-award.svg-DfA-EhHI.js → interface-favorite-award.svg-CX7vjSmO.js} +1 -1
- package/web/assets/{interface-favorite-flag.svg-BnmSaveE.js → interface-favorite-flag.svg-Bf-5zzqB.js} +1 -1
- package/web/assets/{interface-favorite-heart.svg-28i7lMzG.js → interface-favorite-heart.svg-CuDUk_-U.js} +1 -1
- package/web/assets/{interface-favorite-star.svg-u8xOEB4S.js → interface-favorite-star.svg-jiT9sBTw.js} +1 -1
- package/web/assets/{interface-favorite-stars-sparkles.svg-D5UHf8ar.js → interface-favorite-stars-sparkles.svg-B14YHOWj.js} +1 -1
- package/web/assets/{interface-hierarchy-flowchart.svg-BmjWTh4K.js → interface-hierarchy-flowchart.svg-DxZmAHe8.js} +1 -1
- package/web/assets/{interface-home-house.svg-DJ5Ae65N.js → interface-home-house.svg-CPRm99Q5.js} +1 -1
- package/web/assets/{interface-hyperlink.svg-HdHKY_g6.js → interface-hyperlink.svg-CYpU8zdB.js} +1 -1
- package/web/assets/{interface-lighting-brightness.svg-BDELfqMb.js → interface-lighting-brightness.svg-Bm2pypGs.js} +1 -1
- package/web/assets/{interface-lock-closed.svg-BcDwDHkS.js → interface-lock-closed.svg-BJbzqDi9.js} +1 -1
- package/web/assets/{interface-lock-open-unlock.svg-DNESCRC1.js → interface-lock-open-unlock.svg-Be2miC-V.js} +1 -1
- package/web/assets/{interface-login-key.svg-BOEot3yk.js → interface-login-key.svg-BvPEKsKK.js} +1 -1
- package/web/assets/{interface-search.svg-CFsy7ant.js → interface-search.svg-CxqA1oOe.js} +1 -1
- package/web/assets/{interface-setting-cog.svg-B7Zk0iyr.js → interface-setting-cog.svg-RjIklwFA.js} +1 -1
- package/web/assets/{interface-share-megaphone-bullhorn.svg-DvG0IjMM.js → interface-share-megaphone-bullhorn.svg-CqesMCvG.js} +1 -1
- package/web/assets/{interface-share-rocket.svg-gvaeTB8G.js → interface-share-rocket.svg-Du5P2iVk.js} +1 -1
- package/web/assets/{interface-share-satellite.svg-B5pXJ0kU.js → interface-share-satellite.svg-BMzUK6ux.js} +1 -1
- package/web/assets/{interface-share-space-ship.svg-B0k0J-VQ.js → interface-share-space-ship.svg-BWpbb-zz.js} +1 -1
- package/web/assets/{interface-share.svg-ZDsCvjRe.js → interface-share.svg-C044g6pa.js} +1 -1
- package/web/assets/{interface-signal-square.svg-DBkJ1ire.js → interface-signal-square.svg-DypNLn80.js} +1 -1
- package/web/assets/{interface-time-clock-circle.svg-BheUirew.js → interface-time-clock-circle.svg-CRNvdPs5.js} +1 -1
- package/web/assets/{interface-time-hour-glass.svg-iORrebF8.js → interface-time-hour-glass.svg-BYTiCdVN.js} +1 -1
- package/web/assets/{interface-users-multiple.svg-DMqedSUQ.js → interface-users-multiple.svg-B0BO30tc.js} +1 -1
- package/web/assets/{interface-weather-moon.svg-DyPBHRw4.js → interface-weather-moon.svg-C9dWP7q-.js} +1 -1
- package/web/assets/{javascript-B1Y6a5s6.js → javascript-DCs9TLWg.js} +1 -1
- package/web/assets/{jsonMode-Vj2pUgcF.js → jsonMode-BE2uSFxY.js} +1 -1
- package/web/assets/{liquid-lb0ImGEW.js → liquid-BZjYukYL.js} +1 -1
- package/web/assets/{lspLanguageFeatures-sh8ggL5N.js → lspLanguageFeatures-4LyxjQPX.js} +1 -1
- package/web/assets/{mail-chat-bubble-square.svg-D_Lx6uBc.js → mail-chat-bubble-square.svg-CTGFukhv.js} +1 -1
- package/web/assets/{mail-send-email-paper-airplane.svg-B6FGKBZu.js → mail-send-email-paper-airplane.svg-DD-FZNCw.js} +1 -1
- package/web/assets/{mail-send-envelope.svg-Dtm4h_xw.js → mail-send-envelope.svg-AuHOjRAo.js} +1 -1
- package/web/assets/{mdx-BbFPcqiD.js → mdx-9unslLAn.js} +1 -1
- package/web/assets/{minus-Bxw18Xk6.js → minus-CHP_QK2B.js} +1 -1
- package/web/assets/modal-BTKNoQeE.js +1 -0
- package/web/assets/{modal-DLY8nKW-.js → modal-OQde8W0w.js} +1 -1
- package/web/assets/{money-cashier-receipt.svg-VpEb8Ewv.js → money-cashier-receipt.svg-B3aJCJ9h.js} +1 -1
- package/web/assets/{money-currency-dollar-pay.svg-vo8FP9z4.js → money-currency-dollar-pay.svg-xdKFuxOB.js} +1 -1
- package/web/assets/{money-graph-arrow-increase.svg-CNcLQGOf.js → money-graph-arrow-increase.svg-wWmaxtEW.js} +1 -1
- package/web/assets/{money-graph-bar-chart-increase.svg-BHAccBVA.js → money-graph-bar-chart-increase.svg-BEhoD6l7.js} +1 -1
- package/web/assets/{multiselect-Crs0miOE.js → multiselect-DtWF2AZf.js} +1 -1
- package/web/assets/{nature-ecology-leaf.svg-0y4pBUlD.js → nature-ecology-leaf.svg-DjdQrhs6.js} +1 -1
- package/web/assets/{password-TyT4zuky.js → password-CrFWhx7M.js} +1 -1
- package/web/assets/{phone-telephone.svg-BdWhV2vz.js → phone-telephone.svg-CLNYyQne.js} +1 -1
- package/web/assets/{plus-4Z2iFfO2.js → plus-DW-wbR7B.js} +1 -1
- package/web/assets/process.store-DrmMxxoc.js +1 -0
- package/web/assets/{programming-bug.svg-DXDJVNeQ.js → programming-bug.svg-MarViUOk.js} +1 -1
- package/web/assets/{programming-cloud.svg-qWtq6fXG.js → programming-cloud.svg-W3xHdUnB.js} +1 -1
- package/web/assets/{programming-computer-database-server.svg-DnlJHfH5.js → programming-computer-database-server.svg-CKehXNTl.js} +1 -1
- package/web/assets/{programming-computer-database.svg-Bl73TDXc.js → programming-computer-database.svg-gCA_mBCi.js} +1 -1
- package/web/assets/{programming-module-four-layout.svg-CGkj0OdH.js → programming-module-four-layout.svg-BqwwSEVQ.js} +1 -1
- package/web/assets/{programming-module-three.svg-Bsk_vaHc.js → programming-module-three.svg-DqwYgzpA.js} +1 -1
- package/web/assets/{programming-module.svg-D0Yng9wS.js → programming-module.svg-BV--KFzc.js} +1 -1
- package/web/assets/{programming-script-code.svg-DTHMCNnF.js → programming-script-code.svg-CBCpPkxq.js} +1 -1
- package/web/assets/{python-HImlMuYG.js → python-CCsqTZHL.js} +1 -1
- package/web/assets/{razor-CTFKddzv.js → razor-BRMeTt-k.js} +1 -1
- package/web/assets/router-CV1Vunn0.js +1 -0
- package/web/assets/settings-scope-BTe7KdSG.js +1 -0
- package/web/assets/{settings.store-CZ9jrl3S.js → settings.store-erZiUPuR.js} +1 -1
- package/web/assets/{shopping-cart.svg-Cx50mrFm.js → shopping-cart.svg-jc4kXbD3.js} +1 -1
- package/web/assets/{shopping-gift-present.svg-DGOO6qNg.js → shopping-gift-present.svg-Bqvvhp3D.js} +1 -1
- package/web/assets/{shopping-shipping-box-parcel-package.svg-C96i4g3q.js → shopping-shipping-box-parcel-package.svg-D2SgWwJp.js} +1 -1
- package/web/assets/{src-DRjytMUo.js → src-CeApk0FF.js} +1 -1
- package/web/assets/{src-DzMKqnGu.js → src-dSgRs0bd.js} +1 -1
- package/web/assets/{tabpanel-BW8I76pY.js → tabpanel-CeLflR6J.js} +1 -1
- package/web/assets/{tag-new-circle.svg-CV5DN0Db.js → tag-new-circle.svg-CkA4UdUB.js} +1 -1
- package/web/assets/{toggleswitch-D4Evlg2b.js → toggleswitch-DKBXnmzT.js} +1 -1
- package/web/assets/{travel-map-earth-globe.svg-CWvuO_Hb.js → travel-map-earth-globe.svg-kl6fMv7M.js} +1 -1
- package/web/assets/trpc-CgcMlFhM.js +1 -0
- package/web/assets/{tsMode-BqKPHyIc.js → tsMode-DA6ejbio.js} +1 -1
- package/web/assets/{typescript-Bme6ns4u.js → typescript-Bfy7_Fw8.js} +1 -1
- package/web/assets/useAiChatDrawer-DPZ2UftQ.js +1 -0
- package/web/assets/{useCloudOrg-D2LTbk-G.js → useCloudOrg-CsuqKLSU.js} +3 -3
- package/web/assets/{useProjectCatalog-nlAZuu5X.js → useProjectCatalog-4ks7Tpfb.js} +1 -1
- package/web/assets/{xml-zsImRVNc.js → xml-D5p3PPs0.js} +1 -1
- package/web/assets/{yaml-VubzWJpP.js → yaml-CzBSY9q-.js} +1 -1
- package/web/index.html +2 -2
- package/agent-manager-QQPKKLKY.js +0 -8
- package/chunk-3MJLS5UY.js.map +0 -1
- package/chunk-R23UUB5R.js.map +0 -1
- package/chunk-WAC56HS4.js.map +0 -1
- package/settings-manager-6FKHBLIV.js +0 -8
- package/src-NEPDGULO.js.map +0 -1
- package/web/assets/AiChatPage-DDr9XEv8.js +0 -1
- package/web/assets/CloudAccountPage-BAkTRH4E.js +0 -1
- package/web/assets/KanbanBoardPage-DL1WwMBP.js +0 -4
- package/web/assets/KanbanBoardPage-K07_QbUq.css +0 -1
- package/web/assets/SettingsPage-Bi72zdhb.js +0 -2063
- package/web/assets/WikiPage-BH8A-IB_.js +0 -1
- package/web/assets/auth-errors-CwswzwYV.js +0 -1
- package/web/assets/interface-content-folder.svg-FcNZvOjy.js +0 -1
- package/web/assets/modal-D-InjkVP.js +0 -1
- package/web/assets/process.store-DsGpeQnV.js +0 -1
- package/web/assets/router-DTzqrUba.js +0 -1
- package/web/assets/settings-scope-CdxhnRbI.js +0 -1
- package/web/assets/trpc-BbC62Ymt.js +0 -1
- package/web/assets/useAiChatDrawer-BG8t5Thc.js +0 -1
- /package/{agent-manager-QQPKKLKY.js.map → agent-manager-SNVPZNLC.js.map} +0 -0
- /package/{chat-LPMGV2VS.js.map → chat-NSWAMXLO.js.map} +0 -0
- /package/{chunk-HX3ZIWHM.js.map → chunk-BHLCBARP.js.map} +0 -0
- /package/{chunk-72LQC3YC.js.map → chunk-F3HKV5AU.js.map} +0 -0
- /package/{companion-VPYVGTRU.js.map → companion-EWR2QZAB.js.map} +0 -0
- /package/{settings-manager-6FKHBLIV.js.map → settings-manager-YHQ5YHUH.js.map} +0 -0
package/mcp-server/index.js
CHANGED
|
@@ -24,18 +24,29 @@ function clearable(raw, parse, key) {
|
|
|
24
24
|
if (!text || text === "null") return { [key]: null };
|
|
25
25
|
return { [key]: parse(text) };
|
|
26
26
|
}
|
|
27
|
+
function gitTarget(p) {
|
|
28
|
+
return {
|
|
29
|
+
...p.serviceId ? { serviceId: p.serviceId } : {},
|
|
30
|
+
...p.projectId ? { projectId: p.projectId } : {},
|
|
31
|
+
...p.agentId ? { agentId: p.agentId } : {},
|
|
32
|
+
...p.orgId ? { orgId: p.orgId } : {}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
27
35
|
var RUNEYA_CAPABILITIES = [
|
|
28
36
|
{
|
|
29
37
|
name: "list_services",
|
|
30
|
-
description: "List
|
|
38
|
+
description: "List services, with the serviceId and agentId to use in other calls. Pass the projectId your context names to stay on the project the user is looking at, or another one from list_projects to look elsewhere. Called with no project, this can answer for every project of every organization on the machine \u2014 far more than the interface shows.",
|
|
31
39
|
route: "service.list",
|
|
32
40
|
method: "GET",
|
|
33
|
-
params: [
|
|
34
|
-
|
|
41
|
+
params: [
|
|
42
|
+
{ name: "projectId", description: "Restrict to this project, from list_projects. Omit to list every service on the machine.", required: false },
|
|
43
|
+
{ name: "orgId", description: "Its organization. Needed only when the same project id exists in several.", required: false }
|
|
44
|
+
],
|
|
45
|
+
buildInput: (p) => p.projectId ? { projectId: p.projectId, ...p.orgId ? { orgId: p.orgId } : {} } : void 0
|
|
35
46
|
},
|
|
36
47
|
{
|
|
37
48
|
name: "get_service_status",
|
|
38
|
-
description: "Get the current status (running, stopped, etc.) of a service.",
|
|
49
|
+
description: "Get the current status (running, stopped, etc.) of a service. A service that has never been started on this agent has no process yet, and this answers 404 Process not found \u2014 that means STOPPED, not forbidden and not missing. Start it, or read its configuration with get_service.",
|
|
39
50
|
route: "process.get",
|
|
40
51
|
method: "GET",
|
|
41
52
|
params: [
|
|
@@ -302,6 +313,261 @@ var RUNEYA_CAPABILITIES = [
|
|
|
302
313
|
{ name: "organizationId", description: "Which organization. Optional: needed only when the account belongs to several and the error message asks for it.", required: false }
|
|
303
314
|
],
|
|
304
315
|
buildInput: (p) => p.organizationId ? { organizationId: p.organizationId } : {}
|
|
316
|
+
},
|
|
317
|
+
// ─── Lecture seule ───────────────────────────────────────────────────────
|
|
318
|
+
//
|
|
319
|
+
// Tout ce qui se consulte sans rien changer. La création, la mise à jour et
|
|
320
|
+
// la suppression restent hors MCP : elles s'ajouteront au cas par cas.
|
|
321
|
+
//
|
|
322
|
+
// Volontairement absentes, et à ne pas ajouter sans y regarder à deux fois,
|
|
323
|
+
// parce qu'elles rendent un secret : `environment.list` / `get` / `resolve` /
|
|
324
|
+
// `resolveFlat` (un `Environment` porte ses variables, valeurs comprises),
|
|
325
|
+
// `apiKeys.list` / `reveal`, `setup.getEncryptionKeyHex` et `getOrgKeys`
|
|
326
|
+
// (clés de chiffrement), `settings.get` et `settings.listAIProviders` (clés
|
|
327
|
+
// de fournisseurs d'IA — `settings.getPaths` et `getNetwork`, eux, ne
|
|
328
|
+
// rendent que des chemins et une adresse, d'où leur présence ci-dessous),
|
|
329
|
+
// `cloudAuth.session`, `agent.getPassthroughEnv`. Un agent n'a pas besoin de
|
|
330
|
+
// ces valeurs pour travailler, et ce qu'il lit finit dans une transcription.
|
|
331
|
+
{
|
|
332
|
+
name: "list_processes",
|
|
333
|
+
description: "List every process across all agents with its current state (running, stopped, exit code, uptime). Use this to see the whole machine at once, rather than calling get_service_status service by service. An agent only learns about a service when it is first started, so this lists what is deployed, not what is configured: an empty list means nothing has been started, not that you cannot see them \u2014 list_services shows what exists.",
|
|
334
|
+
route: "process.list",
|
|
335
|
+
method: "GET",
|
|
336
|
+
params: [],
|
|
337
|
+
buildInput: () => void 0
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
name: "get_service",
|
|
341
|
+
description: "Read the full configuration of one service: its commands, ports, groups, runner, log sources and restart policy. list_services gives the ids.",
|
|
342
|
+
route: "service.get",
|
|
343
|
+
method: "GET",
|
|
344
|
+
params: [
|
|
345
|
+
{ name: "serviceId", description: "The service ID", required: true }
|
|
346
|
+
],
|
|
347
|
+
buildInput: (p) => ({ id: p.serviceId })
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
name: "get_service_metrics",
|
|
351
|
+
description: "Read the CPU and memory currently used by a running service.",
|
|
352
|
+
route: "process.metrics",
|
|
353
|
+
method: "GET",
|
|
354
|
+
params: [
|
|
355
|
+
{ name: "serviceId", description: "The service ID", required: true },
|
|
356
|
+
{ name: "agentId", description: "The agent ID hosting this service", required: true }
|
|
357
|
+
],
|
|
358
|
+
buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId })
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: "list_agents",
|
|
362
|
+
description: "List the agents connected to this Runeya, with their status and whether they run on this machine. Passphrases are never returned.",
|
|
363
|
+
route: "agent.list",
|
|
364
|
+
method: "GET",
|
|
365
|
+
params: [],
|
|
366
|
+
buildInput: () => void 0
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
name: "list_projects",
|
|
370
|
+
description: "List the projects known to this Runeya, with their ids and the services they hold.",
|
|
371
|
+
route: "project.list",
|
|
372
|
+
method: "GET",
|
|
373
|
+
params: [],
|
|
374
|
+
buildInput: () => void 0
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
name: "get_project",
|
|
378
|
+
description: "Read one project: its services, its active environment, its organization.",
|
|
379
|
+
route: "project.get",
|
|
380
|
+
method: "GET",
|
|
381
|
+
params: [
|
|
382
|
+
{ name: "projectId", description: "The project ID, from list_projects", required: true },
|
|
383
|
+
{ name: "orgId", description: "Its organization. Needed only when the same project id exists in several.", required: false }
|
|
384
|
+
],
|
|
385
|
+
buildInput: (p) => ({ id: p.projectId, ...p.orgId ? { orgId: p.orgId } : {} })
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
name: "list_project_paths",
|
|
389
|
+
description: "Where each project lives on this machine. Use it to find the directory to work in before reading or editing files.",
|
|
390
|
+
route: "project.localPaths",
|
|
391
|
+
method: "GET",
|
|
392
|
+
params: [],
|
|
393
|
+
buildInput: () => void 0
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
name: "git_status",
|
|
397
|
+
description: "Read the git working tree of a service or a project: staged, modified and untracked files, current branch, ahead/behind counts.",
|
|
398
|
+
route: "git.status",
|
|
399
|
+
method: "GET",
|
|
400
|
+
params: [
|
|
401
|
+
{ name: "serviceId", description: "Target the repository of this service", required: false },
|
|
402
|
+
{ name: "projectId", description: "Target the repository of this project, when no service is given", required: false },
|
|
403
|
+
{ name: "agentId", description: "The agent hosting the repository", required: false },
|
|
404
|
+
{ name: "orgId", description: "Its organization, when a project id alone is ambiguous", required: false }
|
|
405
|
+
],
|
|
406
|
+
buildInput: (p) => gitTarget(p)
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
name: "git_log",
|
|
410
|
+
description: "Read the recent commits of a service or project repository: hash, author, date, message.",
|
|
411
|
+
route: "git.log",
|
|
412
|
+
method: "GET",
|
|
413
|
+
params: [
|
|
414
|
+
{ name: "serviceId", description: "Target the repository of this service", required: false },
|
|
415
|
+
{ name: "projectId", description: "Target the repository of this project, when no service is given", required: false },
|
|
416
|
+
{ name: "agentId", description: "The agent hosting the repository", required: false },
|
|
417
|
+
{ name: "orgId", description: "Its organization, when a project id alone is ambiguous", required: false },
|
|
418
|
+
{ name: "limit", description: "How many commits to return (1-200). Default: 50.", required: false }
|
|
419
|
+
],
|
|
420
|
+
buildInput: (p) => ({ ...gitTarget(p), ...p.limit ? { limit: Number(p.limit) } : {} })
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
name: "git_branches",
|
|
424
|
+
description: "List the local and remote branches of a service or project repository.",
|
|
425
|
+
route: "git.branches",
|
|
426
|
+
method: "GET",
|
|
427
|
+
params: [
|
|
428
|
+
{ name: "serviceId", description: "Target the repository of this service", required: false },
|
|
429
|
+
{ name: "projectId", description: "Target the repository of this project, when no service is given", required: false },
|
|
430
|
+
{ name: "agentId", description: "The agent hosting the repository", required: false },
|
|
431
|
+
{ name: "orgId", description: "Its organization, when a project id alone is ambiguous", required: false }
|
|
432
|
+
],
|
|
433
|
+
buildInput: (p) => gitTarget(p)
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
name: "git_diff",
|
|
437
|
+
description: "Read the diff of a service or project repository \u2014 everything, or one file. Use it to see what changed before describing or reviewing it.",
|
|
438
|
+
route: "git.diff",
|
|
439
|
+
method: "GET",
|
|
440
|
+
params: [
|
|
441
|
+
{ name: "serviceId", description: "Target the repository of this service", required: false },
|
|
442
|
+
{ name: "projectId", description: "Target the repository of this project, when no service is given", required: false },
|
|
443
|
+
{ name: "agentId", description: "The agent hosting the repository", required: false },
|
|
444
|
+
{ name: "orgId", description: "Its organization, when a project id alone is ambiguous", required: false },
|
|
445
|
+
{ name: "path", description: "Restrict the diff to this file path", required: false },
|
|
446
|
+
{ name: "staged", description: 'Set to "true" to read the staged diff instead of the working tree', required: false },
|
|
447
|
+
{ name: "untracked", description: 'Set to "true" to include untracked files', required: false }
|
|
448
|
+
],
|
|
449
|
+
buildInput: (p) => ({
|
|
450
|
+
...gitTarget(p),
|
|
451
|
+
...p.path ? { path: p.path } : {},
|
|
452
|
+
...p.staged !== void 0 ? { staged: p.staged === "true" } : {},
|
|
453
|
+
...p.untracked !== void 0 ? { untracked: p.untracked === "true" } : {}
|
|
454
|
+
})
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
name: "list_docs",
|
|
458
|
+
description: "List the markdown documentation files of a scope, as a tree. Pair it with read_doc to answer from the project's own docs rather than from guesswork.",
|
|
459
|
+
route: "wiki.list",
|
|
460
|
+
method: "GET",
|
|
461
|
+
params: [
|
|
462
|
+
{ name: "scope", description: `"global" for this Runeya, or "service:<serviceId>" for one service's repository`, required: true }
|
|
463
|
+
],
|
|
464
|
+
buildInput: (p) => ({ scope: p.scope })
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: "read_doc",
|
|
468
|
+
description: "Read one markdown documentation file. Paths come from list_docs; only .md and .markdown can be read.",
|
|
469
|
+
route: "wiki.read",
|
|
470
|
+
method: "GET",
|
|
471
|
+
params: [
|
|
472
|
+
{ name: "scope", description: `"global" for this Runeya, or "service:<serviceId>" for one service's repository`, required: true },
|
|
473
|
+
{ name: "path", description: "Relative path of the file, as returned by list_docs", required: true }
|
|
474
|
+
],
|
|
475
|
+
buildInput: (p) => ({ scope: p.scope, path: p.path })
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
name: "get_server_logs",
|
|
479
|
+
description: "Read Runeya's own recent log entries. Use it to explain why Runeya itself misbehaved \u2014 not to read a service's output, which is get_logs.",
|
|
480
|
+
route: "diagnostics.recentLogs",
|
|
481
|
+
method: "GET",
|
|
482
|
+
params: [
|
|
483
|
+
{ name: "limit", description: "How many entries to return (1-2000). Default: 500.", required: false }
|
|
484
|
+
],
|
|
485
|
+
buildInput: (p) => p.limit ? { limit: Number(p.limit) } : void 0
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
name: "get_kanban_queue_state",
|
|
489
|
+
description: "Read the state of the kanban task queue: what is running, what is waiting. Use it before queuing work, or to explain why a card has not started.",
|
|
490
|
+
route: "kanbanQueue.getState",
|
|
491
|
+
method: "GET",
|
|
492
|
+
params: [],
|
|
493
|
+
buildInput: () => void 0
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
name: "export_project",
|
|
497
|
+
description: "Read a project and every service it holds in one call, with secrets stripped out. Cheaper and safer than calling get_service for each service \u2014 prefer it whenever you need the whole picture of a project.",
|
|
498
|
+
route: "project.export",
|
|
499
|
+
method: "GET",
|
|
500
|
+
params: [
|
|
501
|
+
{ name: "projectId", description: "The project ID, from list_projects", required: true },
|
|
502
|
+
{ name: "orgId", description: "Its organization. Needed only when the same project id exists in several.", required: false }
|
|
503
|
+
],
|
|
504
|
+
buildInput: (p) => ({ id: p.projectId, ...p.orgId ? { orgId: p.orgId } : {} })
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
name: "git_remotes",
|
|
508
|
+
description: "List the git remotes of a service or project repository, with their URLs.",
|
|
509
|
+
route: "git.remotes",
|
|
510
|
+
method: "GET",
|
|
511
|
+
params: [
|
|
512
|
+
{ name: "serviceId", description: "Target the repository of this service", required: false },
|
|
513
|
+
{ name: "projectId", description: "Target the repository of this project, when no service is given", required: false },
|
|
514
|
+
{ name: "agentId", description: "The agent hosting the repository", required: false },
|
|
515
|
+
{ name: "orgId", description: "Its organization, when a project id alone is ambiguous", required: false }
|
|
516
|
+
],
|
|
517
|
+
buildInput: (p) => gitTarget(p)
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
name: "git_stash_list",
|
|
521
|
+
description: "List the stashes of a service or project repository. Useful before assuming work was lost: it may simply be stashed.",
|
|
522
|
+
route: "git.stashList",
|
|
523
|
+
method: "GET",
|
|
524
|
+
params: [
|
|
525
|
+
{ name: "serviceId", description: "Target the repository of this service", required: false },
|
|
526
|
+
{ name: "projectId", description: "Target the repository of this project, when no service is given", required: false },
|
|
527
|
+
{ name: "agentId", description: "The agent hosting the repository", required: false },
|
|
528
|
+
{ name: "orgId", description: "Its organization, when a project id alone is ambiguous", required: false }
|
|
529
|
+
],
|
|
530
|
+
buildInput: (p) => gitTarget(p)
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
name: "get_runeya_version",
|
|
534
|
+
description: "Read the version of Runeya running here, the latest published one, and whether this install is up to date. Use it before blaming a bug on the code: the machine may simply be behind.",
|
|
535
|
+
route: "health.versionInfo",
|
|
536
|
+
method: "GET",
|
|
537
|
+
params: [],
|
|
538
|
+
buildInput: () => void 0
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
name: "get_runeya_paths",
|
|
542
|
+
description: "Read where Runeya keeps its things on this machine: its launch directory, its data directory, and the machine-wide directory holding cloud projects.",
|
|
543
|
+
route: "settings.getPaths",
|
|
544
|
+
method: "GET",
|
|
545
|
+
params: [],
|
|
546
|
+
buildInput: () => void 0
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
name: "get_network_info",
|
|
550
|
+
description: "Read where this Runeya listens (host and port) and whether it is reachable from the local network, with the URLs to use. Use it to give someone a working link instead of guessing one.",
|
|
551
|
+
route: "settings.getNetwork",
|
|
552
|
+
method: "GET",
|
|
553
|
+
params: [],
|
|
554
|
+
buildInput: () => void 0
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
name: "list_runeya_instances",
|
|
558
|
+
description: "List every Runeya answering on this machine, this one included, with its port and directory. Use it when a port is taken or when two instances seem to disagree.",
|
|
559
|
+
route: "diagnostics.instances",
|
|
560
|
+
method: "GET",
|
|
561
|
+
params: [],
|
|
562
|
+
buildInput: () => void 0
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
name: "get_cloud_status",
|
|
566
|
+
description: "Say whether this Runeya is linked to a cloud account, and to which cloud. A kanban tool failing for lack of a cloud link is explained here.",
|
|
567
|
+
route: "cloudAuth.status",
|
|
568
|
+
method: "GET",
|
|
569
|
+
params: [],
|
|
570
|
+
buildInput: () => void 0
|
|
305
571
|
}
|
|
306
572
|
];
|
|
307
573
|
async function callTrpc(baseUrl, route, method, input, authToken) {
|
|
@@ -322,11 +588,29 @@ async function callTrpc(baseUrl, route, method, input, authToken) {
|
|
|
322
588
|
return result?.["data"] ?? result ?? json;
|
|
323
589
|
}
|
|
324
590
|
|
|
591
|
+
// src/project-default.ts
|
|
592
|
+
function applyProjectAnchor(cap, params, anchor) {
|
|
593
|
+
if (!anchor.projectId) return params;
|
|
594
|
+
const accepts = (name) => cap.params.some((p) => p.name === name);
|
|
595
|
+
if (!accepts("projectId") || params["projectId"]) return params;
|
|
596
|
+
return {
|
|
597
|
+
...params,
|
|
598
|
+
projectId: anchor.projectId,
|
|
599
|
+
// L'organisation n'accompagne le projet que si la capability la comprend :
|
|
600
|
+
// ailleurs, ce serait un champ de trop, refusé par le schéma de la route.
|
|
601
|
+
...anchor.orgId && accepts("orgId") && !params["orgId"] ? { orgId: anchor.orgId } : {}
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
|
|
325
605
|
// src/index.ts
|
|
326
606
|
var BASE_URL = process.env["RUNEYA_BASE_URL"] ?? "http://localhost:4000";
|
|
327
607
|
var CONVERSATION_ID = process.env["RUNEYA_CONVERSATION_ID"] ?? "";
|
|
328
608
|
var INTERNAL_TOKEN = process.env["RUNEYA_INTERNAL_TOKEN"] ?? "";
|
|
329
609
|
var ENV_TOKEN = process.env["RUNEYA_API_TOKEN"] ?? "";
|
|
610
|
+
var PROJECT_ANCHOR = {
|
|
611
|
+
projectId: process.env["RUNEYA_PROJECT_ID"] || void 0,
|
|
612
|
+
orgId: process.env["RUNEYA_ORG_ID"] || void 0
|
|
613
|
+
};
|
|
330
614
|
var server = new McpServer({ name: "runeya", version: "1.0.0" });
|
|
331
615
|
for (const cap of RUNEYA_CAPABILITIES) {
|
|
332
616
|
const zodShape = {};
|
|
@@ -340,7 +624,7 @@ for (const cap of RUNEYA_CAPABILITIES) {
|
|
|
340
624
|
const raw = input.authToken;
|
|
341
625
|
const authToken = raw && !raw.startsWith("$") ? raw : ENV_TOKEN || INTERNAL_TOKEN || void 0;
|
|
342
626
|
if (!authToken) throw new Error("No auth token available");
|
|
343
|
-
const params = input;
|
|
627
|
+
const params = applyProjectAnchor(cap, input, PROJECT_ANCHOR);
|
|
344
628
|
const result = await callTrpc(BASE_URL, cap.route, cap.method, cap.buildInput(params), authToken);
|
|
345
629
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
346
630
|
} catch (err) {
|
package/mcp-server/index.js.map
CHANGED
|
@@ -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\n/**\n * Une liste, telle qu'un modèle l'écrit.\n *\n * Il envoie du JSON quand il y pense, une énumération séparée par des virgules\n * quand il n'y pense pas. Refuser la seconde ferait échouer l'appel sans que\n * rien n'explique pourquoi.\n */\nfunction toList(raw: string | undefined): string[] {\n if (!raw) return [];\n const text = raw.trim();\n if (text.startsWith('[')) {\n try {\n const parsed: unknown = JSON.parse(text);\n if (Array.isArray(parsed)) return parsed.map((v) => String(v).trim()).filter(Boolean);\n } catch {\n // Un JSON malformé se lit comme une énumération : mieux vaut retenir les\n // noms qu'il contient que de tout perdre sur une virgule en trop.\n }\n }\n return text.split(',').map((v) => v.trim().replace(/^[\"'[]+|[\"'\\]]+$/g, '')).filter(Boolean);\n}\n\n/**\n * Un champ qu'on peut soit changer, soit effacer, soit laisser tranquille.\n *\n * Absent : on n'y touche pas. `null` ou vide : on l'efface — c'est ce que le\n * cloud attend, et la seule façon pour un agent de retirer une échéance.\n */\nfunction clearable(\n raw: string | undefined,\n parse: (value: string) => unknown,\n key: string,\n): Record<string, unknown> {\n if (raw === undefined) return {};\n const text = String(raw).trim();\n if (!text || text === 'null') return { [key]: null };\n return { [key]: parse(text) };\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, body and comments (accent- and case-insensitive). Archived cards are included. 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, bodies and comments', 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 name: 'kanban_get_card',\n description: 'Read one kanban card by id, including archived ones. Cheaper than fetching the whole board, and the only way to read a card that has been archived.',\n route: 'kanban.getCard',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId }),\n },\n {\n name: 'kanban_update_card',\n description: 'Update an existing kanban card. Only the fields you pass are changed; passing null to priority, color or deadline clears it. Prefer this over creating a second card when something needs correcting.',\n route: 'kanban.updateCard',\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: 'title', description: 'New title', required: false },\n { name: 'content', description: 'New card content, in markdown', required: false },\n { name: 'priority', description: 'Priority from 1 to 10, or null to clear it', required: false },\n { name: 'color', description: 'Card colour, or null to clear it', required: false },\n { name: 'groups', description: 'Labels, as a list of strings. Replaces the current ones.', required: false },\n { name: 'deadline', description: 'Due date as YYYY-MM-DD, or null to clear it', required: false },\n { name: 'assignees', description: 'User ids to assign, as a list. Replaces the current ones; use kanban_list_members to find the ids.', required: false },\n ],\n buildInput: (p) => ({\n boardId: p.boardId,\n cardId: p.cardId,\n ...(p.title !== undefined ? { title: p.title } : {}),\n ...(p.content !== undefined ? { content: p.content } : {}),\n // Tout arrive en chaîne : un modèle n'écrit pas des nombres, des listes\n // ni des `null` typés. `clearable` distingue « efface » de « ne touche\n // pas » — sans quoi vider une couleur serait impossible à exprimer, et\n // changer un titre risquerait de vider le reste.\n ...(clearable(p.priority, (v) => Number(v), 'priority')),\n ...(clearable(p.color, (v) => v, 'color')),\n ...(clearable(p.deadline, (v) => v, 'deadline')),\n ...(p.groups !== undefined ? { groups: toList(p.groups) } : {}),\n ...(p.assignees !== undefined ? { assignees: toList(p.assignees) } : {}),\n }),\n },\n {\n name: 'kanban_set_card_archived',\n description: 'Archive a kanban card (it leaves the board but is not deleted) or bring it back. An unarchived card returns to the column it left.',\n route: 'kanban.setCardArchived',\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: 'archived', description: 'true to archive, false to bring the card back', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId, archived: p.archived === 'true' }),\n },\n {\n name: 'kanban_list_members',\n description: 'List the people of the organization who can be assigned to a card, with their ids. Needed before assigning anyone with kanban_update_card.',\n route: 'kanban.listMembers',\n method: 'GET',\n params: [\n { name: 'organizationId', description: 'Which organization. Optional: needed only when the account belongs to several and the error message asks for it.', required: false },\n ],\n buildInput: (p) => (p.organizationId ? { organizationId: p.organizationId } : {}),\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;;;ACuClB,SAAS,OAAO,KAAmC;AACjD,MAAI,CAAC,IAAK,QAAO,CAAC;AAClB,QAAM,OAAO,IAAI,KAAK;AACtB,MAAI,KAAK,WAAW,GAAG,GAAG;AACxB,QAAI;AACF,YAAM,SAAkB,KAAK,MAAM,IAAI;AACvC,UAAI,MAAM,QAAQ,MAAM,EAAG,QAAO,OAAO,IAAI,CAAC,MAAM,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,OAAO,OAAO;IACtF,QAAQ;IAGR;EACF;AACA,SAAO,KAAK,MAAM,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,qBAAqB,EAAE,CAAC,EAAE,OAAO,OAAO;AAC7F;AAQA,SAAS,UACP,KACA,OACA,KACyB;AACzB,MAAI,QAAQ,OAAW,QAAO,CA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B,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","../src/project-default.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';\nimport { applyProjectAnchor } from './project-default.js';\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// Le projet dans lequel Runeya a lancé ce CLI. Absent hors conversation\n// (un CLI démarré à la main), et alors rien n'est ancré.\nconst PROJECT_ANCHOR = {\n projectId: process.env['RUNEYA_PROJECT_ID'] || undefined,\n orgId: process.env['RUNEYA_ORG_ID'] || undefined,\n};\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 = applyProjectAnchor(cap, input as Record<string, string | undefined>, PROJECT_ANCHOR);\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\n/**\n * Une liste, telle qu'un modèle l'écrit.\n *\n * Il envoie du JSON quand il y pense, une énumération séparée par des virgules\n * quand il n'y pense pas. Refuser la seconde ferait échouer l'appel sans que\n * rien n'explique pourquoi.\n */\nfunction toList(raw: string | undefined): string[] {\n if (!raw) return [];\n const text = raw.trim();\n if (text.startsWith('[')) {\n try {\n const parsed: unknown = JSON.parse(text);\n if (Array.isArray(parsed)) return parsed.map((v) => String(v).trim()).filter(Boolean);\n } catch {\n // Un JSON malformé se lit comme une énumération : mieux vaut retenir les\n // noms qu'il contient que de tout perdre sur une virgule en trop.\n }\n }\n return text.split(',').map((v) => v.trim().replace(/^[\"'[]+|[\"'\\]]+$/g, '')).filter(Boolean);\n}\n\n/**\n * Un champ qu'on peut soit changer, soit effacer, soit laisser tranquille.\n *\n * Absent : on n'y touche pas. `null` ou vide : on l'efface — c'est ce que le\n * cloud attend, et la seule façon pour un agent de retirer une échéance.\n */\nfunction clearable(\n raw: string | undefined,\n parse: (value: string) => unknown,\n key: string,\n): Record<string, unknown> {\n if (raw === undefined) return {};\n const text = String(raw).trim();\n if (!text || text === 'null') return { [key]: null };\n return { [key]: parse(text) };\n}\n\n/**\n * La cible d'une commande git : un service, ou à défaut un projet.\n *\n * Les quatre champs sont facultatifs côté route (`gitTargetShape`), qui résout\n * elle-même l'agent et le répertoire. On ne transmet que ce que le modèle a\n * réellement donné : un `serviceId` vide ferait échouer la résolution.\n */\nfunction gitTarget(p: Record<string, string | undefined>): Record<string, unknown> {\n return {\n ...(p.serviceId ? { serviceId: p.serviceId } : {}),\n ...(p.projectId ? { projectId: p.projectId } : {}),\n ...(p.agentId ? { agentId: p.agentId } : {}),\n ...(p.orgId ? { orgId: p.orgId } : {}),\n };\n}\n\nexport const RUNEYA_CAPABILITIES: RuneyaCapability[] = [\n {\n name: 'list_services',\n description: \"List services, with the serviceId and agentId to use in other calls. Pass the projectId your context names to stay on the project the user is looking at, or another one from list_projects to look elsewhere. Called with no project, this can answer for every project of every organization on the machine — far more than the interface shows.\",\n route: 'service.list',\n method: 'GET',\n params: [\n { name: 'projectId', description: 'Restrict to this project, from list_projects. Omit to list every service on the machine.', required: false },\n { name: 'orgId', description: 'Its organization. Needed only when the same project id exists in several.', required: false },\n ],\n buildInput: (p) => (p.projectId\n ? { projectId: p.projectId, ...(p.orgId ? { orgId: p.orgId } : {}) }\n : undefined),\n },\n {\n name: 'get_service_status',\n description: \"Get the current status (running, stopped, etc.) of a service. A service that has never been started on this agent has no process yet, and this answers 404 Process not found — that means STOPPED, not forbidden and not missing. Start it, or read its configuration with get_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, body and comments (accent- and case-insensitive). Archived cards are included. 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, bodies and comments', 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 name: 'kanban_get_card',\n description: 'Read one kanban card by id, including archived ones. Cheaper than fetching the whole board, and the only way to read a card that has been archived.',\n route: 'kanban.getCard',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId }),\n },\n {\n name: 'kanban_update_card',\n description: 'Update an existing kanban card. Only the fields you pass are changed; passing null to priority, color or deadline clears it. Prefer this over creating a second card when something needs correcting.',\n route: 'kanban.updateCard',\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: 'title', description: 'New title', required: false },\n { name: 'content', description: 'New card content, in markdown', required: false },\n { name: 'priority', description: 'Priority from 1 to 10, or null to clear it', required: false },\n { name: 'color', description: 'Card colour, or null to clear it', required: false },\n { name: 'groups', description: 'Labels, as a list of strings. Replaces the current ones.', required: false },\n { name: 'deadline', description: 'Due date as YYYY-MM-DD, or null to clear it', required: false },\n { name: 'assignees', description: 'User ids to assign, as a list. Replaces the current ones; use kanban_list_members to find the ids.', required: false },\n ],\n buildInput: (p) => ({\n boardId: p.boardId,\n cardId: p.cardId,\n ...(p.title !== undefined ? { title: p.title } : {}),\n ...(p.content !== undefined ? { content: p.content } : {}),\n // Tout arrive en chaîne : un modèle n'écrit pas des nombres, des listes\n // ni des `null` typés. `clearable` distingue « efface » de « ne touche\n // pas » — sans quoi vider une couleur serait impossible à exprimer, et\n // changer un titre risquerait de vider le reste.\n ...(clearable(p.priority, (v) => Number(v), 'priority')),\n ...(clearable(p.color, (v) => v, 'color')),\n ...(clearable(p.deadline, (v) => v, 'deadline')),\n ...(p.groups !== undefined ? { groups: toList(p.groups) } : {}),\n ...(p.assignees !== undefined ? { assignees: toList(p.assignees) } : {}),\n }),\n },\n {\n name: 'kanban_set_card_archived',\n description: 'Archive a kanban card (it leaves the board but is not deleted) or bring it back. An unarchived card returns to the column it left.',\n route: 'kanban.setCardArchived',\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: 'archived', description: 'true to archive, false to bring the card back', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId, archived: p.archived === 'true' }),\n },\n {\n name: 'kanban_list_members',\n description: 'List the people of the organization who can be assigned to a card, with their ids. Needed before assigning anyone with kanban_update_card.',\n route: 'kanban.listMembers',\n method: 'GET',\n params: [\n { name: 'organizationId', description: 'Which organization. Optional: needed only when the account belongs to several and the error message asks for it.', required: false },\n ],\n buildInput: (p) => (p.organizationId ? { organizationId: p.organizationId } : {}),\n },\n\n // ─── Lecture seule ───────────────────────────────────────────────────────\n //\n // Tout ce qui se consulte sans rien changer. La création, la mise à jour et\n // la suppression restent hors MCP : elles s'ajouteront au cas par cas.\n //\n // Volontairement absentes, et à ne pas ajouter sans y regarder à deux fois,\n // parce qu'elles rendent un secret : `environment.list` / `get` / `resolve` /\n // `resolveFlat` (un `Environment` porte ses variables, valeurs comprises),\n // `apiKeys.list` / `reveal`, `setup.getEncryptionKeyHex` et `getOrgKeys`\n // (clés de chiffrement), `settings.get` et `settings.listAIProviders` (clés\n // de fournisseurs d'IA — `settings.getPaths` et `getNetwork`, eux, ne\n // rendent que des chemins et une adresse, d'où leur présence ci-dessous),\n // `cloudAuth.session`, `agent.getPassthroughEnv`. Un agent n'a pas besoin de\n // ces valeurs pour travailler, et ce qu'il lit finit dans une transcription.\n {\n name: 'list_processes',\n description: \"List every process across all agents with its current state (running, stopped, exit code, uptime). Use this to see the whole machine at once, rather than calling get_service_status service by service. An agent only learns about a service when it is first started, so this lists what is deployed, not what is configured: an empty list means nothing has been started, not that you cannot see them — list_services shows what exists.\",\n route: 'process.list',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'get_service',\n description: 'Read the full configuration of one service: its commands, ports, groups, runner, log sources and restart policy. list_services gives the ids.',\n route: 'service.get',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'The service ID', required: true },\n ],\n buildInput: (p) => ({ id: p.serviceId }),\n },\n {\n name: 'get_service_metrics',\n description: 'Read the CPU and memory currently used by a running service.',\n route: 'process.metrics',\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: 'list_agents',\n description: 'List the agents connected to this Runeya, with their status and whether they run on this machine. Passphrases are never returned.',\n route: 'agent.list',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'list_projects',\n description: 'List the projects known to this Runeya, with their ids and the services they hold.',\n route: 'project.list',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'get_project',\n description: 'Read one project: its services, its active environment, its organization.',\n route: 'project.get',\n method: 'GET',\n params: [\n { name: 'projectId', description: 'The project ID, from list_projects', required: true },\n { name: 'orgId', description: 'Its organization. Needed only when the same project id exists in several.', required: false },\n ],\n buildInput: (p) => ({ id: p.projectId, ...(p.orgId ? { orgId: p.orgId } : {}) }),\n },\n {\n name: 'list_project_paths',\n description: 'Where each project lives on this machine. Use it to find the directory to work in before reading or editing files.',\n route: 'project.localPaths',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'git_status',\n description: 'Read the git working tree of a service or a project: staged, modified and untracked files, current branch, ahead/behind counts.',\n route: 'git.status',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'Target the repository of this service', required: false },\n { name: 'projectId', description: 'Target the repository of this project, when no service is given', required: false },\n { name: 'agentId', description: 'The agent hosting the repository', required: false },\n { name: 'orgId', description: 'Its organization, when a project id alone is ambiguous', required: false },\n ],\n buildInput: (p) => gitTarget(p),\n },\n {\n name: 'git_log',\n description: 'Read the recent commits of a service or project repository: hash, author, date, message.',\n route: 'git.log',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'Target the repository of this service', required: false },\n { name: 'projectId', description: 'Target the repository of this project, when no service is given', required: false },\n { name: 'agentId', description: 'The agent hosting the repository', required: false },\n { name: 'orgId', description: 'Its organization, when a project id alone is ambiguous', required: false },\n { name: 'limit', description: 'How many commits to return (1-200). Default: 50.', required: false },\n ],\n buildInput: (p) => ({ ...gitTarget(p), ...(p.limit ? { limit: Number(p.limit) } : {}) }),\n },\n {\n name: 'git_branches',\n description: 'List the local and remote branches of a service or project repository.',\n route: 'git.branches',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'Target the repository of this service', required: false },\n { name: 'projectId', description: 'Target the repository of this project, when no service is given', required: false },\n { name: 'agentId', description: 'The agent hosting the repository', required: false },\n { name: 'orgId', description: 'Its organization, when a project id alone is ambiguous', required: false },\n ],\n buildInput: (p) => gitTarget(p),\n },\n {\n name: 'git_diff',\n description: 'Read the diff of a service or project repository — everything, or one file. Use it to see what changed before describing or reviewing it.',\n route: 'git.diff',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'Target the repository of this service', required: false },\n { name: 'projectId', description: 'Target the repository of this project, when no service is given', required: false },\n { name: 'agentId', description: 'The agent hosting the repository', required: false },\n { name: 'orgId', description: 'Its organization, when a project id alone is ambiguous', required: false },\n { name: 'path', description: 'Restrict the diff to this file path', required: false },\n { name: 'staged', description: 'Set to \"true\" to read the staged diff instead of the working tree', required: false },\n { name: 'untracked', description: 'Set to \"true\" to include untracked files', required: false },\n ],\n buildInput: (p) => ({\n ...gitTarget(p),\n ...(p.path ? { path: p.path } : {}),\n ...(p.staged !== undefined ? { staged: p.staged === 'true' } : {}),\n ...(p.untracked !== undefined ? { untracked: p.untracked === 'true' } : {}),\n }),\n },\n {\n name: 'list_docs',\n description: 'List the markdown documentation files of a scope, as a tree. Pair it with read_doc to answer from the project\\'s own docs rather than from guesswork.',\n route: 'wiki.list',\n method: 'GET',\n params: [\n { name: 'scope', description: '\"global\" for this Runeya, or \"service:<serviceId>\" for one service\\'s repository', required: true },\n ],\n buildInput: (p) => ({ scope: p.scope }),\n },\n {\n name: 'read_doc',\n description: 'Read one markdown documentation file. Paths come from list_docs; only .md and .markdown can be read.',\n route: 'wiki.read',\n method: 'GET',\n params: [\n { name: 'scope', description: '\"global\" for this Runeya, or \"service:<serviceId>\" for one service\\'s repository', required: true },\n { name: 'path', description: 'Relative path of the file, as returned by list_docs', required: true },\n ],\n buildInput: (p) => ({ scope: p.scope, path: p.path }),\n },\n {\n name: 'get_server_logs',\n description: \"Read Runeya's own recent log entries. Use it to explain why Runeya itself misbehaved — not to read a service's output, which is get_logs.\",\n route: 'diagnostics.recentLogs',\n method: 'GET',\n params: [\n { name: 'limit', description: 'How many entries to return (1-2000). Default: 500.', required: false },\n ],\n buildInput: (p) => (p.limit ? { limit: Number(p.limit) } : undefined),\n },\n {\n name: 'get_kanban_queue_state',\n description: 'Read the state of the kanban task queue: what is running, what is waiting. Use it before queuing work, or to explain why a card has not started.',\n route: 'kanbanQueue.getState',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'export_project',\n description: \"Read a project and every service it holds in one call, with secrets stripped out. Cheaper and safer than calling get_service for each service — prefer it whenever you need the whole picture of a project.\",\n route: 'project.export',\n method: 'GET',\n params: [\n { name: 'projectId', description: 'The project ID, from list_projects', required: true },\n { name: 'orgId', description: 'Its organization. Needed only when the same project id exists in several.', required: false },\n ],\n buildInput: (p) => ({ id: p.projectId, ...(p.orgId ? { orgId: p.orgId } : {}) }),\n },\n {\n name: 'git_remotes',\n description: 'List the git remotes of a service or project repository, with their URLs.',\n route: 'git.remotes',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'Target the repository of this service', required: false },\n { name: 'projectId', description: 'Target the repository of this project, when no service is given', required: false },\n { name: 'agentId', description: 'The agent hosting the repository', required: false },\n { name: 'orgId', description: 'Its organization, when a project id alone is ambiguous', required: false },\n ],\n buildInput: (p) => gitTarget(p),\n },\n {\n name: 'git_stash_list',\n description: 'List the stashes of a service or project repository. Useful before assuming work was lost: it may simply be stashed.',\n route: 'git.stashList',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'Target the repository of this service', required: false },\n { name: 'projectId', description: 'Target the repository of this project, when no service is given', required: false },\n { name: 'agentId', description: 'The agent hosting the repository', required: false },\n { name: 'orgId', description: 'Its organization, when a project id alone is ambiguous', required: false },\n ],\n buildInput: (p) => gitTarget(p),\n },\n {\n name: 'get_runeya_version',\n description: 'Read the version of Runeya running here, the latest published one, and whether this install is up to date. Use it before blaming a bug on the code: the machine may simply be behind.',\n route: 'health.versionInfo',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'get_runeya_paths',\n description: \"Read where Runeya keeps its things on this machine: its launch directory, its data directory, and the machine-wide directory holding cloud projects.\",\n route: 'settings.getPaths',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'get_network_info',\n description: 'Read where this Runeya listens (host and port) and whether it is reachable from the local network, with the URLs to use. Use it to give someone a working link instead of guessing one.',\n route: 'settings.getNetwork',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'list_runeya_instances',\n description: 'List every Runeya answering on this machine, this one included, with its port and directory. Use it when a port is taken or when two instances seem to disagree.',\n route: 'diagnostics.instances',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'get_cloud_status',\n description: 'Say whether this Runeya is linked to a cloud account, and to which cloud. A kanban tool failing for lack of a cloud link is explained here.',\n route: 'cloudAuth.status',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\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 * 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","import type { RuneyaCapability } from '@runeya/packages-ai-capabilities';\n\n/** Le projet dans lequel cette instance du serveur MCP a été lancée. */\nexport interface ProjectAnchor {\n projectId?: string;\n orgId?: string;\n}\n\n/**\n * Ancrer un appel sur le projet de la conversation.\n *\n * `service.list` rend tout le poste : chaque coffre, donc chaque projet de\n * chaque organisation de la machine. L'interface n'en montre qu'un, et le\n * prompt de l'agent ne décrit que celui-là — mais la tool, elle, répondait 88\n * services quand l'écran en montrait trois. L'agent citait alors des services\n * que l'utilisateur n'a jamais vus, et concluait à un problème de permissions.\n *\n * Le projet est donc posé par Runeya au lancement du serveur MCP, et complété\n * ici plutôt que laissé à la bonne lecture d'une consigne.\n *\n * Ne complète QUE ce que la capability déclare et que l'appelant a laissé vide :\n * un `projectId` donné explicitement gagne toujours, ce qui laisse l'agent\n * interroger un autre projet — `list_projects` les nomme tous.\n */\nexport function applyProjectAnchor(\n cap: Pick<RuneyaCapability, 'params'>,\n params: Record<string, string | undefined>,\n anchor: ProjectAnchor,\n): Record<string, string | undefined> {\n if (!anchor.projectId) return params;\n\n const accepts = (name: string) => cap.params.some((p) => p.name === name);\n if (!accepts('projectId') || params['projectId']) return params;\n\n return {\n ...params,\n projectId: anchor.projectId,\n // L'organisation n'accompagne le projet que si la capability la comprend :\n // ailleurs, ce serait un champ de trop, refusé par le schéma de la route.\n ...(an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.ts
CHANGED
|
@@ -13,6 +13,15 @@
|
|
|
13
13
|
interface RuneyaMcpEnv {
|
|
14
14
|
RUNEYA_BASE_URL?: string;
|
|
15
15
|
RUNEYA_API_TOKEN?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Le projet de la conversation qui lance ce CLI, s'il y en a un.
|
|
18
|
+
*
|
|
19
|
+
* Le serveur MCP en fait le défaut des tools qui acceptent un `projectId` :
|
|
20
|
+
* sans lui, `list_services` rend tous les projets de la machine, quand
|
|
21
|
+
* l'écran et le prompt n'en montrent qu'un.
|
|
22
|
+
*/
|
|
23
|
+
RUNEYA_PROJECT_ID?: string;
|
|
24
|
+
RUNEYA_ORG_ID?: string;
|
|
16
25
|
}
|
|
17
26
|
/**
|
|
18
27
|
* Chemin du point d'entrée du serveur MCP, à lancer avec `node`.
|
|
@@ -25,6 +34,16 @@ interface RuneyaMcpEnv {
|
|
|
25
34
|
* symboliques de l'espace de travail n'existent plus.
|
|
26
35
|
*/
|
|
27
36
|
declare function resolveMcpServerPath(): string;
|
|
37
|
+
/**
|
|
38
|
+
* La config MCP de Runeya, au format `mcpServers` attendu par `--mcp-config`.
|
|
39
|
+
*
|
|
40
|
+
* Seul endroit du dépôt où ce JSON se fabrique. `chat.ts` en tenait deux copies
|
|
41
|
+
* qui résolvaient le chemin avec `import.meta.url` — le piège que
|
|
42
|
+
* `resolveMcpServerPath()` documente juste au-dessus : bundlées dans l'app
|
|
43
|
+
* hôte, elles visaient un fichier qui n'existe pas, et le CLI démarrait sans
|
|
44
|
+
* les tools Runeya, en silence.
|
|
45
|
+
*/
|
|
46
|
+
declare function runeyaMcpConfig(env: RuneyaMcpEnv): string;
|
|
28
47
|
/**
|
|
29
48
|
* Arguments `--mcp-config` pour le CLI `claude`, qui attend du JSON.
|
|
30
49
|
*
|
|
@@ -42,4 +61,4 @@ declare function claudeMcpArgs(env: RuneyaMcpEnv): string[];
|
|
|
42
61
|
*/
|
|
43
62
|
declare function codexMcpArgs(env: RuneyaMcpEnv): string[];
|
|
44
63
|
|
|
45
|
-
export { type RuneyaMcpEnv, claudeMcpArgs, codexMcpArgs, resolveMcpServerPath };
|
|
64
|
+
export { type RuneyaMcpEnv, claudeMcpArgs, codexMcpArgs, resolveMcpServerPath, runeyaMcpConfig };
|