decocms 4.623.0 → 4.624.0
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/client/assets/AlertCircle-DAmgHcYM.js +1 -0
- package/dist/client/assets/AreaChart-Zb_o-3jS.js +1 -0
- package/dist/client/assets/ArrowLeft-Bbut1_6L.js +1 -0
- package/dist/client/assets/ArrowRight-DHvOiwfA.js +1 -0
- package/dist/client/assets/ArrowUp-DJ1ux-eS.js +1 -0
- package/dist/client/assets/BookOpen01-U3uHUYGF.js +1 -0
- package/dist/client/assets/CartesianChart-k6PpsBpW.js +1 -0
- package/dist/client/assets/CategoricalChart-BU8Fb7a3.js +33 -0
- package/dist/client/assets/CheckCircle-7nGNgqon.js +1 -0
- package/dist/client/assets/ChevronDown-f6WxX6x1.js +1 -0
- package/dist/client/assets/ChevronSelectorVertical-CVnifV0z.js +1 -0
- package/dist/client/assets/ChevronUp-DkybI6eL.js +1 -0
- package/dist/client/assets/Copy01-DrKR8sjM.js +1 -0
- package/dist/client/assets/CreditCard01-BAE1bmF_.js +1 -0
- package/dist/client/assets/Eye-Bpx-aqm8.js +1 -0
- package/dist/client/assets/File02-CSQcpToj.js +1 -0
- package/dist/client/assets/Fingerprint04-ncIq4l25.js +1 -0
- package/dist/client/assets/Flag01-FB03TgKM.js +1 -0
- package/dist/client/assets/FolderCode-DaLny9ho.js +1 -0
- package/dist/client/assets/Globe04-Dt-y-J0j.js +1 -0
- package/dist/client/assets/Image01-C49Ygyvj.js +1 -0
- package/dist/client/assets/Key01-D23nc6jA.js +1 -0
- package/dist/client/assets/LayoutLeft-Dj-Gsb5o.js +1 -0
- package/dist/client/assets/Link03-DZKIevw2.js +1 -0
- package/dist/client/assets/LinkBroken01-BancIi59.js +1 -0
- package/dist/client/assets/Mail01-DvvtND2n.js +1 -0
- package/dist/client/assets/Minus-x2wTDpn8.js +1 -0
- package/dist/client/assets/Monitor01-CdQn6XG4.js +1 -0
- package/dist/client/assets/Play-CcNV29Kf.js +1 -0
- package/dist/client/assets/Plus-DS1puo6u.js +1 -0
- package/dist/client/assets/ReferenceLine-DhBx4eu_.js +1 -0
- package/dist/client/assets/SearchMd-BIoAkvcK.js +1 -0
- package/dist/client/assets/Share07-CF-dE0sB.js +1 -0
- package/dist/client/assets/ShoppingBag01-x22D29sZ.js +1 -0
- package/dist/client/assets/Sun-BEwk2SAZ.js +1 -0
- package/dist/client/assets/SwitchHorizontal01-gBbNjlPD.js +1 -0
- package/dist/client/assets/Tool01-DPrffk9i.js +1 -0
- package/dist/client/assets/Tooltip-DyjbQM-Z.js +1 -0
- package/dist/client/assets/Trash01-Cb6JzMA_.js +1 -0
- package/dist/client/assets/Upload01-BESnk1vB.js +1 -0
- package/dist/client/assets/UserCheck01-CQDmVD20.js +1 -0
- package/dist/client/assets/UserSquare-CY8RzqIc.js +1 -0
- package/dist/client/assets/Users01-0aYTa02A.js +1 -0
- package/dist/client/assets/XClose-Cwm3E7iC.js +1 -0
- package/dist/client/assets/Zap-DXVSe_sk.js +1 -0
- package/dist/client/assets/access-gate-BjXrbCKh.js +1 -0
- package/dist/client/assets/add-connection-dialog-iAo_WdZK.js +1 -0
- package/dist/client/assets/agent-app-ZUaXj7Oq.js +1 -0
- package/dist/client/assets/agent-assets-BNeIM3h4.js +1 -0
- package/dist/client/assets/agent-automation-C7dLd_nh.js +20 -0
- package/dist/client/assets/agent-automations-1Rumtw8X.js +1 -0
- package/dist/client/assets/agent-blog-DMFqZAWM.js +2 -0
- package/dist/client/assets/agent-blog-post-CRN3pI96.js +2 -0
- package/dist/client/assets/agent-business-case-VspgJ---.js +1 -0
- package/dist/client/assets/agent-calendar-BJDAPnSz.js +1 -0
- package/dist/client/assets/agent-capabilities-yiKlbudK.js +1 -0
- package/dist/client/assets/agent-connect-sources-Ci5h91vT.js +1 -0
- package/dist/client/assets/agent-deck-BEtSHNIt.js +1 -0
- package/dist/client/assets/agent-e2e-Cqp-bqTQ.js +1 -0
- package/dist/client/assets/agent-experiments-L7GiSnl2.js +1 -0
- package/dist/client/assets/agent-file-D-7AddjO.js +1 -0
- package/dist/client/assets/agent-hosting-CfYuj9Ju.js +1 -0
- package/dist/client/assets/agent-icon-BXpAi9QB.js +1 -0
- package/dist/client/assets/agent-library-IdVviqql.js +1 -0
- package/dist/client/assets/agent-library-file-65M-JnFF.js +1 -0
- package/dist/client/assets/agent-overview-BhvSLM4N.js +1 -0
- package/dist/client/assets/agent-releases-D9ltHkbO.js +3 -0
- package/dist/client/assets/agent-settings-Do1M_wOd.js +1 -0
- package/dist/client/assets/agent-site-editor-BrkUwJSm.js +16 -0
- package/dist/client/assets/agent-site-editor-code-Ba3LkRbS.js +2 -0
- package/dist/client/assets/agent-site-editor-content-DscsXXwe.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-uDyUnox_.js +1 -0
- package/dist/client/assets/agent-view-DQM9whve.js +1 -0
- package/dist/client/assets/agent-view-guard-C7MzPTZp.js +1 -0
- package/dist/client/assets/ai-providers-C9mlevsU.js +1 -0
- package/dist/client/assets/alert-BYMQChL0.js +1 -0
- package/dist/client/assets/analytics-sections-DExmEfI_.js +1 -0
- package/dist/client/assets/api-keys-6sD9So_o.js +1 -0
- package/dist/client/assets/api-keys-DGMWdj2Q.js +1 -0
- package/dist/client/assets/app-editor-DsU9syma.js +1 -0
- package/dist/client/assets/asset-utils-D8B06UuO.js +1 -0
- package/dist/client/assets/auth-BWDMMgyS.js +1 -0
- package/dist/client/assets/auth-catchall-yPqlB-ZK.js +1 -0
- package/dist/client/assets/auth-entry-B-pS4bFm.js +1 -0
- package/dist/client/assets/auth-split-layout-MKszk56I.js +1 -0
- package/dist/client/assets/authenticate-and-persist-oauth-DTCu38Oy.js +1 -0
- package/dist/client/assets/automation-list-row-BdbWu2m-.js +1 -0
- package/dist/client/assets/automation-runs-B-ISpML5.js +1 -0
- package/dist/client/assets/automations-C4REVPb-.js +1 -0
- package/dist/client/assets/badge-VkLFh9uU.js +1 -0
- package/dist/client/assets/block-document-DuKHMzXU.js +3 -0
- package/dist/client/assets/blocks-preview-workspace-context-PEOIMtOs.js +1 -0
- package/dist/client/assets/blocks-tab-states-BwA_PwyL.js +1 -0
- package/dist/client/assets/blog-preview-url-t6J3IRzH.js +1 -0
- package/dist/client/assets/blog-schema-DMMAI7E-.js +1 -0
- package/dist/client/assets/blog-source-gate-_EuRSpud.js +1 -0
- package/dist/client/assets/blog-view-gate-UshUFt-x.js +1 -0
- package/dist/client/assets/buckets-D-cbXDwA.js +1 -0
- package/dist/client/assets/build-improve-prompt-doc-TFEiN_GI.js +2 -0
- package/dist/client/assets/calendar-DXB71uja.js +1 -0
- package/dist/client/assets/capability-load-error-DyrYNOx6.js +1 -0
- package/dist/client/assets/category-editor-BCqqd3pb.js +1 -0
- package/dist/client/assets/category-tree-D81V-g_V.js +18 -0
- package/dist/client/assets/chart-B27c4FIK.js +13 -0
- package/dist/client/assets/chat-context-gA7Mp2aY.js +43 -0
- package/dist/client/assets/chat-draft-DDJmHgit.js +1 -0
- package/dist/client/assets/checkbox-Dc86QqpH.js +1 -0
- package/dist/client/assets/choose-editor-KttnM-LF.js +1 -0
- package/dist/client/assets/cli-auth-success-CHa5Jfb6.js +1 -0
- package/dist/client/assets/cms-settings-editor-Cukrix2m.js +1 -0
- package/dist/client/assets/cms-store-drafts-C8FiOmEN.js +1 -0
- package/dist/client/assets/collapsible-CYHAGyxT.js +1 -0
- package/dist/client/assets/collection-detail-DtrBe8dd.js +1 -0
- package/dist/client/assets/collection-display-button-1flBRjpw.js +1 -0
- package/dist/client/assets/collection-search-BUjvaoKu.js +1 -0
- package/dist/client/assets/collection-table-wrapper-CHxBDquy.js +1 -0
- package/dist/client/assets/collection-tabs-CT87r-iN.js +1 -0
- package/dist/client/assets/combobox-447bRpiG.js +1 -0
- package/dist/client/assets/command-CNg33dyG.js +1 -0
- package/dist/client/assets/companion-mcps-section-B19DPYG2.js +1 -0
- package/dist/client/assets/config-aHGo1hUH.js +1 -0
- package/dist/client/assets/connect-DursMHb9.js +9 -0
- package/dist/client/assets/connect-key-B_Ned0t7.js +1 -0
- package/dist/client/assets/connect-layout-B3PKEP1R.js +1 -0
- package/dist/client/assets/connect-source-dialog-Db6YHl0P.js +1 -0
- package/dist/client/assets/connection-BxGs7aqW.js +1 -0
- package/dist/client/assets/connection-card-DYl_eqRh.js +1 -0
- package/dist/client/assets/connection-detail-CKey7mCJ.js +1 -0
- package/dist/client/assets/connection-form-helpers-06UjzOv7.js +1 -0
- package/dist/client/assets/connection-slug-BE_uCbgb.js +1 -0
- package/dist/client/assets/connections-CmgKVHAN.js +1 -0
- package/dist/client/assets/content-changes-CvXUL4aB.js +1 -0
- package/dist/client/assets/content-tab-C9eBGnmJ.js +19 -0
- package/dist/client/assets/context-BnHP1ofM.js +1 -0
- package/dist/client/assets/context-menu-CaMiRZ1m.js +1 -0
- package/dist/client/assets/context-shell-BULVj6cb.js +37 -0
- package/dist/client/assets/create-organization-dialog-7S7HpWc5.js +1 -0
- package/dist/client/assets/daily-pulse-D-DC7UQM.js +1 -0
- package/dist/client/assets/device-hint-CI3SVi9_.js +1 -0
- package/dist/client/assets/discover-KT_ojyrp.js +1 -0
- package/dist/client/assets/domain-settings-B3IOi3Em.js +1 -0
- package/dist/client/assets/drawer-CyTq59gq.js +1 -0
- package/dist/client/assets/editor-C1Nd0ihX.js +11 -0
- package/dist/client/assets/editor-classes-CJi931Qk.js +1 -0
- package/dist/client/assets/empty-state-Cso9EJYJ.js +1 -0
- package/dist/client/assets/empty-state-DWM-SIwD.js +1 -0
- package/dist/client/assets/experiments-tab-choice-B6xZIkwj.js +1 -0
- package/dist/client/assets/extract-connection-data-HHGoL7v0.js +1 -0
- package/dist/client/assets/feature-gate-BFEQgaYr.js +1 -0
- package/dist/client/assets/feature-paywall-CcBzTlw-.js +1 -0
- package/dist/client/assets/file-explorer-D4e3fuYD.js +2 -0
- package/dist/client/assets/file-preview-jjQ_knLw.js +1 -0
- package/dist/client/assets/file-share-button-BeV8YiDQ.js +3 -0
- package/dist/client/assets/file-type-icon-CWhDd3lR.js +1 -0
- package/dist/client/assets/folder-icon-C3AHJ4ic.js +1 -0
- package/dist/client/assets/form-C7SDM654.js +1 -0
- package/dist/client/assets/frame-navigation-DSKuR-Eb.js +1 -0
- package/dist/client/assets/gateway-client-CLYJzik4.js +1 -0
- package/dist/client/assets/general-BPH8GuIw.js +1 -0
- package/dist/client/assets/github-icon-O8WpQchu.js +1 -0
- package/dist/client/assets/held-block-view-DdkPiyr8.js +3 -0
- package/dist/client/assets/home-CvBgXUY8.js +1 -0
- package/dist/client/assets/home-overview-dRwa__Bn.js +1 -0
- package/dist/client/assets/hosted-reconcile-7SkSTCNW.js +1 -0
- package/dist/client/assets/icon-button-BEBpG4-J.js +1 -0
- package/dist/client/assets/index-2jpFce2t.js +26 -0
- package/dist/client/assets/index-5u_fltR0.js +1 -0
- package/dist/client/assets/index-B-kbhjr1.js +1 -0
- package/dist/client/assets/index-BAn0Dxl-.js +1 -0
- package/dist/client/assets/index-BL-4uLgf.js +1 -0
- package/dist/client/assets/index-Bk1YKF6U.js +5 -0
- package/dist/client/assets/index-CRvCXFgN.js +1 -0
- package/dist/client/assets/index-CVF-xO05.js +1 -0
- package/dist/client/assets/index-DJioilyu.js +69 -0
- package/dist/client/assets/index-DQpSZHsz.js +15 -0
- package/dist/client/assets/index-DSQaXvEa.js +4 -0
- package/dist/client/assets/index-DZhxpcQR.js +1 -0
- package/dist/client/assets/index-DZxZfm-X.js +1 -0
- package/dist/client/assets/index-HxsXxu8x.js +1 -0
- package/dist/client/assets/index-S-ZR1ral.js +1 -0
- package/dist/client/assets/index-_MevbWo3.js +273 -0
- package/dist/client/assets/index-a0TE3OE9.js +1 -0
- package/dist/client/assets/index-redirect-BzUYfFe2.js +1 -0
- package/dist/client/assets/index-vRQGSRXS.js +4 -0
- package/dist/client/assets/infiniteQueryObserver-DLpfoYPn.js +1 -0
- package/dist/client/assets/infra-billing-C2d5692H.js +1 -0
- package/dist/client/assets/input-BNGPrLf9.js +17 -0
- package/dist/client/assets/input-x8g_UkAo.js +1 -0
- package/dist/client/assets/integration-icon-DFEgj5JK.js +1 -0
- package/dist/client/assets/invite-link-BcnAjmuz.js +1 -0
- package/dist/client/assets/invite-link-panel-BpKU2cCG.js +1 -0
- package/dist/client/assets/item-actions-Dsiia1W0.js +1 -0
- package/dist/client/assets/jira-icon-xBJiziRT.js +1 -0
- package/dist/client/assets/label-DqQGvxA6.js +1 -0
- package/dist/client/assets/layout-Cex5QszX.js +1 -0
- package/dist/client/assets/legacy-admin-welcome-dialog-DwZ0pxGr.js +1 -0
- package/dist/client/assets/legacy-agents-deep-CODSew_k.js +1 -0
- package/dist/client/assets/legacy-content-Dfb3F6Q5.js +4 -0
- package/dist/client/assets/legacy-main-redirect-BtxNoZ36.js +1 -0
- package/dist/client/assets/library-D7Hesuxm.js +1 -0
- package/dist/client/assets/library-tab-CKkNos-P.js +162 -0
- package/dist/client/assets/login-vtztPXCC.js +1 -0
- package/dist/client/assets/markdown-64lcMXAT.js +93 -0
- package/dist/client/assets/mcp-app-renderer-D6jzjosA.js +11 -0
- package/dist/client/assets/mcp-oauth-C0DUuWsy.js +1 -0
- package/dist/client/assets/mcp-oauth-DrKBDwlq.js +1 -0
- package/dist/client/assets/members-BIVMNMC5.js +1 -0
- package/dist/client/assets/memory-CgcSIpzd.js +7 -0
- package/dist/client/assets/mock-board-DZ0FOMdN.js +10 -0
- package/dist/client/assets/monaco-editor-D1YQEVsN.js +9 -0
- package/dist/client/assets/monitoring-CjkH7I7W.js +2 -0
- package/dist/client/assets/monitoring-stats-row-DsHvOwJp.js +1 -0
- package/dist/client/assets/multi-select-Dqp27USG.js +1 -0
- package/dist/client/assets/mustache-BfZcB6pV.js +4 -0
- package/dist/client/assets/named-rule-step-wUboGfQx.js +1 -0
- package/dist/client/assets/named-rule-view-BM8XtQUT.js +1 -0
- package/dist/client/assets/new-project-dialog-JwJv_W-u.js +1 -0
- package/dist/client/assets/new-project-store-DKX1Nr1i.js +1 -0
- package/dist/client/assets/oauth-callback-BtuvTfYM.js +1 -0
- package/dist/client/assets/oauth-callback-ai-provider-z9__N6_0.js +1 -0
- package/dist/client/assets/oauth-consent-DZiMr8R6.js +1 -0
- package/dist/client/assets/onboarding-iqt0pXlW.js +1 -0
- package/dist/client/assets/openai-conversation-BAyIaaKr.js +3 -0
- package/dist/client/assets/optimistic-project-sidebar-views-CC2XVjj2.js +1 -0
- package/dist/client/assets/order-monitor-day-CVQptNY2.js +1 -0
- package/dist/client/assets/organization-choice-YbsnUkIN.js +1 -0
- package/dist/client/assets/orgs-Cq7IOHiy.js +1 -0
- package/dist/client/assets/own-accounts-section-DdLFGpfA.js +1 -0
- package/dist/client/assets/pair-BZG9CIDl.js +48 -0
- package/dist/client/assets/parse-sections-D43OEGEn.js +4 -0
- package/dist/client/assets/plan-ladder-DYHHJ_jA.js +1 -0
- package/dist/client/assets/plan-m1-n1zdB.js +1 -0
- package/dist/client/assets/plan-page-B7QeLjuD.js +6 -0
- package/dist/client/assets/plan-usage-card-BX9O7tuq.js +6 -0
- package/dist/client/assets/popover-AnK8v98x.js +1 -0
- package/dist/client/assets/post-calendar-Duf8KKe4.js +1 -0
- package/dist/client/assets/post-editor-X5ftynr7.js +2 -0
- package/dist/client/assets/preview-content-CFML8r1s.js +1 -0
- package/dist/client/assets/preview-dialog-hZClqMff.js +1 -0
- package/dist/client/assets/preview-panel-DLdONUkx.js +1 -0
- package/dist/client/assets/preview-tab-CaSVSxSe.js +557 -0
- package/dist/client/assets/primitives-BrBAZQU4.js +1 -0
- package/dist/client/assets/product-picker-dialog-B0mtNS8b.js +1 -0
- package/dist/client/assets/profile-D4Ad4NnB.js +1 -0
- package/dist/client/assets/project-app-view-D0qQzxzP.js +1 -0
- package/dist/client/assets/project-apps-CMxAT7bs.js +1 -0
- package/dist/client/assets/project-icon-KJ4sAw-b.js +1 -0
- package/dist/client/assets/project-index-BMeMqsks.js +1 -0
- package/dist/client/assets/project-reports-SKqvZBkX.js +1 -0
- package/dist/client/assets/project-tasks-D6vHSR4Q.js +1 -0
- package/dist/client/assets/projects-D0Q13LoK.js +1 -0
- package/dist/client/assets/projects-empty-state-ByQjD0Vj.js +1 -0
- package/dist/client/assets/prompts-B7FEOSEY.js +1 -0
- package/dist/client/assets/record-editor-Cp7je4T7.js +1 -0
- package/dist/client/assets/redirect-editor-Q_OohzJA.js +1 -0
- package/dist/client/assets/reports-JUrTCQm3.js +3 -0
- package/dist/client/assets/reports-nSzu7mpe.js +1 -0
- package/dist/client/assets/reports-onboarding-B3kn9jO6.js +1 -0
- package/dist/client/assets/reports-tab-CHEsyxrx.js +2 -0
- package/dist/client/assets/repositories-Bhv4tO4G.js +1 -0
- package/dist/client/assets/repositories-DQOUJYnS.js +1 -0
- package/dist/client/assets/repository-binding-CcYacKs1.js +1 -0
- package/dist/client/assets/repository-picker-D8NcrgAa.js +1 -0
- package/dist/client/assets/require-capability-DGHYjBMM.js +1 -0
- package/dist/client/assets/required-auth-layout-Dn7Rkx5Z.js +1 -0
- package/dist/client/assets/reset-password-DtgCjwE1.js +1 -0
- package/dist/client/assets/resizable-QjIF7g7g.js +1 -0
- package/dist/client/assets/resolve-tab-icon-3k9X1nc0.js +1 -0
- package/dist/client/assets/review-settings-BkLLZKFt.js +1 -0
- package/dist/client/assets/role-color-75B9Lp0f.js +1 -0
- package/dist/client/assets/roles-CJ2Ksj8j.js +1 -0
- package/dist/client/assets/route-BYkwF5CN.js +1 -0
- package/dist/client/assets/route-CuKOcURI.js +1 -0
- package/dist/client/assets/route-page-header-BJ7zHEHy.js +1 -0
- package/dist/client/assets/route-zjGu5JDD.js +1 -0
- package/dist/client/assets/sandbox-git-api-WixIcpAj.js +1 -0
- package/dist/client/assets/sandbox-lifecycle-context-DJBBVuLu.js +1 -0
- package/dist/client/assets/save-status-BQO2H7FQ.js +1 -0
- package/dist/client/assets/schema-C4qTfMN3.js +1 -0
- package/dist/client/assets/schema-jtnIkAdC.js +1 -0
- package/dist/client/assets/scroll-area-DZ1theh-.js +1 -0
- package/dist/client/assets/search-input-BRG5lLwk.js +1 -0
- package/dist/client/assets/search-toggle-CtLCxTsp.js +1 -0
- package/dist/client/assets/secret-picker-C-N6o4Vb.js +1 -0
- package/dist/client/assets/secrets-DZbh80aG.js +1 -0
- package/dist/client/assets/section-array-field-DiF2BOMO.js +1 -0
- package/dist/client/assets/sections-DiYSoGzq.js +1 -0
- package/dist/client/assets/sections-editor-C5JWmlFc.js +1 -0
- package/dist/client/assets/select-model-DGCLh_Bj.js +1 -0
- package/dist/client/assets/select-mubLH2KI.js +1 -0
- package/dist/client/assets/seo-editor-D9dWqGTt.js +1 -0
- package/dist/client/assets/separator-CzF_fr0K.js +1 -0
- package/dist/client/assets/session-runtime-TPNp8gb7.js +1 -0
- package/dist/client/assets/settings-tab-Tp_2z3vO.js +1 -0
- package/dist/client/assets/sheet-CxNkjzTI.js +1 -0
- package/dist/client/assets/shell-layout-CE9vo5o-.js +1 -0
- package/dist/client/assets/site-draft-actions-CXJHBSTj.js +7 -0
- package/dist/client/assets/site-draft-view-B1GPZ9rH.js +1 -0
- package/dist/client/assets/site-editor-DOOY0pNw.js +1 -0
- package/dist/client/assets/site-editor-toast-CyhiGEEx.js +1 -0
- package/dist/client/assets/skills-D3-hXj5X.js +1 -0
- package/dist/client/assets/slider-D49bf_VD.js +1 -0
- package/dist/client/assets/sortable.esm-C4ZR4J0q.js +1 -0
- package/dist/client/assets/sso-DfQRxtrZ.js +1 -0
- package/dist/client/assets/suggestion-D0xjpxQX.js +2 -0
- package/dist/client/assets/super-agent-icon-I-qSnnr4.js +1 -0
- package/dist/client/assets/switch-B-uWcYzE.js +1 -0
- package/dist/client/assets/synced-repos-47lDGVpz.js +1 -0
- package/dist/client/assets/tab-icon-glyph-HMGWhokL.js +1 -0
- package/dist/client/assets/table-DXLWi5Uj.js +1 -0
- package/dist/client/assets/tabs-DtRh2Buo.js +1 -0
- package/dist/client/assets/task-board-DnXBfWZ7.js +1 -0
- package/dist/client/assets/task-key-BkyKVHkW.js +5 -0
- package/dist/client/assets/task-route-0zxGyiWU.js +1 -0
- package/dist/client/assets/task-status-Bu2FoV0g.js +1 -0
- package/dist/client/assets/taskboard-analytics-C2evUOW-.js +1 -0
- package/dist/client/assets/tasks-BU49zajZ.js +1 -0
- package/dist/client/assets/tasks-CoQsM1xM.js +4 -0
- package/dist/client/assets/textarea-CyN7utWg.js +1 -0
- package/dist/client/assets/thread-analytics-CzL2aDH5.js +1 -0
- package/dist/client/assets/thread-button-C8qZLJ0I.js +1 -0
- package/dist/client/assets/thread-intent-BpGkWTcJ.js +15 -0
- package/dist/client/assets/thread-route-k0OQaEgp.js +1 -0
- package/dist/client/assets/thread-route-kDYG61B4.js +1 -0
- package/dist/client/assets/thread-sheet-body-DP-41AOU.js +1 -0
- package/dist/client/assets/time-range-picker-CdRDxNzc.js +1 -0
- package/dist/client/assets/toggle-group-9b5GTf1k.js +1 -0
- package/dist/client/assets/tool-set-selector-CxjhMiQS.js +1 -0
- package/dist/client/assets/toolbar-icon-button-BCVt39UQ.js +1 -0
- package/dist/client/assets/tooltip-DbIWGyWX.js +1 -0
- package/dist/client/assets/tooltipContext-HMMQWsoC.js +1 -0
- package/dist/client/assets/track-Cyz1j3Yw.js +1 -0
- package/dist/client/assets/types-BRTXTYjF.js +77 -0
- package/dist/client/assets/url-slug-BIw62WsW.js +1 -0
- package/dist/client/assets/usage-stats-B8VpADeR.js +141 -0
- package/dist/client/assets/use-ai-providers-C2mhihsF.js +1 -0
- package/dist/client/assets/use-api-keys-C1yQW7CX.js +1 -0
- package/dist/client/assets/use-apply-named-rule-Dc5utyrH.js +1 -0
- package/dist/client/assets/use-ask-in-chat-DmYMZqB-.js +1 -0
- package/dist/client/assets/use-automations-B7TBj_Gs.js +1 -0
- package/dist/client/assets/use-autosave-BzOLRocm.js +1 -0
- package/dist/client/assets/use-blocks-v8-project-CwEvYiak.js +1 -0
- package/dist/client/assets/use-blog-view-B1maq3jt.js +1 -0
- package/dist/client/assets/use-chat-layout-state-CGdFiO4p.js +1 -0
- package/dist/client/assets/use-cms-publish-actions-Z6_gaVoB.js +10 -0
- package/dist/client/assets/use-connect-companion-WPXiwfyP.js +1 -0
- package/dist/client/assets/use-connection-Cb6wlYJt.js +1 -0
- package/dist/client/assets/use-content-sync-CwPPudYE.js +1 -0
- package/dist/client/assets/use-copy-CBX7hZQU.js +1 -0
- package/dist/client/assets/use-current-view-BsmgZhH_.js +1 -0
- package/dist/client/assets/use-date-fns-locale-BlaUn5Z1.js +1 -0
- package/dist/client/assets/use-debounced-autosave-KEaqf0An.js +1 -0
- package/dist/client/assets/use-debounced-value-B22_huH1.js +1 -0
- package/dist/client/assets/use-deco-credits-DfZ1u8SV.js +1 -0
- package/dist/client/assets/use-decopilot-events-B-O4604K.js +1 -0
- package/dist/client/assets/use-delete-block-Dt20gSk8.js +1 -0
- package/dist/client/assets/use-delete-connection-COLU9YY9.js +1 -0
- package/dist/client/assets/use-deployment-admin-Gyg2rHcN.js +1 -0
- package/dist/client/assets/use-entitlements-BC-RTqX5.js +1 -0
- package/dist/client/assets/use-fast-preview-draft-url--8QLYqK5.js +1 -0
- package/dist/client/assets/use-file-configs-DIy_E2PQ.js +1 -0
- package/dist/client/assets/use-id-selection-BE2AAAGx.js +1 -0
- package/dist/client/assets/use-in-settings-CnaMlQET.js +1 -0
- package/dist/client/assets/use-inbox-feed-DBUd4il8.js +1 -0
- package/dist/client/assets/use-infinite-scroll-DGv4zqIR.js +1 -0
- package/dist/client/assets/use-join-requests-DeiIe7yf.js +1 -0
- package/dist/client/assets/use-main-panel-tabs-DVYHKaNp.js +1 -0
- package/dist/client/assets/use-mcp-auth-status-B1s8TCEj.js +1 -0
- package/dist/client/assets/use-mcp-client-B4vdBbCp.js +10 -0
- package/dist/client/assets/use-mcp-prompts-REi-KDv6.js +1 -0
- package/dist/client/assets/use-mcp-tools-KSFVUpMn.js +1 -0
- package/dist/client/assets/use-mobile-BsW3NxK-.js +1 -0
- package/dist/client/assets/use-move-blocks-DKixgqNX.js +1 -0
- package/dist/client/assets/use-navigate-to-agent-CsKGt9zC.js +1 -0
- package/dist/client/assets/use-org-fs-gqkUNR5f.js +1 -0
- package/dist/client/assets/use-org-notice-DRVH9ncx.js +1 -0
- package/dist/client/assets/use-org-repo-syncs-BWeBoxpr.js +1 -0
- package/dist/client/assets/use-org-sso-Dpta-05B.js +1 -0
- package/dist/client/assets/use-organization-settings-DJvj_8Se.js +1 -0
- package/dist/client/assets/use-panel-navigate-BzLyvR2u.js +1 -0
- package/dist/client/assets/use-project-native-view-presence-DLbWGGgw.js +1 -0
- package/dist/client/assets/use-project-scope-DgBS55KP.js +1 -0
- package/dist/client/assets/use-recent-apps-CMJpefPW.js +1 -0
- package/dist/client/assets/use-reports-diagnostic-DUpwZHPo.js +1 -0
- package/dist/client/assets/use-sandbox-events-PXq-wnno.js +2 -0
- package/dist/client/assets/use-secrets-ZBNTa31_.js +1 -0
- package/dist/client/assets/use-section-preview-base-1AuG2TUU.js +1 -0
- package/dist/client/assets/use-sidebar-collapsed-DB7PfLv0.js +1 -0
- package/dist/client/assets/use-tags-DLn4n5K6.js +1 -0
- package/dist/client/assets/use-task-board-analytics-CWmeqb_u.js +1 -0
- package/dist/client/assets/use-task-board-item-prs-CA7ntNPw.js +1 -0
- package/dist/client/assets/use-task-board-items-BpGVTrnZ.js +1 -0
- package/dist/client/assets/use-task-board-prompts-Bm1sys88.js +1 -0
- package/dist/client/assets/use-task-metadata-BA8exdFC.js +1 -0
- package/dist/client/assets/use-thread-outputs-D7Eo6RAe.js +1 -0
- package/dist/client/assets/use-view-draft-kind-Dg-JzlWR.js +1 -0
- package/dist/client/assets/use-voice-input-C18ylsuI.js +1 -0
- package/dist/client/assets/useInfiniteQuery-HpTGLEmD.js +1 -0
- package/dist/client/assets/useQueries-Cc3n_w4F.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-D4gzOxBn.js +1 -0
- package/dist/client/assets/users-Dsz6abu0.js +1 -0
- package/dist/client/assets/utils-Bdtf12J4.js +4 -0
- package/dist/client/assets/variant-calendar-BJQJAa4-.js +1 -0
- package/dist/client/assets/variant-matcher-override-wKP3wlte.js +1 -0
- package/dist/client/assets/view-header-Bk8bDC7V.js +1 -0
- package/dist/client/assets/virtual-mcp-BDqJUjzP.js +1 -0
- package/dist/client/assets/watch-sse-pool-De5Hkvjc.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/AlertCircle-BZ77VPwi.js +0 -1
- package/dist/client/assets/AreaChart-B63k65cr.js +0 -1
- package/dist/client/assets/ArrowLeft-DDcGzUb_.js +0 -1
- package/dist/client/assets/ArrowRight-BI3tgPlE.js +0 -1
- package/dist/client/assets/ArrowUp-BD-j5y7U.js +0 -1
- package/dist/client/assets/BookOpen01-YPr3aj0A.js +0 -1
- package/dist/client/assets/CartesianChart-CvTqapRs.js +0 -1
- package/dist/client/assets/CategoricalChart-DvPysU2d.js +0 -33
- package/dist/client/assets/CheckCircle-BIqDFI6d.js +0 -1
- package/dist/client/assets/ChevronDown-NJEYrOlg.js +0 -1
- package/dist/client/assets/ChevronSelectorVertical-jVE0nLDw.js +0 -1
- package/dist/client/assets/ChevronUp-BYSD5GIe.js +0 -1
- package/dist/client/assets/CreditCard01-CNgkIK-Y.js +0 -1
- package/dist/client/assets/Eye-B44h5Hya.js +0 -1
- package/dist/client/assets/File02-CPfgef4O.js +0 -1
- package/dist/client/assets/Fingerprint04-Bwez4pdA.js +0 -1
- package/dist/client/assets/Flag01-BtZROrOm.js +0 -1
- package/dist/client/assets/FolderCode-C2QZtQP9.js +0 -1
- package/dist/client/assets/Globe04-CcJFb5e_.js +0 -1
- package/dist/client/assets/Image01-Cy1W3NCC.js +0 -1
- package/dist/client/assets/Key01-D1QSQZNg.js +0 -1
- package/dist/client/assets/LayoutLeft-Cc1GOJ46.js +0 -1
- package/dist/client/assets/Link03-DSQvVNoE.js +0 -1
- package/dist/client/assets/LinkBroken01-C-CUMFyf.js +0 -1
- package/dist/client/assets/Mail01-CPPeVE93.js +0 -1
- package/dist/client/assets/Minus-DrEZvCcn.js +0 -1
- package/dist/client/assets/Monitor01-C9Vo2Qr-.js +0 -1
- package/dist/client/assets/Play-CCN4cX3D.js +0 -1
- package/dist/client/assets/Plus-BayUs_u0.js +0 -1
- package/dist/client/assets/ReferenceLine-D-BxFj6o.js +0 -1
- package/dist/client/assets/SearchMd-CUllySvD.js +0 -1
- package/dist/client/assets/Share07-BiIFW6Ut.js +0 -1
- package/dist/client/assets/ShoppingBag01-DsOFAVKz.js +0 -1
- package/dist/client/assets/Sun-DO2Kuro8.js +0 -1
- package/dist/client/assets/SwitchHorizontal01-DyaI_Bi7.js +0 -1
- package/dist/client/assets/Tool01-CS8oD6PR.js +0 -1
- package/dist/client/assets/Tooltip-D7mczIvq.js +0 -1
- package/dist/client/assets/Trash01-C_FjJP1R.js +0 -1
- package/dist/client/assets/Upload01-DM_Ju9r8.js +0 -1
- package/dist/client/assets/UserCheck01-C3Djy5JN.js +0 -1
- package/dist/client/assets/UserSquare-CZ2gYTJ5.js +0 -1
- package/dist/client/assets/Users01-DWu3-W6L.js +0 -1
- package/dist/client/assets/XClose-BBPo6WaS.js +0 -1
- package/dist/client/assets/Zap-D2ebNb3N.js +0 -1
- package/dist/client/assets/access-gate-AuLzoFov.js +0 -1
- package/dist/client/assets/add-connection-dialog-CLgvIYTI.js +0 -1
- package/dist/client/assets/agent-app-D46m2Z-C.js +0 -1
- package/dist/client/assets/agent-assets-mEwR2zY6.js +0 -1
- package/dist/client/assets/agent-automation-9Q_xbL2S.js +0 -20
- package/dist/client/assets/agent-automations-BC65R7_V.js +0 -1
- package/dist/client/assets/agent-blog-9WZGcbIo.js +0 -2
- package/dist/client/assets/agent-blog-post-XA52auNx.js +0 -2
- package/dist/client/assets/agent-business-case-QhVxyO36.js +0 -1
- package/dist/client/assets/agent-calendar-D5kvLI1U.js +0 -1
- package/dist/client/assets/agent-capabilities-Bq1Q56yW.js +0 -1
- package/dist/client/assets/agent-connect-sources-BK7zi4Tv.js +0 -1
- package/dist/client/assets/agent-deck-BY73BPht.js +0 -1
- package/dist/client/assets/agent-e2e-CKSm6v9P.js +0 -1
- package/dist/client/assets/agent-experiments-BhWYoytz.js +0 -1
- package/dist/client/assets/agent-file-HFIRoC6I.js +0 -1
- package/dist/client/assets/agent-hosting-DiBTqx2O.js +0 -1
- package/dist/client/assets/agent-icon-Cwcz3LYz.js +0 -1
- package/dist/client/assets/agent-library-0ka-syR1.js +0 -1
- package/dist/client/assets/agent-library-file-HSxE4i2T.js +0 -1
- package/dist/client/assets/agent-overview-du5f_TT6.js +0 -1
- package/dist/client/assets/agent-releases-BESk52Re.js +0 -3
- package/dist/client/assets/agent-settings-CgRJ4JIJ.js +0 -1
- package/dist/client/assets/agent-site-editor-code-tYrKnk4h.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CBa-qAPn.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-h2DWObiK.js +0 -1
- package/dist/client/assets/agent-site-editor-rdpWruq_.js +0 -16
- package/dist/client/assets/agent-view-guard-DI_7XS4k.js +0 -1
- package/dist/client/assets/agent-view-wn_10yDo.js +0 -1
- package/dist/client/assets/ai-providers-BvGbxXkO.js +0 -1
- package/dist/client/assets/alert-D49-vGaD.js +0 -1
- package/dist/client/assets/analytics-sections-BQ-guGCI.js +0 -1
- package/dist/client/assets/api-keys-DIi--dt5.js +0 -1
- package/dist/client/assets/api-keys-DvMZAQ7m.js +0 -1
- package/dist/client/assets/app-editor-Dik_kJua.js +0 -1
- package/dist/client/assets/asset-utils-BgQjGGAe.js +0 -1
- package/dist/client/assets/auth-CR1FYnTL.js +0 -1
- package/dist/client/assets/auth-catchall-DJJXm45c.js +0 -1
- package/dist/client/assets/auth-entry-DWZREg69.js +0 -1
- package/dist/client/assets/auth-split-layout-6XYTtv_5.js +0 -1
- package/dist/client/assets/authenticate-and-persist-oauth-Dyc91cSq.js +0 -1
- package/dist/client/assets/automation-list-row-C4SnbW5k.js +0 -1
- package/dist/client/assets/automation-runs-CtkoG_F0.js +0 -1
- package/dist/client/assets/automations-pqoI7NgS.js +0 -1
- package/dist/client/assets/badge-COc1JoAA.js +0 -1
- package/dist/client/assets/block-document-BTnKTBKg.js +0 -3
- package/dist/client/assets/blocks-preview-workspace-context-iHs532Xj.js +0 -1
- package/dist/client/assets/blocks-tab-states-Cm-ql5ao.js +0 -1
- package/dist/client/assets/blog-preview-url-CCa1sxvP.js +0 -1
- package/dist/client/assets/blog-schema-D0YD7gpV.js +0 -1
- package/dist/client/assets/blog-source-gate-j9OofSY0.js +0 -1
- package/dist/client/assets/blog-view-gate-vpyivpYa.js +0 -1
- package/dist/client/assets/buckets-B9lBFzD0.js +0 -1
- package/dist/client/assets/build-improve-prompt-doc-CISgl3K5.js +0 -2
- package/dist/client/assets/calendar-BZCE9UK1.js +0 -1
- package/dist/client/assets/capability-load-error-DfS3ubCd.js +0 -1
- package/dist/client/assets/category-editor-Cjye76Gj.js +0 -1
- package/dist/client/assets/category-tree-BHWSw6Er.js +0 -18
- package/dist/client/assets/chart-CtURK-HA.js +0 -13
- package/dist/client/assets/chat-context-DBpp5_ZT.js +0 -43
- package/dist/client/assets/chat-draft-mtm986VJ.js +0 -1
- package/dist/client/assets/checkbox-vn5BEJRY.js +0 -1
- package/dist/client/assets/choose-editor-CTfPTC-2.js +0 -1
- package/dist/client/assets/cli-auth-success-C9T_iE0M.js +0 -1
- package/dist/client/assets/cms-settings-editor-Dthm2bL8.js +0 -1
- package/dist/client/assets/cms-store-drafts-Dbaploi1.js +0 -1
- package/dist/client/assets/collapsible-Dkj3s4xK.js +0 -1
- package/dist/client/assets/collection-detail-Fc4_4_wU.js +0 -1
- package/dist/client/assets/collection-display-button-BYLyicQQ.js +0 -1
- package/dist/client/assets/collection-search-D258soTa.js +0 -1
- package/dist/client/assets/collection-table-wrapper-BxZ0UECG.js +0 -1
- package/dist/client/assets/collection-tabs-DDGy1lYJ.js +0 -1
- package/dist/client/assets/combobox-FRnIDKX-.js +0 -1
- package/dist/client/assets/command-C-lPdUqA.js +0 -1
- package/dist/client/assets/companion-mcps-section-BlGkAYgl.js +0 -1
- package/dist/client/assets/config-MmXf8MXS.js +0 -1
- package/dist/client/assets/connect-BqenKN6l.js +0 -9
- package/dist/client/assets/connect-key-BVX54f6R.js +0 -1
- package/dist/client/assets/connect-layout-ChPgAixD.js +0 -1
- package/dist/client/assets/connect-source-dialog-BQaqYuN1.js +0 -1
- package/dist/client/assets/connection-B6a_5tqJ.js +0 -1
- package/dist/client/assets/connection-card-BhCrWJC-.js +0 -1
- package/dist/client/assets/connection-detail-H3j_1Qr6.js +0 -1
- package/dist/client/assets/connection-form-helpers-CzzXzwaF.js +0 -1
- package/dist/client/assets/connection-slug-CinUCubV.js +0 -1
- package/dist/client/assets/connections-8ojEBktd.js +0 -1
- package/dist/client/assets/content-changes-BRuifczf.js +0 -1
- package/dist/client/assets/content-tab-B3eFuZTB.js +0 -19
- package/dist/client/assets/context-B4c8PErY.js +0 -1
- package/dist/client/assets/context-menu-BqVVlDQ8.js +0 -1
- package/dist/client/assets/context-shell-4ZiyWNbW.js +0 -37
- package/dist/client/assets/create-organization-dialog-BRgq8Rmp.js +0 -1
- package/dist/client/assets/daily-pulse-BbBATTOV.js +0 -1
- package/dist/client/assets/device-hint-CCUE2fgJ.js +0 -1
- package/dist/client/assets/discover-sUHlGOKG.js +0 -1
- package/dist/client/assets/domain-settings-DzVN1yMy.js +0 -1
- package/dist/client/assets/drawer-1wBq-vMr.js +0 -1
- package/dist/client/assets/editor-CfNsW0a_.js +0 -11
- package/dist/client/assets/editor-classes-BCw3l0un.js +0 -1
- package/dist/client/assets/empty-state-BlUFuRNl.js +0 -1
- package/dist/client/assets/empty-state-VV8x3skp.js +0 -1
- package/dist/client/assets/experiments-tab-choice-DNoRw5kx.js +0 -1
- package/dist/client/assets/extract-connection-data-CzjawU4-.js +0 -1
- package/dist/client/assets/feature-gate-PgPwxLOD.js +0 -1
- package/dist/client/assets/feature-paywall-B1WfnhTS.js +0 -1
- package/dist/client/assets/file-explorer-ocaxiwVB.js +0 -2
- package/dist/client/assets/file-preview-DFQuGji9.js +0 -1
- package/dist/client/assets/file-share-button-xb4id2QD.js +0 -3
- package/dist/client/assets/file-type-icon-C9ZRmGi6.js +0 -1
- package/dist/client/assets/folder-icon-B5eB53Ku.js +0 -1
- package/dist/client/assets/form-C2TjtMvY.js +0 -1
- package/dist/client/assets/frame-navigation-Bs8WpEHy.js +0 -1
- package/dist/client/assets/gateway-client-D-GK-cpo.js +0 -1
- package/dist/client/assets/general-ClhCPdGG.js +0 -1
- package/dist/client/assets/github-icon-QHnpTc-V.js +0 -1
- package/dist/client/assets/held-block-view-CYaVU4d2.js +0 -3
- package/dist/client/assets/home-Cx8dXEmW.js +0 -1
- package/dist/client/assets/home-overview-CX-UePss.js +0 -1
- package/dist/client/assets/hosted-reconcile-xWiPXn7c.js +0 -1
- package/dist/client/assets/icon-button-Dd6EIBLa.js +0 -1
- package/dist/client/assets/index-B2PxUjsI.js +0 -1
- package/dist/client/assets/index-BDQDMoMu.js +0 -1
- package/dist/client/assets/index-BPSLgXTP.js +0 -69
- package/dist/client/assets/index-C7k4_WYk.js +0 -15
- package/dist/client/assets/index-CUGPTN_O.js +0 -1
- package/dist/client/assets/index-CZNd-5ul.js +0 -5
- package/dist/client/assets/index-Cs5724jr.js +0 -1
- package/dist/client/assets/index-D3cd_B6T.js +0 -1
- package/dist/client/assets/index-D3gIavkH.js +0 -273
- package/dist/client/assets/index-DB9asfN0.js +0 -1
- package/dist/client/assets/index-DZt5aAgJ.js +0 -4
- package/dist/client/assets/index-DaDMqER_.js +0 -4
- package/dist/client/assets/index-Ddt8Kdik.js +0 -1
- package/dist/client/assets/index-Dsa5YWxQ.js +0 -26
- package/dist/client/assets/index-TI9re2Po.js +0 -1
- package/dist/client/assets/index-dTeRtKfv.js +0 -1
- package/dist/client/assets/index-hsC9ZG7G.js +0 -1
- package/dist/client/assets/index-iVwYK-CL.js +0 -1
- package/dist/client/assets/index-redirect-QSlQbF4Q.js +0 -1
- package/dist/client/assets/infiniteQueryObserver-DYS2_-y7.js +0 -1
- package/dist/client/assets/infra-billing-CeFfq0Xh.js +0 -1
- package/dist/client/assets/input-8IO5Pzl3.js +0 -17
- package/dist/client/assets/input-BrDt9vdY.js +0 -1
- package/dist/client/assets/integration-icon-0s5l0HSg.js +0 -1
- package/dist/client/assets/invite-link-C5iXCD0_.js +0 -1
- package/dist/client/assets/invite-link-panel-CcOXYvfD.js +0 -1
- package/dist/client/assets/item-actions-Dsy0L1R1.js +0 -1
- package/dist/client/assets/jira-icon-DRusKDJV.js +0 -1
- package/dist/client/assets/label-Du2i6uo3.js +0 -1
- package/dist/client/assets/layout-BO8uLim5.js +0 -1
- package/dist/client/assets/legacy-admin-welcome-dialog-B-Sh2StY.js +0 -1
- package/dist/client/assets/legacy-agents-deep-C4e4OXLE.js +0 -1
- package/dist/client/assets/legacy-content-C986oV2Z.js +0 -4
- package/dist/client/assets/legacy-main-redirect-DSoxD8kq.js +0 -1
- package/dist/client/assets/library-BP3TIm2a.js +0 -1
- package/dist/client/assets/library-tab-BzYoBmbH.js +0 -162
- package/dist/client/assets/login-BM0CQ7XV.js +0 -1
- package/dist/client/assets/markdown-Bt9LfDMc.js +0 -93
- package/dist/client/assets/mcp-app-renderer-zA9FZOa9.js +0 -11
- package/dist/client/assets/mcp-oauth-BUETVZpu.js +0 -1
- package/dist/client/assets/mcp-oauth-CmcRixsr.js +0 -1
- package/dist/client/assets/members-0vrdvn5X.js +0 -1
- package/dist/client/assets/memory-BNEe6S-W.js +0 -7
- package/dist/client/assets/mock-board-BLIm0W6A.js +0 -10
- package/dist/client/assets/monaco-editor-Dn_QPQT3.js +0 -9
- package/dist/client/assets/monitoring-DxQBxJO1.js +0 -2
- package/dist/client/assets/monitoring-stats-row-IzIjQdOB.js +0 -1
- package/dist/client/assets/multi-select-0VdptD3G.js +0 -1
- package/dist/client/assets/mustache-BkkXBVFo.js +0 -4
- package/dist/client/assets/named-rule-step-C1kUX0A6.js +0 -1
- package/dist/client/assets/named-rule-view-CZdhRE9C.js +0 -1
- package/dist/client/assets/new-project-dialog-BYBHvXWA.js +0 -1
- package/dist/client/assets/new-project-store--N0gNqnC.js +0 -1
- package/dist/client/assets/oauth-callback-ai-provider-BNMJ6N9g.js +0 -1
- package/dist/client/assets/oauth-callback-vtB23qqV.js +0 -1
- package/dist/client/assets/oauth-consent-DKhJz5Ht.js +0 -1
- package/dist/client/assets/onboarding-C8hyGa3K.js +0 -1
- package/dist/client/assets/openai-conversation-BxE9Lt7E.js +0 -3
- package/dist/client/assets/optimistic-project-sidebar-views-Vr1gEHUj.js +0 -1
- package/dist/client/assets/order-monitor-day-BKPJrwmz.js +0 -1
- package/dist/client/assets/organization-choice-KAZ49gzD.js +0 -1
- package/dist/client/assets/orgs-B1OrGEef.js +0 -1
- package/dist/client/assets/own-accounts-section-DyMOxKK2.js +0 -1
- package/dist/client/assets/pair-BeXsxyAZ.js +0 -48
- package/dist/client/assets/parse-sections-DeDP2suP.js +0 -4
- package/dist/client/assets/plan-DWDCRt2Y.js +0 -1
- package/dist/client/assets/plan-ladder--tRbiFIm.js +0 -1
- package/dist/client/assets/plan-page-DKUJUymd.js +0 -6
- package/dist/client/assets/plan-usage-card-CxBGU-_I.js +0 -6
- package/dist/client/assets/popover-C5AcoofU.js +0 -1
- package/dist/client/assets/post-calendar-CAOIwr_Y.js +0 -1
- package/dist/client/assets/post-editor-D_8b5hdF.js +0 -2
- package/dist/client/assets/preview-content-CzCI8wmZ.js +0 -1
- package/dist/client/assets/preview-dialog-3B3v44YU.js +0 -1
- package/dist/client/assets/preview-panel-CVcS1P7l.js +0 -1
- package/dist/client/assets/preview-tab-DQsErthX.js +0 -557
- package/dist/client/assets/primitives-JdYvjzbD.js +0 -1
- package/dist/client/assets/product-picker-dialog-BnNXoT2R.js +0 -1
- package/dist/client/assets/profile-Cywe0Wvi.js +0 -1
- package/dist/client/assets/project-app-view-CHfJujHn.js +0 -1
- package/dist/client/assets/project-apps-BTaKmBMj.js +0 -1
- package/dist/client/assets/project-icon-C5FTdOoG.js +0 -1
- package/dist/client/assets/project-index-BcTibAVt.js +0 -1
- package/dist/client/assets/project-reports-DaLvj1dJ.js +0 -1
- package/dist/client/assets/project-tasks-DtojPCW-.js +0 -1
- package/dist/client/assets/projects-BIqn55dG.js +0 -1
- package/dist/client/assets/projects-empty-state-CLF8c0vW.js +0 -1
- package/dist/client/assets/prompts-DfOvUANf.js +0 -1
- package/dist/client/assets/record-editor-uRJkj3vL.js +0 -1
- package/dist/client/assets/redirect-editor-CBhYihJO.js +0 -1
- package/dist/client/assets/reports-Bf_vFfBW.js +0 -1
- package/dist/client/assets/reports-Cbt4fwtC.js +0 -3
- package/dist/client/assets/reports-onboarding-BIjSplEw.js +0 -1
- package/dist/client/assets/reports-tab-C8PAR8FQ.js +0 -2
- package/dist/client/assets/repositories-DgVX4uCL.js +0 -1
- package/dist/client/assets/repositories-DmC7VzRy.js +0 -1
- package/dist/client/assets/repository-binding-DemKbKzU.js +0 -1
- package/dist/client/assets/repository-picker-CNN2isxG.js +0 -1
- package/dist/client/assets/require-capability-Cd_GvUin.js +0 -1
- package/dist/client/assets/required-auth-layout-CM7LQjEK.js +0 -1
- package/dist/client/assets/reset-password-CX5ReGwH.js +0 -1
- package/dist/client/assets/resizable-CfdKx0P2.js +0 -1
- package/dist/client/assets/resolve-tab-icon-8sr6FwyN.js +0 -1
- package/dist/client/assets/review-settings-D9dX1SMj.js +0 -1
- package/dist/client/assets/role-color-DZUMuuGl.js +0 -1
- package/dist/client/assets/roles-BAhpR3yp.js +0 -1
- package/dist/client/assets/route-BMqh5ruS.js +0 -1
- package/dist/client/assets/route-D3Kn8krx.js +0 -1
- package/dist/client/assets/route-DwD9UPB5.js +0 -1
- package/dist/client/assets/route-page-header-D_6KXNhB.js +0 -1
- package/dist/client/assets/sandbox-git-api-D4pndQ4d.js +0 -1
- package/dist/client/assets/sandbox-lifecycle-context-D14YHoli.js +0 -1
- package/dist/client/assets/save-status-D0Y2RRF-.js +0 -1
- package/dist/client/assets/schema-BQfCGIE3.js +0 -1
- package/dist/client/assets/schema-DIhR23-c.js +0 -1
- package/dist/client/assets/scroll-area-COQAeP6o.js +0 -1
- package/dist/client/assets/search-input-BqXApUWM.js +0 -1
- package/dist/client/assets/search-toggle-DwT6JzUs.js +0 -1
- package/dist/client/assets/secret-picker-ByklFqpr.js +0 -1
- package/dist/client/assets/secrets-DAbbX0pn.js +0 -1
- package/dist/client/assets/section-array-field-Ma_TEU2G.js +0 -1
- package/dist/client/assets/sections-Cr_VyRv-.js +0 -1
- package/dist/client/assets/sections-editor-BeTL-3nP.js +0 -1
- package/dist/client/assets/select-DpzjPeYX.js +0 -1
- package/dist/client/assets/select-model-BAWXMIQX.js +0 -1
- package/dist/client/assets/seo-editor-ZN7EAQ3L.js +0 -1
- package/dist/client/assets/separator-CNLwwOdk.js +0 -1
- package/dist/client/assets/session-runtime-Dd7eijvp.js +0 -1
- package/dist/client/assets/settings-tab-D4bcsjVU.js +0 -1
- package/dist/client/assets/sheet-HIhKlF-p.js +0 -1
- package/dist/client/assets/shell-layout-Bbrx6ZDg.js +0 -1
- package/dist/client/assets/site-draft-actions-DrCdwXwl.js +0 -7
- package/dist/client/assets/site-draft-view-BB89Omw0.js +0 -1
- package/dist/client/assets/site-editor-5d1VpXE1.js +0 -1
- package/dist/client/assets/site-editor-toast-DSEQt8Mk.js +0 -1
- package/dist/client/assets/skills-B9vEpXJq.js +0 -1
- package/dist/client/assets/slider-D_8WHe8i.js +0 -1
- package/dist/client/assets/sortable.esm-BHlUM8QI.js +0 -1
- package/dist/client/assets/sso-BnpnaZVs.js +0 -1
- package/dist/client/assets/suggestion-CMyxDXtn.js +0 -2
- package/dist/client/assets/super-agent-icon-BG3435AM.js +0 -1
- package/dist/client/assets/switch-RfFtfboJ.js +0 -1
- package/dist/client/assets/synced-repos-B_dKqv9O.js +0 -1
- package/dist/client/assets/tab-icon-glyph-D94bIkhH.js +0 -1
- package/dist/client/assets/table-B79iLRuH.js +0 -1
- package/dist/client/assets/tabs-CVBIse5w.js +0 -1
- package/dist/client/assets/task-board-uoBkMXIH.js +0 -1
- package/dist/client/assets/task-key-C2pRiDEb.js +0 -5
- package/dist/client/assets/task-route-3hblfyqK.js +0 -1
- package/dist/client/assets/task-status-CNHBiGS4.js +0 -1
- package/dist/client/assets/taskboard-analytics-CGqc4Qtv.js +0 -1
- package/dist/client/assets/tasks-CUV941DD.js +0 -4
- package/dist/client/assets/tasks-PGC9IFbC.js +0 -1
- package/dist/client/assets/textarea-BkEy8UFr.js +0 -1
- package/dist/client/assets/thread-analytics-DMGiF80I.js +0 -1
- package/dist/client/assets/thread-button-F64pHFCE.js +0 -1
- package/dist/client/assets/thread-intent-CuVBqftx.js +0 -15
- package/dist/client/assets/thread-route-BtcpAc_6.js +0 -1
- package/dist/client/assets/thread-route-Ze1cL257.js +0 -1
- package/dist/client/assets/thread-sheet-body-E2Y13zQN.js +0 -1
- package/dist/client/assets/time-range-picker-zvJd07Qb.js +0 -1
- package/dist/client/assets/toggle-group-T6MUKaRP.js +0 -1
- package/dist/client/assets/tool-set-selector-ZziplB1P.js +0 -1
- package/dist/client/assets/toolbar-icon-button-Dj_Z1Yil.js +0 -1
- package/dist/client/assets/tooltip-B8U2qBy-.js +0 -1
- package/dist/client/assets/tooltipContext-1BbKTAzU.js +0 -1
- package/dist/client/assets/track-DaJp_1mq.js +0 -1
- package/dist/client/assets/types-iujjD8y4.js +0 -77
- package/dist/client/assets/url-slug-BqZssEtt.js +0 -1
- package/dist/client/assets/usage-stats-Dz_9HW9L.js +0 -141
- package/dist/client/assets/use-ai-providers-Dtb6nTRt.js +0 -1
- package/dist/client/assets/use-api-keys-CkLd3KWk.js +0 -1
- package/dist/client/assets/use-apply-named-rule-Dysmhun2.js +0 -1
- package/dist/client/assets/use-ask-in-chat-Dbza2DX-.js +0 -1
- package/dist/client/assets/use-automations-CT8MQnwE.js +0 -1
- package/dist/client/assets/use-autosave-0dyisWz4.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-BAk1ABBA.js +0 -1
- package/dist/client/assets/use-blog-view-B7OD-5OS.js +0 -1
- package/dist/client/assets/use-chat-layout-state-DEYMzbs0.js +0 -1
- package/dist/client/assets/use-cms-publish-actions-BYjtFBuu.js +0 -10
- package/dist/client/assets/use-connect-companion-BLImyNWf.js +0 -1
- package/dist/client/assets/use-connection-BEhCM5rb.js +0 -1
- package/dist/client/assets/use-content-sync-kd3aRQL7.js +0 -1
- package/dist/client/assets/use-copy-DaHaiNEE.js +0 -1
- package/dist/client/assets/use-current-view-CvsvrLUq.js +0 -1
- package/dist/client/assets/use-date-fns-locale-DzN5aY9A.js +0 -1
- package/dist/client/assets/use-debounced-autosave-DJ22pg-z.js +0 -1
- package/dist/client/assets/use-debounced-value-By4y-tr3.js +0 -1
- package/dist/client/assets/use-deco-credits-ClYMYZ9D.js +0 -1
- package/dist/client/assets/use-decopilot-events-Bsjxr4JE.js +0 -1
- package/dist/client/assets/use-delete-block-D84nev5g.js +0 -1
- package/dist/client/assets/use-delete-connection-C-famoyk.js +0 -1
- package/dist/client/assets/use-deployment-admin-3OdBpmOy.js +0 -1
- package/dist/client/assets/use-entitlements-Bf4tBg2u.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-D8sCx6VS.js +0 -1
- package/dist/client/assets/use-file-configs-Czk5X2HE.js +0 -1
- package/dist/client/assets/use-id-selection-BmE6NPaj.js +0 -1
- package/dist/client/assets/use-in-settings-DodyrbZr.js +0 -1
- package/dist/client/assets/use-inbox-feed-BxOfXZ-v.js +0 -1
- package/dist/client/assets/use-infinite-scroll-BDjokmWT.js +0 -1
- package/dist/client/assets/use-join-requests-CPy0s5N_.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-Dk5r24p-.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-2plnQInu.js +0 -1
- package/dist/client/assets/use-mcp-client-COiyy7zp.js +0 -10
- package/dist/client/assets/use-mcp-prompts-lthCKSUJ.js +0 -1
- package/dist/client/assets/use-mcp-tools-DaiQSXoZ.js +0 -1
- package/dist/client/assets/use-mobile-BY3dRujO.js +0 -1
- package/dist/client/assets/use-move-blocks-C0V8eOLi.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-s5JEw62f.js +0 -1
- package/dist/client/assets/use-org-fs-YkqBIzBi.js +0 -1
- package/dist/client/assets/use-org-notice-0mSaPemN.js +0 -1
- package/dist/client/assets/use-org-repo-syncs-eUgzf-TY.js +0 -1
- package/dist/client/assets/use-org-sso-C1_36CSk.js +0 -1
- package/dist/client/assets/use-organization-settings-Ca6m7dLR.js +0 -1
- package/dist/client/assets/use-panel-navigate-CM0OG2tn.js +0 -1
- package/dist/client/assets/use-project-native-view-presence-SEMq3Ht0.js +0 -1
- package/dist/client/assets/use-project-scope-BvxUf0Vp.js +0 -1
- package/dist/client/assets/use-recent-apps-D2JAOiJv.js +0 -1
- package/dist/client/assets/use-reports-diagnostic-DavYLaSB.js +0 -1
- package/dist/client/assets/use-sandbox-events-Cn-QnLpV.js +0 -2
- package/dist/client/assets/use-secrets-BACiezvH.js +0 -1
- package/dist/client/assets/use-section-preview-base-CSfrtslS.js +0 -1
- package/dist/client/assets/use-sidebar-collapsed-Cr2kBxmQ.js +0 -1
- package/dist/client/assets/use-tags-bNxNet5P.js +0 -1
- package/dist/client/assets/use-task-board-analytics-Bcw37dST.js +0 -1
- package/dist/client/assets/use-task-board-item-prs-D734R-_j.js +0 -1
- package/dist/client/assets/use-task-board-items-Bf9yp0Ra.js +0 -1
- package/dist/client/assets/use-task-board-prompts-sxEng_iT.js +0 -1
- package/dist/client/assets/use-task-metadata-Bws1S4rr.js +0 -1
- package/dist/client/assets/use-thread-outputs-BxIxK4AT.js +0 -1
- package/dist/client/assets/use-view-draft-kind-IOsxyKUY.js +0 -1
- package/dist/client/assets/use-voice-input-DRRAhfPc.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Dk74cgX1.js +0 -1
- package/dist/client/assets/useQueries-V5dTpkU_.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BM9Cj_ol.js +0 -1
- package/dist/client/assets/users-oKA5RnNy.js +0 -1
- package/dist/client/assets/utils-BUG2f_jl.js +0 -4
- package/dist/client/assets/variant-calendar-DjOdP4PA.js +0 -1
- package/dist/client/assets/variant-matcher-override-YqNAZ8rM.js +0 -1
- package/dist/client/assets/view-header-CKTDCEP0.js +0 -1
- package/dist/client/assets/virtual-mcp-CMUy1JUh.js +0 -1
- package/dist/client/assets/watch-sse-pool-Bvx-_ssT.js +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{cR as ce,cS as le,cT as ue,cU as de,cV as he,cW as m,cX as g,cY as fe,cZ as pe,c_ as me,c$ as M,d0 as _e,d1 as F,d2 as we,d3 as q,d4 as ge,d5 as D,d6 as Te,d7 as ye,d8 as ke,d9 as z,da as ve,db as Se,dc as Ce,dd as ee,de as be,df as Re,dg as Ie,bX as Ee,dh as qe,di as Pe,dj as A,dk as $e,dl as Me,dm as Ae,dn as He,dp as Oe,dq as xe,dr as Ue,ds as Ne,dt as je,du as Fe,dv as De,dw as Le,dx as Ve,bO as V,dy as Qe,dz as U,K as te,T as ze,c as se,V as Je,i as We}from"./index-_MevbWo3.js";import{U as P,b as H,c as J}from"./auth-BWDMMgyS.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ke(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ke(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Be{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const h=u,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),m.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,D,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),u&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=W(e);this._notificationHandlers.set(s,r=>{const o=K(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=z.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=z.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ze(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Ye=Se();const Xe=ve(Ye);function et(){const a=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class tt{constructor(e){this._ajv=e??et()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class st{constructor(e){this._client=e}async*callToolStream(e,t=ee,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function rt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function ot(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function at(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let nt=class extends Be{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new tt,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new st(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ze(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(je,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=at(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=b(D,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const k=b(D,f);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?Le:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){rt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&ot(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},$e,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ue,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ne.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));u(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const N=a=>[{type:"text",text:a}];function it(a){const e=V(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(h){const f=h instanceof Error?h.message:"Network error";return{content:N(f),isError:!0}}if(!p.ok){let h=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:N(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:N(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function ct(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,lt=13,I=32;function j(a){}function ut(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=j,onError:t=j,onRetry:s=j,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=f(d);v!==""&&o.push(v);return}if(d.indexOf(`
|
|
2
|
+
`)===-1&&d.indexOf("\r")===-1){o.push(d);return}o.push(d);const c=o.join("");o.length=0;const _=f(c);_!==""&&o.push(_)}function f(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
|
|
3
|
+
`,c);for(;_!==-1;){if(c===_){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=_+1,_=d.indexOf(`
|
|
4
|
+
`,c);continue}const v=d.charCodeAt(c);if(Y(d,c,v)){const S=d.charCodeAt(c+5)===I?c+6:c+5,C=d.slice(S,_);if(p===0&&d.charCodeAt(_+1)===Z){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=_+2,_=d.indexOf(`
|
|
5
|
+
`,c);continue}u=p===0?C:`${u}
|
|
6
|
+
${C}`,p++}else X(d,c,v)?l=d.slice(d.charCodeAt(c+6)===I?c+7:c+6,_)||void 0:w(d,c,_);c=_+1,_=d.indexOf(`
|
|
7
|
+
`,c)}return d.slice(c)}for(;c<d.length;){const _=d.indexOf("\r",c),v=d.indexOf(`
|
|
8
|
+
`,c);let S=-1;if(_!==-1&&v!==-1?S=_<v?_:v:_!==-1?_===d.length-1?S=-1:S=_:v!==-1&&(S=v),S===-1)break;w(d,c,S),c=S+1,d.charCodeAt(c-1)===lt&&d.charCodeAt(c)===Z&&c++}return d.slice(c)}function w(d,c,_){if(c===_){T();return}const v=d.charCodeAt(c);if(Y(d,c,v)){const E=d.charCodeAt(c+5)===I?c+6:c+5,Q=d.slice(E,_);u=p===0?Q:`${u}
|
|
9
|
+
${Q}`,p++;return}if(X(d,c,v)){l=d.slice(d.charCodeAt(c+6)===I?c+7:c+6,_)||void 0;return}if(v===105&&d.charCodeAt(c+1)===100&&d.charCodeAt(c+2)===58){const E=d.slice(d.charCodeAt(c+3)===I?c+4:c+3,_);i=E.includes("\0")?void 0:E;return}if(v===58){if(r){const E=d.slice(c,_);r(E.slice(d.charCodeAt(c+1)===I?2:1))}return}const S=d.slice(c,_),C=S.indexOf(":");if(C===-1){y(S,"",S);return}const ae=S.slice(0,C),ne=S.charCodeAt(C+1)===I?2:1,ie=S.slice(C+ne);y(ae,ie,S)}function y(d,c,_){switch(d){case"event":l=c||void 0;break;case"data":u=p===0?c:`${u}
|
|
10
|
+
${c}`,p++;break;case"id":i=c.includes("\0")?void 0:c;break;case"retry":/^\d+$/.test(c)?s(parseInt(c,10)):t(new B(`Invalid \`retry\` value: "${c}"`,{type:"invalid-retry",value:c,line:_}));break;default:t(new B(`Unknown field "${d.length>20?`${d.slice(0,20)}…`:d}"`,{type:"unknown-field",field:d,value:c,line:_}));break}}function T(){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0}function k(d={}){if(d.consume&&o.length>0){const c=o.join("");w(c,0,c.length)}n=!0,i=void 0,u="",p=0,l=void 0,o.length=0}return{feed:h,reset:k}}function Y(a,e,t){return t===100&&a.charCodeAt(e+1)===97&&a.charCodeAt(e+2)===116&&a.charCodeAt(e+3)===97&&a.charCodeAt(e+4)===58}function X(a,e,t){return t===101&&a.charCodeAt(e+1)===118&&a.charCodeAt(e+2)===101&&a.charCodeAt(e+3)===110&&a.charCodeAt(e+4)===116&&a.charCodeAt(e+5)===58}class dt extends TransformStream{constructor({onError:e,onRetry:t,onComment:s}={}){let r;super({start(o){r=ut({onEvent:n=>{o.enqueue(n)},onError(n){e==="terminate"?o.error(n):typeof e=="function"&&e(n)},onRetry:t,onComment:s})},transform(o){r.feed(o)}})}}const ht={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class $ extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}let ft=class{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=ct(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??ht}async _authThenStart(){if(!this._authProvider)throw new P("No auth provider");let e;try{e=await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(t){throw this.onerror?.(t),t}if(e!=="AUTHORIZED")throw new P;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(e.Authorization=`Bearer ${s.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const t=L(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){const{resumptionToken:t}=e;try{const s=await this._commonHeaders();s.set("Accept","text/event-stream"),t&&s.set("last-event-id",t);const r=await(this._fetch??fetch)(this._url,{method:"GET",headers:s,signal:this._abortController?.signal});if(!r.ok){if(await r.body?.cancel(),r.status===401&&this._authProvider)return await this._authThenStart();if(r.status===405)return;throw new $(r.status,`Failed to open SSE stream: ${r.statusText}`)}this._handleSseStream(r.body,e,!0)}catch(s){throw this.onerror?.(s),s}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const t=this._reconnectionOptions.initialReconnectionDelay,s=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*Math.pow(s,e),r)}_scheduleReconnection(e,t=0){const s=this._reconnectionOptions.maxRetries;if(t>=s){this.onerror?.(new Error(`Maximum reconnection attempts (${s}) exceeded.`));return}const r=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(o=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${o instanceof Error?o.message:String(o)}`)),this._scheduleReconnection(e,t+1)})},r)}_handleSseStream(e,t,s){if(!e)return;const{onresumptiontoken:r,replayMessageId:o}=t;let n,i=!1,u=!1;(async()=>{try{const l=e.pipeThrough(new TextDecoderStream).pipeThrough(new dt({onRetry:w=>{this._serverRetryMs=w}})).getReader();for(;;){const{value:w,done:y}=await l.read();if(y)break;if(w.id&&(n=w.id,i=!0,r?.(w.id)),!!w.data&&(!w.event||w.event==="message"))try{const T=U.parse(JSON.parse(w.data));M(T)&&(u=!0,o!==void 0&&(T.id=o)),this.onmessage?.(T)}catch(T){this.onerror?.(T)}}(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:o},0)}catch(l){if(this.onerror?.(new Error(`SSE stream disconnected: ${l}`)),(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:o},0)}catch(w){this.onerror?.(new Error(`Failed to reconnect: ${w instanceof Error?w.message:String(w)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new P("No auth provider");if(await H(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{const{resumptionToken:s,onresumptiontoken:r}=t||{};if(s){this._startOrAuthSse({resumptionToken:s,replayMessageId:F(e)?e.id:void 0}).catch(f=>this.onerror?.(f));return}const o=await this._commonHeaders();o.set("content-type","application/json"),o.set("accept","application/json, text/event-stream");const n={...this._requestInit,method:"POST",headers:o,body:JSON.stringify(e),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._url,n),u=i.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!i.ok){const f=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new $(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:w,scope:y}=J(i);if(this._resourceMetadataUrl=w,this._scope=y,await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P;return this._hasCompletedAuthFlow=!0,this.send(e)}if(i.status===403&&this._authProvider){const{resourceMetadataUrl:w,scope:y,error:T}=J(i);if(T==="insufficient_scope"){const k=i.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===k)throw new $(403,"Server returned 403 after trying upscoping");if(y&&(this._scope=y),w&&(this._resourceMetadataUrl=w),this._lastUpscopingHeader=k??void 0,await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new P;return this.send(e)}}throw new $(i.status,`Error POSTing to endpoint: ${f}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,i.status===202){await i.body?.cancel(),Qe(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(f=>this.onerror?.(f));return}const l=(Array.isArray(e)?e:[e]).filter(f=>"method"in f&&"id"in f&&f.id!==void 0).length>0,h=i.headers.get("content-type");if(l)if(h?.includes("text/event-stream"))this._handleSseStream(i.body,{onresumptiontoken:r},!1);else if(h?.includes("application/json")){const f=await i.json(),w=Array.isArray(f)?f.map(y=>U.parse(y)):[U.parse(f)];for(const y of w)this.onmessage?.(y)}else throw await i.body?.cancel(),new $(-1,`Unexpected content type: ${h}`);else await i.body?.cancel()}catch(s){throw this.onerror?.(s),s}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const e=await this._commonHeaders(),t={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},s=await(this._fetch??fetch)(this._url,t);if(await s.body?.cancel(),!s.ok&&s.status!==405)throw new $(s.status,`Failed to terminate session: ${s.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}};class pt extends ft{constructor(e,t){super(e,t)}send(e,t){const s=mt(e);return s?.type==="emit"?(this.onmessage?.(s.message),Promise.resolve()):s?.type==="suppress"?Promise.resolve():super.send(e,t)}}function mt(a){const e=a;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const t=e?.params?.protocolVersion;return t?{type:"emit",message:{result:{protocolVersion:t,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"studio-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const _t={name:"studio-sdk",version:"1.0.0"};function wt(a,e,t){const s=t??(typeof window<"u"?window.location.origin:void 0);if(!s)throw new Error("MCP client requires either studioUrl or a browser environment.");const r=`/api/${encodeURIComponent(e)}`,o=a?`${r}/mcp/${a}`:`${r}/mcp`;return new URL(o,s).href}async function gt({connectionId:a,orgId:e,orgSlug:t,token:s,studioUrl:r,meshUrl:o}){const n=V({studioUrl:r,meshUrl:o}),i=te.mcpClient(e,a??"self",s??"",n??"");if(!a||a===ze)return it({orgSlug:t,token:s,studioUrl:n,toJSONString:`mcp-client:${i.join(":")}`});const u=wt(a,t,n),p=new nt(_t,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),l=new pt(new URL(u),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",...s?{Authorization:`Bearer ${s}`}:{}}}});return await p.connect(l),p.toJSON=()=>`mcp-client:${i.join(":")}`,p}function oe(a){const{connectionId:e,token:t,studioUrl:s,meshUrl:r,orgId:o}=a,n=V({studioUrl:s,meshUrl:r});return{queryKey:te.mcpClient(o,e??"self",t??"",n??""),queryFn:()=>gt(a),staleTime:1/0,gcTime:6e4}}function St(a){const e=se.c(2);let t;e[0]!==a?(t=oe(a),e[0]=a,e[1]=t):t=e[1];const{data:s}=Je(t);return s}function Ct(a,e){const t=se.c(7);let s;t[0]!==e?(s=e===void 0?{}:e,t[0]=e,t[1]=s):s=t[1];const{enabled:r}=s,o=r===void 0?!0:r;let n;t[2]!==a?(n=oe(a),t[2]=a,t[3]=n):n=t[3];let i;t[4]!==o||t[5]!==n?(i={...n,enabled:o},t[4]=o,t[5]=n,t[6]=i):i=t[6];const{data:u}=We(i);return u??null}export{Xe as A,nt as C,Be as P,ft as S,Ct as a,ut as b,gt as c,ct as d,oe as m,L as n,St as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as l,i as u,cW as m,cX as f,V as y,K as n}from"./index-_MevbWo3.js";async function c(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],u(a)}export{q as a,b as g,c as l,g as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as f,V as p,i as q,K as m}from"./index-_MevbWo3.js";function C(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],p(o)}function g(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],q(o)}function L(n){const e=f.c(21);let t,s,l,i;e[0]!==n?({client:t,toolName:i,toolArguments:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l,e[4]=i):(t=e[1],s=e[2],l=e[3],i=e[4]);let r,o,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==i){const T=JSON.stringify(l??{});u=p,r=s,o=m.mcpToolCall(t,i,T),e[5]=t,e[6]=s,e[7]=l,e[8]=i,e[9]=r,e[10]=o,e[11]=u}else r=e[9],o=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==i?(a=async()=>await t.callTool({name:i,arguments:l}),e[12]=t,e[13]=l,e[14]=i,e[15]=a):a=e[15];const y=s.staleTime??3e4;let c;return e[16]!==r||e[17]!==o||e[18]!==a||e[19]!==y?(c={...r,queryKey:o,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=o,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,L as b,g as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s}from"./index-_MevbWo3.js";const n=768,r=`(max-width: ${n-1}px)`;function o(e){const t=globalThis.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}const a=()=>globalThis.innerWidth<n,c=()=>!1;function h(){return s.useSyncExternalStore(o,a,c)}export{h as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as T,b as q,e as j,K as C,fS as S}from"./index-_MevbWo3.js";import{u as B}from"./use-voice-input-C18ylsuI.js";import{x as F,c as H,u as U,v as J,aj as N,ax as R,Z as W,X as A,Y as L,aq as Y,ar as g,as as z,au as G,aF as X,aE as Z,aD as _,y as b,$ as D}from"./site-editor-toast-CyhiGEEx.js";import{s as $}from"./sandbox-git-api-WixIcpAj.js";import{u as V}from"./chat-context-gA7Mp2aY.js";import{i as M,H as I}from"./hosted-reconcile-7SkSTCNW.js";import{b as E}from"./sandbox-url-D3mC8qhT.js";import{d as O}from"./utils-Bdtf12J4.js";function ue({orgSlug:i,virtualMcpId:t,branch:o}){const s=T(),y=V()?.taskId??null,P=F(t),Q=B(t).runtime==="cms",{url:v}=H(t),d=U(t,o),f=d.kind==="protocol"?d:null,l=J({orgSlug:i,virtualMcpId:t,branch:o}),h=C.decofile(l),K=q(),x=async(r,c)=>{if(v)return{ok:!0};if(Q){const a=await Z({orgSlug:i,virtualMcpId:t,branch:o},{set:r,delete:c});return _(s,{orgSlug:i,virtualMcpId:t,branch:o},a),await s.invalidateQueries({queryKey:$({orgSlug:i,virtualMcpId:t,branch:o,threadId:y})}),a}const u={orgSlug:i,virtualMcpId:t,branch:o,threadId:y};for(const[a,n]of Object.entries(r)){const e=await fetch(E(u,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:b(P,O(a)),content:JSON.stringify(n,null,2)})});if(!e.ok)return D(e,"Write")}for(const a of c){const n=await fetch(E(u,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:b(P,O(a))})});if(!n.ok)return D(n,"Delete")}return{ok:!0}},p=j({mutationKey:L(i,t,o),scope:A(i,t,o),mutationFn:async({writes:r,deletes:c,copies:u,shown:a})=>{if(d.kind==="pending"||d.kind==="unavailable")throw N("CMS storage");const n=f?.source==="github"?r:S(r);return f?.source==="github"?M({queryClient:s,backend:f,params:{orgSlug:i,virtualMcpId:t,branch:o},cacheKey:l},{writes:n,deletes:c.filter(e=>!(e in n))},u,a?.()):f?R(s,f,{orgSlug:i,virtualMcpId:t,branch:o},l,{set:n,delete:c.filter(e=>!(e in n))}):W({queryClient:s,orgSlug:i,virtualMcpId:t,branch:o,backend:d,cacheKey:l},{kind:"edit",write:()=>x(n,c)})},onSuccess:()=>{f?.source!=="github"&&s.invalidateQueries({queryKey:C.liveMeta(i,t,o)})}});return{move:async(r,c)=>{const u=[...Object.keys(r.writes),...r.deletes],a=s.getQueryData(h),n=new Map;for(const e of u)a&&e in a&&n.set(e,a[e]);s.setQueryData(h,e=>ee(e,r)),s.cancelQueries({queryKey:h});try{return await p.mutateAsync({...r,copies:a,shown:c?.shown})}catch(e){throw e instanceof I?(Y(K,e.deleted,e.deleted&&r.deletes.length>0&&r.deletes.every(m=>g(s,l,m))),e):(z(K,e),f?.source==="github"&&(G(e)||e instanceof X)||s.setQueryData(h,m=>{if(!m)return m;const w={...m};for(const k of u)n.has(k)?w[k]=n.get(k):delete w[k];return w}),e)}},isPending:p.isPending,isError:p.isError}}function ee(i,{writes:t,deletes:o}){const s={...i??{},...t};for(const y of o)y in t||delete s[y];return s}export{ee as a,ue as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as m,aB as F,aD as $,i as S,av as _,K as y,dS as K,ad as N,d as M,a as G,cP as H,dN as q}from"./index-_MevbWo3.js";import{h as R,r as P,g as D,e as Q,d as x}from"./repository-binding-CcYacKs1.js";import{t as B,i as W,c as Y,w as z}from"./thread-intent-BpGkWTcJ.js";const p=[],J=4;function V(t,e){return[e,...t.filter(n=>n!==e)].slice(0,J)}function X(t){const e=m.c(9);let n;e[0]!==t?(n=$.recentProjects(t),e[0]=t,e[1]=n):n=e[1];const[a,o]=F(n,p),r=Array.isArray(a)?a:p;let s,c;e[2]!==o?(s=l=>o(u=>V(Array.isArray(u)?u:p,l)),c=l=>o(u=>(Array.isArray(u)?u:p).filter(h=>h!==l)),e[2]=o,e[3]=s,e[4]=c):(s=e[3],c=e[4]);let i;return e[5]!==r||e[6]!==s||e[7]!==c?(i={recent:r,remember:s,forget:c},e[5]=r,e[6]=s,e[7]=c,e[8]=i):i=e[8],i}function C(t,e,n,a,o){let r=null;for(const s of t)s.virtual_mcp_id===e&&s.created_by===n&&(s.hidden||B(s,a)&&(o&&s.branch===o||(!r||s.updated_at>r.updated_at)&&(r=s)));return r}function be(t,e,n,a,o){const r=o?.blogDrafts??!1;return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&W(s.branch)===r&&B(s,a))}function Z(t,e,n,a,o,r){if(!o)return C(t,e,n,a)??void 0;const s=a==="cms"?new Set((r?.releases??[]).filter(i=>i.runtime==="sandbox").map(i=>i.branch)):null,c=s?.size?t.filter(i=>!i.branch||!s.has(i.branch)):t;return C(c,e,n,a,r?.baseBranch)??void 0}const E=6e4,ee=5*6e4,k=3e4;function T(t,e){const n=K(t.error);return n===null?0:Math.max(0,t.errorUpdatedAt+n-e)}const A={refetchOnWindowFocus:t=>T(t.state,Date.now())===0,refetchOnMount:t=>T(t.state,Date.now())===0};function L(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function te(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function ne(t,e){const n=T(t,e);return n>0?Math.max(n,E):t.data===void 0||t.data.changeRequest?.state==="open"?E:ee}function I(t){const{orgSlug:e,target:n,owner:a,repo:o,branch:r}=t;return{queryKey:y.githubPrState(e,P(n),a,o,r),queryFn:()=>_(e,"CHANGE_REQUEST_STATE",{...n,branch:r}),enabled:!!r&&R(n)&&!!a&&!!o,...A,refetchInterval:s=>ne(s.state,Date.now()),refetchIntervalInBackground:!1,staleTime:k}}function ae(t){const e=m.c(4);let n;e[0]!==t?(n=I(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:se},e[2]=n,e[3]=a):a=e[3],S(a)}function se(t){return t.changeRequest?L(t.changeRequest):null}function pe(t){const e=m.c(4);let n;e[0]!==t?(n=I(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:re},e[2]=n,e[3]=a):a=e[3],S(a)}function re(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(te):[]}const oe=5*6e4;function Se(t){const e=m.c(20),{orgSlug:n,target:a,owner:o,repo:r,base:s}=t;let c;e[0]!==s||e[1]!==n||e[2]!==o||e[3]!==r||e[4]!==a?(c=y.githubLastPublishedPr(n,P(a),o,r,s),e[0]=s,e[1]=n,e[2]=o,e[3]=r,e[4]=a,e[5]=c):c=e[5];let i;e[6]!==s||e[7]!==n||e[8]!==a?(i=()=>_(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:s}),e[6]=s,e[7]=n,e[8]=a,e[9]=i):i=e[9];let l;e[10]!==t.enabled||e[11]!==s||e[12]!==o||e[13]!==r||e[14]!==a?(l=(t.enabled??!0)&&!!s&&R(a)&&!!o&&!!r,e[10]=t.enabled,e[11]=s,e[12]=o,e[13]=r,e[14]=a,e[15]=l):l=e[15];let u;return e[16]!==c||e[17]!==i||e[18]!==l?(u={queryKey:c,queryFn:i,enabled:l,...A,staleTime:oe,select:ie},e[16]=c,e[17]=i,e[18]=l,e[19]=u):u=e[19],S(u)}function ie(t){return t.changeRequest?L(t.changeRequest):null}const ce=50;function Ee(t){const e=m.c(17),{orgSlug:n,target:a,owner:o,repo:r}=t;let s;e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==a?(s=y.githubOpenPrs(n,P(a),o,r),e[0]=n,e[1]=o,e[2]=r,e[3]=a,e[4]=s):s=e[4];let c;e[5]!==n||e[6]!==a?(c=()=>_(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:ce}),e[5]=n,e[6]=a,e[7]=c):c=e[7];let i;e[8]!==t.enabled||e[9]!==o||e[10]!==r||e[11]!==a?(i=(t.enabled??!0)&&R(a)&&!!o&&!!r,e[8]=t.enabled,e[9]=o,e[10]=r,e[11]=a,e[12]=i):i=e[12];let l;return e[13]!==s||e[14]!==c||e[15]!==i?(l={queryKey:s,queryFn:c,enabled:i,...A,staleTime:k,select:le},e[13]=s,e[14]=c,e[15]=i,e[16]=l):l=e[16],S(l)}function le(t){return t.changeRequests.map(L)}function ue(t,e){const{org:n}=N(),a=D(t);return ae({orgId:n.id,orgSlug:n.slug,target:Q(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const de=[];function Te(){const t=m.c(13),e=M(),{org:n,locator:a}=N(),o=x(),{data:r}=G.useSession(),s=Y(),c=ue(void 0,null),{remember:i}=X(n.slug);let l;t[0]!==c||t[1]!==o||t[2]!==a||t[3]!==s?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==r?.user?.id?(l=(d,g,f)=>{if(H(g).kind==="org-destination"){q(e,{tabId:g,org:n.slug,agentId:d,replace:!1});return}const w=(o??[]).find(j=>j.id===d),U=!!(w&&D(w)),v=!f,O=v?void 0:Z(s?.threads.get()??de,d,r?.user?.id,f,U,{baseBranch:c}),b=v?void 0:O?.id??crypto.randomUUID();b&&!O&&f&&z(sessionStorage,a,b,{runtime:f}),q(e,{tabId:g,org:n.slug,agentId:d,search:()=>b?{thread:b}:{},replace:!1})},t[0]=c,t[1]=o,t[2]=a,t[3]=s?.threads,t[4]=e,t[5]=n.slug,t[6]=r?.user?.id,t[7]=l):l=t[7];const u=l;let h;return t[8]!==u||t[9]!==e||t[10]!==n.slug||t[11]!==i?(h=(d,g)=>{const f=g?.panel;if(!f){i(d),e(fe(n.slug,d));return}u(d,f,g?.runtime)},t[8]=u,t[9]=e,t[10]=n.slug,t[11]=i,t[12]=h):h=t[12],h}function fe(t,e){return{to:"/$org/projects/$agentId",params:{org:t,agentId:e},search:n=>({...n,project:void 0,virtualmcpid:void 0,thread:void 0,mainpanel:void 0})}}export{X as a,ue as b,Z as c,Ee as d,ae as e,be as f,Se as g,pe as h,I as p,Te as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as F,ad as w,K as y,i as $,q as k,e as P}from"./index-_MevbWo3.js";import{u as x}from"./useInfiniteQuery-HpTGLEmD.js";function G(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function p(n,e,t,s){const i=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${i?`?${i}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let i="";try{i=(await s.json()).error??""}catch{}throw new Error(i||`HTTP ${s.status}`)}async function E(n,e,t){return(await(await h(p(n,e,"list",{path:t}))).json()).entries.toSorted((r,a)=>r.kind!==a.kind?r.kind==="dir"?-1:1:r.path.localeCompare(a.path))}function Z(n,e,t){const s=F.c(16),{org:i}=w(),r=t?.enabled??!0;let a;s[0]!==i.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(i.id,n,e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let o;s[4]!==i.id||s[5]!==n?(o=(f,u)=>u?.queryKey[1]===i.id&&u.queryKey[2]===n?f:void 0,s[4]=i.id,s[5]=n,s[6]=o):o=s[6];let c;s[7]!==i.slug||s[8]!==e||s[9]!==n?(c=()=>E(i.slug,n,e),s[7]=i.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let l;return s[11]!==r||s[12]!==a||s[13]!==o||s[14]!==c?(l={enabled:r,queryKey:a,placeholderData:o,queryFn:c},s[11]=r,s[12]=a,s[13]=o,s[14]=c,s[15]=l):l=s[15],$(l)}async function _(n,e,t){const s=await h(p(n,e,"stat",{path:t}),void 0,{allow404:!0});return s.status===404?null:(await s.json()).entry}function v(n,e,t){const s=F.c(16),{org:i}=w();let r;s[0]!==i.id||s[1]!==e||s[2]!==n?(r=y.orgFsStat(i.id,n??"",e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=r):r=s[3];const a=n!==null,o=t?.staleTime;let c;s[4]!==t?(c=t?.refetchIntervalWhenAbsent?u=>u.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=c):c=s[5];let l;s[6]!==i.slug||s[7]!==e||s[8]!==n?(l=()=>_(i.slug,n??"",e),s[6]=i.slug,s[7]=e,s[8]=n,s[9]=l):l=s[9];let f;return s[10]!==r||s[11]!==a||s[12]!==o||s[13]!==c||s[14]!==l?(f={queryKey:r,enabled:a,staleTime:o,refetchInterval:c,queryFn:l},s[10]=r,s[11]=a,s[12]=o,s[13]=c,s[14]=l,s[15]=f):f=s[15],$(f)}function ee(n,e){const t=F.c(9),s=n===void 0?60:n,{org:i}=w();let r;t[0]!==i.id?(r=y.orgFsRecent(i.id),t[0]=i.id,t[1]=r):r=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==i.slug?(o=async()=>(await(await h(`/api/${encodeURIComponent(i.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=i.slug,t[4]=o):o=t[4];let c;return t[5]!==r||t[6]!==a||t[7]!==o?(c={queryKey:r,enabled:a,queryFn:o},t[5]=r,t[6]=a,t[7]=o,t[8]=c):c=t[8],$(c)}const R=200;function te(n){const e=F.c(9),{org:t}=w();let s;e[0]!==t.id||e[1]!==n?(s=y.orgFsVolumeFiles(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let i;e[3]!==t.slug||e[4]!==n?(i=async a=>{const{pageParam:o}=a,c=new URLSearchParams({limit:String(R)});return o&&c.set("before",o),await(await h(`/api/${encodeURIComponent(t.slug)}/fs/${encodeURIComponent(n)}/files?${c}`)).json()},e[3]=t.slug,e[4]=n,e[5]=i):i=e[5];let r;return e[6]!==s||e[7]!==i?(r={queryKey:s,initialPageParam:null,queryFn:i,getNextPageParam:C},e[6]=s,e[7]=i,e[8]=r):r=e[8],x(r)}function C(n){return n.next??void 0}const U=50;function se(n,e){const t=F.c(16),{org:s}=w();let i;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(i=y.orgFsSearch(s.id,n,e?.volume??"",e?.prefix??""),t[0]=s.id,t[1]=n,t[2]=e?.prefix,t[3]=e?.volume,t[4]=i):i=t[4];const r=n.length>0;let a;t[5]!==s.id?(a=(l,f)=>f?.queryKey[1]===s.id?l:void 0,t[5]=s.id,t[6]=a):a=t[6];let o;t[7]!==s.slug||t[8]!==n||t[9]!==e?(o=async()=>{const l=new URLSearchParams({q:n,limit:String(U)});return e&&(l.set("volume",e.volume),e.prefix&&l.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(s.slug)}/fs/search?${l}`)).json()).entries},t[7]=s.slug,t[8]=n,t[9]=e,t[10]=o):o=t[10];let c;return t[11]!==i||t[12]!==r||t[13]!==a||t[14]!==o?(c={queryKey:i,enabled:r,placeholderData:a,queryFn:o},t[11]=i,t[12]=r,t[13]=a,t[14]=o,t[15]=c):c=t[15],$(c)}function ne(n){const e=F.c(8),{org:t}=w();let s;e[0]!==t.id?(s=y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const i=n?.enabled;let r;e[2]!==t.slug?(r=async()=>{const o=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(j)},e[2]=t.slug,e[3]=r):r=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==r?(a={queryKey:s,enabled:i,queryFn:r},e[4]=s,e[5]=i,e[6]=r,e[7]=a):a=e[7],$(a)}function j(n){return{volume:n.volume,path:n.path}}async function Q(n){const e=await h(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}function ie(){const n=F.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.slashSkills(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=()=>Q(e.slug),n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}async function M(n,e,t){return(await h(p(n,e,"read",{path:t}))).text()}function re(n,e){const t=F.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const i=e?.enabled!==!1&&n!=="";let r;t[2]!==n?(r=async()=>{const o=await fetch(n,{credentials:"include"});return o.ok?await o.text():null},t[2]=n,t[3]=r):r=t[3];let a;return t[4]!==s||t[5]!==i||t[6]!==r?(a={queryKey:s,enabled:i,staleTime:6e4,retry:!1,queryFn:r},t[4]=s,t[5]=i,t[6]=r,t[7]=a):a=t[7],$(a)}const A=new Set(["md","mdx","markdown","txt","text"]),D=25,N=64*1024,H=256*1024,V=4;function W(n){const e=n.lastIndexOf(".");return e===-1?!1:A.has(n.slice(e+1).toLowerCase())}async function ae(n,e,t){const s=t?`${t}/`:"",i=u=>u.startsWith(s)?u.slice(s.length):u,r=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let g;try{g=(await(await h(p(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((b,m)=>b.path.localeCompare(m.path))){if(d.kind==="dir"){u.depth<V&&o.push({path:d.path,depth:u.depth+1});continue}W(d.path)&&d.size<=N&&r.length<D?r.push(d.path):a.push(i(d.path))}}const c=await Promise.all(r.map(u=>M(n,e,u).catch(()=>null))),l=[];let f=0;return r.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>H){a.push(i(u));return}f+=d.length,l.push({relPath:i(u),content:d})}),l.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:l,omittedPaths:a}}function oe(){const n=F.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}function le(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t.slug||e[1]!==n?(s=i=>p(t.slug,n,"read",{path:i}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ce(){const n=F.c(2),{org:e}=w();let t;return n[0]!==e.slug?(t=(s,i)=>p(e.slug,s,"read",{path:i}),n[0]=e.slug,n[1]=t):t=n[1],t}function ue(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async i=>(await(await h(p(t.slug,n,"file",{path:i.path}),{method:"PUT",headers:{"content-type":i.contentType??"text/html; charset=utf-8"},body:i.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],P(s)}async function fe(n,e,t,s,i,r="text/markdown; charset=utf-8"){const a={"content-type":r};i&&"absent"in i?a["if-none-match"]="*":i&&(a["if-match"]=`"${i.contentHash}"`);const o=await fetch(p(n,e,"file",{path:t}),{method:"PUT",headers:a,body:s});if(o.status===412)return{ok:!1,reason:"conflict"};if(o.status===403)return{ok:!1,reason:"forbidden"};if(!o.ok)throw new Error(`HTTP ${o.status}`);return{ok:!0,entry:(await o.json()).entry}}function de(n){const e=F.c(18),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==n?(i=async l=>(await(await h(p(t.slug,n,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=i):i=e[2];let r;e[3]!==t||e[4]!==s||e[5]!==n?(r=async l=>{const f=y.orgFsStat(t.id,n,l.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),g=l.mode!=="private";return s.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:l.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=r):r=e[6];let a;e[7]!==s?(a=(l,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let o;e[9]!==t||e[10]!==s||e[11]!==n?(o=(l,f,u)=>{s.invalidateQueries({queryKey:y.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=o):o=e[12];let c;return e[13]!==i||e[14]!==r||e[15]!==a||e[16]!==o?(c={mutationFn:i,onMutate:r,onError:a,onSettled:o},e[13]=i,e[14]=r,e[15]=a,e[16]=o,e[17]=c):c=e[17],P(c)}function X(n,e,t){n.invalidateQueries({queryKey:y.orgFsVolume(e,t)}),n.invalidateQueries({queryKey:y.orgFsRecent(e)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e)})}function ge(n){const e=F.c(33),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==s||e[2]!==n?(i=()=>X(s,t.id,n),e[0]=t,e[1]=s,e[2]=n,e[3]=i):i=e[3];const r=i;let a;e[4]!==t||e[5]!==n?(a=async S=>{const T=(await Promise.allSettled(S.files.map(L=>{const q=S.dir?`${S.dir}/${L.name}`:L.name;return h(p(t.slug,n,"file",{path:q}),{method:"PUT",headers:{"content-type":L.type||"application/octet-stream"},body:L})}))).find(Y);if(T)throw T.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==r||e[8]!==a?(o={mutationFn:a,onSettled:r},e[7]=r,e[8]=a,e[9]=o):o=e[9];const c=P(o);let l;e[10]!==t||e[11]!==n?(l=async S=>{await h(p(t.slug,n,"dir",{path:S}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=l):l=e[12];let f;e[13]!==r||e[14]!==l?(f={mutationFn:l,onSuccess:r},e[13]=r,e[14]=l,e[15]=f):f=e[15];const u=P(f);let g;e[16]!==t||e[17]!==n?(g=async S=>{await h(p(t.slug,n,"file",{path:S}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let d;e[19]!==r||e[20]!==g?(d={mutationFn:g,onSuccess:r},e[19]=r,e[20]=g,e[21]=d):d=e[21];const b=P(d);let m;e[22]!==t||e[23]!==n?(m=async S=>{await h(p(t.slug,n,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(S)})},e[22]=t,e[23]=n,e[24]=m):m=e[24];let I;e[25]!==r||e[26]!==m?(I={mutationFn:m,onSuccess:r},e[25]=r,e[26]=m,e[27]=I):I=e[27];const O=P(I);let K;return e[28]!==u||e[29]!==O||e[30]!==b||e[31]!==c?(K={upload:c,mkdir:u,remove:b,move:O},e[28]=u,e[29]=O,e[30]=b,e[31]=c,e[32]=K):K=e[32],K}function Y(n){return n.status==="rejected"}export{le as a,Q as b,v as c,ue as d,G as e,ae as f,de as g,re as h,E as i,ie as j,ge as k,ce as l,X as m,_ as n,M as o,ee as p,ne as q,oe as r,se as s,te as t,Z as u,fe as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as h,j as u,o as C,b as $,r as A,B as S,a as p,t as f,M,i as _,K as z,cO as D,aB as E,aD as I,d as G}from"./index-_MevbWo3.js";import{s as q}from"./XClose-Cwm3E7iC.js";import{S as F}from"./thread-intent-BpGkWTcJ.js";const K={switcher:"tour-layout-switcher",nav:"tour-layout-nav",tasks:"tour-layout-tasks",projects:"tour-layout-projects",account:"tour-layout-account",recentActivity:"tour-layout-recent-activity",siteEditor:"tour-layout-site-editor",surfaceTabs:"tour-layout-surface-tabs",branchPicker:"tour-layout-branch-picker",automations:"tour-layout-automations",settings:"tour-layout-settings"};function oe(e){return`[data-tour="${K[e]}"]`}function Y(e){return e!=="off"}function ie(e){if(!e.hasSource)return[];const t=["site-editor"];return Y(e.cmsMode)&&t.push("content"),e.runtime==="sandbox"&&t.push("code"),t}function B(e){return e==="site-editor"||e==="content"||e==="code"||e.startsWith("code:")}function ae(e){return e.reportsOnly&&!e.onReportAgent&&B(e.tabId)}const X={xs:"xs",sm:"xs",lg:"md"};function U(e){const t=h.c(4),{org:n,size:o}=e,s=o===void 0?"sm":o,r=n.logo??void 0,i=X[s];let a;return t[0]!==n.name||t[1]!==r||t[2]!==i?(a=u.jsx(C,{url:r,fallback:n.name,size:i,tone:"solid"}),t[0]=n.name,t[1]=r,t[2]=i,t[3]=a):a=t[3],a}function ce({invitation:e,onChanged:t}){const n=$(),[o,s]=A.useState(!1),r=e.organizationName??n("header.orgSwitcher.unknownOrganization"),i=async()=>{s(!0);try{const d=await p.organization.acceptInvitation({invitationId:e.id});if(d.error){f.error(d.error.message),s(!1);return}}catch{f.error(n("header.orgSwitcher.failedToAcceptInvitation")),s(!1);return}f.success(n("header.orgSwitcher.joined",{name:r})),M();let c;try{c=(await p.organization.getFullOrganization({query:{organizationId:e.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{s(!0);try{const c=await p.organization.rejectInvitation({invitationId:e.id});if(c.error){f.error(c.error.message),s(!1);return}f.success(n("header.orgSwitcher.invitationDeclined")),s(!1),t()}catch{f.error(n("header.orgSwitcher.failedToDeclineInvitation")),s(!1)}};return u.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[u.jsx(U,{org:{name:r},size:"sm"}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"truncate text-sm font-medium",children:r}),u.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n("header.orgSwitcher.invitedToJoin")})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(S,{size:"sm",variant:"default",onClick:i,disabled:o,children:n("header.orgSwitcher.accept")}),u.jsx(S,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground",onClick:a,disabled:o,"aria-label":n("header.orgSwitcher.declineInvitationTo",{name:r}),children:u.jsx(q,{size:14})})]})]})}function H(e){return typeof e=="object"&&e!==null&&Array.isArray(e.items)}function de(e){const t=h.c(13),n=e.trim(),{data:o}=p.useSession(),s=o?.user?.id??"",r=n.length>0&&!!s,i=z.organizationSearch(s,n);let a;t[0]!==n?(a=async P=>{const{signal:L}=P,w=await fetch(`/api/_me/organizations/search?q=${encodeURIComponent(n)}`,{signal:L});if(!w.ok)throw new Error(`Organization search failed: ${w.status}`);const R=await w.json();if(!H(R))throw new Error("Invalid organization search response");return R},t[0]=n,t[1]=a):a=t[1];let c;t[2]!==r||t[3]!==i||t[4]!==a?(c={queryKey:i,queryFn:a,enabled:r,placeholderData:D,staleTime:3e4,retry:!1},t[2]=r,t[3]=i,t[4]=a,t[5]=c):c=t[5];const{data:d,isFetching:k,isPlaceholderData:N,isError:O}=_(c);let l;t[6]!==d?.items?(l=d?.items??[],t[6]=d?.items,t[7]=l):l=t[7];const b=r&&k,x=r&&N;let y;return t[8]!==O||t[9]!==l||t[10]!==b||t[11]!==x?(y={hits:l,isSearching:b,isStale:x,isError:O},t[8]=O,t[9]=l,t[10]=b,t[11]=x,t[12]=y):y=t[12],y}const J=3,T=10,Q=440,V=55;function ue(e){const t=Math.floor((e-Q)/V);return Math.min(T,Math.max(J,t))}function W(e,t,n=T*3,o=[]){return[...new Set([t,...o,...e])].slice(0,n)}function le(e,t){return!t.id||e.some(n=>n.slug===t.slug)?[...e]:[...e,t]}function fe(e,t,n,o,s=[]){if(e.length<=o)return{shown:[...e],hidden:[]};const r=new Map(e.map(a=>[a.slug,a])),i=new Set;n&&r.has(n)&&i.add(n);for(const a of s)r.has(a)&&i.add(a);for(const a of t){if(i.size>=o)break;r.has(a)&&i.add(a)}for(const a of e){if(i.size>=o)break;i.add(a.slug)}return{shown:e.filter(a=>i.has(a.slug)),hidden:e.filter(a=>!i.has(a.slug))}}const v=[];function Z(){const e=h.c(6);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=I.recentOrgs(),e[0]=t):t=e[0];const[n,o]=E(t,v),s=Array.isArray(n)?n:v;let r;e[1]!==o?(r=(a,c)=>o(d=>W(Array.isArray(d)?d:[],a,void 0,c)),e[1]=o,e[2]=r):r=e[2];let i;return e[3]!==s||e[4]!==r?(i={recent:s,remember:r},e[3]=s,e[4]=r,e[5]=i):i=e[5],i}const j={hidden:[],pinned:[],order:[]},g=(e,t)=>e.filter(n=>n!==t);function ee(e){if(typeof e!="object"||e===null)return j;const t=o=>Array.isArray(o)?o.filter(s=>typeof s=="string"):[],n=e;return{hidden:t(n.hidden),pinned:t(n.pinned),order:t(n.order)}}function he(e,t){return{...e,hidden:[...g(e.hidden,t),t],pinned:g(e.pinned,t)}}function te(e,t){return{...e,hidden:g(e.hidden,t)}}function me(e,t){return e.pinned.includes(t)?{...e,pinned:g(e.pinned,t)}:{...e,hidden:g(e.hidden,t),pinned:[...e.pinned,t]}}function ge(e,t,n){const o=s=>{const r=t.order.indexOf(s);return r===-1?Number.MAX_SAFE_INTEGER:r};return e.filter(s=>s.slug===n||!t.hidden.includes(s.slug)).map((s,r)=>({org:s,index:r})).sort((s,r)=>Number(t.pinned.includes(r.org.slug))-Number(t.pinned.includes(s.org.slug))||o(s.org.slug)-o(r.org.slug)||s.index-r.index).map(({org:s})=>s)}function ye(e,t,n,o){const s=t.indexOf(n),r=t.indexOf(o);if(s===-1||r===-1||s===r||e.pinned.includes(n)!==e.pinned.includes(o))return e;const i=[...t];return i.splice(s,1),i.splice(r,0,n),{...e,order:[...i,...e.order.filter(a=>!i.includes(a))]}}function pe(){const e=h.c(5),t=G(),{remember:n}=Z();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=I.railOrgPrefs(),e[0]=o):o=e[0];const[,s]=E(o,j);let r;return e[1]!==t||e[2]!==n||e[3]!==s?(r=(i,a)=>{const c=a?.includes(i)??!1;s(d=>te(ee(d),i)),n(i,c?a:void 0),t({to:"/$org/home",params:{org:i},search:{thread:void 0},viewTransition:!0})},e[1]=t,e[2]=n,e[3]=s,e[4]=r):r=e[4],r}const m=new F(!1);function Oe(){m.set(!0)}function be(){m.set(!1)}function xe(){const e=h.c(2),t=A.useSyncExternalStore(m.subscribe,m.get);let n;return e[0]!==t?(n=[t,m.set],e[0]=t,e[1]=n):n=e[1],n}function we(e){const t=h.c(8);let n;t[0]!==e?(n=z.orgNotice(e??""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==e?(o=async()=>{const i=await fetch(`/api/${e}/notice`,{credentials:"include"});return i.ok?(await i.json()).notice??null:null},t[2]=e,t[3]=o):o=t[3];const s=!!e;let r;return t[4]!==n||t[5]!==o||t[6]!==s?(r={queryKey:n,queryFn:o,enabled:s,staleTime:6e4},t[4]=n,t[5]=o,t[6]=s,t[7]=r):r=t[7],_(r)}export{j as E,ce as I,K as L,U as O,de as a,Z as b,pe as c,fe as d,ge as e,ue as f,Y as g,he as h,B as i,xe as j,be as k,oe as l,ye as m,ie as n,Oe as o,ee as r,ae as s,me as t,we as u,le as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as r,ad as f,au as y,K as S,i as _,q as d,e as R}from"./index-_MevbWo3.js";const p=5e3;function m(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=r.c(7),{org:n}=f(),t=y();let i;e[0]!==n.id?(i=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=i):i=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==i||e[5]!==s?(o={queryKey:i,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=i,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return m(e.state.data)?p:!1}function P(){const e=r.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function q(){const e=r.c(12),{org:n}=f(),t=y(),i=d();let s;e[0]!==n||e[1]!==i?(s=()=>i.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=i,e[2]=s):s=e[2];const o=s;let c;e[3]!==t?(c=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=c):c=e[4];let a;e[5]!==o||e[6]!==t?(a=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=a):a=e[7];let l;return e[8]!==o||e[9]!==c||e[10]!==a?(l={mutationFn:c,onSuccess:a,onSettled:o},e[8]=o,e[9]=c,e[10]=a,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=r.c(8),{org:n}=f(),t=y(),i=d();let s;e[0]!==t?(s=a=>t.call("ORG_REPO_SYNC_DELETE",{id:a}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==i?(o=()=>i.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=i,e[4]=o):o=e[4];let c;return e[5]!==s||e[6]!==o?(c={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=c):c=e[7],R(c)}export{P as a,q as b,T as c,g as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,i as S,q as r,e as y,K as c}from"./index-_MevbWo3.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function m(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{C as a,O as b,m as c,h as d,q as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,ad as _,i as x,av as P,K as g,a as $,dZ as A,au as S,q as y,e as p}from"./index-_MevbWo3.js";import{D as I,o as N,a as w}from"./schema-jtnIkAdC.js";import{r as M}from"./task-board-DnXBfWZ7.js";const C={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},G={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function R(t,e){return{queryKey:g.organizationSettings(e),queryFn:async()=>{try{return await P(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...C,organizationId:e}}},staleTime:6e4}}function d(t){const e=u.c(7),{org:n}=_();let s;e[0]!==n.id||e[1]!==n.slug?(s=R(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t,a=!!n.id;let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i={...s,select:o,enabled:a},e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],x(i)}function E(){const t=u.c(9),{org:e}=_(),n=S(),s=y();let o;t[0]!==e||t[1]!==n?(o=async l=>{const r=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!r)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return r},t[0]=e,t[1]=n,t[2]=o):o=t[2];let a;t[3]!==e||t[4]!==s?(a=l=>{s.setQueryData(g.organizationSettings(e.id),r=>({...r??C,...l}))},t[3]=e,t[4]=s,t[5]=a):a=t[5];let i;return t[6]!==o||t[7]!==a?(i={mutationFn:o,onSuccess:a},t[6]=o,t[7]=a,t[8]=i):i=t[8],p(i)}function z(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:G}function K(){const{data:t}=d(D);return t??G}function D(t){return z(t.simple_mode)}function V(){const t=u.c(7),e=E();let n,s;t[0]!==e?(n=(a,i)=>e.mutate({simple_mode:a},i),s=(a,i)=>e.mutateAsync({simple_mode:a},i),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function Y(){return m("reports_only")}function m(t){const e=u.c(5);let n;e[0]!==t?(n=a=>N(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=d(n);let o;return e[2]!==s||e[3]!==t?(o=s??I.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function J(t){const e=u.c(6);let n;e[0]!==t?(n=i=>N(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s,isError:o}=d(n);let a;return e[2]!==s||e[3]!==t||e[4]!==o?(a=s??(o?I.has(t):void 0),e[2]=s,e[3]=t,e[4]=o,e[5]=a):a=e[5],a}function W(){const t=m("chat_harness_sandbox_only");return A().runtime.agentSandbox&&t}function H(){const t=u.c(8),{org:e}=_(),n=S(),s=y();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_BLOCKS_EDITOR_SET",{enabled:l}),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{enabled:r}=l;s.setQueryData(g.organizationSettings(e.id),c=>c&&{...c,flags:{...c.flags,new_blocks_editor:r}})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],p(i)}function X(){const{data:t}=d(v);return t??null}function v(t){return t.plan_objective??null}function tt(){const t=u.c(8),{org:e}=_(),n=S(),s=y();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_PLAN_OBJECTIVE_SET",l),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{plan_objective:r}=l;s.setQueryData(g.organizationSettings(e.id),c=>c&&{...c,plan_objective:r})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],p(i)}function et(){const t=u.c(2),e=S();let n;return t[0]!==e?(n={mutationFn:()=>e.call("ORGANIZATION_PLAN_OBJECTIVE_FIND",{})},t[0]=e,t[1]=n):n=t[1],p(n)}function L(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function nt(){const t=u.c(8),{data:e}=$.useSession(),n=A();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||L(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,a=n.hostingControlPlaneGa===!0,i=n.monitorGa===!0,l=m("hosting_enabled"),r=m("e2e_enabled"),c=m("monitor_enabled"),F=m("experiments_enabled"),O=o||a||l,b=o||a||r,T=o||i||c,h=o||a||F;let f;return t[3]!==O||t[4]!==b||t[5]!==T||t[6]!==h?(f={hosting:O,e2e:b,monitor:T,experiments:h},t[3]=O,t[4]=b,t[5]=T,t[6]=h,t[7]=f):f=t[7],f}function st(){const{data:t}=d(j);return t??!1}function j(t){return w(t.flags)}function ot(){const{data:t}=d(q);return t??!0}function q(t){return M(t.flags)}function at(){const t=u.c(7),e=E();let n,s;t[0]!==e?(n=(a,i,l)=>e.mutate({flags:{[a]:i}},l),s=(a,i,l)=>e.mutateAsync({flags:{[a]:i}},l),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function it(){const t=u.c(2),{data:e}=d(Z);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Z(t){return t.coding_agent_mcp_excluded}function lt(){const t=u.c(5),e=E();let n;t[0]!==e?(n=(o,a)=>e.mutate({coding_agent_mcp_excluded:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function ut(){const t=u.c(2),{data:e}=d(k);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function k(t){return t.submodule_credentials}function rt(){const t=u.c(5),e=E();let n;t[0]!==e?(n=(o,a)=>e.mutateAsync({submodule_credentials:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutateAsync:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}export{Y as a,W as b,J as c,K as d,nt as e,ot as f,X as g,tt as h,et as i,H as j,st as k,at as l,it as m,lt as n,V as o,ut as p,rt as q,m as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as p,f as g,u as S,dM as _,d as k,l as P,cP as b,dN as E}from"./index-_MevbWo3.js";import{c as I}from"./thread-route-k0OQaEgp.js";import{u as R}from"./use-project-scope-DgBS55KP.js";function x(e){const t=e.destination==="agent",a={thread:t?e.previous.thread:void 0,sidepanel:e.previous.sidepanel,autosend:t?e.previous.autosend:void 0};return{...e.update?e.update(a):a,mainpanel:void 0}}function M(){const e=p.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={structuralSharing:!0,select:N},e[0]=t):t=e[0],P(t)}function N(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData;if(a?.mainView||a?.siteEditorView)return{mainView:a.mainView,siteEditorView:a.siteEditorView}}return{mainView:void 0,siteEditorView:void 0}}function A(){const e=p.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=g(t);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[1]=o):o=e[1];const i=S(o),s={file:"file"in i&&typeof i.file=="string"?i.file:void 0,key:"key"in i&&typeof i.key=="string"?i.key:void 0,path:"path"in i&&typeof i.path=="string"?i.path:void 0},{mainView:r,siteEditorView:n}=M();return _({mainView:r,siteEditorView:n,params:a,search:s})}function D(){const e=p.c(11),t=k();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const o=g(a),i=I(),s=R(),r=o.org??"";let n;e[1]!==t||e[2]!==r||e[3]!==i||e[4]!==s?(n=(d,c)=>{const h=b(d),v=c?.virtualmcpid!==void 0||s!==null?"project":"organization",y=h.kind==="org-destination"||h.kind==="project-destination"&&v==="organization",V=w=>x({previous:w,destination:y?"organization":"agent",update:c?.search});E(t,{org:r,agentId:c?.virtualmcpid??i,tabId:d,destinationScope:v,taskKey:c?.taskKey,search:V,replace:c?.replace??!0})},e[1]=t,e[2]=r,e[3]=i,e[4]=s,e[5]=n):n=e[5];const m=n;let l;e[6]!==t?(l=d=>t({to:".",search:T,replace:d?.replace??!0}),e[6]=t,e[7]=l):l=e[7];const f=l;let u;return e[8]!==f||e[9]!==m?(u={openPanel:m,closePanel:f},e[8]=f,e[9]=m,e[10]=u):u=e[10],u}function T(e){return{...e,mainpanel:!1,sidepanel:!0}}export{D as a,x as r,A as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as C,ad as W,dZ as y,bC as B,i as N,K as F}from"./index-_MevbWo3.js";import{m as J}from"./match-site-slug-config-B47_xZCi.js";import{u as K}from"./use-file-configs-DIy_E2PQ.js";import{a as U}from"./use-blog-view-B1maq3jt.js";import{e as $}from"./use-organization-settings-DJvj_8Se.js";import{b as k}from"./use-blocks-v8-project-CwEvYiak.js";const d=["overview","context","monitor","plan","reports","board","site-editor","calendar","experiments","blog","assets","releases","hosting","e2e","automations"],q=["overview","reports","board","site-editor","blog"],O=1,D=["overview","context","monitor","plan","board"],L=["blog"],Q=["calendar","experiments"],H=["hosting"],Y={calendar:!1,hosting:!1,"site-editor":!1,blog:!1};function T(t){return[...D,...t.calendar?Q:[],...t.hosting&&t["site-editor"]?H:[],...t.blog?L:[]]}function Z(t,e){const n=new Set(t??[]);return T(e).filter(s=>!n.has(s))}function le(t,e,n){const s=new Set([...t??[],...T({...e,"site-editor":e["site-editor"]&&n.includes("site-editor")})]);return d.filter(r=>s.has(r))}function fe(t,e){if(!t&&e===void 0)return new Set(D);const n=new Set(e!==void 0?V(e,O):V(G(t),t?.sidebarViewsVersion,Z(t?.sidebarViewsSeen,Y)));return new Set(D.filter(s=>n.has(s)))}const z=["calendar","experiments","assets","releases","hosting","e2e"];function de(t,e,n){if(!t)return{project:n??null,resolvedScopeId:null};const s=e?.id===t?e:n?.id===t?n:null;return{project:s,resolvedScopeId:s?t:null}}function G(t){return t?.sidebarViews!==void 0?t.sidebarViews:t?.ui?.layout?.sidebarViews}function V(t,e,n=[]){const s=new Set(t??[]);if(e!==O)for(const r of q)s.add(r);for(const r of n)r==="hosting"&&!s.has("site-editor")||s.add(r);return d.filter(r=>s.has(r))}function X(t){return d.some(e=>e===t)}function M(t){return z.some(e=>e===t)}function ee(t,e){return{overview:t,context:!0,monitor:!0,plan:!0,reports:t,board:t,"site-editor":t,blog:t&&e.blog===!0,assets:e.assets,releases:t&&e.releases,hosting:e.hosting,e2e:e.e2e,calendar:t&&e.calendar,experiments:t&&e.experiments,automations:!0}}function ue(t,e,n){const s=ee(e,n);return t?s:{...s,overview:!0,reports:!0,board:!0}}function Se(t,e,n,s=[]){const r=new Set(V(t,n,s));return d.filter(o=>e[o]&&r.has(o))}function be(t,e,n){return n||!t?t:(t.type==="preview"||t.type==="content"||t.type==="code"?"site-editor":t.type)===e?{type:"settings"}:t}function ge(t){return d.filter(e=>t[e])}function te(t,e,n){return!X(t)||e[t]?!1:t==="blog"?n.blog!==!0:!M(t)||t==="releases"||t==="calendar"||t==="experiments"?!0:!(t==="assets"?n.assets:n.siteAccess)}function Ve(t,e,n,s,r){return te(t==="preview"||t==="content"||t==="code"?"site-editor":t,e,n)||t==="content"&&!s.includes("content")||t==="code"&&r&&!s.includes("code")}function we(t,e,n,s){const r=new Set(V(t,s));return n?r.add(e):r.delete(e),d.filter(o=>r.has(o))}function Pe(t){const e=C.c(22),{org:n}=W(),s=y(),r=$(),o=U(),i=K();let c;e[0]!==t?(c=k(t),e[0]=t,e[1]=c):c=e[1];const u=c;let S;e[2]!==t?(S=B(t),e[2]=t,e[3]=S):S=e[3];const a=S,w=s.hostingEnabled===!0,R=w&&!!a,j=se(n.slug,a,R),v=j.data?.owned===!0;let l;e[4]!==i.data?.configs?(l=i.data?.configs??[],e[4]=i.data?.configs,e[5]=l):l=e[5];const P=t?.metadata?.assetStorageConfigId;let b;e[6]!==a||e[7]!==l||e[8]!==P?(b=J(l,a,P),e[6]=a,e[7]=l,e[8]=P,e[9]=b):b=e[9];const E=!!b,m=u&&!!t?.metadata?.siteSlug,_=w&&v&&r.hosting,p=w&&v&&r.e2e,I=o===!0;let f;e[10]!==E||e[11]!==m||e[12]!==_||e[13]!==p||e[14]!==I||e[15]!==u?(f={assets:E,releases:m,hosting:_,e2e:p,calendar:u,experiments:u,blog:I},e[10]=E,e[11]=m,e[12]=_,e[13]=p,e[14]=I,e[15]=u,e[16]=f):f=e[16];const A=!!(a||t?.metadata?.assetStorageConfigId)&&i.isPending,h=R&&j.isPending,x=o===void 0;let g;return e[17]!==f||e[18]!==A||e[19]!==h||e[20]!==x?(g={presence:f,assetsPending:A,siteAccessPending:h,blogPending:x},e[17]=f,e[18]=A,e[19]=h,e[20]=x,e[21]=g):g=e[21],g}function se(t,e,n){const s=C.c(10);let r;s[0]!==t||s[1]!==e?(r=F.hostingAccess(t,e??""),s[0]=t,s[1]=e,s[2]=r):r=s[2];let o;s[3]!==t||s[4]!==e?(o=async()=>{const c=await fetch(`/api/${t}/hosting/${encodeURIComponent(e??"")}/access`);return c.ok?await c.json():{owned:!1,canWrite:!1}},s[3]=t,s[4]=e,s[5]=o):o=s[5];let i;return s[6]!==n||s[7]!==r||s[8]!==o?(i={queryKey:r,queryFn:o,enabled:n,staleTime:6e4},s[6]=n,s[7]=r,s[8]=o,s[9]=i):i=s[9],N(i)}export{d as P,Se as a,O as b,de as c,ue as d,Ve as e,te as f,V as g,ge as h,M as i,D as j,le as k,be as l,Z as o,ee as p,G as r,fe as s,we as t,Pe as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as I,f as P,u as N,d as T,cQ as R,dO as E,dN as O,an as l}from"./index-_MevbWo3.js";import{d as k,a as C,p as w}from"./repository-binding-CcYacKs1.js";const x=1;function b(e){return(e??[]).filter(E)}function M(){const e=I.c(4);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const r=P(o);let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[1]=n):n=e[1];const t=N(n);if(r.agentId)return r.agentId;let a;return e[2]!==t?(a="virtualmcpid"in t&&typeof t.virtualmcpid=="string"?t.virtualmcpid.trim():void 0,e[2]=t,e[3]=a):a=e[3],a||null}function D(){const e=I.c(16),o=T();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const n=P(r),t=R(),a=k(),c=b(a),s=M(),y=c.find(i=>i.id===s)??null;let p;e[1]!==a||e[2]!==s?(p=s&&a.length>0&&!a.some(i=>i.id===s)?s:null,e[1]=a,e[2]=s,e[3]=p):p=e[3];const _=C(p),u=y??b(_?[_]:[])[0]??null;let m;e[4]!==t||e[5]!==o||e[6]!==n||e[7]!==s?(m=i=>{if(i===s&&t!==void 0)return;const h=n.org??"",S=V;if(i){O(o,{org:h,agentId:i,tabId:t==="board"||t==="reports"?t:"overview",search:S,replace:!1});return}if(t==="board"){o({to:l.tasks,params:{org:h,taskKey:void 0},search:S});return}const j=t==="files"?l.library:t==="monitoring"?l.monitoring:t==="plan"?l.plan:l.home;o({to:j,params:{org:h},search:S})},e[4]=t,e[5]=o,e[6]=n,e[7]=s,e[8]=m):m=e[8];const f=m,v=w(u),g=c.length>=x;let d;return e[9]!==u||e[10]!==c||e[11]!==s||e[12]!==f||e[13]!==v||e[14]!==g?(d={scopeId:s,project:u,repo:v,projects:c,hasProjects:g,setScope:f},e[9]=u,e[10]=c,e[11]=s,e[12]=f,e[13]=v,e[14]=g,e[15]=d):d=e[15],d}function V(e){return{...e,virtualmcpid:void 0,thread:void 0,mainpanel:void 0,path:void 0,preview:void 0,expanded:void 0}}export{D as a,b as s,M as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as A,c as m,l as j,aB as y,aD as b,aq as N}from"./index-_MevbWo3.js";import{u as w}from"./use-blog-view-B1maq3jt.js";import{P as E}from"./project-apps-CMxAT7bs.js";import{a as P}from"./repository-binding-CcYacKs1.js";function M(n,e){const t=new Set(e);return t.size===0?n:n.filter(c=>t.has(c.connectionId))}function R(n){const e=n.metadata?.ui;return Array.isArray(e?.pinnedViews)?e.pinnedViews.filter(t=>!!t&&typeof t=="object"&&typeof t.connectionId=="string"&&typeof t.toolName=="string"&&["undefined","string"].includes(typeof t.label)&&(t.icon==null||typeof t.icon=="string")):[]}const V=4;function I(n,e){return n.app===e.app&&n.projectId===e.projectId}function h(n,e,t=V){return[e,...n.filter(c=>!I(c,e))].slice(0,t)}function _(n,e){return n.filter(t=>!I(t,e))}function O(n,e,t){const c=n.findLast(l=>l.staticData.mainView);if(!c)return null;const{mainView:i,siteEditorView:p,local:r}=c.staticData;if(!i)return null;const o=c.params,a=o?.agentId;if(a&&i==="app"&&o.connectionId&&o.toolName)return{app:t(o.connectionId,o.toolName),projectId:a,connection:{id:o.connectionId,toolName:o.toolName}};const s=p?"site-editor":i;return e(s)?a?{app:s,projectId:a}:r?{app:s,projectId:null}:null:null}const d=[];function S(n){const e=m.c(12);let t;e[0]!==n?(t=b.recentApps(n),e[0]=n,e[1]=t):t=e[1];const[c,i]=y(t,d),p=w(),r=Array.isArray(c)?c:d;let o;e[2]!==p||e[3]!==r?(o=p?r:r.filter(T),e[2]=p,e[3]=r,e[4]=o):o=e[4];let a,s;e[5]!==i?(a=f=>i(u=>h(Array.isArray(u)?u:[],f)),s=f=>i(u=>_(Array.isArray(u)?u:[],f)),e[5]=i,e[6]=a,e[7]=s):(a=e[6],s=e[7]);let l;return e[8]!==o||e[9]!==a||e[10]!==s?(l={recent:o,remember:a,forget:s},e[8]=o,e[9]=a,e[10]=s,e[11]=l):l=e[11],l}function T(n){return n.app!=="blog"}function g(){const n=m.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:L,structuralSharing:!0},n[0]=e):e=n[0],j(e)}function L(n){return O(n.matches,C,N)}function C(n){return n in E}function Y(n){const{remember:e}=S(n),t=g(),c=P(t?.projectId),i=t?.projectId&&c?.id===t.projectId?c.title:null,p=t?.connection&&c?R(c).find(o=>o.connectionId===t.connection?.id&&o.toolName===t.connection.toolName):void 0,r=t?.connection&&{id:t.connection.id,toolName:t.connection.toolName,label:p?.label||t.connection.toolName,icon:p?.icon};A.useEffect(()=>{!t?.projectId||!i||e({app:t.app,projectId:t.projectId,projectTitle:i,...r&&{connection:r}})},[n,t?.app,t?.projectId,i,r?.label,r?.icon])}export{g as a,S as b,M as k,R as p,Y as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as N,ad as Q,W as F,T as A,i as f,K as R,h7 as L,$ as K,U}from"./index-_MevbWo3.js";import{m as O}from"./use-mcp-client-B4vdBbCp.js";import{u as h}from"./companions-core-DhUD88pR.js";function D(n){return n?n.scanned_at?"ready":n.run_in_progress?"generating":"none":"none"}function M(n){return n.connectionQueryPending?!0:!n.hasConnection||n.cdClientFailed?!1:n.diagnosticQueryPending}const b=2e4;function q(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function j(){const n=N.c(24),{org:e}=Q(),t=F.REPORTS(e.id);let l;n[0]!==e.id||n[1]!==e.slug?(l=O({connectionId:A,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=l):l=n[2];const{data:p}=f(l),u=f({queryKey:R.reportsConnection(e.id,t),enabled:!!p,retry:!1,staleTime:6e4,queryFn:async()=>{if(!p)throw new Error("selfClient not ready");const _=await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(_)}}),m=u.data?.item??null,{data:s,isError:y}=f({...O({connectionId:t,orgId:e.id,orgSlug:e.slug}),enabled:!!m}),C=R.reportsDiagnostic(e.id,t),E=!!s;let i;n[3]!==s?(i=async()=>{if(!s)throw new Error("cdClient not ready");const _=await s.callTool({name:L,arguments:{}});return h(_).diagnostic??null},n[3]=s,n[4]=i):i=n[4];let d;n[5]!==C||n[6]!==E||n[7]!==i?(d={queryKey:C,enabled:E,retry:1,refetchInterval:v,queryFn:i},n[5]=C,n[6]=E,n[7]=i,n[8]=d):d=n[8];const r=f(d),o=m?.metadata?.siteUrl,P=r.data??null,w=r.isSuccess,I=!!m;let a;n[9]!==y||n[10]!==u.isPending||n[11]!==r.isPending||n[12]!==I?(a=M({connectionQueryPending:u.isPending,hasConnection:I,cdClientFailed:y,diagnosticQueryPending:r.isPending}),n[9]=y,n[10]=u.isPending,n[11]=r.isPending,n[12]=I,n[13]=a):a=n[13];const S=typeof o=="string"&&o?o:null;let c;n[14]!==o?(c=q(o),n[14]=o,n[15]=c):c=n[15];const T=s??null;let g;return n[16]!==t||n[17]!==r.isSuccess||n[18]!==c||n[19]!==T||n[20]!==P||n[21]!==a||n[22]!==S?(g={diagnostic:P,isSuccess:w,isLoading:a,siteUrl:S,host:c,connectionId:t,cdClient:T},n[16]=t,n[17]=r.isSuccess,n[18]=c,n[19]=T,n[20]=P,n[21]=a,n[22]=S,n[23]=g):g=n[23],g}function v(n){return n.state.status!=="error"&&D(n.state.data)==="generating"?b:!1}function B(n,e){return{to:K.app,params:{org:n.slug,agentId:U(n.id),connectionId:e,toolName:L},search:{}}}export{D as d,B as r,j as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as a,c as ve,j as J,ad as me,q as pe,K as L,cN as W}from"./index-_MevbWo3.js";import{h as Se,u as ge}from"./chat-context-gA7Mp2aY.js";import{b as ye}from"./sandbox-url-D3mC8qhT.js";import{b as be}from"./repository-binding-CcYacKs1.js";import{e as De}from"./backoff-CrEUbyZT.js";function z(t){return t==="installing"||t==="install-failed"||t==="starting"||t==="start-failed"||t==="running"||t==="crashed"}const Te={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ee=a.createContext(Te),X=16384;class Re{data="";append(e){this.data+=e,this.data.length>X&&(this.data=this.data.slice(this.data.length-X))}get(){return this.data}clear(){this.data=""}}const ke=1e3,Ce=3e4,xe=3e3,Le=1500,I=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],Z="log";function _e(t){if(!t)return null;try{return new URL("/_sandbox/events",t).href}catch{return null}}function Oe(t){return t===404}function we(t){return/(?:^|[\s;&|(])deno\s+task\b/.test(t)}async function Pe(t){try{const e=await fetch(t,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(xe)});return await e.body?.cancel().catch(()=>{}),Oe(e.status)}catch{return!1}}const te=Se(ee);function Ve(t){const e=ve.c(10);let i,f,o;e[0]!==t?({resetKey:o,children:i,...f}=t,e[0]=t,e[1]=i,e[2]=f,e[3]=o):(i=e[1],f=e[2],o=e[3]);let c;e[4]!==f||e[5]!==o?(c=J.jsx(Ne,{...f},o),e[4]=f,e[5]=o,e[6]=c):c=e[6];let h;return e[7]!==i||e[8]!==c?(h=J.jsx(te.Host,{source:c,children:i}),e[7]=i,e[8]=c,e[9]=h):h=e[9],h}function Ne(t){return te.usePublish(Be(t)),null}function Be({virtualMcpId:t,branch:e,previewUrl:i=null,enabled:f=!0}){const{org:o}=me(),c=pe(),h=ge()?.taskId??null,[se,_]=a.useState(null),[re,O]=a.useState({phase:"idle"}),[ae,w]=a.useState({state:"running"}),[oe,P]=a.useState({kind:"unknown"}),[ce,N]=a.useState(!1),[ue,B]=a.useState([]),[ie,K]=a.useState([]),[,le]=a.useState(0),p=a.useRef(new Map),A=a.useRef(new Set),T=a.useRef(new Set),F=a.useRef(null),R=_e(i),V=be(t)?.metadata?.runtime?.selected==="deno",de=l=>{let d=p.current.get(l);return d||(d=new Re,p.current.set(l,d)),d};return a.useEffect(()=>{if(_(null),O({phase:"idle"}),w({state:"running"}),P({kind:"unknown"}),F.current=null,N(!1),B([]),K([]),p.current.clear(),!t||!e||!f)return;const l=ye({orgSlug:o.slug,virtualMcpId:t,branch:e,threadId:h??null},"events");let d=!1,S=0,k=null,g=null,y=null,b=null,v=null,E=null,C=null,$=!1;const M=()=>{g&&clearTimeout(g),g=setTimeout(()=>{g=null,c.invalidateQueries({queryKey:L.liveMeta(o.slug,t,e)})},1e3)},fe=()=>{b&&clearTimeout(b),b=setTimeout(()=>{b=null;for(const n of T.current)try{n()}catch{}},Le)},he=n=>{try{const s=JSON.parse(n.data);_(s),s.kind!=="failed"&&(N(!1),S=0),s.kind==="ready"&&Y()}catch(s){console.warn("[vm-events] bad phase payload",s)}},j=()=>{N(!0),_(null),O({phase:"idle"}),w({state:"running"}),P({kind:"unknown"}),B([]),K([]),p.current.clear()},q=n=>{try{const s=JSON.parse(n.data);if(typeof s.data!="string")return;S=0;const u=s.data.replace(/\r?\n/g,`\r
|
|
2
|
+
`);de(s.source).append(u);for(const r of A.current)try{r(s.source,u)}catch{}le(r=>r+1)}catch{}},H=n=>{const s=n.type;try{const u=JSON.parse(n.data);switch(S=0,s){case"lifecycle":{const r=u;O(r.state);const D=`${o.slug}/${t}/${e}`;if(z(r.state.phase)&&!(C&&z(C))){W(c,o.id);const x=L.decofile(D);c.getQueryData(x)===void 0&&c.invalidateQueries({queryKey:x})}r.state.phase==="running"&&C!=="running"&&(W(c,o.id),c.invalidateQueries({queryKey:L.decofile(D)}),M()),C=r.state.phase;const m=r.state.phase==="running"?r.state.port:null,Q=F.current;if(F.current=m,Q!==null&&m!==null&&Q!==m)for(const x of T.current)try{x()}catch{}return}case"status":w(u);return;case"tasks":{const r=u;$=r.active.some(m=>we(m.command));const D=r.active.map(m=>m.logName??"").filter(Boolean);K(D);return}case"scripts":B(u.scripts);return;case"branch":{const r=u.meta;P(r);return}case"reload":for(const r of T.current)try{r()}catch{}return;case"file-changed":{const{path:r}=u,D=`${o.slug}/${t}/${e}`;if(r.startsWith(".deco/")||r.includes("/.deco/")){if(!(C==="running"))return;r.endsWith(".deco/meta.gen.json")&&M(),y&&clearTimeout(y),y=setTimeout(()=>{y=null,c.invalidateQueries({queryKey:L.decofile(D)})},500),(V||$)&&fe()}else M();return}}}catch{}};function U(){if(d)return;const n=new EventSource(l);v=n,n.onopen=()=>{},n.onerror=()=>{v===n&&n.readyState===EventSource.CLOSED&&G("studio")},n.addEventListener("phase",he),n.addEventListener("gone",j),n.addEventListener(Z,q);for(const s of I)n.addEventListener(s,H)}function Y(){if(d||!R||E)return;const n=new EventSource(R);E=n;let s=!1;n.onopen=()=>{if(d||E!==n)return;s=!0,S=0;const u=v;v=null,u?.close()},n.onerror=()=>{E===n&&n.readyState===EventSource.CLOSED&&Ee(n,s)},n.addEventListener(Z,q);for(const u of I)n.addEventListener(u,H)}async function Ee(n,s){const u=R?await Pe(R):!1;if(!(d||E!==n)){if(n.close(),E=null,u){j(),v||U();return}s&&G("direct")}}function G(n){if(d||k)return;const s=De(Ce,ke,S,2,0);S++,k=setTimeout(()=>{if(k=null,!d){if(n==="direct"){E?.close(),E=null,Y();return}v?.close(),v=null,U()}},s)}return U(),()=>{d=!0,v?.close(),E?.close(),k&&clearTimeout(k),g&&clearTimeout(g),y&&clearTimeout(y),b&&clearTimeout(b)}},[t,e,o.slug,o.id,f,h,R,c,V]),{phase:se,lifecycle:re,status:ae,branch:oe,notFound:ce,scripts:ue,activeProcesses:ie,getBuffer:l=>p.current.get(l)?.get()??"",hasData:l=>(p.current.get(l)?.get().length??0)>0,subscribeChunks:l=>(A.current.add(l),()=>{A.current.delete(l)}),subscribeReload:l=>(T.current.add(l),()=>{T.current.delete(l)})}}function ne(){return a.use(ee)}function $e(t){const{subscribeChunks:e}=ne(),i=a.useRef(t);i.current=t,a.useEffect(()=>e((c,h)=>{i.current?.(c,h)}),[e])}function je(t){const{subscribeReload:e}=ne(),i=a.useRef(t);i.current=t,a.useEffect(()=>e(()=>{i.current?.()}),[e])}export{Ve as S,$e as a,je as b,z as i,ne as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o,ad as c,au as r,K as l,V as y,q as f,e as S}from"./index-_MevbWo3.js";function C(){const e=o.c(7),{org:i}=c(),u=r();let a;e[0]!==i.id?(a=l.secrets(i.id),e[0]=i.id,e[1]=a):a=e[1];let t;e[2]!==u?(t=async()=>await u.call("SECRET_LIST",{}),e[2]=u,e[3]=t):t=e[3];let s;e[4]!==a||e[5]!==t?(s={queryKey:a,staleTime:6e4,queryFn:t},e[4]=a,e[5]=t,e[6]=s):s=e[6];const{data:n}=y(s);return n.secrets}function m(){const e=o.c(8),{org:i}=c(),u=r(),a=f();let t;e[0]!==u?(t=async d=>await u.call("SECRET_CREATE",{...d}),e[0]=u,e[1]=t):t=e[1];let s;e[2]!==i||e[3]!==a?(s=()=>{a.invalidateQueries({queryKey:l.secrets(i.id)})},e[2]=i,e[3]=a,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{m as a,C as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ii as ee,bz as te,c as M,b as re,r as b,j as i,m as se,by as oe,D as ie,v as le,x as ne,I as ce,w as ae}from"./index-_MevbWo3.js";import{b as G,f as V}from"./UserSquare-CY8RzqIc.js";import{b as fe}from"./agent-icon-BXpAi9QB.js";import{i as ue}from"./SearchMd-BIoAkvcK.js";import{a as _}from"./save-status-BQO2H7FQ.js";import{ac as de,l as me,an as ve}from"./blocks-tab-states-BwA_PwyL.js";import{aS as K,c as pe,u as xe,i as he,E as ge}from"./site-editor-toast-CyhiGEEx.js";import{d as Y,r as we}from"./held-block-view-DdkPiyr8.js";import{u as Se}from"./use-voice-input-C18ylsuI.js";function be(r){return r.schema?.definitions??r.schema?.$defs??{}}function Z(r,e){const t=be(e),s=t[btoa(r)];if(!s)return[];const o=[s];if(Array.isArray(s.allOf)){const n=s.allOf.find(l=>typeof l.$ref=="string")?.$ref;if(typeof n=="string"){const l=t[n.replace("#/definitions/","")];l&&o.push(l)}}return o}function je(r,e){for(const t of Z(r,e)){const s=typeof t.image=="string"?t.image:void 0;if(s?.includes("{{{"))return s}}function We(r,e){if(!e)return;const t=ee(r,te(e));if(!t)return;const s=je(t.resolveType,e);if(!s)return;const o=we(s,t.data);if(o)return Y(o)}function ye(r,e){for(const t of Z(r,e)){const s=typeof t.image=="string"?t.image:void 0;if(s&&!s.includes("{{"))return Y(s)}}const Ne=12,z=new Set,F=new Set;function Re(){for(const r of F)r()}function Pe(r){return z.has(r)?!0:z.size>=Ne?!1:(z.add(r),!0)}function Q(r){z.delete(r)&&Re()}function Ie(r){return F.add(r),()=>{F.delete(r)}}function Te(r,e){const t=b.useRef(!1),[s,o]=b.useState(!1),n=b.useRef(null),l=b.useRef(null),f=b.useRef(null),c=b.useRef(r);c.current=r;const[p]=b.useState(()=>{const u=()=>{f.current?.(),f.current=null},d=()=>t.current?!0:Pe(e)?(t.current=!0,o(!0),u(),!0):!1;return a=>{if(l.current=a,n.current&&(n.current.disconnect(),n.current=null),u(),!a){t.current&&(Q(e),t.current=!1,o(!1));return}queueMicrotask(()=>{if(l.current!==a)return;const w=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!d()&&!f.current&&(f.current=Ie(()=>{l.current===a&&d()}));return}u(),t.current&&(Q(e),t.current=!1,o(!1))},{root:c.current.current,rootMargin:"160px 0px"});w.observe(a),n.current=w})}});return{ref:p,iframeActive:s}}function Ce(r){const e=M.c(9),{previewUrl:t,title:s,scrollRootRef:o,slotId:n}=r,{ref:l,iframeActive:f}=Te(o,n),[c,p]=b.useState(!1),u=_()?V:G;let d;e[0]!==u||e[1]!==f||e[2]!==c||e[3]!==t||e[4]!==s?(d=f?i.jsxs(i.Fragment,{children:[!c&&i.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:i.jsx(u,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),i.jsx("iframe",{src:t,title:`Preview ${s}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>p(!0)})]}):i.jsx("div",{className:"flex h-full items-center justify-center",children:i.jsx(u,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=u,e[1]=f,e[2]=c,e[3]=t,e[4]=s,e[5]=d):d=e[5];let a;return e[6]!==l||e[7]!==d?(a=i.jsx("div",{ref:l,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:d}),e[6]=l,e[7]=d,e[8]=a):a=e[8],a}function Ue(r){const e=M.c(3),{image:t}=r,s=_()?V:G;let o;return e[0]!==s||e[1]!==t?(o=i.jsx("div",{className:"relative flex aspect-[16/10] w-full items-center justify-center overflow-hidden bg-muted/40",children:t?i.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):i.jsx(s,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=s,e[1]=t,e[2]=o):o=e[2],o}function Be(r){const e=M.c(28),{entry:t,previewUrl:s,image:o,scrollRootRef:n,onSelect:l}=r,c=_()?t.isSavedBlock?fe:V:G,p=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let u;e[0]!==p?(u=se("group flex flex-col overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-lg))] border bg-card text-left transition-colors shadow-edge","hover:border-primary/40 hover:bg-accent",p),e[0]=p,e[1]=u):u=e[1];let d;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==o||e[5]!==s||e[6]!==n?(d=s?i.jsx(Ce,{previewUrl:s,title:t.title,scrollRootRef:n,slotId:t.resolveType}):i.jsx(Ue,{image:o}),e[2]=t.resolveType,e[3]=t.title,e[4]=o,e[5]=s,e[6]=n,e[7]=d):d=e[7];let a;e[8]!==t.isSavedBlock?(a=t.isSavedBlock?{color:oe}:void 0,e[8]=t.isSavedBlock,e[9]=a):a=e[9];let w;e[10]!==c||e[11]!==a?(w=i.jsx(c,{className:"h-4 w-4 shrink-0",style:a}),e[10]=c,e[11]=a,e[12]=w):w=e[12];let m;e[13]!==t.title?(m=i.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[13]=t.title,e[14]=m):m=e[14];let x;e[15]!==t.description?(x=t.description&&i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[15]=t.description,e[16]=x):x=e[16];let h;e[17]!==m||e[18]!==x?(h=i.jsxs("div",{className:"min-w-0 flex-1",children:[m,x]}),e[17]=m,e[18]=x,e[19]=h):h=e[19];let g;e[20]!==w||e[21]!==h?(g=i.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[w,h]}),e[20]=w,e[21]=h,e[22]=g):g=e[22];let S;return e[23]!==l||e[24]!==u||e[25]!==d||e[26]!==g?(S=i.jsxs("button",{type:"button",onClick:l,className:u,children:[d,g]}),e[23]=l,e[24]=u,e[25]=d,e[26]=g,e[27]=S):S=e[27],S}function qe(r){const e=M.c(51),{open:t,onOpenChange:s,meta:o,decofile:n,previewBaseUrl:l,onSelect:f}=r,c=re(),[p,u]=b.useState(""),[d,a]=b.useState(t),w=b.useRef(null);t!==d&&(a(t),t&&u(""));let m,x,h,g,S,y,N,R,j,P,I;if(e[0]!==n||e[1]!==o||e[2]!==s||e[3]!==f||e[4]!==t||e[5]!==l||e[6]!==p||e[7]!==c){const W=t&&o&&n?de(o,n):[],q=o?me(o):"",H=n?ve(n):void 0,X=new Map;if(t&&q&&l)for(const v of W)X.set(v.resolveType,K(l,q,v.previewBlock,H));const O=p.trim().toLowerCase(),J=O?W.filter(v=>v.title.toLowerCase().includes(O)||v.resolveType.toLowerCase().includes(O)||v.description?.toLowerCase().includes(O)):W;x=ie,P=t,I=s,m=le,N="top-3 right-3",R="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let B;e[19]!==c?(B=c("sectionsEditor.addSectionModal.title"),e[19]=c,e[20]=B):B=e[20];let k;e[21]!==B?(k=i.jsx(ne,{children:B}),e[21]=B,e[22]=k):k=e[22];let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($=i.jsx(ue,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=$):$=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=v=>u(v.target.value),e[24]=D):D=e[24];let A;e[25]!==c?(A=c("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=c,e[26]=A):A=e[26];let L;e[27]!==p||e[28]!==A?(L=i.jsxs("div",{className:"relative pt-2",children:[$,i.jsx(ce,{value:p,onChange:D,placeholder:A,className:"h-9 pl-8"})]}),e[27]=p,e[28]=A,e[29]=L):L=e[29],e[30]!==k||e[31]!==L?(j=i.jsxs(ae,{className:"shrink-0 border-b px-4 py-3 text-left",children:[k,L]}),e[30]=k,e[31]=L,e[32]=j):j=e[32],S=w,y="min-h-0 flex-1 overflow-y-auto",h="p-4",g=J.length===0?i.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:c("sectionsEditor.addSectionModal.noSectionsFound")}):i.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:J.map(v=>i.jsx(Be,{entry:v,scrollRootRef:w,previewUrl:l?X.get(v.resolveType)??K(l,q,v.previewBlock,H):null,image:l||!o?void 0:ye(v.resolveType,o),onSelect:()=>f(v)},v.resolveType))}),e[0]=n,e[1]=o,e[2]=s,e[3]=f,e[4]=t,e[5]=l,e[6]=p,e[7]=c,e[8]=m,e[9]=x,e[10]=h,e[11]=g,e[12]=S,e[13]=y,e[14]=N,e[15]=R,e[16]=j,e[17]=P,e[18]=I}else m=e[8],x=e[9],h=e[10],g=e[11],S=e[12],y=e[13],N=e[14],R=e[15],j=e[16],P=e[17],I=e[18];let T;e[33]!==h||e[34]!==g?(T=i.jsx("div",{className:h,children:g}),e[33]=h,e[34]=g,e[35]=T):T=e[35];let C;e[36]!==T||e[37]!==S||e[38]!==y?(C=i.jsx("div",{ref:S,className:y,children:T}),e[36]=T,e[37]=S,e[38]=y,e[39]=C):C=e[39];let U;e[40]!==m||e[41]!==C||e[42]!==N||e[43]!==R||e[44]!==j?(U=i.jsxs(m,{closeButtonClassName:N,className:R,children:[j,C]}),e[40]=m,e[41]=C,e[42]=N,e[43]=R,e[44]=j,e[45]=U):U=e[45];let E;return e[46]!==x||e[47]!==U||e[48]!==P||e[49]!==I?(E=i.jsx(x,{open:P,onOpenChange:I,children:U}),e[46]=x,e[47]=U,e[48]=P,e[49]=I,e[50]=E):E=e[50],E}function Fe(r){const e=M.c(4),{previewServerUrl:t,runtime:s}=Se(r.virtualMcpId),{url:o}=pe(r.virtualMcpId),n=xe(r.virtualMcpId,r.branch),l=s==="cms";if(he(n))return null;if(o)return o;let f;return e[0]!==l||e[1]!==r.sandboxUrl||e[2]!==t?(f=ge({sandboxUrl:r.sandboxUrl,previewServerUrl:t,fastPreviewActive:l}),e[0]=l,e[1]=r.sandboxUrl,e[2]=t,e[3]=f):f=e[3],f}export{qe as A,We as g,Z as s,Fe as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as T,c as y,j as o,m as C,c5 as $,c6 as z}from"./index-_MevbWo3.js";import{u as B}from"./use-mobile-BsW3NxK-.js";import{b as A,c as P,S as R,d as k,a as H}from"./sheet-CxNkjzTI.js";import{b as V,a as W,T as L,c as F}from"./tooltip-DbIWGyWX.js";const q="15rem",G="18rem",J="4.5rem",E=T.createContext(null);function D(){const l=T.useContext(E);if(!l)throw new Error("useSidebar must be used within a SidebarProvider.");return l}function ee(l){const e=y.c(19),{children:t,defaultOpen:s,open:a,onOpenChange:i}=l,c=s===void 0?!1:s,r=B(),[n,S]=T.useState(c),[v,j]=T.useState(!1),p=a!==void 0,m=p?a:n;let g;e[0]!==p||e[1]!==i?(g=M=>{p||S(M),i?.(M)},e[0]=p,e[1]=i,e[2]=g):g=e[2];const d=g;let h;e[3]!==r||e[4]!==m||e[5]!==d?(h=()=>{r?j(K):d(!m)},e[3]=r,e[4]=m,e[5]=d,e[6]=h):h=e[6];const w=h,f=m?"expanded":"collapsed";let u;e[7]!==r||e[8]!==m||e[9]!==v||e[10]!==d||e[11]!==f||e[12]!==w?(u={state:f,open:m,setOpen:d,isMobile:r,openMobile:v,setOpenMobile:j,toggleSidebar:w},e[7]=r,e[8]=m,e[9]=v,e[10]=d,e[11]=f,e[12]=w,e[13]=u):u=e[13];const x=u;let b;e[14]!==t?(b=o.jsx(V,{delayDuration:0,children:t}),e[14]=t,e[15]=b):b=e[15];let N;return e[16]!==x||e[17]!==b?(N=o.jsx(E.Provider,{value:x,children:b}),e[16]=x,e[17]=b,e[18]=N):N=e[18],N}function K(l){return!l}function te(l){const e=y.c(14);let t,s,a,i;e[0]!==l?({className:s,style:i,children:t,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=i):(t=e[1],s=e[2],a=e[3],i=e[4]);let c;e[5]!==i?(c={"--sidebar-width":q,"--sidebar-width-icon":J,...i},e[5]=i,e[6]=c):c=e[6];const r=c;let n;e[7]!==s?(n=C("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",s),e[7]=s,e[8]=n):n=e[8];let S;return e[9]!==t||e[10]!==a||e[11]!==r||e[12]!==n?(S=o.jsx("div",{"data-slot":"sidebar-wrapper",style:r,className:n,...a,children:t}),e[9]=t,e[10]=a,e[11]=r,e[12]=n,e[13]=S):S=e[13],S}function ae(l){const e=y.c(36);let t,s,a,i,c;e[0]!==l?({side:i,variant:c,className:s,children:t,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=i,e[5]=c):(t=e[1],s=e[2],a=e[3],i=e[4],c=e[5]);const r=i===void 0?"left":i,n=c===void 0?"sidebar":c,{isMobile:S,state:v,openMobile:j,setOpenMobile:p}=D();if(S){let N;e[6]===Symbol.for("react.memo_cache_sentinel")?(N={"--sidebar-width":G},e[6]=N):N=e[6];let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsxs(P,{className:"sr-only",children:[o.jsx(R,{children:"Sidebar"}),o.jsx(k,{children:"Displays the mobile sidebar."})]}),e[7]=M):M=e[7];let I;e[8]!==t?(I=o.jsx("div",{className:"flex h-full w-full flex-col",children:t}),e[8]=t,e[9]=I):I=e[9];let _;e[10]!==r||e[11]!==I?(_=o.jsxs(H,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:N,side:r,children:[M,I]}),e[10]=r,e[11]=I,e[12]=_):_=e[12];let O;return e[13]!==j||e[14]!==a||e[15]!==p||e[16]!==_?(O=o.jsx(A,{open:j,onOpenChange:p,...a,children:_}),e[13]=j,e[14]=a,e[15]=p,e[16]=_,e[17]=O):O=e[17],O}const m=v==="expanded",g=m?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let d;e[18]!==g?(d=C("group/sidebar peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","transition-[width] duration-150 ease-out motion-reduce:transition-none",g),e[18]=g,e[19]=d):d=e[19];const h=m?void 0:"icon",w=m?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let f;e[20]!==s||e[21]!==w?(f=C("flex flex-col h-full transition-[width] duration-150 ease-out motion-reduce:transition-none",w,s),e[20]=s,e[21]=w,e[22]=f):f=e[22];let u;e[23]!==t?(u=o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar flex h-full w-full flex-col",children:t}),e[23]=t,e[24]=u):u=e[24];let x;e[25]!==a||e[26]!==f||e[27]!==u?(x=o.jsx("div",{"data-slot":"sidebar-container",className:f,...a,children:u}),e[25]=a,e[26]=f,e[27]=u,e[28]=x):x=e[28];let b;return e[29]!==r||e[30]!==v||e[31]!==d||e[32]!==h||e[33]!==x||e[34]!==n?(b=o.jsx("div",{className:d,"data-state":v,"data-collapsible":h,"data-variant":n,"data-side":r,"data-slot":"sidebar",children:x}),e[29]=r,e[30]=v,e[31]=d,e[32]=h,e[33]=x,e[34]=n,e[35]=b):b=e[35],b}function se(l){const e=y.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=C("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=o.jsx("main",{"data-slot":"sidebar-inset",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function ie(l){const e=y.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=C("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function le(l){const e=y.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=C("flex min-h-0 flex-1 flex-col gap-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function ne(l){const e=y.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=C("flex w-full min-w-0 list-none flex-col gap-1 group-data-[state=collapsed]/sidebar:items-center",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function re(l){const e=y.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=C("group/menu-item relative w-full list-none",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}const Q=z("peer/menu-button flex w-full cursor-pointer items-center gap-2 overflow-hidden rounded-lg py-0 pr-0.5 pl-1.5 text-left text-sm focus-ring transition-[width,height,padding] duration-150 ease-out motion-reduce:transition-none active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate group-data-[state=collapsed]/sidebar:[&>span:last-child]:hidden [&>svg]:size-4 [&>svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground hover:[&_svg:not([class*='text-'])]:text-sidebar-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background ring-1 ring-sidebar-border hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:ring-sidebar-accent"},size:{default:"group-data-[state=expanded]/sidebar:h-8 group-data-[state=expanded]/sidebar:px-2 group-data-[state=collapsed]/sidebar:p-0! group-data-[state=collapsed]/sidebar:mx-auto group-data-[state=collapsed]/sidebar:justify-center text-sm group-data-[state=collapsed]/sidebar:size-8! group-data-[state=collapsed]/sidebar:rounded-full",sm:"h-7 text-xs",lg:"h-12 text-sm p-0!"}},defaultVariants:{variant:"default",size:"default"}});function oe(l){const e=y.c(28);let t,s,a,i,c,r,n;e[0]!==l?({asChild:a,isActive:i,variant:c,size:r,tooltip:n,className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=i,e[5]=c,e[6]=r,e[7]=n):(t=e[1],s=e[2],a=e[3],i=e[4],c=e[5],r=e[6],n=e[7]);const S=a===void 0?!1:a,v=i===void 0?!1:i,j=c===void 0?"default":c,p=r===void 0?"default":r,m=S?$:"button",{isMobile:g}=D();let d;e[8]!==t||e[9]!==p||e[10]!==j?(d=C(Q({variant:j,size:p}),t),e[8]=t,e[9]=p,e[10]=j,e[11]=d):d=e[11];let h;e[12]!==m||e[13]!==v||e[14]!==s||e[15]!==p||e[16]!==d?(h=o.jsx(m,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":p,"data-active":v,className:d,...s}),e[12]=m,e[13]=v,e[14]=s,e[15]=p,e[16]=d,e[17]=h):h=e[17];const w=h;if(!n)return w;if(typeof n=="string"){let b;e[18]!==n?(b={children:n},e[18]=n,e[19]=b):b=e[19],n=b}let f;e[20]!==w?(f=o.jsx(L,{asChild:!0,children:w}),e[20]=w,e[21]=f):f=e[21];let u;e[22]!==g||e[23]!==n?(u=o.jsx(W,{side:"right",align:"center",hidden:g,...n}),e[22]=g,e[23]=n,e[24]=u):u=e[24];let x;return e[25]!==f||e[26]!==u?(x=o.jsxs(F,{children:[f,u]}),e[25]=f,e[26]=u,e[27]=x):x=e[27],x}function de(){const{state:l,isMobile:e}=D();return l==="collapsed"&&!e}export{oe as S,ne as a,re as b,D as c,ie as d,le as e,ae as f,ee as g,te as h,se as i,de as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,ad as f,au as y,i as d,q as g,e as T,K as l,t as E}from"./index-_MevbWo3.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],d(a)}function p(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){E.error(e instanceof Error?e.message:"Failed to create tag")}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){E.error(e instanceof Error?e.message:"Failed to delete tag")}function M(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],d(c)}function A(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:m}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:m})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){E.error(e instanceof Error?e.message:"Failed to update member tags")}export{p as a,C as b,M as c,A as d,K as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as O,f,i as S,K as _,av as R,ad as i,au as l}from"./index-_MevbWo3.js";const K=["TASK_BOARD_OPERATION","TASK_BOARD_REWORK","TASK_BOARD_DELIVERY","TASK_BOARD_SPRINTS","TASK_BOARD_STUCK","TASK_BOARD_COST","TASK_BOARD_ERRORS","TASK_BOARD_TENANTS"];function B(){const t=O.c(8),o=f({strict:!1}).org??"";let e;t[0]!==o?(e=_.taskBoardAdminOrgs(o),t[0]=o,t[1]=e):e=t[1];const s=!!o;let n;t[2]!==o?(n=()=>R(o,"TASK_BOARD_ADMIN_ORG_LIST",{}),t[2]=o,t[3]=n):n=t[3];let c;return t[4]!==e||t[5]!==s||t[6]!==n?(c={queryKey:e,enabled:s,queryFn:n,staleTime:3e5},t[4]=e,t[5]=s,t[6]=n,t[7]=c):c=t[7],S(c)}function y(t,o){const e=O.c(14),{locator:s}=i(),n=l();let c;e[0]!==s||e[1]!==o.from||e[2]!==o.org||e[3]!==o.project||e[4]!==o.to||e[5]!==t?(c=_.taskBoardAnalytics(s,t,o.org??"",o.project??"",o.from,o.to),e[0]=s,e[1]=o.from,e[2]=o.org,e[3]=o.project,e[4]=o.to,e[5]=t,e[6]=c):c=e[6];let T;e[7]!==o||e[8]!==n||e[9]!==t?(T=()=>n.call(t,o),e[7]=o,e[8]=n,e[9]=t,e[10]=T):T=e[10];let A;return e[11]!==c||e[12]!==T?(A={queryKey:c,queryFn:T},e[11]=c,e[12]=T,e[13]=A):A=e[13],S(A)}function D(t,o){const e=O.c(15),{locator:s}=i(),n=l();let c;e[0]!==o||e[1]!==s||e[2]!==t.from||e[3]!==t.org||e[4]!==t.project||e[5]!==t.to?(c=_.taskBoardOperationTasks(s,t.org??"",t.project??"",t.from,t.to,o??""),e[0]=o,e[1]=s,e[2]=t.from,e[3]=t.org,e[4]=t.project,e[5]=t.to,e[6]=c):c=e[6];const T=o!==null;let A;e[7]!==o||e[8]!==t||e[9]!==n?(A=()=>n.call("TASK_BOARD_OPERATION_TASKS",{...t,drill:o??""}),e[7]=o,e[8]=t,e[9]=n,e[10]=A):A=e[10];let u;return e[11]!==c||e[12]!==T||e[13]!==A?(u={queryKey:c,enabled:T,queryFn:A},e[11]=c,e[12]=T,e[13]=A,e[14]=u):u=e[14],S(u)}export{K as A,y as a,D as b,B as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as y,aD as w,c as h,ad as R,au as T,q as k,i as D,K as A}from"./index-_MevbWo3.js";import{c as O}from"./watch-sse-pool-De5Hkvjc.js";const P=()=>0;function B(e){const{orgSlug:t,itemId:s,onPrs:r}=e,o=y.useRef(r);o.current=r;const l=y.useRef(null),a=y.useRef(""),i=`${t}:${s??""}`;(!l.current||a.current!==i)&&(a.current=i,l.current=u=>{if(!t||!s)return()=>{};const d=c=>{let n;try{n=JSON.parse(c.data)}catch{return}n.data?.id!==s||!Array.isArray(n.data.prs)||(o.current(n.data.prs),u())};return O.subscribe(t,d)}),y.useSyncExternalStore(l.current,P,P)}const E=1440*60*1e3,C=40;function g(e){try{const t=window.localStorage.getItem(w.taskBoardPrs(e));return t?JSON.parse(t):{}}catch{return{}}}function L(e){const t=Date.now(),s=Object.entries(e).filter(([,r])=>t-r.updatedAt<=E);for(s.sort(([,r],[,o])=>r.updatedAt-o.updatedAt);s.length>C;)s.shift();return Object.fromEntries(s)}function _(e,t){if(typeof window>"u")return null;const s=g(e)[t];return!s||Date.now()-s.updatedAt>E?null:s}function b(e,t,s){if(!(typeof window>"u"))try{const r=g(e);r[t]={data:s,updatedAt:Date.now()},window.localStorage.setItem(w.taskBoardPrs(e),JSON.stringify(L(r)))}catch{}}const v=6e4,K=2e3,N=e=>e.state===null;function j(e){const t=h.c(25),{org:s,locator:r}=R(),o=T(),l=k();let a;t[0]!==e||t[1]!==r||t[2]!==l?(a=S=>{l.setQueryData(A.taskBoardItemPrs(r,e??""),S)},t[0]=e,t[1]=r,t[2]=l,t[3]=a):a=t[3];let i;t[4]!==e||t[5]!==s.slug||t[6]!==a?(i={orgSlug:s.slug,itemId:e,onPrs:a},t[4]=e,t[5]=s.slug,t[6]=a,t[7]=i):i=t[7],B(i);let u;t[8]!==e||t[9]!==r?(u=A.taskBoardItemPrs(r,e??""),t[8]=e,t[9]=r,t[10]=u):u=t[10];const d=!!e;let c,n;t[11]!==e||t[12]!==r?(c=()=>e?_(r,e)?.data??void 0:void 0,n=()=>e?_(r,e)?.updatedAt:void 0,t[11]=e,t[12]=r,t[13]=c,t[14]=n):(c=t[13],n=t[14]);let f;t[15]!==e||t[16]!==r||t[17]!==o?(f=async()=>{const{prs:S}=await o.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:e});return b(r,e,S),S},t[15]=e,t[16]=r,t[17]=o,t[18]=f):f=t[18];let p;return t[19]!==u||t[20]!==d||t[21]!==c||t[22]!==n||t[23]!==f?(p={queryKey:u,enabled:d,refetchInterval:M,initialData:c,initialDataUpdatedAt:n,queryFn:f},t[19]=u,t[20]=d,t[21]=c,t[22]=n,t[23]=f,t[24]=p):p=t[24],D(p)}function M(e){return e.state.data?.some(N)?K:v}export{j as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as R,c as $,ad as V,au as W,i as G,q as Y,K as k,b as H,e as O,E as X,t as N}from"./index-_MevbWo3.js";import{a as Z}from"./task-board-DnXBfWZ7.js";import{t as ee}from"./watch-sse-pool-De5Hkvjc.js";import{u as te}from"./use-decopilot-events-B-O4604K.js";const J=()=>0;function se(e){const{orgSlug:u,enabled:o=!0,onUpdate:t,onDelete:s,onResync:a}=e,c=R.useRef(t);c.current=t;const i=R.useRef(s);i.current=s;const g=R.useRef(a);g.current=a;const r=R.useRef(null),m=R.useRef(o),I=R.useRef(u);(!r.current||m.current!==o||I.current!==u)&&(m.current=o,I.current=u,r.current=l=>{if(!o||!u)return()=>{};const d=T=>{let f;try{f=JSON.parse(T.data)}catch{return}f.data&&(T.type===Z?i.current?.(f.data.id):c.current(f.data)),l()};return ee.subscribe(u,d,()=>g.current?.())}),R.useSyncExternalStore(r.current,J,J)}function ae(e,u){return{queryKey:k.taskBoardItems(e),refetchInterval:6e4,queryFn:async()=>{const{items:o,demoFrozenItemIds:t}=await u.call("TASK_BOARD_ITEM_LIST",{});return{items:o,demoFrozenItemIds:t}}}}function re(){const e=$.c(21),{org:u,locator:o}=V(),t=Y();let s;e[0]!==o?(s=k.taskBoardItems(o),e[0]=o,e[1]=s):s=e[1];const a=s;let c;e[2]!==o||e[3]!==t||e[4]!==a?(c=y=>{t.cancelQueries({queryKey:a}),t.setQueryData(a,l=>l&&{...l,items:l.items.some(d=>d.id===y.id)?l.items.map(d=>d.id===y.id?y:d):[y,...l.items]}),t.invalidateQueries({queryKey:k.taskBoardActivity(o,y.id)}),t.invalidateQueries({queryKey:k.taskBoardComments(o,y.id)})},e[2]=o,e[3]=t,e[4]=a,e[5]=c):c=e[5];let i,g;e[6]!==t||e[7]!==a?(i=()=>{t.invalidateQueries({queryKey:a})},g=y=>{t.cancelQueries({queryKey:a}),t.setQueryData(a,l=>l&&{...l,items:l.items.filter(d=>d.id!==y)})},e[6]=t,e[7]=a,e[8]=i,e[9]=g):(i=e[8],g=e[9]);let r;e[10]!==u.slug||e[11]!==c||e[12]!==i||e[13]!==g?(r={orgSlug:u.slug,onUpdate:c,onResync:i,onDelete:g},e[10]=u.slug,e[11]=c,e[12]=i,e[13]=g,e[14]=r):r=e[14],se(r);let m;e[15]!==t||e[16]!==a?(m=y=>{const l=y.subject,d=y.data.status;t.cancelQueries({queryKey:a}),t.setQueryData(a,f=>f&&{...f,items:f.items.map(S=>S.threads.some(_=>_.threadId===l)?{...S,threads:S.threads.map(_=>_.threadId===l?{..._,status:d}:_)}:S)});const T=t.getQueryData(a)?.items.some(f=>f.threads.some(S=>S.threadId===l));d==="failed"&&T&&t.invalidateQueries({queryKey:a})},e[15]=t,e[16]=a,e[17]=m):m=e[17];let I;e[18]!==u.slug||e[19]!==m?(I={orgSlug:u.slug,onTaskStatus:m},e[18]=u.slug,e[19]=m,e[20]=I):I=e[20],te(I)}function ce(){const e=$.c(13),{locator:u}=V(),o=W();let t;e[0]!==u||e[1]!==o?(t=ae(u,o),e[0]=u,e[1]=o,e[2]=t):t=e[2];const s=G(t);re();let a;e[3]!==s.data?.items?(a=s.data?.items??[],e[3]=s.data?.items,e[4]=a):a=e[4];let c;e[5]!==s.data?.demoFrozenItemIds?(c=s.data?.demoFrozenItemIds??[],e[5]=s.data?.demoFrozenItemIds,e[6]=c):c=e[6];let i;return e[7]!==s.error||e[8]!==s.isFetching||e[9]!==s.isLoading||e[10]!==a||e[11]!==c?(i={items:a,demoFrozenItemIds:c,isLoading:s.isLoading,isFetching:s.isFetching,error:s.error},e[7]=s.error,e[8]=s.isFetching,e[9]=s.isLoading,e[10]=a,e[11]=c,e[12]=i):i=e[12],i}function de(){const e=$.c(70),{org:u,locator:o}=V(),t=W(),s=Y(),a=H();let c;e[0]!==o?(c=k.taskBoardItems(o),e[0]=o,e[1]=c):c=e[1];const i=c;let g;e[2]!==s||e[3]!==i?(g=()=>s.invalidateQueries({queryKey:i}),e[2]=s,e[3]=i,e[4]=g):g=e[4];const r=g;let m;e[5]!==t?(m=n=>t.call("TASK_BOARD_ITEM_CREATE",n),e[5]=t,e[6]=m):m=e[6];let I;e[7]!==r||e[8]!==m?(I={mutationFn:m,onSuccess:r},e[7]=r,e[8]=m,e[9]=I):I=e[9];const y=O(I);let l;e[10]!==t?(l=n=>t.call("TASK_BOARD_ITEM_UPDATE",n),e[10]=t,e[11]=l):l=e[11];let d;e[12]!==s||e[13]!==i?(d=async n=>{await s.cancelQueries({queryKey:i});const B=s.getQueryData(i);return s.setQueryData(i,E=>E&&{...E,items:E.items.map(z=>z.id===n.id?{...z,...n,...n.status!==void 0&&n.status!==z.status&&{statusSince:new Date().toISOString()}}:z)}),{previous:B}},e[12]=s,e[13]=i,e[14]=d):d=e[14];let T;e[15]!==u?(T=(n,B)=>{B.status==="done"&&X("task_marked_done",{organization_id:u.id,task_board_item_id:B.id})},e[15]=u,e[16]=T):T=e[16];let f;e[17]!==s||e[18]!==i?(f=(n,B,E)=>{E?.previous&&s.setQueryData(i,E.previous)},e[17]=s,e[18]=i,e[19]=f):f=e[19];let S;e[20]!==r||e[21]!==o||e[22]!==s?(S=(n,B,E)=>{r(),s.invalidateQueries({queryKey:k.taskBoardActivity(o,E.id)})},e[20]=r,e[21]=o,e[22]=s,e[23]=S):S=e[23];let _;e[24]!==l||e[25]!==d||e[26]!==T||e[27]!==f||e[28]!==S?(_={mutationFn:l,onMutate:d,onSuccess:T,onError:f,onSettled:S},e[24]=l,e[25]=d,e[26]=T,e[27]=f,e[28]=S,e[29]=_):_=e[29];const U=O(_);let D;e[30]!==t?(D=n=>t.call("TASK_BOARD_ITEM_DELETE",{id:n}),e[30]=t,e[31]=D):D=e[31];let A;e[32]!==r||e[33]!==a?(A=n=>{N.error(n instanceof Error&&n.message?n.message:a("taskBoard.taskBoard.deleteError")),r()},e[32]=r,e[33]=a,e[34]=A):A=e[34];let p;e[35]!==r||e[36]!==D||e[37]!==A?(p={mutationFn:D,onSuccess:r,onError:A},e[35]=r,e[36]=D,e[37]=A,e[38]=p):p=e[38];const w=O(p);let Q;e[39]!==t?(Q=async n=>{const B=await Promise.allSettled(n.map(E=>t.call("TASK_BOARD_ITEM_DELETE",{id:E})));return{total:n.length,failed:B.filter(oe).length}},e[39]=t,e[40]=Q):Q=e[40];let h,K;e[41]!==a?(h=n=>{const{total:B,failed:E}=n;E!==0&&N.error(a("taskBoard.taskBoard.deleteBulkError",{failed:String(E),total:String(B)}))},K=()=>N.error(a("taskBoard.taskBoard.deleteError")),e[41]=a,e[42]=h,e[43]=K):(h=e[42],K=e[43]);let M;e[44]!==r||e[45]!==Q||e[46]!==h||e[47]!==K?(M={mutationFn:Q,onSuccess:h,onError:K,onSettled:r},e[44]=r,e[45]=Q,e[46]=h,e[47]=K,e[48]=M):M=e[48];const x=O(M);let F;e[49]!==t?(F=n=>t.call("TASK_BOARD_ITEM_UPDATE",n),e[49]=t,e[50]=F):F=e[50];let v;e[51]!==r||e[52]!==F?(v={mutationFn:F,onSuccess:r},e[51]=r,e[52]=F,e[53]=v):v=e[53];const P=O(v);let b;e[54]!==t?(b=n=>t.call("TASK_BOARD_ITEM_RERUN",n),e[54]=t,e[55]=b):b=e[55];let q;e[56]!==r||e[57]!==o||e[58]!==s?(q=(n,B,E)=>{r(),s.invalidateQueries({queryKey:k.taskBoardActivity(o,E.id)})},e[56]=r,e[57]=o,e[58]=s,e[59]=q):q=e[59];let L;e[60]!==b||e[61]!==q?(L={mutationFn:b,onSettled:q},e[60]=b,e[61]=q,e[62]=L):L=e[62];const j=O(L);let C;return e[63]!==y||e[64]!==P||e[65]!==w||e[66]!==x||e[67]!==j||e[68]!==U?(C={create:y,update:U,remove:w,removeMany:x,link:P,rerun:j},e[63]=y,e[64]=P,e[65]=w,e[66]=x,e[67]=j,e[68]=U,e[69]=C):C=e[69],C}function oe(e){return e.status==="rejected"}export{ce as a,se as b,de as c,ae as t,re as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as $,b as D,m as z,j as o,ad as q,L as Z,aC as ee,d as te,r as U,hq as se,B as ae,t as oe,au as V,K as F,i as ne,q as Y,e as le}from"./index-_MevbWo3.js";import{s as W}from"./Plus-DS1puo6u.js";import{s as re}from"./XClose-Cwm3E7iC.js";import{i as ie}from"./Zap-DXVSe_sk.js";import{B as K}from"./badge-VkLFh9uU.js";import{f as ce,a as ue,c as de,C as me,e as fe,b as pe}from"./command-CNg33dyG.js";import{I as xe}from"./icon-button-BEBpG4-J.js";import{c as ge,a as he,b as je,S as ve}from"./sheet-CxNkjzTI.js";import{j as ke}from"./use-org-fs-gqkUNR5f.js";import{a as Ne}from"./use-project-scope-DgBS55KP.js";import{u as J,a as _e}from"./use-automations-B7TBj_Gs.js";import{C as ye}from"./task-board-DnXBfWZ7.js";import{b as be}from"./watch-sse-pool-De5Hkvjc.js";const Be={triage:"taskBoard.columnGuide.triage",todo:"taskBoard.columnGuide.todo",in_progress:"taskBoard.columnGuide.inProgress",in_review:"taskBoard.columnGuide.inReview",qa:"taskBoard.columnGuide.qa",customer_approval:"taskBoard.columnGuide.customerApproval",ready_for_deployment:"taskBoard.columnGuide.readyForDeployment",post_deploy_validation:"taskBoard.columnGuide.postDeployValidation",done:null,archived:null};function Ce(t){const e=ye.find(a=>a===t);return e?Be[e]:null}function He(t){const e=$.c(7),{data:a}=J();let s;e[0]!==a?(s=a??[],e[0]=a,e[1]=s):s=e[1];let n;if(e[2]!==t||e[3]!==s){let l;e[5]!==t?(l=r=>r.board_triggers.some(c=>c.type==="board_column_transition"&&c.column_key===t),e[5]=t,e[6]=l):l=e[6],n=s.filter(l),e[2]=t,e[3]=s,e[4]=n}else n=e[4];return n}function Q(t){switch(t){case"board_column_transition":return 0;case"board_pr_ready":return 1;case"board_pr_merged":return 2;default:return t}}function Se(t){switch(t){case"board_column_transition":return"taskBoard.columnRules.starter.board_column_transition";case"board_pr_ready":return"taskBoard.columnRules.starter.board_pr_ready";case"board_pr_merged":return"taskBoard.columnRules.starter.board_pr_merged";default:return t}}function Re(t){const e=$.c(5),{data:a}=J();let s;if(e[0]!==t||e[1]!==a){let n;e[3]!==t?(n=l=>{const r=l.board_triggers.find(c=>c.column_key===t);return r?[{automation:l,starter:r.type}]:[]},e[3]=t,e[4]=n):n=e[4],s=(a??[]).flatMap(n).sort(Ae),e[0]=t,e[1]=a,e[2]=s}else s=e[2];return s}function Ae(t,e){return Number(e.automation.active)-Number(t.automation.active)||Q(t.starter)-Q(e.starter)}function Ue(t){const e=$.c(37),{columnKey:a,label:s,icon:n,iconClassName:l,open:r,onOpenChange:c}=t,i=D(),{org:u}=q(),g=Ce(a),d=Re(a);let h;e[0]!==c?(h=()=>c(!1),e[0]=c,e[1]=h):h=e[1];const x=h,R=je,_=he,O="w-full gap-0 sm:max-w-md",y=void 0,b=Te,B=ge,A="gap-1 pb-0";let m;e[2]!==n||e[3]!==l?(m=n&&o.jsx(n,{size:16,className:l}),e[2]=n,e[3]=l,e[4]=m):m=e[4];let j;e[5]!==s||e[6]!==m?(j=o.jsxs(ve,{className:"flex items-center gap-2",children:[m,s]}),e[5]=s,e[6]=m,e[7]=j):j=e[7];const T=g&&o.jsx("p",{className:"surface-inset mt-2 rounded-xl px-3.5 py-3 text-sm leading-relaxed text-foreground",children:i(g)});let v;e[8]!==B||e[9]!==j||e[10]!==T?(v=o.jsxs(B,{className:A,children:[j,T]}),e[8]=B,e[9]=j,e[10]=T,e[11]=v):v=e[11];let k;e[12]!==i?(k=i("taskBoard.columnRules.runsHere"),e[12]=i,e[13]=k):k=e[13];let C;e[14]!==k?(C=o.jsx("h3",{className:"text-meta",children:k}),e[14]=k,e[15]=C):C=e[15];let f;e[16]!==d||e[17]!==a||e[18]!==s||e[19]!==x||e[20]!==u||e[21]!==i?(f=d.length===0?o.jsx(we,{columnKey:a,label:s,onLeave:x}):o.jsx("div",{className:"surface divide-y divide-border",children:d.map(L=>{const{automation:N,starter:E}=L;return o.jsxs(Z,{to:"/$org/projects/$agentId/automations/$automationId",params:{org:u.slug,agentId:N.virtual_mcp_id,automationId:N.id},onClick:x,className:"group flex items-center gap-3 px-3 py-2.5 transition-colors hover:bg-accent/50",children:[o.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsx("span",{className:z("truncate text-sm",N.active?"text-foreground":"text-muted-foreground"),children:N.name}),o.jsx("span",{className:"text-meta",children:N.active?i(Se(E)):i("taskBoard.columnRules.off")})]}),o.jsx(ee,{size:14,className:"shrink-0 text-muted-foreground transition-colors group-hover:text-foreground"})]},N.id)})}),e[16]=d,e[17]=a,e[18]=s,e[19]=x,e[20]=u,e[21]=i,e[22]=f):f=e[22];let w;e[23]!==C||e[24]!==f?(w=o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-4 pt-6 pb-6",children:[C,f]}),e[23]=C,e[24]=f,e[25]=w):w=e[25];let I;e[26]!==_||e[27]!==w||e[28]!==y||e[29]!==b||e[30]!==v?(I=o.jsxs(_,{className:O,"aria-describedby":y,onOpenAutoFocus:b,children:[v,w]}),e[26]=_,e[27]=w,e[28]=y,e[29]=b,e[30]=v,e[31]=I):I=e[31];let S;return e[32]!==R||e[33]!==r||e[34]!==c||e[35]!==I?(S=o.jsx(R,{open:r,onOpenChange:c,children:I}),e[32]=R,e[33]=r,e[34]=c,e[35]=I,e[36]=S):S=e[36],S}function Te(t){return t.preventDefault()}function we({columnKey:t,label:e,onLeave:a}){const s=D(),{org:n}=q(),{project:l}=Ne(),r=te(),{create:c,triggerAdd:i}=_e(),[u,g]=U.useState(!1),d=l?.id??se(n.id),h=async()=>{g(!0);try{const x=await c.mutateAsync({name:s("taskBoard.columnRules.newAutomationName",{column:e}),messages:[],models:{tier:"smart"},active:!1,virtual_mcp_id:d});await i.mutateAsync({automation_id:x.id,type:"board_column_transition",column_key:t}),a(),r({to:"/$org/projects/$agentId/automations/$automationId",params:{org:n.slug,agentId:d,automationId:x.id}})}catch{oe.error(s("taskBoard.columnRules.newAutomationFailed"))}finally{g(!1)}};return o.jsxs("div",{className:"surface flex flex-col items-center gap-3 px-6 py-8 text-center",children:[o.jsx("span",{className:"flex size-9 items-center justify-center rounded-full bg-muted text-muted-foreground",children:o.jsx(ie,{size:16})}),o.jsx("p",{className:"text-sm font-medium text-foreground",children:s("taskBoard.columnRules.noAutomations")}),o.jsxs(ae,{variant:"outline",size:"sm",className:"gap-1.5",disabled:u,onClick:h,children:[o.jsx(W,{size:14}),s("taskBoard.columnRules.newAutomation")]})]})}const Ie=[];function Ve(t){const e=$.c(71),{value:a,onChange:s,inherited:n,fill:l}=t,r=n===void 0?Ie:n,c=l===void 0?!1:l,i=D(),u=ke();let g;e[0]!==u.data?(g=f=>u.data?.find(w=>w.id===f)?.name??f,e[0]=u.data,e[1]=g):g=e[1];const d=g;let h,x,R,_,O,y,b,B,A,m;if(e[2]!==u.data||e[3]!==c||e[4]!==r||e[5]!==d||e[6]!==s||e[7]!==i||e[8]!==a){let f;e[19]!==r||e[20]!==a?(f=p=>!p.disableModelInvocation&&!a.includes(p.id)&&!r.includes(p.id),e[19]=r,e[20]=a,e[21]=f):f=e[21];const w=(u.data??[]).filter(f);if(e[22]!==c||e[23]!==r||e[24]!==d||e[25]!==s||e[26]!==i||e[27]!==a){let p;e[30]!==r?(p=P=>!r.includes(P),e[30]=r,e[31]=p):p=e[31];const M=a.filter(p),G=c&&"min-h-0 flex-1";e[32]!==G?(m=z("flex flex-col gap-2",G),e[32]=G,e[33]=m):m=e[33],_=M.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5",children:M.map(P=>o.jsxs(K,{variant:"outline",className:"py-0 pr-0 pl-2",children:[d(P),o.jsx(xe,{label:i("taskBoard.columnRules.removeSkill",{skill:d(P)}),onClick:()=>s(a.filter(X=>X!==P)),className:"size-5 text-muted-foreground",children:o.jsx(re,{size:12})})]},P))}),e[22]=c,e[23]=r,e[24]=d,e[25]=s,e[26]=i,e[27]=a,e[28]=_,e[29]=m}else _=e[28],m=e[29];R=ce;const I=c&&"min-h-0 flex-1";e[34]!==I?(B=z("h-auto border",I),e[34]=I,e[35]=B):B=e[35];let S;e[36]!==i?(S=i("taskBoard.columnRules.searchSkills"),e[36]=i,e[37]=S):S=e[37],e[38]!==S?(A=o.jsx(ue,{placeholder:S,className:"h-9"}),e[38]=S,e[39]=A):A=e[39],x=de;const L=c?"max-h-none flex-1":"max-h-56";e[40]!==L?(y=z(L),e[40]=L,e[41]=y):y=e[41];let N;e[42]!==i?(N=i("taskBoard.columnRules.noSkills"),e[42]=i,e[43]=N):N=e[43],e[44]!==N?(b=o.jsx(me,{children:N}),e[44]=N,e[45]=b):b=e[45],h=fe;let E;e[46]!==s||e[47]!==a?(E=p=>o.jsxs(pe,{value:`${p.name} ${p.id}`,onSelect:()=>s([...a,p.id]),children:[o.jsx(W,{size:14,className:"shrink-0 text-muted-foreground"}),o.jsxs("span",{className:"flex min-w-0 flex-col",children:[o.jsx("span",{className:"truncate text-sm",children:p.name}),p.description&&o.jsx("span",{className:"text-meta line-clamp-1",children:p.description})]})]},p.id),e[46]=s,e[47]=a,e[48]=E):E=e[48],O=w.map(E),e[2]=u.data,e[3]=c,e[4]=r,e[5]=d,e[6]=s,e[7]=i,e[8]=a,e[9]=h,e[10]=x,e[11]=R,e[12]=_,e[13]=O,e[14]=y,e[15]=b,e[16]=B,e[17]=A,e[18]=m}else h=e[9],x=e[10],R=e[11],_=e[12],O=e[13],y=e[14],b=e[15],B=e[16],A=e[17],m=e[18];let j;e[49]!==h||e[50]!==O?(j=o.jsx(h,{children:O}),e[49]=h,e[50]=O,e[51]=j):j=e[51];let T;e[52]!==x||e[53]!==j||e[54]!==y||e[55]!==b?(T=o.jsxs(x,{className:y,children:[b,j]}),e[52]=x,e[53]=j,e[54]=y,e[55]=b,e[56]=T):T=e[56];let v;e[57]!==R||e[58]!==T||e[59]!==B||e[60]!==A?(v=o.jsxs(R,{className:B,children:[A,T]}),e[57]=R,e[58]=T,e[59]=B,e[60]=A,e[61]=v):v=e[61];let k;e[62]!==r||e[63]!==d||e[64]!==i?(k=r.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-meta",children:i("taskBoard.columnRules.inheritedHint")}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.map(f=>o.jsx(K,{variant:"muted",children:d(f)},f))})]}),e[62]=r,e[63]=d,e[64]=i,e[65]=k):k=e[65];let C;return e[66]!==_||e[67]!==v||e[68]!==k||e[69]!==m?(C=o.jsxs("div",{className:m,children:[_,v,k]}),e[66]=_,e[67]=v,e[68]=k,e[69]=m,e[70]=C):C=e[70],C}function Ye(){const t=$.c(7),{org:e}=q(),a=V();let s;t[0]!==e.id?(s=F.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==a?(n=async()=>(await a.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=a,t[3]=n):n=t[3];let l;return t[4]!==s||t[5]!==n?(l={queryKey:s,staleTime:6e4,queryFn:n},t[4]=s,t[5]=n,t[6]=l):l=t[6],ne(l)}function We(){const t=$.c(8),{org:e}=q(),a=V(),s=Y();let n;t[0]!==a?(n=async c=>{const{columnKey:i,rules:u}=c;if(u){const g=u.prompt.trim();await(g||u.skills.length?a.call("TASK_BOARD_PROMPT_UPSERT",{columnKey:i,prompt:g,skills:u.skills}):a.call("TASK_BOARD_PROMPT_DELETE",{columnKey:i}))}},t[0]=a,t[1]=n):n=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:F.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==n||t[6]!==l?(r={mutationFn:n,onSettled:l},t[5]=n,t[6]=l,t[7]=r):r=t[7],le(r)}const H=()=>0;function Je(){const t=$.c(6),{org:e}=q(),a=Y();let s;t[0]!==e.id||t[1]!==a?(s=()=>a.invalidateQueries({queryKey:F.taskBoardPrompts(e.id)}),t[0]=e.id,t[1]=a,t[2]=s):s=t[2];const n=s;let l;t[3]!==e.slug||t[4]!==n?(l=()=>be.subscribe(e.slug,n,n),t[3]=e.slug,t[4]=n,t[5]=l):l=t[5];const r=l;U.useSyncExternalStore(r,H,H)}export{Ue as C,Ve as S,He as a,Ye as b,Ce as c,We as d,Je as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ad as l,au as c,r as i,V as d,K as T}from"./index-_MevbWo3.js";import{c as m}from"./thread-intent-BpGkWTcJ.js";const p=[],S=()=>()=>{},h=()=>p;function f(t){const{org:s}=l(),r=c(),n=m(),o=i.useSyncExternalStore(n?.threads.subscribe??S,n?.threads.get??h),e=t===null?null:o.find(a=>a.id===t)??null,{data:u}=d({queryKey:T.ensureTask(s.id,t),queryFn:async()=>{if(t===null)return null;try{const{item:a}=await r.call("COLLECTION_THREADS_GET",{id:t});return a??null}catch{return null}},initialData:e&&!e.partial?e:void 0,select:a=>a?.metadata??null,staleTime:3e4});return e?.metadata??u??null}export{f as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c,ad as i,i as l,K as p}from"./index-_MevbWo3.js";import{f}from"./chat-context-gA7Mp2aY.js";async function m(e,s){const t=await fetch(`/api/${s}/threads/${encodeURIComponent(e)}/outputs`,{credentials:"include"});if(!t.ok)throw new Error(`Failed to fetch thread outputs: ${t.status}`);return(await t.json()).objects??[]}function $(){const e=c.c(2),s=f()?.messages??[];let t;return e[0]!==s?(t=s.some(y),e[0]=s,e[1]=t):t=e[1],t}function y(e){return e.parts?.some(b)}function b(e){const s=e;return(s.type==="tool-bash"||s.type==="tool-write")&&s.state==="output-available"}function g(e,s){const t=c.c(9),{org:u}=i();let o;t[0]!==e?(o=p.threadOutputs(e??""),t[0]=e,t[1]=o):o=t[1];let n;t[2]!==u||t[3]!==e?(n=()=>m(e??"",u.slug),t[2]=u,t[3]=e,t[4]=n):n=t[4];const r=!!e&&(s?.enabled??!0);let a;return t[5]!==o||t[6]!==n||t[7]!==r?(a={queryKey:o,queryFn:n,enabled:r,staleTime:0},t[5]=o,t[6]=n,t[7]=r,t[8]=a):a=t[8],l(a)}export{g as a,$ as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aD as b,cP as g,c as p,cQ as h,u as A}from"./index-_MevbWo3.js";import{u as y}from"./use-blog-view-B1maq3jt.js";import{e as f,i as o,g as d,t as S}from"./thread-intent-BpGkWTcJ.js";import{a as v,d as w}from"./session-runtime-TPNp8gb7.js";const D=1e4,I="true",l=2;function c(t,e){return b.chatAutosend(t,e)}function T(t){return t==="pending"||t==="sending"}function E(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!="object")return null;const n=e;let a=0;n.status==="sending"?a=n.retryAt===void 0?1:l:n.retryAt!==void 0&&(a=1);const r=n.attempt===void 0?a:n.attempt;return typeof n.createdAt!="number"||typeof n.message!="object"||!T(n.status)||n.retryAt!==void 0&&typeof n.retryAt!="number"||typeof r!="number"||!Number.isInteger(r)||r<0||r>l?null:{...e,attempt:r}}function U(t,e,n,a,r=Date.now()){const i={message:a,createdAt:r,status:"pending",attempt:0};return t.setItem(c(e,n),JSON.stringify(i)),i}function N(t,e,n){const a=c(e,n),r=E(t.getItem(a));return r||(t.removeItem(a),null)}function k(t,e,n,a=Date.now()){const r=c(e,n),i=N(t,e,n);if(!i||i.status!=="pending")return null;if(i.attempt>=l)return t.removeItem(r),null;const s=i.retryAt??i.createdAt;if(a-s>=D)return t.removeItem(r),null;const u={...i,status:"sending",attempt:i.attempt+1};return t.setItem(r,JSON.stringify(u)),{message:u.message,createdAt:u.createdAt,attempt:u.attempt}}function M(t,e,n){t.removeItem(c(e,n))}const x=new Set(["site-editor","content","code","calendar","experiments"]);function _(t,e,n){return n?t==="blog"||t==="blog-post"?"blog":t==="monitoring"?e==="experiments"?"site":null:t&&x.has(t)?"site":null:null}function m(t){return o(t)?"blog":"site"}function j(t,e,n){return e===null?[...t]:t.filter(a=>m(a.branch)===e||a.branch===n)}function F(t,e,n,a){const r=t.filter(i=>i.branch!==e&&(n===null||m(i.branch)===n));return r.find(i=>(i.runtime??a)!=="sandbox")??r[0]}function J(t){return o(t)?"thread.branchPicker.blogDraftName":"thread.branchPicker.defaultVersionName"}function K(t,e,n){return t==="blog"?o(e.branch)||v(e.metadata,n)==="sandbox":t==="site"?!o(e.branch):!0}function C(t,e,n){return!e.partial&&t==="blog"===o(e.branch)&&S(e,w(n))}function Q(t,e){const n=t||f(e);return o(n)?{branch:n}:{branch:n,runtime:"sandbox"}}function O(t,e,n){return K(t,e,n)?null:t==="blog"?"site-editor":"blog"}function Y(t,e,n){return n&&o(t)?f(e):d(e)}function G(t){const e=t.viewKind==="blog"||t.blogView&&o(t.branch)?f(t.userLabel):d(t.userLabel);return t.projectDefault==="cms"?{kind:"new-thread",runtime:"cms",branch:e}:{kind:"repoint",branch:e}}function R(t){if(!t)return null;const e=g(t);return e.kind==="blog"?"blog":e.kind==="site-editor"||e.kind==="agent-section"&&(e.section==="calendar"||e.section==="experiments")?"site":null}function W(t,e,n){return!t||!e||!n?t:O(R(t),e,void 0)??t}function X(){const t=p.c(5),e=h(),n=y();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[0]=a):a=t[0];const r=A(a),i="view"in r&&typeof r.view=="string"?r.view:void 0;let s;return t[1]!==n||t[2]!==e||t[3]!==i?(s=_(e,i,n),t[1]=n,t[2]=e,t[3]=i,t[4]=s):s=t[4],s}export{I as A,M as a,Q as b,k as c,J as d,j as e,m as f,G as g,C as i,Y as n,F as s,W as t,X as u,K as v,U as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as L,b as V,r as N,j as r,m as q,B as Z,b3 as ee}from"./index-_MevbWo3.js";import{a as te,d as re,r as se,p as ne}from"./session-runtime-TPNp8gb7.js";import{u as H,i as oe,d as le,j as ie,k as ce,m as ae}from"./chat-context-gA7Mp2aY.js";import{b as ue}from"./repository-binding-CcYacKs1.js";import{a as Q,b as Y,P as G}from"./popover-AnK8v98x.js";import{d as de,b as fe,a as me,D as he}from"./drawer-CyTq59gq.js";import{T as pe,a as xe,c as ge}from"./tooltip-DbIWGyWX.js";import{u as ve}from"./use-mobile-BsW3NxK-.js";import{f as ye,a9 as be}from"./agent-icon-BXpAi9QB.js";import{t as Se}from"./ChevronDown-f6WxX6x1.js";import{a as je}from"./UserCheck01-CQDmVD20.js";import{t as Te}from"./Tool01-DPrffk9i.js";import{d as Re}from"./use-organization-settings-DJvj_8Se.js";import{u as J,e as Me,b as ke}from"./use-ai-providers-C2mhihsF.js";import{M as Ce,a as Ie}from"./index-DSQaXvEa.js";import{c as we,d as Ne,b as _e}from"./use-entitlements-BC-RTqX5.js";function mt(t){const e=L.c(14),o=ue(t),l=H(),n=o?.metadata,u=l?.activeTask,s=u?.metadata?.runtime;let x;e[0]!==s?(x=ne(s),e[0]=s,e[1]=x):x=e[1];const R=x,g=!!u&&!u.partial,c=u?.metadata;let S;e[2]!==n||e[3]!==c?(S=te(c,n),e[2]=n,e[3]=c,e[4]=S):S=e[4];const v=!!R||g&&!!o;let f;e[5]!==n?(f=re(n),e[5]=n,e[6]=f):f=e[6];let i;e[7]!==n?(i=se(n),e[7]=n,e[8]=i):i=e[8];let y;return e[9]!==S||e[10]!==v||e[11]!==f||e[12]!==i?(y={runtime:S,resolved:v,projectDefault:f,previewServerUrl:i},e[9]=S,e[10]=v,e[11]=f,e[12]=i,e[13]=y):y=e[13],y}function Pe(t){return["openai-compatible","openrouter","deco"].includes(t)}function De(t,e){return Pe(t)&&$e(e)!==null}function $e(t){const e=t.replace(/^openai\//,"");return/^(gpt-\d|o[134](?:-|$))/.test(e)?e:null}const Ee={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function Fe(t,e){return Ee[t]?.test(e)??!1}function Ae(t){return Me(t)&&Fe(t.providerId,t.modelId)}function ze(t,e){return t?{modelId:t.modelId,title:t.title??t.modelId,keyId:t.keyId,providerId:e,description:null,logo:null,capabilities:[],limits:null,costs:null}:null}const Le={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function Ue(t){const e=L.c(32),{tier:o,orgSlot:l,userSlot:n,autoSlot:u,filterModels:s,onPick:x,onReset:R,onClose:g}=t,c=V(),S=J(),v=new Set(S.map(Be)),f=oe([n,l,u],v),i=f?.keyId??null,[y,m]=N.useState(i??S[0]?.id??null),a=S.some(P=>P.id===y)?y:i??S[0]?.id??null,k=a?S.find(P=>P.id===a):null,M="flex h-[70vh] max-h-[460px] w-full flex-col",j=Le[o];let h;e[0]!==c||e[1]!==j?(h=c(j),e[0]=c,e[1]=j,e[2]=h):h=e[2];let p;e[3]!==h?(p=r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:h}),e[3]=h,e[4]=p):p=e[4];let b;e[5]!==R||e[6]!==c||e[7]!==n?(b=n&&r.jsx("button",{type:"button",onClick:R,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:c("chat.modelPreferences.reset")}),e[5]=R,e[6]=c,e[7]=n,e[8]=b):b=e[8];let T;e[9]!==p||e[10]!==b?(T=r.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[p,b]}),e[9]=p,e[10]=b,e[11]=T):T=e[11];const d="flex-1 min-h-0",C=N.Suspense;let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=r.jsx(Ie,{}),e[12]=_):_=e[12];const z=Ce,A=!0,E=ze(i?f:null,k?.providerId??"deco");let D;e[13]!==a||e[14]!==x||e[15]!==m?(D=P=>{const F=P.keyId??a??"";m(F),x({keyId:F,modelId:P.modelId,title:P.title})},e[13]=a,e[14]=x,e[15]=m,e[16]=D):D=e[16];let I;e[17]!==z||e[18]!==a||e[19]!==s||e[20]!==g||e[21]!==m||e[22]!==E||e[23]!==D?(I=r.jsx(z,{compact:A,filterModels:s,onClose:g,credentialId:a,onCredentialChange:m,selectedModel:E,onModelChange:D}),e[17]=z,e[18]=a,e[19]=s,e[20]=g,e[21]=m,e[22]=E,e[23]=D,e[24]=I):I=e[24];let w;e[25]!==C||e[26]!==I||e[27]!==_?(w=r.jsx("div",{className:d,children:r.jsx(C,{fallback:_,children:I})}),e[25]=C,e[26]=I,e[27]=_,e[28]=w):w=e[28];let $;return e[29]!==w||e[30]!==T?($=r.jsxs("div",{className:M,children:[T,w]}),e[29]=w,e[30]=T,e[31]=$):$=e[31],$}function Be(t){return t.id}const Ke=["fast","smart","thinking"];function X(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const O={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function qe(t){const e=L.c(28),{tier:o,pillIcon:l,groups:n}=t,u=V();let s;e[0]!==u?(s=X(u),e[0]=u,e[1]=s):s=e[1];const x=s,[R,g]=N.useState(!1);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=T=>{T.onSelect(),g(!1)},e[2]=c):c=e[2];const S=c,v=x[o];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=q("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[480px]/chat-bottom:gap-1.5"),e[3]=f):f=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=q("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[480px]/chat-bottom:max-w-24 @[480px]/chat-bottom:opacity-100"),e[4]=i):i=e[4];const y=x[o];let m;e[5]!==y?(m=r.jsx("span",{className:i,children:y}),e[5]=y,e[6]=m):m=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx(Se,{size:12,className:"opacity-60 hidden @[480px]/chat-bottom:inline-block"}),e[7]=a):a=e[7];let k;e[8]!==l||e[9]!==v||e[10]!==m?(k=r.jsx(pe,{asChild:!0,children:r.jsx("span",{className:"inline-flex min-w-0 shrink",children:r.jsx(Q,{asChild:!0,children:r.jsxs(Z,{type:"button",variant:"ghost",size:"default","aria-label":v,className:f,children:[l,m,a]})})})}),e[8]=l,e[9]=v,e[10]=m,e[11]=k):k=e[11];let M;e[12]!==v?(M=r.jsx(xe,{children:v}),e[12]=v,e[13]=M):M=e[13];let j;e[14]!==k||e[15]!==M?(j=r.jsxs(ge,{children:[k,M]}),e[14]=k,e[15]=M,e[16]=j):j=e[16];let h;if(e[17]!==n||e[18]!==u){let T;e[20]!==u?(T=d=>r.jsx("div",{className:"flex flex-col",children:d.rows.map(C=>r.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-accent",children:[r.jsxs("button",{type:"button",role:"menuitem","aria-label":C.title,onClick:()=>S(C),className:q("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",C.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[C.icon&&r.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:C.icon}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm",children:C.title}),C.subtitle&&r.jsx("div",{className:"text-xs text-muted-foreground",children:C.subtitle})]}),C.active&&r.jsx("span",{title:u("chat.tierTrigger.selected"),children:r.jsx(ee,{size:14,className:"text-foreground mt-0.5"})})]}),C.modelOverride&&r.jsx(Oe,{label:C.title,render:C.modelOverride})]},C.key))},d.key),e[20]=u,e[21]=T):T=e[21],h=n.map(T),e[17]=n,e[18]=u,e[19]=h}else h=e[19];let p;e[22]!==h?(p=r.jsx(Y,{align:"end",className:"p-1 w-64",onOpenAutoFocus:Ve,children:r.jsx("div",{role:"menu",className:"flex flex-col",children:h})}),e[22]=h,e[23]=p):p=e[23];let b;return e[24]!==R||e[25]!==j||e[26]!==p?(b=r.jsxs(G,{open:R,onOpenChange:g,children:[j,p]}),e[24]=R,e[25]=j,e[26]=p,e[27]=b):b=e[27],b}function Ve(t){return t.preventDefault()}function Oe(t){const e=L.c(38),{label:o,render:l}=t,n=V(),u=ve(),[s,x]=N.useState(!1);let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R=()=>x(!1),e[0]=R):R=e[0];const g=R;let c;e[1]!==o||e[2]!==n?(c=n("chat.modelPreferences.customizeModel",{tier:o}),e[1]=o,e[2]=n,e[3]=c):c=e[3];const S=s&&"opacity-100";let v;e[4]!==S?(v=q("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 rounded-lg bg-background shadow-edge","text-muted-foreground hover:text-foreground","opacity-100 [@media(hover:hover)]:opacity-0","[@media(hover:hover)]:group-hover/tier-row:opacity-100","[@media(hover:hover)]:group-focus-within/tier-row:opacity-100",S),e[4]=S,e[5]=v):v=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(je,{size:14}),e[6]=f):f=e[6];let i;e[7]!==c||e[8]!==v?(i=r.jsx("button",{type:"button","aria-label":c,className:v,children:f}),e[7]=c,e[8]=v,e[9]=i):i=e[9];const y=i;if(u){let j;e[10]!==y?(j=r.jsx(de,{asChild:!0,children:y}),e[10]=y,e[11]=j):j=e[11];let h;e[12]!==o||e[13]!==n?(h=n("chat.modelPreferences.customizeModel",{tier:o}),e[12]=o,e[13]=n,e[14]=h):h=e[14];let p;e[15]!==h?(p=r.jsx(fe,{className:"sr-only",children:h}),e[15]=h,e[16]=p):p=e[16];let b;e[17]!==s||e[18]!==l?(b=s&&l(g),e[17]=s,e[18]=l,e[19]=b):b=e[19];let T;e[20]!==b||e[21]!==p?(T=r.jsxs(me,{className:"p-0 flex flex-col max-h-[95vh]",children:[p,b]}),e[20]=b,e[21]=p,e[22]=T):T=e[22];let d;return e[23]!==s||e[24]!==T||e[25]!==j?(d=r.jsxs(he,{open:s,onOpenChange:x,children:[j,T]}),e[23]=s,e[24]=T,e[25]=j,e[26]=d):d=e[26],d}let m;e[27]!==y?(m=r.jsx(Q,{asChild:!0,children:y}),e[27]=y,e[28]=m):m=e[28];let a;e[29]!==s||e[30]!==l?(a=s&&l(g),e[29]=s,e[30]=l,e[31]=a):a=e[31];let k;e[32]!==a?(k=r.jsx(Y,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:a}),e[32]=a,e[33]=k):k=e[33];let M;return e[34]!==s||e[35]!==m||e[36]!==k?(M=r.jsxs(G,{open:s,onOpenChange:x,children:[m,k]}),e[34]=s,e[35]=m,e[36]=k,e[37]=M):M=e[37],M}function W(t){return t==="fast"?r.jsx(ye,{size:16}):t==="thinking"?r.jsx(be,{size:16}):r.jsx(Te,{size:16})}function We(){const t=L.c(12),e=ae();let o;t[0]!==e.tiers?(o=R=>{const g=e.tiers[R];return g?g.title??g.modelId:void 0},t[0]=e.tiers,t[1]=o):o=t[1];const l=o;let n;t[2]!==l?(n=l("fast"),t[2]=l,t[3]=n):n=t[3];let u;t[4]!==l?(u=l("smart"),t[4]=l,t[5]=u):u=t[5];let s;t[6]!==l?(s=l("thinking"),t[6]=l,t[7]=s):s=t[7];let x;return t[8]!==n||t[9]!==u||t[10]!==s?(x={fast:n,smart:u,thinking:s},t[8]=n,t[9]=u,t[10]=s,t[11]=x):x=t[11],x}function ht(){const t=L.c(25),e=V(),{simpleModeTier:o,setSimpleModeTier:l}=le(),n=Re(),u=J(),s=ke(u),x=We(),{data:R,error:g}=ie();let c;t[0]!==R?(c=R===void 0?{tiers:{}}:R,t[0]=R,t[1]=c):c=t[1];const S=c,v=ce(),f=H()?.lockedHarness,i=f==="claude-code",y=we("model_choice"),m=Ne(),a=_e();if(!m||!y)return null;let k,M;if(t[2]!==s||t[3]!==a||t[4]!==i||t[5]!==f||t[6]!==n||t[7]!==l||t[8]!==e||t[9]!==o||t[10]!==x||t[11]!==v||t[12]!==S||t[13]!==g){const T=X(e);k="decopilot",M=Ke.map(d=>{const C=x[d],_=S.tiers[d];return{key:`decopilot-${d}`,icon:W(d),title:T[d],subtitle:a?C??e(O[d]):e(O[d]),active:o===d,onSelect:()=>l(d),modelOverride:a?z=>r.jsxs(r.Fragment,{children:[g&&r.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),r.jsx(Ue,{tier:d,orgSlot:n.tiers[d],userSlot:_,autoSlot:s.chat[d],filterModels:f==="codex"?He:i?Ae:void 0,onClose:z,onPick:A=>v.mutate({tier:d,slot:A}),onReset:()=>v.mutate({tier:d,slot:null})},`${d}:${_?.keyId??"org"}:${_?.modelId??""}`)]}):void 0}}),t[2]=s,t[3]=a,t[4]=i,t[5]=f,t[6]=n,t[7]=l,t[8]=e,t[9]=o,t[10]=x,t[11]=v,t[12]=S,t[13]=g,t[14]=k,t[15]=M}else k=t[14],M=t[15];let j;t[16]!==k||t[17]!==M?(j=[{key:k,rows:M}],t[16]=k,t[17]=M,t[18]=j):j=t[18];const h=j;let p;t[19]!==o?(p=W(o),t[19]=o,t[20]=p):p=t[20];let b;return t[21]!==h||t[22]!==p||t[23]!==o?(b=r.jsx(qe,{tier:o,pillIcon:p,groups:h}),t[21]=h,t[22]=p,t[23]=o,t[24]=b):b=t[24],b}function He(t){return De(t.providerId,t.modelId)}const B=48;function pt(){const t=L.c(12),[e,o]=N.useState("idle"),[l,n]=N.useState(""),[u,s]=N.useState(""),[x,R]=N.useState(Ge),g=N.useRef(null),c=N.useRef(null),S=N.useRef(null),v=N.useRef(null),f=N.useRef(0),i=N.useRef(!1),y=N.useRef(""),m=N.useRef(""),a=N.useRef(!1),k=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let M;t[0]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),c.current?.close().catch(Ye),v.current?.getTracks().forEach(Qe),S.current=null,c.current=null,v.current=null},t[0]=M):M=t[0];const j=M;let h;t[1]===Symbol.for("react.memo_cache_sentinel")?(h=E=>{v.current=E;const D=new AudioContext;c.current=D;const I=D.createMediaStreamSource(E),w=D.createAnalyser();w.fftSize=128,w.smoothingTimeConstant=.8,I.connect(w),S.current=w;const $=new Uint8Array(w.frequencyBinCount),P=()=>{if(!S.current)return;S.current.getByteFrequencyData($);const F=[];for(let U=0;U<B;U++){const K=Math.floor(U/B*$.length);F.push(Math.max(.04,($[K]??0)/255))}R(F),f.current=requestAnimationFrame(P)};P()},t[1]=h):h=t[1];const p=h;let b;t[2]!==e?(b=async()=>{if(a.current||i.current)return e;a.current=!0;const E=window.SpeechRecognition||window.webkitSpeechRecognition;if(!E)return a.current=!1,o("unsupported"),"unsupported";let D;try{D=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return a.current=!1,o("permission-denied"),"permission-denied"}a.current=!1,n(""),s(""),m.current="",y.current="",i.current=!0,o("recording"),p(D);const I=new E;g.current=I,I.interimResults=!0,I.continuous=!0,I.lang=navigator.language||"en-US",I.onresult=w=>{if(g.current!==I)return;let $="",P="";for(let F=w.resultIndex;F<w.results.length;F++){const U=w.results[F],K=U?.[0]?.transcript??"";U?.isFinal?P=P+K:$=$+K}P&&(y.current=y.current+P,n(y.current)),m.current=$,s($)},I.onerror=w=>{g.current===I&&w.error!=="no-speech"&&(i.current=!1,g.current=null,j(),o(w.error==="not-allowed"?"permission-denied":"idle"))},I.onend=()=>{if(g.current===I&&i.current)try{I.start()}catch{}};try{I.start()}catch{return i.current=!1,g.current=null,j(),o("idle"),"idle"}return"recording"},t[2]=e,t[3]=b):b=t[3];const T=b;let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{i.current=!1,g.current?.stop(),j(),o("idle"),R(Array(B).fill(.05)),s("");const E=(y.current+(m.current?" "+m.current:"")).trim();return n(""),y.current="",m.current="",E},t[4]=d):d=t[4];const C=d;let _;t[5]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{i.current=!1,g.current?.abort(),j(),o("idle"),n(""),s(""),R(Array(B).fill(.05)),y.current="",m.current=""},t[5]=_):_=t[5];const z=_;let A;return t[6]!==u||t[7]!==T||t[8]!==e||t[9]!==l||t[10]!==x?(A={status:e,transcript:l,interimTranscript:u,waveformData:x,isSupported:k,startRecording:T,stopRecording:C,cancelRecording:z},t[6]=u,t[7]=T,t[8]=e,t[9]=l,t[10]=x,t[11]=A):A=t[11],A}function Qe(t){return t.stop()}function Ye(){}function Ge(){return Array(B).fill(.05)}export{ht as T,pt as a,Pe as s,mt as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as u}from"./infiniteQueryObserver-DLpfoYPn.js";import{e6 as i}from"./index-_MevbWo3.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{eg as Q,eh as y,ei as S,ej as w,e7 as C,q as k,ek as q,el as x,r as p,em as M,en as H,eo as L,ep as P,eq as O,er as B,es as A}from"./index-_MevbWo3.js";function R(r,e){const s=new Set(e);return r.filter(t=>!s.has(t))}function T(r,e,s){const t=r.slice(0);return t[e]=s,t}var j=class extends Q{#i;#e;#n;#r;#s;#t;#o;#u;#h;#a=[];constructor(r,e,s){super(),this.#i=r,this.#r=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(e=>{this.#d(r,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,e){this.#n=r,this.#r=e,y.batch(()=>{const s=this.#s,t=this.#f(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=s.length!==i.length,c=i.some((o,d)=>o!==s[d]),f=u||c,b=f?!0:n.some((o,d)=>{const g=this.#e[d];return!g||!S(o,g)});!f&&!b||(f&&(this.#a=t,this.#s=i),this.#e=n,this.hasListeners()&&(f&&(R(s,i).forEach(o=>{o.destroy()}),R(i,s).forEach(o=>{o.subscribe(d=>{this.#d(o,d)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#f(r),t=s.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=s.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,e,i),()=>this.#c(t,s)]}#c(r,e){return e.map((s,t)=>{const i=r[t];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,n=>{e.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,e,s){if(e){const t=this.#h,i=s!==void 0&&t!==void 0&&(t.length!==s.length||s.some((n,u)=>n!==t[u]));return(!this.#t||this.#e!==this.#u||i||e!==this.#o)&&(this.#o=e,this.#u=this.#e,s!==void 0&&(this.#h=s),this.#t=w(this.#t,e(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#s.some((r,e)=>r.options.suspense&&this.#e[e]?.data===void 0)}#f(r){const e=new Map;this.#s.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=e.get(i);n?n.push(t):e.set(i,[t])});const s=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=e.get(i.queryHash)?.shift()??new C(this.#i,i);s.push({defaultedQueryOptions:i,observer:u})}),s}#d(r,e){const s=this.#s.indexOf(r);s!==-1&&(this.#e=T(this.#e,s,e),this.#p())}#p(){if(this.hasListeners()){const r=this.#c(this.#e,this.#a),e=this.#b(),s=this.#t,t=e?s:this.#l(r,this.#r?.combine);(e||s!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function I({queries:r,...e},s){const t=k(s),i=q(),n=x(),u=p.useMemo(()=>r.map(h=>{const a=t.defaultQueryOptions(h);return a._optimisticResults=i?"isRestoring":"optimistic",a}),[r,t,i]);u.forEach(h=>{M(h);const a=t.getQueryCache().get(h.queryHash);H(h,n,a)}),L(n);const[c]=p.useState(()=>new j(t,u,e)),[f,b,o]=c.getOptimisticResult(u,e.combine),d=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>d?c.subscribe(y.batchCalls(h)):P,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setQueries(u,e)},[u,e,c]);const m=f.some((h,a)=>O(u[a],h))?f.flatMap((h,a)=>{const l=u[a];if(l&&O(l,h)){const E=new C(t,l);return B(l,E,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const v=f.find((h,a)=>{const l=u[a];return l&&A({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(v?.error)throw v.error;return b(o())}export{I as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as s}from"./infiniteQueryObserver-DLpfoYPn.js";import{e6 as u,ee as n}from"./index-_MevbWo3.js";function a(e,r){return u({...e,enabled:!0,suspense:!0,throwOnError:n},s,r)}export{a as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as V,b as q,r as z,a as O,i as Y,e as $,j as t,n as L,K as J,t as Q,o as W,B as G,p as H}from"./index-_MevbWo3.js";import{C as X}from"./collection-table-wrapper-CHxBDquy.js";import{E as D}from"./empty-state-Cso9EJYJ.js";import{S as Z}from"./search-input-BRG5lLwk.js";import{B as I}from"./badge-VkLFh9uU.js";import{u as ee}from"./use-debounced-value-B22_huH1.js";import{a as K}from"./admin-fetch-BhTJlAsX.js";import"./table-DXLWi5Uj.js";import"./ArrowUp-DJ1ux-eS.js";import"./SearchMd-BIoAkvcK.js";function pe(){const e=V.c(58),s=q(),[r,M]=z.useState("");let N;e[0]!==r?(N=r.trim(),e[0]=r,e[1]=N):N=e[1];const i=ee(N,300),{data:R}=O.useSession(),k=R?.user?.id;let n;e[2]!==i?(n=J.deploymentAdminUsers(i),e[2]=i,e[3]=n):n=e[3];let l;e[4]!==i?(l=()=>{const a=new URLSearchParams({limit:"100"});return i&&a.set("searchValue",i),K(`/api/_admin/users?${a}`)},e[4]=i,e[5]=l):l=e[5];let C;e[6]!==n||e[7]!==l?(C={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=C):C=e[8];const{data:P,isLoading:_,isError:A}=Y(C);let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=te,e[9]=w):w=e[9];let y;e[10]!==s?(y={mutationFn:ae,onSuccess:w,onError:a=>{Q.error(a instanceof Error?a.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=y):y=e[11];const E=$(y);let b;e[12]!==P?.users?(b=P?.users??[],e[12]=P?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=a=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(W,{url:a.image??void 0,fallback:a.name??"?",shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:a.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:a.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=a=>a.emailVerified?t.jsx(I,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(I,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:se,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==k||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:a=>t.jsx(G,{variant:"outline",size:"sm",disabled:a.id===k||E.isPending,onClick:()=>E.mutate(a.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=k,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==r||e[44]!==j?(g=t.jsx(Z,{value:r,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=r,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==i||e[47]!==A||e[48]!==s?(S=A?t.jsx(D,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(D,{title:s("admin.users.noUsersFoundTitle"),description:i?s("admin.users.noUsersMatchSearch",{search:i}):s("admin.users.noUsersYet")}),e[46]=i,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(X,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(L,{children:t.jsx(L.Content,{children:t.jsx(L.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function se(e){return t.jsx("span",{className:"text-sm text-foreground",children:H(e.createdAt)})}function te(){window.location.href="/"}function ae(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{pe as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{aq as W,ar as E}from"./agent-icon-BXpAi9QB.js";import{i as w}from"./File02-CSQcpToj.js";import{a as j}from"./Image01-C49Ygyvj.js";function I(e){if(!e||e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;try{const t=decodeURIComponent(e);return!!(t.includes("\\")||t.includes("..")||t.includes("\0"))}catch{return!0}}function L(e){if(I(e))throw new Error(`Invalid block key: ${e||"(empty)"}`)}function C(e){try{return decodeURIComponent(e)}catch{return e}}function P(e){return L(e),encodeURIComponent(e)}function v(e){return`.deco/blocks/${P(e)}.json`}const z=1e4,F=3;function y(e){return e.trim()?(e.startsWith("/")?e:`/${e}`).replace(/\/+/g,"/"):"/"}function x(e){return e.startsWith("/")?e.slice(1):e}function D(e){const t=x(e);return!t||t.includes("..")||t.includes("\\")?!1:t.startsWith(".deco/blocks/")||!t.startsWith("/")&&!t.includes("://")}function h(e){return e.trim()?e.startsWith("/")?e:`/${e}`:"/"}function $(e){const t=h(e);if(t==="/")return"/";const n=t.split("/").filter(Boolean);return n.pop(),n.length===0?"/":`/${n.join("/")}`}function _(e,t){const n=t.replace(/^\/+|\/+$/g,"");return h(n?`${e==="/"?"":e}/${n}`:e)}function M(e,t){return t==="directory"?e:$(e)}function S(e){const t=e.trim();return t?t.includes("/")||t.includes("\\")||t.includes("..")||t.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function B(e){const t=x(e);return t?t.split("/").filter(Boolean).length:0}function q(e,t,n,r=!1){return{files:[...new Set([...e,...n.files])],directories:[...new Set([...t,...n.directories??[]])],truncated:r||!!n.truncated}}function H(e,t){return B(e)>=F&&!t.has(e)}function U(e,t,n=[]){const r=x(e);if(t.includes(r)||n.includes(r))return!0;if(!r)return!1;const s=`${r}/`;return t.some(o=>o.startsWith(s))||n.some(o=>o.startsWith(s))}function A(e){const t=x(e),n=".deco/blocks/";if(!t.startsWith(n)||!t.endsWith(".json"))return null;const r=t.slice(n.length,-5);return C(r)}function X(e){if(!e)return"plaintext";const t=e.toLowerCase();return t.endsWith(".tsx")||t.endsWith(".ts")?"typescript":t.endsWith(".jsx")||t.endsWith(".js")||t.endsWith(".mjs")||t.endsWith(".cjs")?"javascript":t.endsWith(".json")?"json":t.endsWith(".md")||t.endsWith(".mdx")?"markdown":t.endsWith(".css")?"css":t.endsWith(".scss")?"scss":t.endsWith(".html")?"html":t.endsWith(".yaml")||t.endsWith(".yml")?"yaml":t.endsWith(".xml")||t.endsWith(".svg")?"xml":t.endsWith(".py")?"python":t.endsWith(".sql")?"sql":t.endsWith(".sh")?"shell":"plaintext"}const T="#94a3b8";function K(e){const t=e.toLowerCase();return t.endsWith(".tsx")||t.endsWith(".ts")?{Icon:W,color:"#3b82f6"}:t.endsWith(".jsx")||t.endsWith(".js")||t.endsWith(".mjs")||t.endsWith(".cjs")?{Icon:W,color:"#d9a441"}:t.endsWith(".json")?{Icon:E,color:"#cb9b3f"}:t.endsWith(".css")||t.endsWith(".scss")?{Icon:W,color:"#06b6d4"}:t.endsWith(".html")||t.endsWith(".xml")?{Icon:W,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(t)?{Icon:j,color:"#a855f7"}:t.endsWith(".md")||t.endsWith(".mdx")?{Icon:w,color:"#64748b"}:{Icon:w,color:T}}function V(e){const t=y(e).split("/").filter(Boolean),n=["/"];let r="";for(const s of t.slice(0,-1))r+=`/${s}`,n.push(r);return n}function J(e,t=[]){const n={path:"/",children:[]},r=new Map,s=a=>{let i=r.get(a.path);return i||(i=new Map,r.set(a.path,i)),i},o=a=>{const c=y(a).split("/").filter(Boolean);let l=n,m="";for(const f of c){m+=`/${f}`;const g=s(l);let d=g.get(f);d?d.kind==="file"&&(d.kind="directory"):(d={name:f,path:m,kind:"directory",children:[]},l.children.push(d),g.set(f,d)),l=d}};for(const a of e){const c=y(a).split("/").filter(Boolean);let l=n,m="";c.forEach((f,g)=>{m+=`/${f}`;const d=g===c.length-1,k=s(l);let p=k.get(f);p||(p={name:f,path:m,kind:d?"file":"directory",children:[]},l.children.push(p),k.set(f,p)),l=p})}for(const a of t)o(h(a));const u=a=>{a.sort((i,c)=>i.kind!==c.kind?i.kind==="directory"?-1:1:i.name.localeCompare(c.name));for(const i of a)i.children.length>0&&u(i.children)};return u(n.children),n.children}function N(e,t,n=0){const r=[];for(const s of e)if(s.name!==".gitkeep"&&(r.push({node:s,depth:n}),s.kind==="directory"&&s.children.length>0&&t.has(s.path)))for(const o of N(s.children,t,n+1))r.push(o);return r}function Q(e){const t=[];for(const n of e.split(`
|
|
2
|
+
`)){if(!n)continue;const r=n.indexOf(":");if(r<0)continue;const s=n.indexOf(":",r+1);if(s<0)continue;const o=Number.parseInt(n.slice(r+1,s),10);Number.isFinite(o)&&t.push({path:h(n.slice(0,r)),line:o,text:n.slice(s+1)})}return t}function Y(e,t,n){const r=t.trim().toLowerCase();if(!r)return[];const s=[];for(const o of e)if((o.split("/").pop()??o).toLowerCase().includes(r)&&(s.push(h(o)),s.length>=n))break;return s}const b=24;function Z(e,t){const n=e.replace(/^\s+/,""),r=t.trim().toLowerCase();if(!r)return{leadingEllipsis:!1,segments:[{text:n,match:!1}]};const s=n.toLowerCase().indexOf(r);if(s<0)return{leadingEllipsis:!1,segments:[{text:n,match:!1}]};const o=s>b,u=o?n.slice(s-b):n,a=u.toLowerCase(),i=[];let c=0;for(;;){const l=a.indexOf(r,c);if(l<0){c<u.length&&i.push({text:u.slice(c),match:!1});break}l>c&&i.push({text:u.slice(c,l),match:!1}),i.push({text:u.slice(l,l+r.length),match:!0}),c=l+r.length}return{leadingEllipsis:o,segments:i}}function tt(e){const t=[],n=new Map;for(const r of e){let s=n.get(r.path);s||(s={path:r.path,matches:[]},n.set(r.path,s),t.push(s)),s.matches.push(r)}return t}function et(e){return e.split(`
|
|
3
|
+
`).map(t=>t.replace(/^\d+\t/,"")).join(`
|
|
4
|
+
`)}export{F as E,C as a,L as b,z as c,v as d,J as e,N as f,X as g,tt as h,D as i,M as j,h as k,K as l,$ as m,V as n,Z as o,H as p,_ as q,U as r,et as s,x as t,Y as u,S as v,Q as w,A as x,q as y};
|