@vellumai/web 0.10.11-dev.202607231240.e03ec0b → 0.10.11-dev.202607231425.01b751a
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/dist/assets/{AnimatePresence-CrNVfOlf.js → AnimatePresence-BA3fB2ei.js} +1 -1
- package/dist/assets/{BundleConfirmPage-BhmdHqx5.js → BundleConfirmPage-CauU_qhn.js} +1 -1
- package/dist/assets/{a2a-invite-C_2qvwjb.js → a2a-invite-cGLd10KQ.js} +1 -1
- package/dist/assets/{about-page-Bhs6kxpo.js → about-page-DxY-GLXL.js} +1 -1
- package/dist/assets/{account-page-4OPGIzD3.js → account-page-CJL05A1-.js} +1 -1
- package/dist/assets/{account-shell-CRIf1eWb.js → account-shell-C7g85lC1.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-DpA07WFv.js → acp-run-detail-panel-BwBa75fG.js} +3 -3
- package/dist/assets/{activity-steps-panel-Eiuv4mEX.js → activity-steps-panel-CGuJeKMe.js} +1 -1
- package/dist/assets/add-credits-modal-CUUdRibP.js +1 -0
- package/dist/assets/ai-page-C4BPzWGf.js +1 -0
- package/dist/assets/{animated-avatar-Ca8ZnVID.js → animated-avatar-CKx95GOp.js} +1 -1
- package/dist/assets/api-B66zeRSp.js +1 -0
- package/dist/assets/{api-BB3OgWZK.js → api-Ck4M0sez.js} +1 -1
- package/dist/assets/{api-key-screen-C4-neX_1.js → api-key-screen-B7rj3ifH.js} +1 -1
- package/dist/assets/{app-info-CJOyAn-i.js → app-info-CBjmLxjK.js} +1 -1
- package/dist/assets/{archive-redirect-page-B0jMKMvB.js → archive-redirect-page-B2UOo_Rd.js} +1 -1
- package/dist/assets/{assistant-feature-flag-store-BV_nEYvU.js → assistant-feature-flag-store-DtWdHoc7.js} +1 -1
- package/dist/assets/assistant-identity-store-BbQGi1Z8.js +1 -0
- package/dist/assets/{assistant-status-panel-BTxCCenj.js → assistant-status-panel-DcXrFkHk.js} +1 -1
- package/dist/assets/{auth-store-De2L1iVx.js → auth-store-DTxOB4OE.js} +2 -2
- package/dist/assets/{background-task-detail-panel-C0ShhKn8.js → background-task-detail-panel-DRpWrTUH.js} +1 -1
- package/dist/assets/billing-page-pynIc_6F.js +3 -0
- package/dist/assets/{billing-redirect-page-CCvojrrt.js → billing-redirect-page-BEZ1VREv.js} +1 -1
- package/dist/assets/{bookmarks-page-DyHvBhzu.js → bookmarks-page-DpceEfEl.js} +1 -1
- package/dist/assets/{browser-H-XO-EFJ.js → browser-D1h4fzvz.js} +2 -2
- package/dist/assets/{build-state-BUBAQTn6.js → build-state-FPgtWXCB.js} +1 -1
- package/dist/assets/{capture-error-EqyiBCqE.js → capture-error-TIfXqClD.js} +1 -1
- package/dist/assets/{channels-page-route-CU-NT-sp.js → channels-page-route-RUouWpbe.js} +2 -2
- package/dist/assets/chat-CQOcunZy.js +1 -0
- package/dist/assets/chat-markdown-message-BkuowO-g.js +2 -0
- package/dist/assets/{checkbox-Cv54orKS.js → checkbox-Wmxrk7Ne.js} +1 -1
- package/dist/assets/chevron-right-DqqmezXC.js +1 -0
- package/dist/assets/{circle-check-D3NSGpeC.js → circle-alert-zOqdmf25.js} +1 -1
- package/dist/assets/circle-check-VSiny8yl.js +1 -0
- package/dist/assets/{client-feature-flag-store-ebKDvCeO.js → client-feature-flag-store-XF5x4WRY.js} +1 -1
- package/dist/assets/{client-identity-B8jJ42cg.js → client-identity-vi8PNDLe.js} +1 -1
- package/dist/assets/{command-palette-BNsQkO0X.js → command-palette--9oVa8R-.js} +1 -1
- package/dist/assets/{command-palette-window-page-BsWQwXLR.js → command-palette-window-page-C3FllbDk.js} +1 -1
- package/dist/assets/{community-page-BVnxLfgR.js → community-page-BomgVeP-.js} +1 -1
- package/dist/assets/{confirm-dialog-BX77s7Gd.js → confirm-dialog-Ca60m3Th.js} +1 -1
- package/dist/assets/{connect-page-BNwPFj0J.js → connect-page-Dduax_Xg.js} +1 -1
- package/dist/assets/consent-DkQodVPE.js +1 -0
- package/dist/assets/{consent-controls-BAMoad-r.js → consent-controls-BuwDMphC.js} +1 -1
- package/dist/assets/{contacts-gateway-cDndXLAC.js → contacts-gateway-CBtqc7-k.js} +1 -1
- package/dist/assets/contacts-page-route-wfOsHczd.js +1 -0
- package/dist/assets/{conversation-list-fetchers-yHqbkHwh.js → conversation-list-fetchers-BQTdMMYw.js} +1 -1
- package/dist/assets/{conversation-store-CyN6YmgF.js → conversation-store-CGwVWV9r.js} +1 -1
- package/dist/assets/credential-entry-page-DQKjh5mE.js +1 -0
- package/dist/assets/credentials-page-NIT9L3BA.js +1 -0
- package/dist/assets/{danger-zone-redirect-page-DikJsVox.js → danger-zone-redirect-page-DnfUglXc.js} +1 -1
- package/dist/assets/debug-page-TaVwWPeF.js +4 -0
- package/dist/assets/{deploy-dialogs-D6o8RDRh.js → deploy-dialogs-qqZ-07TN.js} +1 -1
- package/dist/assets/{detail-card-BO9_00mj.js → detail-card-DDyqflXI.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-D2LN59n8.js → detail-panel-stop-button-DwbUgrWc.js} +1 -1
- package/dist/assets/{developer-page-CIBxe5bO.js → developer-page-DkHVY8tv.js} +1 -1
- package/dist/assets/{devices-redirect-page-DfNHiW1h.js → devices-redirect-page-BzC1Xl3w.js} +1 -1
- package/dist/assets/{diagnostics-BMoK9V67.js → diagnostics-ADlglrSx.js} +1 -1
- package/dist/assets/{dictation-overlay-page-BZQ1IiWW.js → dictation-overlay-page-Cx5wqNkY.js} +1 -1
- package/dist/assets/{dist-u2usiFto.js → dist-BKQxiB9U.js} +1 -1
- package/dist/assets/{dist-V92C3kic.js → dist-DCQZ68wG.js} +1 -1
- package/dist/assets/{document-viewer-page-8cZSV3s1.js → document-viewer-page-CMKD-jaB.js} +1 -1
- package/dist/assets/{edge-swipe-arbiter-store-BsNe8Psb.js → edge-swipe-arbiter-store-DKOWYciE.js} +1 -1
- package/dist/assets/effective-timezone-DYkHWNkp.js +1 -0
- package/dist/assets/{emails-page-DZUaMVqR.js → emails-page-uoV0KOzm.js} +1 -1
- package/dist/assets/{environment-store-PamE9l4Q.js → environment-store-CJm9dJIK.js} +1 -1
- package/dist/assets/{esm-CE78YIFt.js → esm-BId8Y-2v.js} +2 -2
- package/dist/assets/esm-BJFBHGN0.js +2 -0
- package/dist/assets/esm-CyB7vjwO.js +2 -0
- package/dist/assets/esm-D2HzZNP6.js +2 -0
- package/dist/assets/esm-DjhYoTKt.js +1 -0
- package/dist/assets/esm-Q_30tLM_.js +2 -0
- package/dist/assets/esm-SYrS8Ge3.js +2 -0
- package/dist/assets/feature-flag-catalog-3X9uE40T.js +1 -0
- package/dist/assets/{file-editor-CMMPrgbN.js → file-editor-By7WMhZJ.js} +1 -1
- package/dist/assets/{file-markdown-CA8FY-7h.js → file-markdown-Cisl4Gl8.js} +1 -1
- package/dist/assets/general-page-BGVEgfaq.js +1 -0
- package/dist/assets/{get-memory-stats-C_2FuJIs.js → get-memory-stats-CgvcocQb.js} +1 -1
- package/dist/assets/{haptics-Dx0gd0A-.js → haptics-Cht1dTEa.js} +2 -2
- package/dist/assets/{hatching-screen-oBes6VQG.js → hatching-screen-CGjNqpv8.js} +1 -1
- package/dist/assets/home-page-route-ChbF9jcm.js +1 -0
- package/dist/assets/{hosting-screen-BlHWMQ5l.js → hosting-screen-c0p4HCgD.js} +1 -1
- package/dist/assets/{identity-page-route-Da3XAZFT.js → identity-page-route-B1_a70iD.js} +2 -2
- package/dist/assets/index-BF7oaBYU.css +2 -0
- package/dist/assets/index-k210BwEJ.js +217 -0
- package/dist/assets/{ingest-Bula8dIq.js → ingest-CHc1zI_k.js} +1 -1
- package/dist/assets/{inspect-page-D4RBNe7y.js → inspect-page-EcxNY9By.js} +4 -4
- package/dist/assets/integrations-page-CppAkYeB.js +1 -0
- package/dist/assets/{intelligence-layout-C5caw6j5.js → intelligence-layout-CYHTr5nz.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-redirect-page-ZpwBU1Wf.js → keyboard-shortcuts-redirect-page-CvIQqAte.js} +1 -1
- package/dist/assets/{latest-assistant-text-Ctd2fcCH.js → latest-assistant-text-Bs58sJYD.js} +1 -1
- package/dist/assets/{library-detail-page-BYC0dQ9v.js → library-detail-page-BDs0_nhX.js} +1 -1
- package/dist/assets/{library-page-BXyq_gmm.js → library-page-Dtbrouyk.js} +1 -1
- package/dist/assets/list-row-Ba2xWuBK.js +1 -0
- package/dist/assets/{local-mode-BZyeVbEM.js → local-mode-B3-gNTGk.js} +1 -1
- package/dist/assets/{login-flow-D3EZFl_S.js → login-flow-DC2qOXLZ.js} +1 -1
- package/dist/assets/{login-page-cM7o1FYs.js → login-page-Bi6YeHOR.js} +1 -1
- package/dist/assets/{logout-page-D_X1y-aM.js → logout-page-BVu0XGSv.js} +1 -1
- package/dist/assets/{logs-layout-D-XkuO-J.js → logs-layout-DO1bRGGl.js} +1 -1
- package/dist/assets/{memory-page-route-DyJRk3Ol.js → memory-page-route-Be_2ZoRM.js} +1 -1
- package/dist/assets/{memory-router-playground-page-Bwqn_yOk.js → memory-router-playground-page-CcY5flWJ.js} +1 -1
- package/dist/assets/menu-D6Zd1pD0.js +1 -0
- package/dist/assets/{messages-BmjvhRSR.js → messages-eSEnt1cZ.js} +1 -1
- package/dist/assets/{metric-card-wLFNcpzT.js → metric-card-BmlEw91t.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-vBwxPgat.js → mobile-sidebar-drawer-ipZMZ-xV.js} +1 -1
- package/dist/assets/{modal-uxv7vVf7.js → modal-B5LIURGT.js} +1 -1
- package/dist/assets/mutation-error-CTl5_tRJ.js +1 -0
- package/dist/assets/native-anchor-BP5lOvKS.js +1 -0
- package/dist/assets/{native-biometric-CEVNJbma.js → native-biometric-C77WIZgU.js} +1 -1
- package/dist/assets/{native-file-CU9AlxYs.js → native-file-DOWRMAg4.js} +2 -2
- package/dist/assets/notice-rXKtDAyE.js +1 -0
- package/dist/assets/{notifications-page-D4Why7e5.js → notifications-page-DkQqbAOQ.js} +1 -1
- package/dist/assets/{oauth-complete-page-8lBwq15D.js → oauth-complete-page-BgWGaJNm.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-B3v-dJhq.js → oauth-popup-complete-page-CozFGOGr.js} +1 -1
- package/dist/assets/{onboarding-store-9Wpl8g1M.js → onboarding-store-C_c7S4PW.js} +1 -1
- package/dist/assets/{page-empty-state-fHq773BH.js → page-empty-state-Bmd9bsUe.js} +1 -1
- package/dist/assets/{page-shell-CL8sbGeM.js → page-shell-DESP4OEm.js} +1 -1
- package/dist/assets/pairing-page-BC8Q8HwB.js +1 -0
- package/dist/assets/panel-item-C55DV5jS.js +1 -0
- package/dist/assets/{password-reset-page-DQRqCWH2.js → password-reset-page-CU7hOacp.js} +1 -1
- package/dist/assets/{personality-page-BJulFBDf.js → personality-page-CPd40A6i.js} +1 -1
- package/dist/assets/{plans-page-BXtSJKgK.js → plans-page-CRNM4_oU.js} +1 -1
- package/dist/assets/{platform-detection-Ce1c9UX-.js → platform-detection-BuN9WnU3.js} +1 -1
- package/dist/assets/{platform-loopback-page-B_59Xlo3.js → platform-loopback-page-BVTNsb_k.js} +1 -1
- package/dist/assets/{plugin-detail-page-9HIVa5Vm.js → plugin-detail-page-CVPn5S0Z.js} +1 -1
- package/dist/assets/{plugins-page-RWeARJbM.js → plugins-page-C-1mpbA_.js} +1 -1
- package/dist/assets/{popover-Cnk1lojt.js → popover-BBHEa1a8.js} +1 -1
- package/dist/assets/{prefs-Bijw1A1H.js → prefs-BXzVpbTP.js} +1 -1
- package/dist/assets/privacy-page-CfqPVgly.js +1 -0
- package/dist/assets/{privacy-screen-KR-ZQCyT.js → privacy-screen-Kjrw_8B8.js} +1 -1
- package/dist/assets/{provider-callback-page-CCreci4A.js → provider-callback-page-DyTWp0oC.js} +1 -1
- package/dist/assets/{provider-key-7P1U32J7.js → provider-key-C6AXXJ13.js} +1 -1
- package/dist/assets/{provider-signup-page-BI01h70b.js → provider-signup-page-C-W3FhGq.js} +1 -1
- package/dist/assets/{quick-input-page-DuL3u9Zx.js → quick-input-page-BKusvGp2.js} +1 -1
- package/dist/assets/{react-query.gen-BfXcRy9K.js → react-query.gen-Ckfv3u8n.js} +1 -1
- package/dist/assets/{react-query.gen-BmvBFzUQ.js → react-query.gen-Dx7ROyjY.js} +1 -1
- package/dist/assets/{remote-gateway-session-BfwzkHft.js → remote-gateway-session-D-_XM8ss.js} +1 -1
- package/dist/assets/{research-mock-page-D6WX-cSW.js → research-mock-page-CjRVsACC.js} +1 -1
- package/dist/assets/{research-onboarding-persistence-DpDo5irZ.js → research-onboarding-persistence-pmhIhd-d.js} +1 -1
- package/dist/assets/research-onboarding-route-ChqXyAd3.js +43 -0
- package/dist/assets/{resolved-assistants-store-SYKKvZcj.js → resolved-assistants-store-D4LlwCnB.js} +1 -1
- package/dist/assets/{review-terms-screen-BydxdOY-.js → review-terms-screen-Dz1jA1oY.js} +1 -1
- package/dist/assets/{risk-DVMoHqLD.js → risk-CMoNB8Wi.js} +1 -1
- package/dist/assets/{routes-DN3K5OaW.js → routes-CujiOvCG.js} +1 -1
- package/dist/assets/{schedules-CMEFglO5.js → schedules-C-Q7Xxpn.js} +1 -1
- package/dist/assets/schedules-page-ctpa_OJe.js +1 -0
- package/dist/assets/{sdk.gen-iPQMma2I.js → sdk.gen-BWZTl2s4.js} +1 -1
- package/dist/assets/{security-redirect-page-CLrTkvoP.js → security-redirect-page-Da4FaO7N.js} +1 -1
- package/dist/assets/select-assistant-screen-CsY3n-7c.js +1 -0
- package/dist/assets/{setting-row-WePcvVdj.js → setting-row-BB4qJf19.js} +1 -1
- package/dist/assets/{settings-divider-2u8AYyKP.js → settings-divider-C8AqP6uw.js} +1 -1
- package/dist/assets/{settings-layout-rKajYl2h.js → settings-layout-CGrUcocE.js} +1 -1
- package/dist/assets/{share-feedback-modal-CdzAko5b.js → share-feedback-modal-CFWnLFBk.js} +1 -1
- package/dist/assets/sidebar-tree-CPmL_ch0.js +1 -0
- package/dist/assets/{signup-page-CgumoZWg.js → signup-page-B2YeBW4P.js} +1 -1
- package/dist/assets/{signup-shell-Dh0n9N7x.js → signup-shell-nLh51_AY.js} +1 -1
- package/dist/assets/{site-favicon-D3w8K4_d.js → site-favicon-D_BNfccU.js} +1 -1
- package/dist/assets/{skill-detail-page-BSBVJgLg.js → skill-detail-page-BNi7e0TS.js} +1 -1
- package/dist/assets/{skill-detail-panel-BgWGaTm5.js → skill-detail-panel-_VZA61D4.js} +1 -1
- package/dist/assets/{skills-XlGzEtCF.js → skills-DP8q421k.js} +1 -1
- package/dist/assets/{skills-page-MVp92vg_.js → skills-page-D-O8Xrcb.js} +1 -1
- package/dist/assets/{sound-manager-BOkLPpIj.js → sound-manager-CUjq4DLM.js} +1 -1
- package/dist/assets/{sounds-page-DMXMPZE6.js → sounds-page-BF1DItdm.js} +1 -1
- package/dist/assets/{src-ChvLuWxs.js → src-eF1GUpNZ.js} +1 -1
- package/dist/assets/{start-screen-d-gvSaGT.js → start-screen-Bm9Enx4S.js} +1 -1
- package/dist/assets/subagent-detail-panel-sYKQ0Ek6.js +4 -0
- package/dist/assets/{subagent-store-Cob24ufO.js → subagent-store-CqCpvQ-t.js} +1 -1
- package/dist/assets/superpowers-page-BO6yulzk.js +1 -0
- package/dist/assets/{system-events-page-BSoTGIUe.js → system-events-page-CAhuoQWC.js} +1 -1
- package/dist/assets/{system-events-redirect-page-XQdMAHZt.js → system-events-redirect-page-CZdJ1Stb.js} +1 -1
- package/dist/assets/{tag-D4RWxz2r.js → tag-B2RIok_S.js} +1 -1
- package/dist/assets/{theme-stage-page-BhHJYDBU.js → theme-stage-page-CApzIge4.js} +1 -1
- package/dist/assets/{tiptap-document-editor-Z5gChK2b.js → tiptap-document-editor-D-jnycTq.js} +1 -1
- package/dist/assets/toast-CWA3SxUv.js +1 -0
- package/dist/assets/{tool-detail-panel-3ertbTbW.js → tool-detail-panel-DtU7j-Mu.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-CyhuTbkj.js → upgrade-cancel-page-Co7H03gg.js} +1 -1
- package/dist/assets/upgrade-success-page-JBppz3Kz.js +1 -0
- package/dist/assets/{usage-redirect-page-KsmA-vdi.js → usage-redirect-page-BN8e-Hl7.js} +1 -1
- package/dist/assets/{use-active-assistant-id-COiCJBSe.js → use-active-assistant-id-CNvX2Z8T.js} +1 -1
- package/dist/assets/{use-assistant-identity-details-BvTE3c_d.js → use-assistant-identity-details-BpSJpsKz.js} +1 -1
- package/dist/assets/{use-bus-subscription-B3Mg2dYP.js → use-bus-subscription-Ccs0Qaht.js} +1 -1
- package/dist/assets/use-checkout-dismiss-refresh-D2b9-nhq.js +1 -0
- package/dist/assets/{use-edge-swipe-back-24qRhD5r.js → use-edge-swipe-back-Cdp_SxuJ.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-t9tfAo4w.js → use-invite-link-dialog-Bn8eMH1-.js} +1 -1
- package/dist/assets/use-is-org-ready-763-33xE.js +1 -0
- package/dist/assets/{use-onboarding-login-HSH-s-Ny.js → use-onboarding-login-BbWOyFOC.js} +1 -1
- package/dist/assets/{use-reduced-motion-BsOusnBw.js → use-reduced-motion-CxP6vGgk.js} +1 -1
- package/dist/assets/{use-skill-actions-BuaWaFN2.js → use-skill-actions-Ct1Cecpq.js} +1 -1
- package/dist/assets/{use-skill-detail-files-Sd7BIZjr.js → use-skill-detail-files-CnQo2_L-.js} +1 -1
- package/dist/assets/{utils-CuIE4SGk.js → utils-CuX5xnER.js} +1 -1
- package/dist/assets/{viewer-store-CfzJBHeW.js → viewer-store-C6GyeuCm.js} +1 -1
- package/dist/assets/{voice-page-DW1aQd2C.js → voice-page-DvcHCFE7.js} +1 -1
- package/dist/assets/{weather-forecast-display-KE1aZQ9y.js → weather-forecast-display-W2Pr7o7-.js} +1 -1
- package/dist/assets/{web-X3cVWBmL.js → web-4APZHMYt.js} +1 -1
- package/dist/assets/{web-iTUVH6bP.js → web-9pGh4GZq.js} +1 -1
- package/dist/assets/{web-CXqEfhsv.js → web-BXx5eD3w.js} +1 -1
- package/dist/assets/{web-B8PpmDG1.js → web-BaOSoBGc.js} +1 -1
- package/dist/assets/{web-CTttk_RP.js → web-BuG_pBKP.js} +1 -1
- package/dist/assets/{web-BezO5Yqj.js → web-CZmqng1v.js} +1 -1
- package/dist/assets/{web-QKBh228l.js → web-DDsyZCMo.js} +1 -1
- package/dist/assets/{web-DZrtuUub.js → web-bWtpgLmd.js} +1 -1
- package/dist/assets/{welcome-screen-DXo7RlC9.js → welcome-screen-CbipUYFT.js} +1 -1
- package/dist/assets/workflow-detail-panel-p4rw_7qr.js +1 -0
- package/dist/assets/workspace-page-D4ZjRaC7.js +1 -0
- package/dist/index.html +136 -134
- package/package.json +1 -1
- package/dist/assets/ai-page-Ilh8oEBA.js +0 -1
- package/dist/assets/api-BbpfHkAG.js +0 -1
- package/dist/assets/assistant-identity-store-D_L4IJs-.js +0 -1
- package/dist/assets/billing-page-J_cHaFA6.js +0 -3
- package/dist/assets/chat-CfDXQbUT.js +0 -1
- package/dist/assets/chat-markdown-message-Dc8j-__5.js +0 -2
- package/dist/assets/consent-CiBV3Dw0.js +0 -1
- package/dist/assets/contacts-page-route-F-zr1zVR.js +0 -1
- package/dist/assets/credential-entry-page-JYzRZbU2.js +0 -1
- package/dist/assets/credentials-page-C9cmfrBo.js +0 -1
- package/dist/assets/debug-page-DwzL-9GZ.js +0 -4
- package/dist/assets/effective-timezone-8F3mg6L0.js +0 -1
- package/dist/assets/esm-1g1ABQna.js +0 -2
- package/dist/assets/esm-1gvTMOWI.js +0 -1
- package/dist/assets/esm-BA6eIjn0.js +0 -2
- package/dist/assets/esm-DBQcNiJR.js +0 -2
- package/dist/assets/esm-DSupHsB6.js +0 -2
- package/dist/assets/esm-JfwPwkDG.js +0 -2
- package/dist/assets/feature-flag-catalog-Bkr5vS-F.js +0 -1
- package/dist/assets/general-page-DcPJAAiz.js +0 -1
- package/dist/assets/home-page-route-BFOTKfyB.js +0 -1
- package/dist/assets/index-D3N_a2Td.css +0 -2
- package/dist/assets/index-DA-27U7J.js +0 -217
- package/dist/assets/integrations-page-CtorNovo.js +0 -1
- package/dist/assets/list-row-BG3ohT9d.js +0 -1
- package/dist/assets/menu-B-5JB1WS.js +0 -1
- package/dist/assets/mutation-error-HFUttnbD.js +0 -1
- package/dist/assets/native-anchor-BSMnT3LA.js +0 -1
- package/dist/assets/notice-Bd1rN4YY.js +0 -1
- package/dist/assets/pairing-page-B5chxtcv.js +0 -1
- package/dist/assets/panel-item-BdWXckRy.js +0 -1
- package/dist/assets/privacy-page-C9rqm2o3.js +0 -1
- package/dist/assets/research-onboarding-route-B5No6fJE.js +0 -43
- package/dist/assets/schedules-page-DHC4G3MB.js +0 -1
- package/dist/assets/select-assistant-screen-D8tbxVLQ.js +0 -1
- package/dist/assets/sidebar-tree-FO-frXVZ.js +0 -1
- package/dist/assets/subagent-detail-panel-BXTIqhMk.js +0 -4
- package/dist/assets/superpowers-page-C6A1Vq8D.js +0 -1
- package/dist/assets/toast-CJSlHuX8.js +0 -1
- package/dist/assets/upgrade-success-page-BHfLu0ex.js +0 -1
- package/dist/assets/use-checkout-dismiss-refresh-B3XiCNx4.js +0 -1
- package/dist/assets/use-is-org-ready-DX9EbciC.js +0 -1
- package/dist/assets/workflow-detail-panel-Dmp1BJGa.js +0 -1
- package/dist/assets/workspace-page-CpRX-Yir.js +0 -1
- /package/dist/assets/{Combination-DLX0pSR-.js → Combination-DVPinsP-.js} +0 -0
- /package/dist/assets/{api-errors-DNWYjUzX.js → api-errors-D52GcK-c.js} +0 -0
- /package/dist/assets/{app-types-CTJGOi24.js → app-types-BkwrqrlW.js} +0 -0
- /package/dist/assets/{avatar-bundled-components-CMIiT9CS.js → avatar-bundled-components-CtSJhHTe.js} +0 -0
- /package/dist/assets/{avatar-svg-compositor-DQyPgWSC.js → avatar-svg-compositor-BfycUW-4.js} +0 -0
- /package/dist/assets/{browser-timezone-B2VEIYkv.js → browser-timezone-Pt5zHES5.js} +0 -0
- /package/dist/assets/{build.umd-DmVl_0fG.js → build.umd-BQvYt2GV.js} +0 -0
- /package/dist/assets/{by-tool-use-id-index-Czd_T_0A.js → by-tool-use-id-index-Dbdu-8Kf.js} +0 -0
- /package/dist/assets/{client.gen-6-_D0Y3s.js → client.gen-BgQlZ6XT.js} +0 -0
- /package/dist/assets/{clipboard-copy-0aofAwaM.js → clipboard-copy-DF6K1xc6.js} +0 -0
- /package/dist/assets/{clock-DO_4QDAG.js → clock-BfaF7UiJ.js} +0 -0
- /package/dist/assets/{cloud-off-Db1nySkc.js → cloud-off-D943IxQy.js} +0 -0
- /package/dist/assets/{code-Czx7d7SK.js → code-Dl3IekqV.js} +0 -0
- /package/dist/assets/{cpu-DeKH9ZSF.js → cpu-BjzPZZO7.js} +0 -0
- /package/dist/assets/{create-selectors-BbPasxJ6.js → create-selectors-CB3td4FB.js} +0 -0
- /package/dist/assets/{crown-BJwJq0zQ.js → crown-CbQRwy8n.js} +0 -0
- /package/dist/assets/{definitions-yX2e5E14.js → definitions-CM08vMFY.js} +0 -0
- /package/dist/assets/{definitions-CDlCrnSH.js → definitions-ybBJvS5F.js} +0 -0
- /package/dist/assets/{dist-CF8byLVe.js → dist-CJm2PFfi.js} +0 -0
- /package/dist/assets/{dist-5TMEu0DT.js → dist-DEnAtv43.js} +0 -0
- /package/dist/assets/{dist-BbIM5YOh2.js → dist-Df-tf9-G2.js} +0 -0
- /package/dist/assets/{domains-DMJk4PgF.js → domains-CHPH2UJ5.js} +0 -0
- /package/dist/assets/{download-CO38a5Al.js → download-CAuK-nZ6.js} +0 -0
- /package/dist/assets/{dropdown-Dftxb_kj.js → dropdown-CY4Pur0N.js} +0 -0
- /package/dist/assets/{emoji-catalog-data-BNtUmdK0.js → emoji-catalog-data--NL3EmUB.js} +0 -0
- /package/dist/assets/{event-bus-CLQzQrf8.js → event-bus-C7pTeNSK.js} +0 -0
- /package/dist/assets/{external-link-CfkE0LZW.js → external-link-Dqpx9nRm.js} +0 -0
- /package/dist/assets/{eye-cZNKsRpd.js → eye-CSkO4zr-.js} +0 -0
- /package/dist/assets/{eye-off-PTJlqk3s.js → eye-off-BZGLjMTP.js} +0 -0
- /package/dist/assets/{file-DcpGkiWZ.js → file-CZqt7Lfg.js} +0 -0
- /package/dist/assets/{file-text-CxRYK_Ja.js → file-text-YQjMPDid.js} +0 -0
- /package/dist/assets/{folder-open-DrhdMA1v.js → folder-open-Bc5csnpa.js} +0 -0
- /package/dist/assets/{format-file-size-CLx85Act.js → format-file-size-NlWnTYo4.js} +0 -0
- /package/dist/assets/{globe-DWcyIkcn.js → globe-CYmqQnbY.js} +0 -0
- /package/dist/assets/{hard-drive-BXlWvYOb.js → hard-drive-DwQCEDaH.js} +0 -0
- /package/dist/assets/{impersonate-version-flag-2MqdDMfJ.js → impersonate-version-flag-eNRXoBN4.js} +0 -0
- /package/dist/assets/{info-BuIjW2mw.js → info-DIYWVpY2.js} +0 -0
- /package/dist/assets/{input-CGhuhT4R.js → input-CqzWbhlg.js} +0 -0
- /package/dist/assets/{is-electron-f6weDa36.js → is-electron-DfdJ73pd.js} +0 -0
- /package/dist/assets/{key-round-CYcIcZBu.js → key-round-BNxuL6Ys.js} +0 -0
- /package/dist/assets/{link-2-Bm8BwcWP.js → link-2-B_lKjTgC.js} +0 -0
- /package/dist/assets/{link-click-CB6xDcAQ.js → link-click-cOqjA8PL.js} +0 -0
- /package/dist/assets/{loader-circle-CWO25Tky.js → loader-circle-DHHDfu74.js} +0 -0
- /package/dist/assets/{log-in-BjlTk4EE.js → log-in-UqkLJLYd.js} +0 -0
- /package/dist/assets/{machine-sizes-DzPByH40.js → machine-sizes-DzQNxnM-.js} +0 -0
- /package/dist/assets/{mic-BNPrFJt5.js → mic-Bt7m4Gub.js} +0 -0
- /package/dist/assets/{minimize-2-o3zKpK5v.js → minimize-2-D6r29tx3.js} +0 -0
- /package/dist/assets/{misc-DzJhdG9X.js → misc-BW2SfpvH.js} +0 -0
- /package/dist/assets/{monitor-DxSPqk61.js → monitor-Bg6ET6fd.js} +0 -0
- /package/dist/assets/{moon-BY5W7KNZ.js → moon-D3b6Wzk6.js} +0 -0
- /package/dist/assets/{native-deep-link-BZH3xsyz.js → native-deep-link-DmClhlUR.js} +0 -0
- /package/dist/assets/{onboarding-step-layout-BfSOxqy3.js → onboarding-step-layout-kPP5JFP-.js} +0 -0
- /package/dist/assets/{optimistic-lifecycle-DQ9ivtaV.js → optimistic-lifecycle-BOkyBy0p.js} +0 -0
- /package/dist/assets/{pdf-Bgtvn-RQ.js → pdf-DVb0eJxD.js} +0 -0
- /package/dist/assets/{pencil-olIS2Qwz.js → pencil-u8kUHDu1.js} +0 -0
- /package/dist/assets/{plugin-attribution-CMiJBOT6.js → plugin-attribution-Dcl7GaXq.js} +0 -0
- /package/dist/assets/{plus-BZzVJ5E8.js → plus-Y5Y0OQo7.js} +0 -0
- /package/dist/assets/{pointer-qy7F2Zff.js → pointer-BK-9IReQ.js} +0 -0
- /package/dist/assets/{prechat-qRQ4KcYS.js → prechat-Zk1l58N8.js} +0 -0
- /package/dist/assets/{profile-metadata-B3ypNKET.js → profile-metadata-Dqd8Hqos.js} +0 -0
- /package/dist/assets/{progress-bar-CFJpRI8T.js → progress-bar-_3mfj1nF.js} +0 -0
- /package/dist/assets/{proxy-BvEmziK9.js → proxy-Bmdpu1sr.js} +0 -0
- /package/dist/assets/{public-asset-Budc22a_.js → public-asset-BuFg8E9D.js} +0 -0
- /package/dist/assets/{puzzle-Iv8Cm4fF.js → puzzle-C23ox4Fh.js} +0 -0
- /package/dist/assets/{refresh-cw-CtW8hhca.js → refresh-cw-CM091oiN.js} +0 -0
- /package/dist/assets/{repeat-D_3ouUDK.js → repeat-DZFBLR2c.js} +0 -0
- /package/dist/assets/{sdk.gen-CenbOmmb.js → sdk.gen-Bke-lgN6.js} +0 -0
- /package/dist/assets/{sdk.gen-CPsr6ePr.js → sdk.gen-DKNY8Bx5.js} +0 -0
- /package/dist/assets/{semver-DKrC_c5_.js → semver-BPMr6t52.js} +0 -0
- /package/dist/assets/{shield-check-DPQwNmC8.js → shield-check-BMJaX1V5.js} +0 -0
- /package/dist/assets/{sliders-horizontal-Bn66BkOm.js → sliders-horizontal-C3od3uct.js} +0 -0
- /package/dist/assets/{sparkles-BIyazSWm.js → sparkles-D2G1TC69.js} +0 -0
- /package/dist/assets/{square-BaqnLb-n.js → square-BmcTJ4Ep.js} +0 -0
- /package/dist/assets/{status-badge-pill-DQHLgr0r.js → status-badge-pill-Dezqkwfk.js} +0 -0
- /package/dist/assets/{theme-preferences-DXNlsaIE.js → theme-preferences-QKcNHgRj.js} +0 -0
- /package/dist/assets/{three-dot-indicator-B7ma4dAk.js → three-dot-indicator-OWxXOhjw.js} +0 -0
- /package/dist/assets/{toggle-CvdrA_Wf.js → toggle-D0F64xtr.js} +0 -0
- /package/dist/assets/{triangle-alert-BAgktlRD.js → triangle-alert-BiYR_vCj.js} +0 -0
- /package/dist/assets/{typed-storage-yK4igtBn.js → typed-storage-CSjOkiBC.js} +0 -0
- /package/dist/assets/{use-copy-to-clipboard-DPzMJz6R.js → use-copy-to-clipboard-MsGbgkfV.js} +0 -0
- /package/dist/assets/{user-plus-nCVu5N3f.js → user-plus-BBNl6TNQ.js} +0 -0
- /package/dist/assets/{users-C664VUFU.js → users-B9OBdAo0.js} +0 -0
- /package/dist/assets/{volume-2-CGlmdr-4.js → volume-2-CcQdY7RE.js} +0 -0
- /package/dist/assets/{workflow-status-sueKIg-y.js → workflow-status-ByHycBJ_.js} +0 -0
- /package/dist/assets/{x-x6asKwaA.js → x-B1c_0Hpo.js} +0 -0
- /package/dist/assets/{xterm-DW9P5sX0.js → xterm-DxbTm7XB.js} +0 -0
- /package/dist/assets/{xterm-addon-fit-Du8AR7hX.js → xterm-addon-fit-CiplDkxq.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{B as r,H as i,U as a,V as o,h as s,n as c,r as l}from"./proxy-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{B as r,H as i,U as a,V as o,h as s,n as c,r as l}from"./proxy-Bmdpu1sr.js";var u=n(),d=e(t(),1);function f(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function p(...e){return t=>{let n=!1,r=e.map(e=>{let r=f(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():f(e[t],null)}}}}function m(...e){return d.useCallback(p(...e),e)}var h=class extends d.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(s(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=s(e)&&e.offsetWidth||0,r=s(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function g({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,d.useId)(),s=(0,d.useRef)(null),c=(0,d.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:f}=(0,d.useContext)(l),p=m(s,e.props?.ref??e?.ref);return(0,d.useInsertionEffect)(()=>{let{width:e,height:l,top:u,left:d,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!l)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${d}`:g?`left: ${d}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${u}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);f&&(y.nonce=f);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
2
2
|
[data-motion-pop-id="${o}"] {
|
|
3
3
|
position: absolute !important;
|
|
4
4
|
width: ${e}px !important;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./misc-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./misc-BW2SfpvH.js";import{t as i}from"./format-file-size-NlWnTYo4.js";var a=e(t(),1),o=n(),s={verified:{label:`Verified`,className:`bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`},signed:{label:`Signed`,className:`bg-[var(--system-info-weak)] text-[var(--system-info-strong)]`},unsigned:{label:`Unsigned`,className:`bg-[var(--surface-active)] text-[var(--content-secondary)]`},tampered:{label:`Tampered — signature invalid`,className:`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`}};function c(){let[e,t]=(0,a.useState)(null),[n,c]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{window.vellum?.bundleConfirm?.getData().then(e=>{e&&t(e)})},[]),!e)return(0,o.jsx)(`div`,{className:`flex h-svh w-screen items-center justify-center bg-background text-muted-foreground select-none`,children:`Loading...`});let{manifest:l,scanResult:u,signatureResult:d,bundleSizeBytes:f}=e,p=s[d.trustTier],m=d.trustTier===`tampered`,h=u.warnings;return(0,o.jsxs)(`div`,{className:`flex h-svh w-screen flex-col bg-background px-6 pt-14 pb-6 text-foreground select-none`,children:[(0,o.jsxs)(`div`,{className:`flex items-start gap-3`,children:[l.icon?(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:l.icon}):(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:`📦`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:l.name}),l.description&&(0,o.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-sm leading-snug`,children:l.description})]})]}),(0,o.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:r(`inline-block rounded-full px-2.5 py-0.5 text-xs font-medium`,p.className),children:p.label}),d.trustTier===`signed`&&d.signerDisplayName&&(0,o.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`by `,d.signerDisplayName]})]}),(0,o.jsxs)(`dl`,{className:`mt-4 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 text-sm`,children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Size`}),(0,o.jsx)(`dd`,{children:i(f)}),(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created by`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.created_by}),l.capabilities.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Capabilities`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.capabilities.join(`, `)})]})]}),h.length>0&&(0,o.jsxs)(`div`,{className:`mt-4`,children:[(0,o.jsxs)(`button`,{type:`button`,className:`text-muted-foreground text-xs font-medium hover:underline`,onClick:()=>c(e=>!e),children:[n?`Hide`:`Show`,` Warnings (`,h.length,`)`]}),n&&(0,o.jsx)(`ul`,{className:`mt-1.5 space-y-1 text-xs`,children:h.map((e,t)=>(0,o.jsx)(`li`,{className:`rounded bg-[var(--system-mid-weak)] px-2 py-1 text-[var(--system-mid-strong)]`,children:e},t))})]}),(0,o.jsxs)(`div`,{className:`mt-auto flex items-center justify-end gap-3 pt-4`,children:[(0,o.jsx)(`button`,{type:`button`,className:`rounded-md border border-border px-4 py-1.5 text-sm font-medium text-foreground hover:bg-muted`,onClick:()=>window.vellum?.bundleConfirm?.respond(!1),children:`Cancel`}),(0,o.jsx)(`button`,{type:`button`,className:r(`rounded-md px-4 py-1.5 text-sm font-medium text-white`,m?`bg-red-600 hover:bg-red-700`:`bg-primary hover:bg-primary/90`),onClick:()=>window.vellum?.bundleConfirm?.respond(!0),children:m?`Install Anyway`:`Install`})]})]})}export{c as BundleConfirmPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./routes-
|
|
1
|
+
import{u as e}from"./routes-CujiOvCG.js";function t(t){let n=typeof window<`u`?window.location.origin:``,r=new URLSearchParams({senderAssistantId:t.senderAssistantId,token:t.token});return`${n}${e.connect}?${r.toString()}`}function n(e){let t=e.get(`senderAssistantId`)?.trim(),n=e.get(`token`)?.trim();return!t||!n?null:{senderAssistantId:t,token:n}}export{n,t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-DfdJ73pd.js";import{n as i,t as a}from"./app-info-CBjmLxjK.js";var o=e(t(),1),s=n();function c(){let[e,t]=(0,o.useState)(null);(0,o.useEffect)(()=>{a().then(t)},[]);let n=e??l;return(0,s.jsxs)(`div`,{className:`flex h-svh w-screen flex-col items-center justify-center bg-background px-8 pt-14 pb-8 text-center text-foreground select-none`,children:[(0,s.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:n.appName}),(0,s.jsx)(`p`,{className:`text-muted-foreground mt-1 mb-7 text-xs`,children:`AI assistant for your Mac`}),(0,s.jsxs)(`dl`,{className:`mb-7 grid grid-cols-[auto_auto] gap-x-4 gap-y-1.5 text-sm`,children:[(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Version`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.version}),(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Build`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.commitSha})]}),(0,s.jsx)(`a`,{href:n.website,className:`text-primary text-sm hover:underline`,onClick:e=>{r()&&(e.preventDefault(),i())},children:new URL(n.website).host}),(0,s.jsx)(`div`,{className:`text-muted-foreground mt-auto pt-6 text-[11px]`,children:n.copyright})]})}var l={appName:`Vellum`,version:`—`,commitSha:`—`,copyright:`© ${new Date().getFullYear()} Vellum`,website:`https://vellum.ai`};export{c as AboutPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{a as i,n as a,s as o}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{a as i,n as a,s as o}from"./auth-store-DTxOB4OE.js";import{f as s}from"./native-biometric-C77WIZgU.js";import{u as c}from"./routes-CujiOvCG.js";import{n as l,t as u}from"./login-flow-DC2qOXLZ.js";import{pi as d}from"./index-k210BwEJ.js";import{r as f,t as p}from"./account-shell-C7g85lC1.js";var m=e(t(),1),h=r();function g(){let e=i(),t=o(),r=a.use.user(),g=a.use.logout(),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(!1),x=async()=>{v(null),b(!0);try{await s(l,u)}catch(e){console.error(`[account] auth flow failed:`,e),v(`Something went wrong. Please try again.`),b(!1)}};return t?(0,h.jsx)(p,{children:(0,h.jsx)(f,{title:`Loading...`})}):e?(0,h.jsxs)(p,{children:[(0,h.jsx)(f,{title:`Welcome${r?.username?`, ${r.username}`:``}!`,subtitle:`You are signed in.`}),(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,h.jsx)(n,{to:c.assistant,className:`inline-flex w-full items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Go to your assistant`}),(0,h.jsx)(`button`,{type:`button`,onClick:async()=>{await g(),d(c.account.login)},className:`cursor-pointer bg-transparent text-sm font-normal text-[var(--content-secondary)] transition-colors hover:text-[var(--content-default)]`,children:`Sign out`})]})]}):(0,h.jsxs)(p,{children:[(0,h.jsx)(f,{title:`Welcome to Vellum`,subtitle:`Sign in to get started.`}),_&&(0,h.jsx)(`p`,{className:`text-center text-sm text-[var(--system-negative-strong)]`,children:_}),(0,h.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,h.jsx)(`button`,{type:`button`,onClick:()=>void x(),disabled:y,className:`inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:opacity-50`,children:`Sign in`})})]})}export{g as AccountPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{t}from"./notice-
|
|
1
|
+
import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{t}from"./notice-rXKtDAyE.js";import"./src-eF1GUpNZ.js";var n=e(),r=(0,n.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{d:`M7.5 15L12.5 10L7.5 5`,stroke:`currentColor`,strokeWidth:`1.67`,strokeLinecap:`round`,strokeLinejoin:`round`})});function i({onSubmit:e,error:i,children:a,submitLabel:o,submittingLabel:s,isSubmitting:c,footer:l}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`form`,{onSubmit:e,className:`flex flex-col gap-4`,children:[i&&(0,n.jsx)(t,{tone:`error`,children:i}),(0,n.jsx)(`div`,{className:`flex flex-col gap-3`,children:a}),(0,n.jsxs)(`button`,{type:`submit`,disabled:c,className:`mt-2 inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:cursor-wait disabled:opacity-50`,children:[c?s:o,r]})]}),l&&(0,n.jsx)(`div`,{className:`mt-8 text-center`,children:l})]})}function a(e){return(0,n.jsx)(`input`,{...e,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3 text-sm text-[var(--content-default)] outline-none placeholder:text-[var(--content-tertiary)] focus:border-[var(--primary-base)]/50`})}function o({title:e,subtitle:t}){return(0,n.jsxs)(`div`,{className:`mb-8 text-center`,children:[(0,n.jsx)(`h1`,{className:`mb-2 font-serif text-[2rem] font-bold italic text-[var(--content-default)]`,children:e}),t&&(0,n.jsx)(`p`,{className:`text-sm text-[var(--content-secondary)]`,children:t})]})}function s({children:e}){return(0,n.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)]`,children:(0,n.jsx)(`div`,{className:`w-full max-w-[480px] px-6`,children:(0,n.jsx)(`div`,{className:`flex flex-col items-center gap-10`,children:(0,n.jsx)(`div`,{className:`w-full`,children:e})})})})}export{a as i,i as n,o as r,s as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-
|
|
2
|
-
`)}function H(e){if(e!=null){if(typeof e==`string`)return e;if(typeof e==`object`)try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}}function U(e,t){let n=new Map;for(let t of e)t.type===`diff`&&n.set(t.path,{path:t.path,newText:t.newText,...t.oldText===void 0?{}:{oldText:t.oldText}});for(let e of t??[])n.has(e.path)||n.set(e.path,{path:e.path});return Array.from(n.values())}var W=i();function _e({content:e,isComplete:t}){return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-agent-message`,className:`flex w-full flex-col items-start text-chat text-[var(--content-default)]`,children:[(0,W.jsx)(x,{content:e}),!t&&(0,W.jsx)(S,{className:`mt-1`,"data-testid":`acp-chat-agent-streaming`})]})}function ve({entries:e}){return e.length===0?null:(0,W.jsxs)(`div`,{"data-testid":`acp-chat-plan-block`,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-center gap-1.5 text-[var(--content-tertiary)]`,children:[(0,W.jsx)(ce,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(a,{variant:`body-small-emphasised`,className:`text-inherit`,children:`Plan`})]}),(0,W.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.map((e,t)=>(0,W.jsxs)(`li`,{"data-testid":`acp-chat-plan-entry`,"data-checked":e.checked,className:`flex items-start gap-2`,children:[e.checked?(0,W.jsx)(d,{"aria-hidden":!0,className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}):(0,W.jsx)(f,{"aria-hidden":!0,className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-disabled)]`}),(0,W.jsx)(`span`,{className:e.checked?`text-body-small-default text-[var(--content-tertiary)] line-through`:`text-body-small-default text-[var(--content-default)]`,children:e.label})]},t))})]})}function ye(e){switch(e){case`max_tokens`:case`max_turn_requests`:return`Stopped: limit reached`;case`refusal`:return`Refused`;case`cancelled`:return`Cancelled`;default:return`Completed`}}function be(e){return new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function G({completedAt:e}){return e===void 0?null:(0,W.jsxs)(`span`,{"data-testid":`acp-chat-terminal-time`,children:[`at `,be(e)]})}function xe({status:e,stopReason:t,error:n,completedAt:r}){if(w(e))return null;if(e===`failed`)return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`failed`,className:`flex items-start gap-2 rounded-lg bg-[var(--system-negative-weak)] px-3 py-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,W.jsx)(`span`,{"aria-hidden":!0,"data-testid":`acp-chat-terminal-failed-icon`,className:`flex h-[12px] w-4 shrink-0 items-center justify-center`,children:(0,W.jsx)(v,{className:`h-4 w-4`})}),(0,W.jsx)(`span`,{children:n??`Run failed`})]});if(e===`cancelled`)return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`cancelled`,className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,W.jsx)(
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-TIfXqClD.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-BxZ6HzpA.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./typography-B_Zom8Gj.js";import{t as o}from"./createLucideIcon-IRfcSUxS.js";import{t as s}from"./arrow-left-8m8Hdw7f.js";import{t as c}from"./brain-BDL_F8de.js";import{t as l}from"./chevron-down-qD-re7AW.js";import{t as u}from"./chevron-right-DqqmezXC.js";import{t as d}from"./circle-check-VSiny8yl.js";import{w as f}from"./menu-D6Zd1pD0.js";import{t as p}from"./code-Dl3IekqV.js";import{t as m}from"./file-text-YQjMPDid.js";import{t as h}from"./globe-CYmqQnbY.js";import{t as g}from"./repeat-DZFBLR2c.js";import{t as _}from"./square-BmcTJ4Ep.js";import{t as v}from"./triangle-alert-BiYR_vCj.js";import{t as y}from"./x-B1c_0Hpo.js";import"./src-eF1GUpNZ.js";import{t as b}from"./tag-B2RIok_S.js";import{t as x}from"./chat-markdown-message-BkuowO-g.js";import{t as S}from"./three-dot-indicator-OWxXOhjw.js";import{At as C,Mt as w,Sa as ee,_t as te,go as ne,gt as re,jt as ie,kt as T,lo as ae,ma as E,pa as oe,vt as D,xa as se,za as ce}from"./index-k210BwEJ.js";import{t as le}from"./status-badge-pill-Dezqkwfk.js";var ue=o(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),de=o(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),O=e(n(),1),k=``;function A(e,t){switch(e){case`complete`:case`completed`:return`completed`;case`failed`:case`error`:return`error`;case void 0:return t;default:return`running`}}function fe(e){return(e.messageId?.startsWith(`local-marker-`)??!1)||(e.content?.startsWith(`↻ Steering: `)??!1)}function j(e){let t=e??``;return t.startsWith(`↻ Steering: `)?t.slice(T.length):t}function M(e){let t=e[e.length-1];t&&(t.kind===`agent`||t.kind===`thinking`)&&!t.isComplete&&(e[e.length-1]={...t,isComplete:!0})}function N(e,t){if(t.updateType===`agent_message_chunk`&&fe(t)){M(e),e.push({kind:`user`,id:t.messageId??`steer-${e.length}`,content:j(t.content)});return}switch(t.updateType){case`user_message_chunk`:{let n=t.messageId??k,r=j(t.content),i=e[e.length-1];i&&i.kind===`user`&&i.id===n?e[e.length-1]={...i,content:i.content+r}:(M(e),e.push({kind:`user`,id:n,content:r}));let a=e[e.length-1].content;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.kind===`user`&&n.id.startsWith(`local-marker-`)&&n.content===a){e.splice(t,1);break}}return}case`agent_message_chunk`:{let n=t.messageId??k,r=e[e.length-1];if(r&&r.kind===`agent`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}if(n!==k&&r&&r.kind===`agent`&&r.messageId===k&&!r.isComplete&&r.content===(t.content??``)){e[e.length-1]={...r,messageId:n};return}M(e),e.push({kind:`agent`,messageId:n,content:t.content??``,isComplete:!1});return}case`agent_thought_chunk`:{let n=t.messageId??k,r=e[e.length-1];if(r&&r.kind===`thinking`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}M(e),e.push({kind:`thinking`,messageId:n,content:t.content??``,isComplete:!1});return}case`tool_call`:{let n=t.toolCallId;if(n===void 0)return;M(e),e.push({kind:`tool`,toolCallId:n,title:t.toolTitle??``,toolKind:t.toolKind,status:A(t.toolStatus,`running`),content:t.content,locations:P(t),rawInput:t.rawInput,rawOutput:t.rawOutput});return}case`tool_call_update`:{let n=t.toolCallId;if(n===void 0)return;let r=e.findIndex(e=>e.kind===`tool`&&e.toolCallId===n);if(r===-1)return;let i=e[r],a=P(t);e[r]={...i,title:t.toolTitle??i.title,toolKind:t.toolKind??i.toolKind,status:A(t.toolStatus,i.status),content:t.content??i.content,locations:a??i.locations,rawInput:t.rawInput===void 0?i.rawInput:t.rawInput,rawOutput:t.rawOutput===void 0?i.rawOutput:t.rawOutput};return}case`plan`:{let n=pe(t.content);if(n===null)return;let r=e.findIndex(e=>e.kind===`plan`),i={kind:`plan`,entries:n};r===-1?(M(e),e.push(i)):e[r]=i;return}}}function P(e){let t=e.locations;if(!Array.isArray(t))return;let n=[];for(let e of t){let t=e??{};typeof t.path==`string`&&n.push(typeof t.line==`number`?{path:t.path,line:t.line}:{path:t.path})}return n}function pe(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}let n=Array.isArray(t)?t:Array.isArray(t?.entries)?t.entries:null;return n===null?null:n.map(e=>{let t=e??{},n=t.content??t.label??``;return{label:typeof n==`string`?n:String(n),checked:t.checked===!0||t.status===`completed`}})}function me(e){let t=[];for(let n of e)N(t,n);return t}function F(e,t){if(e===t)return{kind:`identity`};if(e===null)return{kind:`first`};if(t.length<e.length)return{kind:`fallback`};for(let n=0;n<e.length;n++)if(e[n]!==t[n])return n===e.length-1&&t.length===e.length?{kind:`mutate-last`}:{kind:`fallback`};return t.length===e.length?{kind:`identity`}:{kind:`append`,from:e.length}}function I(){let e=null,t=[];function n(n){return t=me(n),e=n,t}function r(r){let i=F(e,r);switch(i.kind){case`identity`:return t;case`first`:return n(r);case`append`:{let n=t.slice();for(let e=i.from;e<r.length;e++)N(n,r[e]);return e=r,t=n,t}case`mutate-last`:case`fallback`:return n(r)}}return{project:r}}function L(e){let t=(0,O.useRef)(null);return t.current??=I(),t.current.project(e)}function R(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{let t=e.trimStart();return t.startsWith(`{`)||t.startsWith(`[`)?[]:[{type:`content`,text:e}]}let n=Array.isArray(t)?t:[t],r=[];for(let e of n){let t=z(e);t&&r.push(t)}return r}function z(e){if(typeof e!=`object`||!e)return null;let t=e;switch(t.type){case`content`:return{type:`content`,text:he(t.content)};case`diff`:return typeof t.path!=`string`||typeof t.newText!=`string`?null:{type:`diff`,path:t.path,newText:t.newText,...typeof t.oldText==`string`?{oldText:t.oldText}:{}};case`terminal`:{let e=ge(t);return e===void 0?{type:`terminal`}:{type:`terminal`,text:e}}default:return null}}function he(e){if(typeof e==`string`)return e;if(typeof e==`object`&&e){let t=e.text;if(typeof t==`string`)return t}return``}function ge(e){if(typeof e.text==`string`)return e.text;if(typeof e.output==`string`)return e.output;if(typeof e.content==`string`)return e.content;if(typeof e.content==`object`&&e.content!==null){let t=e.content.text;if(typeof t==`string`)return t}}function B(e){if(typeof e!=`object`||!e)return;let t=e.command;return typeof t==`string`?t:void 0}function V(e){return R(e).filter(e=>e.type===`content`||e.type===`terminal`).map(e=>`text`in e?e.text??``:``).filter(e=>e.length>0).join(`
|
|
2
|
+
`)}function H(e){if(e!=null){if(typeof e==`string`)return e;if(typeof e==`object`)try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}}function U(e,t){let n=new Map;for(let t of e)t.type===`diff`&&n.set(t.path,{path:t.path,newText:t.newText,...t.oldText===void 0?{}:{oldText:t.oldText}});for(let e of t??[])n.has(e.path)||n.set(e.path,{path:e.path});return Array.from(n.values())}var W=i();function _e({content:e,isComplete:t}){return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-agent-message`,className:`flex w-full flex-col items-start text-chat text-[var(--content-default)]`,children:[(0,W.jsx)(x,{content:e}),!t&&(0,W.jsx)(S,{className:`mt-1`,"data-testid":`acp-chat-agent-streaming`})]})}function ve({entries:e}){return e.length===0?null:(0,W.jsxs)(`div`,{"data-testid":`acp-chat-plan-block`,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-center gap-1.5 text-[var(--content-tertiary)]`,children:[(0,W.jsx)(ce,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(a,{variant:`body-small-emphasised`,className:`text-inherit`,children:`Plan`})]}),(0,W.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.map((e,t)=>(0,W.jsxs)(`li`,{"data-testid":`acp-chat-plan-entry`,"data-checked":e.checked,className:`flex items-start gap-2`,children:[e.checked?(0,W.jsx)(d,{"aria-hidden":!0,className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}):(0,W.jsx)(f,{"aria-hidden":!0,className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-disabled)]`}),(0,W.jsx)(`span`,{className:e.checked?`text-body-small-default text-[var(--content-tertiary)] line-through`:`text-body-small-default text-[var(--content-default)]`,children:e.label})]},t))})]})}function ye(e){switch(e){case`max_tokens`:case`max_turn_requests`:return`Stopped: limit reached`;case`refusal`:return`Refused`;case`cancelled`:return`Cancelled`;default:return`Completed`}}function be(e){return new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function G({completedAt:e}){return e===void 0?null:(0,W.jsxs)(`span`,{"data-testid":`acp-chat-terminal-time`,children:[`at `,be(e)]})}function xe({status:e,stopReason:t,error:n,completedAt:r}){if(w(e))return null;if(e===`failed`)return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`failed`,className:`flex items-start gap-2 rounded-lg bg-[var(--system-negative-weak)] px-3 py-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,W.jsx)(`span`,{"aria-hidden":!0,"data-testid":`acp-chat-terminal-failed-icon`,className:`flex h-[12px] w-4 shrink-0 items-center justify-center`,children:(0,W.jsx)(v,{className:`h-4 w-4`})}),(0,W.jsx)(`span`,{children:n??`Run failed`})]});if(e===`cancelled`)return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`cancelled`,className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,W.jsx)(ae,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`}),(0,W.jsx)(`span`,{children:`Cancelled`}),(0,W.jsx)(G,{completedAt:r})]});let i=ye(t);return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`completed`,className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,W.jsx)(d,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}),(0,W.jsx)(`span`,{children:i}),(0,W.jsx)(G,{completedAt:r})]})}function Se({showDot:e,isLast:t,children:n}){return(0,W.jsxs)(`div`,{className:`relative flex items-start gap-2${t?``:` pb-4`}`,children:[!t&&(0,W.jsx)(`div`,{"aria-hidden":!0,className:`absolute bottom-0 left-[6.5px] w-px bg-[var(--border-element)] ${e?`top-[16px]`:`top-0`}`}),e?(0,W.jsx)(`span`,{"aria-hidden":!0,"data-testid":`acp-chat-timeline-dot`,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,W.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}):(0,W.jsx)(`span`,{"aria-hidden":!0,className:`h-[14px] w-[14px] shrink-0`}),(0,W.jsx)(`div`,{className:`min-w-0 flex-1`,children:n})]})}function Ce({content:e,isComplete:t}){let[n,r]=(0,O.useState)(null),i=n??!t,a=e.trim().length>0,o=t?`Thought process`:`Thinking`,s=t?(0,W.jsx)(c,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,W.jsx)(S,{dotSize:5,className:`shrink-0`,"data-testid":`acp-chat-thinking-streaming`});return a?(0,W.jsxs)(`div`,{"data-testid":`acp-chat-thinking-block`,className:`w-full`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>r(!i),"data-testid":`acp-chat-thinking-toggle`,className:`flex w-full items-center gap-1.5 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)]`,children:[i?(0,W.jsx)(l,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,W.jsx)(u,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),s,(0,W.jsx)(`span`,{children:o})]}),i&&(0,W.jsx)(`div`,{"data-testid":`acp-chat-thinking-body`,className:`mt-1.5 border-l-2 border-[var(--border-base)] pl-3 text-body-small-default text-[var(--content-tertiary)]`,children:(0,W.jsx)(x,{content:e})})]}):(0,W.jsx)(`div`,{"data-testid":`acp-chat-thinking-block`,className:`w-full`,children:(0,W.jsxs)(`div`,{className:`flex w-full items-center gap-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:[s,(0,W.jsx)(`span`,{children:o})]})})}var we={running:`neutral`,completed:`positive`,error:`negative`,ended:`neutral`},Te={running:`Running`,completed:`Completed`,error:`Failed`,ended:`Ended`},Ee={read:`Read file`,edit:`Edit file`,delete:`Delete file`,move:`Move file`,search:`Search`,execute:`Run command`,think:`Thinking`,fetch:`Fetch`,switch_mode:`Switch mode`},De=`Tool call`,Oe={read:m,edit:ue,delete:oe,move:de,search:ee,execute:E,think:c,fetch:h,switch_mode:g},ke=new Set([`read`,`edit`,`delete`,`move`]);function Ae({toolKind:e}){return(0,W.jsx)(e&&Oe[e]||p,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)]`})}function K({label:e,value:t,testId:n}){return(0,W.jsxs)(`div`,{"data-testid":n,children:[(0,W.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-tertiary)]`,children:e}),(0,W.jsx)(`pre`,{className:`max-h-60 overflow-auto rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] p-2.5 font-mono text-body-small-default text-[var(--content-secondary)]`,children:t})]})}function je({block:e,isTerminal:t=!1,onOpenDiff:n,onOpenOutput:r}){let[i,o]=(0,O.useState)(!1),s=(0,O.useMemo)(()=>R(e.content),[e.content]),c=(0,O.useMemo)(()=>V(e.content),[e.content]),d=(0,O.useMemo)(()=>c.split(`
|
|
3
3
|
`).map(e=>e.trim()).find(e=>e.length>0&&!e.startsWith("```"))||`View output`,[c]),f=(0,O.useMemo)(()=>U(s,e.locations),[s,e.locations]),p=t&&e.status===`running`?`ended`:e.status,h=p===`running`,g=e.toolKind&&Ee[e.toolKind]||De,_=B(e.rawInput)??e.title,v=_&&_!==g&&(!ke.has(e.toolKind??``)||f.length===0)?_:null,y=H(e.rawInput),x=H(e.rawOutput),C=y!==void 0||x!==void 0;return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-tool-card`,"data-status":e.status,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Ae,{toolKind:e.toolKind}),(0,W.jsx)(a,{variant:`body-small-emphasised`,className:`min-w-0 flex-1 truncate text-[var(--content-default)]`,title:e.title,children:g}),(0,W.jsx)(b,{tone:we[p],"data-testid":`acp-chat-tool-status`,children:Te[p]}),h&&(0,W.jsx)(S,{className:`shrink-0`,"data-testid":`acp-chat-tool-running`})]}),v&&(0,W.jsx)(`div`,{"data-testid":`acp-chat-tool-detail`,className:`mt-1.5 font-mono text-body-small-default whitespace-pre-wrap break-words text-[var(--content-secondary)]`,children:v}),f.length>0&&(0,W.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:f.map(t=>{let r=t.oldText!==void 0||t.newText!==void 0,i=`flex max-w-full items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-1 text-body-small-default text-[var(--content-secondary)]`;return r?(0,W.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-file-chip`,onClick:()=>n(e.toolCallId,t),title:t.path,className:`${i} cursor-pointer transition-colors hover:bg-[var(--surface-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--border-focus)]`,children:[(0,W.jsx)(m,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate font-mono`,children:t.path})]},t.path):(0,W.jsxs)(`span`,{"data-testid":`acp-chat-tool-file-ref`,title:t.path,className:i,children:[(0,W.jsx)(m,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate font-mono`,children:t.path})]},t.path)})}),c.length>0&&(0,W.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-output-open`,onClick:()=>r?.(e.toolCallId),className:`mt-2 flex w-full items-center gap-2 rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] px-2.5 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--border-focus)]`,children:[(0,W.jsx)(E,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:d}),(0,W.jsx)(u,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`})]}),C&&(0,W.jsxs)(`div`,{className:`mt-2`,"data-testid":`acp-chat-tool-raw`,children:[(0,W.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-raw-toggle`,"aria-expanded":i,onClick:()=>o(e=>!e),className:`flex items-center gap-1 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-default)]`,children:[i?(0,W.jsx)(l,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,W.jsx)(u,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:i?`Hide raw input/output`:`Show raw input/output`})]}),i&&(0,W.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-2`,children:[y!==void 0&&(0,W.jsx)(K,{label:`Raw input`,value:y,testId:`acp-chat-tool-raw-input`}),x!==void 0&&(0,W.jsx)(K,{label:`Raw output`,value:x,testId:`acp-chat-tool-raw-output`})]})]})]})}function Me({content:e}){return(0,W.jsx)(`div`,{"data-testid":`acp-chat-user-turn`,className:`flex w-full justify-end`,children:(0,W.jsx)(`div`,{className:`max-w-[80%] rounded-lg bg-[var(--surface-lift)] px-4 py-3 whitespace-pre-wrap text-chat text-[var(--content-default)]`,children:e})})}function Ne(e,t){let n=e=>new Intl.NumberFormat(void 0,{style:`currency`,currency:t}).format(e);return e>0&&e<.01?`<${n(.01)}`:n(e)}var q=new Intl.NumberFormat(`en-US`);function J({label:e,value:t}){return(0,W.jsxs)(`div`,{className:`flex items-baseline gap-1`,"data-usage-stat":e.toLowerCase(),children:[(0,W.jsx)(a,{variant:`label-small-default`,className:`text-[var(--content-tertiary)]`,children:e}),(0,W.jsx)(a,{variant:`body-small-default`,className:`text-[var(--content-secondary)] tabular-nums`,children:t})]})}function Pe({entry:e}){let{inputTokens:t,outputTokens:n,costAmount:r,costCurrency:i}=e;if(t===void 0&&n===void 0)return null;let a=t??0,o=n??0,s=r!=null&&i!=null;return(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,"data-testid":`acp-usage-meter`,children:[(0,W.jsx)(J,{label:`Input`,value:q.format(a)}),(0,W.jsx)(J,{label:`Output`,value:q.format(o)}),s&&(0,W.jsx)(J,{label:`Cost`,value:Ne(r,i)})]})}function Fe({content:e}){return(0,W.jsx)(`div`,{"data-testid":`acp-chat-command-output`,className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3 [&_pre]:!max-h-none`,children:(0,W.jsx)(x,{content:V(e),hardLineBreaks:!0})})}var Y=2e3;function X(e){if(e===``)return[];let t=e.split(`
|
|
4
4
|
`);return e.endsWith(`
|
|
5
|
-
`)&&t.pop(),t}function Ie(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)i[a][n]=e[a]===t[n]?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o]===t[s]?(a.push({type:`ctx`,text:e[o],oldNo:o+1,newNo:s+1}),o++,s++):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,text:e[o],oldNo:o+1}),o++):(a.push({type:`add`,text:t[s],newNo:s+1}),s++);for(;o<n;)a.push({type:`del`,text:e[o],oldNo:o+1}),o++;for(;s<r;)a.push({type:`add`,text:t[s],newNo:s+1}),s++;return a}function Le(e,t){let n=X(e),r=X(t);return n.length>Y||r.length>Y?[{type:`too-large`,text:`Diff too large to render (over ${Y.toLocaleString()} lines)`}]:n.length===0?r.map((e,t)=>({type:`add`,text:e,newNo:t+1})):r.length===0?n.map((e,t)=>({type:`del`,text:e,oldNo:t+1})):Ie(n,r)}var Z=`—`;function Q(e){switch(e){case`add`:return`bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`;case`del`:return`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`;case`too-large`:return`text-[var(--content-tertiary)] italic`;default:return`text-[var(--content-tertiary)]`}}function Re(e){switch(e){case`add`:return`+`;case`del`:return`-`;default:return` `}}function ze({path:e,oldText:t,newText:n}){let r=Le(t??``,n??``);return(0,W.jsx)(`div`,{"aria-label":`Diff for ${e}`,"data-testid":`acp-chat-file-diff`,className:`flex flex-col overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)]`,children:(0,W.jsx)(`div`,{className:`overflow-x-auto font-mono text-xs`,children:r.map((e,t)=>(0,W.jsx)(Be,{row:e},t))})})}function Be({row:e}){return e.type===`too-large`?(0,W.jsx)(`div`,{"data-diff-type":`too-large`,className:`px-3 py-2 whitespace-pre-wrap ${Q(e.type)}`,children:e.text}):(0,W.jsxs)(`div`,{"data-diff-type":e.type,className:`flex items-start whitespace-pre ${Q(e.type)}`,children:[(0,W.jsx)(`span`,{className:`w-10 shrink-0 select-none px-2 text-right text-[var(--content-tertiary)] tabular-nums`,children:e.oldNo??Z}),(0,W.jsx)(`span`,{className:`w-10 shrink-0 select-none px-2 text-right text-[var(--content-tertiary)] tabular-nums`,children:e.newNo??Z}),(0,W.jsx)(`span`,{className:`w-4 shrink-0 select-none text-center`,children:Re(e.type)}),(0,W.jsx)(`span`,{className:`flex-1 pr-3`,children:e.text})]})}var Ve=80;function $(e){return e.scrollHeight-e.clientHeight-e.scrollTop<=Ve}function He(e){let t=(0,O.useRef)(null),n=(0,O.useRef)(!0),[r,i]=(0,O.useState)(!1),a=(0,O.useCallback)(()=>{let e=t.current;e&&(e.scrollTop=e.scrollHeight)},[]),o=(0,O.useCallback)(()=>{let e=t.current;if(!e)return;let r=$(e);n.current=r,i(e=>e===!r?e:!r)},[]),s=(0,O.useCallback)(()=>{n.current=!0,a(),i(!1)},[a]),c=(0,O.useCallback)(e=>{let r=t.current;r&&r.removeEventListener(`scroll`,o),t.current=e,e&&(e.addEventListener(`scroll`,o,{passive:!0}),n.current?e.scrollTop=e.scrollHeight:o())},[o]);return(0,O.useLayoutEffect)(()=>{n.current?a():o()},[e,a,o]),{scrollRef:c,showScrollToLatest:r,scrollToLatest:s}}function Ue(e,t){switch(e.kind){case`user`:return`user-${e.id||t}`;case`agent`:return`agent-${e.messageId||t}`;case`thinking`:return`thinking-${e.messageId||t}`;case`tool`:return`tool-${e.toolCallId}`;case`plan`:return`plan`}}var We=[];function Ge({entry:e,onClose:t}){let n=w(e.status),i=L(C(t=>t.byId[e.acpSessionId]?.events??We)),[o,s]=(0,O.useState)(null),[c,l]=(0,O.useState)(e.acpSessionId);c!==e.acpSessionId&&(l(e.acpSessionId),s(null));let d=(0,O.useCallback)((e,t)=>s({kind:`diff`,toolCallId:e,path:t.path}),[]),f=(0,O.useCallback)(e=>s({kind:`output`,toolCallId:e}),[]),p=(0,O.useCallback)(()=>s(null),[]),m=(0,O.useMemo)(()=>o?i.find(e=>e.kind===`tool`&&e.toolCallId===o.toolCallId)??null:null,[o,i]),h=(0,O.useMemo)(()=>o?.kind!==`diff`||!m?null:U(R(m.content),m.locations).find(e=>e.path===o.path)??null,[o,m]),g=o?.kind===`diff`?o.path:m?B(m.rawInput)??m.title??`Output`:`Output`,{scrollRef:_,showScrollToLatest:v,scrollToLatest:y}=He((0,O.useMemo)(()=>({blocks:i,status:e.status,completedAt:e.completedAt}),[i,e.status,e.completedAt])),b=!n;return(0,W.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[o&&(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:p,title:e.agent,className:`min-w-0 shrink cursor-pointer truncate text-left text-[var(--content-default)] hover:underline`,children:(0,W.jsx)(a,{variant:`body-small-default`,as:`span`,children:e.agent})}),(0,W.jsx)(u,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,W.jsx)(a,{variant:`body-small-default`,as:`span`,title:g,className:`min-w-0 shrink truncate font-mono text-[var(--content-secondary)]`,children:g})]}),(0,W.jsx)(Ke,{entry:e,isRunning:n,onClose:t,showBack:!!o,onBack:p},`header-${e.acpSessionId}`),o?(0,W.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:o.kind===`diff`?(0,W.jsx)(ze,{path:o.path,oldText:h?.oldText,newText:h?.newText}):(0,W.jsx)(Fe,{content:m?.content})}):(0,W.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,W.jsxs)(`div`,{ref:_,"data-testid":`acp-chat-conversation`,className:`flex h-full flex-col gap-4 overflow-y-auto px-5 py-5`,children:[(0,W.jsx)(qe,{task:e.task}),(0,W.jsx)(`div`,{className:`flex flex-col`,"data-testid":`acp-chat-timeline`,children:i.map((e,t)=>(0,W.jsx)(Se,{showDot:t===0||t===i.length-1||e.kind===`tool`||e.kind===`plan`,isLast:t===i.length-1,children:(0,W.jsx)(Je,{block:e,isTerminal:b,onOpenDiff:d,onOpenOutput:f})},Ue(e,t)))}),!n&&(0,W.jsx)(xe,{status:e.status,stopReason:e.stopReason,error:e.error,completedAt:e.completedAt})]}),v&&(0,W.jsx)(r,{variant:`outlined`,size:`compact`,iconOnly:(0,W.jsx)(
|
|
5
|
+
`)&&t.pop(),t}function Ie(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)i[a][n]=e[a]===t[n]?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o]===t[s]?(a.push({type:`ctx`,text:e[o],oldNo:o+1,newNo:s+1}),o++,s++):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,text:e[o],oldNo:o+1}),o++):(a.push({type:`add`,text:t[s],newNo:s+1}),s++);for(;o<n;)a.push({type:`del`,text:e[o],oldNo:o+1}),o++;for(;s<r;)a.push({type:`add`,text:t[s],newNo:s+1}),s++;return a}function Le(e,t){let n=X(e),r=X(t);return n.length>Y||r.length>Y?[{type:`too-large`,text:`Diff too large to render (over ${Y.toLocaleString()} lines)`}]:n.length===0?r.map((e,t)=>({type:`add`,text:e,newNo:t+1})):r.length===0?n.map((e,t)=>({type:`del`,text:e,oldNo:t+1})):Ie(n,r)}var Z=`—`;function Q(e){switch(e){case`add`:return`bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`;case`del`:return`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`;case`too-large`:return`text-[var(--content-tertiary)] italic`;default:return`text-[var(--content-tertiary)]`}}function Re(e){switch(e){case`add`:return`+`;case`del`:return`-`;default:return` `}}function ze({path:e,oldText:t,newText:n}){let r=Le(t??``,n??``);return(0,W.jsx)(`div`,{"aria-label":`Diff for ${e}`,"data-testid":`acp-chat-file-diff`,className:`flex flex-col overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)]`,children:(0,W.jsx)(`div`,{className:`overflow-x-auto font-mono text-xs`,children:r.map((e,t)=>(0,W.jsx)(Be,{row:e},t))})})}function Be({row:e}){return e.type===`too-large`?(0,W.jsx)(`div`,{"data-diff-type":`too-large`,className:`px-3 py-2 whitespace-pre-wrap ${Q(e.type)}`,children:e.text}):(0,W.jsxs)(`div`,{"data-diff-type":e.type,className:`flex items-start whitespace-pre ${Q(e.type)}`,children:[(0,W.jsx)(`span`,{className:`w-10 shrink-0 select-none px-2 text-right text-[var(--content-tertiary)] tabular-nums`,children:e.oldNo??Z}),(0,W.jsx)(`span`,{className:`w-10 shrink-0 select-none px-2 text-right text-[var(--content-tertiary)] tabular-nums`,children:e.newNo??Z}),(0,W.jsx)(`span`,{className:`w-4 shrink-0 select-none text-center`,children:Re(e.type)}),(0,W.jsx)(`span`,{className:`flex-1 pr-3`,children:e.text})]})}var Ve=80;function $(e){return e.scrollHeight-e.clientHeight-e.scrollTop<=Ve}function He(e){let t=(0,O.useRef)(null),n=(0,O.useRef)(!0),[r,i]=(0,O.useState)(!1),a=(0,O.useCallback)(()=>{let e=t.current;e&&(e.scrollTop=e.scrollHeight)},[]),o=(0,O.useCallback)(()=>{let e=t.current;if(!e)return;let r=$(e);n.current=r,i(e=>e===!r?e:!r)},[]),s=(0,O.useCallback)(()=>{n.current=!0,a(),i(!1)},[a]),c=(0,O.useCallback)(e=>{let r=t.current;r&&r.removeEventListener(`scroll`,o),t.current=e,e&&(e.addEventListener(`scroll`,o,{passive:!0}),n.current?e.scrollTop=e.scrollHeight:o())},[o]);return(0,O.useLayoutEffect)(()=>{n.current?a():o()},[e,a,o]),{scrollRef:c,showScrollToLatest:r,scrollToLatest:s}}function Ue(e,t){switch(e.kind){case`user`:return`user-${e.id||t}`;case`agent`:return`agent-${e.messageId||t}`;case`thinking`:return`thinking-${e.messageId||t}`;case`tool`:return`tool-${e.toolCallId}`;case`plan`:return`plan`}}var We=[];function Ge({entry:e,onClose:t}){let n=w(e.status),i=L(C(t=>t.byId[e.acpSessionId]?.events??We)),[o,s]=(0,O.useState)(null),[c,l]=(0,O.useState)(e.acpSessionId);c!==e.acpSessionId&&(l(e.acpSessionId),s(null));let d=(0,O.useCallback)((e,t)=>s({kind:`diff`,toolCallId:e,path:t.path}),[]),f=(0,O.useCallback)(e=>s({kind:`output`,toolCallId:e}),[]),p=(0,O.useCallback)(()=>s(null),[]),m=(0,O.useMemo)(()=>o?i.find(e=>e.kind===`tool`&&e.toolCallId===o.toolCallId)??null:null,[o,i]),h=(0,O.useMemo)(()=>o?.kind!==`diff`||!m?null:U(R(m.content),m.locations).find(e=>e.path===o.path)??null,[o,m]),g=o?.kind===`diff`?o.path:m?B(m.rawInput)??m.title??`Output`:`Output`,{scrollRef:_,showScrollToLatest:v,scrollToLatest:y}=He((0,O.useMemo)(()=>({blocks:i,status:e.status,completedAt:e.completedAt}),[i,e.status,e.completedAt])),b=!n;return(0,W.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[o&&(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:p,title:e.agent,className:`min-w-0 shrink cursor-pointer truncate text-left text-[var(--content-default)] hover:underline`,children:(0,W.jsx)(a,{variant:`body-small-default`,as:`span`,children:e.agent})}),(0,W.jsx)(u,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,W.jsx)(a,{variant:`body-small-default`,as:`span`,title:g,className:`min-w-0 shrink truncate font-mono text-[var(--content-secondary)]`,children:g})]}),(0,W.jsx)(Ke,{entry:e,isRunning:n,onClose:t,showBack:!!o,onBack:p},`header-${e.acpSessionId}`),o?(0,W.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:o.kind===`diff`?(0,W.jsx)(ze,{path:o.path,oldText:h?.oldText,newText:h?.newText}):(0,W.jsx)(Fe,{content:m?.content})}):(0,W.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,W.jsxs)(`div`,{ref:_,"data-testid":`acp-chat-conversation`,className:`flex h-full flex-col gap-4 overflow-y-auto px-5 py-5`,children:[(0,W.jsx)(qe,{task:e.task}),(0,W.jsx)(`div`,{className:`flex flex-col`,"data-testid":`acp-chat-timeline`,children:i.map((e,t)=>(0,W.jsx)(Se,{showDot:t===0||t===i.length-1||e.kind===`tool`||e.kind===`plan`,isLast:t===i.length-1,children:(0,W.jsx)(Je,{block:e,isTerminal:b,onOpenDiff:d,onOpenOutput:f})},Ue(e,t)))}),!n&&(0,W.jsx)(xe,{status:e.status,stopReason:e.stopReason,error:e.error,completedAt:e.completedAt})]}),v&&(0,W.jsx)(r,{variant:`outlined`,size:`compact`,iconOnly:(0,W.jsx)(ne,{}),onClick:y,"aria-label":`Go to newest`,tooltip:`Go to newest`,"data-testid":`acp-chat-scroll-to-latest`,className:`absolute bottom-3 left-1/2 -translate-x-1/2 rounded-full shadow-md`})]}),n&&!o&&(0,W.jsx)(Ye,{acpSessionId:e.acpSessionId},`steer-${e.acpSessionId}`)]})}function Ke({entry:e,isRunning:n,onClose:i,showBack:o=!1,onBack:c}){let[l,u]=(0,O.useState)(!1),d=ie(e.status,e.stopReason),f=(0,O.useCallback)(()=>{u(!0),te(e.acpSessionId).catch(e=>{u(!1),t(e,{context:`AcpRunChatView.stop`})})},[e.acpSessionId]);return(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-hover)] px-5 py-4`,children:[o&&(0,W.jsx)(r,{variant:`outlined`,iconOnly:(0,W.jsx)(s,{}),onClick:c,"aria-label":`Back to conversation`,tooltip:`Back`,"data-testid":`acp-chat-diff-back`,className:`shrink-0 rounded-lg`}),(0,W.jsx)(D,{agent:e.agent,className:`h-5 w-5 shrink-0`}),(0,W.jsx)(a,{variant:`title-medium`,title:e.agent,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:e.agent}),(0,W.jsx)(le,{color:d.color,label:d.label}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(Pe,{entry:e}),n&&(0,W.jsxs)(`button`,{type:`button`,"aria-label":`Stop run`,onClick:f,disabled:l,className:`flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-lg border border-[var(--system-negative-strong)] bg-transparent px-2.5 py-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)] disabled:cursor-default disabled:opacity-50`,children:[(0,W.jsx)(_,{className:`h-3 w-3`,fill:`currentColor`}),(0,W.jsx)(a,{variant:`label-small-default`,children:`Stop`})]}),(0,W.jsx)(r,{variant:`outlined`,iconOnly:(0,W.jsx)(y,{}),onClick:i,"aria-label":`Close run detail`,tooltip:`Close`,className:`shrink-0 rounded-lg`})]})}function qe({task:e}){return e?(0,W.jsxs)(`div`,{"data-testid":`acp-chat-objective`,children:[(0,W.jsx)(a,{variant:`body-medium-default`,as:`h3`,className:`mb-1 text-[var(--content-emphasised)]`,children:`Objective`}),(0,W.jsx)(a,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:e}),(0,W.jsx)(`div`,{className:`mt-4 h-px w-full bg-[var(--border-hover)]`})]}):null}function Je({block:e,isTerminal:t,onOpenDiff:n,onOpenOutput:r}){switch(e.kind){case`user`:return(0,W.jsx)(Me,{content:e.content});case`agent`:return(0,W.jsx)(_e,{content:e.content,isComplete:e.isComplete||t});case`thinking`:return(0,W.jsx)(Ce,{content:e.content,isComplete:e.isComplete||t});case`tool`:return(0,W.jsx)(je,{block:e,isTerminal:t,onOpenDiff:n,onOpenOutput:r});case`plan`:return(0,W.jsx)(ve,{entries:e.entries})}}function Ye({acpSessionId:e}){let[n,i]=(0,O.useState)(``),[a,o]=(0,O.useState)(!1);return(0,W.jsx)(`form`,{onSubmit:(0,O.useCallback)(r=>{r.preventDefault();let s=n.trim();if(!s||a)return;o(!0);let c=C.getState().appendLocalMarker({acpSessionId:e,content:`${T}${s}`});re(e,s).then(()=>i(``)).catch(n=>{c&&C.getState().removeLocalMarker({acpSessionId:e,markerId:c}),t(n,{context:`AcpRunChatView.steer`})}).finally(()=>o(!1))},[n,a,e]),"data-testid":`acp-chat-steer-form`,className:`sticky bottom-0 z-10 shrink-0 border-t border-[var(--border-hover)] bg-[var(--surface-lift)] px-5 py-3`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md bg-[var(--surface-base)] px-3 py-2`,children:[(0,W.jsx)(`input`,{type:`text`,value:n,onChange:e=>i(e.target.value),placeholder:`Steer the run…`,disabled:a,"aria-label":`Steering instruction`,className:`text-body-medium-default min-w-0 flex-1 bg-transparent text-[color:var(--content-default)] placeholder:text-[color:var(--content-tertiary)] focus:outline-none disabled:opacity-50`}),(0,W.jsx)(r,{type:`submit`,variant:`primary`,size:`compact`,iconOnly:(0,W.jsx)(se,{}),disabled:a||n.trim()===``,"aria-label":`Send steering instruction`,className:`shrink-0`})]})})}function Xe({entry:e,onClose:t}){return(0,W.jsx)(Ge,{entry:e,onClose:t})}export{Xe as AcpRunDetailPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BxZ6HzpA.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./typography-B_Zom8Gj.js";import{E as a,S as o,c as s,l as c,x as l}from"./risk-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BxZ6HzpA.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./typography-B_Zom8Gj.js";import{E as a,S as o,c as s,l as c,x as l}from"./risk-CMoNB8Wi.js";import{t as u}from"./chevron-left-BMF1xNfR.js";import"./src-eF1GUpNZ.js";import{t as d}from"./chat-markdown-message-BkuowO-g.js";import{C as f,a as p,i as m,n as h,r as g,s as _,y as v}from"./site-favicon-D_BNfccU.js";import{At as y,E as b,G as x,J as S,K as C,U as w,W as T,X as E,Y as D,q as O,vi as k,zt as A}from"./index-k210BwEJ.js";import{ToolDetailBody as j,t as M}from"./tool-detail-panel-DtU7j-Mu.js";var N=e(t(),1);function P(e,t,n){let r=T(t,n.workflow),i=e=>{let t=C(e,n.workflow.byToolUseId);if(t!==null&&r.has(t))return!0;let i=w(e,n.acpByToolUseId);if(i!==null&&n.acpById[i]!==void 0)return!0;let a=x(e);return a!==void 0&&n.backgroundTaskById[a]!==void 0},a=t.filter(e=>!i(e));if(a.length===t.length)return{items:e,toolCalls:t};let o=new Set(a.map(e=>e.id));return{items:e.filter(e=>e.kind!==`toolCall`||o.has(e.toolCall.id)),toolCalls:a}}function F(e,t){let n=o(),r=k.use.byId(),i=k.use.byToolUseId(),l=k.use.notFoundRunIds(),u=k.use.hydrationFailedRunIds(),d=y.use.byId(),f=y.use.byToolUseId(),p=A.use.byId();return(0,N.useMemo)(()=>{if(!e||t==null)return null;let o=n.find(t=>a(t).includes(e));if(!o)return null;let m=c(o.contentBlocks??[],{splitInlineThinking:o.role!==`user`})[t];if(!m||m.type!==`activity`)return null;let{cardItems:h,toolCalls:g}=s(m.items);return P(h,g,{workflow:{byId:r,byToolUseId:i,notFoundRunIds:l,hydrationFailedRunIds:u},acpById:d,acpByToolUseId:f,backgroundTaskById:p})},[n,e,t,r,i,l,u,d,f,p])}var I=r(),L=60;function R({payload:e,onClose:t}){let[r,a]=(0,N.useState)(null),o=F(e.messageId,e.groupIndex),s=o?.items??e.items,c=o?.toolCalls??e.toolCalls,l=E(s),d=S(l.steps),p=D(l.state,l.steps),m=p===`loading`,h=O(p,l.totalDurationLabel??``,d.failed),g=m&&l.currentStepTitle||h,v=new Map(c.map(e=>[e.id,e])),y=r?r.kind===`thinking`?`Thinking`:r.activity||r.title:``;return(0,I.jsx)(b,{titleNode:r?(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 py-0.5`,children:[(0,I.jsx)(n,{variant:`ghost`,iconOnly:(0,I.jsx)(u,{}),"aria-label":`Back to all steps`,tooltip:`All steps`,onClick:()=>a(null),className:`-ml-2.5 shrink-0`}),(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:y})]}):(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 py-0.5`,children:[(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:m?(0,I.jsx)(f,{children:g}):g}),l.stepCount?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`size-[3px] shrink-0 rounded-full bg-[var(--content-tertiary)]`}),(0,I.jsx)(i,{variant:`title-medium`,className:`shrink-0 whitespace-nowrap leading-snug text-[var(--content-secondary)]`,children:l.stepCount})]}):null]}),closeLabel:`Close steps`,onClose:t,children:r?(0,I.jsx)(B,{detail:r}):(0,I.jsx)(_,{steps:l.steps,timeline:!0,renderStep:t=>(0,I.jsx)(z,{step:t,activeDetail:r,onOpenDetail:a,lookupToolCall:e=>v.get(e),messageId:e.messageId,groupIndex:e.groupIndex})})})}function z({step:e,activeDetail:t,onOpenDetail:n,lookupToolCall:r,messageId:i,groupIndex:a}){if(e.kind===`thinking`){let t=i!=null&&e.thinkingItemIndex!=null?{messageId:i,thinkingGroupIndex:a,thinkingItemIndex:e.thinkingItemIndex}:{};return(0,I.jsx)(m,{iconName:`brain`,label:l(e.text,L),ariaLabel:`View thinking`,active:!1,onClick:()=>n({kind:`thinking`,toolCallId:``,toolName:``,title:`Thinking`,activity:``,input:{},status:`completed`,thinkingText:e.text,...t})})}if(e.kind===`web_search`)return(0,I.jsx)(g,{step:e});if(e.kind===`web_search_error`)return(0,I.jsx)(h,{step:e});if(e.kind!==`tool`)return(0,I.jsx)(p,{step:e});let o=r(e.toolCallId);return(0,I.jsx)(m,{iconName:e.iconName,label:e.activity||e.info||e.title,active:t?.toolCallId===e.toolCallId,onClick:()=>{o&&n(v(o))}})}function B({detail:e}){let t=M(e.kind===`thinking`?e.messageId:void 0,e.thinkingGroupIndex,e.thinkingItemIndex);return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.kind===`thinking`?(0,I.jsx)(d,{content:t??e.thinkingText??``,hardLineBreaks:!0}):(0,I.jsx)(j,{detail:e})})}export{R as ActivityStepsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-BxZ6HzpA.js";import{l as i,m as a,t as o}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./useMutation-Lj4VunQV.js";import{t as u}from"./jsx-runtime-CVSDxk6A.js";import{t as d}from"./chevron-right-DqqmezXC.js";import{t as f}from"./circle-alert-zOqdmf25.js";import{t as p}from"./loader-circle-DHHDfu74.js";import{t as m}from"./modal-B5LIURGT.js";import{t as h}from"./dropdown-CY4Pur0N.js";import{u as g}from"./routes-CujiOvCG.js";import{n as _,r as v}from"./browser-D1h4fzvz.js";import{dt as y,pt as b}from"./react-query.gen-Ckfv3u8n.js";var x=t({AddCreditsModal:()=>D}),S=e(n(),1),C=u(),w=[`10.00`,`20.00`,`30.00`,`40.00`,`50.00`,`60.00`,`70.00`,`80.00`,`90.00`,`100.00`];function T(e){let t=parseFloat(e);if(Number.isNaN(t))return`0 credits`;let n=t.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2});return`${n.endsWith(`.00`)?n.slice(0,-3):n} credits`}function E(e){if(e&&typeof e==`object`){let t=e.amount;if(Array.isArray(t)&&typeof t[0]==`string`)return t[0]}return`Failed to create checkout session. Please try again.`}function D({open:e,onOpenChange:t}){let n=s(),{pathname:u}=i(),[x]=a(),D=x.toString()?`${u}?${x.toString()}`:u,{data:O,isLoading:k}=c(y()),A=O?.allowed_top_up_amounts?.length?O.allowed_top_up_amounts:w,[j,M]=(0,S.useState)(null),N=j&&A.includes(j)?j:A[0]??w[0],P=l(b());return(0,S.useEffect)(()=>v(()=>{t(!1),n.invalidateQueries(y())}),[t,n]),(0,C.jsx)(m.Root,{open:e,onOpenChange:t,children:(0,C.jsxs)(m.Content,{size:`sm`,children:[(0,C.jsxs)(m.Header,{children:[(0,C.jsx)(m.Title,{children:`Add Credits`}),(0,C.jsx)(m.Description,{children:`You'll be redirected to Stripe to complete the payment.`})]}),(0,C.jsx)(m.Body,{children:(0,C.jsxs)(`div`,{className:`space-y-4`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`label`,{htmlFor:`add-credits-amount`,className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Amount`}),(0,C.jsx)(h,{id:`add-credits-amount`,value:N,onChange:e=>{M(e),P.isError&&P.reset()},disabled:k||!O,options:A.map(e=>({value:e,label:T(e)}))})]}),P.isError&&(0,C.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,C.jsx)(f,{className:`h-3.5 w-3.5 shrink-0`}),E(P.error)]}),(0,C.jsxs)(o,{to:g.settings.usageBilling,className:`flex items-center gap-1 text-body-small-default text-[var(--content-tertiary)] hover:text-[var(--content-secondary)]`,onClick:()=>t(!1),children:[`Configure Automatic Top-Ups`,(0,C.jsx)(d,{className:`size-4`})]}),(0,C.jsx)(`div`,{className:`h-px w-full bg-[var(--border-subtle)]`})]})}),(0,C.jsxs)(m.Footer,{children:[(0,C.jsx)(m.Close,{asChild:!0,children:(0,C.jsx)(r,{variant:`outlined`,children:`Cancel`})}),(0,C.jsx)(r,{variant:`primary`,leftIcon:P.isPending?(0,C.jsx)(p,{className:`animate-spin`}):void 0,onClick:()=>{P.isPending||P.mutate({body:{amount:N,return_path:D}},{onSuccess:e=>{_(e.checkout_url)}})},disabled:P.isPending||k||!O,children:`Continue`})]})]})})}export{x as n,D as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,c as n,i as r}from"./local-settings-C-dW2vkq.js";import{r as i,t as a}from"./capture-error-TIfXqClD.js";import{t as o}from"./react-DJZBPgpf.js";import{t as s}from"./button-BxZ6HzpA.js";import{m as c,u as l}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as u}from"./QueryClientProvider-DKhXIxGb.js";import{t as d}from"./useQuery-B45lW1Kk.js";import{t as f}from"./useMutation-Lj4VunQV.js";import{t as p}from"./jsx-runtime-CVSDxk6A.js";import{t as m}from"./cn-eDwV5N77.js";import{t as h}from"./typography-B_Zom8Gj.js";import{t as g}from"./createLucideIcon-IRfcSUxS.js";import{t as _}from"./check-DFNrQERi.js";import{t as v}from"./chevron-down-qD-re7AW.js";import{t as y}from"./circle-alert-zOqdmf25.js";import{t as b}from"./circle-check-VSiny8yl.js";import{t as x}from"./clock-BfaF7UiJ.js";import{t as S}from"./crown-CbQRwy8n.js";import{t as C}from"./external-link-Dqpx9nRm.js";import{t as w}from"./info-DIYWVpY2.js";import{t as T}from"./loader-circle-DHHDfu74.js";import{t as E}from"./triangle-alert-BiYR_vCj.js";import{t as D}from"./notice-rXKtDAyE.js";import{j as O}from"./src-eF1GUpNZ.js";import{t as k}from"./tag-B2RIok_S.js";import{t as A}from"./popover-BBHEa1a8.js";import{t as j}from"./input-CqzWbhlg.js";import{t as M}from"./toggle-D0F64xtr.js";import{t as N}from"./modal-B5LIURGT.js";import{n as P}from"./toast-CWA3SxUv.js";import{t as F}from"./confirm-dialog-Ca60m3Th.js";import{t as I}from"./dropdown-CY4Pur0N.js";import{Ut as L,Wt as R,ar as z,ft as ee,j as B,lt as te,wn as V}from"./sdk.gen-DKNY8Bx5.js";import{Bt as H,Ft as ne,H as U,V as W,_t as G,c as K,d as q,f as J,l as Y,m as re,p as ie,u as X}from"./react-query.gen-Dx7ROyjY.js";import{t as ae}from"./assistant-identity-store-BbQGi1Z8.js";import{i as oe,r as se,t as ce}from"./utils-CuX5xnER.js";import{r as le}from"./api-errors-D52GcK-c.js";import{u as ue}from"./routes-CujiOvCG.js";import{t as de}from"./use-is-org-ready-763-33xE.js";import{c as fe,ct as pe,d as me,f as he,g as ge,h as _e,l as ve,m as ye,o as be,p as xe,s as Se,u as Ce,v as we,y as Te}from"./react-query.gen-Ckfv3u8n.js";import{$i as Ee,$t as De,Ai as Oe,Ar as ke,B as Ae,Bi as je,Br as Me,Di as Ne,Dr as Pe,Ei as Fe,Fi as Ie,Fr as Le,Gi as Re,Gr as ze,H as Be,Hi as Ve,Hr as He,Ii as Ue,Ir as We,Ji as Ge,Ki as Ke,Lr as qe,Mi as Je,Mr as Ye,Ni as Xe,Nr as Ze,Oi as Qe,Or as $e,Pi as et,Pr as tt,Qi as nt,Qt as rt,R as it,Rr as at,Sa as ot,Ti as st,Ui as ct,Ur as lt,V as ut,Vi as dt,Wi as ft,Wr as pt,Xi as mt,Xt as ht,Yi as gt,Zi as _t,Zt as vt,ea as yt,ji as bt,jr as xt,ki as St,kr as Ct,na as wt,pa as Tt,qi as Et,ra as Dt,ta as Ot,wi as kt,z as At,zi as jt,zr as Mt}from"./index-k210BwEJ.js";import{t as Nt}from"./use-active-assistant-id-CNvX2Z8T.js";import{t as Pt}from"./detail-card-DDyqflXI.js";import{t as Ft}from"./environment-store-CJm9dJIK.js";var It=g(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Z=e(o(),1),Q=p();function Lt({mode:e,onChange:t}){return(0,Q.jsx)(`div`,{className:`max-w-[280px]`,children:(0,Q.jsx)(O,{ariaLabel:`Service mode`,value:e,onChange:t,items:[{value:`managed`,label:`Managed`},{value:`your-own`,label:`Your Own`}]})})}function Rt({id:e,title:t,subtitle:n,mode:r,onModeChange:i,children:a}){return(0,Q.jsxs)(Pt,{id:e,title:t,subtitle:n,accessory:(0,Q.jsx)(Lt,{mode:r,onChange:i}),children:[(0,Q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,Q.jsx)(`div`,{className:`mt-4`,children:a})]})}function zt({id:e,title:t,subtitle:n,children:r}){return(0,Q.jsxs)(Pt,{id:e,title:t,subtitle:n,children:[(0,Q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,Q.jsx)(`div`,{className:`mt-4`,children:r})]})}function Bt(){return(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-4 py-2.5`,children:[(0,Q.jsx)(w,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsxs)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:[`Managed services are metered and deducted from your Vellum account balance.`,` `,(0,Q.jsxs)(`a`,{href:`https://www.vellum.ai/docs/pricing`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--primary-base)] hover:underline`,children:[`View pricing`,(0,Q.jsx)(C,{className:`h-3.5 w-3.5`})]})]})]})}function Vt({status:e,message:t,isLoading:n}){return n?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2.5 py-0.5 text-body-small-default text-[var(--content-quiet)]`,children:[(0,Q.jsx)(T,{className:`h-3 w-3 animate-spin`}),`Checking domain…`]}):e?e===`verified`?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-positive-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,title:`DNS records have been verified. Your domain is ready to send and receive email.`,children:[(0,Q.jsx)(_,{className:`h-3 w-3`}),`Domain verified`]}):e===`pending`||e===`not_started`?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-mid-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-mid-strong)]`,title:`DNS records have been provisioned. Waiting for the email provider to verify them — this usually takes a few minutes.`,children:[(0,Q.jsx)(x,{className:`h-3 w-3`}),`Verifying domain…`]}):(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-negative-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,title:`Domain verification failed. DNS records may not have propagated correctly. You could try releasing and re-registering the domain.`,children:[(0,Q.jsx)(y,{className:`h-3 w-3`}),`Verification failed`]}):(0,Q.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2.5 py-0.5 text-body-small-default text-[var(--content-quiet)]`,title:`Unable to retrieve domain verification status.`,children:`Unknown status`})}function $({onClick:e,disabled:t}){return(0,Q.jsx)(s,{onClick:e,disabled:t,children:`Save`})}function Ht({onClick:e,filled:t=!1}){return(0,Q.jsx)(s,{variant:t?`danger`:`dangerGhost`,onClick:e,children:`Reset`})}function Ut({guide:e}){return(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(w,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{children:e.description}),(0,Q.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[e.linkLabel,(0,Q.jsx)(C,{className:`h-3 w-3`})]})]})]})}var Wt=`__custom__`;function Gt(e){return e?!!(e.profile||e.provider||e.model):!1}function Kt(e,t){let n=Gt(e);return n===Gt(t)?n?(e?.profile??null)===(t?.profile??null)&&(e?.provider??null)===(t?.provider??null)&&(e?.model??null)===(t?.model??null):!0:!1}function qt({id:e,displayName:t,description:n,defaultProfileLabel:r,draft:i,profileOptions:a,onDraftChange:o,onToggle:s}){let c=Gt(i),l=!i||!c?``:i.provider||i.model?Wt:i.profile??``,u=l===Wt,d=Je(),f=d[0]??Ee[0],p=d.find(e=>e===i?.provider)??f,m=Dt(p).map(e=>({value:e.id,label:e.displayName})),h=!!i?.provider&&!i?.model;function g(t){t===`__custom__`?o(e,{profile:null,provider:f,model:wt(f)??``}):t===``?o(e,null):o(e,{profile:t,provider:null,model:null})}function _(t){let n=wt(t)??``;o(e,{...i??{},profile:null,provider:t,model:n})}function v(t){o(e,{...i??{},model:t})}return(0,Q.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default font-medium text-[var(--content-default)]`,children:t}),n&&(0,Q.jsxs)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[n,r&&(0,Q.jsxs)(`span`,{className:`ml-1.5 text-body-small-default text-[var(--content-tertiary)] opacity-60`,children:[`· Default: `,r]})]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c&&(0,Q.jsx)(I,{value:l,onChange:g,options:a,className:`w-44`,menuMinWidth:280,menuAlign:`end`}),(0,Q.jsx)(M,{checked:c,onChange:t=>s(e,t),"aria-label":`Override ${t}`})]})]}),c&&u&&(0,Q.jsxs)(`div`,{className:`mt-3 space-y-2 border-t border-[var(--border-base)] pt-3`,children:[(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex-1`,children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(I,{value:p??``,onChange:_,options:d.map(e=>({value:e,label:Ot[e]??e}))})]}),(0,Q.jsxs)(`div`,{className:`flex-1`,children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Model`}),(0,Q.jsx)(I,{value:i?.model??``,onChange:v,options:m})]})]}),h&&(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:`Pick a model`})]})]})}function Jt({isOpen:e,onClose:t,assistantId:n}){let r=(0,Z.useRef)(!1);return(0,Q.jsx)(N.Root,{open:e,onOpenChange:e=>{!e&&!r.current&&t()},children:e?(0,Q.jsx)(Yt,{assistantId:n,onClose:t,onSavingChange:e=>{r.current=e}}):null})}function Yt({assistantId:e,onClose:t,onSavingChange:n}){let r=u(),{data:i}=d({...K({path:{assistant_id:e}}),staleTime:3e4}),o=(0,Z.useMemo)(()=>i?.llm?.profiles??{},[i?.llm?.profiles]),c=(0,Z.useMemo)(()=>i?.llm?.profileOrder??[],[i?.llm?.profileOrder]),l=(0,Z.useMemo)(()=>i?.llm?.callSites??{},[i?.llm?.callSites]),f=(0,Z.useMemo)(()=>dt(o,c),[o,c]),p=Je(),m=H({onSuccess:t=>{X(r,{path:{assistant_id:e}},t)}}),[h,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(``),[y,b]=(0,Z.useState)({}),[x,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(!1),{data:E,isLoading:D,isError:O,refetch:k}=d({...q({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4,refetchOnWindowFocus:!1}),A=(0,Z.useMemo)(()=>(E?.callSites??[]).filter(e=>e.id!==`mainAgent`),[E]),M=!D&&!O&&!!E&&!!i,L=(0,Z.useMemo)(()=>A.map(e=>e.id),[A]),R=(0,Z.useMemo)(()=>{if(!M)return{};let e={};for(let t of L)if(t in y)e[t]=y[t];else{let n=l[t];e[t]=n?{...n}:{}}return e},[M,L,l,y]),z=(0,Z.useMemo)(()=>new Set(L),[L]),ee=(0,Z.useMemo)(()=>Object.entries(l).some(([e,t])=>z.has(e)&&(t?.profile!=null||t?.provider!=null||t?.model!=null)),[l,z]),B=(0,Z.useMemo)(()=>{if(!M)return!1;for(let e of Object.keys(R))if(!Kt(R[e],l[e]))return!0;return!1},[M,R,l]),te=(0,Z.useMemo)(()=>Object.values(R).some(e=>Gt(e)&&!!e?.provider&&!e?.model),[R]),V=(0,Z.useMemo)(()=>ut(f,[]).map(e=>({value:e.name,label:At(e)})),[f]),ne=(0,Z.useCallback)(()=>{if(!_)return;let e={};for(let t of L)e[t]={profile:_};b(e)},[_,L]),U=(0,Z.useCallback)(e=>[...ut(f,[e]).map(e=>({value:e.name,label:At(e)})),{value:Wt,label:`Custom`}],[f]),W=(0,Z.useMemo)(()=>{if(!h.trim())return A;let e=h.toLowerCase();return A.filter(t=>(t.displayName??``).toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e)||(t.domain??``).toLowerCase().includes(e))},[A,h]),G=(0,Z.useMemo)(()=>{if(!E)return[];let e=E.domains.map(e=>e.id),t=new Map(E.domains.map(e=>[e.id,e])),n=[];for(let r of e){let e=W.filter(e=>e.domain===r);e.length>0&&n.push({domain:t.get(r),sites:e})}let r=new Set(e),i=W.filter(e=>!r.has(e.domain));return i.length>0&&n.push({domain:{id:`other`,displayName:`Other`},sites:i}),n},[E,W]),J=(0,Z.useCallback)((e,t)=>{b(n=>({...n,[e]:t}))},[]),Y=(0,Z.useCallback)((e,t)=>{if(!t){b(t=>({...t,[e]:null}));return}let n=Ae(f,A.find(t=>t.id===e)?.defaultProfile);if(n)b(t=>({...t,[e]:{profile:n}}));else{let t=p[0]??Ee[0],n=wt(t)??``;b(r=>({...r,[e]:{provider:t,model:n}}))}},[A,f,p]),re=(0,Z.useCallback)(async()=>{S(!0),n?.(!0);try{let n={};for(let e of Object.keys(R)){let t=R[e]??null;n[e]=Gt(t)?{profile:t?.profile??null,provider:t?.provider??null,model:t?.model??null}:null}await m.mutateAsync({path:{assistant_id:e},body:{llm:{callSites:n}}}),t(),P.success(`Overrides saved.`)}catch(e){P.error(`Failed to save overrides. Please try again.`),a(e,{context:`call_site_overrides_save`})}finally{S(!1),n?.(!1)}},[R,t,m,n,e]),ie=(0,Z.useCallback)(async()=>{S(!0),n?.(!0);try{let n={};for(let e of Object.keys(R))n[e]=null;await m.mutateAsync({path:{assistant_id:e},body:{llm:{callSites:n}}}),t(),P.success(`Overrides reset.`)}catch(e){P.error(`Failed to reset overrides. Please try again.`),a(e,{context:`call_site_overrides_reset`})}finally{S(!1),n?.(!1)}},[R,t,m,n,e]);return(0,Q.jsxs)(N.Content,{size:`lg`,hideCloseButton:!0,children:[(0,Q.jsxs)(N.Header,{children:[(0,Q.jsx)(N.Title,{children:`Action Overrides`}),(0,Q.jsx)(N.Description,{children:`Customize which model profile specific actions should use. Uses your default profile if no override is set.`})]}),(0,Q.jsxs)(N.Body,{children:[(0,Q.jsx)(`div`,{className:`mb-4`,children:(0,Q.jsx)(j,{type:`search`,value:h,onChange:e=>g(e.target.value),placeholder:`Search actions…`,leftIcon:(0,Q.jsx)(ot,{className:`h-4 w-4`}),fullWidth:!0})}),V.length>0&&(0,Q.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 text-body-medium-default text-[var(--content-default)]`,children:`Use one profile for all actions`}),(0,Q.jsx)(I,{value:_,onChange:v,options:V,placeholder:`Choose profile…`,className:`w-44`,menuMinWidth:280,menuAlign:`end`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:ne,disabled:!_||!M||x,children:`Apply to all`})]}),D&&(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Q.jsx)(T,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`})}),O&&(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-12 text-center`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Couldn't load actions`}),(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Make sure your assistant is running`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>void k(),children:`Retry`})]}),!D&&!O&&E&&(0,Q.jsx)(`div`,{className:`space-y-4`,children:G.length===0?(0,Q.jsx)(`p`,{className:`py-8 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No actions match your search.`}):G.map(({domain:e,sites:t})=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`mb-2 text-body-small-default font-semibold uppercase tracking-wider text-[var(--content-tertiary)]`,children:e.displayName}),(0,Q.jsx)(`div`,{className:`space-y-1`,children:t.map(e=>{let t=(()=>{let t=R[e.id]??null;return!t||!Gt(t)?``:t.provider||t.model?`__custom__`:t.profile??``})(),n=e.defaultProfile?f.find(t=>t.name===e.defaultProfile)?.label??e.defaultProfile:null;return(0,Q.jsx)(qt,{id:e.id,displayName:e.displayName,description:e.description,defaultProfileLabel:n,draft:R[e.id]??null,profileOptions:U(t===``||t===`__custom__`?null:t),onDraftChange:J,onToggle:Y},e.id)})})]},e.id))})]}),(0,Q.jsxs)(N.Footer,{children:[ee&&(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>w(!0),disabled:x||!M,tintColor:`var(--system-negative-strong)`,className:`mr-auto`,children:`Reset to Defaults`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:t,disabled:x,children:`Cancel`}),(0,Q.jsx)(s,{variant:`primary`,size:`compact`,onClick:()=>void re(),disabled:!B||te||x,children:x?(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin`}):`Save`})]}),(0,Q.jsx)(F,{open:C,title:`Reset to Defaults`,message:`Every task override will be reset and will follow your active profile. This cannot be undone.`,confirmLabel:`Reset to Defaults`,destructive:!0,onConfirm:()=>{w(!1),ie()},onCancel:()=>w(!1)})]})}function Xt({blocked:e,availableReplacements:t,replacement:n,onReplacementChange:r,error:i,saving:a,onClose:o,onConfirm:c}){let l=``;if(e){let t=e.label||e.name;l=e.isActive&&e.callSiteIds.length>0?`"${t}" is the active profile and is used by ${e.callSiteIds.length} call site(s). Pick a replacement profile.`:e.isActive?`"${t}" is the active profile. Pick a different active profile before deleting, or select a replacement below.`:`"${t}" is used by ${e.callSiteIds.length} call site(s). Select a replacement profile to reassign them before deleting.`}return(0,Q.jsx)(N.Root,{open:e!==null,onOpenChange:e=>{e||o()},children:(0,Q.jsxs)(N.Content,{size:`sm`,children:[(0,Q.jsx)(N.Header,{children:(0,Q.jsx)(N.Title,{children:`Can't Delete Profile`})}),(0,Q.jsxs)(N.Body,{className:`space-y-4`,children:[(0,Q.jsx)(h,{variant:`body-medium-default`,as:`p`,children:l}),e&&e.callSiteIds.length>0&&(0,Q.jsx)(`ul`,{className:`space-y-1 pl-1`,children:e.callSiteIds.map(e=>(0,Q.jsxs)(`li`,{className:`text-body-small-default text-(--content-secondary)`,children:[`• `,(0,Q.jsx)(`code`,{children:e})]},e))}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Replacement profile`}),(0,Q.jsx)(I,{"aria-label":`Replacement profile`,value:n,onChange:r,options:[{value:``,label:`Select a replacement…`},...t.map(e=>({value:e.name,label:e.label??e.name}))]})]}),i&&(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:i})]}),(0,Q.jsxs)(N.Footer,{children:[(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:o,children:`Cancel`}),(0,Q.jsx)(s,{variant:`primary`,size:`compact`,disabled:!n||a,onClick:c,children:a?`Saving…`:`Reassign and Delete`})]})]})})}function Zt(e,t){if(e){let n=Dt(e).find(e=>e.id===t);if(n)return n.displayName}let n=t.lastIndexOf(`/`);return n>=0?t.slice(n+1):t}function Qt(e,t){let n=[];e.description&&n.push(e.description);let r=e.provider_connection===`vellum`&&t?`vellum`:e.provider,i=[];if(e.model&&i.push(Zt(r,e.model)),r){let e=Ot[r]??r;i.push(`hosted by ${e}`)}return i.length>0&&n.push(i.join(` `)),n.join(` – `)}function $t({profile:e,vellumIsManaged:t,isDragging:n,dropTarget:r,isDeleting:i,deleteError:a,isToggling:o,onDragStart:c,onDragEnd:l,onDragOver:u,onDragLeave:d,onDrop:f,onEditClick:p,onDeleteClick:m,onStatusToggle:g}){let _=e.source===`managed`,v=e.invariant===!0,y=e.status!==`disabled`;return(0,Q.jsxs)(`div`,{className:`relative`,children:[r?.name===e.name&&!r.after&&(0,Q.jsx)(`div`,{className:`mx-0 h-0.5 rounded-full bg-[var(--border-active)]`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg pr-2 py-2${n?` opacity-50`:``}`,draggable:!_,onDragStart:c,onDragEnd:l,onDragOver:u,onDragLeave:d,onDrop:f,children:[(0,Q.jsx)(It,{className:`h-4 w-4 shrink-0 ${_?`invisible`:`cursor-grab text-[var(--content-tertiary)]`}`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1${y?``:` opacity-55`}`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(h,{variant:`body-medium-default`,as:`span`,className:`text-(--content-default)`,children:e.label??e.name}),_&&(0,Q.jsx)(k,{tone:`positive`,title:`Managed by Platform — this profile cannot be disabled, deleted, or renamed.`,children:`Platform`})]}),e.description||e.model||e.provider?(0,Q.jsx)(h,{variant:`body-medium-lighter`,as:`p`,className:`mt-0.5 text-(--content-tertiary)`,children:Qt(e,t)}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(!v||!y)&&(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center`,title:y?`Active — toggle to hide from pickers`:`Disabled — toggle to show in pickers`,children:(0,Q.jsx)(M,{checked:y,onChange:e=>g(e),disabled:o,"aria-label":`${y?`Disable`:`Enable`} ${e.label??e.name}`})}),(0,Q.jsxs)(`div`,{className:`flex w-[92px] items-center justify-end gap-2`,children:[(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:p,children:_||v?`View`:`Edit`}),(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(Tt,{}),"aria-label":`Delete ${e.label??e.name}`,disabled:_||v||i,title:_||v?`Managed profiles cannot be deleted`:void 0,onClick:m,tintColor:`var(--system-negative-strong)`})]})]})]}),r?.name===e.name&&r.after&&(0,Q.jsx)(`div`,{className:`mx-0 h-0.5 rounded-full bg-[var(--border-active)]`}),a?(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`px-2 pb-1 text-(--system-negative-strong)`,children:a}):null]})}function en({isOpen:e,assistantId:t,onClose:n}){let r=u(),{data:i}=d({...K({path:{assistant_id:t}}),staleTime:3e4}),o=(0,Z.useMemo)(()=>i?.llm?.profiles??{},[i?.llm?.profiles]),s=(0,Z.useMemo)(()=>i?.llm?.profileOrder??[],[i?.llm?.profileOrder]),c=i?.llm?.activeProfile??null,l=i?.llm?.callSites??{},f=(0,Z.useMemo)(()=>dt(o,s),[o,s]),p=H({onSuccess:e=>{X(r,{path:{assistant_id:t}},e)}}),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(null),{data:v}=d({...W({path:{assistant_id:t}}),enabled:e}),y=v?.connections,b=y?.some(e=>e.name===`vellum`&&e.provider===`vellum`)??!1,x=Object.keys(o);async function S(e,n,r){let i=r?.mode??`replace`,c=!(e in o);if(i===`merge`&&!c){await p.mutateAsync({path:{assistant_id:t},body:{llm:{profiles:{[e]:n}}}}),h(!1),_(null);return}let l={profiles:{[e]:n}};if(c&&(l.profileOrder=s.includes(e)?s:[...s,e]),c)await p.mutateAsync({path:{assistant_id:t},body:{llm:l}});else{let n=o[e];await p.mutateAsync({path:{assistant_id:t},body:{llm:{profiles:{[e]:null}}}});try{await p.mutateAsync({path:{assistant_id:t},body:{llm:l}})}catch(r){throw a(r,{context:`settings-ai-profile-edit-recreate`}),n!=null&&await p.mutateAsync({path:{assistant_id:t},body:{llm:{profiles:{[e]:n}}}}).catch(()=>{}),r}}c&&P.success(`Profile "${n.label??e}" created`),h(!1),_(null)}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(N.Root,{open:e,onOpenChange:e=>{e||n()},children:e?(0,Q.jsx)(tn,{assistantId:t,vellumIsManaged:b,profiles:o,profileOrder:s,orderedProfiles:f,activeProfile:c,callSiteOverrides:l,onClose:n,onEditClick:e=>{_(e),h(!0)},onNewClick:()=>{_(null),h(!0)}}):null}),(0,Q.jsx)(kt,{isOpen:m,mode:g?g.source===`managed`||g.invariant===!0?`view`:`edit`:`create`,profileName:g?.name,initialValues:g??void 0,existingNames:x,connections:y,assistantId:t,onSave:S,onCancel:()=>{h(!1),_(null)}})]})}function tn({assistantId:e,vellumIsManaged:t,profiles:n,profileOrder:r,orderedProfiles:i,activeProfile:o,callSiteOverrides:c,onClose:l,onEditClick:d,onNewClick:f}){let p=u(),m=H({onSuccess:t=>{X(p,{path:{assistant_id:e}},t)}}),[g,_]=(0,Z.useState)({}),[v,y]=(0,Z.useState)({}),[b,x]=(0,Z.useState)(new Set),[S,C]=(0,Z.useState)(null),[w,T]=(0,Z.useState)(null),[E,D]=(0,Z.useState)(null),[O,k]=(0,Z.useState)(null),A=(0,Z.useRef)(null),j=(0,Z.useRef)(null),[M,P]=(0,Z.useState)(null),[F,I]=(0,Z.useState)(null),[L,R]=(0,Z.useState)(``),[z,ee]=(0,Z.useState)(!1),B=(0,Z.useMemo)(()=>i,[i]);async function te(t,r){if(b.has(t.name))return!1;x(e=>new Set(e).add(t.name)),C(null);let i=r?`active`:`disabled`;if(!n[t.name])return x(e=>{let n=new Set(e);return n.delete(t.name),n}),!1;try{return await m.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[t.name]:{status:i}}}}}),!0}catch(e){return a(e,{context:`settings-ai-profile-toggle`}),C(`Couldn't update "${t.label??t.name}". Please try again.`),!1}finally{x(e=>{let n=new Set(e);return n.delete(t.name),n})}}async function V(t){y(e=>({...e,[t]:!0})),_(e=>{let n={...e};return delete n[t],n});try{let n=r.filter(e=>e!==t);await m.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[t]:null},profileOrder:n}}})}catch(e){a(e,{context:`settings-ai-profile-delete`}),_(e=>({...e,[t]:`Failed to delete profile. Please try again.`}))}finally{y(e=>{let n={...e};return delete n[t],n})}}function ne(e){let t=B.find(t=>t.name===e)?.label??e,n=e===o,r=Object.entries(c).filter(([t,n])=>t!==`mainAgent`&&n?.profile===e).map(([e])=>e);if(n||r.length>0){P({name:e,label:t,isActive:n,callSiteIds:r}),R(``),I(null);return}V(e)}async function U(){if(!M||!L)return;ee(!0),I(null);let t={};if(M.isActive&&(t.activeProfile=L),M.callSiteIds.length>0){let e={};for(let t of M.callSiteIds)e[t]={profile:L};t.callSites=e}if(Object.keys(t).length>0)try{await m.mutateAsync({path:{assistant_id:e},body:{llm:t}})}catch(e){a(e,{context:`settings-ai-profile-reassign-delete`}),I(`Failed to reassign references. Please try again.`),ee(!1);return}let n=M.name;P(null),ee(!1),V(n)}async function W(t,n){if(t===n.name)return;k(null);let i=r.filter(e=>e!==t),o=i.indexOf(n.name);if(o===-1)return;n.after&&(o+=1);let s=[...i.slice(0,o),t,...i.slice(o)];try{await m.mutateAsync({path:{assistant_id:e},body:{llm:{profileOrder:s}}})}catch(e){a(e,{context:`settings-ai-profile-reorder`}),k(`Failed to reorder profiles. Please try again.`)}}let G=B.filter(e=>e.name!==M?.name&&e.source!==`managed`),K=G.length>0?G:B.filter(e=>e.name!==M?.name);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(N.Content,{size:`md`,children:[(0,Q.jsxs)(N.Header,{children:[(0,Q.jsx)(N.Title,{children:`Model Profiles`}),(0,Q.jsx)(N.Description,{children:`Bundle a provider and model into a named profile. Assign profiles to specific actions or swap between them when chatting.`})]}),(0,Q.jsxs)(N.Body,{children:[B.length===0?(0,Q.jsx)(h,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`No profiles yet. Create one to get started.`}):(0,Q.jsx)(`div`,{className:`space-y-1`,children:B.map(e=>(0,Q.jsx)($t,{profile:e,vellumIsManaged:t,isDragging:w===e.name,dropTarget:E,isDeleting:v[e.name]??!1,deleteError:g[e.name],isToggling:b.has(e.name),onDragStart:t=>{A.current=e.name,T(e.name),t.dataTransfer&&(t.dataTransfer.effectAllowed=`move`)},onDragEnd:()=>{A.current=null,j.current=null,T(null),D(null)},onDragOver:t=>{t.preventDefault();let n=t.currentTarget.getBoundingClientRect(),r=t.clientY>n.top+n.height/2,i={name:e.name,after:r};j.current=i,D(i)},onDragLeave:t=>{t.currentTarget.contains(t.relatedTarget)||(j.current=null,D(t=>t?.name===e.name?null:t))},onDrop:e=>{e.preventDefault();let t=A.current,n=j.current;A.current=null,j.current=null,T(null),D(null),t&&n&&W(t,n)},onEditClick:()=>d(e),onDeleteClick:()=>ne(e.name),onStatusToggle:t=>void te(e,t)},e.name))}),O&&(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`mt-2 text-(--system-negative-strong)`,children:O}),S&&(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`mt-2 text-(--system-negative-strong)`,children:S})]}),(0,Q.jsxs)(N.Footer,{className:`justify-between`,children:[(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:f,children:`+ New Profile`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:l,children:`Done`})]})]}),(0,Q.jsx)(Xt,{blocked:M,availableReplacements:K,replacement:L,onReplacementChange:R,error:F,saving:z,onClose:()=>{P(null),I(null)},onConfirm:()=>void U()})]})}var nn=`0.10.8`;function rn(){return se(nn)}function an({mode:e,connection:t,assistantId:n,existingNames:r,onSave:i,onCancel:a}){let[o,c]=(0,Z.useState)(t?.label??``),l=t?.name??``,d=t?.provider??`anthropic`,f=t?.auth.type??`api_key`,[p,m]=(0,Z.useState)(()=>t?.auth.type===`api_key`?t.auth.credential:t?``:`credential/anthropic/api_key`),[g,_]=(0,Z.useState)(t?.baseUrl??``),[v,y]=(0,Z.useState)(()=>t?.models?t.models.map(e=>e.id).join(`, `):``),[b,x]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(null),w=d===`openai-compatible`,[T,E]=(0,Z.useState)(``),[D,O]=(0,Z.useState)(!1),k=u(),A=(0,Z.useMemo)(()=>et(p),[p]),M=f===`api_key`&&A!==null,{hasStoredCredential:P,isLoading:F}=bt({assistantId:n,credentialKind:`credential`,credentialName:A?`${A.service}:${A.field}`:``,enabled:M}),{credentials:I}=Fe({assistantId:n,enabled:f===`api_key`});(0,Z.useEffect)(()=>{let e=t?.provider??`anthropic`;c(t?.label??``),t?.auth.type===`api_key`?m(t.auth.credential):m(t?``:`credential/${e}/api_key`),C(null),_(t?.baseUrl??``),y(t?.models?t.models.map(e=>e.id).join(`, `):``),E(``),O(!1)},[t]);let L=l.trim().length>0;async function ee(){if(L){x(!0),C(null);try{let e;if(f===`api_key`){let t=p.trim()||`credential/${d}/api_key`,r=T.trim();if(r){O(!0);try{let e=et(t);await z({path:{assistant_id:n},body:e?{type:`credential`,name:`${e.service}:${e.field}`,value:r}:{type:`api_key`,name:d,value:r},throwOnError:!0});let i=Oe(n,`credential`,e?`${e.service}:${e.field}`:``);k.setQueryData(i,!0),k.invalidateQueries({queryKey:G({path:{assistant_id:n}})})}catch{C(`Failed to save API key. Please try again.`);return}finally{O(!1)}}e={type:`api_key`,credential:t}}else if(t)e=t.auth;else{C(`Nothing to edit. Close and try again.`);return}let r=o.trim()||null,a={auth:e,label:r,...w&&{base_url:g.trim()||null,models:v.trim()?v.split(`,`).map(e=>({id:e.trim()})).filter(e=>e.id):null}},{data:s,error:c,response:u}=await R({path:{assistant_id:n,name:t?.name??l.trim()},body:a});if(!u?.ok){C(Ue(u?.status,c)??Xe(u?.status));return}if(!s){C(`Server returned an empty response. Please try again.`);return}i(s)}catch{C(`Failed to save provider. Please try again.`)}finally{x(!1)}}}let B=I.filter(e=>e.service===d),te=e!==`create`&&t?.auth.type===`api_key`,V=B.length>0||te,H=Ne(`Enter your API key`,P);return e===`create`?(0,Q.jsx)(st,{variant:`modal`,assistantId:n,existingNames:r,defaultProviderType:d,onCreated:i,onCancel:a}):(0,Q.jsxs)(N.Content,{size:`md`,children:[(0,Q.jsxs)(N.Header,{children:[(0,Q.jsx)(N.Title,{children:`Edit Provider`}),(0,Q.jsx)(N.Description,{children:t?`Editing ${Ie(t)}.`:`Edit provider settings.`})]}),(0,Q.jsxs)(N.Body,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsxs)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:[`Display Name`,` `,(0,Q.jsx)(`span`,{className:`text-[var(--content-disabled)]`,children:`(optional)`})]}),(0,Q.jsx)(j,{value:o,onChange:e=>c(e.target.value),placeholder:`e.g. My Anthropic Key`,fullWidth:!0})]}),w&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Base URL`}),(0,Q.jsx)(j,{value:g,onChange:e=>_(e.target.value),placeholder:`https://api.example.com/v1`,fullWidth:!0})]}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Models`}),(0,Q.jsx)(j,{value:v,onChange:e=>y(e.target.value),placeholder:`model-1, model-2`,fullWidth:!0}),(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-[var(--content-tertiary)]`,children:`Comma-separated model identifiers exposed by your endpoint.`})]})]}),f===`api_key`&&(0,Q.jsx)(Qe,{apiKeyValue:T,onApiKeyChange:E,credential:p,onCredentialChange:m,isLoadingCredential:F,apiKeyPlaceholder:H,provider:d,providerCredentials:B,showAdvancedSection:V,onError:C}),f===`oauth_subscription`&&(0,Q.jsx)(St,{assistantId:n,onConnected:i}),S&&(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:S})]}),(0,Q.jsxs)(N.Footer,{children:[(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:a,children:`Cancel`}),(0,Q.jsx)(s,{variant:`primary`,size:`compact`,disabled:!L||b||D,onClick:()=>void ee(),children:b?`Saving…`:`Save`})]})]})}var on={anthropic:!0,openai:!0,gemini:!0,fireworks:!0,openrouter:!0,vellum:!0};function sn(e){return e in on}function cn({isOpen:e,assistantId:t,onClose:n}){let[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(null),s=u(),{data:c,isLoading:l,isError:f}=d({...W({path:{assistant_id:t}}),enabled:e}),p=rn(),{data:m}=d({...J({path:{assistant_id:t}}),enabled:e&&p}),h=(0,Z.useMemo)(()=>{let e=c?.connections??[];return[...e.filter(e=>e.provider===yt),...e.filter(e=>e.provider!==yt)]},[c]);function g(){s.invalidateQueries({queryKey:ie({path:{assistant_id:t}})}),s.invalidateQueries({queryKey:Y({path:{assistant_id:t}})})}function _(e){s.invalidateQueries({queryKey:U({path:{assistant_id:t}})}),i(!1),o(null)}let v=h.map(e=>e.name),y=()=>{i(!1),o(null)};return(0,Q.jsx)(N.Root,{open:e,onOpenChange:e=>{e||(r?y():n())},children:e?r?(0,Q.jsx)(an,{mode:a?`edit`:`create`,connection:a??void 0,assistantId:t,existingNames:v,onSave:_,onCancel:y}):(0,Q.jsx)(ln,{connections:h,loading:l,isError:f,assistantId:t,supportsDefaultProvider:p,defaultConnectionName:p?m?.resolvedConnectionName??null:null,onDefaultChanged:g,onClose:n,onEditClick:e=>{o(e),i(!0)},onNewClick:()=>{o(null),i(!0)},onConnectionDeleted:()=>{s.invalidateQueries({queryKey:U({path:{assistant_id:t}})})}}):null})}function ln({connections:e,loading:t,isError:n,assistantId:r,supportsDefaultProvider:i,defaultConnectionName:o,onDefaultChanged:c,onClose:l,onEditClick:u,onNewClick:d,onConnectionDeleted:p}){let[m,g]=(0,Z.useState)({}),[_,v]=(0,Z.useState)({}),y=f({...re(),onMutate:e=>{let t=e.body?.connectionName;t&&g(e=>{let n={...e};return delete n[t],n})},onSuccess:c,onError:(e,t)=>{a(e,{context:`settings-ai-set-default-provider`});let n=t.body?.connectionName;n&&g(e=>({...e,[n]:`Failed to set default provider. Please try again.`}))}});function b(e){sn(e.provider)&&y.mutate({path:{assistant_id:r},body:{provider:e.provider,connectionName:e.name}})}async function x(e){v(t=>({...t,[e]:!0})),g(t=>{let n={...t};return delete n[e],n});try{let{response:t}=await L({path:{assistant_id:r,name:e}});t?.ok||t?.status===404?p(e):t?.status===409?g(t=>({...t,[e]:`This provider is in use by a profile or as the default provider. Update those settings before deleting it.`})):g(t=>({...t,[e]:`Failed to delete provider. Please try again.`}))}catch{g(t=>({...t,[e]:`Failed to delete provider. Please try again.`}))}finally{v(t=>{let n={...t};return delete n[e],n})}}return(0,Q.jsxs)(N.Content,{size:`md`,children:[(0,Q.jsxs)(N.Header,{children:[(0,Q.jsx)(N.Title,{children:`Providers`}),(0,Q.jsx)(N.Description,{children:`Manage the model providers your assistant can use.`})]}),(0,Q.jsx)(N.Body,{children:t?(0,Q.jsx)(`div`,{className:`space-y-2 py-2`,children:[1,2,3].map(e=>(0,Q.jsx)(`div`,{className:`h-10 animate-pulse rounded-lg bg-[var(--surface-active)]`},e))}):n?(0,Q.jsx)(h,{variant:`body-medium-default`,as:`p`,className:`py-4 text-center text-(--system-negative-strong)`,children:`Failed to load providers. Please try again.`}):e.length===0?(0,Q.jsx)(h,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`No providers yet. Add one to get started.`}):(0,Q.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>{let t=_[e.name]??!1,n=m[e.name],r=e.isManaged??!1,a=e.name===o,c=sn(e.provider),l=y.isPending&&y.variables?.body?.connectionName===e.name;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg px-2 py-2`,children:[(0,Q.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(h,{variant:`body-medium-default`,as:`span`,className:`text-(--content-default)`,children:Ie(e)}),r&&(0,Q.jsx)(k,{tone:`positive`,title:`Managed by Platform — you can rename this provider, but not edit it.`,children:`Platform`}),a&&(0,Q.jsx)(k,{tone:`info`,title:`Built-in profiles (Balanced, Quality, Speed) use this provider.`,children:`Default`})]})}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[i&&!a&&(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,disabled:!c||l,title:c?`Use this provider for the built-in profiles.`:`Built-in profiles can't run on this provider.`,onClick:()=>b(e),children:`Set as default`}),!r&&(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:()=>u(e),children:`Edit`}),(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(Tt,{}),"aria-label":`Delete ${Ie(e)}`,disabled:r||a||t,title:r?`The Vellum provider cannot be removed`:a?`This is your default provider. Set another provider as default first.`:void 0,onClick:()=>void x(e.name),tintColor:`var(--system-negative-strong)`})]})]}),n?(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`px-2 pb-1 text-(--system-negative-strong)`,children:n}):null]},e.name)})})}),(0,Q.jsxs)(N.Footer,{className:`justify-between`,children:[(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:d,children:`+ Add Provider`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:l,children:`Done`})]})]})}function un(e){let[t,n]=(0,Z.useState)(void 0);return(0,Z.useEffect)(()=>{t!==void 0&&e===t.value&&n(void 0)},[e,t]),[t===void 0?e:t.value,(0,Z.useCallback)(e=>n(e===void 0?void 0:{value:e}),[])]}function dn(){let e=Nt(),t=u(),{data:n}=d({...K({path:{assistant_id:e}}),staleTime:3e4}),r=rn(),{data:i,refetch:o}=d({...J({path:{assistant_id:e}}),enabled:r}),c=i?.availability,l=n?.llm?.activeProfile??null,f=n?.llm?.advisorProfile??null,p=n?.llm?.callSites??{},{profiles:m,profileOrder:g}=it(n?.llm,e),_=(0,Z.useMemo)(()=>dt(m,g),[m,g]),v=H({onSuccess:n=>{X(t,{path:{assistant_id:e}},n)}}),[y,b]=un(l),[x,S]=un(f),[C,w]=(0,Z.useState)(!1),[E,O]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(!1),j=(0,Z.useMemo)(()=>ut(_,[y]),[_,y]),M=(0,Z.useMemo)(()=>ut(_,[x]),[_,x]),N=Object.entries(p).filter(([e,t])=>e!==`mainAgent`&&(t?.profile!=null||t?.provider!=null||t?.model!=null)).length,F=N===1?`1 Override`:N>0?`${N} Overrides`:`Overrides`,L=y!==l,R=x!==f,z=(0,Z.useCallback)(async()=>{try{let t={};L&&(t.activeProfile=y),R&&(t.advisorProfile=x),await v.mutateAsync({path:{assistant_id:e},body:{llm:t}}),P.success(`Saved.`)}catch(e){P.error(`Failed to save. Please try again.`),a(e,{context:`settings-ai-language-model-save`})}},[L,R,y,x,v,e]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(zt,{title:`Language Model`,subtitle:`Configure the LLMs that power your assistant`,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[c&&c.status!==`ok`&&(0,Q.jsx)(D,{tone:c.status===`unknown`?`warning`:`error`,children:c.message??`Your default provider is not available.`}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Default Profile`}),(0,Q.jsx)(I,{value:y??``,onChange:e=>{b(e===``?null:e)},placeholder:`Select a default profile…`,options:j.map(e=>({value:e.name,label:At(e)}))}),j.length===0?(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`mt-1 text-(--content-tertiary)`,children:`No profiles yet. Click Profiles below to create one.`}):null]}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Advisor Profile`}),(0,Q.jsx)(I,{value:x??``,onChange:e=>{S(e===``?null:e)},placeholder:`Select an advisor profile…`,options:M.map(e=>({value:e.name,label:At(e)}))}),(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`mt-1 text-(--content-tertiary)`,children:`Which model your assistant consults for a second opinion`})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>A(!0),children:`Providers`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>w(!0),children:`Profiles`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>O(!0),children:F})]}),(L||R)&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)($,{onClick:z,disabled:v.isPending}),v.isPending&&(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`})]})]})}),e&&(0,Q.jsx)(en,{isOpen:C,assistantId:e,onClose:()=>w(!1)}),e&&(0,Q.jsx)(Jt,{isOpen:E,onClose:()=>O(!1),assistantId:e}),e&&(0,Q.jsx)(cn,{isOpen:k,assistantId:e,onClose:()=>{A(!1),r&&o()}})]})}function fn(){let e=Nt();return(0,Z.useCallback)(async(t,n)=>{try{let{data:r}=await z({path:{assistant_id:e},body:{value:n,type:`api_key`,name:t},throwOnError:!0});je(r)}catch(e){throw e instanceof Error&&e.message===`No assistant found`?P.error(`Assistant not ready. Please try again.`):P.error(`Failed to save ${t} API key. Please try again.`),a(e,{context:`provision_provider_key`}),e}},[e])}var pn=`0.10.12`;function mn(){return ce(pn)}function hn(){let e=Nt(),i=u(),o=de(),{data:s}=d({...K({path:{assistant_id:e}}),enabled:o,staleTime:3e4}),c=H({onSuccess:t=>{X(i,{path:{assistant_id:e}},t)}}),l=fn(),f=(0,Z.useMemo)(()=>{if(!s)return r(qe,`inference-provider-native`);let e=s.services?.[`web-search`];return(e?.mode===`managed`&&e?.provider!==`inference-provider-native`?`vellum`:e?.provider)||r(`vellum:ai:webSearchProvider`,`inference-provider-native`)},[s]),[p,m]=(0,Z.useState)(!1),[h,g]=un(f),[_,v]=(0,Z.useState)(``),y=Re.has(h),{hasStoredCredential:b}=bt({assistantId:e,credentialKind:`api_key`,credentialName:h,enabled:y}),x=_.trim().length>0,S=p||y&&!b&&!x||h===f&&!x,C=Ne(Ge[h]??`Enter your API key`,b),w=(0,Z.useCallback)(async()=>{m(!0);let t=_.trim(),r=ct(h),o=y&&t.length>0;try{o&&await l(h,t),await oe();let n=h===`vellum`?mn()?{provider:`vellum`,mode:`managed`}:{mode:`managed`}:{provider:h,mode:`your-own`};await c.mutateAsync({path:{assistant_id:e},body:{services:{"web-search":n}}}).catch(e=>{throw P.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e})}catch{m(!1);return}m(!1);try{if(n(qe,h),o){r&&n(r,t);let a=Oe(e,`api_key`,h);i.setQueryData(a,!0),i.invalidateQueries({queryKey:a}),v(``)}P.success(`Web search settings saved.`)}catch(e){a(e,{context:`settings-ai-web-search-persist-local`}),P.error(`Saved, but local preferences could not be written.`)}},[y,c,l,i,e,_,h]),E=(0,Z.useCallback)(()=>{let e=ct(h);e&&t(e),v(``),g(`inference-provider-native`),n(qe,`inference-provider-native`)},[h,g]);return(0,Q.jsx)(zt,{title:`Web Search`,subtitle:`Configure how your assistant should search the web`,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(I,{"aria-label":`Web search provider`,value:h,onChange:g,options:Et.map(e=>({value:e,label:Ke[e]??e}))})]}),h===`vellum`&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Search runs through your Vellum account.`}),y&&(0,Q.jsx)(j,{label:`API Key`,type:`password`,value:_,onChange:e=>v(e.target.value),placeholder:C,fullWidth:!0}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)($,{onClick:w,disabled:S}),p&&(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),y&&(0,Q.jsx)(Ht,{onClick:E,filled:!0})]})]})})}var gn=`default`;function _n(){let e=Nt(),i=u(),{data:o}=d({...K({path:{assistant_id:e}}),staleTime:3e4}),s=H({onSuccess:t=>{X(i,{path:{assistant_id:e}},t)}}),c=fn(),l=(0,Z.useMemo)(()=>o?o.services?.[`web-fetch`]?.provider||r(`vellum:ai:webFetchProvider`,gn):r(We,gn),[o]),[f,p]=(0,Z.useState)(!1),[m,h]=un(l),[g,_]=(0,Z.useState)(``),v=gt.has(m),{hasStoredCredential:y}=bt({assistantId:e,credentialKind:`api_key`,credentialName:m,enabled:v}),b=g.trim().length>0,x=f||v&&!y&&!b||m===l&&!b,S=Ne(nt[m]??`Enter your API key`,y),C=(0,Z.useCallback)(async()=>{p(!0);let t=g.trim(),r=v&&t.length>0;try{r&&await c(m,t),await s.mutateAsync({path:{assistant_id:e},body:{services:{"web-fetch":{provider:m}}}}).catch(e=>{throw P.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e})}catch{p(!1);return}p(!1);try{if(n(We,m),r){let r=Ve(m);r&&n(r,t);let a=Oe(e,`api_key`,m);i.setQueryData(a,!0),i.invalidateQueries({queryKey:a}),_(``)}P.success(`Web fetch settings saved.`)}catch(e){a(e,{context:`settings-ai-web-fetch-persist-local`}),P.error(`Saved, but local preferences could not be written.`)}},[v,s,c,i,e,g,m]),w=(0,Z.useCallback)(()=>{let e=Ve(m);e&&t(e),_(``),h(gn),n(We,gn)},[m,h]);return(0,Q.jsx)(zt,{id:`web-fetch`,title:`Web Fetch`,subtitle:`Configure how your assistant reads individual web pages`,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(I,{value:m,onChange:h,options:_t.map(e=>({value:e,label:mt[e]??e}))})]}),v&&(0,Q.jsx)(j,{label:`API Key`,type:`password`,value:g,onChange:e=>_(e.target.value),placeholder:S,fullWidth:!0}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)($,{onClick:C,disabled:x}),f&&(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),v&&(0,Q.jsx)(Ht,{onClick:w,filled:!0})]})]})})}function vn({subdomain:e,onSubdomainChange:t,domainSuffix:n,subdomainPlaceholder:r=`my-assistant`,disabled:i,autoFocus:a,prefix:o,error:s,locked:c,lockedMessage:l}){return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex h-9 w-full items-center rounded-md border bg-[var(--field-bg)] text-body-medium-lighter transition-[border-color] duration-150 ${s?`border-[var(--system-negative-strong)]`:`border-[var(--field-border)] focus-within:border-[var(--border-active)]`}`,children:[o,(0,Q.jsx)(`input`,{value:e,onChange:e=>t(e.target.value.toLowerCase().trim()),disabled:i||c,readOnly:c,autoFocus:a,placeholder:r,"aria-label":`Subdomain`,"aria-invalid":!!s,className:`h-full min-w-0 flex-1 bg-transparent ${o?`pl-1.5`:`pl-3`} pr-1 text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none disabled:cursor-not-allowed disabled:opacity-60`}),(0,Q.jsxs)(`span`,{className:`shrink-0 pr-3 font-mono text-[var(--content-secondary)]`,children:[`.`,n]})]}),s&&(0,Q.jsx)(`p`,{className:`mt-1.5 text-body-small-default text-[var(--system-negative-strong)]`,children:s}),c&&l&&(0,Q.jsx)(`p`,{className:`mt-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:l})]})}function yn({assistantId:e,assistantHandle:t,emailRootDomain:n}){let r=u(),i=l(),[o,p]=c(),[m,h]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(``),[C,w]=(0,Z.useState)(null),[E,O]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(!1),[j,M]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{g||!t||m||(h(t),_(!0))},[t,g,m]);let N=d({...pe(),enabled:!0}),I=N.data,L=I?.entitlements,R=L?.managed_email===!0,z=!!L&&!R,ee=!I&&N.isError&&!N.isFetching,B=d({...fe({path:{assistant_id:e}}),enabled:!z}),te=d({...xe({path:{assistant_id:e}}),enabled:!z}),V=B.data?.results?.[0],H=te.data?.results?.[0],ne=V?`${V.subdomain}.${n}`:null,U=d({..._e({path:{assistant_id:e,id:H?.id??``}}),enabled:!!H?.id,refetchOnWindowFocus:!1}),W=d({...Ce({path:{assistant_id:e,id:V?.id??``}}),enabled:!!V?.id,refetchInterval:e=>{let t=e.state.data?.status;return t===`verified`||t===`failed`?!1:1e4},refetchOnWindowFocus:!0});(0,Z.useEffect)(()=>{o.get(`release`)!==`1`||!V||H||(A(!0),p(e=>{let t=new URLSearchParams(e);return t.delete(`release`),t},{replace:!0}))},[H,V,o,p]);let G=f(be()),K=f(Se()),q=f(me()),J=f(he()),Y=(0,Z.useCallback)(()=>{let t={assistant_id:e};r.invalidateQueries({queryKey:ve({path:t})}),r.invalidateQueries({queryKey:ye({path:t})}),H?.id&&r.invalidateQueries({queryKey:ge({path:{...t,id:H.id}})}),r.invalidateQueries({queryKey:Te()})},[H?.id,e,r]),re=(0,Z.useCallback)(async()=>{let t=m.trim().toLowerCase();if(!t){y(`Enter a subdomain.`);return}O(!1);try{await G.mutateAsync({path:{assistant_id:e},body:{subdomain:t}}),h(``),y(null),Y(),P.success(`Domain ${t}.${n} registered.`)}catch(e){y(le(e,void 0,`Failed to register domain.`))}},[e,n,Y,G,m]),ie=(0,Z.useCallback)(async()=>{let t=b.trim().toLowerCase();if(!t){w(`Enter an email username.`);return}try{await q.mutateAsync({path:{assistant_id:e},body:{username:t}}),x(``),w(null),Y(),P.success(`Email address created.`)}catch(e){w(le(e,void 0,`Failed to create email address.`))}},[e,Y,q,b]),X=(0,Z.useCallback)(async()=>{if(H?.id){M(!1);try{await J.mutateAsync({path:{assistant_id:e,id:H.id}}),Y(),P.success(`Email address removed.`)}catch(e){a(e,{context:`email_address_delete`}),P.error(`Failed to remove email address.`)}}},[H?.id,e,J,Y]),ae=(0,Z.useCallback)(async()=>{if(!V?.id)return;if(H){P.error(`Remove the email address first.`);return}A(!1);let t=V.subdomain;try{await K.mutateAsync({path:{assistant_id:e,id:V.id}}),h(t),Y(),P.success(`Domain released.`)}catch(e){a(e,{context:`email_domain_release`}),P.error(`Failed to release domain.`)}},[H,e,K,V?.id,V?.subdomain,Y]);if(N.isLoading)return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin`}),`Checking subscription…`]});if(z)return(0,Q.jsxs)(D,{tone:`info`,icon:(0,Q.jsx)(S,{className:`h-4 w-4`,"aria-hidden":!0}),title:`Get a dedicated email address for your assistant`,actions:(0,Q.jsx)(s,{size:`compact`,onClick:()=>i(`${ue.settings.usage}?tab=billing&adjust_plan`),children:`Upgrade to Pro`}),children:[`Pro plans include a managed`,` `,`<your-subdomain>.${n}`,` inbox — no provider setup required. Or switch to `,(0,Q.jsx)(`strong`,{children:`Your Own`}),` to bring an existing provider.`]});let oe=ee?(0,Q.jsx)(D,{tone:`warning`,title:`Couldn't verify subscription status`,actions:(0,Q.jsx)(s,{size:`compact`,variant:`outlined`,onClick:()=>N.refetch(),children:`Retry`}),children:`We couldn't reach the billing service. The form below assumes managed email is enabled for your org — if it isn't, registering a domain will fail.`}):null;return V?H?(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[oe,(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Address`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:H.address}),(0,Q.jsx)(Vt,{status:W.data?.status,message:W.data?.message,isLoading:W.isLoading}),(0,Q.jsx)(s,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Q.jsx)(Tt,{}),onClick:()=>M(!0),disabled:J.isPending,"aria-label":`Remove email address`})]}),(0,Q.jsx)(F,{open:j,title:`Remove Email Address`,message:(0,Q.jsxs)(Q.Fragment,{children:[`Are you sure you want to remove `,(0,Q.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:H.address}),`? Your assistant will no longer be able to send or receive email at this address.`]}),confirmLabel:`Remove`,destructive:!0,onConfirm:X,onCancel:()=>M(!1)})]}),U.data?.usage&&(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[U.data.usage.sent_today,` /`,` `,U.data.usage.daily_limit,` sent today ·`,` `,U.data.usage.received_today,` received`]})]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[oe,(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Domain`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:[V.subdomain,`.`,n]}),(0,Q.jsx)(Vt,{status:W.data?.status,message:W.data?.message,isLoading:W.isLoading}),(0,Q.jsx)(s,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Q.jsx)(Tt,{}),onClick:()=>A(!0),disabled:K.isPending,"aria-label":`Release domain`})]}),(0,Q.jsx)(F,{open:k,title:`Release Domain`,message:(0,Q.jsxs)(Q.Fragment,{children:[`Are you sure you want to release `,(0,Q.jsxs)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:[V.subdomain,`.`,n]}),`? The subdomain will become available for others to claim.`]}),confirmLabel:`Release`,destructive:!0,onConfirm:ae,onCancel:()=>A(!1)})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Email address`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex h-9 min-w-0 flex-1 items-center rounded-md border bg-[var(--field-bg)] text-body-medium-lighter transition-[border-color] duration-150 ${C?`border-[var(--system-negative-strong)]`:`border-[var(--field-border)] focus-within:border-[var(--border-active)]`}`,children:[(0,Q.jsx)(`input`,{value:b,onChange:e=>{x(e.target.value.toLowerCase()),C&&w(null)},placeholder:`hi`,"aria-label":`Email username`,"aria-invalid":!!C,className:`h-full min-w-0 flex-1 bg-transparent pl-3 pr-1 text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`}),(0,Q.jsxs)(`span`,{className:`shrink-0 pr-3 font-mono text-[var(--content-secondary)]`,children:[`@`,ne]})]}),(0,Q.jsx)(s,{onClick:ie,disabled:q.isPending||!b.trim(),children:q.isPending?`Creating…`:`Create`})]}),C&&(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:C})]})]}):(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[oe,(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Subdomain`}),(0,Q.jsx)(vn,{subdomain:m,onSubdomainChange:e=>{h(e),v&&y(null)},domainSuffix:n,subdomainPlaceholder:`my-assistant`,error:v}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Each assistant gets its own subdomain. Lowercase letters, numbers, and hyphens only.`}),(0,Q.jsx)(s,{onClick:()=>O(!0),disabled:G.isPending||!m.trim(),children:G.isPending?`Registering…`:`Register`}),(0,Q.jsx)(F,{open:E,title:`Set Subdomain`,message:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:m.trim().toLowerCase()||`subdomain`}),` will also become your assistant's public handle. You won't be able to change it once set.`]}),confirmLabel:`Confirm`,onConfirm:re,onCancel:()=>O(!1)})]})}function bn(){let e=Nt(),t=de(),{data:o}=d({...we(),enabled:t}),s=o?.results?.[0]?.handle,c=Ft.use.emailRootDomain(),l=jt(),[u,f]=(0,Z.useState)(()=>l===`gated`?`your-own`:ft(r($e,`managed`),`managed`)),[p,m]=(0,Z.useState)(()=>{let e=r(Pe,`resend`);return e===`mailgun`||e===`resend`?e:`resend`}),h=d({queryKey:[`byoEmailCredential`,e,p],queryFn:async()=>{let{data:t}=await te({path:{assistant_id:e},body:{service:p,field:`api_key`},throwOnError:!0});return t},enabled:u===`your-own`||l===`gated`,staleTime:6e4,retry:i,meta:{errorContext:`byo_email_credential_check`}});(0,Z.useEffect)(()=>{h.error&&a(h.error,{context:`byo_email_credential_check`,bestEffort:!0})},[h.error]);let g=h.data?.hasSecret===!0,_=(0,Z.useCallback)(e=>{f(e),n($e,e)},[]),v=(0,Z.useCallback)(()=>{n(Pe,p),P.success(`Email settings saved.`)},[p]),y=(0,Z.useMemo)(()=>Mt.find(e=>e.id===p)??Mt[0],[p]),x=(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(w,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsxs)(`span`,{children:[`Configure `,y.displayName,` via the assistant CLI: ask the assistant to run the`,` `,(0,Q.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:y.setupSkill}),` `,`skill. It walks you through storing the API key, detecting the domain, and (optionally) wiring up an inbound webhook.`]}),(0,Q.jsxs)(`a`,{href:y.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Open `,y.displayName,(0,Q.jsx)(C,{className:`h-3 w-3`})]})]})]}),S=(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(I,{value:p,onChange:e=>{(e===`mailgun`||e===`resend`)&&m(e)},options:Mt.map(e=>({value:e.id,label:e.displayName}))})]}),g?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[var(--system-positive-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-default)]`,children:[(0,Q.jsx)(b,{className:`h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}),(0,Q.jsxs)(`span`,{children:[y.displayName,` API key configured. To reconfigure, run the`,` `,(0,Q.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:y.setupSkill}),` `,`skill.`]})]}),(0,Q.jsxs)(`a`,{href:y.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-body-small-default text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Open `,y.displayName,(0,Q.jsx)(C,{className:`h-3 w-3`})]})]}):x,(0,Q.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Q.jsx)($,{onClick:v,disabled:!1})})]});return l===`gated`?(0,Q.jsx)(zt,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,children:S}):(0,Q.jsx)(Rt,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,mode:u,onModeChange:_,children:u===`managed`?(0,Q.jsx)(`div`,{className:`space-y-4`,children:l===`disabled`?(0,Q.jsx)(Be,{children:`Log in to the Vellum platform to manage email settings.`}):(0,Q.jsx)(yn,{assistantId:e,assistantHandle:s,emailRootDomain:c})}):S})}function xn(){let e=Nt(),t=u(),{data:i}=d({...K({path:{assistant_id:e}}),staleTime:3e4}),o=H({onSuccess:n=>{X(t,{path:{assistant_id:e}},n)}}),s=fn(),[c,l]=un((0,Z.useMemo)(()=>ft(i?i.services?.[`image-generation`]?.mode??r(`vellum:ai:imageGenMode`,`your-own`):r(Ct,`your-own`),`your-own`),[i])),[f,p]=(0,Z.useState)(()=>r(ke,`gemini-3.1-flash-image-preview`)),[m,h]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(!1),v=(0,Z.useCallback)(async()=>{_(!0);let r=m.trim(),i=c===`your-own`&&r.length>0;try{i&&await s(pt(f),r),await o.mutateAsync({path:{assistant_id:e},body:{services:{"image-generation":{mode:c}}}}).catch(e=>{throw P.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e});try{await V({path:{assistant_id:e},body:{modelId:f},throwOnError:!0})}catch(e){throw P.error(`Failed to update image generation model. Please try again.`),a(e,{context:`set_image_gen_model`}),e}finally{t.invalidateQueries({queryKey:Y({path:{assistant_id:e}})})}}catch{_(!1);return}_(!1);try{n(Ct,c),n(ke,f),i&&h(``),P.success(`Image generation settings saved.`)}catch(e){a(e,{context:`settings-ai-image-gen-persist-local`}),P.error(`Saved, but local preferences could not be written.`)}},[m,c,f,e,o,s,t]),y=(0,Z.useCallback)(()=>{h(``),p(`gemini-3.1-flash-image-preview`),n(ke,`gemini-3.1-flash-image-preview`)},[]);return(0,Q.jsx)(Rt,{title:`Image Generation`,subtitle:`Configure which model your assistant uses to generate images`,mode:c,onModeChange:e=>l(e),children:c===`managed`?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Active Model`}),(0,Q.jsxs)(`div`,{className:`flex items-end gap-3`,children:[(0,Q.jsx)(I,{className:`flex-1`,value:f,onChange:p,options:at.map(e=>({value:e,label:Me[e]??e}))}),(0,Q.jsx)($,{onClick:v,disabled:g}),g&&(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`})]})]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(j,{label:`API Key`,type:`password`,value:m,onChange:e=>h(e.target.value),placeholder:pt(f)===`openai`?`Enter your OpenAI API key`:`Enter your Gemini API key`,fullWidth:!0}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Active Model`}),(0,Q.jsx)(I,{value:f,onChange:p,options:at.map(e=>({value:e,label:Me[e]??e}))})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)($,{onClick:v,disabled:g}),g&&(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),(0,Q.jsx)(Ht,{onClick:y})]})]})})}async function Sn(e){let{provider:t,apiKey:n,voiceId:r,text:i}=e;if(n.trim().length===0)return{kind:`error`,message:`Save an API key for this provider first.`};try{return t===`elevenlabs`?await Cn(n,r,i):t===`deepgram`?await wn(n,i):t===`fish-audio`?{kind:`unsupported`,message:`Fish Audio TTS is only supported in the desktop app today. Use ElevenLabs or Deepgram to test from the browser.`}:t===`xai`?{kind:`unsupported`,message:`xAI TTS is only supported in the desktop app today. Use ElevenLabs or Deepgram to test from the browser.`}:{kind:`unsupported`,message:`TTS testing for "${t}" is not supported from the browser yet.`}}catch(e){return{kind:`error`,message:e instanceof Error?e.message:`Failed to reach the TTS provider.`}}}async function Cn(e,t,n){let r=t.trim();if(r.length===0)return{kind:`error`,message:`Enter and save a Voice ID before testing ElevenLabs.`};let i=await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${encodeURIComponent(r)}?output_format=mp3_44100_128`,{method:`POST`,headers:{"xi-api-key":e,"Content-Type":`application/json`,Accept:`audio/mpeg`},body:JSON.stringify({text:n,model_id:`eleven_turbo_v2_5`})});return i.ok?{kind:`audio`,blob:await i.blob()}:{kind:`error`,message:await Tn(i,`ElevenLabs rejected the request.`)}}async function wn(e,t){let n=await fetch(`https://api.deepgram.com/v1/speak?model=aura-2-thalia-en`,{method:`POST`,headers:{Authorization:`Token ${e}`,"Content-Type":`application/json`,Accept:`audio/mpeg`},body:JSON.stringify({text:t})});return n.ok?{kind:`audio`,blob:await n.blob()}:{kind:`error`,message:await Tn(n,`Deepgram rejected the request.`)}}async function Tn(e,t){try{let n=await e.text();if(n.length===0)return`${t} (HTTP ${e.status})`;try{let e=JSON.parse(n);if(e&&typeof e==`object`&&`detail`in e&&typeof e.detail==`string`)return e.detail;if(e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`)return e.message}catch{}return n.slice(0,200)}catch{return`${t} (HTTP ${e.status})`}}function En({assistantId:e,value:t,onChange:n,className:r}){let[i,a]=(0,Z.useState)(!1),{voices:o}=rt(e);if(o.length===0)return null;let s=o.find(e=>e.model===t)??o[0];return(0,Q.jsxs)(A.Root,{open:i,onOpenChange:a,children:[(0,Q.jsx)(A.Trigger,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,"aria-label":`Voice`,className:m(`flex h-9 w-full items-center gap-2 rounded-md border border-[var(--field-border)] bg-[var(--field-bg)] px-3 text-left text-body-medium-lighter text-[var(--content-default)] transition-colors focus:outline-none data-[state=open]:border-[var(--border-active)]`,r),children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:s?vt(s.description):`Select a voice`}),(0,Q.jsx)(v,{className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0})]})}),(0,Q.jsx)(A.Content,{side:`bottom`,align:`start`,className:`w-[var(--radix-popover-trigger-width)] p-1`,children:(0,Q.jsx)(ht,{assistantId:e,value:t,onChange:n,onSelect:()=>a(!1),showSource:!0})})]})}var Dn={elevenlabs:`voiceId`,"fish-audio":`referenceId`,xai:`voiceId`};function On({assistantId:e,hideSaveButton:t=!1,hideCredentialsGuide:i=!1,onSaveStateChange:a}={}){let o=Nt(),c=e??o,l=ae.use.name()??`your assistant`,f=de(),p=u(),{data:m}=d({...ne({path:{assistant_id:c}}),enabled:f,staleTime:1/0}),h=(0,Z.useMemo)(()=>{let e=m?.providers;if(!e)return lt;if(e.some(e=>e.id===`vellum`))return e;let t=lt.find(e=>e.id===`vellum`);return t?[t,...e]:e},[m]),{data:g}=d({...K({path:{assistant_id:c}}),enabled:f,staleTime:3e4}),_=g?.services?.tts,v=_?.mode===`managed`?`vellum`:_?.provider,y=`elevenlabs`,b=(0,Z.useMemo)(()=>v??r(`vellum:voice:ttsProvider`,y),[v,y]),x=!!v,[S,C]=un(b),[w,T]=(0,Z.useState)(``),[E,D]=(0,Z.useState)(``),[O,k]=(0,Z.useState)(``),[A,M]=(0,Z.useState)(!1),[N,F]=(0,Z.useState)(!1),[L,R]=(0,Z.useState)(!1),{voices:z,defaultModel:te,fetched:V}=De(c,{enabled:S===`vellum`}),H=_?.providers?.vellum?.model??te??``,[U,W]=un(H),G=z.find(e=>e.model===U)??z[0],q=(0,Z.useMemo)(()=>h.find(e=>e.id===S)??h[0],[S,h]),J=S===`vellum`&&q.supportsVoiceSelection&&U!==H,re=(0,Z.useCallback)(e=>{let t=r(Ze+e,``),n=r(Le+e,``);M(t.length>0),D(n),k(n),T(``)},[]);(0,Z.useEffect)(()=>{re(S)},[S,re]);let ie=(0,Z.useMemo)(()=>{let e=S!==b,t=w.trim().length>0,n=E.trim()!==O;return e||t||n||J},[S,b,w,E,O,J]),X=(0,Z.useCallback)(async()=>{let e=w.trim(),t=E.trim(),i=q.id;n(tt,i),e.length>0&&n(Ze+i,e),n(Le+i,t);let a=e.length>0?e:r(Ze+i,``),o=Dn[i];R(!0);try{if(a.length>0){let{response:e}=await ee({path:{assistant_id:c},body:{service:i,field:`api_key`,value:a,label:`${q.displayName} API Key`},throwOnError:!1});if(!e?.ok)throw Error(`Failed to store API key (HTTP ${e?.status??`?`})`)}let e={...S!==b||!x?{provider:i,mode:i===`vellum`?`managed`:`your-own`}:{},...o?{providers:{[i]:{[o]:t}}}:{},...J?{providers:{vellum:{model:U}}}:{}};if(Object.keys(e).length>0){let{response:t}=await B({path:{assistant_id:c},body:{services:{tts:e}},throwOnError:!1});if(!t?.ok)throw Error(`Failed to save configuration (HTTP ${t?.status??`?`})`)}return M(a.length>0),k(t),T(``),p.invalidateQueries({queryKey:Y({path:{assistant_id:c}})}),P.success(`Text-to-speech settings saved`),!0}catch(e){return P.error(e instanceof Error?e.message:`Failed to save text-to-speech settings`),!1}finally{R(!1)}},[c,S,U,J,w,E,q,b,x,p]);(0,Z.useEffect)(()=>{a?.({hasChanges:ie,saving:L,save:X})},[a,ie,L,X]);let oe=(0,Z.useCallback)(()=>{n(Ze+S,``),M(!1),T(``)},[S]),se=(0,Z.useCallback)(async()=>{F(!0);try{let e=r(Ze+S,``),t=w.trim(),n=t.length>0?t:e;if(n.length===0){P.error(`Save an API key for this provider before testing.`);return}let i=r(Le+S,``),a=E.trim(),o=await Sn({provider:S,apiKey:n,voiceId:a.length>0?a:i,text:`Hey! It's ${l}. How does this sound?`});if(o.kind!==`audio`){P.error(o.message);return}let s=URL.createObjectURL(o.blob);try{let e=new Audio(s);await e.play(),await new Promise(t=>{e.onended=()=>t(),e.onerror=()=>t()})}finally{URL.revokeObjectURL(s)}}finally{F(!1)}},[l,w,S,E]),ce=A?`•••••••• (Enter a new key to replace)`:q.apiKeyPlaceholder,le=S===`vellum`,ue=le&&q.supportsVoiceSelection;return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(I,{value:S,onChange:C,options:h.map(e=>({value:e.id,label:e.displayName})),"aria-label":`TTS provider`})]}),!le&&(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,Q.jsx)(j,{type:`password`,value:w,onChange:e=>T(e.target.value),placeholder:ce,fullWidth:!0})]}),ue&&G&&(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Voice`}),(0,Q.jsx)(En,{assistantId:c,value:U,onChange:W})]}),ue&&V&&!G&&(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`No managed voices are currently available.`}),q.supportsVoiceSelection&&!le&&(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Voice ID`}),(0,Q.jsx)(j,{type:`text`,value:E,onChange:e=>D(e.target.value),placeholder:`Enter a voice ID`,fullWidth:!0})]}),!i&&!le&&(0,Q.jsx)(Ut,{guide:q.credentialsGuide}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!le&&(0,Q.jsx)(s,{variant:`outlined`,onClick:se,disabled:N,children:N?`Testing…`:`Test`}),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[!t&&(0,Q.jsx)($,{onClick:X,disabled:!ie||L}),A&&!le&&(0,Q.jsx)(Ht,{onClick:oe})]})]})]})}function kn(){return(0,Q.jsx)(zt,{title:`Text-to-Speech`,subtitle:`Configure how your assistant speaks`,children:(0,Q.jsx)(On,{})})}var An={vellum:{provider:`vellum`},deepgram:{provider:`deepgram`,credentialService:`deepgram`},openai:{provider:`openai-whisper`,credentialService:`openai`}},jn={vellum:`vellum`,deepgram:`deepgram`,"openai-whisper":`openai`},Mn=`deepgram`;function Nn({assistantId:e,hideSaveButton:t=!1,hideCredentialsGuide:i=!1,onSaveStateChange:a}={}){let o=Nt(),s=e??o,c=de(),l=u(),[f]=(0,Z.useState)(()=>He.filter(e=>!e.requiresNativeDictation||ze())),p=Mn,{data:m}=d({...K({path:{assistant_id:s}}),enabled:c,staleTime:3e4}),h=m?.services?.stt,g=h?.mode===`managed`?`vellum`:h?.provider,_=(0,Z.useMemo)(()=>{let e=g?jn[g]:void 0;if(e&&f.some(t=>t.id===e))return e;let t=r(Ye,p);return f.some(e=>e.id===t)?t:p},[g,f,p]),v=!!g,[y,b]=un(_),[x,S]=(0,Z.useState)(``),[C,w]=(0,Z.useState)(!1),[T,D]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{let e=r(Ye,p);e===`macos-native`&&!f.some(t=>t.id===e)&&n(Ye,p)},[f,p]);let O=(0,Z.useMemo)(()=>f.find(e=>e.id===y)??f[0],[f,y]),k=O.apiKeyPlaceholder!==void 0;(0,Z.useEffect)(()=>{w(r(xt+y,``).length>0),S(``)},[y]);let A=(0,Z.useMemo)(()=>{let e=y!==_,t=x.trim().length>0;return e||t},[y,_,x]),M=(0,Z.useCallback)(async()=>{let e=x.trim();n(Ye,y),e.length>0&&n(xt+y,e);let t=An[y];D(!0);try{if(t?.credentialService){let n=e.length>0?e:r(xt+y,``);if(n.length>0){let{response:e}=await ee({path:{assistant_id:s},body:{service:t.credentialService,field:`api_key`,value:n,label:`${O.displayName} API Key`},throwOnError:!1});if(!e?.ok)throw Error(`Failed to store API key (HTTP ${e?.status??`?`})`)}}if(t&&(y!==_||!v)||g===`vellum`&&y!==`vellum`){let e=t?.provider??Mn,{response:n}=await B({path:{assistant_id:s},body:{services:{stt:{provider:e,mode:e===`vellum`?`managed`:`your-own`}}},throwOnError:!1});if(!n?.ok)throw Error(`Failed to save configuration (HTTP ${n?.status??`?`})`)}return e.length>0&&w(!0),S(``),l.invalidateQueries({queryKey:Y({path:{assistant_id:s}})}),P.success(`Speech-to-text settings saved`),!0}catch(e){return P.error(e instanceof Error?e.message:`Failed to save speech-to-text settings`),!1}finally{D(!1)}},[s,y,x,O,_,v,g,l]);(0,Z.useEffect)(()=>{a?.({hasChanges:A,saving:T,save:M})},[a,A,T,M]);let N=(0,Z.useCallback)(()=>{n(xt+y,``),w(!1),S(``)},[y]),F=C?`•••••••• (Enter a new key to replace)`:O.apiKeyPlaceholder;return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(I,{value:y,onChange:b,options:f.map(e=>({value:e.id,label:e.displayName})),"aria-label":`STT provider`})]}),k&&(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,Q.jsx)(j,{type:`password`,value:x,onChange:e=>S(e.target.value),placeholder:F,fullWidth:!0})]}),O.setupWarning&&(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(E,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-mid-strong)]`}),(0,Q.jsx)(`span`,{children:O.setupWarning})]}),!i&&O.credentialsGuide&&(0,Q.jsx)(Ut,{guide:O.credentialsGuide}),y===`vellum`&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Transcription runs through your Vellum account.`}),(!t||C)&&(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[!t&&(0,Q.jsx)($,{onClick:M,disabled:!A||T}),C&&(0,Q.jsx)(Ht,{onClick:N})]})]})}function Pn(){return(0,Q.jsx)(zt,{title:`Speech-to-Text`,subtitle:`Configure how your assistant transcribes speech`,children:(0,Q.jsx)(Nn,{})})}function Fn(){return(0,Z.useEffect)(()=>{let e=window.location.hash.slice(1);e&&requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({block:`start`})})},[]),(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsx)(Bt,{}),(0,Q.jsx)(dn,{}),(0,Q.jsx)(hn,{}),(0,Q.jsx)(_n,{}),(0,Q.jsx)(bn,{}),(0,Q.jsx)(xn,{}),(0,Q.jsx)(kn,{}),(0,Q.jsx)(Pn,{})]})}export{Fn as AiPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{n as r,r as i}from"./avatar-svg-compositor-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{n as r,r as i}from"./avatar-svg-compositor-BfycUW-4.js";import{t as a}from"./use-reduced-motion-CxP6vGgk.js";var o=e(t(),1),s=n();function c(e,t){return e+Math.random()*(t-e)}function l(e){let t=[],n=/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,r;for(;(r=n.exec(e))!==null;)t.push(parseFloat(r[0]));return t}function u(e){let t=l(e),n=0,r=0,i=0;for(let e=0;e<t.length-1;e+=2)n+=t[e],r+=t[e+1],i++;return i>0?{x:n/i,y:r/i}:{x:0,y:0}}function d(e,t,n){let r=u(e),i=t*1.1;return e.replace(/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,(t,a)=>{let o=parseFloat(t),s=e.slice(0,a).match(/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi),c=s?s.length:0,u=c%2==0,d=u?r.x:r.y,f=l(e),p=u?c+1:c-1,m=p>=0&&p<f.length?f[p]:d,h=u?o:m,g=Math.atan2((u?m:o)-r.y,h-r.x),_=1+(Math.sin(g*2+i)*.7+Math.sin(g*3-i*.5)*.3)*n;return(d+(o-d)*_).toFixed(3)})}function f(e,t,n){let r=[e];for(let i=1;i<t;i++)r.push(d(e,i,n));return r}function p({components:e,traits:t,size:n,isAssistantBusy:l=!1,breathe:u=!0}){let d=a(),{bodyShape:p,eyeStyle:m,color:h}=i(e,t.bodyShape,t.eyeStyle,t.color),{bodyTransform:g,eyeTransform:_}=r(p,m,e,n),v=m.sourceViewBox,y=p.viewBox,b=Math.min(n/y.width,n/y.height),x=(n-y.width*b)/2,S=(n-y.height*b)/2,C=Math.min(y.width/v.width,y.height/v.height),w=e.faceCenterOverrides.find(e=>e.bodyShape===p.id&&e.eyeStyle===m.id),T=w?w.faceCenter:p.faceCenter,E=T.x-m.eyeCenter.x*C,D=T.y-m.eyeCenter.y*C,O=b*(E+m.eyeCenter.x*C)+x,k=b*(D+m.eyeCenter.y*C)+S,A=(0,o.useMemo)(()=>l?f(p.svgPath,16,.06):[p.svgPath],[p.svgPath,l]),[j,M]=(0,o.useState)(!1),[N,P]=(0,o.useState)(0),[F,I]=(0,o.useState)(0),L=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(d||l){M(!1);return}let e=!1;function t(){return setTimeout(()=>{e||(M(!0),setTimeout(()=>{e||(M(!1),Math.random()<.2?setTimeout(()=>{e||(M(!0),setTimeout(()=>{e||(M(!1),t())},150))},200):t())},150))},c(3e3,7e3))}let n=t();return()=>{e=!0,clearTimeout(n)}},[d,l]),(0,o.useEffect)(()=>{if(d||l){P(0);return}let e=!1;function t(){return setTimeout(()=>{e||(P((Math.random()<.5?-1:1)*c(1,2)),setTimeout(()=>{e||(P(0),t())},200))},c(8e3,15e3))}let n=t();return()=>{e=!0,clearTimeout(n)}},[d,l]),(0,o.useEffect)(()=>{if(!l||d){I(0);return}let e=0;return L.current=setInterval(()=>{e=(e+1)%A.length,I(e)},150),()=>{L.current&&clearInterval(L.current),L.current=null}},[l,d,A.length]);let R=n/2,z=n/2,B=d?`none`:l?`avatar-morph-scale 2.4s ease-in-out infinite, avatar-morph-rotate 3s ease-in-out infinite`:u?`avatar-breathe-kf 4s ease-in-out infinite`:`none`,V=l?0:N,H=j&&!l,U=A[F]??p.svgPath;return(0,s.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n,height:n,viewBox:`0 0 ${n} ${n}`,style:{animation:B,transformOrigin:`center`},children:[(0,s.jsx)(`g`,{style:{transform:`rotate(${V}deg)`,transformOrigin:`${R}px ${z}px`,transition:V===0?`transform 0.3s ease-out`:`transform 0.2s ease-in-out`},children:(0,s.jsx)(`path`,{d:U,fill:h.hex,transform:g,style:{transition:l?`d 0.3s ease-in-out`:`none`}})}),(0,s.jsx)(`g`,{style:{transform:H?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${O}px ${k}px`,transition:`transform 0.15s ease-in-out`},children:m.paths.map((e,t)=>(0,s.jsx)(`path`,{d:e.svgPath,fill:e.color,transform:_},t))})]})}export{p as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-jRWAZmH_.js";import{B as t,F as n,G as r,H as i,I as ee,J as a,K as o,L as s,R as te,U as c,V as ne,W as l,X as re,Y as u,Z as ie,q as d,z as f}from"./local-mode-B3-gNTGk.js";function p(e){return ie(ee,e)}function ae(e){return re(n,e)}var oe=s([`end_turn`,`max_tokens`,`max_turn_requests`,`refusal`,`cancelled`]),se=l({type:i(`acp_session_completed`),acpSessionId:d(),stopReason:oe}).strict(),ce=l({type:i(`acp_session_error`),acpSessionId:d(),error:d()}).strict(),le=l({type:i(`acp_session_spawned`),acpSessionId:d(),agent:d(),parentConversationId:d(),parentToolUseId:d().optional(),task:d().optional()}).strict(),ue=s([`agent_message_chunk`,`agent_thought_chunk`,`user_message_chunk`,`tool_call`,`tool_call_update`,`plan`]),de=l({type:i(`acp_session_update`),acpSessionId:d(),updateType:ue,content:d().optional(),toolCallId:d().optional(),toolTitle:d().optional(),toolKind:d().optional(),toolStatus:d().optional(),rawInput:u().optional(),rawOutput:u().optional(),locations:f(l({path:d(),line:c().optional()})).optional(),messageId:d().optional(),seq:c().optional()}).strict(),fe=l({type:i(`acp_session_usage`),acpSessionId:d(),usedTokens:c(),contextSize:c(),inputTokens:c().optional(),outputTokens:c().optional(),costAmount:c().optional(),costCurrency:d().optional()}).strict(),pe=s([`idle`,`thinking`,`streaming`,`tool_running`,`awaiting_confirmation`]),me=s([`assistant_turn`,`user_turn`,`global`]),he=s([`message_dequeued`,`thinking_delta`,`first_text_delta`,`tool_use_start`,`preview_start`,`tool_result_received`,`confirmation_requested`,`confirmation_resolved`,`context_compacting`,`message_complete`,`generation_cancelled`,`error_terminal`]),ge=l({type:i(`assistant_activity_state`),conversationId:d(),activityVersion:c(),phase:pe,anchor:me,reason:he,requestId:d().optional(),statusText:d().optional()}),_e=l({type:i(`assistant_text_delta`),text:d(),messageId:d().optional(),conversationId:d().optional()}),ve=l({type:i(`assistant_thinking_delta`),thinking:d(),messageId:d().optional(),conversationId:d().optional(),timestampMs:c().optional()}),ye=l({type:i(`assistant_turn_start`),messageId:d(),conversationId:d().optional()}),be=l({type:i(`avatar_updated`),avatarPath:d()}),xe=l({type:i(`background_tool_completed`),id:d(),conversationId:d(),status:s([`completed`,`failed`,`cancelled`]),exitCode:c().nullable().optional(),output:d().optional(),completedAt:c()}),Se=l({type:i(`background_tool_started`),id:d(),toolName:d(),conversationId:d(),command:d(),startedAt:c()}),Ce=l({id:d(),messageId:d(),conversationId:d(),conversationTitle:d().nullable(),messagePreview:d(),messageRole:d(),messageCreatedAt:c(),createdAt:c()}),we=l({type:i(`bookmark.created`),bookmark:Ce}),Te=l({type:i(`bookmark.deleted`),messageId:d()}),Ee=l({type:i(`compaction_circuit_closed`),conversationId:d()}),De=l({type:i(`compaction_circuit_open`),conversationId:d(),reason:i(`3_consecutive_failures`),openUntil:c()}),m=l({label:d(),description:d(),pattern:d()}),h=l({label:d(),scope:d()}),g=l({label:d(),scope:d()}),_=l({filePath:d(),oldContent:d(),newContent:d(),isNewFile:t()}),Oe=s([`allow_once`,`allow_always`,`reject_once`,`reject_always`]),ke=l({optionId:d(),name:d(),kind:Oe}),Ae=s([`sandbox`,`host`]),je=l({type:i(`confirmation_request`),requestId:d(),toolName:d(),input:o(d(),u()),riskLevel:d(),riskReason:d().optional(),isContainerized:t().optional(),executionTarget:Ae.optional(),allowlistOptions:f(m),scopeOptions:f(h),directoryScopeOptions:f(g).optional(),diff:_.optional(),conversationId:d().optional(),persistentDecisionsAllowed:t().optional(),toolUseId:d().optional(),acpToolKind:d().optional(),acpOptions:f(ke).optional()}),Me=l({type:i(`contact_request`),requestId:d(),channel:d().optional(),placeholder:d().optional(),label:d().optional(),description:d().optional(),role:d().optional()}),Ne=l({type:i(`contacts_changed`)}),v=s([`PROVIDER_NETWORK`,`PROVIDER_RATE_LIMIT`,`MANAGED_USAGE_LIMIT`,`PROVIDER_OVERLOADED`,`PROVIDER_API`,`IMAGE_TOO_LARGE`,`PROVIDER_BILLING`,`PROVIDER_ORDERING`,`PROVIDER_WEB_SEARCH`,`PROVIDER_NOT_CONFIGURED`,`PROVIDER_INVALID_KEY`,`MANAGED_KEY_INVALID`,`CONTEXT_TOO_LARGE`,`BUDGET_YIELD_UNRECOVERED`,`MAX_TOKENS_REACHED`,`CONVERSATION_ABORTED`,`CONVERSATION_PROCESSING_FAILED`,`DISK_SPACE_CRITICAL`,`UNKNOWN`]),y=l({type:i(`conversation_error`),conversationId:d(),code:v,userMessage:d(),retryable:t(),debugDetails:d().optional(),errorCategory:d().optional(),connectionName:d().optional(),profileName:d().optional()}),b=s([`created`,`renamed`,`deleted`,`reordered`,`seen_changed`]),Pe=l({type:i(`conversation_list_invalidated`),reason:b}),Fe=s([`memory_v3`]),Ie=l({type:i(`conversation_notice`),conversationId:d(),source:Fe,code:v,userMessage:d(),errorCategory:d().optional()}),Le=l({type:i(`conversation_title_updated`),conversationId:d(),title:d()}),Re=s([`disabled`,`ok`,`warning`,`critical`,`unknown`]),ze=s([`agent-turns`,`background-work`,`remote-ingress`]),x=l({enabled:t(),state:Re,locked:t(),acknowledged:t(),overrideActive:t(),effectivelyLocked:t(),lockId:d().nullable(),usagePercent:c().nullable(),thresholdPercent:c(),path:d().nullable(),lastCheckedAt:d().nullable(),blockedCapabilities:f(ze),error:d().nullable()}),Be=l({type:i(`disk_pressure_status_changed`),status:x}),Ve=l({id:d(),surfaceId:d(),author:d(),content:d(),anchorStart:c().optional(),anchorEnd:c().optional(),anchorText:d().optional(),parentCommentId:d().optional(),status:d(),createdAt:c(),updatedAt:c()}),He=l({type:i(`document_comment_created`),conversationId:d(),surfaceId:d(),comment:Ve}),Ue=l({type:i(`document_comment_deleted`),conversationId:d(),surfaceId:d(),commentId:d()}),We=l({type:i(`document_comment_reopened`),conversationId:d(),surfaceId:d(),commentId:d()}),Ge=l({type:i(`document_comment_resolved`),conversationId:d(),surfaceId:d(),commentId:d(),resolvedBy:d()}),Ke=l({type:i(`document_editor_update`),conversationId:d(),surfaceId:d(),markdown:d(),mode:d()}),qe=l({type:i(`error`),message:d(),code:d().optional(),category:d().optional(),errorCategory:d().optional(),requestId:d().optional(),conversationId:d().optional()}),Je=l({type:i(`generation_cancelled`),conversationId:d().optional()}),S=l({id:d().optional(),filename:d(),mimeType:d(),data:d(),sourceType:s([`sandbox_file`,`host_file`,`tool_block`]).optional(),sizeBytes:c().optional(),thumbnailData:d().optional(),fileBacked:t().optional(),filePath:d().optional()}),Ye=l({type:i(`generation_handoff`),conversationId:d().optional(),requestId:d().optional(),queuedCount:c(),messageId:d().optional(),attachments:f(S).optional(),attachmentWarnings:f(d()).optional()}),Xe=l({type:i(`home_feed_updated`),updatedAt:d(),newItemCount:c()}),Ze=l({kind:s([`plugin`,`workspace`]),id:d()}),Qe=l({type:i(`hook_event`),conversationId:d().optional(),hookName:d(),owner:Ze,detail:o(d(),u())}),$e=l({type:i(`identity_changed`),name:d(),role:d(),personality:d(),emoji:d(),home:d()}),et=s([`approved`,`rejected`,`answered`,`cancelled`,`superseded`]),tt=l({type:i(`interaction_resolved`),requestId:d(),conversationId:d(),state:et,kind:d()}),C=l({semanticUnavailable:t(),reason:d(),fallbackSources:f(d())}),nt=l({key:d(),type:d(),kind:d(),finalScore:c(),semantic:c(),recency:c()}),rt=l({type:i(`memory_recalled`),provider:d(),model:d(),degradation:C.optional(),semanticHits:c(),tier1Count:c(),tier2Count:c(),hybridSearchLatencyMs:c(),sparseVectorUsed:t(),mergedCount:c(),selectedCount:c(),injectedTokens:c(),latencyMs:c(),topCandidates:f(nt)}),it=l({type:i(`memory_status`),enabled:t(),degraded:t(),degradation:C.optional(),reason:d().optional(),provider:d().optional(),model:d().optional()}),at=l({type:i(`message_complete`),messageId:d().optional(),conversationId:d().optional(),source:s([`main`,`aux`]).optional(),attachments:f(S).optional(),attachmentWarnings:f(d()).optional()}),ot=l({type:i(`message_dequeued`),conversationId:d(),requestId:d()}),st=l({type:i(`message_queued`),conversationId:d(),requestId:d(),position:c()}),ct=l({type:i(`message_queued_deleted`),conversationId:d(),requestId:d()}),lt=l({type:i(`message_request_complete`),conversationId:d(),requestId:d(),runStillActive:t().optional()}),ut=l({type:i(`navigate_settings`),tab:d()}),dt=l({type:i(`notification_conversation_created`),conversationId:d(),title:d(),sourceEventName:d(),targetGuardianPrincipalId:d().optional(),groupId:d().optional(),source:d().optional(),silent:t().optional()}),ft=l({type:i(`notification_intent`),sourceEventName:d(),title:d(),body:d(),deliveryId:d().optional(),deepLinkMetadata:o(d(),u()).optional(),targetGuardianPrincipalId:d().optional(),silent:t().optional()}),pt=l({type:i(`open_conversation`),conversationId:d(),title:d().optional(),anchorMessageId:d().optional(),focus:t().optional()}),mt=l({type:i(`open_panel`),panelType:d(),data:o(d(),u()).optional(),conversationId:d().optional(),surfaceId:d().optional()}),ht=l({type:i(`open_url`),url:d().min(1),title:d().optional(),conversationId:d().optional()}),w=l({id:d(),label:d(),description:d().optional()}),T=l({id:d(),question:d(),description:d().optional(),options:f(w),freeTextPlaceholder:d().optional()}),gt=l({type:i(`question_request`),requestId:d(),questions:f(T),question:d(),description:d().optional(),options:f(w),freeTextPlaceholder:d().optional(),conversationId:d().optional(),toolUseId:d().optional()}),_t=l({captureScope:s([`display`,`window`]).optional(),displayId:d().optional(),windowId:c().optional(),includeAudio:t().optional(),includeMicrophone:t().optional(),promptForSource:t().optional()}),vt=l({type:i(`recording_start`),recordingId:d(),attachToConversationId:d().optional(),options:_t.optional(),operationToken:d().optional()}),yt=l({type:i(`recording_stop`),recordingId:d()}),bt=l({type:i(`recording_pause`),recordingId:d()}),xt=l({type:i(`recording_resume`),recordingId:d()}),St=l({type:i(`relationship_state_updated`),updatedAt:d()}),Ct=l({type:i(`secret_request`),requestId:d(),service:d(),field:d(),label:d(),description:d().optional(),placeholder:d().optional(),conversationId:d().optional(),purpose:d().optional(),allowedTools:f(d()).optional(),allowedDomains:f(d()).optional(),allowOneTimeSend:t().optional()}),wt=l({type:i(`service_group_update_complete`),installedVersion:d(),success:t(),rolledBackToVersion:d().optional()}),Tt=l({type:i(`service_group_update_progress`),statusMessage:d()}),Et=l({type:i(`service_group_update_starting`),targetVersion:d(),expectedDowntimeSeconds:c()}),Dt=l({type:d(),content:d().optional(),text:d().optional(),result:d().optional(),input:o(d(),u()).optional(),toolName:d().optional(),isError:t().optional(),toolUseId:d().optional()}).passthrough(),Ot=l({type:i(`subagent_event`),conversationId:d(),subagentId:d(),event:Dt}).strict(),kt=l({type:i(`subagent_spawned`),subagentId:d(),parentConversationId:d(),label:d(),objective:d(),isFork:t().optional(),parentToolUseId:d().optional()}).strict(),E=s([`pending`,`running`,`awaiting_input`,`completed`,`failed`,`aborted`,`interrupted`]),D=l({inputTokens:c(),outputTokens:c(),estimatedCost:c()}).strict(),At=l({type:i(`subagent_status_changed`),subagentId:d(),status:E,error:d().optional(),usage:D.optional()}).strict(),jt=l({type:i(`sync_changed`),tags:f(d().min(1)).min(1),originClientId:d().min(1).optional()}),Mt=s([`tool_start`,`tool_complete`,`status`]),Nt=l({type:i(`tool_output_chunk`),chunk:d(),conversationId:d().optional(),toolUseId:d().optional(),subType:Mt.optional(),subToolName:d().optional(),subToolInput:d().optional(),subToolIsError:t().optional(),subToolId:d().optional(),messageId:d().optional()}),Pt=l({pattern:d(),label:d()}),Ft=s([`anthropic-native`,`brave`,`perplexity`,`tavily`,`firecrawl`]),It=s([`default`,`firecrawl`]),Lt=l({rank:c(),title:d(),url:d(),domain:d(),faviconUrl:d().optional(),snippet:d().optional(),age:d().optional(),score:c().optional()}),Rt=l({query:d(),provider:Ft,resultCount:c(),durationMs:c(),results:f(Lt),errorMessage:d().optional()}),zt=l({url:d(),finalUrl:d(),provider:It.optional(),status:c(),contentType:d().optional(),byteCount:c(),charCount:c(),truncated:t(),title:d().optional(),domain:d(),faviconUrl:d().optional(),redirectCount:c(),durationMs:c(),errorMessage:d().optional(),mayRequireJavaScript:t().optional()}),O=l({webSearch:Rt.optional(),webFetch:zt.optional()}),Bt=l({type:i(`tool_result`),toolName:d(),result:d(),isError:t().optional(),diff:_.optional(),status:d().optional(),conversationId:d().optional(),imageData:d().optional(),imageDataList:f(d()).optional(),toolUseId:d().optional(),messageId:d().optional(),riskLevel:d().optional(),riskReason:d().optional(),matchedTrustRuleId:d().optional(),isContainerized:t().optional(),riskScopeOptions:f(Pt).optional(),riskAllowlistOptions:f(m).optional(),riskDirectoryScopeOptions:f(g).optional(),approvalMode:d().optional(),approvalReason:d().optional(),riskThreshold:d().optional(),activityMetadata:O.optional(),errorCode:d().optional(),completedAt:c().optional()}),Vt=l({type:i(`tool_use_preview_start`),toolUseId:d(),toolName:d(),conversationId:d().optional(),messageId:d().optional(),previewStartedAt:c().optional()}),Ht=l({type:i(`tool_use_start`),toolName:d(),input:o(d(),u()),toolUseId:d().optional(),messageId:d().optional(),conversationId:d().optional(),startedAt:c().optional(),previewStartedAt:c().optional()}),Ut=l({type:i(`ui_surface_complete`),conversationId:d(),surfaceId:d(),summary:d(),submittedData:o(d(),u()).optional()}),Wt=l({type:i(`ui_surface_dismiss`),conversationId:d(),surfaceId:d()}),Gt=l({id:d(),label:d(),style:s([`primary`,`secondary`,`destructive`]).optional(),data:o(d(),u()).optional()}),Kt=l({type:i(`ui_surface_show`),conversationId:d(),surfaceId:d(),surfaceType:d(),title:d().optional(),data:o(d(),u()),actions:f(Gt).optional(),display:s([`inline`,`panel`]).optional(),messageId:d().optional(),persistent:t().optional(),toolCallId:d().optional()}),qt=l({type:i(`ui_surface_update`),conversationId:d(),surfaceId:d(),data:o(d(),u())}),k=l({type:i(`usage_progress`),conversationId:d(),inputTokens:c(),outputTokens:c(),estimatedCost:c(),model:d()}),Jt=l({type:i(`usage_update`),conversationId:d(),inputTokens:c(),outputTokens:c(),cacheCreationInputTokens:c().optional(),cacheReadInputTokens:c().optional(),totalInputTokens:c(),totalOutputTokens:c(),estimatedCost:c(),model:d(),contextWindowTokens:c().optional(),contextWindowMaxTokens:c().optional()}),Yt=l({type:i(`user_message_echo`),text:d(),conversationId:d().optional(),messageId:d().optional(),requestId:d().optional(),clientMessageId:d().optional()}).strict(),A=s([`running`,`completed`,`failed`,`aborted`,`cap_exceeded`,`interrupted`]),Xt=l({type:i(`workflow_completed`),runId:d(),conversationId:d().optional(),status:A,agentsSpawned:c(),inputTokens:c(),outputTokens:c(),summary:d().optional()}).strict(),Zt=l({type:i(`workflow_leaf_finished`),runId:d(),conversationId:d(),seq:c().int(),status:s([`completed`,`failed`]),label:d().optional(),inputTokens:c().optional(),outputTokens:c().optional(),resultSummary:d().optional()}).strict(),Qt=l({type:i(`workflow_leaf_started`),runId:d(),conversationId:d(),seq:c().int(),label:d().optional(),phase:d().optional(),promptSummary:d().optional()}).strict(),$t=l({type:i(`workflow_progress`),runId:d(),conversationId:d().optional(),agentsSpawned:c(),phase:d().optional(),label:d().optional(),message:d().optional()}).strict(),en=l({type:i(`workflow_started`),runId:d(),conversationId:d(),toolUseId:d().optional(),label:d().optional()}).strict(),tn=`syntheticAgentErrorMessage`,nn=`compactionAgent`,rn=3e4,an=l({cursorInTextField:t().optional().describe(`Whether the cursor is in an editable text field when dictation started`)}).passthrough().describe(`Dictation context (app name, window title, bundle ID, cursor state, selected text)`),on=l({transcription:d().describe(`Raw speech transcription`),context:an,profileId:d().describe(`Optional dictation profile ID`).optional()}),j=l({id:d(),filename:d(),mimeType:d(),sizeBytes:c(),kind:d(),data:d().optional(),thumbnailData:d().optional(),fileBacked:t().optional()}),sn=l({pattern:d(),label:d()}),cn=l({label:d(),description:d(),pattern:d()}),ln=l({scope:d(),label:d()}),un=l({requestId:d(),title:d().optional(),description:d().optional(),toolName:d().optional(),riskLevel:d().optional(),riskReason:d().optional(),input:o(d(),u()).optional(),allowlistOptions:f(m).optional(),scopeOptions:f(h).optional(),directoryScopeOptions:f(g).optional(),persistentDecisionsAllowed:t().optional()}),dn=l({requestId:d(),entries:f(T)}),fn=s([`approved`,`denied`,`timed_out`]),M=l({id:d().optional(),name:d(),input:o(d(),u()),result:d().optional(),isError:t().optional(),errorCode:d().optional(),imageData:d().optional(),imageDataList:f(d()).optional(),imageAttachmentIds:f(d()).optional(),startedAt:c().optional(),previewStartedAt:c().optional(),completedAt:c().optional(),confirmationDecision:fn.optional(),confirmationLabel:d().optional(),riskLevel:d().optional(),riskReason:d().optional(),matchedTrustRuleId:d().optional(),autoApproved:t().optional(),approvalMode:d().optional(),approvalReason:d().optional(),riskThreshold:d().optional(),riskScopeOptions:f(sn).optional(),riskAllowlistOptions:f(cn).optional(),riskDirectoryScopeOptions:f(ln).optional(),activityMetadata:O.optional(),scopeOptions:f(h).optional(),pendingConfirmation:un.optional(),pendingQuestion:dn.optional()}),pn=l({id:d(),label:d(),style:d().optional(),data:o(d(),u()).optional()}),N=l({surfaceId:d(),surfaceType:d(),title:d().optional(),data:o(d(),u()),actions:f(pn).optional(),display:d().optional(),persistent:t().optional(),completed:t().optional(),completionSummary:d().optional(),toolCallId:d().optional()}),mn=l({subagentId:d(),label:d(),status:d(),error:d().optional(),conversationId:d().optional(),objective:d().optional()}),hn=l({acpSessionId:d(),agent:d().optional()}),gn=l({id:d(),toolName:d(),conversationId:d(),command:d(),startedAt:c(),status:s([`completed`,`failed`,`cancelled`]),exitCode:c().nullable(),output:d(),completedAt:c()}),_n=l({appUrl:d().optional(),webUrl:d().optional()}),vn=l({emoji:d(),op:s([`added`,`removed`]),actorDisplayName:d().optional(),targetChannelTs:d()}),yn=l({channelId:d(),channelName:d().optional(),channelTs:d(),threadTs:d().optional(),sender:l({displayName:d().optional(),externalUserId:d().optional()}).optional(),messageLink:_n.optional(),threadLink:_n.optional(),eventKind:s([`message`,`reaction`]).optional(),reaction:vn.optional()}),bn=l({type:i(`text`),text:d()}),xn=l({type:i(`thinking`),thinking:d(),startedAt:c().optional(),completedAt:c().optional()}),Sn=l({type:i(`tool_use`),toolCall:M}),Cn=l({type:i(`surface`),surface:N}),wn=l({type:i(`attachment`),attachment:j}),Tn=ne(`type`,[bn,xn,Sn,Cn,wn]),En=l({id:d(),mergedMessageIds:f(d()).optional(),clientMessageId:d().optional(),role:s([`user`,`assistant`]),timestamp:d(),attachments:f(j),toolCalls:f(M).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks (the tool_use variant). Flat list of tool calls.`}).optional(),surfaces:f(N).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks (the surface variant). Flat list of surfaces.`}).optional(),textSegments:f(d()).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks. Text segments split by tool-call boundaries.`}).optional(),thinkingSegments:f(d()).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks. Reasoning text extracted from thinking blocks.`}).optional(),contentOrder:f(d()).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks. Positional "<type>:<index>" content ordering (e.g. "text:0", "thinking:1").`}).optional(),contentBlocks:f(Tn).optional(),subagentNotification:mn.optional(),acpNotification:hn.optional(),backgroundEventNotification:t().optional(),backgroundToolCompletion:gn.optional(),systemCard:t().optional(),slackMessage:yn.optional(),queueStatus:s([`queued`,`processing`]).optional(),queuePosition:c().optional()}),Dn=l({status:x}),On=i(`notification`),kn=s([`new`,`seen`,`acted_on`,`dismissed`]),An=s([`low`,`medium`,`high`,`critical`]),jn=s([`security`,`scheduling`,`background`,`email`,`system`]),Mn=s([`heartbeat`,`memory_consolidation`,`schedule`,`auto_analysis`,`user`,`other`]),Nn=l({id:d(),label:d(),prompt:d()}),Pn=s([`emailDraft`,`documentPreview`,`permissionChat`,`paymentAuth`,`toolPermission`,`updatesList`]),Fn=l({kind:Pn}),In=l({id:d(),type:On,priority:c().int().min(0).max(100),title:d().optional(),summary:d(),timestamp:d(),status:kn.default(`new`),expiresAt:d().optional(),actions:f(Nn).optional(),urgency:An.optional(),conversationId:d().optional(),detailPanel:Fn.optional(),category:jn.optional(),noteworthy:t().optional(),fromAssistant:t().optional(),metadata:o(d(),u()).optional(),sourceType:Mn.optional(),sourceKey:d().optional(),sourceLabel:d().optional(),createdAt:d()}),Ln=s([`deterministic`,`assistant`]),Rn=l({id:d(),label:d(),icon:d().optional(),prompt:d(),source:Ln}),zn=l({greeting:d(),timeAwayLabel:d(),newCount:c().int().min(0)}),Bn=l({items:f(In),updatedAt:d(),contextBanner:zn,suggestedPrompts:f(Rn)}),Vn=l({id:d(),category:s([`voice`,`world`,`priorities`]),text:d(),confidence:s([`strong`,`uncertain`]),source:s([`onboarding`,`inferred`])}),Hn=l({id:d(),name:d(),description:d(),tier:s([`unlocked`,`next-up`,`earned`]),gate:d(),unlockHint:d().optional(),ctaLabel:d().optional()}),Un=l({version:i(1),assistantId:d(),tier:a([i(1),i(2),i(3),i(4)]),progressPercent:c(),facts:f(Vn),capabilities:f(Hn),conversationCount:c(),hatchedDate:d(),assistantName:d(),userName:d().optional(),updatedAt:d()}),Wn=l({key:d(),label:d(),ms:c()}),Gn=l({key:d(),label:d(),ms:c(),subPhases:f(Wn).optional()}),Kn=l({phases:f(Gn),ttftMs:c().nullish(),totalToFirstTokenMs:c().nullish(),providerDurationMs:c().nullish(),firstTokenKind:s([`thinking`,`text`]).nullish()}),qn=l({provider:d().nullish(),model:d().nullish(),status:d().nullish(),inputTokens:c().nullish(),outputTokens:c().nullish(),cacheCreationInputTokens:c().nullish(),cacheReadInputTokens:c().nullish(),stopReason:d().nullish(),requestMessageCount:c().nullish(),requestToolCount:c().nullish(),responseMessageCount:c().nullish(),responseToolCallCount:c().nullish(),responsePreview:d().nullish(),toolCallNames:f(d()).nullish(),estimatedCostUsd:c().nullish(),durationMs:c().nullish()}),P=l({kind:d(),label:d().nullish(),role:d().nullish(),text:d().nullish(),toolName:d().nullish(),data:u().optional(),language:d().nullish()}),Jn=l({name:d().nullish(),message:d().nullish(),code:d().nullish(),provider:d().nullish(),statusCode:c().nullish(),retryAfterMs:c().nullish(),apiErrorCode:d().nullish(),apiErrorType:d().nullish(),apiErrorParam:d().nullish(),requestId:d().nullish()}),Yn=l({id:d(),createdAt:c(),requestPayload:te(),responsePayload:te(),provider:d().nullish(),summary:qn.nullish(),requestSections:f(P).nullish(),responseSections:f(P).nullish(),agentLoopExitReason:d().nullish(),callSite:d().nullish(),error:Jn.nullish(),latency:Kn.nullish()}),Xn=l({nodeId:d(),score:c(),semanticSimilarity:c(),recencyBoost:c(),type:d().optional()}),Zn=l({reason:d(),semanticUnavailable:t(),fallbackSources:f(d())}),Qn=l({enabled:t(),degraded:t(),provider:d().nullable(),model:d().nullable(),degradation:Zn.nullable(),semanticHits:c().nullish(),mergedCount:c().nullish(),selectedCount:c().nullish(),tier1Count:c().nullish(),tier2Count:c().nullish(),hybridSearchLatencyMs:c().nullish(),sparseVectorUsed:t().nullish(),injectedTokens:c().nullish(),latencyMs:c().nullish(),topCandidates:f(Xn),injectedText:d().nullable(),reason:d().nullable(),queryContext:d().nullable()}),$n=l({slug:d(),finalActivation:c(),ownActivation:c(),priorActivation:c(),simUser:c(),simAssistant:c(),simNow:c(),simUserRerankBoost:c().optional(),simAssistantRerankBoost:c().optional(),inRerankPool:t().optional(),spreadContribution:c(),source:d(),status:d()}),er=l({d:c(),c_user:c(),c_assistant:c(),c_now:c(),k:c(),hops:c(),top_k:c(),epsilon:c()}),tr=l({turn:c(),mode:d(),concepts:f($n),config:er}),nr=l({slug:d(),source:d(),pinned:t(),sectionOrdinal:c().nullable().optional(),sectionHeading:d().nullable().optional()}),rr=l({turn:c(),live:t(),selections:f(nr),injectedText:d()}),ir=l({messageId:d().nullish(),conversationKey:d().nullish(),conversationId:d().nullish(),conversationKind:d(),conversationTotalEstimatedCostUsd:c().nullish(),logs:f(Yn),memoryRecall:Qn.nullable(),memoryV2Activation:tr.nullable(),memoryV3Selection:rr.nullish()}),ar=l({type:d(),content:d(),toolName:d().optional(),isError:t().optional(),messageId:d().optional(),toolUseId:d().optional(),input:o(d(),u()).optional()}),or=l({subagentId:d(),objective:d().optional(),status:E.optional(),usage:D.optional(),events:f(ar)}),sr=l({seq:c().int(),kind:s([`agent`,`workflow`]),label:d().optional(),phase:d().optional(),promptSummary:d().optional(),status:d(),resultSummary:d().optional(),inputTokens:c().optional(),outputTokens:c().optional(),createdAt:c().nullable()}),cr=l({runId:d(),status:A.optional(),agentsSpawned:c().optional(),inputTokens:c().optional(),outputTokens:c().optional(),phase:d().optional(),leaves:f(sr)});function F(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function lr(e){if(F(e))return e;if(typeof e==`string`)try{let t=JSON.parse(e);if(F(t))return t}catch{}return{}}var I=()=>d().optional().catch(void 0),L=()=>t().optional().catch(void 0),R=()=>c().finite().optional().catch(void 0);function z(e){return r(e=>Array.isArray(e)?e.filter(F):[],f(e))}var B=l({title:d().optional(),subtitle:d().optional(),body:d().optional(),metadata:f(l({label:p(),value:p()})).optional(),template:d().optional(),templateData:o(d(),u()).optional()}),ur=r(e=>{let t=(typeof e==`string`?e.split(`,`):Array.isArray(e)?e:[]).map(e=>typeof e==`string`||typeof e==`number`?String(e).trim():``).filter(e=>e.length>0);return t.length>0?t:void 0},f(d()).optional()),V=l({prompt:p().optional(),acceptedTypes:ur,maxFiles:ae().int().positive().optional().catch(void 0),maxSizeBytes:ae().positive().optional().catch(void 0)}),H=l({text:d().catch(``),label:I(),language:I()});function dr(e,t){let n={...t};for(let t of[`text`,`label`,`language`])typeof n[t]!=`string`&&typeof e[t]==`string`&&(n[t]=e[t]);return H.parse(n)}var fr=l({id:d(),title:d(),description:I(),recommended:L(),data:o(d(),u()).optional().catch(void 0)}),pr=r(e=>Array.isArray(e)?e.flatMap(e=>{if(!F(e))return[];let t=typeof e.id==`string`?e.id.trim():``,n=typeof e.title==`string`?e.title.trim():typeof e.label==`string`?e.label.trim():``;return!t||!n?[]:[{...e,id:t,title:n}]}):[],f(fr)),U=l({description:I(),options:pr,selectionMode:r(e=>e===`multiple`?`multiple`:`single`,s([`single`,`multiple`])),commitOnSelect:L(),submitLabel:I()}),W=l({providerKey:r(e=>typeof e==`string`?e.trim():e,d()).catch(``),displayName:I(),description:I(),logoUrl:d().nullable().optional().catch(void 0)}),G=l({id:d().catch(``),type:s([`text`,`textarea`,`select`,`toggle`,`number`,`password`]).catch(`text`),label:d().catch(``),placeholder:I(),required:L(),defaultValue:a([d(),c(),t()]).optional().catch(void 0),options:f(l({label:p(),value:p()})).optional().catch(void 0)}),mr=l({id:d().catch(``),title:d().catch(``),description:I(),fields:z(G)}),K=l({description:I(),fields:z(G),submitLabel:I(),pages:z(mr).optional().catch(void 0),pageLabels:l({next:I(),back:I(),submit:I()}).optional().catch(void 0),progressStyle:s([`bar`,`tabs`]).optional().catch(void 0)}),hr=l({id:d().catch(``),title:d().catch(``),subtitle:I(),icon:I(),selected:L()}),q=l({items:z(hr),selectionMode:s([`single`,`multiple`,`none`]).catch(`none`)}),gr=l({id:d().catch(``),label:d().catch(``),width:R()}),_r=l({text:p().catch(``),icon:I(),iconColor:I()}),vr=l({id:d().catch(``),cells:o(d(),a([d(),_r]).catch(``)).catch({}),selectable:L(),selected:L()}),J=l({columns:z(gr),rows:z(vr),selectionMode:s([`none`,`single`,`multiple`]).optional().catch(void 0),caption:I()}),Y=l({message:d().catch(``),detail:I(),confirmLabel:I(),confirmedLabel:I(),cancelLabel:I(),destructive:L()}),yr=l({title:d().catch(``),subtitle:I(),description:I(),icon:I(),metrics:f(l({label:p(),value:p()})).optional().catch(void 0),context:s([`app_create`,`general`]).optional().catch(void 0),previewImage:I()}),br=l({html:d().catch(``),width:R(),height:R(),appId:I(),dirName:I(),reloadGeneration:R(),status:I(),preview:yr.optional().catch(void 0)}),xr=l({title:d().catch(``),surfaceId:d().catch(``),subtitle:I(),content:I(),mimeType:I()}),Sr=s([`completed`,`partial`,`failed`,`in_progress`]),X=s([`neutral`,`positive`,`warning`,`negative`]),Cr=s([`items`,`timeline`,`diff`,`artifacts`,`warnings`]),wr=()=>({label:p().catch(``),value:a([d(),c()]).catch(``)}),Tr=l({...wr(),detail:I(),tone:X.optional().catch(void 0)}),Z=l(wr()),Er=l({id:I(),title:p().catch(``),description:I(),status:I(),tone:X.optional().catch(void 0),metadata:z(Z).optional().catch(void 0),href:I()}),Dr=l({label:I(),before:I(),after:I()}),Or=l({id:I(),title:p().catch(``),description:I(),type:Cr.optional().catch(void 0),items:z(Er).optional().catch(void 0),diffs:z(Dr).optional().catch(void 0)}),kr=l({eyebrow:I(),status:Sr.optional().catch(void 0),summary:I(),metrics:z(Tr).optional().catch(void 0),sections:z(Or).optional().catch(void 0)}),Q=[`card`,`channel_setup`,`choice`,`copy_block`,`oauth_connect`,`form`,`list`,`table`,`confirmation`,`dynamic_page`,`file_upload`,`document_preview`,`task_preferences`,`work_result`,`skill_card`,`call_summary`],Ar=s(Q),jr=[`skill_card`,`call_summary`],Mr=new Set(jr);function Nr(e){return Mr.has(e)}var Pr=Q.filter(e=>!Nr(e));new Set(Q);var Fr={card:B,channel_setup:o(d(),u()),choice:U,copy_block:H,oauth_connect:W,form:K,list:q,table:J,confirmation:Y,dynamic_page:br,file_upload:V,document_preview:xr,task_preferences:o(d(),u()),work_result:kr,skill_card:o(d(),u()),call_summary:o(d(),u())},Ir=e({ACPOptionKindSchema:()=>Oe,ACPOptionSchema:()=>ke,AcpSessionCompletedEventSchema:()=>se,AcpSessionErrorEventSchema:()=>ce,AcpSessionSpawnedEventSchema:()=>le,AcpSessionUpdateEventSchema:()=>de,AcpSessionUpdateTypeSchema:()=>ue,AcpSessionUsageEventSchema:()=>fe,AcpStopReasonSchema:()=>oe,AllowlistOptionSchema:()=>m,AssistantActivityAnchorSchema:()=>me,AssistantActivityPhaseSchema:()=>pe,AssistantActivityReasonSchema:()=>he,AssistantActivityStateEventSchema:()=>ge,AssistantEventEnvelopeSchema:()=>Lr,AssistantEventSchema:()=>$,AssistantOutboundAttachmentSchema:()=>S,AssistantTextDeltaEventSchema:()=>_e,AssistantThinkingDeltaEventSchema:()=>ve,AssistantTurnStartEventSchema:()=>ye,AvatarUpdatedEventSchema:()=>be,BackgroundToolCompletedEventSchema:()=>xe,BackgroundToolStartedEventSchema:()=>Se,BookmarkCreatedEventSchema:()=>we,BookmarkDeletedEventSchema:()=>Te,BookmarkSummarySchema:()=>Ce,CALL_SITE_COMPACTION_AGENT:()=>nn,CALL_SITE_SYNTHETIC_AGENT_ERROR_MESSAGE:()=>tn,CapabilitySchema:()=>Hn,CardSurfaceDataSchema:()=>B,ChoiceOptionSchema:()=>fr,ChoiceSurfaceDataSchema:()=>U,CompactionCircuitClosedEventSchema:()=>Ee,CompactionCircuitOpenEventSchema:()=>De,ConfirmationDiffSchema:()=>_,ConfirmationExecutionTargetSchema:()=>Ae,ConfirmationRequestEventSchema:()=>je,ConfirmationSurfaceDataSchema:()=>Y,ContactRequestEventSchema:()=>Me,ContactsChangedEventSchema:()=>Ne,ContextBannerSchema:()=>zn,ConversationAttachmentBlockSchema:()=>wn,ConversationContentBlockSchema:()=>Tn,ConversationErrorCodeSchema:()=>v,ConversationErrorEventSchema:()=>y,ConversationListInvalidatedEventSchema:()=>Pe,ConversationListInvalidatedReasonSchema:()=>b,ConversationMessageAttachmentSchema:()=>j,ConversationMessageSchema:()=>En,ConversationMessageSurfaceSchema:()=>N,ConversationMessageToolCallSchema:()=>M,ConversationNoticeEventSchema:()=>Ie,ConversationNoticeSourceSchema:()=>Fe,ConversationSlackMessageSchema:()=>yn,ConversationSubagentNotificationSchema:()=>mn,ConversationSurfaceBlockSchema:()=>Cn,ConversationTextBlockSchema:()=>bn,ConversationThinkingBlockSchema:()=>xn,ConversationTitleUpdatedEventSchema:()=>Le,ConversationToolUseBlockSchema:()=>Sn,CopyBlockSurfaceDataSchema:()=>H,DAEMON_INTERNAL_SURFACE_TYPES:()=>jr,DEFAULT_TOOL_EXECUTION_TIMEOUT_SEC:()=>120,DictationContextSchema:()=>an,DictationRequestSchema:()=>on,DirectoryScopeOptionSchema:()=>g,DiskPressureBlockedCapabilitySchema:()=>ze,DiskPressureStateSchema:()=>Re,DiskPressureStatusChangedEventSchema:()=>Be,DiskPressureStatusResponseSchema:()=>Dn,DiskPressureStatusSchema:()=>x,DocumentCommentCreatedEventSchema:()=>He,DocumentCommentDeletedEventSchema:()=>Ue,DocumentCommentReopenedEventSchema:()=>We,DocumentCommentResolvedEventSchema:()=>Ge,DocumentEditorUpdateEventSchema:()=>Ke,DocumentPreviewSurfaceDataSchema:()=>xr,DynamicPagePreviewSchema:()=>yr,DynamicPageSurfaceDataSchema:()=>br,ErrorEventSchema:()=>qe,FactSchema:()=>Vn,FeedActionSchema:()=>Nn,FeedItemCategorySchema:()=>jn,FeedItemDetailPanelKindSchema:()=>Pn,FeedItemDetailPanelSchema:()=>Fn,FeedItemSchema:()=>In,FeedItemSourceTypeSchema:()=>Mn,FeedItemStatusSchema:()=>kn,FeedItemTypeSchema:()=>On,FeedItemUrgencySchema:()=>An,FileUploadSurfaceDataSchema:()=>V,FormFieldSchema:()=>G,FormPageSchema:()=>mr,FormSurfaceDataSchema:()=>K,GenerationCancelledEventSchema:()=>Je,GenerationHandoffEventSchema:()=>Ye,HomeFeedResponseSchema:()=>Bn,HomeFeedUpdatedEventSchema:()=>Xe,HookEventOwnerSchema:()=>Ze,HookEventSchema:()=>Qe,IdentityChangedEventSchema:()=>$e,InteractionResolutionStateSchema:()=>et,InteractionResolvedEventSchema:()=>tt,LLMCallErrorSchema:()=>Jn,LLMCallSummarySchema:()=>qn,LLMContextSectionSchema:()=>P,LLMRequestLogEntrySchema:()=>Yn,LatencyBreakdownSchema:()=>Kn,LatencyPhaseSchema:()=>Gn,ListItemSchema:()=>hr,ListSurfaceDataSchema:()=>q,LlmContextResponseSchema:()=>ir,MODEL_INVOKABLE_SURFACE_TYPES:()=>Pr,MemoryCandidateSchema:()=>Xn,MemoryDegradationSchema:()=>Zn,MemoryRecallLogSchema:()=>Qn,MemoryRecalledCandidateDebugSchema:()=>nt,MemoryRecalledDegradationSchema:()=>C,MemoryRecalledEventSchema:()=>rt,MemoryStatusEventSchema:()=>it,MemoryV2ActivationLogSchema:()=>tr,MemoryV2ConceptRowSchema:()=>$n,MemoryV2ConfigSnapshotSchema:()=>er,MemoryV3SelectionLogSchema:()=>rr,MemoryV3SelectionRowSchema:()=>nr,MessageCompleteEventSchema:()=>at,MessageDequeuedEventSchema:()=>ot,MessageQueuedDeletedEventSchema:()=>ct,MessageQueuedEventSchema:()=>st,MessageRequestCompleteEventSchema:()=>lt,NavigateSettingsEventSchema:()=>ut,NotificationConversationCreatedEventSchema:()=>dt,NotificationIntentEventSchema:()=>ft,OAuthConnectSurfaceDataSchema:()=>W,OpenConversationEventSchema:()=>pt,OpenPanelEventSchema:()=>mt,OpenUrlEventSchema:()=>ht,PendingToolConfirmationSchema:()=>un,QuestionEntrySchema:()=>T,QuestionOptionSchema:()=>w,QuestionRequestEventSchema:()=>gt,RecordingOptionsSchema:()=>_t,RecordingPauseEventSchema:()=>bt,RecordingResumeEventSchema:()=>xt,RecordingStartEventSchema:()=>vt,RecordingStopEventSchema:()=>yt,RelationshipStateSchema:()=>Un,RelationshipStateUpdatedEventSchema:()=>St,RiskScopeOptionSchema:()=>Pt,SSE_REPLAY_RING_AGE_LIMIT_MS:()=>rn,SSE_REPLAY_RING_COUNT_LIMIT:()=>200,SURFACE_DATA_SCHEMAS:()=>Fr,SURFACE_TYPES:()=>Q,ScopeOptionSchema:()=>h,SecretRequestEventSchema:()=>Ct,ServiceGroupUpdateCompleteEventSchema:()=>wt,ServiceGroupUpdateProgressEventSchema:()=>Tt,ServiceGroupUpdateStartingEventSchema:()=>Et,SubagentDetailEventSchema:()=>ar,SubagentDetailResponseSchema:()=>or,SubagentEventEventSchema:()=>Ot,SubagentInnerEventSchema:()=>Dt,SubagentSpawnedEventSchema:()=>kt,SubagentStatusChangedEventSchema:()=>At,SubagentStatusSchema:()=>E,SubagentUsageStatsSchema:()=>D,SuggestedPromptSchema:()=>Rn,SuggestedPromptSourceSchema:()=>Ln,SurfaceActionSchema:()=>Gt,SurfaceTypeSchema:()=>Ar,SyncChangedEventSchema:()=>jt,TableCellValueSchema:()=>_r,TableColumnSchema:()=>gr,TableRowSchema:()=>vr,TableSurfaceDataSchema:()=>J,ToolActivityMetadataSchema:()=>O,ToolOutputChunkEventSchema:()=>Nt,ToolOutputChunkSubTypeSchema:()=>Mt,ToolResultEventSchema:()=>Bt,ToolUsePreviewStartEventSchema:()=>Vt,ToolUseStartEventSchema:()=>Ht,UISurfaceCompleteEventSchema:()=>Ut,UISurfaceDismissEventSchema:()=>Wt,UISurfaceShowEventSchema:()=>Kt,UISurfaceUpdateEventSchema:()=>qt,UsageProgressEventSchema:()=>k,UsageUpdateEventSchema:()=>Jt,UserMessageEchoEventSchema:()=>Yt,WebFetchMetadataSchema:()=>zt,WebSearchMetadataSchema:()=>Rt,WebSearchProviderIdSchema:()=>Ft,WebSearchResultItemSchema:()=>Lt,WorkResultDiffSchema:()=>Dr,WorkResultItemSchema:()=>Er,WorkResultMetadataSchema:()=>Z,WorkResultMetricSchema:()=>Tr,WorkResultSectionSchema:()=>Or,WorkResultSectionTypeSchema:()=>Cr,WorkResultStatusSchema:()=>Sr,WorkResultSurfaceDataSchema:()=>kr,WorkResultToneSchema:()=>X,WorkflowCompletedEventSchema:()=>Xt,WorkflowJournalResponseSchema:()=>cr,WorkflowLeafFinishedEventSchema:()=>Zt,WorkflowLeafSchema:()=>sr,WorkflowLeafStartedEventSchema:()=>Qt,WorkflowProgressEventSchema:()=>$t,WorkflowRunStatusSchema:()=>A,WorkflowStartedEventSchema:()=>en,coerceSurfaceDataRecord:()=>lr,isDaemonInternalSurfaceType:()=>Nr,normalizeCopyBlockShowData:()=>dr}),$=ne(`type`,[se,ce,le,de,fe,ge,_e,ve,ye,be,xe,Se,we,Te,Ee,De,je,Me,Ne,y,Pe,Ie,Le,Be,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Qe,$e,tt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,bt,xt,vt,yt,St,Ct,wt,Tt,Et,Ot,kt,At,jt,Nt,Bt,Vt,Ht,Ut,Wt,Kt,qt,k,Jt,Yt,Xt,Zt,Qt,$t,en]),Lr=l({id:d(),conversationId:d().optional(),seq:c().int().optional(),emittedAt:d(),message:$});export{nn as _,U as a,V as c,W as d,J as f,rn as g,Dn as h,B as i,K as l,or as m,$ as n,Y as o,cr as p,Ir as r,H as s,Lr as t,q as u,tn as v,k as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,ct as t,et as n,o as r}from"./local-mode-
|
|
1
|
+
import{c as e,ct as t,et as n,o as r}from"./local-mode-B3-gNTGk.js";import{h as i}from"./api-B66zeRSp.js";import{At as a,_ as o,ht as s,mt as c,v as l,y as u}from"./sdk.gen-DKNY8Bx5.js";import{a as d,n as f}from"./api-errors-D52GcK-c.js";import{B as p,T as m,V as h,a as g,i as _,o as v,w as y,z as b}from"./sdk.gen-BWZTl2s4.js";async function x(e,t){let{data:n,error:r,response:i}=await y({body:e??{},query:t?{mode:t}:void 0,throwOnError:!1});return f(i,r,`Failed to hatch assistant.`),i.ok?{ok:!0,status:i.status,data:n}:{ok:!1,status:i.status,error:d(r,i)}}async function S(n){if(t()){let t=n?r(n):e();if(t)return{ok:!0,status:200,data:{id:t.assistantId,name:t.name??t.assistantId,status:`active`,is_local:!0,created:t.hatchedAt??``}}}if(n){let{data:e,error:t,response:r}=await h({path:{id:n},throwOnError:!1});return f(r,t,`Failed to get assistant.`),r.ok?{ok:!0,status:r.status,data:e}:{ok:!1,status:r.status,error:d(t,r)}}let i=await m({query:{hosting:`platform`},throwOnError:!1});if(f(i.response,i.error,`Failed to get assistant.`),!i.response.ok)return{ok:!1,status:i.response.status,error:d(i.error,i.response)};let a=i.data?.results??[];if(a.length>0)return{ok:!0,status:i.response.status,data:a[0]};let o=await m({query:{hosting:`local`},throwOnError:!1});if(f(o.response,o.error,`Failed to get assistant.`),o.response.ok){let e=o.data?.results??[];if(e.length>0)return{ok:!0,status:o.response.status,data:e[0]}}return o.response.ok?{ok:!1,status:404,error:{detail:`No assistants found`}}:{ok:!1,status:o.response.status,error:d(o.error,o.response)}}async function C(e){let{data:t,error:n,response:r}=await a({path:{assistant_id:e},throwOnError:!1});return f(r,n,`Failed to get assistant healthz.`),r.ok&&t?{ok:!0,status:r.status,data:t}:{ok:!1,status:r.status,error:d(n,r)}}async function w(e){let{data:t,error:n,response:r}=await s({path:{assistant_id:e},throwOnError:!1});if(f(r,n,`Failed to get assistant disk pressure status.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:d(e.error.message,r)}}return{ok:!1,status:r.status,error:d(n,r)}}async function T(e){let{data:t,error:n,response:r}=await c({path:{assistant_id:e},throwOnError:!1});if(f(r,n,`Failed to acknowledge assistant disk pressure.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:d(e.error.message,r)}}return{ok:!1,status:r.status,error:d(n,r)}}function E(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};if(Array.isArray(t.backups))return t.backups;let n=t,r=[],i=n.local?.snapshots;if(Array.isArray(i))for(let e of i)r.push({snapshot_name:e.filename,pvc:``,created_at:e.created_at,ready_to_use:!0,backup_type:`scheduled`,path:e.path});if(Array.isArray(n.offsite)){for(let e of n.offsite)if(Array.isArray(e.snapshots))for(let t of e.snapshots)r.push({snapshot_name:t.filename,pvc:``,created_at:t.created_at,ready_to_use:!t.encrypted,backup_type:`scheduled`,path:t.path})}return r}function D(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};return Array.isArray(t.backups)?t.backups:[]}async function O(e){let t=!n(),[r,i]=await Promise.all([l({path:{assistant_id:e},throwOnError:!1}),t?v({path:{assistant_id:e},throwOnError:!1}):null]);if(f(r.response,r.error,`Failed to list assistant backups.`),!r.response.ok)return{ok:!1,status:r.response.status,error:d(r.error,r.response)};let a=E(r.data);if(i){if(i.response?.ok){let e=D(i.data);return{ok:!0,status:r.response.status,data:[...e,...a]}}if(a.length===0&&i.response)return{ok:!1,status:i.response.status,error:d(i.error,i.response)}}return{ok:!0,status:r.response.status,data:a}}async function k(e){let{data:t,error:r,response:i}=n()?await o({path:{assistant_id:e},throwOnError:!1}):await _({path:{assistant_id:e},throwOnError:!1});if(f(i,r,`Failed to create assistant backup.`),i.ok){let e=t&&typeof t==`object`&&!Array.isArray(t)?t:{};return{ok:!0,status:i.status,data:e}}return{ok:!1,status:i.status,error:d(r,i)}}async function A(e,t){let{data:r,error:i,response:a}=n()?await u({path:{assistant_id:e},body:{path:t.path??t.snapshot_name},throwOnError:!1}):await g({path:{assistant_id:e,snapshot_name:t.snapshot_name},throwOnError:!1});if(f(a,i,`Failed to restore assistant backup.`),a.ok){let e=r&&typeof r==`object`&&!Array.isArray(r)?r:{};return{ok:!0,status:a.status,data:e}}return{ok:!1,status:a.status,error:d(i,a)}}async function j(e){let{data:t,error:n,response:r}=await b({path:{id:e},throwOnError:!1});return f(r,n,`Failed to restart assistant.`),r.ok?{ok:!0,data:t&&typeof t==`object`&&!Array.isArray(t)?t:{}}:{ok:!1,status:r.status,error:d(n,r)}}async function M(e){let{error:t,response:n}=await p({path:{id:e},throwOnError:!1});return f(n,t,`Failed to retire assistant.`),n.ok?{ok:!0}:{ok:!1,status:n.status,error:d(t,n)}}async function N(){let{data:e,error:t,response:n}=await m({query:{hosting:`all`},throwOnError:!1});return f(n,t,`Failed to list assistants.`),n.ok?{ok:!0,status:n.status,data:e?.results??[]}:{ok:!1,status:n.status,error:d(t,n)}}export{C as a,N as c,M as d,w as i,j as l,k as n,x as o,S as r,O as s,T as t,A as u};
|