@runeya/runeya 2.0.124 → 2.0.126
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.map +1 -1
- package/{agent-manager-FZFFWISA.js → agent-manager-QLXVQ7OD.js} +3 -3
- package/{chat-JIJQ7IJS.js → chat-ODBVFMKX.js} +6 -6
- package/{chunk-GKK3ACWB.js → chunk-2EDVDRKV.js} +589 -258
- package/chunk-2EDVDRKV.js.map +1 -0
- package/{chunk-N3ZI35SC.js → chunk-K7A3Q62R.js} +2 -2
- package/{chunk-H22YLVQE.js → chunk-SG2ACPOE.js} +43 -19
- package/chunk-SG2ACPOE.js.map +1 -0
- package/{chunk-T2BV5WZE.js → chunk-TTPL2M74.js} +87 -1
- package/chunk-TTPL2M74.js.map +1 -0
- package/{chunk-4PN7QBNM.js → chunk-WLZQDWJT.js} +6 -2
- package/chunk-WLZQDWJT.js.map +1 -0
- package/{companion-OZODV5BR.js → companion-5DPH3HIO.js} +6 -4
- package/{desktop-launcher-EGGVXXKV.js → desktop-launcher-J2BCSSGZ.js} +2 -2
- package/index.js +4 -4
- package/mcp-server/index.js +1469 -20
- package/mcp-server/index.js.map +1 -1
- package/package.json +1 -1
- package/{settings-manager-MAVD4GAS.js → settings-manager-E3L56VAY.js} +3 -3
- package/{src-SGSG2RSF.js → src-XCI5NILM.js} +245 -54
- package/src-XCI5NILM.js.map +1 -0
- package/web/assets/AgentScalarChatInterface.vue-86061Tlh.js +13 -0
- package/web/assets/AgentTerminalPage-DxGLu5uT.js +1 -0
- package/web/assets/AiChatPage-DmQKv6pr.js +1 -0
- package/web/assets/{AppLayout-vWoE_P8T.css → AppLayout-Do2CLgOr.css} +1 -1
- package/web/assets/AppLayout-DtK_nr-e.js +1 -0
- package/web/assets/AuditPage-CX5VJGlF.js +1 -0
- package/web/assets/CloudAccountPage-B_sjXlfl.js +1 -0
- package/web/assets/CloudAccountPage-ocHdrVEm.js +1 -0
- package/web/assets/CloudMessagingPage-BTfGWio6.js +2 -0
- package/web/assets/DashboardPage-7sATlyhd.js +164 -0
- package/web/assets/DashboardPage-DWA-1xgl.css +1 -0
- package/web/assets/DirectoryPickerDialog-DAJGNiRV.js +1 -0
- package/web/assets/{EditorIcon-BZyy2C12.js → EditorIcon-lzF8hPtZ.js} +2 -2
- package/web/assets/EnvironmentForm-DVWdFsE1.js +108 -0
- package/web/assets/EnvironmentFormPage-DoKBTKCU.js +1 -0
- package/web/assets/EnvironmentListPage-C9wGFZWU.js +1 -0
- package/web/assets/KanbanBoardPage-CoiDga7h.js +4 -0
- package/web/assets/KanbanListPage-xWYUu1P0.js +1 -0
- package/web/assets/LaunchProjectPage-DVXgnUYk.js +1 -0
- package/web/assets/LaunchServicesPage-CPN3Z3m5.css +1 -0
- package/web/assets/LaunchServicesPage-DM6keva3.js +1 -0
- package/web/assets/LogViewer-CMtuP1rB.js +3 -0
- package/web/assets/OrgKeyPrompt-BqVugrV1.js +1 -0
- package/web/assets/{ProcessControls-neMxqIY_.js → ProcessControls-DkaiMo0H.js} +1 -1
- package/web/assets/ProcessDetailPage-DJacy1ZE.js +1 -0
- package/web/assets/{ProcessMetrics-Bb7yNIVd.js → ProcessMetrics-D2lP9cEF.js} +2 -2
- package/web/assets/RandomJobTestPage-BOsChnPH.js +2 -0
- package/web/assets/ScenarioEditorPage-8XSWtwA5.js +14 -0
- package/web/assets/SendToChatDialog-DqPVoUgN.js +1 -0
- package/web/assets/ServiceControlsBar-QwLQLGFP.js +1 -0
- package/web/assets/ServiceControlsBar-lhuSKZqO.css +1 -0
- package/web/assets/ServiceDetailPage-DUw-ZZyD.js +2 -0
- package/web/assets/{ServiceDetailPage-BcFOlsU9.css → ServiceDetailPage-cQNK1uWq.css} +1 -1
- package/web/assets/ServiceFormPage-OYBr0pY4.js +1 -0
- package/web/assets/SettingsPage-BFoWbWhq.js +2063 -0
- package/web/assets/UnlockPage-DgLCLMkg.js +1 -0
- package/web/assets/VaultMigrationPage-C93bZgWb.js +1 -0
- package/web/assets/VersionBadge-2JJyjyFh.js +1 -0
- package/web/assets/WikiPage-DBinkJlt.js +1 -0
- package/web/assets/WikiView-DMyRUz16.js +1 -0
- package/web/assets/add-scalar-classes-C1s53GSo.js +387 -0
- package/web/assets/{autocomplete-BTMTTAk9.js → autocomplete-qVwP27uM.js} +3 -3
- package/web/assets/{basic-shape-diamond.svg-CZQG7mdB.js → basic-shape-diamond.svg-BwZ1Enqo.js} +1 -1
- package/web/assets/{basic-shape-hexagon.svg-BnLoXUmj.js → basic-shape-hexagon.svg-Cyko19l-.js} +1 -1
- package/web/assets/{basic-shape-primary-circle-ellipse-round.svg-DDU6pRYe.js → basic-shape-primary-circle-ellipse-round.svg-CWaxr-XS.js} +1 -1
- package/web/assets/{basic-shape-primary-square-rectangle.svg-Dq_Zdck2.js → basic-shape-primary-square-rectangle.svg-BueTJIhO.js} +1 -1
- package/web/assets/{basic-shape-shield.svg-DbFCxPmO.js → basic-shape-shield.svg-DiYXMUMt.js} +1 -1
- package/web/assets/{browser-CTYk99RA.js → browser-72mztbYe.js} +1 -1
- package/web/assets/{browser-DowFjZcI.js → browser-B8wHMk1o.js} +1 -1
- package/web/assets/{card-R4Q2Qr9t.js → card-CRMlmWrt.js} +2 -2
- package/web/assets/{checkbox-CfoV-T17.js → checkbox-BiDvmfqK.js} +3 -3
- package/web/assets/{chip-V3vhLdcF.js → chip-Cb6eK00K.js} +2 -2
- package/web/assets/client-3Q_o9QCm.js +24 -0
- package/web/assets/cloud-chat.store-DIxQd2ew.js +1 -0
- package/web/assets/cloud-client-Idzdbhu6.js +1 -0
- package/web/assets/cloud-session-CIGp7324.js +2 -0
- package/web/assets/cloud-session-Cj_Q0hKS.js +1 -0
- package/web/assets/column-4DnT4nYp.js +763 -0
- package/web/assets/{computer-device-desktop-monitor.svg-CRLfD7-U.js → computer-device-desktop-monitor.svg-DkL4R6oe.js} +1 -1
- package/web/assets/{computer-device-desktop.svg-CGKq4iih.js → computer-device-desktop.svg-DXRQ2Wl4.js} +1 -1
- package/web/assets/{computer-device-laptop.svg-bmeM_RDO.js → computer-device-laptop.svg-BwdMHvul.js} +1 -1
- package/web/assets/{computer-device-mobile-phone-android-samsung-back.svg-CFwMSjoP.js → computer-device-mobile-phone-android-samsung-back.svg-CzfVICvS.js} +1 -1
- package/web/assets/{computer-device-mobile-phone-android-samsung.svg-iIOhGZVY.js → computer-device-mobile-phone-android-samsung.svg-5mcZzPvQ.js} +1 -1
- package/web/assets/{computer-device-mobile-phone-iphone-x-back.svg-CLqnsMnT.js → computer-device-mobile-phone-iphone-x-back.svg-CovJE-GH.js} +1 -1
- package/web/assets/{computer-device-mobile-phone-iphone-x.svg-XECS9ZDX.js → computer-device-mobile-phone-iphone-x.svg-PgDuCiQq.js} +1 -1
- package/web/assets/{computer-device-mobile-tablet-touch.svg-CUR9IhGB.js → computer-device-mobile-tablet-touch.svg-1xFu6tBt.js} +1 -1
- package/web/assets/{computer-device-mobile-tablet.svg-BJGisjBt.js → computer-device-mobile-tablet.svg-lvKpoZnh.js} +1 -1
- package/web/assets/{computer-device-network-ethernet-cat6.svg-DzgiswAZ.js → computer-device-network-ethernet-cat6.svg-BJ6jNe-4.js} +1 -1
- package/web/assets/{computer-device-network-lan-www.svg-Dr1frFpv.js → computer-device-network-lan-www.svg-D2V9EO5w.js} +1 -1
- package/web/assets/{computer-device-network-wifi-connection.svg-DSj6qxT1.js → computer-device-network-wifi-connection.svg-DhFLYNK0.js} +1 -1
- package/web/assets/{computer-device-network-wifi-router.svg-8lGzw_-s.js → computer-device-network-wifi-router.svg-BGWV2N2B.js} +1 -1
- package/web/assets/{cssMode-sBjZEJAf.js → cssMode-Q_UQl6r1.js} +1 -1
- package/web/assets/{divider-p4BForJk.js → divider-D2zmU0b9.js} +2 -2
- package/web/assets/{docx-preview-D-bfEEBT.js → docx-preview-CAEo0pZg.js} +1 -1
- package/web/assets/{ecology-science-erlenmeyer-flask.svg-DhxVJRJ1.js → ecology-science-erlenmeyer-flask.svg-D4Cb7DOj.js} +1 -1
- package/web/assets/{fieldset-CCZ1tJUm.js → fieldset-CvPPXvgb.js} +2 -2
- package/web/assets/{freemarker2-C8iPD1fo.js → freemarker2-CCRi9jHA.js} +1 -1
- package/web/assets/{handlebars-BbBZAhwL.js → handlebars-4FU6Ze_N.js} +1 -1
- package/web/assets/{html-BQ_SV3Jd.js → html-1I40tTPC.js} +1 -1
- package/web/assets/{htmlMode-DReHoZFB.js → htmlMode-DQrNrxvx.js} +1 -1
- package/web/assets/{image-flash-lightning.svg-DbKHX2c2.js → image-flash-lightning.svg-Bh48o-tL.js} +1 -1
- package/web/assets/{image-picture-flower.svg-CEpqP8le.js → image-picture-flower.svg-CE0C3oid.js} +1 -1
- package/web/assets/{index-PMr5ScNs.js → index-SrQFBx_K.js} +36 -36
- package/web/assets/{interface-alert-exclamation-diamond.svg-CoNNtahD.js → interface-alert-exclamation-diamond.svg-Dzt9JrNZ.js} +1 -1
- package/web/assets/{interface-alert-exclamation-triangle-warning.svg-BHa7AW0u.js → interface-alert-exclamation-triangle-warning.svg-CET5JCIK.js} +1 -1
- package/web/assets/{interface-alert-information-circle.svg-CpRzO-l8.js → interface-alert-information-circle.svg-GX_R0hCS.js} +1 -1
- package/web/assets/{interface-award-crown.svg-BFOXAZFu.js → interface-award-crown.svg-BUS_3snr.js} +1 -1
- package/web/assets/{interface-bookmark.svg-DulnuoPg.js → interface-bookmark-tag.svg-GOtO3ous.js} +1 -1
- package/web/assets/{interface-bookmark-tag.svg-DpZGlSV4.js → interface-bookmark.svg-B1HfpZ9v.js} +1 -1
- package/web/assets/{interface-calendar-date-one.svg-CWQHbXWQ.js → interface-calendar-date-one.svg-W8G2NQFL.js} +1 -1
- package/web/assets/{interface-content-book-open-pages.svg-BH97UDUJ.js → interface-content-book-open-pages.svg-0dUMuEJV.js} +1 -1
- package/web/assets/{interface-content-book-page.svg-DmnJkpeN.js → interface-content-book-page.svg-BZ9dLtQQ.js} +1 -1
- package/web/assets/{interface-content-file.svg-DkouOQzj.js → interface-content-file.svg-C5JU1QaC.js} +1 -1
- package/web/assets/interface-content-folder.svg-BZAP22kT.js +1 -0
- package/web/assets/{interface-content-folder.svg-DK2esxIw.js → interface-content-folder.svg-DeWnODx9.js} +1 -1
- package/web/assets/{interface-copy-clipboard.svg-DuwyZprv.js → interface-copy-clipboard.svg-DneOONZN.js} +1 -1
- package/web/assets/{interface-edit-attachment.svg-C4lXPh7a.js → interface-edit-attachment.svg-BUDutqFa.js} +1 -1
- package/web/assets/{interface-edit-binocular.svg-CuA4f4ED.js → interface-edit-binocular.svg-DQ_sVWUa.js} +1 -1
- package/web/assets/{interface-edit-magic-wand.svg-D-Cc4zpI.js → interface-edit-magic-wand.svg-BqDEUbja.js} +1 -1
- package/web/assets/{interface-edit-tool-paint-roller.svg-MtAeMQ6k.js → interface-edit-tool-paint-roller.svg-CcbJr-sE.js} +1 -1
- package/web/assets/{interface-edit-tool-pencil.svg-ZAP8C3Sw.js → interface-edit-tool-pencil.svg-Dlmq9sMb.js} +1 -1
- package/web/assets/{interface-favorite-award.svg-DRZh5var.js → interface-favorite-award.svg-CfRf16yB.js} +1 -1
- package/web/assets/{interface-favorite-flag.svg-Dy0qBZak.js → interface-favorite-flag.svg-BeXa9l_o.js} +1 -1
- package/web/assets/{interface-favorite-heart.svg-Cjxi5AEp.js → interface-favorite-heart.svg-DWDXtfc-.js} +1 -1
- package/web/assets/{interface-favorite-star.svg-B1OPbNTd.js → interface-favorite-star.svg-D0my2O2z.js} +1 -1
- package/web/assets/{interface-favorite-stars-sparkles.svg-CvnZTUkf.js → interface-favorite-stars-sparkles.svg-DwnkpORM.js} +1 -1
- package/web/assets/{interface-hierarchy-flowchart.svg-GGCH0pvQ.js → interface-hierarchy-flowchart.svg-BS1qAEvQ.js} +1 -1
- package/web/assets/{interface-home-house.svg-DB_dC7eo.js → interface-home-house.svg-ByCGOgtp.js} +1 -1
- package/web/assets/{interface-hyperlink.svg-LlMqAHmb.js → interface-hyperlink.svg-D0RP2diO.js} +1 -1
- package/web/assets/{interface-lighting-brightness.svg-DutEgNfQ.js → interface-lighting-brightness.svg-B7Wir9fI.js} +1 -1
- package/web/assets/{interface-lock-closed.svg-DteyBWrL.js → interface-lock-closed.svg-D93wzWGY.js} +1 -1
- package/web/assets/{interface-lock-open-unlock.svg-D2g-W1Mn.js → interface-lock-open-unlock.svg-CEbreK15.js} +1 -1
- package/web/assets/{interface-login-key.svg-Dk1JjhYH.js → interface-login-key.svg-a_CUiiRx.js} +1 -1
- package/web/assets/{interface-search.svg-CDHAdhLc.js → interface-search.svg-CP6bN80a.js} +1 -1
- package/web/assets/{interface-setting-cog.svg-BXKxgm-B.js → interface-setting-cog.svg-C1yqB1H3.js} +1 -1
- package/web/assets/{interface-share-megaphone-bullhorn.svg-Fq3c3_sE.js → interface-share-megaphone-bullhorn.svg-BpEzN7dc.js} +1 -1
- package/web/assets/{interface-share-rocket.svg-BBIuiQ8_.js → interface-share-rocket.svg-CZTpH2do.js} +1 -1
- package/web/assets/{interface-share-satellite.svg-LZRzoY-Y.js → interface-share-satellite.svg-CDpvXyTq.js} +1 -1
- package/web/assets/{interface-share-space-ship.svg-C6EewxDh.js → interface-share-space-ship.svg-QXv4WQWa.js} +1 -1
- package/web/assets/{interface-share.svg-Bj60UW_t.js → interface-share.svg-DO9f8_w3.js} +1 -1
- package/web/assets/{interface-signal-square.svg-wJGg3ZJ7.js → interface-signal-square.svg-Dpbb94dT.js} +1 -1
- package/web/assets/{interface-time-clock-circle.svg-C2Ki_bgh.js → interface-time-clock-circle.svg-BOM8J4p-.js} +1 -1
- package/web/assets/{interface-time-hour-glass.svg-BeaTe2YW.js → interface-time-hour-glass.svg-B4wmuGrS.js} +1 -1
- package/web/assets/{interface-users-multiple.svg-ZNPhOLEJ.js → interface-users-multiple.svg-CX6Z1IAw.js} +1 -1
- package/web/assets/{interface-weather-moon.svg-CzOxK1E2.js → interface-weather-moon.svg-VjaROepI.js} +1 -1
- package/web/assets/{javascript-CV2jmATe.js → javascript-dnJjMqJl.js} +1 -1
- package/web/assets/{jsonMode-BpNATOZn.js → jsonMode-DIklAZzl.js} +2 -2
- package/web/assets/{liquid-Bkbhlfu6.js → liquid-DM3-T0fg.js} +1 -1
- package/web/assets/{lspLanguageFeatures-BIiCr6WR.js → lspLanguageFeatures-DtduOI48.js} +3 -3
- package/web/assets/{mail-chat-bubble-square.svg-B-R9ItyG.js → mail-chat-bubble-square.svg-BtQmLgyl.js} +1 -1
- package/web/assets/{mail-send-email-paper-airplane.svg-F4sC3JuQ.js → mail-send-email-paper-airplane.svg-DBzfHbzK.js} +1 -1
- package/web/assets/{mail-send-envelope.svg-BaE9bGol.js → mail-send-envelope.svg-ByoaJJai.js} +1 -1
- package/web/assets/{mdx-CsTzsRLc.js → mdx-COmjqkAf.js} +1 -1
- package/web/assets/{minus-CsIPqtIl.js → minus-CLTSMcUf.js} +2 -2
- package/web/assets/modal-BaVGcm8s.js +1 -0
- package/web/assets/modal-Cl434j6P.js +5 -0
- package/web/assets/{money-cashier-receipt.svg-C8rqn3qa.js → money-cashier-receipt.svg-D3I5UkrO.js} +1 -1
- package/web/assets/{money-currency-dollar-pay.svg-BW5dnMxx.js → money-currency-dollar-pay.svg-BEt_zoFT.js} +1 -1
- package/web/assets/{money-graph-arrow-increase.svg-fHNc8kor.js → money-graph-arrow-increase.svg-BFgo8Syp.js} +1 -1
- package/web/assets/{money-graph-bar-chart-increase.svg-65H_xZ15.js → money-graph-bar-chart-increase.svg-BPBRyqtM.js} +1 -1
- package/web/assets/{multiselect-Z0owdrkn.js → multiselect-Bd1n3-4t.js} +3 -3
- package/web/assets/{nature-ecology-leaf.svg-BIZVZEYz.js → nature-ecology-leaf.svg-DCIaflet.js} +1 -1
- package/web/assets/{password-Be5EVCzq.js → password-kxqyN9bC.js} +4 -4
- package/web/assets/{phone-telephone.svg-B1dHjXge.js → phone-telephone.svg-_P3X_Fym.js} +1 -1
- package/web/assets/{plus-BY4yX4ZS.js → plus-Cs39ICwL.js} +6 -6
- package/web/assets/process.store-m5afcW9w.js +1 -0
- package/web/assets/{programming-bug.svg-DJHBIgCF.js → programming-bug.svg-BGbIcZnS.js} +1 -1
- package/web/assets/{programming-cloud.svg-26MWe8cC.js → programming-cloud.svg-8TyU38aV.js} +1 -1
- package/web/assets/{programming-computer-database-server.svg-Dy7gdMab.js → programming-computer-database-server.svg-DBxTrFCn.js} +1 -1
- package/web/assets/{programming-computer-database.svg-3HsFit56.js → programming-computer-database.svg-Bi3RBUmB.js} +1 -1
- package/web/assets/{programming-module-four-layout.svg-CLumiwsC.js → programming-module-four-layout.svg-BicMHalL.js} +1 -1
- package/web/assets/{programming-module-three.svg-3DvVSvY_.js → programming-module-three.svg-D13tfKhT.js} +1 -1
- package/web/assets/{programming-module.svg-CgtgW8TW.js → programming-module.svg-HJDv8jeZ.js} +1 -1
- package/web/assets/{programming-script-code.svg-DdeXzy2-.js → programming-script-code.svg-oXFzvCKr.js} +1 -1
- package/web/assets/project-launch.store-Cgu622KX.js +1 -0
- package/web/assets/project.store-CM-kT9-z.js +1 -0
- package/web/assets/{python-YqWM3LFr.js → python-ejRXAr81.js} +1 -1
- package/web/assets/{radiobutton-Pm1c37Fw.js → radiobutton-BWBirQno.js} +2 -2
- package/web/assets/{razor-BtNiyC__.js → razor-CbzUoARP.js} +1 -1
- package/web/assets/router-o5ycRaEE.js +1 -0
- package/web/assets/settings-scope-CSLK3J2k.js +1 -0
- package/web/assets/settings.store-DDQmm1ig.js +1 -0
- package/web/assets/{shopping-cart.svg-ejbEU5yG.js → shopping-cart.svg-DL2Mf0BX.js} +1 -1
- package/web/assets/{shopping-gift-present.svg-RLuyvmga.js → shopping-gift-present.svg-keqzudV3.js} +1 -1
- package/web/assets/{shopping-shipping-box-parcel-package.svg-0GduEUbl.js → shopping-shipping-box-parcel-package.svg-BZ0Ri9AV.js} +1 -1
- package/web/assets/src-C1fYy9Ht.js +572 -0
- package/web/assets/src-DnhPQBBB.js +1 -0
- package/web/assets/{tabpanel-CssLXh-h.js → tabpanel-Bdw_XASI.js} +3 -3
- package/web/assets/{tag-new-circle.svg-CEdgH15R.js → tag-new-circle.svg-7tUBDDe7.js} +1 -1
- package/web/assets/theme-COzp71lh.js +1 -0
- package/web/assets/{toggleswitch-CEiGEBl3.js → toggleswitch-BhJmSx1t.js} +2 -2
- package/web/assets/{travel-map-earth-globe.svg-Dmwx1Lus.js → travel-map-earth-globe.svg-CfJb5_3k.js} +1 -1
- package/web/assets/trpc-Bn_6G8HK.js +1 -0
- package/web/assets/{tsMode-DpPT4F6s.js → tsMode-D5Gulgwd.js} +5 -5
- package/web/assets/{typescript-DoO0syM1.js → typescript-B73-3GtI.js} +1 -1
- package/web/assets/useAiChatDrawer-QOflawaX.js +1 -0
- package/web/assets/useCloudOrg-BZNmQ2Ek.js +1 -0
- package/web/assets/useEnvVarAutocomplete-DAxcV0jl.js +1 -0
- package/web/assets/useProjectCatalog-8u5wFtf-.js +1 -0
- package/web/assets/{useProjectCloudOrg-CG7seJKu.js → useProjectCloudOrg-Bkja4sed.js} +1 -1
- package/web/assets/useServiceUrlHost-biHEzQVv.js +1 -0
- package/web/assets/{xml-FoCdWVvH.js → xml-Mkua9fdo.js} +1 -1
- package/web/assets/{yaml-CgRsanOy.js → yaml-BP9pkdmT.js} +1 -1
- package/web/index.html +1 -1
- package/chunk-4PN7QBNM.js.map +0 -1
- package/chunk-GKK3ACWB.js.map +0 -1
- package/chunk-H22YLVQE.js.map +0 -1
- package/chunk-T2BV5WZE.js.map +0 -1
- package/src-SGSG2RSF.js.map +0 -1
- package/web/assets/AgentScalarChatInterface.vue-Bv7WQetq.js +0 -13
- package/web/assets/AgentTerminalPage-CMA5oI2T.js +0 -1
- package/web/assets/AiChatPage-C0Ho1rG3.js +0 -1
- package/web/assets/AppLayout-DBKRAp0R.js +0 -1
- package/web/assets/AuditPage-fZVhSJlE.js +0 -1
- package/web/assets/CloudAccountPage-2LiTQCKr.js +0 -1
- package/web/assets/CloudAccountPage-CunPTy1b.js +0 -1
- package/web/assets/CloudMessagingPage-DWciFn32.js +0 -2
- package/web/assets/DashboardPage-3psdQljM.js +0 -164
- package/web/assets/DashboardPage-DFaiJ4c-.css +0 -1
- package/web/assets/DirectoryPickerDialog-DiiAUQKg.js +0 -1
- package/web/assets/EnvironmentForm-MRC8U5op.js +0 -108
- package/web/assets/EnvironmentFormPage-gd8fGS8P.js +0 -1
- package/web/assets/EnvironmentListPage-DgbclvZs.js +0 -1
- package/web/assets/KanbanBoardPage-BBT0gqjT.js +0 -4
- package/web/assets/KanbanListPage-CidIQgAq.js +0 -1
- package/web/assets/LaunchProjectPage-DBtkrI-A.js +0 -1
- package/web/assets/LaunchServicesPage-DdmfVxYL.js +0 -1
- package/web/assets/LaunchServicesPage-zR9FoF4q.css +0 -1
- package/web/assets/LogViewer-CvDPgFjq.js +0 -3
- package/web/assets/OrgKeyPrompt-D3RmJEtb.js +0 -1
- package/web/assets/ProcessDetailPage-Dj0L8Jz0.js +0 -1
- package/web/assets/RandomJobTestPage-ohHAOaio.js +0 -2
- package/web/assets/ScenarioEditorPage-BIcmG3wo.js +0 -14
- package/web/assets/SendToChatDialog-oi4KFAVq.js +0 -1
- package/web/assets/ServiceControlsBar-BtnWYJmp.css +0 -1
- package/web/assets/ServiceControlsBar-GgoPszoH.js +0 -1
- package/web/assets/ServiceDetailPage-CIDlO0iu.js +0 -2
- package/web/assets/ServiceFormPage-p3AUhHLN.js +0 -1
- package/web/assets/SettingsPage-B_heumvd.js +0 -2063
- package/web/assets/UnlockPage-nz_1VQWy.js +0 -1
- package/web/assets/VaultMigrationPage-B_nZC8Cc.js +0 -1
- package/web/assets/VersionBadge-DJJK7bgD.js +0 -1
- package/web/assets/WikiPage-DiCUjWEu.js +0 -1
- package/web/assets/WikiView-vYMnLt41.js +0 -1
- package/web/assets/add-scalar-classes-_7NDhIUO.js +0 -387
- package/web/assets/client-DHQNUKOx.js +0 -24
- package/web/assets/cloud-chat.store-CaSRn8Mg.js +0 -1
- package/web/assets/cloud-client-CzGojtBl.js +0 -1
- package/web/assets/cloud-session-D71P4F3g.js +0 -2
- package/web/assets/cloud-session-DlLnrwVQ.js +0 -1
- package/web/assets/column-CjJa3tsz.js +0 -763
- package/web/assets/interface-content-folder.svg-BLBb2W1v.js +0 -1
- package/web/assets/modal-B_0-h4nC.js +0 -1
- package/web/assets/modal-KwmdNF_4.js +0 -5
- package/web/assets/process.store-B-PvNJQb.js +0 -1
- package/web/assets/project-launch.store-DtFeb4vv.js +0 -1
- package/web/assets/project.store-DcaBpnnB.js +0 -1
- package/web/assets/router-DnVYXVMw.js +0 -1
- package/web/assets/settings-scope-DR8NUZr5.js +0 -1
- package/web/assets/settings.store-CniuNQ3t.js +0 -1
- package/web/assets/src-BS3JGGS_.js +0 -1
- package/web/assets/src-BzZzroPd.js +0 -572
- package/web/assets/theme-C7HVmgEO.js +0 -1
- package/web/assets/trpc-C6zILEMh.js +0 -1
- package/web/assets/useAiChatDrawer-CnrYG1GW.js +0 -1
- package/web/assets/useCloudOrg-DWmP9gqs.js +0 -1
- package/web/assets/useEnvVarAutocomplete-Dkx7Cn9l.js +0 -1
- package/web/assets/useProjectCatalog-Cu3VZu2F.js +0 -1
- package/web/assets/useServiceUrlHost-ADKWqhx0.js +0 -1
- /package/{settings-manager-MAVD4GAS.js.map → agent-manager-QLXVQ7OD.js.map} +0 -0
- /package/{companion-OZODV5BR.js.map → chat-ODBVFMKX.js.map} +0 -0
- /package/{chunk-N3ZI35SC.js.map → chunk-K7A3Q62R.js.map} +0 -0
- /package/{chat-JIJQ7IJS.js.map → companion-5DPH3HIO.js.map} +0 -0
- /package/{desktop-launcher-EGGVXXKV.js.map → desktop-launcher-J2BCSSGZ.js.map} +0 -0
- /package/{agent-manager-FZFFWISA.js.map → settings-manager-E3L56VAY.js.map} +0 -0
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
runCompanionNow,
|
|
32
32
|
syncConversationFromClaudeTranscript,
|
|
33
33
|
verifyJwt
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-SG2ACPOE.js";
|
|
35
35
|
import {
|
|
36
36
|
StoreDiskCoordinator,
|
|
37
37
|
agentManager,
|
|
@@ -50,10 +50,10 @@ import {
|
|
|
50
50
|
recordLocalRemoval,
|
|
51
51
|
refsOfProjectId,
|
|
52
52
|
serviceStore
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-WLZQDWJT.js";
|
|
54
54
|
import {
|
|
55
55
|
settingsManager
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-K7A3Q62R.js";
|
|
57
57
|
import {
|
|
58
58
|
atomicWriteJsonSecure,
|
|
59
59
|
atomicWriteSecure,
|
|
@@ -67,26 +67,33 @@ import {
|
|
|
67
67
|
import {
|
|
68
68
|
AGENT_STOP_FETCH_TIMEOUT,
|
|
69
69
|
ApiKeysFileSchema,
|
|
70
|
+
BUILTIN_VARIABLES,
|
|
71
|
+
BootstrapCommandSchema,
|
|
70
72
|
DockerConfigSchema,
|
|
71
73
|
HealthCheckSchema,
|
|
72
74
|
JSLogParserSchema,
|
|
73
75
|
LogSourceConfigSchema,
|
|
76
|
+
MASKED_VALUE,
|
|
74
77
|
MissingVariableSchema,
|
|
75
78
|
RestartStrategySchema,
|
|
76
79
|
ScenarioSchema,
|
|
77
80
|
ServiceCommandSchema,
|
|
81
|
+
ServiceConfigSchema,
|
|
78
82
|
ServiceShortcutSchema,
|
|
79
83
|
ambiguousServiceSlugs,
|
|
80
84
|
crossServiceValues,
|
|
85
|
+
findUnresolvedReferences,
|
|
81
86
|
interpolateBuiltinsInEnv,
|
|
82
87
|
isSharedWithAi,
|
|
88
|
+
maskLogSourceSecrets,
|
|
83
89
|
nativeParsers,
|
|
90
|
+
restoreLogSourceSecrets,
|
|
84
91
|
servicePortValues,
|
|
85
92
|
serviceSlug,
|
|
86
93
|
serviceUrlValues,
|
|
87
94
|
urlHostFor,
|
|
88
95
|
withDeprecatedAliases
|
|
89
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-TTPL2M74.js";
|
|
90
97
|
import {
|
|
91
98
|
allVaultRoots,
|
|
92
99
|
env,
|
|
@@ -101,7 +108,7 @@ import {
|
|
|
101
108
|
} from "./chunk-ZFELQG4B.js";
|
|
102
109
|
|
|
103
110
|
// ../server/src/trpc/routers/chat.ts
|
|
104
|
-
import { z as
|
|
111
|
+
import { z as z9 } from "zod";
|
|
105
112
|
import Anthropic2 from "@anthropic-ai/sdk";
|
|
106
113
|
import OpenAI2 from "openai";
|
|
107
114
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
@@ -824,7 +831,6 @@ function slotReferenceText(variable) {
|
|
|
824
831
|
${slot.value}
|
|
825
832
|
${slot.post}`;
|
|
826
833
|
}
|
|
827
|
-
var MASKED_VALUE = "***";
|
|
828
834
|
var HIDDEN_VALUES_NOTICE = `Values shown as ${MASKED_VALUE} are secrets their author did not share with AI. The service does receive them: never treat such a key as missing, and never pass ${MASKED_VALUE} as its value.`;
|
|
829
835
|
function filterEnvForAi(resolved, sharedKeys) {
|
|
830
836
|
const secret = new Set(resolved.envSecrets);
|
|
@@ -1169,8 +1175,8 @@ var EnvironmentResolver = class {
|
|
|
1169
1175
|
return secretKeys;
|
|
1170
1176
|
}
|
|
1171
1177
|
interpolatesSecretKey(rawValue, ctxSecretKeys) {
|
|
1172
|
-
const
|
|
1173
|
-
return
|
|
1178
|
+
const refs2 = [...rawValue.matchAll(/\{\{environment\.([^}]+)\}\}/g)].map((m) => m[1]);
|
|
1179
|
+
return refs2.some((ref) => ctxSecretKeys.has(ref));
|
|
1174
1180
|
}
|
|
1175
1181
|
/**
|
|
1176
1182
|
* Build the interpolation context for an environment.
|
|
@@ -1374,6 +1380,7 @@ var EnvironmentResolver = class {
|
|
|
1374
1380
|
var environmentResolver = new EnvironmentResolver();
|
|
1375
1381
|
|
|
1376
1382
|
// ../../packages/ai-capabilities/src/capabilities.ts
|
|
1383
|
+
import { z as z3 } from "zod";
|
|
1377
1384
|
function toList(raw) {
|
|
1378
1385
|
if (!raw) return [];
|
|
1379
1386
|
const text = raw.trim();
|
|
@@ -1400,9 +1407,107 @@ function gitTarget(p) {
|
|
|
1400
1407
|
...p.orgId ? { orgId: p.orgId } : {}
|
|
1401
1408
|
};
|
|
1402
1409
|
}
|
|
1410
|
+
var toBool = (raw) => raw.trim().toLowerCase() === "true";
|
|
1411
|
+
var newId = () => globalThis.crypto.randomUUID();
|
|
1412
|
+
function listItem(raw) {
|
|
1413
|
+
try {
|
|
1414
|
+
return JSON.parse(raw);
|
|
1415
|
+
} catch {
|
|
1416
|
+
return raw;
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
function parseTyped(name, schema, raw) {
|
|
1420
|
+
if (raw === void 0) return void 0;
|
|
1421
|
+
let result = raw.trim() === "null" ? schema.safeParse(null) : schema.safeParse(raw);
|
|
1422
|
+
if (!result.success && raw.trim() === "null") result = schema.safeParse(raw);
|
|
1423
|
+
if (!result.success) {
|
|
1424
|
+
const text = raw.trim();
|
|
1425
|
+
const json = listItem(text);
|
|
1426
|
+
if (json !== text) result = schema.safeParse(json);
|
|
1427
|
+
if (!result.success && !/^[[{]/.test(text)) {
|
|
1428
|
+
const list = schema.safeParse(toList(text).map(listItem));
|
|
1429
|
+
if (list.success) result = list;
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
if (!result.success) throw new Error(`${name}: ${z3.prettifyError(result.error)}`);
|
|
1433
|
+
return result.data;
|
|
1434
|
+
}
|
|
1435
|
+
function withIds(items) {
|
|
1436
|
+
return items.map((item) => ({ ...item, id: item.id || newId() }));
|
|
1437
|
+
}
|
|
1438
|
+
var optionalId = (schema) => schema.extend({ id: z3.string().min(1).max(64).optional() });
|
|
1439
|
+
var DockerConfigInput = DockerConfigSchema.extend({
|
|
1440
|
+
bootstrapCommands: z3.array(optionalId(BootstrapCommandSchema)).max(20).default([])
|
|
1441
|
+
}).refine((c) => !!c.image !== !!c.dockerfile, {
|
|
1442
|
+
message: 'dockerConfig needs exactly one of "image" (an image to pull) or "dockerfile" (a Dockerfile to build)'
|
|
1443
|
+
});
|
|
1444
|
+
var SERVICE_FIELDS = [
|
|
1445
|
+
{ name: "description", description: "What the service is, in a sentence" },
|
|
1446
|
+
{ name: "agentId", description: "The agent that runs it, from list_agents. Omit to inherit from the environment.", clearable: true },
|
|
1447
|
+
{ name: "cwd", description: `Working directory, RELATIVE to the project root (e.g. "apps/web", or omit for the root). The project is synced between machines and lives in a different folder on each: Runeya resolves a relative cwd against each machine's own project folder, while an absolute path (/home/you/\u2026) breaks on every other machine. Use an absolute path only for something outside the project, written with ~ or an environment variable ($NAME) rather than a literal home directory.`, clearable: true },
|
|
1448
|
+
{ name: "command", description: 'Shortcut for a single command line (e.g. "npm run dev"). Replaces every existing command. Use commands for several.' },
|
|
1449
|
+
{ name: "commands", description: 'The processes of the service. They all start AT THE SAME TIME, in parallel, and the service runs while they run \u2014 not one after another. Use several for processes that live side by side (a web server and a worker). Steps that must follow each other (build, then install, then launch) go in ONE command chained with &&. A one-off action the user triggers by hand (build, deploy, read logs) is a shortcut, not a command. Each command runs in the service cwd, or its own "cwd", relative to the project root. No absolute paths of this machine: the service is synced to other machines. Replaces every existing command. "id" is generated when omitted; "shell" runs the line through a shell (default true).', schema: z3.array(optionalId(ServiceCommandSchema)).max(50) },
|
|
1450
|
+
{ name: "ports", description: "Ports the service listens on. Declare them: they become {{service.PORT}}, {{service.URL}} and {{services.<slug>.URL}} for the other services, which environment variables should reference instead of repeating the numbers.", schema: ServiceConfigSchema.shape.ports.unwrap().unwrap() },
|
|
1451
|
+
{ name: "groups", description: "Groups the service belongs to. Replaces the current ones.", schema: ServiceConfigSchema.shape.groups.unwrap().unwrap() },
|
|
1452
|
+
{ name: "url", description: "URL where the service is reached" },
|
|
1453
|
+
{ name: "localUrls", description: 'Local domain names routed to a port of the service (e.g. {"url":"api.localhost.dev","port":3000})', schema: ServiceConfigSchema.shape.localUrls.unwrap().unwrap() },
|
|
1454
|
+
{ name: "openapiUrl", description: "URL of its OpenAPI document" },
|
|
1455
|
+
{ name: "docsPath", description: "Where its markdown docs live, relative to cwd or absolute. Defaults to cwd." },
|
|
1456
|
+
{ name: "git", description: 'Its git repository: "remote" URL and "home" page', schema: ServiceConfigSchema.shape.git.unwrap(), clearable: true },
|
|
1457
|
+
{ name: "meta", description: "Free key/value metadata (strings)", schema: ServiceConfigSchema.shape.meta.unwrap(), clearable: true },
|
|
1458
|
+
{ name: "runner", description: '"native" runs the commands on the machine; "docker" runs the service in a container and then needs dockerConfig', schema: ServiceConfigSchema.shape.runner.unwrap().unwrap() },
|
|
1459
|
+
{ name: "dockerConfig", description: 'With runner "docker": the container. Exactly one of "image" (pull) or "dockerfile" (inline Dockerfile, built with "buildContext", "buildArgs", "targetStage"). Ports and volumes use Docker syntax ("8080:80", "./data:/data"); host paths in volumes relative to the service directory, never an absolute path of this machine. "useNativeCommand" runs the service commands inside the container instead of its CMD ("nativeCommandMode": one shared container or one per command). "bootstrapCommands" run once when the container starts. Replaces the whole Docker configuration: read it first with get_service to keep what you do not change.', schema: DockerConfigInput },
|
|
1460
|
+
{ name: "healthCheck", description: 'How to tell the service is ready: an HTTP "path" to call, or a "command" that must succeed', schema: HealthCheckSchema, clearable: true },
|
|
1461
|
+
{ name: "autoRestart", description: "Restart the service when it crashes", schema: z3.boolean() },
|
|
1462
|
+
{ name: "restartStrategy", description: "When to restart it", schema: RestartStrategySchema.unwrap() },
|
|
1463
|
+
{ name: "maxRestarts", description: "Give up after this many restarts", schema: ServiceConfigSchema.shape.maxRestarts.unwrap() },
|
|
1464
|
+
{ name: "restartBackoffMs", description: "Delay before a restart, in milliseconds", schema: ServiceConfigSchema.shape.restartBackoffMs.unwrap().unwrap() },
|
|
1465
|
+
{ name: "clearLogsOnStart", description: "Clear the logs each time the service starts", schema: z3.boolean() },
|
|
1466
|
+
{ name: "shortcuts", description: 'One-click actions shown on the service, run on demand and independently of the running commands (build, deploy, migrate, read logs). Same path rules as commands: relative to the project root, never an absolute path of this machine. Replaces the current ones. "id" is generated when omitted.', schema: z3.array(optionalId(ServiceShortcutSchema)).max(50) },
|
|
1467
|
+
{ name: "parserIds", description: "Log parsers applied to its output, by id", schema: ServiceConfigSchema.shape.parserIds.unwrap() },
|
|
1468
|
+
{ name: "logSources", description: 'Extra log sources beyond the console output (files, databases\u2026). Replaces the current ones. Credentials (mongo connectionString, mysql password) read as "***": send "***" back to keep the stored value, or the real value to change it.', schema: ServiceConfigSchema.shape.logSources.unwrap().unwrap() }
|
|
1469
|
+
];
|
|
1470
|
+
function serviceParams(clearable2) {
|
|
1471
|
+
return SERVICE_FIELDS.map((f) => {
|
|
1472
|
+
const nullable = clearable2 && f.clearable;
|
|
1473
|
+
const base = f.schema ?? (nullable ? z3.string() : void 0);
|
|
1474
|
+
return {
|
|
1475
|
+
name: f.name,
|
|
1476
|
+
description: nullable ? `${f.description} null clears it.` : f.description,
|
|
1477
|
+
required: false,
|
|
1478
|
+
...base ? { schema: nullable ? base.nullable() : base } : {}
|
|
1479
|
+
};
|
|
1480
|
+
});
|
|
1481
|
+
}
|
|
1482
|
+
function serviceFields(p, params) {
|
|
1483
|
+
const out = {};
|
|
1484
|
+
for (const param of params) {
|
|
1485
|
+
if (p[param.name] === void 0 || param.name === "command") continue;
|
|
1486
|
+
out[param.name] = param.schema ? parseTyped(param.name, param.schema, p[param.name]) : p[param.name];
|
|
1487
|
+
}
|
|
1488
|
+
if (p.command !== void 0 && p.commands === void 0) out["commands"] = [{ label: "", command: p.command, shell: true }];
|
|
1489
|
+
if (Array.isArray(out["commands"])) out["commands"] = withIds(out["commands"]);
|
|
1490
|
+
if (Array.isArray(out["shortcuts"])) out["shortcuts"] = withIds(out["shortcuts"]);
|
|
1491
|
+
const docker = out["dockerConfig"];
|
|
1492
|
+
if (docker?.bootstrapCommands) out["dockerConfig"] = { ...docker, bootstrapCommands: withIds(docker.bootstrapCommands) };
|
|
1493
|
+
return out;
|
|
1494
|
+
}
|
|
1495
|
+
function maskServices(result) {
|
|
1496
|
+
if (Array.isArray(result)) return result.map(maskServices);
|
|
1497
|
+
if (result && typeof result === "object" && Array.isArray(result.logSources)) {
|
|
1498
|
+
const service = result;
|
|
1499
|
+
return { ...service, logSources: maskLogSourceSecrets(service.logSources) };
|
|
1500
|
+
}
|
|
1501
|
+
return result;
|
|
1502
|
+
}
|
|
1503
|
+
var refs = (scope) => BUILTIN_VARIABLES.filter((b) => b.scope === scope).map((b) => `{{${b.name}}}`).join(", ");
|
|
1504
|
+
var BUILTINS_HELP = `Built-in references Runeya fills itself \u2014 filled when the service is deployed, from the service that receives the variable: ${refs("server")}, the numbered {{service.PORT_2}} / {{service.URL_2}}\u2026 for its other ports, and {{services.<slug>.PORT}}, .URL, .BASE_URL, .NAME, .ID for a sibling service of the project (slug = its name in lowercase-dashes). Filled on the machine when the service starts: ${refs("agent")}.`;
|
|
1505
|
+
var CREATE_SERVICE_PARAMS = serviceParams(false);
|
|
1506
|
+
var UPDATE_SERVICE_PARAMS = serviceParams(true);
|
|
1403
1507
|
var RUNEYA_CAPABILITIES = [
|
|
1404
1508
|
{
|
|
1405
1509
|
name: "list_services",
|
|
1510
|
+
transformOutput: maskServices,
|
|
1406
1511
|
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.",
|
|
1407
1512
|
route: "service.list",
|
|
1408
1513
|
method: "GET",
|
|
@@ -1688,8 +1793,8 @@ var RUNEYA_CAPABILITIES = [
|
|
|
1688
1793
|
},
|
|
1689
1794
|
// ─── Lecture seule ───────────────────────────────────────────────────────
|
|
1690
1795
|
//
|
|
1691
|
-
// Tout ce qui se consulte sans rien changer.
|
|
1692
|
-
//
|
|
1796
|
+
// Tout ce qui se consulte sans rien changer. Les écritures s'ajoutent au cas
|
|
1797
|
+
// par cas : aujourd'hui les services et leurs variables, plus bas.
|
|
1693
1798
|
//
|
|
1694
1799
|
// Volontairement absentes, et à ne pas ajouter sans y regarder à deux fois,
|
|
1695
1800
|
// parce qu'elles rendent un secret : `environment.list` / `get` / `resolve` /
|
|
@@ -1716,6 +1821,7 @@ var RUNEYA_CAPABILITIES = [
|
|
|
1716
1821
|
},
|
|
1717
1822
|
{
|
|
1718
1823
|
name: "get_service",
|
|
1824
|
+
transformOutput: maskServices,
|
|
1719
1825
|
description: "Read the full configuration of one service: its commands, ports, groups, runner, log sources and restart policy. list_services gives the ids.",
|
|
1720
1826
|
route: "service.get",
|
|
1721
1827
|
method: "GET",
|
|
@@ -1726,13 +1832,145 @@ var RUNEYA_CAPABILITIES = [
|
|
|
1726
1832
|
},
|
|
1727
1833
|
{
|
|
1728
1834
|
name: "get_service_env",
|
|
1729
|
-
description: 'Read the environment variables a service runs with, and the project\'s variable inventory. `env` lists every key the service receives; a value reads "***" when it is a secret whose author did not share it with AI (sharing = ticking "AI read", or injecting it into the agents\' environment, which grants reading too). `envSecrets` says which keys are secret, `hiddenKeys` which ones are masked. A masked key is set on the service: never treat it as missing, never suggest adding it, and never pass "***" as a value \u2014 ask the user for it. `variables` describes every variable of the project \u2014 which environment defines it and its scope, its description, its flags, whether this machine overrides it, and `inService: false` for the ones this service does not receive. Use it to say where a variable must be changed instead of guessing. On an overridden variable, `sharedValue` is what the machine-local override replaces (the team\'s value, masked as "***" when unreadable); no other value appears there.',
|
|
1835
|
+
description: 'Read the environment variables a service runs with, and the project\'s variable inventory. `env` lists every key the service receives; a value reads "***" when it is a secret whose author did not share it with AI (sharing = ticking "AI read", or injecting it into the agents\' environment, which grants reading too). `envSecrets` says which keys are secret, `hiddenKeys` which ones are masked. A masked key is set on the service: never treat it as missing, never suggest adding it, and never pass "***" as a value \u2014 ask the user for it. `variables` describes every variable of the project \u2014 which environment defines it and its scope, its description, its flags, whether this machine overrides it, and `inService: false` for the ones this service does not receive. Use it to say where a variable must be changed instead of guessing. On an overridden variable, `sharedValue` is what the machine-local override replaces (the team\'s value, masked as "***" when unreadable); no other value appears there. This is the resolver: the values are what the service would receive \u2014 inheritance, {{environment.KEY}} references, this machine\'s overrides and server built-ins applied; agent built-ins stay as written until the service starts. Use it to check a variable you just composed. `unresolvedReferences` lists references nothing will fill (a typo, a variable that does not exist): fix them.',
|
|
1730
1836
|
route: "service.getEnv",
|
|
1731
1837
|
method: "GET",
|
|
1732
1838
|
params: [
|
|
1733
|
-
{ name: "serviceId", description: "The service ID", required: true }
|
|
1839
|
+
{ name: "serviceId", description: "The service ID", required: true },
|
|
1840
|
+
{ name: "environmentId", description: "A global environment of the project to resolve in instead of the active one, without activating it (from list_environments). Omit for the active one.", required: false }
|
|
1734
1841
|
],
|
|
1735
|
-
buildInput: (p) => ({ id: p.serviceId })
|
|
1842
|
+
buildInput: (p) => ({ id: p.serviceId, ...p.environmentId ? { environmentId: p.environmentId } : {} })
|
|
1843
|
+
},
|
|
1844
|
+
// ─── Écrire un service et ses variables ────────────────────────────────────
|
|
1845
|
+
//
|
|
1846
|
+
// Les variables s'écrivent à l'aveugle (`environment.setVariableBlind`) : une
|
|
1847
|
+
// IA remplace la valeur d'un secret sans la lire, et ne peut ni le rendre
|
|
1848
|
+
// public, ni le partager avec les IA. La règle tient côté serveur, dans la
|
|
1849
|
+
// route ; ces outils ne passent jamais par une route qui renvoie des valeurs
|
|
1850
|
+
// (`upsertVariable`, `removeVariable`, `update` rendent l'environnement entier).
|
|
1851
|
+
{
|
|
1852
|
+
name: "create_service",
|
|
1853
|
+
transformOutput: maskServices,
|
|
1854
|
+
description: "Create a service, native or Docker, in a project: it joins the project and gets its environments in the same call. Pass the projectId your context names. Projects are synced between machines, so write paths relative to the project root and put machine-specific values (a device serial, a local token) in environment variables, referenced as $NAME in commands \u2014 see the cwd, commands and shortcuts parameters. Then set its variables with set_environment_variable.",
|
|
1855
|
+
route: "service.create",
|
|
1856
|
+
method: "POST",
|
|
1857
|
+
params: [
|
|
1858
|
+
{ name: "name", description: "The service name", required: true },
|
|
1859
|
+
{ name: "projectId", description: "The project it joins: the one your context names, or another from list_projects. Without it, the service belongs to no project.", required: false },
|
|
1860
|
+
{ name: "orgId", description: "Its organization. Needed only when the same project id exists in several.", required: false },
|
|
1861
|
+
...CREATE_SERVICE_PARAMS
|
|
1862
|
+
],
|
|
1863
|
+
buildInput: (p) => {
|
|
1864
|
+
const fields = serviceFields(p, CREATE_SERVICE_PARAMS);
|
|
1865
|
+
if (fields["runner"] === "docker" && !fields["dockerConfig"]) {
|
|
1866
|
+
throw new Error('dockerConfig: required with runner "docker" \u2014 give an "image" or a "dockerfile"');
|
|
1867
|
+
}
|
|
1868
|
+
return {
|
|
1869
|
+
name: p.name,
|
|
1870
|
+
...fields,
|
|
1871
|
+
...p.projectId ? { projectId: p.projectId } : {},
|
|
1872
|
+
...p.orgId ? { orgId: p.orgId } : {}
|
|
1873
|
+
};
|
|
1874
|
+
}
|
|
1875
|
+
},
|
|
1876
|
+
{
|
|
1877
|
+
name: "add_service_to_project",
|
|
1878
|
+
description: "Add an existing service to a project, and create its environments \u2014 one for each of the project's environments, where its own variables go. Not needed after create_service, which already does it; calling it again changes nothing.",
|
|
1879
|
+
route: "project.addService",
|
|
1880
|
+
method: "POST",
|
|
1881
|
+
params: [
|
|
1882
|
+
{ name: "projectId", description: "The project ID, from list_projects", required: true },
|
|
1883
|
+
{ name: "serviceId", description: "The service ID", required: true },
|
|
1884
|
+
{ name: "orgId", description: "Its organization. Needed only when the same project id exists in several.", required: false }
|
|
1885
|
+
],
|
|
1886
|
+
buildInput: (p) => ({ projectId: p.projectId, serviceId: p.serviceId, ...p.orgId ? { orgId: p.orgId } : {} })
|
|
1887
|
+
},
|
|
1888
|
+
{
|
|
1889
|
+
name: "update_service",
|
|
1890
|
+
transformOutput: maskServices,
|
|
1891
|
+
description: "Change any part of a service configuration \u2014 commands, ports, health check, restart policy, shortcuts, log sources, whether it runs natively or in Docker (runner, dockerConfig)\u2026 Only the fields you pass change; a list or an object you pass replaces the current one whole. Read the service first with get_service.",
|
|
1892
|
+
route: "service.update",
|
|
1893
|
+
method: "POST",
|
|
1894
|
+
params: [
|
|
1895
|
+
{ name: "serviceId", description: "The service ID", required: true },
|
|
1896
|
+
{ name: "name", description: "New name", required: false },
|
|
1897
|
+
{ name: "orgId", description: "Move the service to this organization vault. Leave unset unless asked.", required: false, schema: z3.string().max(128).nullable() },
|
|
1898
|
+
...UPDATE_SERVICE_PARAMS
|
|
1899
|
+
],
|
|
1900
|
+
buildInput: (p) => ({
|
|
1901
|
+
id: p.serviceId,
|
|
1902
|
+
...p.name ? { name: p.name } : {},
|
|
1903
|
+
...p.orgId !== void 0 ? { orgId: parseTyped("orgId", z3.string().max(128).nullable(), p.orgId) } : {},
|
|
1904
|
+
...serviceFields(p, UPDATE_SERVICE_PARAMS)
|
|
1905
|
+
})
|
|
1906
|
+
},
|
|
1907
|
+
{
|
|
1908
|
+
name: "list_environments",
|
|
1909
|
+
description: "List the environments of a project, with no value: each one's id, name and scope (global = shared by the whole project, service = one service's own variables), which global environment is active, which service a service environment belongs to and which global environment activates it, its parents (it inherits their variables), `isolated` when a service environment does not inherit from its global one, and the variables it defines with their flags. Empty environments are listed too \u2014 a service you just created has one per global environment, where its own variables go. Use it to find the environmentId before set_environment_variable.",
|
|
1910
|
+
route: "environment.listForAi",
|
|
1911
|
+
method: "GET",
|
|
1912
|
+
params: [
|
|
1913
|
+
{ name: "projectId", description: "The project ID: the one your context names, or another from list_projects", required: true },
|
|
1914
|
+
{ name: "orgId", description: "Its organization. Needed only when the same project id exists in several.", required: false }
|
|
1915
|
+
],
|
|
1916
|
+
buildInput: (p) => ({ projectId: p.projectId, ...p.orgId ? { orgId: p.orgId } : {} })
|
|
1917
|
+
},
|
|
1918
|
+
{
|
|
1919
|
+
name: "resolve_environment",
|
|
1920
|
+
description: "Resolve one environment alone \u2014 its variables with those inherited from its parents and this machine's overrides \u2014 as an AI may read it: secrets not shared with AI read \"***\". Built-in references ({{service.*}}, {{services.*}}, {{agent.*}}\u2026) are NOT filled, since they depend on the service that receives the variable; use get_service_env for a service's final values. `unresolvedReferences` lists references nothing will fill: a misspelled {{environment.KEY}}, or a name that is no built-in.",
|
|
1921
|
+
route: "environment.resolveForAi",
|
|
1922
|
+
method: "GET",
|
|
1923
|
+
params: [
|
|
1924
|
+
{ name: "environmentId", description: "The environment, from list_environments", required: true }
|
|
1925
|
+
],
|
|
1926
|
+
buildInput: (p) => ({ environmentId: p.environmentId })
|
|
1927
|
+
},
|
|
1928
|
+
{
|
|
1929
|
+
name: "set_environment_variable",
|
|
1930
|
+
description: `Create or change an environment variable, by name, in one environment \u2014 global or service, same rules for both. Find the environmentId with list_environments. Where it belongs: a value shared by several services (a database host, an API base URL) goes ONCE in the active global environment; services inherit it. A value only one service needs goes in that service's environment (scope service, activated by the active global one), where it also overrides a global variable of the same name. Never hardcode what Runeya already knows: a service's own port is {{service.PORT}}, its own URL {{service.URL}}, another service's address {{services.<slug>.URL}} \u2014 a copied "3210" or "http://localhost:3211" breaks as soon as a port changes or the project runs on another machine. If the port a variable needs is not declared on its service, declare it there (update_service, ports) instead of writing the number. When a written value contains a port or URL of a project service, the response lists \`suggestions\`: rewrite the value with those references. Compose instead of copying: a value can reference another variable of the resolved environment as {{environment.KEY}} (e.g. "postgres://{{environment.DB_USER}}@{{environment.DB_HOST}}:5432"). ${BUILTINS_HELP} After writing, check the result with get_service_env (a service, optionally in another global environment) or resolve_environment (an environment alone). References are substituted in one pass: a reference to a variable whose own value is only a reference may stay unexpanded, so point at the variable that holds the actual value. $NAME is not a reference here: it only expands inside a shell command. pre and post are concatenated around the value, each resolved separately. You can replace a secret's value without reading it, and create a variable as secret. You cannot make a secret public nor make it readable by AI: that stays the user's decision. Never pass "***" as a value. The response never contains the value.`,
|
|
1931
|
+
route: "environment.setVariableBlind",
|
|
1932
|
+
method: "POST",
|
|
1933
|
+
params: [
|
|
1934
|
+
{ name: "environmentId", description: "The environment that holds the variable, from list_environments", required: true },
|
|
1935
|
+
{ name: "key", description: "The variable name, e.g. DATABASE_URL", required: true },
|
|
1936
|
+
{ name: "value", description: "The new value, possibly with {{environment.KEY}} references. Omit to leave it unchanged.", required: false },
|
|
1937
|
+
{ name: "pre", description: 'Text put before the value (e.g. "https://"). Omit to leave it unchanged.', required: false },
|
|
1938
|
+
{ name: "post", description: 'Text put after the value (e.g. "/api"). Omit to leave it unchanged.', required: false },
|
|
1939
|
+
{ name: "isSecret", description: '"true" to store it as a secret. On an existing public variable, makes it secret.', required: false },
|
|
1940
|
+
{ name: "description", description: "What the variable is for, in markdown", required: false }
|
|
1941
|
+
],
|
|
1942
|
+
buildInput: (p) => ({
|
|
1943
|
+
environmentId: p.environmentId,
|
|
1944
|
+
key: p.key,
|
|
1945
|
+
...p.value !== void 0 ? { value: p.value } : {},
|
|
1946
|
+
...p.pre !== void 0 ? { pre: p.pre } : {},
|
|
1947
|
+
...p.post !== void 0 ? { post: p.post } : {},
|
|
1948
|
+
...p.isSecret !== void 0 ? { isSecret: toBool(p.isSecret) } : {},
|
|
1949
|
+
...p.description !== void 0 ? { description: p.description } : {}
|
|
1950
|
+
})
|
|
1951
|
+
},
|
|
1952
|
+
{
|
|
1953
|
+
name: "set_environment_inheritance",
|
|
1954
|
+
description: "Switch whether a service environment inherits the variables of the global environment that activates it (the default), or is isolated from it and receives only its own variables. list_environments shows this as `isolated`. Isolating a service is unusual: it loses every shared variable of the project. Do it only when the user asks, and never to work around a variable \u2014 override it in the service environment instead.",
|
|
1955
|
+
route: "environment.setInheritanceBlind",
|
|
1956
|
+
method: "POST",
|
|
1957
|
+
params: [
|
|
1958
|
+
{ name: "environmentId", description: "A service environment (scope service), from list_environments", required: true },
|
|
1959
|
+
{ name: "inherit", description: '"true" to inherit from the global environment, "false" to isolate', required: true, schema: z3.boolean() }
|
|
1960
|
+
],
|
|
1961
|
+
buildInput: (p) => ({ environmentId: p.environmentId, inherit: toBool(p.inherit ?? "true") })
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
name: "remove_environment_variable",
|
|
1965
|
+
description: "Delete an environment variable, by name, from one environment. Its value is lost.",
|
|
1966
|
+
route: "environment.removeVariableBlind",
|
|
1967
|
+
method: "POST",
|
|
1968
|
+
params: [
|
|
1969
|
+
{ name: "environmentId", description: "The environment that holds the variable", required: true },
|
|
1970
|
+
{ name: "key", description: "The variable name", required: true }
|
|
1971
|
+
],
|
|
1972
|
+
buildInput: (p) => ({ environmentId: p.environmentId, key: p.key }),
|
|
1973
|
+
destructive: true
|
|
1736
1974
|
},
|
|
1737
1975
|
{
|
|
1738
1976
|
name: "get_service_metrics",
|
|
@@ -1959,6 +2197,14 @@ var RUNEYA_CAPABILITIES = [
|
|
|
1959
2197
|
}
|
|
1960
2198
|
];
|
|
1961
2199
|
|
|
2200
|
+
// ../../packages/ai-capabilities/src/adapters/json-schema.ts
|
|
2201
|
+
import { z as z4 } from "zod";
|
|
2202
|
+
function paramJsonSchema(param) {
|
|
2203
|
+
if (!param.schema) return { type: "string", description: param.description };
|
|
2204
|
+
const { $schema: _ignored, ...schema } = z4.toJSONSchema(param.schema, { io: "input", unrepresentable: "any" });
|
|
2205
|
+
return { ...schema, description: param.description };
|
|
2206
|
+
}
|
|
2207
|
+
|
|
1962
2208
|
// ../../packages/ai-capabilities/src/adapters/anthropic.ts
|
|
1963
2209
|
function buildAnthropicTools(capabilities) {
|
|
1964
2210
|
return capabilities.map((cap) => ({
|
|
@@ -1967,7 +2213,7 @@ function buildAnthropicTools(capabilities) {
|
|
|
1967
2213
|
input_schema: {
|
|
1968
2214
|
type: "object",
|
|
1969
2215
|
properties: Object.fromEntries(
|
|
1970
|
-
cap.params.map((p) => [p.name,
|
|
2216
|
+
cap.params.map((p) => [p.name, paramJsonSchema(p)])
|
|
1971
2217
|
),
|
|
1972
2218
|
required: cap.params.filter((p) => p.required).map((p) => p.name)
|
|
1973
2219
|
}
|
|
@@ -1984,7 +2230,7 @@ function buildOpenAITools(capabilities) {
|
|
|
1984
2230
|
parameters: {
|
|
1985
2231
|
type: "object",
|
|
1986
2232
|
properties: Object.fromEntries(
|
|
1987
|
-
cap.params.map((p) => [p.name,
|
|
2233
|
+
cap.params.map((p) => [p.name, paramJsonSchema(p)])
|
|
1988
2234
|
),
|
|
1989
2235
|
required: cap.params.filter((p) => p.required).map((p) => p.name)
|
|
1990
2236
|
}
|
|
@@ -2011,14 +2257,24 @@ function buildToolSafetyInstruction(capabilities) {
|
|
|
2011
2257
|
return lines.join("\n");
|
|
2012
2258
|
}
|
|
2013
2259
|
|
|
2260
|
+
// ../../packages/ai-capabilities/src/adapters/mcp.ts
|
|
2261
|
+
import { z as z5 } from "zod";
|
|
2262
|
+
function toRawParams(input, cap) {
|
|
2263
|
+
const typed = new Set(cap?.params.filter((p) => p.schema).map((p) => p.name));
|
|
2264
|
+
return Object.fromEntries(Object.entries(input).map(([k, v]) => [
|
|
2265
|
+
k,
|
|
2266
|
+
v === null && typed.has(k) ? "null" : v == null ? void 0 : typeof v === "object" ? JSON.stringify(v) : String(v)
|
|
2267
|
+
]));
|
|
2268
|
+
}
|
|
2269
|
+
|
|
2014
2270
|
// ../../packages/ai-capabilities/src/trpc-caller.ts
|
|
2015
|
-
async function callTrpc(baseUrl, route, method, input, authToken) {
|
|
2271
|
+
async function callTrpc(baseUrl, route, method, input, authToken, fetchImpl = fetch) {
|
|
2016
2272
|
const headers = {
|
|
2017
2273
|
"Content-Type": "application/json",
|
|
2018
2274
|
"Authorization": `Bearer ${authToken}`
|
|
2019
2275
|
};
|
|
2020
2276
|
const url = method === "GET" && input ? `${baseUrl}/api/trpc/${route}?input=${encodeURIComponent(JSON.stringify(input))}` : `${baseUrl}/api/trpc/${route}`;
|
|
2021
|
-
const res = await
|
|
2277
|
+
const res = await fetchImpl(url, {
|
|
2022
2278
|
method,
|
|
2023
2279
|
headers,
|
|
2024
2280
|
...method === "POST" ? { body: JSON.stringify(input ?? {}) } : {},
|
|
@@ -2029,6 +2285,24 @@ async function callTrpc(baseUrl, route, method, input, authToken) {
|
|
|
2029
2285
|
const result = json["result"];
|
|
2030
2286
|
return result?.["data"] ?? result ?? json;
|
|
2031
2287
|
}
|
|
2288
|
+
async function runCapability(cap, baseUrl, params, authToken, fetchImpl = fetch) {
|
|
2289
|
+
const result = await callTrpc(baseUrl, cap.route, cap.method, cap.buildInput(params), authToken, fetchImpl);
|
|
2290
|
+
return cap.transformOutput ? cap.transformOutput(result) : result;
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
// ../../packages/ai-capabilities/src/project-anchor.ts
|
|
2294
|
+
function applyProjectAnchor(cap, params, anchor2) {
|
|
2295
|
+
if (!anchor2.projectId) return params;
|
|
2296
|
+
const accepts = (name) => cap.params.some((p) => p.name === name);
|
|
2297
|
+
if (!accepts("projectId") || params["projectId"]) return params;
|
|
2298
|
+
return {
|
|
2299
|
+
...params,
|
|
2300
|
+
projectId: anchor2.projectId,
|
|
2301
|
+
// L'organisation n'accompagne le projet que si la capability la comprend :
|
|
2302
|
+
// ailleurs, ce serait un champ de trop, refusé par le schéma de la route.
|
|
2303
|
+
...anchor2.orgId && accepts("orgId") && !params["orgId"] ? { orgId: anchor2.orgId } : {}
|
|
2304
|
+
};
|
|
2305
|
+
}
|
|
2032
2306
|
|
|
2033
2307
|
// ../server/src/services/llms-txt-generator.ts
|
|
2034
2308
|
function generateAdminLlmsTxt(services, jwt, project) {
|
|
@@ -2215,7 +2489,7 @@ function normalizeToolName(raw) {
|
|
|
2215
2489
|
const match = KNOWN_TOOL_NAMES.find((t2) => raw.startsWith(t2));
|
|
2216
2490
|
return match ?? raw;
|
|
2217
2491
|
}
|
|
2218
|
-
async function executeTool(rawName, input, apiKey, authToken) {
|
|
2492
|
+
async function executeTool(rawName, input, apiKey, authToken, anchor2 = {}) {
|
|
2219
2493
|
const name = normalizeToolName(rawName);
|
|
2220
2494
|
const cap = RUNEYA_CAPABILITIES.find((c) => c.name === name);
|
|
2221
2495
|
if (!cap) throw new Error(`Unknown tool: ${name}`);
|
|
@@ -2233,18 +2507,13 @@ async function executeTool(rawName, input, apiKey, authToken) {
|
|
|
2233
2507
|
throw new Error(`No '${action}' permission for service ${serviceId}`);
|
|
2234
2508
|
}
|
|
2235
2509
|
}
|
|
2236
|
-
const params =
|
|
2237
|
-
Object.entries(input).map(([k, v]) => [
|
|
2238
|
-
k,
|
|
2239
|
-
v != null ? typeof v === "object" ? JSON.stringify(v) : String(v) : void 0
|
|
2240
|
-
])
|
|
2241
|
-
);
|
|
2510
|
+
const params = applyProjectAnchor(cap, toRawParams(input, cap), anchor2);
|
|
2242
2511
|
const baseUrl = `http://localhost:${env.PORT}`;
|
|
2243
|
-
return
|
|
2512
|
+
return runCapability(cap, baseUrl, params, authToken);
|
|
2244
2513
|
}
|
|
2245
2514
|
|
|
2246
2515
|
// ../server/src/trpc/routers/service.ts
|
|
2247
|
-
import { z as
|
|
2516
|
+
import { z as z6 } from "zod";
|
|
2248
2517
|
import { TRPCError as TRPCError2 } from "@trpc/server";
|
|
2249
2518
|
|
|
2250
2519
|
// ../server/src/services/audit-service.ts
|
|
@@ -2538,6 +2807,39 @@ function buildServerBuiltins(input) {
|
|
|
2538
2807
|
|
|
2539
2808
|
// ../server/src/trpc/routers/service.ts
|
|
2540
2809
|
import { isAbsolute as isAbsolute2 } from "path";
|
|
2810
|
+
|
|
2811
|
+
// ../server/src/services/attach-service.ts
|
|
2812
|
+
async function attachServiceToProject(target, serviceId) {
|
|
2813
|
+
const project = await projectStore.addService(target, serviceId);
|
|
2814
|
+
if (!project) return null;
|
|
2815
|
+
const service = await serviceStore.get(serviceId);
|
|
2816
|
+
if (!service) return project;
|
|
2817
|
+
const globalEnvs = await environmentStore.listByScope(target.id, "global", target.orgId);
|
|
2818
|
+
for (const globalEnv of globalEnvs) {
|
|
2819
|
+
if (await environmentStore.findServiceEnvironment(serviceId, globalEnv.id)) continue;
|
|
2820
|
+
const svcEnv = await environmentStore.create({
|
|
2821
|
+
projectId: target.id,
|
|
2822
|
+
name: `${service.name} (${globalEnv.name})`,
|
|
2823
|
+
scope: "service",
|
|
2824
|
+
reference: serviceId,
|
|
2825
|
+
activateOn: globalEnv.id,
|
|
2826
|
+
parentIds: [globalEnv.id],
|
|
2827
|
+
variables: {}
|
|
2828
|
+
}, target.orgId);
|
|
2829
|
+
await projectStore.addEnvironment(target, svcEnv.id);
|
|
2830
|
+
}
|
|
2831
|
+
return project;
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
// ../server/src/trpc/routers/service.ts
|
|
2835
|
+
function withRestoredLogSecrets(incoming, existing) {
|
|
2836
|
+
if (!incoming) return void 0;
|
|
2837
|
+
try {
|
|
2838
|
+
return restoreLogSourceSecrets(incoming, existing);
|
|
2839
|
+
} catch (err) {
|
|
2840
|
+
throw new TRPCError2({ code: "BAD_REQUEST", message: err.message });
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2541
2843
|
async function resolveEffectiveAgentId(service) {
|
|
2542
2844
|
const known = /* @__PURE__ */ new Set([
|
|
2543
2845
|
...agentManager.listAgents().map((a) => a.config.id),
|
|
@@ -2552,7 +2854,7 @@ async function resolveEffectiveAgentId(service) {
|
|
|
2552
2854
|
}
|
|
2553
2855
|
return agentManager.getDefaultAgentId();
|
|
2554
2856
|
}
|
|
2555
|
-
async function resolveServiceVariables(service) {
|
|
2857
|
+
async function resolveServiceVariables(service, opts = {}) {
|
|
2556
2858
|
const projects = await projectStore.list();
|
|
2557
2859
|
const project = projects.find((p) => p.serviceIds.includes(service.id));
|
|
2558
2860
|
let resolvedService = service;
|
|
@@ -2571,16 +2873,17 @@ async function resolveServiceVariables(service) {
|
|
|
2571
2873
|
} catch (err) {
|
|
2572
2874
|
console.error("[service-router] Failed to resolve parsers for service", service.id + ":", err.message);
|
|
2573
2875
|
}
|
|
2574
|
-
|
|
2876
|
+
const environmentId = opts.environmentId ?? project?.activeEnvironmentId;
|
|
2877
|
+
if (!project || !environmentId) {
|
|
2575
2878
|
return resolvedService;
|
|
2576
2879
|
}
|
|
2577
2880
|
try {
|
|
2578
2881
|
const resolved = await environmentResolver.resolveForService({
|
|
2579
2882
|
serviceId: service.id,
|
|
2580
|
-
activeEnvironmentId:
|
|
2883
|
+
activeEnvironmentId: environmentId
|
|
2581
2884
|
});
|
|
2582
2885
|
const [environment, agentId, siblings] = await Promise.all([
|
|
2583
|
-
environmentStore.get(
|
|
2886
|
+
environmentStore.get(environmentId),
|
|
2584
2887
|
resolveEffectiveAgentId(service),
|
|
2585
2888
|
Promise.all(project.serviceIds.filter((id) => id !== service.id).map((id) => serviceStore.get(id)))
|
|
2586
2889
|
]);
|
|
@@ -2603,7 +2906,7 @@ async function resolveServiceVariables(service) {
|
|
|
2603
2906
|
}
|
|
2604
2907
|
return resolvedService;
|
|
2605
2908
|
}
|
|
2606
|
-
var
|
|
2909
|
+
var DockerConfigInput2 = DockerConfigSchema;
|
|
2607
2910
|
var serviceRouter = router({
|
|
2608
2911
|
/**
|
|
2609
2912
|
* Sans filtre, la réponse couvre TOUT le poste : `serviceStore.list()` rend
|
|
@@ -2620,10 +2923,10 @@ var serviceRouter = router({
|
|
|
2620
2923
|
* silencieux ferait croire au filtrage tout en rendant les services des
|
|
2621
2924
|
* autres organisations.
|
|
2622
2925
|
*/
|
|
2623
|
-
list: protectedProcedure.meta({ openapi: { method: "GET", path: "/services", tags: ["services"], summary: "List services (every project of the machine unless narrowed by project or organization)", protect: true } }).input(
|
|
2624
|
-
projectId:
|
|
2625
|
-
orgId:
|
|
2626
|
-
}).optional()).output(
|
|
2926
|
+
list: protectedProcedure.meta({ openapi: { method: "GET", path: "/services", tags: ["services"], summary: "List services (every project of the machine unless narrowed by project or organization)", protect: true } }).input(z6.object({
|
|
2927
|
+
projectId: z6.string().max(128).optional(),
|
|
2928
|
+
orgId: z6.string().max(128).nullable().optional()
|
|
2929
|
+
}).optional()).output(z6.any()).query(async ({ input, ctx }) => {
|
|
2627
2930
|
const all = await serviceStore.list();
|
|
2628
2931
|
const allowedIds = getAllowedServiceIds(ctx);
|
|
2629
2932
|
let filtered = allowedIds ? all.filter((s) => allowedIds.has(s.id)) : all;
|
|
@@ -2643,7 +2946,7 @@ var serviceRouter = router({
|
|
|
2643
2946
|
effectiveAgentId: await resolveEffectiveAgentId(s)
|
|
2644
2947
|
})));
|
|
2645
2948
|
}),
|
|
2646
|
-
get: protectedProcedure.meta({ openapi: { method: "GET", path: "/services/{id}", tags: ["services"], summary: "Get a service by ID", protect: true } }).input(
|
|
2949
|
+
get: protectedProcedure.meta({ openapi: { method: "GET", path: "/services/{id}", tags: ["services"], summary: "Get a service by ID", protect: true } }).input(z6.object({ id: z6.string().max(128) })).output(z6.any()).query(async ({ input, ctx }) => {
|
|
2647
2950
|
requireServiceAction(ctx, input.id, "service:read");
|
|
2648
2951
|
const service = await serviceStore.get(input.id);
|
|
2649
2952
|
if (!service) {
|
|
@@ -2669,17 +2972,28 @@ var serviceRouter = router({
|
|
|
2669
2972
|
* valeurs** — où chacune est définie, ce que ses cases disent, et si ce
|
|
2670
2973
|
* service la reçoit. Sans lui, un agent lisait l'effet sans la cause.
|
|
2671
2974
|
*/
|
|
2672
|
-
getEnv: protectedProcedure.meta({ openapi: { method: "GET", path: "/services/{id}/env", tags: ["services"], summary: "Get a service's environment variables (unshared secrets masked) plus the project's value-free variable inventory", protect: true } }).input(
|
|
2975
|
+
getEnv: protectedProcedure.meta({ openapi: { method: "GET", path: "/services/{id}/env", tags: ["services"], summary: "Get a service's environment variables (unshared secrets masked) plus the project's value-free variable inventory", protect: true } }).input(z6.object({
|
|
2976
|
+
id: z6.string().max(128),
|
|
2977
|
+
// Un environnement global du projet où résoudre, sans l'activer. Absent : l'actif.
|
|
2978
|
+
environmentId: z6.string().max(128).optional()
|
|
2979
|
+
})).output(z6.any()).query(async ({ input, ctx }) => {
|
|
2673
2980
|
requireServiceAction(ctx, input.id, "service:read");
|
|
2674
2981
|
const service = await serviceStore.get(input.id);
|
|
2675
2982
|
if (!service) {
|
|
2676
2983
|
throw new TRPCError2({ code: "NOT_FOUND", message: `Service ${input.id} not found` });
|
|
2677
2984
|
}
|
|
2678
|
-
const resolved = await resolveServiceVariables(service);
|
|
2679
2985
|
const project = await projectStore.ofService(service.id);
|
|
2680
|
-
|
|
2986
|
+
if (input.environmentId) {
|
|
2987
|
+
const target = await environmentStore.get(input.environmentId);
|
|
2988
|
+
if (!target || !project || target.projectId !== project.id || (target.scope ?? "global") !== "global") {
|
|
2989
|
+
throw new TRPCError2({ code: "BAD_REQUEST", message: `Environment ${input.environmentId} is not a global environment of this service's project` });
|
|
2990
|
+
}
|
|
2991
|
+
}
|
|
2992
|
+
const environmentId = input.environmentId ?? project?.activeEnvironmentId ?? null;
|
|
2993
|
+
const resolved = await resolveServiceVariables(service, input.environmentId ? { environmentId: input.environmentId } : {});
|
|
2994
|
+
const shared = environmentId ? await environmentResolver.resolveAiSharedKeysForService({
|
|
2681
2995
|
serviceId: service.id,
|
|
2682
|
-
activeEnvironmentId:
|
|
2996
|
+
activeEnvironmentId: environmentId
|
|
2683
2997
|
}) : /* @__PURE__ */ new Set();
|
|
2684
2998
|
const filtered = filterEnvForAi(
|
|
2685
2999
|
{ env: resolved.env ?? {}, envSecrets: resolved.envSecrets ?? [] },
|
|
@@ -2688,8 +3002,8 @@ var serviceRouter = router({
|
|
|
2688
3002
|
const [environments, overrides, sharedResolved] = project ? await Promise.all([
|
|
2689
3003
|
environmentStore.getByProjectId(project.id, project.orgId ?? null),
|
|
2690
3004
|
environmentOverridesStore.getAll(),
|
|
2691
|
-
|
|
2692
|
-
{ serviceId: service.id, activeEnvironmentId:
|
|
3005
|
+
environmentId ? environmentResolver.resolveForService(
|
|
3006
|
+
{ serviceId: service.id, activeEnvironmentId: environmentId },
|
|
2693
3007
|
{ applyOverrides: false }
|
|
2694
3008
|
) : Promise.resolve({ env: {}, envSecrets: [] })
|
|
2695
3009
|
]) : [[], {}, { env: {}, envSecrets: [] }];
|
|
@@ -2700,38 +3014,47 @@ var serviceRouter = router({
|
|
|
2700
3014
|
resolvedSecretKeys: new Set(resolved.envSecrets ?? []),
|
|
2701
3015
|
maskedKeys: new Set(filtered.hiddenKeys)
|
|
2702
3016
|
});
|
|
2703
|
-
return {
|
|
3017
|
+
return {
|
|
3018
|
+
...filtered,
|
|
3019
|
+
environmentId,
|
|
3020
|
+
// Ce qui arrivera tel quel au process. Les valeurs masquées n'y sont pas
|
|
3021
|
+
// inspectées : leurs références diraient la forme du secret.
|
|
3022
|
+
unresolvedReferences: findUnresolvedReferences(resolved.env ?? {}, { serverResolved: true, skipKeys: filtered.hiddenKeys }),
|
|
3023
|
+
variables
|
|
3024
|
+
};
|
|
2704
3025
|
}),
|
|
2705
|
-
create: protectedProcedure.meta({ openapi: { method: "POST", path: "/services", tags: ["services"], summary: "Create a new service", protect: true } }).output(
|
|
2706
|
-
|
|
2707
|
-
agentId:
|
|
2708
|
-
name:
|
|
2709
|
-
commands:
|
|
2710
|
-
cwd:
|
|
2711
|
-
ports:
|
|
2712
|
-
groups:
|
|
2713
|
-
description:
|
|
2714
|
-
docsPath:
|
|
2715
|
-
url:
|
|
2716
|
-
localUrls:
|
|
2717
|
-
url:
|
|
2718
|
-
port:
|
|
3026
|
+
create: protectedProcedure.meta({ openapi: { method: "POST", path: "/services", tags: ["services"], summary: "Create a new service", protect: true } }).output(z6.any()).input(
|
|
3027
|
+
z6.object({
|
|
3028
|
+
agentId: z6.string().max(128).optional(),
|
|
3029
|
+
name: z6.string().min(1).max(200),
|
|
3030
|
+
commands: z6.array(ServiceCommandSchema).max(50).optional(),
|
|
3031
|
+
cwd: z6.string().max(4096).optional(),
|
|
3032
|
+
ports: z6.array(z6.number().int().min(1).max(65535)).max(20).optional(),
|
|
3033
|
+
groups: z6.array(z6.string().max(200)).max(20).optional(),
|
|
3034
|
+
description: z6.string().max(2e3).optional(),
|
|
3035
|
+
docsPath: z6.string().max(4096).optional(),
|
|
3036
|
+
url: z6.string().max(2048).optional(),
|
|
3037
|
+
localUrls: z6.array(z6.object({
|
|
3038
|
+
url: z6.string().max(253),
|
|
3039
|
+
port: z6.number().int().min(1).max(65535)
|
|
2719
3040
|
})).max(20).optional(),
|
|
2720
|
-
openapiUrl:
|
|
2721
|
-
git:
|
|
2722
|
-
meta:
|
|
2723
|
-
runner:
|
|
2724
|
-
dockerConfig:
|
|
3041
|
+
openapiUrl: z6.string().max(2048).optional(),
|
|
3042
|
+
git: z6.object({ remote: z6.string().max(2048).optional(), home: z6.string().max(2048).optional() }).optional(),
|
|
3043
|
+
meta: z6.record(z6.string().max(256), z6.string().max(2e3)).optional().refine((obj) => !obj || Object.keys(obj).length <= 100, { message: "Too many meta keys (max 100)" }),
|
|
3044
|
+
runner: z6.enum(["native", "docker"]).optional().default("native"),
|
|
3045
|
+
dockerConfig: DockerConfigInput2.optional(),
|
|
2725
3046
|
healthCheck: HealthCheckSchema.optional(),
|
|
2726
|
-
autoRestart:
|
|
3047
|
+
autoRestart: z6.boolean().optional().default(false),
|
|
3048
|
+
clearLogsOnStart: z6.boolean().optional(),
|
|
2727
3049
|
restartStrategy: RestartStrategySchema.optional(),
|
|
2728
|
-
maxRestarts:
|
|
2729
|
-
restartBackoffMs:
|
|
2730
|
-
orgId:
|
|
3050
|
+
maxRestarts: z6.number().int().nonnegative().optional(),
|
|
3051
|
+
restartBackoffMs: z6.number().int().positive().optional().default(1e3),
|
|
3052
|
+
orgId: z6.string().max(128).nullable().optional(),
|
|
3053
|
+
logSources: z6.array(LogSourceConfigSchema).max(20).optional(),
|
|
2731
3054
|
// Le projet qui va l'adopter : le service naît dans son coffre.
|
|
2732
|
-
projectId:
|
|
2733
|
-
shortcuts:
|
|
2734
|
-
parserIds:
|
|
3055
|
+
projectId: z6.string().max(128).optional(),
|
|
3056
|
+
shortcuts: z6.array(ServiceShortcutSchema).max(50).optional(),
|
|
3057
|
+
parserIds: z6.array(z6.string().max(128)).max(50).optional()
|
|
2735
3058
|
})
|
|
2736
3059
|
).mutation(async ({ input }) => {
|
|
2737
3060
|
if (input.agentId) {
|
|
@@ -2743,55 +3066,59 @@ var serviceRouter = router({
|
|
|
2743
3066
|
});
|
|
2744
3067
|
}
|
|
2745
3068
|
}
|
|
2746
|
-
if (input.runner === "docker") {
|
|
2747
|
-
throw new TRPCError2({ code: "BAD_REQUEST", message: 'Docker runner is not yet supported. Use "native" runner.' });
|
|
2748
|
-
}
|
|
2749
3069
|
const { projectId, ...fields } = input;
|
|
3070
|
+
const logSources = withRestoredLogSecrets(input.logSources, []);
|
|
3071
|
+
const target = projectId ? { id: projectId, ...input.orgId !== void 0 ? { orgId: input.orgId } : {} } : void 0;
|
|
3072
|
+
if (target && !await projectStore.get(target)) {
|
|
3073
|
+
throw new TRPCError2({ code: "NOT_FOUND", message: `Project ${projectId} not found` });
|
|
3074
|
+
}
|
|
2750
3075
|
const service = await serviceStore.create(
|
|
2751
|
-
{ ...fields, agentId: input.agentId },
|
|
3076
|
+
{ ...fields, agentId: input.agentId, ...logSources ? { logSources } : {} },
|
|
2752
3077
|
projectId ? { id: projectId, orgId: input.orgId } : void 0
|
|
2753
3078
|
);
|
|
3079
|
+
if (target) await attachServiceToProject(target, service.id);
|
|
2754
3080
|
await auditService.log({ userId: "local", action: "create", entityType: "service", entityId: service.id, metadata: { name: input.name } });
|
|
2755
3081
|
return service;
|
|
2756
3082
|
}),
|
|
2757
|
-
update: protectedProcedure.meta({ openapi: { method: "PATCH", path: "/services/{id}", tags: ["services"], summary: "Update a service", protect: true } }).output(
|
|
2758
|
-
|
|
2759
|
-
id:
|
|
2760
|
-
agentId:
|
|
3083
|
+
update: protectedProcedure.meta({ openapi: { method: "PATCH", path: "/services/{id}", tags: ["services"], summary: "Update a service", protect: true } }).output(z6.any()).input(
|
|
3084
|
+
z6.object({
|
|
3085
|
+
id: z6.string().max(128),
|
|
3086
|
+
agentId: z6.string().max(128).nullable().optional(),
|
|
2761
3087
|
// null = clear (inherit from env)
|
|
2762
|
-
name:
|
|
2763
|
-
commands:
|
|
2764
|
-
cwd:
|
|
2765
|
-
ports:
|
|
2766
|
-
groups:
|
|
2767
|
-
description:
|
|
2768
|
-
docsPath:
|
|
2769
|
-
url:
|
|
2770
|
-
localUrls:
|
|
2771
|
-
url:
|
|
2772
|
-
port:
|
|
3088
|
+
name: z6.string().min(1).max(200).optional(),
|
|
3089
|
+
commands: z6.array(ServiceCommandSchema).max(50).optional(),
|
|
3090
|
+
cwd: z6.string().max(4096).nullable().optional(),
|
|
3091
|
+
ports: z6.array(z6.number().int().min(1).max(65535)).max(20).optional(),
|
|
3092
|
+
groups: z6.array(z6.string().max(200)).max(20).optional(),
|
|
3093
|
+
description: z6.string().max(2e3).optional(),
|
|
3094
|
+
docsPath: z6.string().max(4096).optional(),
|
|
3095
|
+
url: z6.string().max(2048).optional(),
|
|
3096
|
+
localUrls: z6.array(z6.object({
|
|
3097
|
+
url: z6.string().max(253),
|
|
3098
|
+
port: z6.number().int().min(1).max(65535)
|
|
2773
3099
|
})).max(20).optional(),
|
|
2774
|
-
openapiUrl:
|
|
2775
|
-
git:
|
|
2776
|
-
meta:
|
|
2777
|
-
runner:
|
|
2778
|
-
dockerConfig:
|
|
3100
|
+
openapiUrl: z6.string().max(2048).optional(),
|
|
3101
|
+
git: z6.object({ remote: z6.string().max(2048).optional(), home: z6.string().max(2048).optional() }).nullable().optional(),
|
|
3102
|
+
meta: z6.record(z6.string().max(256), z6.string().max(2e3)).nullable().optional().refine((obj) => !obj || Object.keys(obj).length <= 100, { message: "Too many meta keys (max 100)" }),
|
|
3103
|
+
runner: z6.enum(["native", "docker"]).optional(),
|
|
3104
|
+
dockerConfig: DockerConfigInput2.optional(),
|
|
2779
3105
|
healthCheck: HealthCheckSchema.nullable().optional(),
|
|
2780
|
-
autoRestart:
|
|
2781
|
-
clearLogsOnStart:
|
|
3106
|
+
autoRestart: z6.boolean().optional(),
|
|
3107
|
+
clearLogsOnStart: z6.boolean().optional(),
|
|
2782
3108
|
restartStrategy: RestartStrategySchema.optional(),
|
|
2783
|
-
maxRestarts:
|
|
2784
|
-
restartBackoffMs:
|
|
2785
|
-
orgId:
|
|
2786
|
-
shortcuts:
|
|
2787
|
-
parserIds:
|
|
2788
|
-
logSources:
|
|
3109
|
+
maxRestarts: z6.number().int().nonnegative().optional(),
|
|
3110
|
+
restartBackoffMs: z6.number().int().positive().optional(),
|
|
3111
|
+
orgId: z6.string().max(128).nullable().optional(),
|
|
3112
|
+
shortcuts: z6.array(ServiceShortcutSchema).max(50).optional(),
|
|
3113
|
+
parserIds: z6.array(z6.string().max(128)).max(50).optional(),
|
|
3114
|
+
logSources: z6.array(LogSourceConfigSchema).max(20).optional()
|
|
2789
3115
|
})
|
|
2790
3116
|
).mutation(async ({ input }) => {
|
|
2791
3117
|
const existing = await serviceStore.get(input.id);
|
|
2792
3118
|
if (!existing) {
|
|
2793
3119
|
throw new TRPCError2({ code: "NOT_FOUND", message: `Service ${input.id} not found` });
|
|
2794
3120
|
}
|
|
3121
|
+
const logSources = withRestoredLogSecrets(input.logSources, existing.logSources ?? []);
|
|
2795
3122
|
let stoppedForAgentChange = false;
|
|
2796
3123
|
if (input.agentId !== void 0 && input.agentId !== existing.agentId && existing.agentId) {
|
|
2797
3124
|
const oldAgentStatus = agentManager.getStatus(existing.agentId);
|
|
@@ -2816,7 +3143,7 @@ var serviceRouter = router({
|
|
|
2816
3143
|
}
|
|
2817
3144
|
}
|
|
2818
3145
|
}
|
|
2819
|
-
const service = await serviceStore.update(input);
|
|
3146
|
+
const service = await serviceStore.update({ ...input, ...logSources ? { logSources } : {} });
|
|
2820
3147
|
if (!service) {
|
|
2821
3148
|
throw new TRPCError2({ code: "NOT_FOUND", message: `Service ${input.id} not found` });
|
|
2822
3149
|
}
|
|
@@ -2840,7 +3167,7 @@ var serviceRouter = router({
|
|
|
2840
3167
|
await auditService.log({ userId: "local", action: "update", entityType: "service", entityId: input.id });
|
|
2841
3168
|
return { ...service, effectiveAgentId: await resolveEffectiveAgentId(service), stoppedForAgentChange };
|
|
2842
3169
|
}),
|
|
2843
|
-
delete: protectedProcedure.meta({ openapi: { method: "DELETE", path: "/services/{id}", tags: ["services"], summary: "Delete a service", protect: true } }).input(
|
|
3170
|
+
delete: protectedProcedure.meta({ openapi: { method: "DELETE", path: "/services/{id}", tags: ["services"], summary: "Delete a service", protect: true } }).input(z6.object({ id: z6.string().max(128) })).output(z6.object({ success: z6.literal(true) })).mutation(async ({ input }) => {
|
|
2844
3171
|
const deleted = await serviceStore.delete(input.id);
|
|
2845
3172
|
if (!deleted) {
|
|
2846
3173
|
throw new TRPCError2({ code: "NOT_FOUND", message: `Service ${input.id} not found` });
|
|
@@ -2848,7 +3175,7 @@ var serviceRouter = router({
|
|
|
2848
3175
|
await auditService.log({ userId: "local", action: "delete", entityType: "service", entityId: input.id });
|
|
2849
3176
|
return { success: true };
|
|
2850
3177
|
}),
|
|
2851
|
-
checkCwd: protectedProcedure.input(
|
|
3178
|
+
checkCwd: protectedProcedure.input(z6.object({ id: z6.string().max(128), checkReachability: z6.boolean().optional() })).query(async ({ input }) => {
|
|
2852
3179
|
const service = await serviceStore.get(input.id);
|
|
2853
3180
|
if (!service) {
|
|
2854
3181
|
throw new TRPCError2({ code: "NOT_FOUND", message: `Service ${input.id} not found` });
|
|
@@ -2881,7 +3208,7 @@ var serviceRouter = router({
|
|
|
2881
3208
|
}
|
|
2882
3209
|
return { exists, canClone, unresolvedVars: [], resolvedCwd, gitMismatch };
|
|
2883
3210
|
}),
|
|
2884
|
-
cloneRepository: protectedProcedure.input(
|
|
3211
|
+
cloneRepository: protectedProcedure.input(z6.object({ id: z6.string().max(128) })).mutation(async ({ input }) => {
|
|
2885
3212
|
const service = await serviceStore.get(input.id);
|
|
2886
3213
|
if (!service) {
|
|
2887
3214
|
throw new TRPCError2({ code: "NOT_FOUND", message: `Service ${input.id} not found` });
|
|
@@ -3639,9 +3966,9 @@ async function fetchProviderModels(provider, plaintextKey) {
|
|
|
3639
3966
|
async function vaultOfProject(projectId) {
|
|
3640
3967
|
if (!projectId) return void 0;
|
|
3641
3968
|
await ensureProjectsLoaded();
|
|
3642
|
-
const
|
|
3643
|
-
if (
|
|
3644
|
-
return
|
|
3969
|
+
const refs2 = refsOfProjectId(projectId);
|
|
3970
|
+
if (refs2.length !== 1) return void 0;
|
|
3971
|
+
return refs2[0]?.orgId ?? void 0;
|
|
3645
3972
|
}
|
|
3646
3973
|
|
|
3647
3974
|
// ../server/src/services/image-storage.service.ts
|
|
@@ -3830,7 +4157,7 @@ async function resolveImagesToBase64(images, contextId) {
|
|
|
3830
4157
|
}
|
|
3831
4158
|
|
|
3832
4159
|
// ../server/src/trpc/routers/cloud-auth.ts
|
|
3833
|
-
import { z as
|
|
4160
|
+
import { z as z8 } from "zod";
|
|
3834
4161
|
import { hostname } from "os";
|
|
3835
4162
|
import { basename } from "path";
|
|
3836
4163
|
import { TRPCError as TRPCError3 } from "@trpc/server";
|
|
@@ -4087,12 +4414,12 @@ var cloudSessionStore = new CloudSessionStore();
|
|
|
4087
4414
|
import { networkInterfaces } from "os";
|
|
4088
4415
|
import { readFile as readFile7, writeFile as writeFile4, rename as rename4, mkdir as mkdir6 } from "fs/promises";
|
|
4089
4416
|
import { join as join7 } from "path";
|
|
4090
|
-
import { z as
|
|
4417
|
+
import { z as z7 } from "zod";
|
|
4091
4418
|
var LOOPBACK2 = "127.0.0.1";
|
|
4092
4419
|
var ANY = "0.0.0.0";
|
|
4093
4420
|
var NETWORK_FILE = "network.json";
|
|
4094
|
-
var NetworkFileSchema =
|
|
4095
|
-
instances:
|
|
4421
|
+
var NetworkFileSchema = z7.object({
|
|
4422
|
+
instances: z7.record(z7.string(), z7.object({ lanEnabled: z7.boolean().default(false) })).default({})
|
|
4096
4423
|
});
|
|
4097
4424
|
var httpServer = null;
|
|
4098
4425
|
function instanceKey() {
|
|
@@ -4360,15 +4687,15 @@ function isAllowedProxyPath(path) {
|
|
|
4360
4687
|
const [pathname] = path.split("?");
|
|
4361
4688
|
return PROXY_PREFIXES.some((p) => pathname === p || pathname.startsWith(p));
|
|
4362
4689
|
}
|
|
4363
|
-
var ScopeSchema =
|
|
4364
|
-
accountId:
|
|
4690
|
+
var ScopeSchema = z8.object({
|
|
4691
|
+
accountId: z8.string().min(1).max(64)
|
|
4365
4692
|
});
|
|
4366
4693
|
function scopeOf(input) {
|
|
4367
4694
|
return { accountId: input.accountId };
|
|
4368
4695
|
}
|
|
4369
4696
|
var cloudAuthRouter = router({
|
|
4370
4697
|
/** Build the cloud authorization URL to open in the browser. */
|
|
4371
|
-
startLogin: protectedProcedure.input(
|
|
4698
|
+
startLogin: protectedProcedure.input(z8.object({ returnTo: z8.string().url().max(2048) })).mutation(async ({ input }) => {
|
|
4372
4699
|
const callback = callbackForReturnTo(input.returnTo);
|
|
4373
4700
|
if (!callback) {
|
|
4374
4701
|
throw new TRPCError3({
|
|
@@ -4406,7 +4733,7 @@ var cloudAuthRouter = router({
|
|
|
4406
4733
|
* `null` quand rien ne rattache cette organisation à un compte de ce poste :
|
|
4407
4734
|
* l'interface l'affiche comme déconnectée, ce qu'elle est.
|
|
4408
4735
|
*/
|
|
4409
|
-
accountForOrg: protectedProcedure.input(
|
|
4736
|
+
accountForOrg: protectedProcedure.input(z8.object({ orgId: z8.string().min(1).max(128) })).query(async ({ input }) => ({ accountId: await accountForOrg(input.orgId) })),
|
|
4410
4737
|
/**
|
|
4411
4738
|
* Les comptes liés à ce poste, et l'organisation dont chacun répond.
|
|
4412
4739
|
*
|
|
@@ -4462,7 +4789,7 @@ var cloudAuthRouter = router({
|
|
|
4462
4789
|
* drops the session, and the local token is dropped here too, so nothing is
|
|
4463
4790
|
* left holding a dead credential.
|
|
4464
4791
|
*/
|
|
4465
|
-
revokeDevice: protectedProcedure.input(ScopeSchema.extend({ id:
|
|
4792
|
+
revokeDevice: protectedProcedure.input(ScopeSchema.extend({ id: z8.string().min(1).max(128) })).mutation(async ({ input }) => {
|
|
4466
4793
|
const { accountId } = input;
|
|
4467
4794
|
if (!accountId) throw new TRPCError3({ code: "PRECONDITION_FAILED", message: "No cloud account for this scope." });
|
|
4468
4795
|
const res = await cloudFetch2("/api/auth/device/revoke", {
|
|
@@ -4485,17 +4812,17 @@ var cloudAuthRouter = router({
|
|
|
4485
4812
|
* the cloud: the web UI asks its own server, which holds the credential.
|
|
4486
4813
|
*/
|
|
4487
4814
|
proxy: protectedProcedure.input(
|
|
4488
|
-
|
|
4489
|
-
path:
|
|
4490
|
-
method:
|
|
4491
|
-
query:
|
|
4492
|
-
body:
|
|
4815
|
+
z8.object({
|
|
4816
|
+
path: z8.string().min(1).max(512),
|
|
4817
|
+
method: z8.enum(["GET", "POST"]).default("GET"),
|
|
4818
|
+
query: z8.record(z8.string().max(128), z8.string().max(2048)).optional(),
|
|
4819
|
+
body: z8.unknown().optional(),
|
|
4493
4820
|
// Obligatoire, et seul : c'est la porte par laquelle passent tous les
|
|
4494
4821
|
// appels cloud de l'interface. La laisser optionnelle est ce qui a
|
|
4495
4822
|
// permis aux composables partagées de n'envoyer aucune portée pendant
|
|
4496
4823
|
// trente routes, et au serveur de retomber sur « le compte unique du
|
|
4497
4824
|
// poste » — muet dès qu'il y en a eu deux.
|
|
4498
|
-
accountId:
|
|
4825
|
+
accountId: z8.string().min(1).max(64)
|
|
4499
4826
|
})
|
|
4500
4827
|
).mutation(async ({ input }) => {
|
|
4501
4828
|
if (!isAllowedProxyPath(input.path)) {
|
|
@@ -5277,7 +5604,7 @@ function tailTranscript(opts) {
|
|
|
5277
5604
|
|
|
5278
5605
|
// ../server/src/services/ai-runners/claude-pty-runner.ts
|
|
5279
5606
|
async function getAgentManager() {
|
|
5280
|
-
const { agentManager: agentManager2 } = await import("./agent-manager-
|
|
5607
|
+
const { agentManager: agentManager2 } = await import("./agent-manager-QLXVQ7OD.js");
|
|
5281
5608
|
return agentManager2;
|
|
5282
5609
|
}
|
|
5283
5610
|
function buildPtyArgs(params, sessionId, opts) {
|
|
@@ -5969,7 +6296,7 @@ async function shutdownCodexAppServer() {
|
|
|
5969
6296
|
}
|
|
5970
6297
|
}
|
|
5971
6298
|
async function getAgentManager2() {
|
|
5972
|
-
const { agentManager: agentManager2 } = await import("./agent-manager-
|
|
6299
|
+
const { agentManager: agentManager2 } = await import("./agent-manager-QLXVQ7OD.js");
|
|
5973
6300
|
return agentManager2;
|
|
5974
6301
|
}
|
|
5975
6302
|
function parseRuneyaCurlCommand(command) {
|
|
@@ -6407,22 +6734,22 @@ ${prompt}`;
|
|
|
6407
6734
|
};
|
|
6408
6735
|
|
|
6409
6736
|
// ../server/src/trpc/routers/chat.ts
|
|
6410
|
-
var MessageSchema =
|
|
6411
|
-
role:
|
|
6412
|
-
content:
|
|
6737
|
+
var MessageSchema = z9.object({
|
|
6738
|
+
role: z9.enum(["user", "assistant"]),
|
|
6739
|
+
content: z9.string().max(1e5)
|
|
6413
6740
|
});
|
|
6414
|
-
var ImagePartSchema =
|
|
6415
|
-
type:
|
|
6416
|
-
imageId:
|
|
6417
|
-
url:
|
|
6418
|
-
mimeType:
|
|
6419
|
-
altText:
|
|
6741
|
+
var ImagePartSchema = z9.object({
|
|
6742
|
+
type: z9.literal("image"),
|
|
6743
|
+
imageId: z9.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
6744
|
+
url: z9.string().max(500),
|
|
6745
|
+
mimeType: z9.string().max(100),
|
|
6746
|
+
altText: z9.string().max(500).optional()
|
|
6420
6747
|
});
|
|
6421
|
-
var ImagePartsSchema =
|
|
6748
|
+
var ImagePartsSchema = z9.array(ImagePartSchema).max(5).optional();
|
|
6422
6749
|
var LANGUAGE_INSTRUCTION = "Always respond in the same language the user writes in.";
|
|
6423
6750
|
async function buildSystemPrompt(apiKey) {
|
|
6424
6751
|
const allServices = await serviceStore.list();
|
|
6425
|
-
const resolvedServices = await Promise.all(allServices.map(resolveServiceVariables));
|
|
6752
|
+
const resolvedServices = await Promise.all(allServices.map((s) => resolveServiceVariables(s)));
|
|
6426
6753
|
const context = apiKey ? generateLlmsTxt(apiKey, resolvedServices.filter((s) => apiKey.scopes.services.some((p) => p.serviceId === s.id))) : generateAdminLlmsTxt(resolvedServices);
|
|
6427
6754
|
const runeya_ai_vars = Object.entries(process.env).filter(([k]) => k.startsWith("RUNEYA_AI_")).map(([k, v]) => `${k}=${v}`).join("\n");
|
|
6428
6755
|
const envSection = runeya_ai_vars ? `
|
|
@@ -6434,7 +6761,7 @@ ${runeya_ai_vars}` : "";
|
|
|
6434
6761
|
|
|
6435
6762
|
${context}${envSection}`;
|
|
6436
6763
|
}
|
|
6437
|
-
async function* runAnthropic(client, model, system, initialMessages, apiKey, authToken, signal) {
|
|
6764
|
+
async function* runAnthropic(client, model, system, initialMessages, apiKey, authToken, signal, anchor2 = {}) {
|
|
6438
6765
|
const messages = [...initialMessages];
|
|
6439
6766
|
const MAX_TOOL_ROUNDS = 10;
|
|
6440
6767
|
for (let round = 0; round < MAX_TOOL_ROUNDS; round++) {
|
|
@@ -6491,7 +6818,7 @@ async function* runAnthropic(client, model, system, initialMessages, apiKey, aut
|
|
|
6491
6818
|
let result;
|
|
6492
6819
|
let isError = false;
|
|
6493
6820
|
try {
|
|
6494
|
-
result = await executeTool(block.name, block.input, apiKey, authToken);
|
|
6821
|
+
result = await executeTool(block.name, block.input, apiKey, authToken, anchor2);
|
|
6495
6822
|
} catch (err) {
|
|
6496
6823
|
result = err.message;
|
|
6497
6824
|
isError = true;
|
|
@@ -6508,7 +6835,7 @@ async function* runAnthropic(client, model, system, initialMessages, apiKey, aut
|
|
|
6508
6835
|
}
|
|
6509
6836
|
yield { type: "done", text: "" };
|
|
6510
6837
|
}
|
|
6511
|
-
async function* runOpenAI(client, model, initialMessages, apiKey, authToken, signal) {
|
|
6838
|
+
async function* runOpenAI(client, model, initialMessages, apiKey, authToken, signal, anchor2 = {}) {
|
|
6512
6839
|
const messages = [...initialMessages];
|
|
6513
6840
|
const MAX_TOOL_ROUNDS = 10;
|
|
6514
6841
|
for (let round = 0; round < MAX_TOOL_ROUNDS; round++) {
|
|
@@ -6559,7 +6886,7 @@ async function* runOpenAI(client, model, initialMessages, apiKey, authToken, sig
|
|
|
6559
6886
|
let result;
|
|
6560
6887
|
let isError = false;
|
|
6561
6888
|
try {
|
|
6562
|
-
result = await executeTool(tc.name, input, apiKey, authToken);
|
|
6889
|
+
result = await executeTool(tc.name, input, apiKey, authToken, anchor2);
|
|
6563
6890
|
} catch (err) {
|
|
6564
6891
|
result = err.message;
|
|
6565
6892
|
isError = true;
|
|
@@ -6661,7 +6988,7 @@ async function buildCliSystemContext(conv, jwt) {
|
|
|
6661
6988
|
const ref = conv ? await conversationStore.projectRefOf(conv) : null;
|
|
6662
6989
|
const project = ref ? await projectStore.get(ref) : null;
|
|
6663
6990
|
const ownServices = project ? allServices.filter((svc) => project.serviceIds.includes(svc.id)) : allServices;
|
|
6664
|
-
const resolvedServices = await Promise.all(ownServices.map(resolveServiceVariables));
|
|
6991
|
+
const resolvedServices = await Promise.all(ownServices.map((s) => resolveServiceVariables(s)));
|
|
6665
6992
|
let systemContext = generateAdminLlmsTxt(resolvedServices, jwt, project);
|
|
6666
6993
|
if (!conv?.isCompanion) systemContext += "\n\n" + companionSystemNote();
|
|
6667
6994
|
systemContext += await kanbanContextFor(conv);
|
|
@@ -6806,24 +7133,24 @@ async function startCodexSession(convId, prompt, opts = {}) {
|
|
|
6806
7133
|
});
|
|
6807
7134
|
return { session, done };
|
|
6808
7135
|
}
|
|
6809
|
-
var MessagePartSchema =
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
type:
|
|
7136
|
+
var MessagePartSchema = z9.discriminatedUnion("type", [
|
|
7137
|
+
z9.object({ type: z9.literal("thinking"), text: z9.string().max(1e5) }),
|
|
7138
|
+
z9.object({ type: z9.literal("text"), text: z9.string().max(1e5) }),
|
|
7139
|
+
z9.object({
|
|
7140
|
+
type: z9.literal("tool"),
|
|
6814
7141
|
id: Id128Schema,
|
|
6815
7142
|
name: Id128Schema,
|
|
6816
|
-
input:
|
|
6817
|
-
rawInput:
|
|
6818
|
-
result:
|
|
6819
|
-
isError:
|
|
6820
|
-
pending:
|
|
7143
|
+
input: z9.record(z9.string(), z9.unknown()).optional(),
|
|
7144
|
+
rawInput: z9.string().max(1e4).optional(),
|
|
7145
|
+
result: z9.unknown().optional(),
|
|
7146
|
+
isError: z9.boolean().optional(),
|
|
7147
|
+
pending: z9.boolean()
|
|
6821
7148
|
})
|
|
6822
7149
|
]);
|
|
6823
|
-
var StoredMessageSchema =
|
|
6824
|
-
role:
|
|
6825
|
-
content:
|
|
6826
|
-
parts:
|
|
7150
|
+
var StoredMessageSchema = z9.object({
|
|
7151
|
+
role: z9.enum(["user", "assistant"]),
|
|
7152
|
+
content: z9.string().max(1e5),
|
|
7153
|
+
parts: z9.array(MessagePartSchema).max(200).optional()
|
|
6827
7154
|
});
|
|
6828
7155
|
async function conversationCwd(conv) {
|
|
6829
7156
|
return resolveConversationCwd(conv.id);
|
|
@@ -6840,7 +7167,7 @@ var chatRouter = router({
|
|
|
6840
7167
|
* et sans le même filtre il y reversait toutes les conversations de la
|
|
6841
7168
|
* machine, une seconde après un chargement pourtant filtré.
|
|
6842
7169
|
*/
|
|
6843
|
-
onChanged: protectedProcedure.input(
|
|
7170
|
+
onChanged: protectedProcedure.input(z9.object({
|
|
6844
7171
|
projectId: Id128Schema.optional(),
|
|
6845
7172
|
orgId: Id128Schema.nullable().optional()
|
|
6846
7173
|
}).optional()).subscription(async function* ({ input }) {
|
|
@@ -6888,7 +7215,7 @@ var chatRouter = router({
|
|
|
6888
7215
|
* reachable where they were written, without leaking into every other
|
|
6889
7216
|
* organization's projects.
|
|
6890
7217
|
*/
|
|
6891
|
-
list: protectedProcedure.input(
|
|
7218
|
+
list: protectedProcedure.input(z9.object({
|
|
6892
7219
|
projectId: Id128Schema.optional(),
|
|
6893
7220
|
orgId: Id128Schema.nullable().optional()
|
|
6894
7221
|
}).optional()).query(async ({ input }) => {
|
|
@@ -6896,24 +7223,24 @@ var chatRouter = router({
|
|
|
6896
7223
|
if (!projectId) return conversationStore.list();
|
|
6897
7224
|
return conversationStore.listForProject({ id: projectId, orgId: input?.orgId });
|
|
6898
7225
|
}),
|
|
6899
|
-
get: protectedProcedure.input(
|
|
7226
|
+
get: protectedProcedure.input(z9.object({ id: Id128Schema })).query(async ({ input }) => {
|
|
6900
7227
|
const conv = await conversationStore.get(input.id);
|
|
6901
7228
|
if (!conv) throw new TRPCError4({ code: "NOT_FOUND", message: "Conversation not found" });
|
|
6902
7229
|
return conv;
|
|
6903
7230
|
}),
|
|
6904
|
-
create: protectedProcedure.input(
|
|
7231
|
+
create: protectedProcedure.input(z9.object({
|
|
6905
7232
|
title: ShortString200Schema.optional(),
|
|
6906
|
-
isCli:
|
|
6907
|
-
runner:
|
|
7233
|
+
isCli: z9.boolean().optional(),
|
|
7234
|
+
runner: z9.enum(["claude-code", "codex"]).optional(),
|
|
6908
7235
|
providerId: Id128Schema.optional(),
|
|
6909
7236
|
scenarioId: Id128Schema.optional(),
|
|
6910
|
-
scenarioInput:
|
|
7237
|
+
scenarioInput: z9.string().max(1e5).optional(),
|
|
6911
7238
|
kanbanBoardId: Id128Schema.optional(),
|
|
6912
7239
|
kanbanCardId: Id128Schema.optional(),
|
|
6913
7240
|
// The project the conversation is about: only the caller knows which
|
|
6914
7241
|
// one it is looking at.
|
|
6915
7242
|
projectId: Id128Schema.optional(),
|
|
6916
|
-
orgId:
|
|
7243
|
+
orgId: z9.string().max(128).nullable().optional()
|
|
6917
7244
|
})).mutation(async ({ input }) => {
|
|
6918
7245
|
let scenario = null;
|
|
6919
7246
|
if (input.scenarioId) {
|
|
@@ -6947,13 +7274,13 @@ var chatRouter = router({
|
|
|
6947
7274
|
}
|
|
6948
7275
|
return conv;
|
|
6949
7276
|
}),
|
|
6950
|
-
update: protectedProcedure.input(
|
|
7277
|
+
update: protectedProcedure.input(z9.object({
|
|
6951
7278
|
id: Id128Schema,
|
|
6952
7279
|
title: ShortString200Schema.optional(),
|
|
6953
|
-
messages:
|
|
6954
|
-
contextUsage:
|
|
6955
|
-
inputTokens:
|
|
6956
|
-
contextWindow:
|
|
7280
|
+
messages: z9.array(StoredMessageSchema).max(500).optional(),
|
|
7281
|
+
contextUsage: z9.object({
|
|
7282
|
+
inputTokens: z9.number().int().nonnegative(),
|
|
7283
|
+
contextWindow: z9.number().int().positive()
|
|
6957
7284
|
}).optional()
|
|
6958
7285
|
})).mutation(async ({ input }) => {
|
|
6959
7286
|
const conv = await conversationStore.update(input.id, { title: input.title, messages: input.messages, contextUsage: input.contextUsage });
|
|
@@ -6967,10 +7294,10 @@ var chatRouter = router({
|
|
|
6967
7294
|
* messages, et un réglage qui voyage avec 500 messages se perdrait dans un
|
|
6968
7295
|
* patch dont ce n'est pas le sujet.
|
|
6969
7296
|
*/
|
|
6970
|
-
setCompanion: protectedProcedure.input(
|
|
7297
|
+
setCompanion: protectedProcedure.input(z9.object({
|
|
6971
7298
|
id: Id128Schema,
|
|
6972
|
-
enabled:
|
|
6973
|
-
runner:
|
|
7299
|
+
enabled: z9.boolean(),
|
|
7300
|
+
runner: z9.enum(["claude-code", "codex"]).optional()
|
|
6974
7301
|
})).mutation(async ({ input }) => {
|
|
6975
7302
|
const existing = await conversationStore.get(input.id);
|
|
6976
7303
|
if (!existing) throw new TRPCError4({ code: "NOT_FOUND", message: "Conversation not found" });
|
|
@@ -6993,7 +7320,7 @@ var chatRouter = router({
|
|
|
6993
7320
|
* compagnon silencieux parce qu'il n'avait rien à dire et un message qui
|
|
6994
7321
|
* n'a pas pu être transmis se ressemblent parfaitement sans cette trace.
|
|
6995
7322
|
*/
|
|
6996
|
-
companionDelivery: protectedProcedure.input(
|
|
7323
|
+
companionDelivery: protectedProcedure.input(z9.object({ id: Id128Schema })).query(async ({ input }) => {
|
|
6997
7324
|
const conv = await conversationStore.get(input.id);
|
|
6998
7325
|
const companionId = conv?.companionConversationId;
|
|
6999
7326
|
const running = isCompanionThinking(input.id) || (companionId ? activeSessionRegistry.get(companionId)?.status === "running" : false);
|
|
@@ -7043,7 +7370,7 @@ var chatRouter = router({
|
|
|
7043
7370
|
* route emprunte exactement le chemin de livraison, sans le jugement, et
|
|
7044
7371
|
* rend PAR OÙ le message est passé.
|
|
7045
7372
|
*/
|
|
7046
|
-
testCompanionBridge: protectedProcedure.input(
|
|
7373
|
+
testCompanionBridge: protectedProcedure.input(z9.object({ id: Id128Schema })).mutation(async ({ input }) => {
|
|
7047
7374
|
const conv = await conversationStore.get(input.id);
|
|
7048
7375
|
if (!conv) throw new TRPCError4({ code: "NOT_FOUND", message: "Conversation not found" });
|
|
7049
7376
|
const route = await deliverToMainConversation(
|
|
@@ -7064,7 +7391,7 @@ var chatRouter = router({
|
|
|
7064
7391
|
* entier, bien plus qu'une requête ne doit rester ouverte. L'interface suit
|
|
7065
7392
|
* l'avancement par l'état poussé « il relit », déjà en place.
|
|
7066
7393
|
*/
|
|
7067
|
-
runCompanionNow: protectedProcedure.input(
|
|
7394
|
+
runCompanionNow: protectedProcedure.input(z9.object({ id: Id128Schema })).mutation(async ({ input }) => {
|
|
7068
7395
|
const conv = await conversationStore.get(input.id);
|
|
7069
7396
|
if (!conv) throw new TRPCError4({ code: "NOT_FOUND", message: "Conversation not found" });
|
|
7070
7397
|
if (conv.isCompanion) {
|
|
@@ -7081,7 +7408,7 @@ var chatRouter = router({
|
|
|
7081
7408
|
});
|
|
7082
7409
|
return { started: true };
|
|
7083
7410
|
}),
|
|
7084
|
-
delete: protectedProcedure.input(
|
|
7411
|
+
delete: protectedProcedure.input(z9.object({ id: Id128Schema })).mutation(async ({ input }) => {
|
|
7085
7412
|
const existing = await conversationStore.get(input.id);
|
|
7086
7413
|
if (!existing) throw new TRPCError4({ code: "NOT_FOUND", message: "Conversation not found" });
|
|
7087
7414
|
resetRelaunches(input.id);
|
|
@@ -7109,12 +7436,12 @@ var chatRouter = router({
|
|
|
7109
7436
|
(err) => console.error("[chat.delete] Image cleanup error:", err)
|
|
7110
7437
|
);
|
|
7111
7438
|
}),
|
|
7112
|
-
archive: protectedProcedure.input(
|
|
7439
|
+
archive: protectedProcedure.input(z9.object({ id: Id128Schema, archived: z9.boolean() })).mutation(async ({ input }) => {
|
|
7113
7440
|
const conv = await conversationStore.update(input.id, { archived: input.archived });
|
|
7114
7441
|
if (!conv) throw new TRPCError4({ code: "NOT_FOUND", message: "Conversation not found" });
|
|
7115
7442
|
return conv;
|
|
7116
7443
|
}),
|
|
7117
|
-
pin: protectedProcedure.input(
|
|
7444
|
+
pin: protectedProcedure.input(z9.object({ id: Id128Schema, pinned: z9.boolean() })).mutation(async ({ input }) => {
|
|
7118
7445
|
const conv = await conversationStore.setPinned(input.id, input.pinned);
|
|
7119
7446
|
if (!conv) throw new TRPCError4({ code: "NOT_FOUND", message: "Conversation not found" });
|
|
7120
7447
|
return conv;
|
|
@@ -7122,16 +7449,16 @@ var chatRouter = router({
|
|
|
7122
7449
|
// L'ordre ne vaut que pour les ids donnés : l'écran ne connaît que les
|
|
7123
7450
|
// conversations du projet courant, et les épinglées des autres projets
|
|
7124
7451
|
// n'ont pas à bouger parce qu'on a rangé celles-ci.
|
|
7125
|
-
reorderPinned: protectedProcedure.input(
|
|
7452
|
+
reorderPinned: protectedProcedure.input(z9.object({ ids: z9.array(Id128Schema).max(500) })).mutation(async ({ input }) => {
|
|
7126
7453
|
await conversationStore.reorderPinned(input.ids);
|
|
7127
7454
|
})
|
|
7128
7455
|
}),
|
|
7129
|
-
listModels: protectedProcedure.input(
|
|
7456
|
+
listModels: protectedProcedure.input(z9.object({
|
|
7130
7457
|
providerId: Id128Schema.optional(),
|
|
7131
7458
|
// Le projet dit de quelle organisation lire les fournisseurs ; absent,
|
|
7132
7459
|
// ce sont ceux du poste.
|
|
7133
7460
|
projectId: Id128Schema.optional(),
|
|
7134
|
-
orgId:
|
|
7461
|
+
orgId: z9.string().max(128).nullable().optional()
|
|
7135
7462
|
}).optional()).query(async ({ input }) => {
|
|
7136
7463
|
const active = await getActiveProvider(
|
|
7137
7464
|
input?.providerId,
|
|
@@ -7144,7 +7471,7 @@ var chatRouter = router({
|
|
|
7144
7471
|
return [];
|
|
7145
7472
|
}
|
|
7146
7473
|
}),
|
|
7147
|
-
checkCliAvailability: protectedProcedure.input(
|
|
7474
|
+
checkCliAvailability: protectedProcedure.input(z9.object({ agentId: Id128Schema.optional() }).optional()).query(async ({ input }) => {
|
|
7148
7475
|
if (input?.agentId) {
|
|
7149
7476
|
try {
|
|
7150
7477
|
const res = await agentManager.agentQuery(
|
|
@@ -7162,12 +7489,12 @@ var chatRouter = router({
|
|
|
7162
7489
|
]);
|
|
7163
7490
|
return { available: claudeOk, codexAvailable: codexOk };
|
|
7164
7491
|
}),
|
|
7165
|
-
enhanceScenarioPrompt: protectedProcedure.input(
|
|
7166
|
-
text:
|
|
7492
|
+
enhanceScenarioPrompt: protectedProcedure.input(z9.object({
|
|
7493
|
+
text: z9.string().max(1e4),
|
|
7167
7494
|
providerId: Id128Schema.optional(),
|
|
7168
|
-
model:
|
|
7495
|
+
model: z9.string().max(200).optional(),
|
|
7169
7496
|
projectId: Id128Schema.optional(),
|
|
7170
|
-
orgId:
|
|
7497
|
+
orgId: z9.string().max(128).nullable().optional()
|
|
7171
7498
|
})).mutation(async ({ input }) => {
|
|
7172
7499
|
const active = await getActiveProvider(
|
|
7173
7500
|
input.providerId,
|
|
@@ -7224,22 +7551,22 @@ Return ONLY the improved text, no explanation, no preamble.`;
|
|
|
7224
7551
|
}
|
|
7225
7552
|
}),
|
|
7226
7553
|
getStreamingStatus: protectedProcedure.query(() => activeSessionRegistry.listActive()),
|
|
7227
|
-
stopSession: protectedProcedure.input(
|
|
7554
|
+
stopSession: protectedProcedure.input(z9.object({ conversationId: ConversationIdSchema })).mutation(({ input }) => {
|
|
7228
7555
|
if (process.env.RUNEYA_DEBUG) console.log("[chat]: stopSession");
|
|
7229
7556
|
const killed = activeSessionRegistry.kill(input.conversationId);
|
|
7230
7557
|
if (!killed) throw new TRPCError4({ code: "NOT_FOUND", message: "No active session for this conversation" });
|
|
7231
7558
|
return { ok: true };
|
|
7232
7559
|
}),
|
|
7233
|
-
streamViaClaudeCode: protectedProcedure.input(
|
|
7560
|
+
streamViaClaudeCode: protectedProcedure.input(z9.object({
|
|
7234
7561
|
conversationId: ConversationIdSchema,
|
|
7235
|
-
prompt:
|
|
7236
|
-
contextNote:
|
|
7562
|
+
prompt: z9.string().max(1e5),
|
|
7563
|
+
contextNote: z9.string().max(2e5).optional(),
|
|
7237
7564
|
model: ShortString200Schema.optional(),
|
|
7238
|
-
effort:
|
|
7239
|
-
reconnect:
|
|
7565
|
+
effort: z9.enum(["low", "medium", "high"]).optional(),
|
|
7566
|
+
reconnect: z9.boolean().optional(),
|
|
7240
7567
|
agentId: Id128Schema.optional(),
|
|
7241
|
-
environmentId:
|
|
7242
|
-
imageIds:
|
|
7568
|
+
environmentId: z9.string().max(128).optional(),
|
|
7569
|
+
imageIds: z9.array(z9.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i)).max(5).optional(),
|
|
7243
7570
|
imageParts: ImagePartsSchema
|
|
7244
7571
|
})).subscription(async function* ({ input, ctx, signal }) {
|
|
7245
7572
|
if (process.env.RUNEYA_DEBUG) console.log("[chat]: Reconnect");
|
|
@@ -7341,15 +7668,15 @@ ${imagePaths.map((p) => `Image: ${p}`).join("\n")}` : cliPrompt;
|
|
|
7341
7668
|
if (process.env.RUNEYA_DEBUG) console.log("[chat]: drainSession...");
|
|
7342
7669
|
yield* drainSession(session, signal, false);
|
|
7343
7670
|
}),
|
|
7344
|
-
streamViaCodex: protectedProcedure.input(
|
|
7671
|
+
streamViaCodex: protectedProcedure.input(z9.object({
|
|
7345
7672
|
conversationId: ConversationIdSchema,
|
|
7346
|
-
prompt:
|
|
7347
|
-
contextNote:
|
|
7673
|
+
prompt: z9.string().max(1e5),
|
|
7674
|
+
contextNote: z9.string().max(2e5).optional(),
|
|
7348
7675
|
model: ShortString200Schema.optional(),
|
|
7349
|
-
reconnect:
|
|
7676
|
+
reconnect: z9.boolean().optional(),
|
|
7350
7677
|
agentId: Id128Schema.optional(),
|
|
7351
|
-
environmentId:
|
|
7352
|
-
imageIds:
|
|
7678
|
+
environmentId: z9.string().max(128).optional(),
|
|
7679
|
+
imageIds: z9.array(z9.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i)).max(5).optional(),
|
|
7353
7680
|
imageParts: ImagePartsSchema
|
|
7354
7681
|
})).subscription(async function* ({ input, ctx, signal }) {
|
|
7355
7682
|
const existingSession = activeSessionRegistry.get(input.conversationId);
|
|
@@ -7419,13 +7746,13 @@ ${input.prompt}` : input.prompt;
|
|
|
7419
7746
|
});
|
|
7420
7747
|
yield* drainSession(session, signal, false);
|
|
7421
7748
|
}),
|
|
7422
|
-
send: protectedProcedure.input(
|
|
7749
|
+
send: protectedProcedure.input(z9.object({
|
|
7423
7750
|
conversationId: ConversationIdSchema,
|
|
7424
|
-
messages:
|
|
7751
|
+
messages: z9.array(MessageSchema).min(0).max(100),
|
|
7425
7752
|
model: ShortString200Schema.optional(),
|
|
7426
|
-
contextNote:
|
|
7427
|
-
reconnect:
|
|
7428
|
-
imageIds:
|
|
7753
|
+
contextNote: z9.string().max(2e5).optional(),
|
|
7754
|
+
reconnect: z9.boolean().optional(),
|
|
7755
|
+
imageIds: z9.array(z9.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i)).max(5).optional(),
|
|
7429
7756
|
imageParts: ImagePartsSchema
|
|
7430
7757
|
})).subscription(async function* ({ input, ctx, signal }) {
|
|
7431
7758
|
const existingSession = activeSessionRegistry.get(input.conversationId);
|
|
@@ -7438,6 +7765,7 @@ ${input.prompt}` : input.prompt;
|
|
|
7438
7765
|
}
|
|
7439
7766
|
const conv = await conversationStore.get(input.conversationId);
|
|
7440
7767
|
const convRef = conv ? await conversationStore.projectRefOf(conv) : null;
|
|
7768
|
+
const anchor2 = { projectId: convRef?.id, orgId: convRef?.orgId ?? void 0 };
|
|
7441
7769
|
const active = await getActiveProvider(conv?.providerId, convRef?.orgId ?? void 0);
|
|
7442
7770
|
if (!active) {
|
|
7443
7771
|
throw new TRPCError4({
|
|
@@ -7486,7 +7814,7 @@ ${input.prompt}` : input.prompt;
|
|
|
7486
7814
|
}
|
|
7487
7815
|
return { role: m.role, content: m.content };
|
|
7488
7816
|
});
|
|
7489
|
-
gen = runAnthropic(client, model, system, msgs, apiKey, authToken, apiSignal);
|
|
7817
|
+
gen = runAnthropic(client, model, system, msgs, apiKey, authToken, apiSignal, anchor2);
|
|
7490
7818
|
} else if (provider.provider in OPENAI_COMPAT_BASE_URLS) {
|
|
7491
7819
|
const baseURL = OPENAI_COMPAT_BASE_URLS[provider.provider];
|
|
7492
7820
|
const client = new OpenAI2({ apiKey: plaintextKey || "ollama", baseURL });
|
|
@@ -7505,7 +7833,7 @@ ${input.prompt}` : input.prompt;
|
|
|
7505
7833
|
return { role: m.role, content: m.content };
|
|
7506
7834
|
})
|
|
7507
7835
|
];
|
|
7508
|
-
gen = runOpenAI(client, model, msgs, apiKey, authToken, apiSignal);
|
|
7836
|
+
gen = runOpenAI(client, model, msgs, apiKey, authToken, apiSignal, anchor2);
|
|
7509
7837
|
} else {
|
|
7510
7838
|
activeSessionRegistry.pushEvent(input.conversationId, { type: "error", message: `Provider "${provider.provider}" is not supported.` });
|
|
7511
7839
|
activeSessionRegistry.pushEvent(input.conversationId, { type: "done", text: "" });
|
|
@@ -7538,25 +7866,25 @@ ${input.prompt}` : input.prompt;
|
|
|
7538
7866
|
// ── PTY passthrough (interactive Claude Code session) ────────────────────
|
|
7539
7867
|
pty: router({
|
|
7540
7868
|
/** Start a PTY session running `claude --resume <sessionId>` (or fresh). */
|
|
7541
|
-
start: protectedProcedure.input(
|
|
7542
|
-
agentId:
|
|
7543
|
-
sessionId:
|
|
7544
|
-
runner:
|
|
7545
|
-
resume:
|
|
7546
|
-
model:
|
|
7547
|
-
cwd:
|
|
7869
|
+
start: protectedProcedure.input(z9.object({
|
|
7870
|
+
agentId: z9.string().max(128).optional(),
|
|
7871
|
+
sessionId: z9.string().max(128).optional(),
|
|
7872
|
+
runner: z9.enum(["claude-code", "codex"]).default("claude-code"),
|
|
7873
|
+
resume: z9.boolean().default(false),
|
|
7874
|
+
model: z9.string().max(128).optional(),
|
|
7875
|
+
cwd: z9.string().max(4096).optional(),
|
|
7548
7876
|
/** Anchors the session when no explicit cwd is given. */
|
|
7549
|
-
serviceId:
|
|
7877
|
+
serviceId: z9.string().max(128).optional(),
|
|
7550
7878
|
projectId: Id128Schema.optional(),
|
|
7551
|
-
orgId:
|
|
7552
|
-
cols:
|
|
7553
|
-
rows:
|
|
7554
|
-
enableMcp:
|
|
7555
|
-
apiBaseUrl:
|
|
7556
|
-
environmentId:
|
|
7557
|
-
attachedContexts:
|
|
7558
|
-
label:
|
|
7559
|
-
text:
|
|
7879
|
+
orgId: z9.string().max(128).nullable().optional(),
|
|
7880
|
+
cols: z9.number().int().min(1).max(1e3).default(120),
|
|
7881
|
+
rows: z9.number().int().min(1).max(1e3).default(30),
|
|
7882
|
+
enableMcp: z9.boolean().default(false),
|
|
7883
|
+
apiBaseUrl: z9.string().max(512).optional(),
|
|
7884
|
+
environmentId: z9.string().max(128).optional(),
|
|
7885
|
+
attachedContexts: z9.array(z9.object({
|
|
7886
|
+
label: z9.string().max(200),
|
|
7887
|
+
text: z9.string().max(1e6)
|
|
7560
7888
|
})).max(20).optional()
|
|
7561
7889
|
})).mutation(async ({ input, ctx }) => {
|
|
7562
7890
|
const t0 = Date.now();
|
|
@@ -7714,10 +8042,10 @@ Context:
|
|
|
7714
8042
|
return { spawnId: res.spawnId, agentId, reattached: false };
|
|
7715
8043
|
}),
|
|
7716
8044
|
/** Subscribe to PTY output stream (raw text with ANSI). */
|
|
7717
|
-
stream: protectedProcedure.input(
|
|
7718
|
-
agentId:
|
|
7719
|
-
spawnId:
|
|
7720
|
-
fromOffset:
|
|
8045
|
+
stream: protectedProcedure.input(z9.object({
|
|
8046
|
+
agentId: z9.string().max(128).optional(),
|
|
8047
|
+
spawnId: z9.string().max(128),
|
|
8048
|
+
fromOffset: z9.number().int().min(0).default(0)
|
|
7721
8049
|
})).subscription(async function* ({ input, signal }) {
|
|
7722
8050
|
const agentId = input.agentId ?? agentManager.getDefaultAgentId();
|
|
7723
8051
|
if (!agentId) throw new TRPCError4({ code: "PRECONDITION_FAILED", message: "No agent available" });
|
|
@@ -7772,10 +8100,10 @@ Context:
|
|
|
7772
8100
|
}
|
|
7773
8101
|
}),
|
|
7774
8102
|
/** Write input to a PTY session (keystrokes from xterm). */
|
|
7775
|
-
write: protectedProcedure.input(
|
|
7776
|
-
agentId:
|
|
7777
|
-
spawnId:
|
|
7778
|
-
data:
|
|
8103
|
+
write: protectedProcedure.input(z9.object({
|
|
8104
|
+
agentId: z9.string().max(128).optional(),
|
|
8105
|
+
spawnId: z9.string().max(128),
|
|
8106
|
+
data: z9.string().max(1e6)
|
|
7779
8107
|
})).mutation(async ({ input }) => {
|
|
7780
8108
|
const agentId = input.agentId ?? agentManager.getDefaultAgentId();
|
|
7781
8109
|
if (!agentId) throw new TRPCError4({ code: "PRECONDITION_FAILED", message: "No agent available" });
|
|
@@ -7785,11 +8113,11 @@ Context:
|
|
|
7785
8113
|
});
|
|
7786
8114
|
}),
|
|
7787
8115
|
/** Resize a PTY session. */
|
|
7788
|
-
resize: protectedProcedure.input(
|
|
7789
|
-
agentId:
|
|
7790
|
-
spawnId:
|
|
7791
|
-
cols:
|
|
7792
|
-
rows:
|
|
8116
|
+
resize: protectedProcedure.input(z9.object({
|
|
8117
|
+
agentId: z9.string().max(128).optional(),
|
|
8118
|
+
spawnId: z9.string().max(128),
|
|
8119
|
+
cols: z9.number().int().min(1).max(1e3),
|
|
8120
|
+
rows: z9.number().int().min(1).max(1e3)
|
|
7793
8121
|
})).mutation(async ({ input }) => {
|
|
7794
8122
|
const agentId = input.agentId ?? agentManager.getDefaultAgentId();
|
|
7795
8123
|
if (!agentId) throw new TRPCError4({ code: "PRECONDITION_FAILED", message: "No agent available" });
|
|
@@ -7805,11 +8133,11 @@ Context:
|
|
|
7805
8133
|
* picks it up. Returns the tmp path and which clipboard method succeeded
|
|
7806
8134
|
* (null if none — caller should inject `@<path>` instead of Ctrl+V).
|
|
7807
8135
|
*/
|
|
7808
|
-
pasteImage: protectedProcedure.input(
|
|
7809
|
-
agentId:
|
|
7810
|
-
sessionId:
|
|
7811
|
-
mimeType:
|
|
7812
|
-
base64:
|
|
8136
|
+
pasteImage: protectedProcedure.input(z9.object({
|
|
8137
|
+
agentId: z9.string().max(128).optional(),
|
|
8138
|
+
sessionId: z9.string().max(128).optional(),
|
|
8139
|
+
mimeType: z9.string().max(64),
|
|
8140
|
+
base64: z9.string().max(15e6)
|
|
7813
8141
|
})).mutation(async ({ input }) => {
|
|
7814
8142
|
const agentId = input.agentId ?? agentManager.getDefaultAgentId();
|
|
7815
8143
|
if (!agentId) throw new TRPCError4({ code: "PRECONDITION_FAILED", message: "No agent available" });
|
|
@@ -7827,7 +8155,7 @@ Context:
|
|
|
7827
8155
|
* Read the transcript Claude Code stores on disk for a given session.
|
|
7828
8156
|
* Returns parsed JSONL entries (user / assistant messages, tool uses, etc.).
|
|
7829
8157
|
*/
|
|
7830
|
-
transcript: protectedProcedure.input(
|
|
8158
|
+
transcript: protectedProcedure.input(z9.object({ sessionId: z9.string().max(128) })).query(async ({ input }) => {
|
|
7831
8159
|
return readClaudeTranscript(input.sessionId);
|
|
7832
8160
|
}),
|
|
7833
8161
|
/**
|
|
@@ -7835,9 +8163,9 @@ Context:
|
|
|
7835
8163
|
* when was the transcript JSONL last touched? Used by the non-PTY view
|
|
7836
8164
|
* to show a "Claude is thinking…" indicator while output streams.
|
|
7837
8165
|
*/
|
|
7838
|
-
activity: protectedProcedure.input(
|
|
7839
|
-
agentId:
|
|
7840
|
-
sessionId:
|
|
8166
|
+
activity: protectedProcedure.input(z9.object({
|
|
8167
|
+
agentId: z9.string().max(128).optional(),
|
|
8168
|
+
sessionId: z9.string().max(128)
|
|
7841
8169
|
})).query(async ({ input }) => {
|
|
7842
8170
|
const agentId = input.agentId ?? agentManager.getDefaultAgentId();
|
|
7843
8171
|
let running = false;
|
|
@@ -7863,7 +8191,7 @@ Context:
|
|
|
7863
8191
|
* them on the conversation, so the non-PTY chat view stays in sync.
|
|
7864
8192
|
* Uses the conversation id as session id (PTY sessions are spawned that way).
|
|
7865
8193
|
*/
|
|
7866
|
-
syncTranscript: protectedProcedure.input(
|
|
8194
|
+
syncTranscript: protectedProcedure.input(z9.object({ conversationId: ConversationIdSchema })).mutation(async ({ input }) => {
|
|
7867
8195
|
const conv = await conversationStore.get(input.conversationId);
|
|
7868
8196
|
if (!conv) {
|
|
7869
8197
|
throw new TRPCError4({ code: "NOT_FOUND", message: `Conversation ${input.conversationId} not found` });
|
|
@@ -7877,14 +8205,14 @@ Context:
|
|
|
7877
8205
|
* with the given sessionId. Used to benchmark the PTY → tRPC → xterm.js
|
|
7878
8206
|
* pipeline. Open the conversation in PTY mode to attach to it.
|
|
7879
8207
|
*/
|
|
7880
|
-
debugStress: protectedProcedure.input(
|
|
7881
|
-
sessionId:
|
|
7882
|
-
agentId:
|
|
7883
|
-
bytesPerSec:
|
|
7884
|
-
chunkSize:
|
|
7885
|
-
durationMs:
|
|
7886
|
-
cols:
|
|
7887
|
-
rows:
|
|
8208
|
+
debugStress: protectedProcedure.input(z9.object({
|
|
8209
|
+
sessionId: z9.string().max(128),
|
|
8210
|
+
agentId: z9.string().max(128).optional(),
|
|
8211
|
+
bytesPerSec: z9.number().int().min(100).max(1e7).default(5e4),
|
|
8212
|
+
chunkSize: z9.number().int().min(1).max(65536).default(256),
|
|
8213
|
+
durationMs: z9.number().int().min(0).max(36e5).default(0),
|
|
8214
|
+
cols: z9.number().int().min(1).max(1e3).default(120),
|
|
8215
|
+
rows: z9.number().int().min(1).max(1e3).default(30)
|
|
7888
8216
|
})).mutation(async ({ input }) => {
|
|
7889
8217
|
const agentId = input.agentId ?? agentManager.getDefaultAgentId();
|
|
7890
8218
|
if (!agentId) throw new TRPCError4({ code: "PRECONDITION_FAILED", message: "No agent available" });
|
|
@@ -7931,9 +8259,9 @@ Context:
|
|
|
7931
8259
|
return { spawnId: res.spawnId, agentId, stressSessionId };
|
|
7932
8260
|
}),
|
|
7933
8261
|
/** Kill a PTY session. */
|
|
7934
|
-
kill: protectedProcedure.input(
|
|
7935
|
-
agentId:
|
|
7936
|
-
spawnId:
|
|
8262
|
+
kill: protectedProcedure.input(z9.object({
|
|
8263
|
+
agentId: z9.string().max(128).optional(),
|
|
8264
|
+
spawnId: z9.string().max(128)
|
|
7937
8265
|
})).mutation(async ({ input }) => {
|
|
7938
8266
|
const agentId = input.agentId ?? agentManager.getDefaultAgentId();
|
|
7939
8267
|
if (!agentId) throw new TRPCError4({ code: "PRECONDITION_FAILED", message: "No agent available" });
|
|
@@ -7965,11 +8293,14 @@ export {
|
|
|
7965
8293
|
accountForOrgOrThrow,
|
|
7966
8294
|
cloudFetch,
|
|
7967
8295
|
readCloudIdentity,
|
|
8296
|
+
attachServiceToProject,
|
|
7968
8297
|
environmentOverridesStore,
|
|
8298
|
+
filterEnvForAi,
|
|
7969
8299
|
environmentResolver,
|
|
7970
8300
|
auditService,
|
|
7971
8301
|
isShareable,
|
|
7972
8302
|
logParserStore,
|
|
8303
|
+
buildServerBuiltins,
|
|
7973
8304
|
resolveWorkspaceCwd,
|
|
7974
8305
|
resolveAgentCwd,
|
|
7975
8306
|
resolveConversationCwd,
|
|
@@ -8011,4 +8342,4 @@ export {
|
|
|
8011
8342
|
startCliSession,
|
|
8012
8343
|
chatRouter
|
|
8013
8344
|
};
|
|
8014
|
-
//# sourceMappingURL=chunk-
|
|
8345
|
+
//# sourceMappingURL=chunk-2EDVDRKV.js.map
|