@vellumai/web 0.10.0 → 0.10.1-staging.1
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/{BundleConfirmPage-CkXUMWg6.js → BundleConfirmPage-B1RL5CT5.js} +1 -1
- package/dist/assets/{Combination-DmnhUZru.js → Combination-CDqVzelh.js} +1 -1
- package/dist/assets/{about-page-Bue2vNnY.js → about-page-CW4mH7w7.js} +1 -1
- package/dist/assets/account-page-DcjAe3ze.js +1 -0
- package/dist/assets/{account-shell-oWV1wIYb.js → account-shell-BBL0HqTX.js} +1 -1
- package/dist/assets/add-credits-modal-BRZVeZOI.js +1 -0
- package/dist/assets/advanced-page-axzblMww.js +1 -0
- package/dist/assets/ai-page-DrDDpvgG.js +1 -0
- package/dist/assets/{api-BSHLYsxJ.js → api-kMnfZUPa.js} +1 -1
- package/dist/assets/{api-key-screen-CUKjlF2C.js → api-key-screen-CM-BLcGz.js} +1 -1
- package/dist/assets/{archive-BCoY55bM.js → archive-D-fnxeQf.js} +1 -1
- package/dist/assets/{archive-page-YsBlmevd.js → archive-page-DabK-GNm.js} +1 -1
- package/dist/assets/arrow-left-CEu7Dsda.js +1 -0
- package/dist/assets/arrow-up-BHPaHiHe.js +1 -0
- package/dist/assets/assistant-api-c0d65GPi.js +1 -0
- package/dist/assets/assistant-feature-flag-store-BD9zTDcP.js +6 -0
- package/dist/assets/assistant-identity-store-DaDnhbxy.js +1 -0
- package/dist/assets/assistant-status-panel-Cm8ComZV.js +1 -0
- package/dist/assets/auth-store-6CnXVIAL.js +7 -0
- package/dist/assets/ban-DOB4wT-M.js +1 -0
- package/dist/assets/{bell-CSP2EUlP.js → bell-tEVVOFRL.js} +1 -1
- package/dist/assets/billing-page-CvQeoBjS.js +3 -0
- package/dist/assets/{bookmark-Cj14Qikr.js → bookmark-Bw04OiC7.js} +1 -1
- package/dist/assets/{bookmarks-page-DRcIBBva.js → bookmarks-page-CvfOEvF0.js} +1 -1
- package/dist/assets/{bug-BIPj7Nbx.js → bug-Dyqld0Aa.js} +1 -1
- package/dist/assets/{build-state-DqzVxR37.js → build-state-CjVnPOtQ.js} +1 -1
- package/dist/assets/{cable-R_YO6j5x.js → cable-CYB4K1nY.js} +1 -1
- package/dist/assets/{calendar-Dm2Jn-zV.js → calendar-DUv7hzHD.js} +1 -1
- package/dist/assets/{capture-error-B0wqOYKY.js → capture-error-CN7ObyIk.js} +1 -1
- package/dist/assets/{checkbox-Dc9gjmAy.js → checkbox-ChtGq7OI.js} +1 -1
- package/dist/assets/chevron-left-BFX62ERI.js +1 -0
- package/dist/assets/chevron-right-Cc3NZhAF.js +1 -0
- package/dist/assets/{chevron-up-Ck7_ou16.js → chevron-up-BT6xIbCo.js} +1 -1
- package/dist/assets/{circle-alert-C5TvMkJV.js → circle-alert-D58pfVBz.js} +1 -1
- package/dist/assets/circle-check-BKkxjdE1.js +1 -0
- package/dist/assets/{client-feature-flag-store-ivPVcKfH.js → client-feature-flag-store-DjN8fxHA.js} +1 -1
- package/dist/assets/{cloud-off-DJomNBuZ.js → cloud-off-DfVAWu4D.js} +1 -1
- package/dist/assets/code-CfKv4BKJ.js +1 -0
- package/dist/assets/{command-palette-BXEAR93M.js → command-palette-AsmJHeEk.js} +1 -1
- package/dist/assets/{command-palette-window-page-5SP_Ft4Y.js → command-palette-window-page-DrgvLRov.js} +1 -1
- package/dist/assets/{community-page-D5-exeNr.js → community-page-sWODbqYS.js} +1 -1
- package/dist/assets/confirm-dialog-SpCsmAdG.js +1 -0
- package/dist/assets/{connect-page-Bvs0EgCJ.js → connect-page-DsRXJyfd.js} +1 -1
- package/dist/assets/consent-controls-Bk8etO5C.js +1 -0
- package/dist/assets/{contacts-gateway-Cf32jSYa.js → contacts-gateway-CZMULd7Z.js} +1 -1
- package/dist/assets/contacts-page-route-eK-_KwLV.js +1 -0
- package/dist/assets/{conversation-queries-Dt4RoWIo.js → conversation-queries-Hwr6Ce8U.js} +1 -1
- package/dist/assets/{conversation-store-BSxi0r0X.js → conversation-store-I2d3A6Tv.js} +1 -1
- package/dist/assets/{cpu-CT8bAyOk.js → cpu-fIfNq834.js} +1 -1
- package/dist/assets/{credit-card-XOxZwKz-.js → credit-card-CcU-1-nT.js} +1 -1
- package/dist/assets/{danger-zone-redirect-page-5H-AuIvi.js → danger-zone-redirect-page-BsyYvQrZ.js} +1 -1
- package/dist/assets/debug-page-BeqbpC6w.js +2 -0
- package/dist/assets/{deploy-dialogs-BtpYB7B8.js → deploy-dialogs-CDE1JAyP.js} +1 -1
- package/dist/assets/{detail-card-CLwQ17AA.js → detail-card-QPVpO5cj.js} +1 -1
- package/dist/assets/developer-page-Bh9POaRZ.js +1 -0
- package/dist/assets/devices-page-br5aQnJ6.js +1 -0
- package/dist/assets/dictation-overlay-page-D_kPOJmY.js +1 -0
- package/dist/assets/{dist-DhhV5jI1.js → dist-cZPU9ZZL.js} +1 -1
- package/dist/assets/{document-viewer-page-BLBwWqM4.js → document-viewer-page-BWNgq5A7.js} +1 -1
- package/dist/assets/{dollar-sign-Ctayw6dD.js → dollar-sign-Bi1OUcqU.js} +1 -1
- package/dist/assets/{domain-field-yW8B9mxj.js → domain-field-BqCbfaBb.js} +1 -1
- package/dist/assets/earn-credits-modal-BQlDvHQX.js +1 -0
- package/dist/assets/emails-page-DCEa8uJF.js +1 -0
- package/dist/assets/{environment-store-Ck7wXCrL.js → environment-store-DoO5ZqXZ.js} +1 -1
- package/dist/assets/{esm-DkmmS1Rg.js → esm-B9FuN3Io.js} +2 -2
- package/dist/assets/esm-BIUrrGWd.js +2 -0
- package/dist/assets/esm-BT7uz_mC.js +2 -0
- package/dist/assets/esm-BU45yXtJ.js +2 -0
- package/dist/assets/esm-D51SsTmc.js +2 -0
- package/dist/assets/esm-KT7CwnAY.js +1 -0
- package/dist/assets/{external-link-B3skagqt.js → external-link-CyRCaWBE.js} +1 -1
- package/dist/assets/{feature-flag-catalog-DEr38CMM.js → feature-flag-catalog-RZLmDa1F.js} +1 -1
- package/dist/assets/{file-editor-HQXiGdH-.js → file-editor-D0SuRz-y.js} +1 -1
- package/dist/assets/general-page-Cxl-qtRp.js +1 -0
- package/dist/assets/{globe-BV8ouh66.js → globe-CiNEZj-J.js} +1 -1
- package/dist/assets/google-logo-DNkI-jCf.js +1 -0
- package/dist/assets/{hard-drive-C6sJQKXL.js → hard-drive-BbaHN7Gp.js} +1 -1
- package/dist/assets/hatching-screen-CHqDiHaW.js +1 -0
- package/dist/assets/home-page-route-CAziCmHd.js +1 -0
- package/dist/assets/{hosting-screen-dPfTLCnv.js → hosting-screen-DVJZyhOt.js} +1 -1
- package/dist/assets/identity-page-route-DmpOhvmv.js +1 -0
- package/dist/assets/index-BvIwFdLE.css +2 -0
- package/dist/assets/index-Chr1kHBM.js +155 -0
- package/dist/assets/{octagon-x-DV9qasaC.js → info-BGLlcyt6.js} +1 -1
- package/dist/assets/{info-BJtskZc-.js → info-CUuJWmsF.js} +1 -1
- package/dist/assets/inspect-page-CBpmIz3n.js +7 -0
- package/dist/assets/{install-CHMiF_Hw.js → install-CFvX5wtl.js} +1 -1
- package/dist/assets/integrations-page-C2AgksrD.js +1 -0
- package/dist/assets/{intelligence-layout-CjDxFKQO.js → intelligence-layout-BzBg1Kci.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-DIhG1FK_.js → keyboard-shortcuts-page-CfAeD2Ca.js} +1 -1
- package/dist/assets/lib-BVvJNDCQ.js +14 -0
- package/dist/assets/library-detail-page-D6RDZtML.js +1 -0
- package/dist/assets/{library-page-BFIPthR_.js → library-page-CrI--_3N.js} +1 -1
- package/dist/assets/{link-2-BedDg97D.js → link-2-C6BJ3RH_.js} +1 -1
- package/dist/assets/loader-circle-YAV9sMh_.js +1 -0
- package/dist/assets/local-mode-Bg6wpc5q.js +39 -0
- package/dist/assets/{log-in-DOSWwTiS.js → log-in-BPJxI98d.js} +1 -1
- package/dist/assets/{login-flow-BMwbZfKA.js → login-flow-sr2DI9LC.js} +1 -1
- package/dist/assets/login-page-JTaRfldA.js +1 -0
- package/dist/assets/{logout-page-DI7i4Hok.js → logout-page-DjT8j4Lw.js} +1 -1
- package/dist/assets/{logs-layout-BEMQQY7S.js → logs-layout-DsCE83mN.js} +1 -1
- package/dist/assets/mcp-page-BgOwigD-.js +1 -0
- package/dist/assets/{memory-router-playground-page-JdkTEwPy.js → memory-router-playground-page-BFeqOyw_.js} +1 -1
- package/dist/assets/{menu-BvyV91Np.js → menu-CdoNX1qx.js} +1 -1
- package/dist/assets/{metric-card-B3EBP9m4.js → metric-card-DxrlxUKS.js} +1 -1
- package/dist/assets/{minimize-2-CwIqAxPY.js → minimize-2-BFkjQhB_.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-DuJUmy0b.js → mobile-sidebar-drawer-ChpPfZ8u.js} +1 -1
- package/dist/assets/{modal-DX6UN7b0.js → modal-CHuPOsJJ.js} +1 -1
- package/dist/assets/{moon-C0wLM1iN.js → moon-D-eeNLvA.js} +1 -1
- package/dist/assets/mutation-error-BjiE6W0q.js +1 -0
- package/dist/assets/{native-file-CbhjzPxL.js → native-file-LJQTmnKy.js} +2 -2
- package/dist/assets/notice-CynJKEow.js +1 -0
- package/dist/assets/notifications-page-Bg_7pXfR.js +1 -0
- package/dist/assets/{oauth-complete-page-R_1ODIIi.js → oauth-complete-page-BuJCcg8E.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-YECuZtPs.js → oauth-popup-complete-page-Cfh_5DAx.js} +1 -1
- package/dist/assets/{page-shell-C0oiLAoY.js → page-shell-W5IMIXQq.js} +1 -1
- package/dist/assets/{pairing-page-BtaFWq0w.js → pairing-page-Jt95f3cN.js} +1 -1
- package/dist/assets/{panel-item-BFOUNXY1.js → panel-item-BLQE_l-g.js} +1 -1
- package/dist/assets/{password-reset-page-Cf5SQHDV.js → password-reset-page-BD2oysNq.js} +1 -1
- package/dist/assets/{pencil-lwgMCqyH.js → pencil-Cyrr5VNX.js} +1 -1
- package/dist/assets/platform-loopback-page-B3Q7OUNO.js +1 -0
- package/dist/assets/{plugin-detail-page-D6Gve0qx.js → plugin-detail-page-C4bk1LvY.js} +1 -1
- package/dist/assets/{plugins-page-DA-JrehF.js → plugins-page-CtHfLqtX.js} +1 -1
- package/dist/assets/{popover-PnyzuDx3.js → popover-BsF65jZY.js} +1 -1
- package/dist/assets/prechat-route-CEPNmia4.js +1 -0
- package/dist/assets/{prefs-Mrqh1A7Y.js → prefs-CrgkSe-_.js} +1 -1
- package/dist/assets/privacy-page-BX4CkH3k.js +1 -0
- package/dist/assets/{privacy-screen-ccjT4S0F.js → privacy-screen-CXDDLFzO.js} +1 -1
- package/dist/assets/{provider-callback-page-BS-DqV_M.js → provider-callback-page-D2guKVyJ.js} +1 -1
- package/dist/assets/{provider-key-DH6JmPXt.js → provider-key-CK_U6Kex.js} +1 -1
- package/dist/assets/{provider-signup-page-Beuafn_s.js → provider-signup-page-DiyM7dV8.js} +1 -1
- package/dist/assets/proxy-l3iqYpig.js +1 -0
- package/dist/assets/{quick-input-page-0PEcj6WT.js → quick-input-page-B8bRJhco.js} +1 -1
- package/dist/assets/react-query.gen-CRARj4mG.js +1 -0
- package/dist/assets/{react-query.gen-DdB0sQgj.js → react-query.gen-DfnbKPpc.js} +1 -1
- package/dist/assets/refresh-cw-C7wug6Q3.js +1 -0
- package/dist/assets/research-mock-page-DB4eGyYW.js +1 -0
- package/dist/assets/research-onboarding-route-BCepmvL-.js +30 -0
- package/dist/assets/{resize-errors-tz_Tui32.js → resize-errors-D0YsLvoI.js} +1 -1
- package/dist/assets/resolved-assistants-store-IMxY1_w9.js +1 -0
- package/dist/assets/return-to-BcgKmS7W.js +1 -0
- package/dist/assets/review-terms-screen-BdGybDri.js +1 -0
- package/dist/assets/{routes-BKwsRssF.js → routes-BLyehs4B.js} +1 -1
- package/dist/assets/{save-WZktF4Xe.js → save-DdguSDQ1.js} +1 -1
- package/dist/assets/{schedules-DqkGi2Lm.js → schedules-Dbclu3k6.js} +1 -1
- package/dist/assets/{sdk.gen-DRL3oRwz.js → sdk.gen-0RzHFsEa.js} +1 -1
- package/dist/assets/{sdk.gen-Bew9wO5C.js → sdk.gen-W0KlW-sG.js} +1 -1
- package/dist/assets/select-assistant-screen-CHBqN3LE.js +1 -0
- package/dist/assets/{semver-DmouQEQK.js → semver-aan9RUyA.js} +1 -1
- package/dist/assets/{setting-row-IILQu7AE.js → setting-row-BHlMSre_.js} +1 -1
- package/dist/assets/settings-layout-CLYztcN0.js +1 -0
- package/dist/assets/share-feedback-modal-CRvX8jqz.js +1 -0
- package/dist/assets/sidebar-tree-CLtH7ULI.js +1 -0
- package/dist/assets/signup-page-Bh-8V-o6.js +1 -0
- package/dist/assets/{signup-shell-D6LXKfGy.js → signup-shell-CEJE1QSw.js} +1 -1
- package/dist/assets/skill-row-DDoJmniT.js +1 -0
- package/dist/assets/skills-page-B5SANwyR.js +1 -0
- package/dist/assets/{sound-manager-CC2af7bI.js → sound-manager-BJ26N0gf.js} +1 -1
- package/dist/assets/{sounds-page-DE47aZrz.js → sounds-page-wAXxaGjk.js} +1 -1
- package/dist/assets/{sparkles-B9QIWdq0.js → sparkles-BoIJjAXt.js} +1 -1
- package/dist/assets/{src-D6Nu2Lol.js → src-BJj2O5XB.js} +3 -3
- package/dist/assets/{step-indicator-dots-BOKv1I4C.js → step-indicator-dots-JQQwRvNU.js} +1 -1
- package/dist/assets/{subagent-detail-panel-BdPp2LMK.js → subagent-detail-panel-Csn2eZm-.js} +2 -2
- package/dist/assets/system-events-page-CY9869ly.js +1 -0
- package/dist/assets/{system-events-redirect-page-CmooXfba.js → system-events-redirect-page-DygqxqRr.js} +1 -1
- package/dist/assets/{tag-BadGF3FB.js → tag-CE_o2aao.js} +1 -1
- package/dist/assets/{tiptap-document-editor-DjIQ9tCC.js → tiptap-document-editor-B-jptvl0.js} +1 -1
- package/dist/assets/toast-CxaZ5f1d.js +1 -0
- package/dist/assets/{tool-detail-panel-C6uFi3_6.js → tool-detail-panel-TULCfc-h.js} +2 -2
- package/dist/assets/trace-page-CHASnwBH.js +1 -0
- package/dist/assets/{triangle-alert-M_S_Pe8C.js → triangle-alert-CoIDviBm.js} +1 -1
- package/dist/assets/triangle-alert-DnZC45c-.js +1 -0
- package/dist/assets/{upgrade-cancel-page-D2-xTACq.js → upgrade-cancel-page-DDp_V51G.js} +1 -1
- package/dist/assets/upgrade-success-page-jXr4wakw.js +1 -0
- package/dist/assets/usage-page-giUgsD1Z.js +1 -0
- package/dist/assets/{usage-window-BO_9IIjX.js → usage-window-DbWHZkbr.js} +1 -1
- package/dist/assets/{use-active-assistant-id-512RohBL.js → use-active-assistant-id-DOx36WGk.js} +1 -1
- package/dist/assets/{use-bus-subscription-RUbeQDfy.js → use-bus-subscription-D-1qIPnj.js} +1 -1
- package/dist/assets/use-is-org-ready-D3HBLwJJ.js +1 -0
- package/dist/assets/{use-onboarding-login-CxXV3Iue.js → use-onboarding-login-Bp9jhDR4.js} +1 -1
- package/dist/assets/{use-plugin-drift-BUHRYq2W.js → use-plugin-drift-B5uLDuHi.js} +1 -1
- package/dist/assets/{use-reduced-motion-CXbk4fYO.js → use-reduced-motion-DgX4o6QR.js} +1 -1
- package/dist/assets/utils-DugRzWBW.js +1 -0
- package/dist/assets/{viewer-store-CInCucV8.js → viewer-store-CTNS5BCs.js} +1 -1
- package/dist/assets/{voice-page-VrJ7AZrg.js → voice-page-BV-46kzi.js} +1 -1
- package/dist/assets/{weather-forecast-display-DKMPxDv5.js → weather-forecast-display-CdImQdck.js} +1 -1
- package/dist/assets/{web-BorhjBfF.js → web-B4ULoQq5.js} +1 -1
- package/dist/assets/{web-DKvxfNu_.js → web-ByMNu3A_.js} +1 -1
- package/dist/assets/{web-BEsXuN9d.js → web-CUTiBnsF.js} +1 -1
- package/dist/assets/{web-4XHemeeJ.js → web-CvCsdCeT.js} +1 -1
- package/dist/assets/{web-CVJTgRoJ.js → web-CyTCBnAZ.js} +1 -1
- package/dist/assets/{web-DALQZUJ4.js → web-DTFLfPeG.js} +1 -1
- package/dist/assets/{web-BcNl6r2T.js → web-DuA0h7oK.js} +1 -1
- package/dist/assets/{welcome-screen-DVeLGZKg.js → welcome-screen-TWxcbCdx.js} +1 -1
- package/dist/assets/{workflow-detail-panel-BgDWu3_4.js → workflow-detail-panel-FzbZ4bE5.js} +1 -1
- package/dist/assets/workspace-page-C4tstjYv.js +1 -0
- package/dist/assets/x-b3o2p6YU.js +1 -0
- package/dist/index.html +112 -107
- package/package.json +1 -1
- package/dist/assets/account-page-B5rB7loj.js +0 -1
- package/dist/assets/add-credits-modal-BEX4_5jj.js +0 -1
- package/dist/assets/advanced-page-9RUi4YCF.js +0 -1
- package/dist/assets/ai-page-CZj92XF4.js +0 -1
- package/dist/assets/arrow-left-DpZuwfUr.js +0 -1
- package/dist/assets/arrow-up-BsbPgGtM.js +0 -1
- package/dist/assets/assistant-api-D7r6RWoh.js +0 -39
- package/dist/assets/assistant-feature-flag-store-D2CUHsmL.js +0 -1
- package/dist/assets/assistant-identity-store-BFaMpt_3.js +0 -1
- package/dist/assets/assistant-status-panel-CMdqv7mF.js +0 -1
- package/dist/assets/auth-store-CrTf0uWL.js +0 -7
- package/dist/assets/ban-BMsomjPu.js +0 -1
- package/dist/assets/billing-page-DgX2YBSA.js +0 -3
- package/dist/assets/chevron-left-CySeFTW4.js +0 -1
- package/dist/assets/chevron-right-HpmykQ8I.js +0 -1
- package/dist/assets/circle-check-D3yd2el7.js +0 -1
- package/dist/assets/code-CXddtaOh.js +0 -1
- package/dist/assets/confirm-dialog-DbNUkFt6.js +0 -1
- package/dist/assets/consent-controls-cNdj_gb8.js +0 -1
- package/dist/assets/contacts-page-route-C9T-8Sdr.js +0 -1
- package/dist/assets/debug-page-ClQetFUa.js +0 -2
- package/dist/assets/developer-page-DQs8SZ8K.js +0 -1
- package/dist/assets/devices-page-VsRsz6XP.js +0 -1
- package/dist/assets/dictation-overlay-page-C5HFJIsY.js +0 -1
- package/dist/assets/earn-credits-modal-Dig03UD-.js +0 -1
- package/dist/assets/emails-page-D9R72EQW.js +0 -1
- package/dist/assets/esm--X8IY1ec.js +0 -1
- package/dist/assets/esm-Cs-ixW_a.js +0 -2
- package/dist/assets/esm-DxJBeF-2.js +0 -2
- package/dist/assets/esm-JmlvYCir.js +0 -2
- package/dist/assets/esm-LyzWW9Z1.js +0 -2
- package/dist/assets/general-page-CMr5RhNh.js +0 -1
- package/dist/assets/hatching-screen-BAzE4aGD.js +0 -1
- package/dist/assets/home-page-route-JenDSLBl.js +0 -1
- package/dist/assets/identity-page-route-r9ZgIw8g.js +0 -1
- package/dist/assets/index-BiN-6kWM.js +0 -140
- package/dist/assets/index-DIEDlrdu.css +0 -2
- package/dist/assets/inspect-page-2cNMjT4e.js +0 -7
- package/dist/assets/integrations-page-BiLM3QyR.js +0 -1
- package/dist/assets/lib-CQbq3OZw.js +0 -29
- package/dist/assets/library-detail-page-CjeBxuMc.js +0 -1
- package/dist/assets/loader-circle-CTs38Ovl.js +0 -1
- package/dist/assets/local-mode-9ZkSq1Fr.js +0 -1
- package/dist/assets/login-page-KDH0IZ6y.js +0 -1
- package/dist/assets/mcp-page-B7tUTzT0.js +0 -1
- package/dist/assets/notice-G5Imd5pC.js +0 -1
- package/dist/assets/notifications-page-CmOvbV59.js +0 -1
- package/dist/assets/platform-loopback-page-Wie5xEwr.js +0 -1
- package/dist/assets/prechat-route-BhzvRsw3.js +0 -1
- package/dist/assets/privacy-page-Yex5OJjZ.js +0 -1
- package/dist/assets/proxy-CQsxT9tJ.js +0 -1
- package/dist/assets/research-mock-page-D0-sKBpu.js +0 -1
- package/dist/assets/research-onboarding-route-ZTgUGnrN.js +0 -38
- package/dist/assets/resolved-assistants-store-DMuRxkZC.js +0 -1
- package/dist/assets/return-to-Bc7amvZZ.js +0 -1
- package/dist/assets/review-terms-screen-DLWgKysx.js +0 -1
- package/dist/assets/select-assistant-screen-LNX6PpzR.js +0 -1
- package/dist/assets/settings-layout-BA0suokL.js +0 -1
- package/dist/assets/share-feedback-modal-CFgHvfgR.js +0 -1
- package/dist/assets/sidebar-tree-DALLHIeG.js +0 -1
- package/dist/assets/signup-page-13TRI3CC.js +0 -1
- package/dist/assets/skills-page-DiopOlcy.js +0 -1
- package/dist/assets/system-events-page-DcaF2EuX.js +0 -1
- package/dist/assets/toast-DLWkiWW6.js +0 -1
- package/dist/assets/trace-page-4MU66DDM.js +0 -1
- package/dist/assets/upgrade-success-page-DLjl6978.js +0 -1
- package/dist/assets/usage-page-CCBqWkRU.js +0 -1
- package/dist/assets/use-is-org-ready-BoWiaeMc.js +0 -1
- package/dist/assets/utils-B5-aBe5u.js +0 -1
- package/dist/assets/workspace-page-BlVlfXIt.js +0 -1
- package/dist/assets/x-Dz7msELe.js +0 -1
- /package/dist/assets/{api-errors-CwAGZ-xJ.js → api-errors-C3sAdlZQ.js} +0 -0
- /package/dist/assets/{avatar-bundled-components-UfXe4Pfu.js → avatar-bundled-components-f4-fradg.js} +0 -0
- /package/dist/assets/{avatar-svg-compositor-Bbqkq_FE.js → avatar-svg-compositor-DMT4wmUm.js} +0 -0
- /package/dist/assets/{build.umd-TjHHwLRY.js → build.umd-CPG-O6Se.js} +0 -0
- /package/dist/assets/{client.gen-CWZrHbc9.js → client.gen-Bx3pJMXa.js} +0 -0
- /package/dist/assets/{client.gen-Cuv6iN0E.js → client.gen-DzaL5PKF.js} +0 -0
- /package/dist/assets/{composer-focus-DP3jFn8K.js → composer-focus-D-P0cGAF.js} +0 -0
- /package/dist/assets/{conversation-selection-BMndnV1U.js → conversation-selection-CrdMTnwx.js} +0 -0
- /package/dist/assets/{create-selectors-ClYkcuKo.js → create-selectors-BE0_e_Ed.js} +0 -0
- /package/dist/assets/{createLucideIcon-DIlBzeWM.js → createLucideIcon-KBgJOpms.js} +0 -0
- /package/dist/assets/{definitions-BqAtozTh.js → definitions-B4RRVbRh.js} +0 -0
- /package/dist/assets/{dist-nMnxT9pm.js → dist-3i_EPbLt.js} +0 -0
- /package/dist/assets/{dist-D7Zr-ONk.js → dist-BQHdyjQ3.js} +0 -0
- /package/dist/assets/{edit-chat-session-B1tanC3Z.js → edit-chat-session-DXSCprPw.js} +0 -0
- /package/dist/assets/{effective-timezone-wo2Bhl1P.js → effective-timezone-DBaPUyaX.js} +0 -0
- /package/dist/assets/{emoji-catalog-data-B6Q5tPZJ.js → emoji-catalog-data-C0EjtsOi.js} +0 -0
- /package/dist/assets/{event-bus-DntJgYuJ.js → event-bus-CFhOgvB8.js} +0 -0
- /package/dist/assets/{format-B12w_G9l.js → format-B2A6k4bb.js} +0 -0
- /package/dist/assets/{format-date-B6hTwbOM.js → format-date-Cx9GZ7-D.js} +0 -0
- /package/dist/assets/{format-file-size-DxhjMSDx.js → format-file-size-Br1LCKQi.js} +0 -0
- /package/dist/assets/{haptics-BtSYrQNK.js → haptics-BCTVEX6s.js} +0 -0
- /package/dist/assets/{impersonate-version-flag-ZdQOgpO3.js → impersonate-version-flag-BksY65Mo.js} +0 -0
- /package/dist/assets/{input-CwdmSRlD.js → input-Ch7OC6ME.js} +0 -0
- /package/dist/assets/{is-electron-BuSDabCt.js → is-electron-CcgCla1v.js} +0 -0
- /package/dist/assets/{llm-dimension-Cs4q1Ovq.js → llm-dimension-ovOt_D6t.js} +0 -0
- /package/dist/assets/{misc-Bo3spjOe.js → misc-Dm72afTZ.js} +0 -0
- /package/dist/assets/{native-deep-link-_WT_7c80.js → native-deep-link-CYaeyOfj.js} +0 -0
- /package/dist/assets/{pdf-CMJp1GoR.js → pdf-DhvXjkis.js} +0 -0
- /package/dist/assets/{prechat-names-BZIP2Y-H.js → prechat-names-CkLrL-Jh.js} +0 -0
- /package/dist/assets/{progress-bar-BOKTRqXE.js → progress-bar-DFH5aT1D.js} +0 -0
- /package/dist/assets/{public-asset-Dp-i4xhW.js → public-asset-CH9GPeL_.js} +0 -0
- /package/dist/assets/{reduced-motion-Do7LyjE6.js → reduced-motion-8QnGN6lg.js} +0 -0
- /package/dist/assets/{shortcut-keys-WNQqv5_X.js → shortcut-keys-vM6sNj7W.js} +0 -0
- /package/dist/assets/{stat-square-B5tBfA4w.js → stat-square-CraPxMcl.js} +0 -0
- /package/dist/assets/{subagent-status-CaVVlphf.js → subagent-status-DOJQZKTk.js} +0 -0
- /package/dist/assets/{toggle-_vZlLDBV.js → toggle-95p73HGd.js} +0 -0
- /package/dist/assets/{typed-storage-SkUUNYR1.js → typed-storage-qVehRaS3.js} +0 -0
- /package/dist/assets/{use-is-mobile-CvT53Qs1.js → use-is-mobile-D_0cze0t.js} +0 -0
- /package/dist/assets/{x-CaVViVFn.js → x-DE8JhiDZ.js} +0 -0
- /package/dist/assets/{xterm-BJ2bbKsF.js → xterm-B74sC241.js} +0 -0
- /package/dist/assets/{xterm-addon-fit-BJTajn72.js → xterm-addon-fit-By7PlC-c.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./dropdown-yOV5eJnU.js";import"./src-BJj2O5XB.js";import{t as c}from"./sparkles-BoIJjAXt.js";import{t as l}from"./triangle-alert-CoIDviBm.js";import{er as u}from"./sdk.gen-W0KlW-sG.js";import{Dt as d,Et as f,Ot as ee,Tt as te,c as ne,d as re,ut as ie}from"./react-query.gen-DfnbKPpc.js";import{t as p}from"./api-errors-C3sAdlZQ.js";import{Jt as ae,jt as m}from"./index-Chr1kHBM.js";import{t as h}from"./use-active-assistant-id-DOx36WGk.js";import{i as g,t as _}from"./format-B2A6k4bb.js";import{i as v,o as y,r as b}from"./llm-dimension-ovOt_D6t.js";import{n as x}from"./usage-window-DbWHZkbr.js";import{n as oe,t as se}from"./schedules-Dbclu3k6.js";var S=e(t(),1);function ce(e){if(!e)return{};let t={};for(let n of e.callSites)!n.id||!n.displayName||(t[n.id]={id:n.id,displayName:n.displayName,description:n.description,domain:n.domain});return t}function C(e,t,n){if(e===`task`){let e=t.groupKey;return e?n.callSites?.[e]?.displayName??t.group:t.group}if(e===`profile`){let e=t.groupKey;return e?n.profiles?.[e]?.displayName??t.group:t.group||`Default / Unset`}return t.group}function le(e,t,n){return!e||e.length===0?[]:e.map(e=>{let r=C(t,e,n);return r===e.group?e:{...e,group:r}})}var w=6,T=`value:`,E=`null:`;function D(e,t=`schedule`){return e===null?`${E}${v(t)?y(t):t}`:`${T}${e}`}function O(e){return[...e].sort((e,t)=>{if(e.date!==t.date)return e.date<t.date?-1:1;let n=j(e.bucketId),r=j(t.bucketId);return n===r?e.bucketId===t.bucketId?0:e.bucketId<t.bucketId?-1:1:n-r})}function ue(e){return e.map(e=>({bucketId:e.bucketId,date:e.date,displayLabel:e.displayLabel,totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalEstimatedCostUsd:e.totalEstimatedCostUsd,eventCount:e.eventCount,groups:{}}))}function de(e,t,n){return t!==`task`&&t!==`profile`?[...e]:e.map(e=>{let r=!1,i={};for(let[a,o]of Object.entries(e.groups)){let e=C(t,A(o),n);e===o.group?i[a]=o:(r=!0,i[a]={...o,group:e})}return r?{...e,groups:i}:e})}function k(e){let t=new Map;for(let n of e)for(let[e,r]of Object.entries(n.groups)){let n=t.get(e);t.set(e,{label:n?.label??r.group,totalEstimatedCostUsd:(n?.totalEstimatedCostUsd??0)+r.totalEstimatedCostUsd})}let n=Array.from(t.entries()).sort(([e,t],[n,r])=>t.totalEstimatedCostUsd===r.totalEstimatedCostUsd?t.label===r.label?e===n?0:e<n?-1:1:t.label<r.label?-1:1:r.totalEstimatedCostUsd-t.totalEstimatedCostUsd).map(([e,t],n)=>({seriesKey:e,label:t.label,totalEstimatedCostUsd:t.totalEstimatedCostUsd,colorIndex:n}));return{items:n,visibleItems:n.slice(0,w)}}function A(e){return{group:e.group,groupId:e.groupKey,groupKey:e.groupKey,totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalCacheCreationTokens:0,totalCacheReadTokens:0,totalEstimatedCostUsd:e.totalEstimatedCostUsd,eventCount:e.eventCount,turnCount:null}}function j(e){let t=e.lastIndexOf(`|`);if(t<0)return 0;let n=Number(e.slice(t+1));return Number.isFinite(n)?n:0}var M=o(),N=140,P=40,F=28,fe=2,pe=2,me=1e-6,I=12,L=220,R=56,he=[40,80,60,100,50,70,30],ge=[18,24,28,35,42,50,64,78,92,106,118,96,84,74,68,80,88,72,56,48,40,34,26,20],z=[`var(--usage-trend-stack-positive, var(--system-positive-strong, #10b981))`,`var(--usage-trend-stack-info, var(--system-info-strong, #3b82f6))`,`var(--usage-trend-stack-mid, var(--system-mid-strong, #f59e0b))`,`var(--usage-trend-stack-secondary, var(--content-secondary, #6b7280))`,`var(--usage-trend-stack-negative, var(--system-negative-strong, #f87171))`,`var(--usage-trend-stack-tertiary, var(--content-tertiary, #9ca3af))`];function B(e){return z[e%z.length]}function V(e){return e.displayLabel?e.displayLabel:e.date}function _e(e,t){let n=e+I,r=t+I;return n+L>window.innerWidth&&(n=e-L-I),r+R>window.innerHeight&&(r=t-R-I),{x:n,y:r}}function ve({buckets:e,isHourly:t,legendItems:n}){let[r,i]=(0,S.useState)(null),a=(0,S.useMemo)(()=>O(e),[e]),o=(0,S.useMemo)(()=>k(e),[e]),s=n??o.items,c=n??o.visibleItems,l=(0,S.useMemo)(()=>a.reduce((e,t)=>Math.max(e,t.totalEstimatedCostUsd),0),[a]),u=(0,S.useCallback)((e,t)=>{let n=_e(e.clientX,e.clientY);i({...t,x:n.x,y:n.y})},[]),d=(0,S.useCallback)(()=>i(null),[]);if(a.length===0){let e=(0,M.jsx)(Se,{title:t?`No hourly data`:`No daily data`,subtitle:`No usage recorded in this time range`});return c.length===0?e:(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e,(0,M.jsx)(H,{items:c})]})}let f=t?F:P;return(0,M.jsxs)(`div`,{className:`overflow-x-auto`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(`div`,{className:`flex items-end gap-2`,style:{height:`${N}px`},"aria-hidden":`true`,children:a.map(e=>{let t=l>0?e.totalEstimatedCostUsd/l:0,r=Math.max(fe,N*t);return(0,M.jsx)(`div`,{className:`flex items-end`,style:{width:`${f}px`,minWidth:`${f}px`,height:`${r}px`,opacity:e.totalEstimatedCostUsd>0?1:.3},title:`${V(e)}: ${_(e.totalEstimatedCostUsd)}`,"data-usage-series-bar":e.bucketId,children:(0,M.jsx)(be,{bucket:e,height:r,legendItems:s,hasLegendOverride:n!=null,onSegmentHover:u,onSegmentLeave:d})},e.bucketId)})}),(0,M.jsx)(`div`,{className:`flex items-start gap-2`,children:a.map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5`,style:{width:`${f}px`,minWidth:`${f}px`},children:[(0,M.jsx)(`span`,{className:`truncate text-[10px]`,style:{color:`var(--content-secondary)`},children:_(e.totalEstimatedCostUsd)}),(0,M.jsx)(`span`,{className:`truncate text-[10px]`,style:{color:`var(--content-tertiary)`},children:V(e)})]},e.bucketId))}),c.length>0?(0,M.jsx)(H,{items:c}):null]}),r?(0,M.jsx)(xe,{tooltip:r}):null]})}function ye({isHourly:e}){let t=e?ge:he,n=e?F:P;return(0,M.jsx)(`div`,{className:`flex items-end gap-2`,style:{height:`${N}px`},"aria-hidden":`true`,children:t.map((e,t)=>(0,M.jsx)(`div`,{className:`rounded-sm`,style:{width:`${n}px`,height:`${e}px`,background:`color-mix(in srgb, var(--border-base) 40%, transparent)`}},t))})}function be({bucket:e,height:t,legendItems:n,hasLegendOverride:r,onSegmentHover:i,onSegmentLeave:a}){let o=Object.keys(e.groups).length>0,s=n.filter(e=>(e.state??`active`)===`active`).flatMap(t=>{let n=e.groups[t.seriesKey];return!n||n.totalEstimatedCostUsd<=0?[]:[{item:t,value:n}]});if(s.length===0&&!o&&!r){let n={label:`Total`,bucketLabel:V(e),cost:_(e.totalEstimatedCostUsd)};return(0,M.jsx)(`div`,{className:`w-full rounded-sm`,title:`${n.label}: ${n.cost}`,onMouseEnter:e=>i(e,n),onMouseMove:e=>i(e,n),onMouseLeave:a,style:{height:`${t}px`,background:B(0)},"data-usage-series-segment-label":n.label,"data-usage-fallback-segment":`true`})}return s.length===0?null:(0,M.jsx)(`div`,{className:`flex w-full flex-col-reverse overflow-hidden rounded-sm`,style:{height:`${t}px`},"data-usage-series-stack":e.bucketId,children:s.map(({item:n,value:r})=>{let o={label:n.label,bucketLabel:V(e),cost:_(r.totalEstimatedCostUsd)};return(0,M.jsx)(`div`,{title:`${o.label}: ${o.cost}`,onMouseEnter:e=>i(e,o),onMouseMove:e=>i(e,o),onMouseLeave:a,style:{height:`${Math.max(pe,t*r.totalEstimatedCostUsd/Math.max(e.totalEstimatedCostUsd,me))}px`,background:B(n.colorIndex)},"data-usage-series-segment":n.seriesKey,"data-usage-series-segment-label":n.label,"data-usage-series-color-index":n.colorIndex},n.seriesKey)})})}function xe({tooltip:e}){return(0,M.jsxs)(`div`,{className:`pointer-events-none fixed z-50 max-w-[220px] rounded-md border px-2 py-1 shadow-xl`,style:{left:`${e.x}px`,top:`${e.y}px`,background:`var(--surface-overlay, var(--surface-lift))`,borderColor:`var(--border-base)`},"aria-hidden":`true`,children:[(0,M.jsx)(`div`,{className:`truncate text-body-small-default`,style:{color:`var(--content-default)`},children:e.label}),(0,M.jsxs)(`div`,{className:`truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[e.bucketLabel,` · `,e.cost]})]})}function H({items:e}){return(0,M.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 pt-1`,children:e.map(e=>{let t=e.state??`active`,n=t===`inactive`;return(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,"data-usage-legend-state":t,children:[(0,M.jsx)(`span`,{className:`h-[7px] w-[7px] shrink-0 rounded-full`,style:{background:n?`var(--content-tertiary)`:B(e.colorIndex),opacity:n?.45:1},"aria-hidden":`true`,"data-usage-series-color-index":e.colorIndex}),(0,M.jsx)(`span`,{className:n?`truncate text-[10px] line-through`:`truncate text-[10px]`,style:{color:`var(--content-tertiary)`,opacity:n?.65:1},children:e.label})]},e.seriesKey)})})}function Se({title:e,subtitle:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-md py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,M.jsx)(`p`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),(0,M.jsx)(`p`,{className:`mt-1 text-body-small-default`,children:t})]})}function U(e){return v(e)?y(e):e}function Ce(e){return G({from:e.from,to:e.to},e.scheduleId)}function we(e){return G({from:e.from,to:e.to,...e.granularity?{granularity:e.granularity}:{},...e.tz?{tz:e.tz}:{}},e.scheduleId)}function W(e){return G({from:e.from,to:e.to,groupBy:U(e.groupBy)},e.scheduleId)}function Te(e){return G({from:e.from,to:e.to,granularity:e.granularity,groupBy:U(e.groupBy),...e.tz?{tz:e.tz}:{}},e.scheduleId)}function G(e,t){return t?{...e,scheduleId:t}:e}function Ee(e){return[`${g(e.totalInputTokens)} direct`,`${g(e.totalCacheCreationTokens)} cache created`,`${g(e.totalCacheReadTokens)} cache read`,`${g(e.totalOutputTokens)} out`].join(` / `)}function K(e){return!Number.isFinite(e)||e===0?`0`:e>=1e6||e>=999950&&e<1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function De(e){return`${K(e.totalInputTokens+e.totalCacheCreationTokens+e.totalCacheReadTokens)} in / ${K(e.totalOutputTokens)} out`}var Oe=`task`,q=`model`,ke=new Set([400,404,422]),Ae=3,je=new Set([`today`,`yesterday`,`7d`,`30d`,`90d`,`all`]),Me=new Set([`actor`,`provider`,`model`,`conversation`,`task`,`profile`,`schedule`]),J={task:b.task,profile:b.profile,model:b.model,provider:`Provider`,actor:`Actor`,conversation:`Conversation`,schedule:`Schedule`},Ne=[{value:`task`,label:J.task},{value:`profile`,label:J.profile},{value:`model`,label:J.model},{value:`provider`,label:J.provider},{value:`schedule`,label:J.schedule},{value:`conversation`,label:J.conversation}];function Pe(e){let t=e.get(`range`),n=e.get(`groupBy`),r=Re(n)?n:Oe;return{range:Le(t)?t:`7d`,groupBy:r,scheduleId:r===`schedule`?Fe(e):void 0}}function Fe(e){let t=e.get(`scheduleId`);if(!(!t||t.trim().length===0))return t}function Ie(e,t){let n=new URLSearchParams(e);return t.range!==void 0&&n.set(`range`,t.range),t.groupBy!==void 0&&n.set(`groupBy`,t.groupBy),t.scheduleId!==void 0&&(t.scheduleId===null||t.scheduleId.trim().length===0?n.delete(`scheduleId`):n.set(`scheduleId`,t.scheduleId)),n.get(`groupBy`)!==`schedule`&&n.delete(`scheduleId`),n}function Le(e){return e!=null&&je.has(e)}function Re(e){return e!=null&&Me.has(e)}function ze(e){return e!==`conversation`}function Be(e,t){return e!==`task`&&e!==`profile`?!1:He(t)}function Ve(e,t){return!He(t)&&e<Ae}function He(e){return e instanceof p&&ke.has(e.status)}function Ue(e,t){let n=e===`hourly`?`Hourly Trend`:`Daily Trend`;return!t||t===`conversation`?n:`${n} by ${J[t]}`}function We({requestedGranularity:e,isLoading:t,buckets:n}){return e===`hourly`&&(t||!n||n.length===0||n.some(Ge))?`hourly`:`daily`}function Ge(e){return e.bucketId.includes(`|`)||Ke(e.date)}function Ke(e){return/^\d{4}-\d{2}-\d{2} ([01]\d|2[0-3]):00$/.test(e)}function qe(e,t,n=Date.now()){return x(e,t,n)}function Je(e){return e===`today`||e===`yesterday`?`hourly`:`daily`}function Ye({prompt:e,children:t,variant:i=`outlined`,size:a=`regular`,className:o}){let s=r(),l=(0,S.useCallback)(()=>{m(s,{prompt:e})},[s,e]);return(0,M.jsx)(n,{variant:i,size:a,leftIcon:(0,M.jsx)(c,{}),onClick:l,className:o,children:t})}var Xe=[{value:`today`,label:`Today`},{value:`yesterday`,label:`Yesterday`},{value:`7d`,label:`Last 7 days`},{value:`30d`,label:`Last 30 days`},{value:`90d`,label:`Last 90 days`},{value:`all`,label:`All time`}],Ze=300*1e3,Qe=[`Please load the llm-cost-optimizer skill.`,`Analyze my recent LLM usage and explain the biggest cost contributors by call site, model, and profile.`,`Check my current llm.default, llm.callSites, and llm.profiles.`,`Give me a concise summary of what is driving cost and what you would optimize first.`,`Do not change config yet.`].join(` `),$e=[`Please load the llm-cost-optimizer skill.`,`Analyze my recent LLM usage and current LLM config, then recommend the safest cost-optimization changes.`,`If changes are clearly safe, show me the exact config commands you would run and ask for confirmation before applying them.`].join(` `);function et({assistantId:e}){let[t,n]=i(),{range:r,groupBy:o,scheduleId:s}=(0,S.useMemo)(()=>Pe(t),[t]),c=ae(),l=(0,S.useCallback)(e=>{n(t=>Ie(t,e),{replace:!0})},[n]),p=(0,S.useMemo)(()=>qe(r,c),[r,c]),m=(0,S.useMemo)(()=>Je(r),[r]),h=a({queryKey:ie({path:{assistant_id:e}}),queryFn:()=>se(e),staleTime:1e4}),g=(0,S.useCallback)(e=>{l({range:e})},[l]),_=a({...ee({path:{assistant_id:e},query:Ce({from:p.from,to:p.to,scheduleId:s})})}),v=a({queryKey:te({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:o,scheduleId:s})}),queryFn:async({signal:t})=>{try{let{data:n}=await u({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:o,scheduleId:s}),signal:t,throwOnError:!0});return{groupBy:o,response:n}}catch(n){if(!Be(o,n))throw n;let{data:r}=await u({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:q,scheduleId:s}),signal:t,throwOnError:!0});return{groupBy:q,response:r}}},retry:Ve}),y=v.data?.groupBy??o,b=ze(y)?y:void 0,x=a({...d({path:{assistant_id:e},query:Te({from:p.from,to:p.to,granularity:m,groupBy:b??`actor`,tz:c,scheduleId:s})}),enabled:!!b,retry:Ve}),C=a({...f({path:{assistant_id:e},query:we({from:p.from,to:p.to,granularity:m,tz:c,scheduleId:s})}),enabled:!b||x.isError}),w=a({...re({path:{assistant_id:e}}),enabled:y===`task`,staleTime:1/0}),T=a({...ne({path:{assistant_id:e}}),select:oe,enabled:y===`profile`,staleTime:Ze}),E=(0,S.useMemo)(()=>({callSites:ce(w.data),profiles:T.data??{}}),[w.data,T.data]),D=(0,S.useMemo)(()=>{let e=v.data;if(e)return le(e.response.breakdown,e.groupBy,E)},[v.data,E]),O=(0,S.useMemo)(()=>{if(!(!b||!x.data))return de(x.data.buckets,b,E)},[x.data,b,E]),k=(0,S.useMemo)(()=>{if(C.data)return ue(C.data.buckets)},[C.data]),A=(0,S.useMemo)(()=>b?x.error?k?{isLoading:!1,error:null,data:k,refetch:C.refetch}:{isLoading:C.isLoading||!k&&!C.error,error:C.error??x.error,data:void 0,refetch:C.error?C.refetch:x.refetch}:{isLoading:x.isLoading,error:x.error,data:O,refetch:x.refetch}:{isLoading:C.isLoading,error:C.error,data:k,refetch:C.refetch},[k,C.error,C.isLoading,C.refetch,O,b,x.error,x.isLoading,x.refetch]),j=We({requestedGranularity:m,isLoading:A.isLoading,buckets:A.data}),N=j===`hourly`,P=b&&x.error?void 0:y,F=(0,S.useMemo)(()=>{if(!(y!==`schedule`||!s))return tt(h.data,s)},[y,s,h.data]);return(0,M.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,M.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Usage`}),(0,M.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:(0,M.jsx)(it,{range:r,onChange:g})})]}),(0,M.jsx)(`section`,{"aria-label":`Totals`,children:(0,M.jsx)(X,{query:_,skeleton:(0,M.jsx)(ot,{}),render:e=>(0,M.jsx)(at,{totals:e})})}),(0,M.jsx)(Y,{title:`Inference Usage`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,M.jsx)(`h4`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:Ue(j,P)}),(0,M.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:(0,M.jsx)(st,{value:y,onChange:e=>{e===o&&y!==o&&(v.refetch(),x.refetch()),l({groupBy:e,scheduleId:e===`schedule`?void 0:null})}})})]}),(0,M.jsx)(X,{query:A,skeleton:(0,M.jsx)(ye,{isHourly:N}),render:e=>(0,M.jsx)(ve,{buckets:e,isHourly:N,legendItems:F})})]})}),(0,M.jsx)(ct,{query:v,groups:D}),(0,M.jsx)(rt,{})]})}function tt(e,t){let n=e??[];return[...n.some(e=>e.id===t)?[]:[{id:t,label:nt(t)}],...n.map(e=>({id:e.id,label:e.name||e.id}))].map((e,n)=>({seriesKey:D(e.id,`schedule`),label:e.label,colorIndex:n,state:e.id===t?`active`:`inactive`}))}function nt(e){return`Unknown schedule (${e})`}function rt(){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsx)(`div`,{className:`h-px w-full`,style:{background:`linear-gradient(to right, transparent, var(--border-base), transparent)`}}),(0,M.jsx)(Y,{title:`Cost assistant`,subtitle:`Review recent spend and tune model profile choices.`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md px-3 py-3 sm:flex-row sm:items-center`,children:[(0,M.jsx)(Ye,{prompt:Qe,children:`Analyze costs with assistant`}),(0,M.jsx)(Ye,{prompt:$e,variant:`ghost`,children:`Optimize settings`})]})})]})}function it({range:e,onChange:t}){return(0,M.jsx)(`div`,{className:`flex items-center`,children:(0,M.jsx)(s,{value:e,onChange:t,options:Xe.map(e=>({value:e.value,label:e.label}))})})}function Y({title:e,subtitle:t,children:n}){return(0,M.jsxs)(`section`,{className:`flex flex-col gap-3 rounded-md border px-4 py-4`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`h3`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),t?(0,M.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t}):null]}),n]})}function X({query:e,skeleton:t,render:n}){return e.isLoading?(0,M.jsx)(M.Fragment,{children:t}):e.error?(0,M.jsx)(ft,{message:e.error instanceof Error?e.error.message:`Failed to load usage.`,onRetry:()=>e.refetch()}):e.data?(0,M.jsx)(M.Fragment,{children:n(e.data)}):(0,M.jsx)(M.Fragment,{children:t})}function at({totals:e}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`span`,{style:{fontSize:`30px`,fontWeight:600,lineHeight:1,color:`var(--content-default)`},children:_(e.totalEstimatedCostUsd)}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-secondary)`},children:`Cost`})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:g(e.eventCount)}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-secondary)`},children:`LLM Calls`})]})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[(0,M.jsx)(Z,{label:`Direct Input Tokens`,value:g(e.totalInputTokens)}),(0,M.jsx)(Z,{label:`Output Tokens`,value:g(e.totalOutputTokens)}),(0,M.jsx)(Z,{label:`Cache Created`,value:g(e.totalCacheCreationTokens)}),(0,M.jsx)(Z,{label:`Cache Read`,value:g(e.totalCacheReadTokens)})]})]})}function Z({label:e,value:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md px-3 py-2`,style:{background:`color-mix(in srgb, var(--border-base) 15%, transparent)`},children:[(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-default)`},children:t}),(0,M.jsx)(`span`,{className:`text-label-medium-default`,style:{color:`var(--content-tertiary)`},children:e})]})}function ot(){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,"aria-hidden":`true`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)($,{width:140,height:30}),(0,M.jsx)($,{width:90,height:12})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)($,{width:60,height:16}),(0,M.jsx)($,{width:60,height:12})]})]}),(0,M.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:Array.from({length:4}).map((e,t)=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md px-3 py-2`,style:{background:`color-mix(in srgb, var(--border-base) 15%, transparent)`},children:[(0,M.jsx)($,{width:`50%`,height:12}),(0,M.jsx)($,{width:`70%`,height:11})]},t))})]})}function st({value:e,onChange:t}){return(0,M.jsx)(`div`,{className:`flex items-center`,children:(0,M.jsx)(s,{value:e,onChange:t,menuAlign:`end`,menuMinWidth:196,options:Ne.map(e=>({value:e.value,label:e.label}))})})}function ct({query:e,groups:t}){let[n,r]=(0,S.useState)(new Set),i=e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,M.jsx)(Y,{title:`Breakdown`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(Q,{label:`% of total`,active:n.has(`pct`),onClick:()=>i(`pct`)}),(0,M.jsx)(Q,{label:`Tokens`,active:n.has(`tokens`),onClick:()=>i(`tokens`)}),(0,M.jsx)(Q,{label:`Turns`,active:n.has(`turns`),onClick:()=>i(`turns`)})]}),(0,M.jsx)(X,{query:e,skeleton:(0,M.jsx)(ut,{}),render:e=>(0,M.jsx)(lt,{groups:t??e.response.breakdown,showPct:n.has(`pct`),showTokens:n.has(`tokens`),showTurns:n.has(`turns`)})})]})})}function Q({label:e,active:t,onClick:n}){return(0,M.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-full border px-2.5 py-1 text-label-medium-default`,style:{borderColor:t?`var(--content-secondary)`:`var(--border-base)`,background:t?`color-mix(in srgb, var(--content-secondary) 15%, transparent)`:`transparent`,color:t?`var(--content-default)`:`var(--content-tertiary)`},children:e})}function lt({groups:e,showPct:t,showTokens:n,showTurns:r}){if(e.length===0)return(0,M.jsx)(dt,{title:`No breakdown data`,subtitle:`No usage recorded for this grouping`});let i=e.reduce((e,t)=>e+t.totalEstimatedCostUsd,0);return(0,M.jsx)(`div`,{className:`overflow-hidden rounded-md`,children:(0,M.jsxs)(`table`,{className:`w-full table-fixed`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{style:{borderBottom:`1px solid var(--border-base)`},children:[(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-left text-label-medium-default`,style:{color:`var(--content-tertiary)`},children:`Group`}),n?(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-left text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`35%`},children:`Tokens`}):null,r?(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`72px`},children:`Turns`}):null,t?(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`64px`},children:`%`}):null,(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`100px`},children:`Cost`})]})}),(0,M.jsx)(`tbody`,{children:e.map((e,a)=>{let o=Ee(e),s=De(e),c=i>0?Math.round(e.totalEstimatedCostUsd/i*100):0;return(0,M.jsxs)(`tr`,{style:{borderTop:a===0?`none`:`1px solid var(--border-base)`},children:[(0,M.jsx)(`td`,{className:`min-w-0 px-3 py-2`,style:{color:`var(--content-default)`},children:(0,M.jsx)(`span`,{className:`block truncate text-body-medium-lighter`,title:e.group,children:e.group})}),n?(0,M.jsx)(`td`,{className:`min-w-0 px-3 py-2`,style:{color:`var(--content-secondary)`},children:(0,M.jsx)(`span`,{className:`block truncate text-body-small-default`,title:o,children:s})}):null,r?(0,M.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.turnCount==null?`—`:e.turnCount.toLocaleString()})}):null,t?(0,M.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,M.jsxs)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[c,`%`]})}):null,(0,M.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,M.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-default)`},children:_(e.totalEstimatedCostUsd)})})]},e.groupKey??e.groupId??`${e.group}-${a}`)})})]})})}function ut(){return(0,M.jsx)(`div`,{className:`flex flex-col gap-2`,"aria-hidden":`true`,children:Array.from({length:4}).map((e,t)=>(0,M.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,M.jsx)($,{width:100,height:14}),(0,M.jsx)($,{width:`60%`,height:12}),(0,M.jsx)($,{width:50,height:14})]},t))})}function $({width:e,height:t}){return(0,M.jsx)(`div`,{className:`rounded-sm`,style:{width:typeof e==`number`?`${e}px`:e,height:`${t}px`,background:`color-mix(in srgb, var(--border-base) 40%, transparent)`}})}function dt({title:e,subtitle:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-1 py-8 text-center`,children:[(0,M.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t})]})}function ft({message:e,onRetry:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 py-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,M.jsx)(l,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-negative-strong, #f87171)`}}),(0,M.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-default)`},children:e})]}),t?(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`self-start rounded-md border px-3 py-1 text-body-small-default`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`,color:`var(--content-default)`},children:`Retry`}):null]})}function pt(){return(0,M.jsx)(et,{assistantId:h()})}export{pt as UsagePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return new Date(e+`T00:00:00`).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})}function t(e,t){return new Intl.DateTimeFormat(`en-CA`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`}).format(e)}function n(e,n){let i=Date.parse(e+`T00:00:00Z`),a=i;for(let e=0;e<2;e++){let e=r(new Date(a),n);a-=e-i}if(t(new Date(a),n)<e){let e=r(new Date(a),n)-a,t=a+3600*1e3,i=r(new Date(t),n)-t-e;a+=i}return a}function r(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}).formatToParts(e),r=e=>Number(n.find(t=>t.type===e)?.value);return Date.UTC(r(`year`),r(`month`)-1,r(`day`),r(`hour`),r(`minute`),r(`second`))}var i={today:0,"7d":6,"30d":29,"90d":89};function a(e,t,r=Date.now()){let a=typeof r==`number`?r:r.getTime();if(e===`all`)return{from:0,to:a};let s=i[e],{fromDate:c}=o(s+1,t,a);return{from:n(c,t),to:a}}function o(e,n,r=Date.now()){let i=typeof r==`number`?r:r.getTime(),a=t(new Date(i),n),[o,s,c]=a.split(`-`).map(Number),l=new Date(Date.UTC(o,s-1,c,12));return l.setUTCDate(l.getUTCDate()-(e-1)),{fromDate:t(l,`UTC`),toDate:a}}export{a as n,e as r,o as t};
|
|
1
|
+
function e(e){return new Date(e+`T00:00:00`).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})}function t(e,t){return new Intl.DateTimeFormat(`en-CA`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`}).format(e)}function n(e,n){let i=Date.parse(e+`T00:00:00Z`),a=i;for(let e=0;e<2;e++){let e=r(new Date(a),n);a-=e-i}if(t(new Date(a),n)<e){let e=r(new Date(a),n)-a,t=a+3600*1e3,i=r(new Date(t),n)-t-e;a+=i}return a}function r(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}).formatToParts(e),r=e=>Number(n.find(t=>t.type===e)?.value);return Date.UTC(r(`year`),r(`month`)-1,r(`day`),r(`hour`),r(`minute`),r(`second`))}var i={today:0,"7d":6,"30d":29,"90d":89};function a(e,t,r=Date.now()){let a=typeof r==`number`?r:r.getTime();if(e===`all`)return{from:0,to:a};if(e===`yesterday`){let{fromDate:e,toDate:r}=o(2,t,a);return{from:n(e,t),to:n(r,t)}}let s=i[e],{fromDate:c}=o(s+1,t,a);return{from:n(c,t),to:a}}function o(e,n,r=Date.now()){let i=typeof r==`number`?r:r.getTime(),a=t(new Date(i),n),[o,s,c]=a.split(`-`).map(Number),l=new Date(Date.UTC(o,s-1,c,12));return l.setUTCDate(l.getUTCDate()-(e-1)),{fromDate:t(l,`UTC`),toDate:a}}export{a as n,e as r,o as t};
|
package/dist/assets/{use-active-assistant-id-512RohBL.js → use-active-assistant-id-DOx36WGk.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./resolved-assistants-store-
|
|
1
|
+
import{n as e}from"./resolved-assistants-store-IMxY1_w9.js";function t(){let t=e.use.activeAssistantId();if(!t)throw Error(`useActiveAssistantId() called outside ActiveAssistantGate — either mount the route under <ActiveAssistantGate> or read the raw store via useResolvedAssistantsStore.use.activeAssistantId().`);return t}export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./event-bus-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./event-bus-CFhOgvB8.js";var r=e(t(),1);function i(e,t){let i=(0,r.useRef)(t);(0,r.useLayoutEffect)(()=>{i.current=t}),(0,r.useEffect)(()=>n(e,e=>{i.current(e)}),[e])}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,l as t}from"./auth-store-6CnXVIAL.js";function n(){let n=t.use.currentOrganizationId();return!e()||n!=null}export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{f as i}from"./local-mode-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{f as i}from"./local-mode-Bg6wpc5q.js";import{t as a}from"./is-electron-CcgCla1v.js";import{L as o,N as s}from"./auth-store-6CnXVIAL.js";import{a as c}from"./routes-BLyehs4B.js";import{n as l,t as u}from"./build-state-CjVnPOtQ.js";import{n as d}from"./login-flow-sr2DI9LC.js";var f=e(t(),1);function p(e){let t=n(),p=r(),[m,h]=(0,f.useState)(!1),[g,_]=(0,f.useState)(null),v=(0,f.useRef)(0);return{loading:m,error:g,login:async()=>{let n=e??l(u({sessionSettled:!0,isAuthenticated:!0}),p.pathname);if(i()&&o()){t(`${c.account.login}?returnTo=${encodeURIComponent(n)}`);return}let r=++v.current;_(null),h(!0);try{await s(d,`${c.account.providerCallback}?returnTo=${encodeURIComponent(n)}`,{returnTo:n})}catch{if(r!==v.current)return;_(`Something went wrong. Please try again.`),h(!1)}},cancel:()=>{v.current++,h(!1),_(null),a()&&window.vellum?.auth?.cancelOAuth()}}}export{p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./useQuery-B45lW1Kk.js";import{t}from"./jsx-runtime-CVSDxk6A.js";import{et as n}from"./react-query.gen-
|
|
1
|
+
import{t as e}from"./useQuery-B45lW1Kk.js";import{t}from"./jsx-runtime-CVSDxk6A.js";import{et as n}from"./react-query.gen-DfnbKPpc.js";var r=t();function i(){return(0,r.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.5 text-body-small-default`,style:{backgroundColor:`var(--surface-info, var(--surface-secondary))`,color:`var(--content-info, var(--primary-base, #60a5fa))`},children:`Update available`})}var a=300*1e3;function o({assistantId:t,name:r,enabled:i=!0}){return e({...n({path:{assistant_id:t,name:r}}),enabled:!!t&&!!r&&i,staleTime:a,retry:!1})}function s(e){let t=e?.local?.localChanges;return!!t&&t?.clean===!1}export{o as n,i as r,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n,r,t as i}from"./reduced-motion-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n,r,t as i}from"./reduced-motion-8QnGN6lg.js";var a=e(t(),1);function o(){!n.current&&i();let[e]=(0,a.useState)(r.current);return e}export{o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./assistant-identity-store-DaDnhbxy.js";import{n as t,r as n,t as r}from"./semver-aan9RUyA.js";function i(e,t,n={}){return t(e.getState())?Promise.resolve():new Promise(r=>{let i,a=()=>{i!==void 0&&clearTimeout(i),o(),r()},o=e.subscribe(e=>{t(e)&&a()});n.timeoutMs!==void 0&&(i=setTimeout(a,n.timeoutMs))})}function a(t){return s(e.use.version(),t)}function o(t){let n=e.getState().version;return s(n,t)}function s(e,i){if(!e)return!1;let a=n(e),o=n(i);if(!a||!o)return!1;let s=r({...a,pre:null},{...o,pre:null});if(s!==0)return s>0;let c=a.pre!==null&&a.pre.startsWith(`dev`),l=o.pre!==null&&o.pre.startsWith(`dev`);return c&&l?t(a.pre,o.pre)>=0:c===l?!0:c}var c=5e3;function l(t=c){return i(e,e=>!!e.version,{timeoutMs:t})}export{i,a as n,l as r,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./capture-error-
|
|
1
|
+
import{t as e}from"./capture-error-CN7ObyIk.js";import{n as t,t as n}from"./create-selectors-BE0_e_Ed.js";import{dt as r,n as i}from"./sdk.gen-W0KlW-sG.js";var a=new Map;function o(e,t){return`${e}::${t}`}function s(e,t){let n=o(e,t),r=a.get(n);return r??(r=i({path:{assistant_id:e,id:t},throwOnError:!0}).then(e=>e.data.html).catch(e=>{throw a.delete(n),e}),a.set(n,r)),r}function c(e,t,n){a.set(o(e,t),Promise.resolve(n))}function l(e,t){a.delete(o(e,t))}function u(e){if(typeof e!=`object`||!e)return!1;let t=e.error;if(typeof t!=`object`||!t||t.code!==`NOT_FOUND`)return!1;let n=t.message;return typeof n==`string`&&n.startsWith(`App not found`)}function d(e,t){let n=e.mainView;return n===`document`||n===`subagent-detail`||n===`tool-detail`||n===`workflow-detail`?e[t]:n}function f(e,t){return t.messageId==null?e.thinkingText===t.thinkingText:e.messageId===t.messageId&&e.thinkingGroupIndex===t.thinkingGroupIndex&&e.thinkingItemIndex===t.thinkingItemIndex}var p={mainView:`chat`,activeAppId:null,openedAppState:null,activeDocumentSurfaceId:null,openedDocumentState:null,isAppMinimized:!1,intelligenceTab:`identity`,assetsRefreshKey:0,viewBeforeDocument:`chat`,activeSubagentId:null,viewBeforeSubagentDetail:`chat`,activeToolDetail:null,viewBeforeToolDetail:`chat`,activeWorkflowRunId:null,viewBeforeWorkflowDetail:`chat`,ruleEditorRequestSeq:0},m=n(t()((t,n)=>({...p,setMainView:e=>{n().mainView!==e&&t({mainView:e})},setIntelligenceTab:e=>{n().intelligenceTab!==e&&t({intelligenceTab:e})},openApp:e=>{t({mainView:`app`,activeAppId:e,openedAppState:null,isAppMinimized:!1})},loadApp:async(r,a)=>{t({mainView:`app`,activeAppId:a,openedAppState:null,isAppMinimized:!1});try{let{data:e}=await i({path:{assistant_id:r,id:a},throwOnError:!0});if(n().activeAppId!==a)return;t({openedAppState:{appId:e.appId,dirName:e.dirName,name:e.name,html:e.html}}),c(r,e.appId,e.html)}catch(r){if(n().activeAppId!==a)return;u(r)||e(r,{context:`openApp`}),t({mainView:`chat`,activeAppId:null,openedAppState:null})}},setLoadedApp:e=>{t({openedAppState:e})},handleAppLoadFailed:()=>{t({mainView:`chat`,activeAppId:null,openedAppState:null})},closeApp:()=>{t({mainView:`chat`,activeAppId:null,openedAppState:null,isAppMinimized:!1})},toggleAppMinimized:()=>{t({isAppMinimized:!n().isAppMinimized})},handleAppUnpinned:e=>{let t=n();return t.activeAppId!==e||t.mainView!==`app`&&t.mainView!==`app-editing`?!1:(n().closeApp(),!0)},enterAppEditing:()=>{t({mainView:`app-editing`})},exitAppEditing:()=>{t({mainView:`app`})},openSubagentDetail:e=>{t({mainView:`subagent-detail`,activeSubagentId:e,viewBeforeSubagentDetail:d(n(),`viewBeforeSubagentDetail`)})},closeSubagentDetail:()=>{t({mainView:n().viewBeforeSubagentDetail,activeSubagentId:null})},openWorkflowDetail:e=>{t({mainView:`workflow-detail`,activeWorkflowRunId:e,viewBeforeWorkflowDetail:d(n(),`viewBeforeWorkflowDetail`)})},closeWorkflowDetail:()=>{t({mainView:n().viewBeforeWorkflowDetail,activeWorkflowRunId:null})},openToolDetail:e=>{t({mainView:`tool-detail`,activeToolDetail:e,viewBeforeToolDetail:d(n(),`viewBeforeToolDetail`)})},toggleToolDetail:e=>{let t=n(),r=t.activeToolDetail;t.mainView===`tool-detail`&&r!=null&&(e.kind===`thinking`?r.kind===`thinking`&&f(r,e):r.kind!==`thinking`&&r.toolCallId===e.toolCallId)?n().closeToolDetail():n().openToolDetail(e)},closeToolDetail:()=>{t({mainView:n().viewBeforeToolDetail,activeToolDetail:null})},requestRuleEditorForActiveTool:()=>{n().activeToolDetail&&t(e=>({ruleEditorRequestSeq:e.ruleEditorRequestSeq+1}))},openDocument:()=>{t({mainView:`document`,openedDocumentState:null,viewBeforeDocument:d(n(),`viewBeforeDocument`)})},loadDocument:async(e,i)=>{let a=d(n(),`viewBeforeDocument`);t({mainView:`document`,activeDocumentSurfaceId:i,openedDocumentState:null,viewBeforeDocument:a});try{let{data:o}=await r({path:{assistant_id:e,id:i},throwOnError:!0});if(n().activeDocumentSurfaceId!==i)return;if(!o){t({mainView:a,activeDocumentSurfaceId:null,openedDocumentState:null});return}t({openedDocumentState:{surfaceId:o.surfaceId,conversationId:o.conversationId,documentName:o.title??`Untitled`,content:o.content??``}})}catch{if(n().activeDocumentSurfaceId!==i)return;t({mainView:a,activeDocumentSurfaceId:null,openedDocumentState:null})}},setLoadedDocument:e=>{t({openedDocumentState:e})},updateDocumentContent:(e,r,i)=>{let a=n();if(!a.openedDocumentState||a.openedDocumentState.surfaceId!==e)return;let o=a.openedDocumentState,s=i===`append`?o.content+r:r;t({openedDocumentState:{...o,content:s}})},handleDocumentLoadFailed:()=>{t({mainView:n().viewBeforeDocument,activeDocumentSurfaceId:null,openedDocumentState:null})},closeDocument:()=>{t({mainView:n().viewBeforeDocument,activeDocumentSurfaceId:null,openedDocumentState:null})},refreshAssets:()=>{t({assetsRefreshKey:n().assetsRefreshKey+1})},reset:()=>t({...p})})));export{c as a,s as i,m as n,l as r,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-D7s2Q_uG.js";import{t as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./dropdown-yOV5eJnU.js";import{t as l}from"./toggle-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-D7s2Q_uG.js";import{t as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./dropdown-yOV5eJnU.js";import{t as l}from"./toggle-95p73HGd.js";import{t as u}from"./info-CUuJWmsF.js";import{a as d}from"./routes-BLyehs4B.js";import{$t as f,Qt as p,aa as m,an as h,bn as g,en as _,in as v,nn as y,on as b,rn as x,sn as S,tn as C,xn as w}from"./index-Chr1kHBM.js";import{t as T}from"./detail-card-QPVpO5cj.js";var E=e(i(),1),D=s(),O=`vellum:voice:conversationTimeoutSeconds`,k=[{label:`Ctrl`,activator:{kind:`modifierOnly`,modifiers:[`control`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}},{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}}],A={label:`Fn`,activator:_},j=[{label:`5 seconds`,value:`5`},{label:`10 seconds`,value:`10`},{label:`15 seconds`,value:`15`},{label:`30 seconds`,value:`30`},{label:`60 seconds`,value:`60`}],M=`30`,N=`text-body-small-default text-[var(--content-tertiary)]`;function P(){return(0,D.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,D.jsx)(F,{}),(0,D.jsx)(L,{}),(0,D.jsx)(R,{}),(0,D.jsx)(B,{})]})}function F(){return(0,D.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--field-bg)] px-3 py-2`,children:[(0,D.jsx)(u,{className:`h-3.5 w-3.5 shrink-0 text-[var(--primary-base)]`}),(0,D.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Looking to configure Speech-to-Text or Text-to-Speech models?`}),(0,D.jsxs)(o,{to:d.settings.ai,className:`inline-flex items-center gap-1 text-body-medium-lighter text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Go to Models & Services`,(0,D.jsx)(m,{className:`h-3 w-3`})]})]})}var I=``;function L(){let[e,n]=(0,E.useState)([]),[i,o]=(0,E.useState)(!1),[s,l]=(0,E.useState)(()=>w()),u=(0,E.useCallback)(async()=>{if(navigator.mediaDevices?.enumerateDevices)try{let e=(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`audioinput`);o(e.length>0&&e.every(e=>!e.label)),n(e.filter(e=>e.deviceId!==``&&e.deviceId!==`default`&&e.deviceId!==`communications`))}catch{n([]),o(!1)}},[]),d=(0,E.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}u()},[u]);(0,E.useEffect)(()=>{u();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void u();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[u]);let f=(0,E.useMemo)(()=>[{value:I,label:`System Default`},...e.map((e,t)=>({value:e.deviceId,label:e.label||`Microphone ${t+1}`}))],[e]),p=(0,E.useCallback)(e=>{l(e),e===I?t(g):r(g,e)},[]);return(0,D.jsx)(T,{title:`Microphone`,subtitle:`Which input device is used for dictation and voice conversations.`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,D.jsx)(`div`,{className:`max-w-xs`,children:(0,D.jsx)(c,{options:f,value:f.some(e=>e.value===s)?s:I,onChange:p,"aria-label":`Microphone`})}),i&&(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,D.jsx)(a,{variant:`outlined`,onClick:d,children:`Allow Microphone Access`}),(0,D.jsx)(`span`,{className:N,children:`Grant microphone access to list your available input devices.`})]})]})})}function R(){let e=p(),[t,i]=(0,E.useState)(()=>{let t=n(C,``);return t?h(t,{preserveFunction:e}):e?A.activator:{kind:`off`}}),[a,o]=(0,E.useState)(!1),[s,c]=(0,E.useState)([]),d=(0,E.useRef)(null),m=(0,E.useRef)(!1),g=(0,E.useMemo)(()=>e?[A,...k]:k,[e]),w=t.kind!==`off`,O=w&&!e,j=(0,E.useCallback)(e=>{i(e),r(C,b(e)),o(!1),c([])},[]),M=(0,E.useCallback)(()=>{o(!0),c([]),m.current=!1,requestAnimationFrame(()=>{d.current?.focus()})},[]),P=(0,E.useCallback)(()=>{o(!1),c([]),m.current=!1},[]),F=(0,E.useCallback)(t=>{let n=[];return e&&t.getModifierState(`Fn`)&&n.push(`function`),t.ctrlKey&&n.push(`control`),t.altKey&&n.push(`option`),t.shiftKey&&n.push(`shift`),t.metaKey&&n.push(`command`),n},[e]),I=(0,E.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){P();return}let t=F(e),n=e.key;if(n===`Control`||n===`Alt`||n===`Shift`||n===`Meta`||n===`Fn`){c(t.includes(`function`)?_.modifiers:S(t));return}if(t.includes(`function`)){j(_);return}m.current=!0,j({kind:`key`,label:n.length===1?n.toUpperCase():n,modifiers:t})},[P,F,j]),L=(0,E.useCallback)(e=>{if(!a)return;e.preventDefault(),e.stopPropagation();let t=e.key;if(t===`Control`||t===`Alt`||t===`Shift`||t===`Meta`||t===`Fn`){if(m.current){m.current=!1,c([]);return}F(e).length===0&&s.length>0&&j({kind:`modifierOnly`,modifiers:s})}},[F,a,s,j]);(0,E.useEffect)(()=>{if(!a)return;let e=e=>{d.current&&!d.current.contains(e.target)&&P()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[P,a]);let R=w&&!g.some(e=>x(e.activator,t));return(0,D.jsx)(T,{title:`Push to Talk`,subtitle:`Hold the activation key to dictate text or start a voice conversation.`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,D.jsx)(l,{checked:w,onChange:n=>{n?t.kind===`off`&&j(e?A.activator:f):j({kind:`off`})},label:`Enable Push to Talk`}),w&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(`span`,{className:N,children:`Activation Key:`}),(0,D.jsxs)(`div`,{ref:d,tabIndex:a?0:-1,onKeyDown:a?I:void 0,onKeyUp:a?L:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[g.map(e=>{let n=x(e.activator,t);return(0,D.jsx)(z,{label:e.label,selected:n,onClick:()=>j(e.activator)},e.label)}),a?(0,D.jsx)(z,{label:s.length>0?v(s):`Press any key…`,selected:!0,recording:!0,onClick:P}):(0,D.jsx)(z,{label:R?y(t):`Custom`,selected:R,onClick:M})]}),O&&(0,D.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--content-quiet)]`,children:[(0,D.jsx)(u,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,D.jsx)(`span`,{children:`Push-to-Talk only works while this tab is focused, and browsers may intercept some shortcuts (e.g. Ctrl+T) before the page can see them. For always-on PTT, use the Vellum desktop app.`})]})]})]})})}function z({label:e,selected:t,recording:n=!1,onClick:r}){return(0,D.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,D.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,D.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function B(){let[e,t]=(0,E.useState)(()=>{let e=n(O,M);return j.find(t=>t.value===e)?.value??M});return(0,D.jsx)(T,{title:`Conversation Timeout`,subtitle:`How long the assistant waits for you to start speaking before ending a voice conversation turn.`,children:(0,D.jsx)(`div`,{className:`max-w-xs`,children:(0,D.jsx)(c,{options:j,value:e,onChange:(0,E.useCallback)(e=>{t(e),r(O,e)},[]),"aria-label":`Conversation timeout`})})})}export{P as VoicePage};
|
package/dist/assets/{weather-forecast-display-DKMPxDv5.js → weather-forecast-display-CdImQdck.js}
RENAMED
|
@@ -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"./moon-C0wLM1iN.js";import{A as i,Bi as a,Ji as o,M as s,N as c,Xa as l,Zi as u,ao as d,io as f,j as p,no as m,oo as h,ro as g,to as _}from"./index-BiN-6kWM.js";var v=e(t(),1),y={"sun.max.fill":{icon:o,className:`text-orange-500`},"cloud.sun.fill":{icon:m,className:`text-amber-400`},"moon.fill":{icon:r,className:`text-blue-400`},"cloud.moon.fill":{icon:f,className:`text-blue-400`},"cloud.fill":{icon:_,className:`text-stone-400`},"cloud.rain.fill":{icon:g,className:`text-blue-400`},snowflake:{icon:u,className:`text-blue-300`},"cloud.bolt.fill":{icon:d,className:`text-orange-500`},"cloud.fog.fill":{icon:h,className:`text-stone-400`}},b={sunny:{icon:o,className:`text-orange-500`},clear:{icon:o,className:`text-orange-500`},"partly cloudy":{icon:m,className:`text-amber-400`},"mostly sunny":{icon:m,className:`text-amber-400`},cloudy:{icon:_,className:`text-stone-400`},overcast:{icon:_,className:`text-stone-400`},rainy:{icon:g,className:`text-blue-400`},rain:{icon:g,className:`text-blue-400`},drizzle:{icon:g,className:`text-blue-400`},snow:{icon:u,className:`text-blue-300`},snowy:{icon:u,className:`text-blue-300`},thunderstorm:{icon:d,className:`text-orange-500`},thunder:{icon:d,className:`text-orange-500`},foggy:{icon:h,className:`text-stone-400`},fog:{icon:h,className:`text-stone-400`},mist:{icon:h,className:`text-stone-400`},hazy:{icon:h,className:`text-stone-400`},night:{icon:r,className:`text-blue-400`},"mainly clear":{icon:o,className:`text-orange-500`},"mostly cloudy":{icon:_,className:`text-stone-400`},breezy:{icon:a,className:`text-stone-400`},windy:{icon:a,className:`text-stone-400`},cool:{icon:_,className:`text-stone-400`},warm:{icon:o,className:`text-orange-500`},hot:{icon:o,className:`text-orange-500`},cold:{icon:u,className:`text-blue-300`},"cold snap":{icon:u,className:`text-blue-300`},"warm, mostly sunny":{icon:m,className:`text-amber-400`},"cooler, breezy":{icon:a,className:`text-stone-400`}},x={icon:_,className:`text-stone-400`};function S(e){let t=y[e];if(t)return t;let n=e.toLowerCase(),r=b[n];if(r)return r;for(let[e,t]of Object.entries(b))if(n.includes(e))return t;return x}function C(e){if(typeof e==`string`){let t=e.match(/^(\d+)\s*mph\s*(.*)/i);if(t)return{speed:Number(t[1]),direction:t[2]?.trim()||void 0}}return{}}function w(e){let t;if(typeof e.location==`string`)t=e.location;else{let n=s(e.location);n&&typeof n.name==`string`&&(t=n.name)}if(!t)return null;let n=s(e.current),r=p(n?.temp)??p(e.currentTemp)??p(e.temperature)??p(e.temp),a=p(n?.feelsLike)??p(n?.feels_like)??p(n?.apparentTemperature)??p(e.feelsLike)??p(e.feels_like)??p(e.apparentTemperature),o=c(n?.condition)??c(e.condition),l=p(n?.humidity)??p(e.humidity),u=C(n?.wind??e.wind),d=p(n?.windSpeed)??p(n?.wind_speed)??p(e.windSpeed)??p(e.wind_speed)??u.speed,f=c(n?.windDirection)??c(n?.wind_direction)??c(e.windDirection)??c(e.wind_direction)??u.direction,m=s(e.units),h=c(m?.temperature)??c(n?.unit)??c(e.unit)??`F`,g=c(m?.speed)??c(e.windUnit)??c(e.wind_unit),_=i(e.hourly).map((e,t)=>({id:c(e.id)??String(t),time:c(e.time)??``,icon:c(e.icon)??c(e.condition)??`cloud.fill`,temp:p(e.tempC)??p(e.temp)??p(e.temperature),tempC:p(e.tempC)})),v=i([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:c(e.id)??String(t),day:c(e.day)??c(e.date),dayLabel:c(e.dayLabel)??c(e.date),icon:c(e.icon)??c(e.condition)??`cloud.fill`,low:p(e.low),high:p(e.high),lowC:p(e.lowC),highC:p(e.highC),precip:p(e.precip)??p(e.precipitation)??p(e.precipitationProbability),condition:c(e.condition)}));return{location:t,currentTemp:r,feelsLike:a,condition:o,humidity:l,windSpeed:d,windDirection:f,windUnit:g,unit:h,hourly:_.length>0?_:void 0,forecast:v.length>0?v:void 0}}function T(e){return e*9/5+32}function E(e){return(e-32)*5/9}function D(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=E(e)),!t&&n&&(r=T(e)),`${Math.round(r)}`}function O(e,t,n){return e.tempC===void 0?e.temp===void 0?null:D(e.temp,t,n):D(e.tempC,!1,n)}function k(e,t,n){return e.lowC===void 0?D(e.low,t,n):D(e.lowC,!1,n)}function A(e,t,n){return e.highC===void 0?D(e.high,t,n):D(e.highC,!1,n)}var j=n();function M({icon:e,size:t=20}){let{icon:n,className:r}=S(e);return(0,j.jsx)(n,{width:t,height:t,className:r})}function N({useFahrenheit:e,onToggle:t}){return(0,j.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:`px-2 py-0.5 text-body-small-default transition-colors ${e?`bg-[var(--primary-base)] text-[var(--content-inset)]`:`bg-transparent text-[var(--content-quiet)]`}`,children:`°F`}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:`px-2 py-0.5 text-body-small-default transition-colors ${e?`bg-transparent text-[var(--content-quiet)]`:`bg-[var(--primary-base)] text-[var(--content-inset)]`}`,children:`°C`})]})}function P({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let i=e.location,o=D(e.currentTemp,t,n),s=D(e.feelsLike,t,n),c=n?`F`:`C`,u=e.forecast?.[0],d=u?A(u,t,n):null,f=u?k(u,t,n):null,p=null;return e.windSpeed!==void 0&&(p=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(p=`${e.windDirection} ${p}`)),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i}),o!==null&&(0,j.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[o,`°`,c]}),e.condition&&(0,j.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,j.jsx)(N,{useFahrenheit:n,onToggle:r})]}),(0,j.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[s!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`Feels like `,s,`°`]}),d!==null&&f!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`H:`,d,`° L:`,f,`°`]}),p&&(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,j.jsx)(a,{width:12,height:12}),p]}),e.humidity!==void 0&&(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,j.jsx)(l,{width:12,height:12}),e.humidity,`%`]})]})]})}function F({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){return(0,j.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,j.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,r)=>{let i=e.time.toLowerCase()===`now`,a=O(e,t,n);return(0,j.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,j.jsx)(`span`,{className:i?`text-body-small-emphasised text-[var(--content-default)]`:`text-label-medium-default text-[var(--content-quiet)]`,children:i?`Now`:e.time}),(0,j.jsx)(M,{icon:e.icon,size:18}),a!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[a,`°`]})]},e.id??r)})})})}function I({forecast:e,currentTemp:t,sourceIsFahrenheit:n,useFahrenheit:r}){let{globalMin:i,globalMax:a}=(0,v.useMemo)(()=>{let t=1/0,n=-1/0;for(let r of e){let e=r.lowC??r.low,i=r.highC??r.high;e!==void 0&&e<t&&(t=e),i!==void 0&&i>n&&(n=i)}return{globalMin:t===1/0?0:t,globalMax:n===-1/0?100:n}},[e]),o=a-i||1;return(0,j.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,j.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,s)=>{let c=e.dayLabel??e.day??`Day ${s+1}`,l=c.toLowerCase()===`today`,u=k(e,n,r),d=A(e,n,r),f=e.precip,p=e.lowC??e.low??i,m=e.highC??e.high??a,h=(p-i)/o*100,g=(m-i)/o*100,_=Math.max(g-h,2),v=null;if(l&&t!==void 0){let r=(e.lowC!==void 0||e.highC!==void 0)&&n?(t-32)*5/9:t;v=m===p?50:(Math.max(p,Math.min(m,r))-p)/(m-p)*100}return(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`w-12 shrink-0 truncate text-body-small-default ${l?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`}`,children:c}),(0,j.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,j.jsx)(M,{icon:e.icon,size:16}),f!==void 0&&f>0&&(0,j.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(f),`%`]})]}),(0,j.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:u===null?`--`:`${u}°`}),(0,j.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,j.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${h}%`,width:`${_}%`}}),v!==null&&(0,j.jsx)(`div`,{className:`absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-[var(--aux-white)] bg-[var(--aux-white)] shadow-sm`,style:{left:`${h+v/100*_}%`}})]}),(0,j.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:d===null?`--`:`${d}°`})]},e.id??s)})})})}function L({templateData:e,fallback:t}){let n=(0,v.useMemo)(()=>w(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,v.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,j.jsxs)(`div`,{className:`mt-3`,children:[(0,j.jsx)(P,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,j.jsx)(F,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,j.jsx)(I,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{L as WeatherForecastDisplay};
|
|
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"./moon-D-eeNLvA.js";import{Bi as i,Er as a,Fi as o,Gi as s,Hi as c,I as l,L as u,Lr as d,Pr as f,R as p,Ui as m,Vi as h,Wi as g,z as _}from"./index-Chr1kHBM.js";var v=e(t(),1),y={"sun.max.fill":{icon:f,className:`text-orange-500`},"cloud.sun.fill":{icon:h,className:`text-amber-400`},"moon.fill":{icon:r,className:`text-blue-400`},"cloud.moon.fill":{icon:m,className:`text-blue-400`},"cloud.fill":{icon:i,className:`text-stone-400`},"cloud.rain.fill":{icon:c,className:`text-blue-400`},snowflake:{icon:d,className:`text-blue-300`},"cloud.bolt.fill":{icon:g,className:`text-orange-500`},"cloud.fog.fill":{icon:s,className:`text-stone-400`}},b={sunny:{icon:f,className:`text-orange-500`},clear:{icon:f,className:`text-orange-500`},"partly cloudy":{icon:h,className:`text-amber-400`},"mostly sunny":{icon:h,className:`text-amber-400`},cloudy:{icon:i,className:`text-stone-400`},overcast:{icon:i,className:`text-stone-400`},rainy:{icon:c,className:`text-blue-400`},rain:{icon:c,className:`text-blue-400`},drizzle:{icon:c,className:`text-blue-400`},snow:{icon:d,className:`text-blue-300`},snowy:{icon:d,className:`text-blue-300`},thunderstorm:{icon:g,className:`text-orange-500`},thunder:{icon:g,className:`text-orange-500`},foggy:{icon:s,className:`text-stone-400`},fog:{icon:s,className:`text-stone-400`},mist:{icon:s,className:`text-stone-400`},hazy:{icon:s,className:`text-stone-400`},night:{icon:r,className:`text-blue-400`},"mainly clear":{icon:f,className:`text-orange-500`},"mostly cloudy":{icon:i,className:`text-stone-400`},breezy:{icon:a,className:`text-stone-400`},windy:{icon:a,className:`text-stone-400`},cool:{icon:i,className:`text-stone-400`},warm:{icon:f,className:`text-orange-500`},hot:{icon:f,className:`text-orange-500`},cold:{icon:d,className:`text-blue-300`},"cold snap":{icon:d,className:`text-blue-300`},"warm, mostly sunny":{icon:h,className:`text-amber-400`},"cooler, breezy":{icon:a,className:`text-stone-400`}},x={icon:i,className:`text-stone-400`};function S(e){let t=y[e];if(t)return t;let n=e.toLowerCase(),r=b[n];if(r)return r;for(let[e,t]of Object.entries(b))if(n.includes(e))return t;return x}function C(e){if(typeof e==`string`){let t=e.match(/^(\d+)\s*mph\s*(.*)/i);if(t)return{speed:Number(t[1]),direction:t[2]?.trim()||void 0}}return{}}function w(e){let t;if(typeof e.location==`string`)t=e.location;else{let n=p(e.location);n&&typeof n.name==`string`&&(t=n.name)}if(!t)return null;let n=p(e.current),r=u(n?.temp)??u(e.currentTemp)??u(e.temperature)??u(e.temp),i=u(n?.feelsLike)??u(n?.feels_like)??u(n?.apparentTemperature)??u(e.feelsLike)??u(e.feels_like)??u(e.apparentTemperature),a=_(n?.condition)??_(e.condition),o=u(n?.humidity)??u(e.humidity),s=C(n?.wind??e.wind),c=u(n?.windSpeed)??u(n?.wind_speed)??u(e.windSpeed)??u(e.wind_speed)??s.speed,d=_(n?.windDirection)??_(n?.wind_direction)??_(e.windDirection)??_(e.wind_direction)??s.direction,f=p(e.units),m=_(f?.temperature)??_(n?.unit)??_(e.unit)??`F`,h=_(f?.speed)??_(e.windUnit)??_(e.wind_unit),g=l(e.hourly).map((e,t)=>({id:_(e.id)??String(t),time:_(e.time)??``,icon:_(e.icon)??_(e.condition)??`cloud.fill`,temp:u(e.tempC)??u(e.temp)??u(e.temperature),tempC:u(e.tempC)})),v=l([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:_(e.id)??String(t),day:_(e.day)??_(e.date),dayLabel:_(e.dayLabel)??_(e.date),icon:_(e.icon)??_(e.condition)??`cloud.fill`,low:u(e.low),high:u(e.high),lowC:u(e.lowC),highC:u(e.highC),precip:u(e.precip)??u(e.precipitation)??u(e.precipitationProbability),condition:_(e.condition)}));return{location:t,currentTemp:r,feelsLike:i,condition:a,humidity:o,windSpeed:c,windDirection:d,windUnit:h,unit:m,hourly:g.length>0?g:void 0,forecast:v.length>0?v:void 0}}function T(e){return e*9/5+32}function E(e){return(e-32)*5/9}function D(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=E(e)),!t&&n&&(r=T(e)),`${Math.round(r)}`}function O(e,t,n){return e.tempC===void 0?e.temp===void 0?null:D(e.temp,t,n):D(e.tempC,!1,n)}function k(e,t,n){return e.lowC===void 0?D(e.low,t,n):D(e.lowC,!1,n)}function A(e,t,n){return e.highC===void 0?D(e.high,t,n):D(e.highC,!1,n)}var j=n();function M({icon:e,size:t=20}){let{icon:n,className:r}=S(e);return(0,j.jsx)(n,{width:t,height:t,className:r})}function N({useFahrenheit:e,onToggle:t}){return(0,j.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:`px-2 py-0.5 text-body-small-default transition-colors ${e?`bg-[var(--primary-base)] text-[var(--content-inset)]`:`bg-transparent text-[var(--content-quiet)]`}`,children:`°F`}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:`px-2 py-0.5 text-body-small-default transition-colors ${e?`bg-transparent text-[var(--content-quiet)]`:`bg-[var(--primary-base)] text-[var(--content-inset)]`}`,children:`°C`})]})}function P({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let i=e.location,s=D(e.currentTemp,t,n),c=D(e.feelsLike,t,n),l=n?`F`:`C`,u=e.forecast?.[0],d=u?A(u,t,n):null,f=u?k(u,t,n):null,p=null;return e.windSpeed!==void 0&&(p=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(p=`${e.windDirection} ${p}`)),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i}),s!==null&&(0,j.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[s,`°`,l]}),e.condition&&(0,j.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,j.jsx)(N,{useFahrenheit:n,onToggle:r})]}),(0,j.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[c!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`Feels like `,c,`°`]}),d!==null&&f!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`H:`,d,`° L:`,f,`°`]}),p&&(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,j.jsx)(a,{width:12,height:12}),p]}),e.humidity!==void 0&&(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,j.jsx)(o,{width:12,height:12}),e.humidity,`%`]})]})]})}function F({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){return(0,j.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,j.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,r)=>{let i=e.time.toLowerCase()===`now`,a=O(e,t,n);return(0,j.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,j.jsx)(`span`,{className:i?`text-body-small-emphasised text-[var(--content-default)]`:`text-label-medium-default text-[var(--content-quiet)]`,children:i?`Now`:e.time}),(0,j.jsx)(M,{icon:e.icon,size:18}),a!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[a,`°`]})]},e.id??r)})})})}function I({forecast:e,currentTemp:t,sourceIsFahrenheit:n,useFahrenheit:r}){let{globalMin:i,globalMax:a}=(0,v.useMemo)(()=>{let t=1/0,n=-1/0;for(let r of e){let e=r.lowC??r.low,i=r.highC??r.high;e!==void 0&&e<t&&(t=e),i!==void 0&&i>n&&(n=i)}return{globalMin:t===1/0?0:t,globalMax:n===-1/0?100:n}},[e]),o=a-i||1;return(0,j.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,j.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,s)=>{let c=e.dayLabel??e.day??`Day ${s+1}`,l=c.toLowerCase()===`today`,u=k(e,n,r),d=A(e,n,r),f=e.precip,p=e.lowC??e.low??i,m=e.highC??e.high??a,h=(p-i)/o*100,g=(m-i)/o*100,_=Math.max(g-h,2),v=null;if(l&&t!==void 0){let r=(e.lowC!==void 0||e.highC!==void 0)&&n?(t-32)*5/9:t;v=m===p?50:(Math.max(p,Math.min(m,r))-p)/(m-p)*100}return(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`w-12 shrink-0 truncate text-body-small-default ${l?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`}`,children:c}),(0,j.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,j.jsx)(M,{icon:e.icon,size:16}),f!==void 0&&f>0&&(0,j.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(f),`%`]})]}),(0,j.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:u===null?`--`:`${u}°`}),(0,j.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,j.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${h}%`,width:`${_}%`}}),v!==null&&(0,j.jsx)(`div`,{className:`absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-[var(--aux-white)] bg-[var(--aux-white)] shadow-sm`,style:{left:`${h+v/100*_}%`}})]}),(0,j.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:d===null?`--`:`${d}°`})]},e.id??s)})})})}function L({templateData:e,fallback:t}){let n=(0,v.useMemo)(()=>w(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,v.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,j.jsxs)(`div`,{className:`mt-3`,children:[(0,j.jsx)(P,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,j.jsx)(F,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,j.jsx)(I,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{L as WeatherForecastDisplay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-3i_EPbLt.js";var t=class extends e{constructor(){super(),this._lastWindow=null}async open(e){this._lastWindow=window.open(e.url,e.windowName||`_blank`)}async close(){return new Promise((e,t)=>{this._lastWindow==null?t(`No active window to close!`):(this._lastWindow.close(),this._lastWindow=null,e())})}};new t;export{t as BrowserWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t}from"./dist-
|
|
1
|
+
import{n as e,r as t}from"./dist-3i_EPbLt.js";import{n}from"./definitions-B4RRVbRh.js";function r(e){let t=e.split(`/`).filter(e=>e!==`.`),n=[];return t.forEach(e=>{e===`..`&&n.length>0&&n[n.length-1]!==`..`?n.pop():n.push(e)}),n.join(`/`)}function i(e,t){e=r(e),t=r(t);let n=e.split(`/`),i=t.split(`/`);return e!==t&&n.every((e,t)=>e===i[t])}var a=class r extends e{constructor(){super(...arguments),this.DB_VERSION=1,this.DB_NAME=`Disc`,this._writeCmds=[`add`,`put`,`delete`],this.downloadFile=async e=>{let n=t(e,e.webFetchExtra),r=await fetch(e.url,n),i;if(!e.progress)i=await r.blob();else if(!r?.body)i=new Blob;else{let t=r.body.getReader(),n=0,a=[],o=r.headers.get(`content-type`),s=parseInt(r.headers.get(`content-length`)||`0`,10);for(;;){let{done:r,value:i}=await t.read();if(r)break;a.push(i),n+=i?.length||0;let o={url:e.url,bytes:n,contentLength:s};this.notifyListeners(`progress`,o)}let c=new Uint8Array(n),l=0;for(let e of a)e!==void 0&&(c.set(e,l),l+=e.length);i=new Blob([c.buffer],{type:o||void 0})}return{path:(await this.writeFile({path:e.path,directory:e.directory??void 0,recursive:e.recursive??!1,data:i})).uri,blob:i}}}readFileInChunks(e,t){throw this.unavailable(`Method not implemented.`)}async initDb(){if(this._db!==void 0)return this._db;if(!(`indexedDB`in window))throw this.unavailable(`This browser doesn't support IndexedDB`);return new Promise((e,t)=>{let n=indexedDB.open(this.DB_NAME,this.DB_VERSION);n.onupgradeneeded=r.doUpgrade,n.onsuccess=()=>{this._db=n.result,e(n.result)},n.onerror=()=>t(n.error),n.onblocked=()=>{console.warn(`db blocked`)}})}static doUpgrade(e){let t=e.target.result;switch(e.oldVersion){default:t.objectStoreNames.contains(`FileStorage`)&&t.deleteObjectStore(`FileStorage`),t.createObjectStore(`FileStorage`,{keyPath:`path`}).createIndex(`by_folder`,`folder`)}}async dbRequest(e,t){let n=this._writeCmds.indexOf(e)===-1?`readonly`:`readwrite`;return this.initDb().then(r=>new Promise((i,a)=>{let o=r.transaction([`FileStorage`],n).objectStore(`FileStorage`)[e](...t);o.onsuccess=()=>i(o.result),o.onerror=()=>a(o.error)}))}async dbIndexRequest(e,t,n){let r=this._writeCmds.indexOf(t)===-1?`readonly`:`readwrite`;return this.initDb().then(i=>new Promise((a,o)=>{let s=i.transaction([`FileStorage`],r).objectStore(`FileStorage`).index(e)[t](...n);s.onsuccess=()=>a(s.result),s.onerror=()=>o(s.error)}))}getPath(e,t){let n=t===void 0?``:t.replace(/^[/]+|[/]+$/g,``),r=``;return e!==void 0&&(r+=`/`+e),t!==``&&(r+=`/`+n),r}async clear(){(await this.initDb()).transaction([`FileStorage`],`readwrite`).objectStore(`FileStorage`).clear()}async readFile(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0)throw Error(`File does not exist.`);return{data:n.content?n.content:``}}async writeFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=e.recursive,a=await this.dbRequest(`get`,[t]);if(a&&a.type===`directory`)throw Error(`The supplied path is a directory.`);let o=t.substr(0,t.lastIndexOf(`/`));if(await this.dbRequest(`get`,[o])===void 0){let t=o.indexOf(`/`,1);if(t!==-1){let n=o.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:i})}}if(!r&&!(n instanceof Blob)&&(n=n.indexOf(`,`)>=0?n.split(`,`)[1]:n,!this.isBase64String(n)))throw Error(`The supplied data is not valid base64 content.`);let s=Date.now(),c={path:t,folder:o,type:`file`,size:n instanceof Blob?n.size:n.length,ctime:s,mtime:s,content:n};return await this.dbRequest(`put`,[c]),{uri:c.path}}async appendFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=t.substr(0,t.lastIndexOf(`/`)),a=Date.now(),o=a,s=await this.dbRequest(`get`,[t]);if(s&&s.type===`directory`)throw Error(`The supplied path is a directory.`);if(await this.dbRequest(`get`,[i])===void 0){let t=i.indexOf(`/`,1);if(t!==-1){let n=i.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:!0})}}if(!r&&!this.isBase64String(n))throw Error(`The supplied data is not valid base64 content.`);if(s!==void 0){if(s.content instanceof Blob)throw Error(`The occupied entry contains a Blob object which cannot be appended to.`);n=s.content!==void 0&&!r?btoa(atob(s.content)+atob(n)):s.content+n,o=s.ctime}let c={path:t,folder:i,type:`file`,size:n.length,ctime:o,mtime:a,content:n};await this.dbRequest(`put`,[c])}async deleteFile(e){let t=this.getPath(e.directory,e.path);if(await this.dbRequest(`get`,[t])===void 0)throw Error(`File does not exist.`);if((await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)])).length!==0)throw Error(`Folder is not empty.`);await this.dbRequest(`delete`,[t])}async mkdir(e){let t=this.getPath(e.directory,e.path),n=e.recursive,r=t.substr(0,t.lastIndexOf(`/`)),i=(t.match(/\//g)||[]).length,a=await this.dbRequest(`get`,[r]),o=await this.dbRequest(`get`,[t]);if(i===1)throw Error(`Cannot create Root directory`);if(o!==void 0)throw Error(`Current directory does already exist.`);if(!n&&i!==2&&a===void 0)throw Error(`Parent directory must exist`);if(n&&i!==2&&a===void 0){let t=r.substr(r.indexOf(`/`,1));await this.mkdir({path:t,directory:e.directory,recursive:n})}let s=Date.now(),c={path:t,folder:r,type:`directory`,size:0,ctime:s,mtime:s};await this.dbRequest(`put`,[c])}async rmdir(e){let{path:t,directory:n,recursive:r}=e,i=this.getPath(n,t),a=await this.dbRequest(`get`,[i]);if(a===void 0)throw Error(`Folder does not exist.`);if(a.type!==`directory`)throw Error(`Requested path is not a directory`);let o=await this.readdir({path:t,directory:n});if(o.files.length!==0&&!r)throw Error(`Folder is not empty`);for(let e of o.files){let i=`${t}/${e.name}`;(await this.stat({path:i,directory:n})).type===`file`?await this.deleteFile({path:i,directory:n}):await this.rmdir({path:i,directory:n,recursive:r})}await this.dbRequest(`delete`,[i])}async readdir(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(e.path!==``&&n===void 0)throw Error(`Folder does not exist.`);let r=await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)]);return{files:await Promise.all(r.map(async e=>{let n=await this.dbRequest(`get`,[e]);return n===void 0&&(n=await this.dbRequest(`get`,[e+`/`])),{name:e.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}))}}async getUri(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);return n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),{uri:n?.path||t}}async stat(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),n===void 0)throw Error(`Entry does not exist.`);return{name:n.path.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}async rename(e){await this._copy(e,!0)}async copy(e){return this._copy(e,!1)}async requestPermissions(){return{publicStorage:`granted`}}async checkPermissions(){return{publicStorage:`granted`}}async _copy(e,t=!1){let{toDirectory:r}=e,{to:a,from:o,directory:s}=e;if(!a||!o)throw Error(`Both to and from must be provided`);r||=s;let c=this.getPath(s,o),l=this.getPath(r,a);if(c===l)return{uri:l};if(i(c,l))throw Error(`To path cannot contain the from path`);let u;try{u=await this.stat({path:a,directory:r})}catch{let e=a.split(`/`);e.pop();let t=e.join(`/`);if(e.length>0&&(await this.stat({path:t,directory:r})).type!==`directory`)throw Error(`Parent directory of the to path is a file`)}if(u&&u.type===`directory`)throw Error(`Cannot overwrite a directory with a file`);let d=await this.stat({path:o,directory:s}),f=async(e,t,n)=>{let i=this.getPath(r,e),a=await this.dbRequest(`get`,[i]);a.ctime=t,a.mtime=n,await this.dbRequest(`put`,[a])},p=d.ctime?d.ctime:Date.now();switch(d.type){case`file`:{let e=await this.readFile({path:o,directory:s});t&&await this.deleteFile({path:o,directory:s});let i;!(e.data instanceof Blob)&&!this.isBase64String(e.data)&&(i=n.UTF8);let c=await this.writeFile({path:a,directory:r,data:e.data,encoding:i});return t&&await f(a,p,d.mtime),c}case`directory`:{if(u)throw Error(`Cannot move a directory over an existing object`);try{await this.mkdir({path:a,directory:r,recursive:!1}),t&&await f(a,p,d.mtime)}catch{}let e=(await this.readdir({path:o,directory:s})).files;for(let n of e)await this._copy({from:`${o}/${n.name}`,to:`${a}/${n.name}`,directory:s,toDirectory:r},t);t&&await this.rmdir({path:o,directory:s})}}return{uri:l}}isBase64String(e){try{return btoa(atob(e))==e}catch{return!1}}};a._debug=!0;export{a as FilesystemWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-3i_EPbLt.js";function t(){let e=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,t=`unknown`,n=e?e.type||e.effectiveType:null;if(n&&typeof n==`string`)switch(n){case`bluetooth`:case`cellular`:t=`cellular`;break;case`none`:t=`none`;break;case`ethernet`:case`wifi`:case`wimax`:t=`wifi`;break;case`other`:case`unknown`:t=`unknown`;break;case`slow-2g`:case`2g`:case`3g`:t=`cellular`;break;case`4g`:t=`wifi`;break;default:break}return t}var n=class extends e{constructor(){super(),this.handleOnline=()=>{let e={connected:!0,connectionType:t()};this.notifyListeners(`networkStatusChange`,e)},this.handleOffline=()=>{this.notifyListeners(`networkStatusChange`,{connected:!1,connectionType:`none`})},typeof window<`u`&&(window.addEventListener(`online`,this.handleOnline),window.addEventListener(`offline`,this.handleOffline))}async getStatus(){if(!window.navigator)throw this.unavailable(`Browser does not support the Network Information API`);let e=window.navigator.onLine,n=t();return{connected:e,connectionType:e?n:`none`}}};new n;export{n as NetworkWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-3i_EPbLt.js";var t=class extends e{constructor(){super(),this.handleVisibilityChange=()=>{let e={isActive:document.hidden!==!0};this.notifyListeners(`appStateChange`,e),document.hidden?this.notifyListeners(`pause`,null):this.notifyListeners(`resume`,null)},document.addEventListener(`visibilitychange`,this.handleVisibilityChange,!1)}exitApp(){throw this.unimplemented(`Not implemented on web.`)}async getInfo(){throw this.unimplemented(`Not implemented on web.`)}async getLaunchUrl(){return{url:``}}async getState(){return{isActive:document.hidden!==!0}}async minimizeApp(){throw this.unimplemented(`Not implemented on web.`)}async toggleBackButtonHandler(){throw this.unimplemented(`Not implemented on web.`)}async getAppLanguage(){return{value:navigator.language.split(`-`)[0].toLowerCase()}}};export{t as AppWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-3i_EPbLt.js";var t=class extends e{async canShare(){return typeof navigator>`u`||!navigator.share?{value:!1}:{value:!0}}async share(e){if(typeof navigator>`u`||!navigator.share)throw this.unavailable(`Share API not available in this browser`);return await navigator.share({title:e.title,text:e.text,url:e.url}),{}}};export{t as ShareWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-3i_EPbLt.js";var t=class extends e{constructor(){super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{if(!(`Notification`in window)||!Notification.requestPermission)return!1;if(Notification.permission!==`granted`)try{new Notification(``)}catch(e){if(e instanceof Error&&e.name===`TypeError`)return!1}return!0}}async getDeliveredNotifications(){let e=[];for(let t of this.deliveredNotifications){let n={title:t.title,id:parseInt(t.tag),body:t.body};e.push(n)}return{notifications:e}}async removeDeliveredNotifications(e){for(let t of e.notifications){let e=this.deliveredNotifications.find(e=>e.tag===String(t.id));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!e)}}async removeAllDeliveredNotifications(){for(let e of this.deliveredNotifications)e.close();this.deliveredNotifications=[]}async createChannel(){throw this.unimplemented(`Not implemented on web.`)}async deleteChannel(){throw this.unimplemented(`Not implemented on web.`)}async listChannels(){throw this.unimplemented(`Not implemented on web.`)}async schedule(e){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);for(let t of e.notifications)this.sendNotification(t);return{notifications:e.notifications.map(e=>({id:e.id}))}}async getPending(){return{notifications:this.pending}}async registerActionTypes(){throw this.unimplemented(`Not implemented on web.`)}async cancel(e){this.pending=this.pending.filter(t=>!e.notifications.find(e=>e.id===t.id))}async areEnabled(){let{display:e}=await this.checkPermissions();return{value:e===`granted`}}async changeExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async checkExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async requestPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(await Notification.requestPermission())}}async checkPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(Notification.permission)}}transformNotificationPermission(e){switch(e){case`granted`:return`granted`;case`denied`:return`denied`;default:return`prompt`}}sendPending(){let e=[],t=new Date().getTime();for(let n of this.pending)n.schedule?.at&&n.schedule.at.getTime()<=t&&(this.buildNotification(n),e.push(n));this.pending=this.pending.filter(t=>!e.find(e=>e===t))}sendNotification(e){if(e.schedule?.at){let t=e.schedule.at.getTime()-new Date().getTime();this.pending.push(e),setTimeout(()=>{this.sendPending()},t);return}this.buildNotification(e)}buildNotification(e){let t=new Notification(e.title,{body:e.body,tag:String(e.id)});return t.addEventListener(`click`,this.onClick.bind(this,e),!1),t.addEventListener(`show`,this.onShow.bind(this,e),!1),t.addEventListener(`close`,()=>{this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)},!1),this.deliveredNotifications.push(t),t}onClick(e){let t={actionId:`tap`,notification:e};this.notifyListeners(`localNotificationActionPerformed`,t)}onShow(e){this.notifyListeners(`localNotificationReceived`,e)}};export{t as LocalNotificationsWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-3i_EPbLt.js";var t=class extends e{async getSafeAreaInsets(){return{insets:{top:0,left:0,right:0,bottom:0}}}async getStatusBarHeight(){return{statusBarHeight:0}}setImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}unsetImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}};export{t as SafeAreaWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./button-D7s2Q_uG.js";import{d as t}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{
|
|
1
|
+
import{t as e}from"./button-D7s2Q_uG.js";import{d as t}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{l as r}from"./local-mode-Bg6wpc5q.js";import{a as i}from"./routes-BLyehs4B.js";import{t as a}from"./use-onboarding-login-Bp9jhDR4.js";import{_t as o}from"./index-Chr1kHBM.js";var s=n();function c(){let n=t(),{loading:c,error:l,login:u,cancel:d}=a();return(0,s.jsx)(o,{children:(0,s.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 text-[var(--content-default)]`,children:(0,s.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,s.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Welcome to Vellum`}),(0,s.jsx)(`p`,{className:`mt-3 text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Your own personal intelligence is just a step away.`}),l&&(0,s.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:l}),(0,s.jsxs)(`div`,{className:`mt-10 flex w-full max-w-sm flex-col gap-3`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,s.jsx)(e,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:c?d:()=>void u(),children:c?`Cancel`:`Log In`}),(0,s.jsx)(e,{variant:`ghost`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>{c&&d(),r()?n(i.selectAssistant):n(i.onboarding.hosting)},children:`Continue without account`})]})]})})})}export{c as WelcomeScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./cn-DvW5mxZR.js";import{t as a}from"./typography-BscuIPxA.js";import"./src-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./cn-DvW5mxZR.js";import{t as a}from"./typography-BscuIPxA.js";import"./src-BJj2O5XB.js";import{n as o,r as s,t as c}from"./metric-card-DxrlxUKS.js";import{t as l}from"./ban-DOB4wT-M.js";import{t as u}from"./circle-check-BKkxjdE1.js";import{t as d}from"./loader-circle-YAV9sMh_.js";import{t as f}from"./triangle-alert-CoIDviBm.js";import{t as p}from"./x-b3o2p6YU.js";import{Mt as m,Nt as h,Or as g,Pt as _,Tr as v,sa as y}from"./index-Chr1kHBM.js";var b=e(t(),1),x=r();function S({status:e}){let t=h(e);return(0,x.jsx)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-md px-2 py-0.5 text-label-small-default`,style:{color:t,backgroundColor:`color-mix(in srgb, ${t} 15%, transparent)`},children:_(e)})}function C({status:e}){let t=`h-3.5 w-3.5 shrink-0`;switch(e){case`completed`:return(0,x.jsx)(u,{className:t,style:{color:`var(--system-positive-strong)`}});case`failed`:return(0,x.jsx)(f,{className:t,style:{color:`var(--system-negative-strong)`}});case`cancelled`:return(0,x.jsx)(l,{className:t,style:{color:`var(--content-secondary)`},role:`img`,"aria-label":`Cancelled`});default:return(0,x.jsx)(d,{className:`${t} animate-spin`,style:{color:`var(--primary-base)`}})}}function w({leaf:e}){let[t,n]=(0,b.useState)(!1),r=!!e.resultSummary,i=e.label??`Leaf ${e.seq}`;return(0,x.jsxs)(`div`,{className:`rounded-lg bg-[var(--surface-overlay)] px-4 py-3`,children:[(0,x.jsxs)(`button`,{type:`button`,disabled:!r,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-2 text-left disabled:cursor-default`,children:[(0,x.jsx)(C,{status:e.status}),(0,x.jsx)(a,{variant:`body-medium-default`,className:`min-w-0 flex-1 truncate text-[var(--content-default)]`,children:i}),r&&(0,x.jsx)(a,{variant:`body-small-default`,className:`shrink-0 text-[var(--content-tertiary)]`,children:t?`Hide`:`Details`})]}),e.promptSummary&&(0,x.jsx)(a,{variant:`body-medium-lighter`,as:`p`,className:`mt-1 whitespace-pre-wrap break-words text-[var(--content-secondary)]`,children:e.promptSummary}),r&&t&&(0,x.jsx)(a,{variant:`body-medium-lighter`,as:`p`,className:`mt-2 whitespace-pre-wrap break-words text-[var(--content-secondary)]`,children:e.resultSummary})]})}function T({leaves:e}){let t=[...e.values()].sort((e,t)=>e.seq-t.seq);return t.length===0?(0,x.jsx)(a,{variant:`body-small-default`,className:`py-4 text-center text-[var(--content-tertiary)]`,children:`No agents yet`}):(0,x.jsx)(`div`,{className:`flex flex-col gap-2`,children:t.map(e=>(0,x.jsx)(w,{leaf:e},e.seq))})}function E({entry:e,onClose:t,onStop:r,onRequestJournal:l}){let u=m(e.status),d=e.label??e.runId,f=e.agentsSpawned||e.leaves.size,h=u?`live`:`final`;return(0,b.useEffect)(()=>{l?.(e.runId)},[e.runId,h,l]),(0,x.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-base)] px-5 py-4`,children:[(0,x.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[var(--surface-overlay)]`,children:(0,x.jsx)(v,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})}),(0,x.jsx)(a,{variant:`title-medium`,title:d,className:`min-w-0 shrink truncate text-[var(--content-default)]`,children:d}),(0,x.jsx)(S,{status:e.status}),(0,x.jsx)(`span`,{className:`flex-1`}),u&&r&&(0,x.jsx)(`button`,{type:`button`,"aria-label":`Stop workflow`,onClick:()=>r(e.runId),className:`flex shrink-0 cursor-pointer items-center gap-1.5 rounded-lg bg-[var(--system-negative-strong)] px-3 py-1.5 text-white transition-colors hover:bg-[color-mix(in_srgb,var(--system-negative-strong)_85%,black)]`,children:(0,x.jsx)(a,{variant:`label-small-default`,className:`text-white`,children:`Stop`})}),(0,x.jsx)(n,{variant:`ghost`,iconOnly:(0,x.jsx)(p,{}),onClick:t,"aria-label":`Close workflow detail`,tooltip:`Close`,className:`shrink-0`})]}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:[(0,x.jsxs)(`div`,{className:`mb-5 grid grid-cols-3 gap-3`,children:[(0,x.jsx)(c,{icon:(0,x.jsx)(y,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>o(Math.round(e)),label:`Input`}),(0,x.jsx)(c,{icon:(0,x.jsx)(s,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens,format:e=>o(Math.round(e)),label:`Output`}),(0,x.jsx)(c,{icon:(0,x.jsx)(g,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:f,format:e=>o(Math.round(e)),label:`Agents`})]}),(e.phase||e.message)&&(0,x.jsxs)(`div`,{className:`mb-5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3`,children:[e.phase&&(0,x.jsx)(a,{variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e.phase}),e.message&&(0,x.jsx)(a,{variant:`body-small-default`,as:`p`,className:i(`whitespace-pre-wrap break-words text-[var(--content-secondary)]`,e.phase&&`mt-1`),children:e.message})]}),e.summary&&(0,x.jsxs)(`div`,{className:`mb-5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3`,children:[(0,x.jsx)(a,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:`Summary`}),(0,x.jsx)(a,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:e.summary})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(a,{variant:`title-medium`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:`Agents`}),(0,x.jsx)(T,{leaves:e.leaves})]})]})]})}export{E as WorkflowDetailPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./queryOptions-BtNi-_9H.js";import{t as l}from"./menu-CdoNX1qx.js";import{a as u}from"./src-BJj2O5XB.js";import{t as d}from"./confirm-dialog-SpCsmAdG.js";import{t as f}from"./input-Ch7OC6ME.js";import{t as p}from"./modal-CHuPOsJJ.js";import{n as m,t as h}from"./panel-item-BLQE_l-g.js";import{t as g}from"./createLucideIcon-KBgJOpms.js";import{t as _}from"./chevron-right-Cc3NZhAF.js";import{t as v}from"./loader-circle-YAV9sMh_.js";import{t as y}from"./pencil-Cyrr5VNX.js";import{t as b}from"./x-b3o2p6YU.js";import{cr as x,dr as S,fr as C,lr as w,pr as T,sr as E,ur as D}from"./sdk.gen-W0KlW-sG.js";import{n as O}from"./use-is-mobile-D_0cze0t.js";import{A as k,Ai as A,Ci as j,Di as M,Dr as N,Gr as P,Mi as F,Mr as I,Ni as ee,Oi as L,Qr as R,ea as z,j as B,ki as V}from"./index-Chr1kHBM.js";import{t as H}from"./use-active-assistant-id-DOx36WGk.js";import{n as U,t as W}from"./mobile-sidebar-drawer-ChpPfZ8u.js";import{i as G,n as K,r as q,t as J}from"./file-editor-D0SuRz-y.js";import{t as Y}from"./format-file-size-Br1LCKQi.js";var te=g(`arrow-down-a-z`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),ne=g(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]),re=g(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),X=g(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Z=e(t(),1);function ie(e){if(!e)return``;let t=e.indexOf(`;`);return(t===-1?e:e.slice(0,t)).trim()}function ae(e,t){return ie(t)===`application/json`?!0:(e??``).toLowerCase().endsWith(`.json`)}function oe(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function se(e){return e.split(`/`).some(e=>e.startsWith(`.`))}var Q=s();function ce(e){return c({queryFn:async()=>{let{data:t,error:n}=await w({path:e.path,query:{path:e.query.path,...e.query.showHidden?{showHidden:`true`}:{}}});if(n)throw n;return t},queryKey:[`assistantsWorkspaceFileRetrieve`,e]})}function le({mimeType:e}){let t=e.indexOf(`;`),n=(t===-1?e:e.slice(0,t)).trim(),r=V;return n.startsWith(`image/`)?r=j:n.startsWith(`video/`)?r=N:!n.startsWith(`text/`)&&n!==`application/json`&&n!==`application/octet-stream`&&(r=L),(0,Q.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 10%, transparent)`},children:(0,Q.jsx)(r,{className:`h-3.5 w-3.5`,style:{color:`var(--content-default)`}})})}function ue({viewMode:e,onChange:t}){return(0,Q.jsx)(`div`,{className:`inline-flex rounded-md p-0.5`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 6%, transparent)`},children:[`preview`,`source`].map(r=>{let i=e===r;return(0,Q.jsx)(n,{variant:`ghost`,onClick:()=>t(r),className:`h-auto rounded border-0 px-2.5 py-1 text-body-small-default hover:bg-transparent`,style:{backgroundColor:i?`var(--surface-lift)`:`transparent`,color:i?`var(--content-default)`:`var(--content-tertiary)`,boxShadow:i?`0 1px 2px rgba(0,0,0,0.15)`:void 0},children:r===`preview`?`Preview`:`Source`},r)})})}function $({name:e,mimeType:t,size:n,rightContent:r}){return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(le,{mimeType:t}),(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),n!=null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:Y(n)})]}),r]})}function de({assistantId:e,path:t,mimeType:n,showHidden:r}){let{data:i,isLoading:o}=a({queryFn:async()=>{let n=await x({path:{assistant_id:e},query:{path:t,...r?{showHidden:`true`}:{}},parseAs:`blob`});if(n.error)throw n.error;return n.data},queryKey:[`assistantsWorkspaceFileContentRetrieve`,{assistantId:e,path:t,showHidden:r}],enabled:!!t}),[s,c]=(0,Z.useState)(null);return(0,Z.useEffect)(()=>{if(!i)return;let e=URL.createObjectURL(i);return c(e),()=>{URL.revokeObjectURL(e),c(null)}},[i]),o?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Q.jsx)(v,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):s?n.startsWith(`image/`)?(0,Q.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Q.jsx)(`img`,{src:s,alt:t.split(`/`).pop()??`image`,className:`max-h-[70vh] max-w-full rounded object-contain`})}):n.startsWith(`video/`)?(0,Q.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Q.jsx)(`video`,{src:s,controls:!0,className:`max-h-[70vh] max-w-full rounded`})}):null:null}function fe({assistantId:e,selectedPath:t,showHidden:r,viewMode:s,onChangeViewMode:c,onBrowse:l,pathRename:u,pathDelete:d}){let f=i(),{data:p,isLoading:m}=a({...ce({path:{assistant_id:e},query:{path:t??``,showHidden:r}}),enabled:!!t}),[h,g]=(0,Z.useState)(null),[_,y]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{if(!u)return;let{from:e,to:t}=u,n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;g(e=>e==null?e:n(e)),y(e=>e==null?e:{...e,path:n(e.path)})},[u]),(0,Z.useEffect)(()=>{if(!d)return;let{path:e}=d,t=t=>t===e||t.startsWith(`${e}/`);g(e=>e!=null&&t(e)?null:e),y(e=>e!=null&&t(e.path)?null:e)},[d]);let b=h!=null&&h===t,x=p?.content??``,S=_?.path===t?_.content:x,C=()=>{g(null),y(null)},w=o({mutationFn:async({path:t,content:n})=>{let{error:r,response:i}=await T({path:{assistant_id:e},body:{path:t,content:n,encoding:`utf8`},throwOnError:!1});if(!i?.ok||r)throw Error(`Failed to save file`)},onSuccess:(e,t)=>{g(e=>e===t.path?null:e),y(e=>e?.path===t.path?null:e),f.invalidateQueries({queryKey:[`assistantsWorkspaceFileRetrieve`]})}}),E=S!==x,D=(0,Z.useCallback)(()=>{t&&E&&!w.isPending&&w.mutate({path:t,content:S})},[t,E,w,S]);if(!t)return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view`}),l&&(0,Q.jsx)(n,{type:`button`,onClick:l,leftIcon:(0,Q.jsx)(re,{"aria-hidden":!0}),className:`sm:hidden`,children:`Browse files`})]});if(m)return(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(v,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})});if(!p)return(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`File not found`})});let O=p.mimeType??`application/octet-stream`,A=p.name??t.split(`/`).pop()??t,j=B(A,O),M=ae(A,O),N=p.content!=null&&!j&&!M,P=t?se(t):!0,F=b&&(0,Q.jsx)(K,{isDirty:E,isSaving:w.isPending,error:w.isError?`Save failed`:null,onSave:D,onDiscard:C});if(j&&p.content!=null){let e=b?S:p.content;return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:A,mimeType:O,rightContent:(0,Q.jsx)(ue,{viewMode:s,onChange:e=>{b&&C(),c(e)}})}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(J,{content:e,fileName:A,mimeType:O,showEdit:!P&&s===`source`,isEditing:b,onToggleEdit:()=>b?C():g(t)}),s===`preview`?(0,Q.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Q.jsx)(k,{content:e})}):b?(0,Q.jsx)(q,{value:S,onChange:e=>y({path:t,content:e}),onSave:D}):(0,Q.jsx)(G,{content:p.content,readOnly:P,onStartEdit:()=>g(t)})]}),F]})}if(M&&p.content!=null){let e=b?S:p.content,n=oe(e);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:A,mimeType:O,rightContent:(0,Q.jsx)(ue,{viewMode:s,onChange:e=>{b&&C(),c(e)}})}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(J,{content:s===`preview`?n:e,downloadContent:e,fileName:A,mimeType:O,showEdit:!P&&s===`source`,isEditing:b,onToggleEdit:()=>b?C():g(t)}),s===`preview`?(0,Q.jsx)(G,{content:n,readOnly:!0,whiteSpace:`pre`}):b?(0,Q.jsx)(q,{value:S,onChange:e=>y({path:t,content:e}),onSave:D}):(0,Q.jsx)(G,{content:p.content,readOnly:P,onStartEdit:()=>g(t)})]}),F]})}return N?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:A,mimeType:O,size:p.size}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(J,{content:b?S:p.content??``,fileName:A,mimeType:O,showEdit:!P,isEditing:b,onToggleEdit:()=>b?C():g(t)}),b?(0,Q.jsx)(q,{value:S,onChange:e=>y({path:t,content:e}),onSave:D}):(0,Q.jsx)(G,{content:p.content??``,readOnly:P,onStartEdit:()=>g(t)})]}),F]}):O.startsWith(`image/`)||O.startsWith(`video/`)?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:A,mimeType:O,size:p.size}),(0,Q.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,Q.jsx)(de,{assistantId:e,path:t,mimeType:O,showHidden:r})})]}):(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:A,mimeType:O,size:p.size}),(0,Q.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,Q.jsxs)(`div`,{className:`w-full max-w-sm rounded-lg border p-6 text-center`,style:{borderColor:`var(--border-base)`,backgroundColor:`var(--surface-lift)`},children:[(0,Q.jsx)(L,{className:`mx-auto h-10 w-10`,style:{color:`var(--content-tertiary)`}}),(0,Q.jsx)(`p`,{className:`mt-3 text-body-medium-default`,style:{color:`var(--content-default)`},children:A}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:O}),(0,Q.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:Y(p.size,`Unknown size`)}),p.modifiedAt&&(0,Q.jsxs)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:[`Modified: `,new Date(p.modifiedAt).toLocaleString()]})]})]})})]})}function pe(e,t){if(t===`name`)return e;let n=e.slice();return n.sort((e,t)=>{let n=e.size??null,r=t.size??null;return n===null&&r===null?(e.name??``).localeCompare(t.name??``):n===null?1:r===null?-1:n===r?(e.name??``).localeCompare(t.name??``):r-n}),n}function me(e){return c({queryFn:async()=>{let t={};e.query?.path&&(t.path=e.query.path),e.query?.showHidden&&(t.showHidden=`true`),e.query?.includeDirSizes&&(t.includeDirSizes=`true`);let{data:n,error:r}=await C({path:e.path,query:t});if(r)throw r;if(!n)throw Error(`Failed to load workspace tree`);return n},queryKey:[`assistantsWorkspaceTreeRetrieve`,e]})}async function he(e,t,n,r){let i=n.toLowerCase(),a=r?.toLowerCase(),{data:o}=await C({path:{assistant_id:e},query:t?{path:t}:{}});if(o?.entries?.some(e=>{let t=(e.name??``).toLowerCase();return t===i&&t!==a}))throw Error(`"${n}" already exists here.`)}function ge({entry:e}){return e.type===`directory`?(0,Q.jsx)(M,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`image/`)?(0,Q.jsx)(j,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`video/`)?(0,Q.jsx)(N,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(V,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}})}function _e({entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:d,onRequestRename:f,onRequestCreate:p,depth:m}){let h=e.path??``,g=e.name??``,v=e.type===`directory`,b=n.has(h),x=r===h,S=g.startsWith(`.`),C=!se(h),w=v&&(b||s.length>0),{data:T}=a({...me({path:{assistant_id:t},query:{path:h,showHidden:i,includeDirSizes:o===`size`}}),enabled:v&&w}),E=(0,Z.useMemo)(()=>pe(T?.entries??[],o),[T?.entries,o]),D=s===``||g.toLowerCase().includes(s);if(s!==``&&!v&&!D)return null;let O=(0,Q.jsxs)(`button`,{onClick:()=>{v?c(h):l(h)},className:`flex w-full items-center gap-1.5 px-2 py-1 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{paddingLeft:`${m*14+8}px`,paddingRight:`8px`,color:x?`var(--content-default)`:S?`var(--content-tertiary)`:`var(--content-default)`,backgroundColor:x?`color-mix(in oklab, var(--primary-base) 12%, transparent)`:void 0,opacity:S&&!x?.7:1},children:[v?w?(0,Q.jsx)(z,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(_,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(`span`,{className:`h-3 w-3 shrink-0`}),(0,Q.jsx)(ge,{entry:e}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:g}),e.size!=null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-label-medium-default tabular-nums`,style:{color:`var(--content-tertiary)`},children:Y(e.size)})]});return(0,Q.jsxs)(`div`,{children:[C?(0,Q.jsxs)(u.Root,{children:[(0,Q.jsx)(u.Trigger,{children:O}),(0,Q.jsxs)(u.Content,{children:[v&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(u.Item,{leftIcon:(0,Q.jsx)(A,{className:`h-3.5 w-3.5`}),onSelect:()=>p({kind:`file`,parentPath:h}),children:`New File`}),(0,Q.jsx)(u.Item,{leftIcon:(0,Q.jsx)(X,{className:`h-3.5 w-3.5`}),onSelect:()=>p({kind:`folder`,parentPath:h}),children:`New Folder`}),(0,Q.jsx)(u.Separator,{})]}),(0,Q.jsx)(u.Item,{leftIcon:(0,Q.jsx)(I,{className:`h-3.5 w-3.5`}),onSelect:()=>d({path:h,name:g,isDirectory:v}),children:`Delete`}),(0,Q.jsx)(u.Item,{leftIcon:(0,Q.jsx)(y,{className:`h-3.5 w-3.5`}),onSelect:()=>f({path:h,name:g,isDirectory:v}),children:`Rename`})]})]}):O,v&&w&&E.length>0&&(0,Q.jsx)(`div`,{children:E.map(e=>(0,Q.jsx)(_e,{entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:d,onRequestRename:f,onRequestCreate:p,depth:m+1},e.path))})]})}function ve({title:e,placeholder:t,confirmLabel:r,pendingLabel:i,initialName:a,onCancel:o,onConfirm:s,pending:c,error:l}){let u=(0,Z.useRef)(null),[d,m]=(0,Z.useState)(a??``),h=d.trim(),g=h.length>0&&(/[/\\]/.test(h)||h===`.`||h===`..`),_=h.length>0&&!g&&!c;return(0,Q.jsx)(p.Root,{open:!0,onOpenChange:e=>{!e&&!c&&o()},children:(0,Q.jsx)(p.Content,{size:`sm`,hideCloseButton:!0,"aria-describedby":void 0,onOpenAutoFocus:e=>{e.preventDefault();let t=u.current;t&&(t.focus(),requestAnimationFrame(()=>{t.setSelectionRange(0,t.value.length)}))},onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),c||o()},children:(0,Q.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),_&&s(h)},children:[(0,Q.jsx)(p.Header,{children:(0,Q.jsx)(p.Title,{children:e})}),(0,Q.jsx)(p.Body,{children:(0,Q.jsx)(f,{ref:u,label:`Name`,value:d,onChange:e=>m(e.target.value),placeholder:t,errorText:l??(g?`Enter a single file or folder name without slashes.`:void 0),autoComplete:`off`,spellCheck:!1,fullWidth:!0})}),(0,Q.jsxs)(p.Footer,{children:[(0,Q.jsx)(n,{type:`button`,variant:`outlined`,onClick:o,disabled:c,children:`Cancel`}),(0,Q.jsx)(n,{type:`submit`,variant:`primary`,disabled:!_,children:c?i:r})]})]})})})}function ye({assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,onToggleExpand:l,onExpandPath:u,onSelectPath:p,onToggleShowHidden:m,onChangeSortMode:h,onPathDeleted:g,onPathRenamed:_}){let v=i(),[y,x]=(0,Z.useState)(``),C=y.trim().toLowerCase(),[w,O]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(null),[j,M]=(0,Z.useState)(null),N=(0,Z.useCallback)(()=>{A(null),M(null)},[]),{data:I,isLoading:L}=a(me({path:{assistant_id:e},query:{showHidden:s,includeDirSizes:c===`size`}})),R=(0,Z.useMemo)(()=>pe(I?.entries??[],c),[I?.entries,c]),z=(0,Z.useCallback)(()=>{for(let e of[`assistantsWorkspaceTreeRetrieve`,`assistantsWorkspaceFileRetrieve`,`assistantsWorkspaceFileContentRetrieve`])v.invalidateQueries({queryKey:[e]})},[v]),B=o({mutationFn:async t=>{let n=t.parentPath?`${t.parentPath}/${t.name}`:t.name;await he(e,t.parentPath,t.name);let{error:r,response:i}=t.kind===`file`?await T({path:{assistant_id:e},body:{path:n,content:``,encoding:`utf8`},throwOnError:!1}):await D({path:{assistant_id:e},body:{path:n},throwOnError:!1});if(r||!i?.ok)throw Error(typeof r==`string`?r:`Failed to create — check the name and try again.`);return{...t,path:n}},onSuccess:e=>{N(),z(),e.parentPath&&u(e.parentPath),e.kind===`file`?p(e.path):u(e.path)},onError:e=>{M(e instanceof Error?e.message:`Failed to create.`)}}),V=o({mutationFn:async t=>{let n=t.oldPath.lastIndexOf(`/`),r=n===-1?``:t.oldPath.slice(0,n),i=t.oldPath.slice(n+1),a=r?`${r}/${t.newName}`:t.newName;await he(e,r,t.newName,i);let{error:o,response:s}=await S({path:{assistant_id:e},body:{oldPath:t.oldPath,newPath:a},throwOnError:!1});if(o||!s?.ok)throw Error(typeof o==`string`?o:`Failed to rename — check the name and try again.`);return{oldPath:t.oldPath,newPath:a}},onSuccess:({oldPath:e,newPath:t})=>{N(),z(),_(e,t)},onError:e=>{M(e instanceof Error?e.message:`Failed to rename.`)}}),H=(0,Z.useCallback)(e=>{M(null),A({type:`create`,...e})},[]),U=(0,Z.useCallback)(e=>{M(null),A({type:`rename`,path:e.path,name:e.name})},[]),[W,G]=(0,Z.useState)(null),K=o({mutationFn:async t=>{let{error:n,response:r}=await E({path:{assistant_id:e},body:{path:t.path},throwOnError:!1});if(n||!r?.ok)throw Error(typeof n==`string`?n:`Failed to delete — try again.`);return t},onSuccess:e=>{G(null),z(),g(e.path)}}),q=(0,Z.useCallback)(e=>{K.reset(),G(e)},[K]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:`Files`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:c===`size`?(0,Q.jsx)(ne,{"aria-hidden":!0}):(0,Q.jsx)(te,{"aria-hidden":!0}),onClick:()=>h(c===`size`?`name`:`size`),"aria-label":c===`size`?`Sort by name`:`Sort by size`,title:c===`size`?`Sorted by size — switch to name`:`Sorted by name — switch to size`,tintColor:c===`size`?`var(--content-default)`:`var(--content-tertiary)`}),(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:s?(0,Q.jsx)(F,{"aria-hidden":!0}):(0,Q.jsx)(ee,{"aria-hidden":!0}),onClick:m,"aria-label":s?`Hide hidden files`:`Show hidden files`,title:s?`Hide hidden files`:`Show hidden files`,tintColor:s?`var(--content-default)`:`var(--content-tertiary)`}),(0,Q.jsx)(be,{open:w,onOpenChange:O,onSelectKind:e=>{O(!1),H({kind:e,parentPath:``})}})]})]}),(0,Q.jsx)(`div`,{className:`px-3 py-2`,children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(f,{type:`text`,value:y,onChange:e=>x(e.target.value),placeholder:`Search files`,leftIcon:(0,Q.jsx)(P,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),fullWidth:!0,spellCheck:!1,autoComplete:`off`}),y&&(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(b,{"aria-hidden":!0}),onClick:()=>x(``),"aria-label":`Clear search`,className:`absolute right-1.5 top-1/2 -translate-y-1/2`,tintColor:`var(--content-tertiary)`})]})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-1`,children:L?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Q.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`,style:{color:`var(--content-tertiary)`}})}):R.length?R.map(n=>(0,Q.jsx)(_e,{entry:n,assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,searchLower:C,onToggleExpand:l,onSelectPath:p,onRequestDelete:q,onRequestRename:U,onRequestCreate:H,depth:0},n.path)):(0,Q.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files found`})}),k?.type===`create`&&(0,Q.jsx)(ve,{title:k.kind===`file`?`New File`:`New Folder`,placeholder:k.kind===`file`?`filename.md`:`folder-name`,confirmLabel:`Create`,pendingLabel:`Creating…`,onCancel:N,onConfirm:e=>{M(null),B.mutate({kind:k.kind,parentPath:k.parentPath,name:e})},pending:B.isPending,error:j},`create-${k.kind}-${k.parentPath}`),k?.type===`rename`&&(0,Q.jsx)(ve,{title:`Rename`,placeholder:k.name,confirmLabel:`Rename`,pendingLabel:`Renaming…`,initialName:k.name,onCancel:N,onConfirm:e=>{if(e===k.name){N();return}M(null),V.mutate({oldPath:k.path,newName:e})},pending:V.isPending,error:j},`rename-${k.path}`),(0,Q.jsx)(d,{open:W!==null,title:W?.isDirectory?`Delete Folder`:`Delete File`,message:(0,Q.jsxs)(Q.Fragment,{children:[`Are you sure you want to delete`,` `,(0,Q.jsx)(`span`,{style:{color:`var(--content-default)`},children:W?.name}),W?.isDirectory?` and all of its contents`:``,`? This cannot be undone.`,K.error&&(0,Q.jsx)(`span`,{className:`mt-2 block`,style:{color:`var(--system-negative-strong)`},children:K.error.message})]}),confirmLabel:K.isPending?`Deleting…`:`Delete`,destructive:!0,isPending:K.isPending,onConfirm:()=>{W&&K.mutate(W)},onCancel:()=>G(null)})]})}function be({open:e,onOpenChange:t,onSelectKind:r}){return O()?(0,Q.jsxs)(m.Root,{open:e,onOpenChange:t,children:[(0,Q.jsx)(m.Trigger,{asChild:!0,children:(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(R,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Q.jsxs)(m.Content,{children:[(0,Q.jsx)(m.Header,{className:`sr-only`,children:(0,Q.jsx)(m.Title,{children:`Create new`})}),(0,Q.jsxs)(m.Body,{className:`pt-0`,children:[(0,Q.jsx)(h,{icon:A,label:`New File`,onSelect:()=>r(`file`)}),(0,Q.jsx)(h,{icon:X,label:`New Folder`,onSelect:()=>r(`folder`)})]})]})]}):(0,Q.jsxs)(l.Root,{open:e,onOpenChange:t,children:[(0,Q.jsx)(l.Trigger,{asChild:!0,children:(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(R,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Q.jsxs)(l.Content,{align:`end`,sideOffset:4,children:[(0,Q.jsx)(l.Item,{leftIcon:(0,Q.jsx)(A,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`file`),children:`New File`}),(0,Q.jsx)(l.Item,{leftIcon:(0,Q.jsx)(X,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`folder`),children:`New Folder`})]})]})}function xe(e){let t=e.split(`/`),n=new Set;for(let e=1;e<t.length;e++)n.add(t.slice(0,e).join(`/`));return n}function Se({assistantId:e}){let[t,n]=r(),[i,a]=(0,Z.useState)(()=>{let e=t.get(`file`);return e?xe(e):new Set}),[o,s]=(0,Z.useState)(()=>t.get(`file`)),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(()=>t.get(`sort`)===`size`?`size`:`name`),[f,p]=(0,Z.useState)(`preview`);(0,Z.useEffect)(()=>{t.get(`file`)&&n(e=>{let t=new URLSearchParams(e);return t.delete(`file`),t},{replace:!0})},[]);let m=(0,Z.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),h=(0,Z.useCallback)(e=>{a(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),[g,_]=(0,Z.useState)(!1),v=(0,Z.useCallback)(e=>{s(e),_(!1)},[]),[y,b]=(0,Z.useState)(null),x=(0,Z.useCallback)(e=>{let t=t=>t===e||t.startsWith(`${e}/`);s(e=>e!==null&&t(e)?null:e),a(e=>{let n=new Set([...e].filter(e=>!t(e)));return n.size===e.size?e:n}),b({path:e})},[]),[S,C]=(0,Z.useState)(null),w={assistantId:e,expandedPaths:i,selectedPath:o,showHidden:c,sortMode:u,onToggleExpand:m,onExpandPath:h,onSelectPath:v,onToggleShowHidden:()=>l(e=>!e),onChangeSortMode:d,onPathDeleted:x,onPathRenamed:(0,Z.useCallback)((e,t)=>{let n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;s(e=>e===null?e:n(e)),a(e=>{let t=!1,r=new Set;for(let i of e){let e=n(i);e!==i&&(t=!0),r.add(e)}return t?r:e}),C({from:e,to:t})},[])};return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4`,children:[(0,Q.jsx)(`div`,{className:`flex items-center sm:hidden`,children:(0,Q.jsx)(U,{onClick:()=>_(!0)})}),(0,Q.jsx)(W,{open:g,onClose:()=>_(!1),title:`Files`,children:(0,Q.jsx)(ye,{...w})}),(0,Q.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-4 sm:grid-cols-[320px_1fr]`,children:[(0,Q.jsx)(`div`,{className:`hidden min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border sm:flex`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Q.jsx)(ye,{...w})}),(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Q.jsx)(fe,{assistantId:e,selectedPath:o,showHidden:c,viewMode:f,onChangeViewMode:p,onBrowse:()=>_(!0),pathRename:S,pathDelete:y})})]})]})}function Ce(){return(0,Q.jsx)(Se,{assistantId:H()})}export{Ce as WorkspacePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-KBgJOpms.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|