decocms 3.97.3 → 3.97.4
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-CiYXjBCp.js → AlertCircle-BI7qL-zf.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-D62C8hBG.js → ArrowUpRight-Z3BBkuVk.js} +1 -1
- package/dist/client/assets/{CheckCircle-B0cHPrPi.js → CheckCircle-Ct0IkEsg.js} +1 -1
- package/dist/client/assets/{ChevronDown-Ep-T2bbc.js → ChevronDown-c1oSYfs-.js} +1 -1
- package/dist/client/assets/{ChevronLeft-Cn3JRl7K.js → ChevronLeft-B5WBGMCf.js} +1 -1
- package/dist/client/assets/{ChevronRight-BB8PtdU_.js → ChevronRight-ro8pTEbC.js} +1 -1
- package/dist/client/assets/{ChevronUp-BCrNzv-A.js → ChevronUp-D4yp8Sde.js} +1 -1
- package/dist/client/assets/{DotsVertical-21OsfYko.js → DotsVertical-Bva5wMia.js} +1 -1
- package/dist/client/assets/{Eye-vPozEeRC.js → Eye-Dz0LfZhX.js} +1 -1
- package/dist/client/assets/{FilterLines-BcHnc4HO.js → FilterLines-CNNSd5My.js} +1 -1
- package/dist/client/assets/{Globe01-eAXhqoKJ.js → Globe01-Cat8RRQP.js} +1 -1
- package/dist/client/assets/{Globe04-8G7DaJlX.js → Globe04-CNkdEC4q.js} +1 -1
- package/dist/client/assets/{HardDrive-BJ-lnZmp.js → HardDrive-Bp0ax-t_.js} +1 -1
- package/dist/client/assets/{Key01-qC4LCntt.js → Key01-CK-dtvzj.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DiBhmi5f.js → LayoutLeft-DRgE3-pt.js} +1 -1
- package/dist/client/assets/{LinkExternal01-k2q6wU7l.js → LinkExternal01-BMRTG9GY.js} +1 -1
- package/dist/client/assets/{Monitor01-DvPP6kPt.js → Monitor01-ClILKoXR.js} +1 -1
- package/dist/client/assets/{Palette-BaoaCY0h.js → Palette-DzZpBk45.js} +1 -1
- package/dist/client/assets/{Play-CMo8plFz.js → Play-B0tuLbrU.js} +1 -1
- package/dist/client/assets/{Plus-CexM6aI0.js → Plus-C2AcrVDQ.js} +1 -1
- package/dist/client/assets/{SearchMd-BT6OYA0s.js → SearchMd-CiOkSnnl.js} +1 -1
- package/dist/client/assets/{Settings02-CtG2aS1_.js → Settings02-DIy8pOAO.js} +1 -1
- package/dist/client/assets/{Shield01-Dwjpxvd-.js → Shield01-txQYlyv3.js} +1 -1
- package/dist/client/assets/{Star01-Ccb8Hi5b.js → Star01-DhVZBXZp.js} +1 -1
- package/dist/client/assets/{Stars01-Dsl5vjAD.js → Stars01-BpFWqd_D.js} +1 -1
- package/dist/client/assets/{Stars02-kHQQc3aX.js → Stars02-Ulg_Ysyf.js} +1 -1
- package/dist/client/assets/{Sun-BjBDYy_F.js → Sun-DTQS8SC0.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-YTEahx81.js → SwitchHorizontal01-h5bJ4Pj6.js} +1 -1
- package/dist/client/assets/{Tool01-DaG15Hqa.js → Tool01-95LOctqu.js} +1 -1
- package/dist/client/assets/{Trash01-B5-ciNMB.js → Trash01-CA4eBk7v.js} +1 -1
- package/dist/client/assets/{Upload01-DWdtOJ5u.js → Upload01-C6hlgF_d.js} +1 -1
- package/dist/client/assets/{User01-4kOfLZMN.js → User01-Bj4QEnuq.js} +1 -1
- package/dist/client/assets/{Users01-dV9sT0dy.js → Users01-DjqWZa4u.js} +1 -1
- package/dist/client/assets/{Users03-D9C5BM7D.js → Users03-BnJ4POBL.js} +1 -1
- package/dist/client/assets/{X-BKm6Fw1t.js → X-C3pn9FBd.js} +1 -1
- package/dist/client/assets/{XCircle-CAZvEkjb.js → XCircle-NMY-qxx5.js} +1 -1
- package/dist/client/assets/{XClose-ssDuFEQg.js → XClose-JPFhglUg.js} +1 -1
- package/dist/client/assets/{Zap-C-erO5Sh.js → Zap-DZT0zVFp.js} +1 -1
- package/dist/client/assets/{ZapSquare-DbVR4h30.js → ZapSquare-CqtF4LbQ.js} +1 -1
- package/dist/client/assets/{ZoomOut-BNzpzje_.js → ZoomOut-D5bsZWrB.js} +1 -1
- package/dist/client/assets/{access-gate-BkA2GKhf.js → access-gate-WSH9l2fw.js} +1 -1
- package/dist/client/assets/{add-section-modal-DxQ_2Wd2.js → add-section-modal-B8U8k2da.js} +1 -1
- package/dist/client/assets/{agent-icon-DC15QH5N.js → agent-icon-CUDD1qQU.js} +1 -1
- package/dist/client/assets/{agents-list-DcKbuDjZ.js → agents-list-Mmv48hK1.js} +1 -1
- package/dist/client/assets/{ai-providers-Je5PimJe.js → ai-providers-DG_vNOxr.js} +1 -1
- package/dist/client/assets/{alert-Dl9mLaEt.js → alert-B3Lwgjtc.js} +1 -1
- package/dist/client/assets/{alert-dialog-DgcsfpwV.js → alert-dialog-Dr09xmbF.js} +1 -1
- package/dist/client/assets/{app-editor-9i48Z1mN.js → app-editor-iiNJMmFS.js} +1 -1
- package/dist/client/assets/{auth-fUaquGnI.js → auth-DEoT60Hp.js} +1 -1
- package/dist/client/assets/{auth-catchall-C-nIq0-D.js → auth-catchall-mlk2GEuO.js} +1 -1
- package/dist/client/assets/{auth-entry-BRIrNXJW.js → auth-entry-D5mX9Y1D.js} +1 -1
- package/dist/client/assets/{auth-split-layout-MeF5ymWQ.js → auth-split-layout-BmZglzY9.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DJxmh0FS.js → authenticate-and-persist-oauth-DdfnmUPY.js} +1 -1
- package/dist/client/assets/{automation-list-row-BE7UAA7m.js → automation-list-row-DPE279l_.js} +1 -1
- package/dist/client/assets/{automation-runs-KROcbEKJ.js → automation-runs-BKcxyen4.js} +1 -1
- package/dist/client/assets/{automations-M_nP8Dw1.js → automations-smiyhS9S.js} +1 -1
- package/dist/client/assets/{avatar-VLg8_8qy.js → avatar-VM4z7Sph.js} +1 -1
- package/dist/client/assets/{badge-CXqt8LsO.js → badge-BZaA6_yP.js} +1 -1
- package/dist/client/assets/{block-document-gRQauTZI.js → block-document-BZQOaxe6.js} +1 -1
- package/dist/client/assets/{brand-context-BBxDnkt1.js → brand-context-DY3B6pea.js} +1 -1
- package/dist/client/assets/{buckets-BMjr1jEe.js → buckets-CIWObJCG.js} +1 -1
- package/dist/client/assets/{capability-load-error-BssWdjEJ.js → capability-load-error-CTNXM3k1.js} +1 -1
- package/dist/client/assets/{card-c1tDYTHP.js → card-6Fn3KHk6.js} +1 -1
- package/dist/client/assets/{category-editor-DsdVSDFi.js → category-editor-E-0PdzQN.js} +1 -1
- package/dist/client/assets/{chat-context-DAyh5sec.js → chat-context-CkCIvS-v.js} +1 -1
- package/dist/client/assets/{checkbox-BZ4Cev3m.js → checkbox-DwEPCxo5.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DIR-u7k3.js → cli-auth-success-CjSSt7y-.js} +1 -1
- package/dist/client/assets/{collection-detail-xnmDLTC2.js → collection-detail-Dx0PFfMs.js} +1 -1
- package/dist/client/assets/{collection-display-button-5E1VxEVW.js → collection-display-button-DCfbO2En.js} +1 -1
- package/dist/client/assets/{collection-search-BHxcuieJ.js → collection-search-D0UcbNUO.js} +1 -1
- package/dist/client/assets/{collection-tabs-BMqIu2hn.js → collection-tabs-C7i3EtkQ.js} +1 -1
- package/dist/client/assets/{command-hmVb9nzj.js → command-C2F2XANI.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BPECsSVR.js → commerce-onboarding-DpQtYpFJ.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-M8mQpyYi.js → connect-desktop-dialog-SkaagoHI.js} +1 -1
- package/dist/client/assets/{connection-card-DwO2q63k.js → connection-card-DKzKsYD0.js} +1 -1
- package/dist/client/assets/{connection-detail-DlzvyCLX.js → connection-detail-106OasvA.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-_UdmyYSC.js → connection-form-helpers-xWNyKJEb.js} +1 -1
- package/dist/client/assets/{connections-BzsSZkKz.js → connections-CQDCMrAi.js} +1 -1
- package/dist/client/assets/{context-menu-ClXPOkdV.js → context-menu-DBrEbI4f.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DF7I7n1i.js → decopilot-sse-pool-p2LEr2W4.js} +1 -1
- package/dist/client/assets/{decopilot-BZ76gfhX.js → decopilot-xz4hhVZ2.js} +1 -1
- package/dist/client/assets/{dialog-CaTEiJVO.js → dialog-XnZQaCET.js} +1 -1
- package/dist/client/assets/{domain-settings-Dy-h970m.js → domain-settings-BmO0lECY.js} +1 -1
- package/dist/client/assets/{drawer-BAJPoLOE.js → drawer-B5z2AOPt.js} +1 -1
- package/dist/client/assets/{dropdown-menu-oCs7Iiv2.js → dropdown-menu-CjfuPw4B.js} +1 -1
- package/dist/client/assets/{empty-state-wZACnL2J.js → empty-state-K13YYE8V.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Bmmw_I_H.js → extract-connection-data-D2_IgRyD.js} +1 -1
- package/dist/client/assets/{file-explorer-DYFMt1oY.js → file-explorer-CSMcmCDO.js} +1 -1
- package/dist/client/assets/{file-type-icon-DHG3dnn1.js → file-type-icon-gLx9uWdG.js} +1 -1
- package/dist/client/assets/{files-BjRJXW0l.js → files-CgBtSGQa.js} +1 -1
- package/dist/client/assets/{form-BWIorvmY.js → form-BCSBsB3M.js} +1 -1
- package/dist/client/assets/{general-CFBr5HF3.js → general-Dev0qsuS.js} +1 -1
- package/dist/client/assets/{github-repo-picker-Bqmm5RYY.js → github-repo-picker-B4DQ87lb.js} +1 -1
- package/dist/client/assets/{hooks-DGQm848Q.js → hooks-Dh6Jo6FF.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-z9TrSbfs.js → import-from-deco-dialog-BVHsGWbT.js} +1 -1
- package/dist/client/assets/{index-ZWBhZDHA.js → index-BBAsYjSg.js} +1 -1
- package/dist/client/assets/{index-DFanLV1X.js → index-BbxDcYXz.js} +1 -1
- package/dist/client/assets/{index-CVhJkkBU.js → index-BuTMcq2r.js} +1 -1
- package/dist/client/assets/{index-DY2Xseue.js → index-C8Wh7-Ly.js} +1 -1
- package/dist/client/assets/{index-6BQORbvL.js → index-CE2XOQVr.js} +1 -1
- package/dist/client/assets/{index-C4Z0gT1h.js → index-CJOXnwUs.js} +1 -1
- package/dist/client/assets/{index-CqwvSop6.js → index-CQJFA7-5.js} +1 -1
- package/dist/client/assets/{index-DIk1O_Dr.js → index-DSYaiu7_.js} +1 -1
- package/dist/client/assets/{index-17QLTZMM.js → index-DbYhcgAw.js} +5 -5
- package/dist/client/assets/{index-DLQ4JwZN.js → index-Djd6TuLO.js} +3 -3
- package/dist/client/assets/{index-DHFxvk5e.js → index-IsMJIAw6.js} +1 -1
- package/dist/client/assets/{index-AltTReR4.js → index-WC9jROXW.js} +1 -1
- package/dist/client/assets/{index-B83rPo9I.js → index-Wtqqsvov.js} +1 -1
- package/dist/client/assets/{index-redirect-2HTXFJkp.js → index-redirect-LwQf8HQF.js} +1 -1
- package/dist/client/assets/{index-qjVbGUv9.js → index-y2e8K8Eh.js} +1 -1
- package/dist/client/assets/{input-BFLS6IB9.js → input-BNOGUlQT.js} +1 -1
- package/dist/client/assets/{integration-icon-DD9LcA1t.js → integration-icon-Da8Ja8xZ.js} +1 -1
- package/dist/client/assets/{label-TS_o46fE.js → label-BzwbJuLA.js} +1 -1
- package/dist/client/assets/{login-jqUZykUn.js → login-BFTv0hNB.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DyPHEZc0.js → mcp-oauth-CiksM5XP.js} +1 -1
- package/dist/client/assets/{members-Oku2ILxU.js → members-BhnBffwF.js} +1 -1
- package/dist/client/assets/{monaco-editor-D0BeTcV-.js → monaco-editor-DiBPYiNx.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BkORDVIl.js → monitoring-stats-row-CcPgk97X.js} +1 -1
- package/dist/client/assets/{oauth-callback-BgIbnfWn.js → oauth-callback-BrGCqspF.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DnNDJyNh.js → oauth-callback-ai-provider-BfdjFrej.js} +1 -1
- package/dist/client/assets/{onboarding-Df5Y7dbu.js → onboarding-CxGIxXF1.js} +1 -1
- package/dist/client/assets/{org-install-C9pyMts_.js → org-install-CI7aPCB0.js} +1 -1
- package/dist/client/assets/{org-layout-Bl_9Td80.js → org-layout-DOBb0Fbt.js} +1 -1
- package/dist/client/assets/{organization-choice-vRlqbiOV.js → organization-choice-BFeOoh8u.js} +1 -1
- package/dist/client/assets/{page-seo-form-BlSVNC9f.js → page-seo-form-BTOsm1v0.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BC74IS3P.js +1 -0
- package/dist/client/assets/{popover-BSP7ejLc.js → popover-D2ChxMGV.js} +1 -1
- package/dist/client/assets/{post-editor-CXXGCGJD.js → post-editor-BkEG5JCy.js} +1 -1
- package/dist/client/assets/{preview-dialog-CSsWWs5M.js → preview-dialog-Dyv-Otum.js} +1 -1
- package/dist/client/assets/{primitives-DhSbPHiR.js → primitives-DqhOOS3x.js} +1 -1
- package/dist/client/assets/{profile-BZTAS1CN.js → profile-BJcOUl1z.js} +1 -1
- package/dist/client/assets/project-app-view-juh8eCQN.js +1 -0
- package/dist/client/assets/record-editor-Bl6ua1Xn.js +1 -0
- package/dist/client/assets/registry-1R5kgpGp.js +2 -0
- package/dist/client/assets/{registry-layout-BRvslRVV.js → registry-layout-BHbBw0Su.js} +1 -1
- package/dist/client/assets/{require-capability-CikSO1sK.js → require-capability-CS7JuOWU.js} +1 -1
- package/dist/client/assets/{required-auth-layout-1Q0s2bde.js → required-auth-layout-D8JzfwRM.js} +1 -1
- package/dist/client/assets/{reset-password-e6G_i6Vq.js → reset-password-BUI5EECa.js} +1 -1
- package/dist/client/assets/{roles-BKbJv76K.js → roles-B25l2ywl.js} +1 -1
- package/dist/client/assets/{save-status-DJMZw4Ff.js → save-status-CcBc_RS2.js} +1 -1
- package/dist/client/assets/{scroll-area-bUXD_r58.js → scroll-area-BnoH8jf-.js} +1 -1
- package/dist/client/assets/{search-input-Cw_P0J35.js → search-input-Djqm0TA1.js} +1 -1
- package/dist/client/assets/{secrets-DH2hlPoO.js → secrets-DcAzNXon.js} +1 -1
- package/dist/client/assets/{sections-editor-D2ALK4En.js → sections-editor-Bk9qVARB.js} +1 -1
- package/dist/client/assets/{select-C0lOOEoK.js → select-DKj7B0V2.js} +1 -1
- package/dist/client/assets/{select-model-vYCpp3x3.js → select-model-Bimfcw46.js} +1 -1
- package/dist/client/assets/{seo-editor-CkygDS8T.js → seo-editor-J7Oo13p-.js} +1 -1
- package/dist/client/assets/{settings-layout-BXYPwJV4.js → settings-layout-DY61B_5X.js} +1 -1
- package/dist/client/assets/{settings-section-Bk_k5SKB.js → settings-section-BHLR2lqY.js} +1 -1
- package/dist/client/assets/{sheet-DAwn9AHA.js → sheet-a31ex1bd.js} +1 -1
- package/dist/client/assets/{shell-controls-HZ3369Yf.js → shell-controls-BRxhvPab.js} +1 -1
- package/dist/client/assets/{shell-layout-DOpUjfn5.js → shell-layout-C1UY2dDO.js} +1 -1
- package/dist/client/assets/{shell-route-loading-xptU08tM.js → shell-route-loading-D1Wm-1cK.js} +1 -1
- package/dist/client/assets/{sidebar-g2qAal9U.js → sidebar-Cj_aFqAP.js} +1 -1
- package/dist/client/assets/{skeleton-D4R3a4o-.js → skeleton-BgGeuCF7.js} +1 -1
- package/dist/client/assets/{sortable.esm-BnJIYE_Z.js → sortable.esm-CMtvLYoN.js} +1 -1
- package/dist/client/assets/{sso-qEodk6g6.js → sso-DqhUN-uI.js} +1 -1
- package/dist/client/assets/{store-C4B_G2oW.js → store-CdnJ7fUT.js} +1 -1
- package/dist/client/assets/store-registry-k484eohP.js +2 -0
- package/dist/client/assets/{studio-tools-COOhA4uQ.js → studio-tools-gp9mLcnF.js} +1 -1
- package/dist/client/assets/{switch-B56_YQh-.js → switch-14YiCb40.js} +1 -1
- package/dist/client/assets/{table-C_RjqUn4.js → table-D5xuIpUU.js} +1 -1
- package/dist/client/assets/{tabs-DWit868K.js → tabs-ChA8V1ag.js} +1 -1
- package/dist/client/assets/{task-status-ANvwNzqA.js → task-status-C7xHgaQ7.js} +1 -1
- package/dist/client/assets/{textarea-DUeOU9F3.js → textarea-0LfkB4H6.js} +1 -1
- package/dist/client/assets/{toggle-group-BJd6ihxO.js → toggle-group-Ctok94CI.js} +1 -1
- package/dist/client/assets/{toolbar-CqV98Xz1.js → toolbar-Dgv-0cJG.js} +1 -1
- package/dist/client/assets/{tooltip-BBVKuVWA.js → tooltip-DNHEz7H9.js} +1 -1
- package/dist/client/assets/{types-CFybozjb.js → types-BpjdnyIn.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BI7Dx3UD.js → use-ai-providers-FEYc1hYo.js} +1 -1
- package/dist/client/assets/{use-automations-BlPG5Nag.js → use-automations-BBBpz3Ll.js} +1 -1
- package/dist/client/assets/{use-capability-GDRaaPxs.js → use-capability-BDeYhQRR.js} +1 -1
- package/dist/client/assets/{use-clock-tick-10nS2wAD.js → use-clock-tick-xyRkceIk.js} +1 -1
- package/dist/client/assets/{use-collections-olSa4--l.js → use-collections-DHsBnI-g.js} +1 -1
- package/dist/client/assets/{use-connection-n2su9fBK.js → use-connection-d25soQOF.js} +1 -1
- package/dist/client/assets/{use-copy-CV2s0Bln.js → use-copy-dG8egJns.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-G5bEKswL.js → use-create-virtual-mcp-t3h12kDQ.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-3i25sE_n.js → use-debounced-autosave-CbQ41T1D.js} +1 -1
- package/dist/client/assets/{use-delete-connection-C1BvcpjL.js → use-delete-connection-DWsYfcTZ.js} +1 -1
- package/dist/client/assets/{use-file-configs-fW8ExhxC.js → use-file-configs-BZdMLkS5.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DEtplhmh.js → use-infinite-scroll-B66e2kY3.js} +1 -1
- package/dist/client/assets/{use-join-requests-CPgAASRp.js → use-join-requests-SbIrsr3r.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CNXUneAa.js → use-mcp-client-DIy-B1wr.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Dp1bbbjz.js → use-mcp-prompts-9snCiqu-.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Dp1oFDkR.js → use-mcp-tools-Dm8hC2Ai.js} +1 -1
- package/dist/client/assets/{use-members-CbHGf6Jg.js → use-members-QdT6WLec.js} +1 -1
- package/dist/client/assets/{use-mobile-D49EcQdA.js → use-mobile-thzrczKW.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-m-7qnjdO.js → use-navigate-to-agent-BUtLr1-s.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-FC6WdH_x.js → use-org-auth-client-DEuaxZpa.js} +1 -1
- package/dist/client/assets/{use-org-sso-BFPLcR8G.js → use-org-sso-CydJi_gG.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CEdyJBDf.js → use-organization-roles-DoQvWm8B.js} +1 -1
- package/dist/client/assets/{use-organization-settings-I56W3q4b.js → use-organization-settings-BIHpPlmZ.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DeVqfCCu.js → use-registry-connections-DaDcQiUE.js} +1 -1
- package/dist/client/assets/{use-secrets-DfdiWPHB.js → use-secrets-JQFoSSKX.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DBMDawLF.js → use-status-sounds-DuB5Qdsa.js} +1 -1
- package/dist/client/assets/{use-view-mode-CVarJF55.js → use-view-mode-n-a_ONE0.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-37EwEzlF.js → use-virtual-mcp-Cw7Cf-co.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-sDr4Gfly.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-CpcwLIEk.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-DlzLq1Lb.js → useSuspenseQueries-DxszLLty.js} +1 -1
- package/dist/client/assets/{variant-calendar-D1ngj2k8.js → variant-calendar-E9B1QGS8.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CoFBmpiz.js → view-mode-toggle-CmzDEt1O.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/page-seo-sheet-B4lXhQN9.js +0 -1
- package/dist/client/assets/project-app-view-zNAcdk0L.js +0 -1
- package/dist/client/assets/record-editor-CTIyv7ob.js +0 -1
- package/dist/client/assets/registry-eX771F2z.js +0 -2
- package/dist/client/assets/store-registry-BYI63lgN.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Do3-OeIV.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-7BcKLQOb.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cZ as de,c_ as he,c$ as fe,ce as pe,d0 as me,bV as m,bW as w,d1 as _e,d2 as ge,d3 as we,d4 as $,d5 as Te,d6 as j,d7 as ye,d8 as q,d9 as ve,da as F,db as ke,dc as Se,dd as Ce,de as Q,bA as Re,bC as be,bh as Ie,c9 as te,cl as Ee,cr as qe,cp as Pe,cN as Ae,df as $e,dg as Me,dh as M,di as Oe,dj as He,cq as Ne,cm as xe,cn as De,co as Ue,bx as je,dk as Fe,dl as Le,dm as Ve,cg as We,dn as ze,dp as Qe,dq as Ge,bw as x,c as se,q as re,aK as V}from"./index-DLQ4JwZN.js";import{U as P,a as O,e as G}from"./auth-fUaquGnI.js";function N(o){return!!o._zod}function R(o,e){return N(o)?de(o,e):o.safeParse(e)}function oe(o){if(!o)return;let e;if(N(o)?e=o._zod?.def?.shape:e=o.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Je(o){if(N(o)){const a=o._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}const t=o._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=o.value;if(s!==void 0)return s}function b(o){return o==="completed"||o==="failed"||o==="cancelled"}function J(o){const t=oe(o)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Je(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(o,e){const t=R(o,e);if(!t.success)throw t.error;return t.data}const Ke=6e4;class Ye{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(he,t=>{this._oncancel(t)}),this.setNotificationHandler(fe,t=>{this._onprogress(t)}),this.setRequestHandler(pe,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(me,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(_e,async(t,s)=>{const r=async()=>{const a=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(a,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(a,s.sessionId);if(!n)throw new m(w.InvalidParams,`Task not found: ${a}`);if(!b(n.status))return await this._waitForTaskUpdate(a,s.signal),await r();if(b(n.status)){const i=await this._taskStore.getTaskResult(a,s.sessionId);return this._clearTaskQueue(a),{...i,_meta:{...i._meta,[q]:{taskId:a}}}}return await r()};return await r()}),this.setRequestHandler(ge,async(t,s)=>{try{const{tasks:r,nextCursor:a}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:a,_meta:{}}}catch(r){throw new m(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(we,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(b(r.status))throw new m(w.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 a=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!a)throw new m(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...a}}catch(r){throw r instanceof m?r:new m(w.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,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:a,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(w.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=a=>{s?.(a),this._onerror(a)};const r=this._transport?.onmessage;this._transport.onmessage=(a,n)=>{r?.(a,n),$(a)||Te(a)?this._onresponse(a):j(a)?this._onrequest(a,n):ye(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},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(w.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,a=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{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=ve(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};a&&(h.relatedTask={taskId:a}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(w.ConnectionClosed,"Request was cancelled");const g={...f,relatedRequestId:e.id};a&&!g.relatedTask&&(g.relatedTask={taskId:a});const y=g.relatedTask?.taskId??a;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,g)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:a,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};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{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:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{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),a=this._progressHandlers.get(r);if(!a){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}a(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),$(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 a=!1;if($(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"&&(a=!0,this._taskProgressTokens.set(i.taskId,t))}}if(a||this._progressHandlers.delete(t),$(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(w.InternalError,String(n))}}return}let a;try{const n=await this.request(e,F,s);if(n.task)a=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:a},s);if(yield{type:"taskStatus",task:i},b(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},t,s)}:i.status==="failed"?yield{type:"error",error:new m(w.InternalError,`Task ${a} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(w.InternalError,`Task ${a} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},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(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:a,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++,g={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(g.params={...g.params,task:i}),u&&(g.params={...g.params,_meta:{...g.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:a,onresumptiontoken:n}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));const _=c instanceof m?c:new m(w.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=R(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ke,v=()=>y(m.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,v,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const k=this._responseHandlers.get(f);k?k(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(g,{relatedRequestId:r,resumptionToken:a,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ke,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},Se,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Ce,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=J(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,a)=>{const n=K(e,r);return Promise.resolve(t(n,a))})}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=J(e);this._notificationHandlers.set(s,r=>{const a=K(e,r);return Promise.resolve(t(a))})}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"&&j(r.message)){const a=r.message.id,n=this._requestResolvers.get(a);n?(n(new m(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} 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,a)=>{if(t.aborted){a(new m(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),a(new m(w.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 a=await s.getTask(r,t);if(!a)throw new m(w.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(r,a,n)=>{await s.storeTaskResult(r,a,n,t);const i=await s.getTask(r,t);if(i){const u=Q.parse({method:"notifications/tasks/status",params:i});await this.notification(u),b(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,a,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(b(i.status))throw new m(w.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,a,n,t);const u=await s.getTask(r,t);if(u){const p=Q.parse({method:"notifications/tasks/status",params:u});await this.notification(p),b(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Y(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function Be(o,e){const t={...o};for(const s in e){const r=s,a=e[r];if(a===void 0)continue;const n=t[r];Y(n)&&Y(a)?t[r]={...n,...a}:t[r]=a}return t}var Ze=be();const Xe=Re(Ze);function et(){const o=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ie(o),o}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=te,s){const r=this._client,a={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,a),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(w.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(w.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(w.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(o,e,t){if(!o)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!o.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function ot(o,e,t){if(!o)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!o.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!o.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function H(o,e){if(!(!o||e===null||typeof e!="object")){if(o.type==="object"&&o.properties&&typeof o.properties=="object"){const t=e,s=o.properties;for(const r of Object.keys(s)){const a=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(a,"default")&&(t[r]=a.default),t[r]!==void 0&&H(a,t[r])}}if(Array.isArray(o.anyOf))for(const t of o.anyOf)typeof t!="boolean"&&H(t,e);if(Array.isArray(o.oneOf))for(const t of o.oneOf)typeof t!="boolean"&&H(t,e)}}function at(o){if(!o)return{supportsFormMode:!1,supportsUrlMode:!1};const e=o.form!==void 0,t=o.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let nt=class extends Ye{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",Ee,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",qe,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Pe,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=Be(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let a;if(N(r)){const i=r;a=i._zod?.def?.value??i.value}else{const i=r;a=i._def?.value??i.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");const n=a;if(n==="elicitation/create"){const i=async(u,p)=>{const l=R(Le,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:g}=at(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new m(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=R(F,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(w.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=R(Ve,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(w.InvalidParams,`Invalid elicitation result: ${c}`)}const v=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&v.action==="accept"&&v.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{H(d,v.content)}catch{}return v};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=R(We,u);if(!l.success){const v=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid sampling request: ${v}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const v=R(F,f);if(!v.success){const d=v.error instanceof Error?v.error.message:String(v.error);throw new m(w.InvalidParams,`Invalid task creation result: ${d}`)}return v.data}const y=h.tools||h.toolChoice?ze:Qe,T=R(y,f);if(!T.success){const v=T.error instanceof Error?T.error.message:String(T.error);throw new m(w.InvalidParams,`Invalid sampling result: ${v}`)}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:Ae,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Me.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"},M,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Oe,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},M,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},He,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ne,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},xe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},De,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ue,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},M,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},M,t)}async callTool(e,t=te,s){if(this.isToolTaskRequired(e.name))throw new m(w.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),a=this.getToolOutputValidator(e.name);if(a){if(!r.structuredContent&&!r.isError)throw new m(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=a(r.structuredContent);if(!n.valid)throw new m(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(w.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},je,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const a=Fe.safeParse(s);if(!a.success)throw new Error(`Invalid ${e} listChanged options: ${a.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=a.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 bt={SELF:o=>`${o}_self`,REGISTRY:o=>`${o}_registry`,COMMUNITY_REGISTRY:o=>`${o}_community-registry`,DEV_ASSETS:o=>`${o}_dev-assets`,SITE_DIAGNOSTICS:o=>`site-diagnostics_${o}`,COMMERCE_DISCOVERY:o=>`${o}_commerce-discovery`},It="get_my_diagnostic",it="self";function W(o){return{is(e){return!e||!e.startsWith(o)?null:e.slice(o.length)||null},get(e){return`${o}${e}`}}}function ct(o){return{id:o.id,organization_id:o.organizationId,title:o.title,description:o.description,icon:o.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:o.instructions??null},pinned:!1,connections:[]}}const ae=W("decopilot_"),Et=ae.is,lt=ae.get,ne=W("dev_"),qt=ne.get,Pt=ne.is;function At(o){return ct({id:lt(o),organizationId:o,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png"})}const ut=W("commerce-discovery_"),$t=ut.get,Mt={AGENT_MANAGER:o=>`studio-agent-manager_${o}`,AUTOMATION_MANAGER:o=>`studio-automation-manager_${o}`,CONNECTION_MANAGER:o=>`studio-connection-manager_${o}`,STORE_MANAGER:o=>`studio-store-manager_${o}`,BRAND_MANAGER:o=>`studio-brand-manager_${o}`,USAGE_MANAGER:o=>`studio-usage-manager_${o}`};function Ot(o){return o?o.startsWith("studio-agent-manager_")||o.startsWith("studio-automation-manager_")||o.startsWith("studio-connection-manager_")||o.startsWith("studio-store-manager_")||o.startsWith("studio-brand-manager_")||o.startsWith("studio-usage-manager_"):!1}const D=o=>[{type:"text",text:o}];function dt(o){const e=o.meshUrl??(typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either meshUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...o.token?{Authorization:`Bearer ${o.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(o.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:D(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:D(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:D(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},a=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:a,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>o.toJSONString}}function L(o){return o?o instanceof Headers?Object.fromEntries(o.entries()):Array.isArray(o)?Object.fromEntries(o):{...o}:{}}function ht(o=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return o(t,r)}:o}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,ft=13,I=32;function U(o){}function pt(o){if(typeof o=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=U,onError:t=U,onRetry:s=U,onComment:r}=o,a=[];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))),a.length===0){const k=f(d);k!==""&&a.push(k);return}if(d.indexOf(`
|
|
1
|
+
import{cZ as de,c_ as he,c$ as fe,ce as pe,d0 as me,bV as m,bW as w,d1 as _e,d2 as ge,d3 as we,d4 as $,d5 as Te,d6 as j,d7 as ye,d8 as q,d9 as ve,da as F,db as ke,dc as Se,dd as Ce,de as Q,bA as Re,bC as be,bh as Ie,c9 as te,cl as Ee,cr as qe,cp as Pe,cN as Ae,df as $e,dg as Me,dh as M,di as Oe,dj as He,cq as Ne,cm as xe,cn as De,co as Ue,bx as je,dk as Fe,dl as Le,dm as Ve,cg as We,dn as ze,dp as Qe,dq as Ge,bw as x,c as se,q as re,aK as V}from"./index-Djd6TuLO.js";import{U as P,a as O,e as G}from"./auth-DEoT60Hp.js";function N(o){return!!o._zod}function R(o,e){return N(o)?de(o,e):o.safeParse(e)}function oe(o){if(!o)return;let e;if(N(o)?e=o._zod?.def?.shape:e=o.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Je(o){if(N(o)){const a=o._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}const t=o._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=o.value;if(s!==void 0)return s}function b(o){return o==="completed"||o==="failed"||o==="cancelled"}function J(o){const t=oe(o)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Je(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(o,e){const t=R(o,e);if(!t.success)throw t.error;return t.data}const Ke=6e4;class Ye{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(he,t=>{this._oncancel(t)}),this.setNotificationHandler(fe,t=>{this._onprogress(t)}),this.setRequestHandler(pe,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(me,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(_e,async(t,s)=>{const r=async()=>{const a=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(a,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(a,s.sessionId);if(!n)throw new m(w.InvalidParams,`Task not found: ${a}`);if(!b(n.status))return await this._waitForTaskUpdate(a,s.signal),await r();if(b(n.status)){const i=await this._taskStore.getTaskResult(a,s.sessionId);return this._clearTaskQueue(a),{...i,_meta:{...i._meta,[q]:{taskId:a}}}}return await r()};return await r()}),this.setRequestHandler(ge,async(t,s)=>{try{const{tasks:r,nextCursor:a}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:a,_meta:{}}}catch(r){throw new m(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(we,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(b(r.status))throw new m(w.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 a=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!a)throw new m(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...a}}catch(r){throw r instanceof m?r:new m(w.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,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:a,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(w.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=a=>{s?.(a),this._onerror(a)};const r=this._transport?.onmessage;this._transport.onmessage=(a,n)=>{r?.(a,n),$(a)||Te(a)?this._onresponse(a):j(a)?this._onrequest(a,n):ye(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},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(w.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,a=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{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=ve(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};a&&(h.relatedTask={taskId:a}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(w.ConnectionClosed,"Request was cancelled");const g={...f,relatedRequestId:e.id};a&&!g.relatedTask&&(g.relatedTask={taskId:a});const y=g.relatedTask?.taskId??a;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,g)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:a,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};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{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:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{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),a=this._progressHandlers.get(r);if(!a){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}a(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),$(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 a=!1;if($(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"&&(a=!0,this._taskProgressTokens.set(i.taskId,t))}}if(a||this._progressHandlers.delete(t),$(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(w.InternalError,String(n))}}return}let a;try{const n=await this.request(e,F,s);if(n.task)a=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:a},s);if(yield{type:"taskStatus",task:i},b(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},t,s)}:i.status==="failed"?yield{type:"error",error:new m(w.InternalError,`Task ${a} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(w.InternalError,`Task ${a} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},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(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:a,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++,g={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(g.params={...g.params,task:i}),u&&(g.params={...g.params,_meta:{...g.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:a,onresumptiontoken:n}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));const _=c instanceof m?c:new m(w.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=R(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ke,v=()=>y(m.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,v,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const k=this._responseHandlers.get(f);k?k(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(g,{relatedRequestId:r,resumptionToken:a,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ke,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},Se,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Ce,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=J(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,a)=>{const n=K(e,r);return Promise.resolve(t(n,a))})}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=J(e);this._notificationHandlers.set(s,r=>{const a=K(e,r);return Promise.resolve(t(a))})}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"&&j(r.message)){const a=r.message.id,n=this._requestResolvers.get(a);n?(n(new m(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} 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,a)=>{if(t.aborted){a(new m(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),a(new m(w.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 a=await s.getTask(r,t);if(!a)throw new m(w.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(r,a,n)=>{await s.storeTaskResult(r,a,n,t);const i=await s.getTask(r,t);if(i){const u=Q.parse({method:"notifications/tasks/status",params:i});await this.notification(u),b(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,a,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(b(i.status))throw new m(w.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,a,n,t);const u=await s.getTask(r,t);if(u){const p=Q.parse({method:"notifications/tasks/status",params:u});await this.notification(p),b(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Y(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function Be(o,e){const t={...o};for(const s in e){const r=s,a=e[r];if(a===void 0)continue;const n=t[r];Y(n)&&Y(a)?t[r]={...n,...a}:t[r]=a}return t}var Ze=be();const Xe=Re(Ze);function et(){const o=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ie(o),o}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=te,s){const r=this._client,a={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,a),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(w.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(w.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(w.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(o,e,t){if(!o)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!o.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function ot(o,e,t){if(!o)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!o.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!o.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function H(o,e){if(!(!o||e===null||typeof e!="object")){if(o.type==="object"&&o.properties&&typeof o.properties=="object"){const t=e,s=o.properties;for(const r of Object.keys(s)){const a=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(a,"default")&&(t[r]=a.default),t[r]!==void 0&&H(a,t[r])}}if(Array.isArray(o.anyOf))for(const t of o.anyOf)typeof t!="boolean"&&H(t,e);if(Array.isArray(o.oneOf))for(const t of o.oneOf)typeof t!="boolean"&&H(t,e)}}function at(o){if(!o)return{supportsFormMode:!1,supportsUrlMode:!1};const e=o.form!==void 0,t=o.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let nt=class extends Ye{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",Ee,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",qe,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Pe,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=Be(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let a;if(N(r)){const i=r;a=i._zod?.def?.value??i.value}else{const i=r;a=i._def?.value??i.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");const n=a;if(n==="elicitation/create"){const i=async(u,p)=>{const l=R(Le,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:g}=at(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new m(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=R(F,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(w.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=R(Ve,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(w.InvalidParams,`Invalid elicitation result: ${c}`)}const v=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&v.action==="accept"&&v.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{H(d,v.content)}catch{}return v};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=R(We,u);if(!l.success){const v=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid sampling request: ${v}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const v=R(F,f);if(!v.success){const d=v.error instanceof Error?v.error.message:String(v.error);throw new m(w.InvalidParams,`Invalid task creation result: ${d}`)}return v.data}const y=h.tools||h.toolChoice?ze:Qe,T=R(y,f);if(!T.success){const v=T.error instanceof Error?T.error.message:String(T.error);throw new m(w.InvalidParams,`Invalid sampling result: ${v}`)}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:Ae,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Me.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"},M,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Oe,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},M,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},He,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ne,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},xe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},De,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ue,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},M,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},M,t)}async callTool(e,t=te,s){if(this.isToolTaskRequired(e.name))throw new m(w.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),a=this.getToolOutputValidator(e.name);if(a){if(!r.structuredContent&&!r.isError)throw new m(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=a(r.structuredContent);if(!n.valid)throw new m(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(w.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},je,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const a=Fe.safeParse(s);if(!a.success)throw new Error(`Invalid ${e} listChanged options: ${a.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=a.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 bt={SELF:o=>`${o}_self`,REGISTRY:o=>`${o}_registry`,COMMUNITY_REGISTRY:o=>`${o}_community-registry`,DEV_ASSETS:o=>`${o}_dev-assets`,SITE_DIAGNOSTICS:o=>`site-diagnostics_${o}`,COMMERCE_DISCOVERY:o=>`${o}_commerce-discovery`},It="get_my_diagnostic",it="self";function W(o){return{is(e){return!e||!e.startsWith(o)?null:e.slice(o.length)||null},get(e){return`${o}${e}`}}}function ct(o){return{id:o.id,organization_id:o.organizationId,title:o.title,description:o.description,icon:o.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:o.instructions??null},pinned:!1,connections:[]}}const ae=W("decopilot_"),Et=ae.is,lt=ae.get,ne=W("dev_"),qt=ne.get,Pt=ne.is;function At(o){return ct({id:lt(o),organizationId:o,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png"})}const ut=W("commerce-discovery_"),$t=ut.get,Mt={AGENT_MANAGER:o=>`studio-agent-manager_${o}`,AUTOMATION_MANAGER:o=>`studio-automation-manager_${o}`,CONNECTION_MANAGER:o=>`studio-connection-manager_${o}`,STORE_MANAGER:o=>`studio-store-manager_${o}`,BRAND_MANAGER:o=>`studio-brand-manager_${o}`,USAGE_MANAGER:o=>`studio-usage-manager_${o}`};function Ot(o){return o?o.startsWith("studio-agent-manager_")||o.startsWith("studio-automation-manager_")||o.startsWith("studio-connection-manager_")||o.startsWith("studio-store-manager_")||o.startsWith("studio-brand-manager_")||o.startsWith("studio-usage-manager_"):!1}const D=o=>[{type:"text",text:o}];function dt(o){const e=o.meshUrl??(typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either meshUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...o.token?{Authorization:`Bearer ${o.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(o.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:D(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:D(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:D(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},a=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:a,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>o.toJSONString}}function L(o){return o?o instanceof Headers?Object.fromEntries(o.entries()):Array.isArray(o)?Object.fromEntries(o):{...o}:{}}function ht(o=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return o(t,r)}:o}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,ft=13,I=32;function U(o){}function pt(o){if(typeof o=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=U,onError:t=U,onRetry:s=U,onComment:r}=o,a=[];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))),a.length===0){const k=f(d);k!==""&&a.push(k);return}if(d.indexOf(`
|
|
2
2
|
`)===-1&&d.indexOf("\r")===-1){a.push(d);return}a.push(d);const c=a.join("");a.length=0;const _=f(c);_!==""&&a.push(_)}function f(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
|
|
3
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
4
|
`,c);continue}const k=d.charCodeAt(c);if(X(d,c,k)){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(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,k as c,bV as m,bW as f,q as y,aK as n}from"./index-
|
|
1
|
+
import{c as l,k as c,bV as m,bW as f,q as y,aK as n}from"./index-Djd6TuLO.js";async function u(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 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=()=>u(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 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=()=>u(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],c(a)}export{g as a,b as g,u as l,q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,k as p,q,aK as T}from"./index-
|
|
1
|
+
import{c as m,k as p,q,aK as T}from"./index-Djd6TuLO.js";function C(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],q(i)}function K(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],p(i)}function O(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{K as a,C as b,O as c,w as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,D as i,q as l,K as m}from"./index-
|
|
1
|
+
import{c as n,D as i,q as l,K as m}from"./index-Djd6TuLO.js";import{u as a}from"./use-org-auth-client-DEuaxZpa.js";function p(){const e=n.c(7),{locator:o}=i(),u=a();let t;e[0]!==o?(t=m.members(o),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.organization.listMembers(),e[2]=u,e[3]=s):s=e[3];let r;return e[4]!==t||e[5]!==s?(r={queryKey:t,queryFn:s},e[4]=t,e[5]=s,e[6]=r):r=e[6],l(r)}export{p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,r}from"./index-
|
|
1
|
+
import{c as m,r}from"./index-Djd6TuLO.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
|
package/dist/client/assets/{use-navigate-to-agent-m-7qnjdO.js → use-navigate-to-agent-BUtLr1-s.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as v,r as f,c as C,j as K,b as j,D as M,a as N}from"./index-
|
|
1
|
+
import{L as v,r as f,c as C,j as K,b as j,D as M,a as N}from"./index-Djd6TuLO.js";import{u as F}from"./use-virtual-mcp-Cw7Cf-co.js";const h="__tool_call_runs__",R=["requires_action","in_progress","failed","expired","completed"];function tt(t){const e=new Map(R.map(r=>[r,[]]));for(const r of t){const n=r.status??"completed";(e.get(n)??e.get("completed")).push(r)}return R.map(r=>({status:r,threads:e.get(r)}))}function et(t,e){const r=new Map;for(const a of t){if(a.id.startsWith("thrd_welcome_"))continue;const u=a.virtual_mcp_id??h,d=r.get(u);d?(d.threads.push(a),(a.updated_at??"")>d.latestUpdatedAt&&(d.latestUpdatedAt=a.updated_at??"")):r.set(u,{virtualMcpId:u,threads:[a],latestUpdatedAt:a.updated_at??""})}const n=e!==null?r.get(e):void 0;n&&e&&r.delete(e);const s=r.get(h);s&&r.delete(h);const o=[...r.values()].sort((a,u)=>u.latestUpdatedAt.localeCompare(a.latestUpdatedAt)),i=[];return e&&i.push(n??{virtualMcpId:e,threads:[],latestUpdatedAt:""}),i.push(...o),s&&s.threads.length>0&&i.push(s),i}function rt(t,e){if(e.size===0)return t;const r=[],n=new Map;for(const s of t){const o=e.get(s.virtualMcpId);if(o){const a=n.get(o);if(a)a.threads=[...a.threads,...s.threads],s.latestUpdatedAt>a.latestUpdatedAt&&(a.latestUpdatedAt=s.latestUpdatedAt);else{const u={virtualMcpId:o,threads:[...s.threads],latestUpdatedAt:s.latestUpdatedAt};n.set(o,u),r.push(u)}continue}const i=n.get(s.virtualMcpId);if(i)i.threads=[...s.threads,...i.threads],s.latestUpdatedAt>i.latestUpdatedAt&&(i.latestUpdatedAt=s.latestUpdatedAt);else{const a={...s,threads:[...s.threads]};n.set(s.virtualMcpId,a),r.push(a)}}return r}const x=new Map,I=new Map;function P(t){return`${t.orgId}:${t.userId}`}function E(t){return`sidebar.group-order.${t}`}function O(t){try{const e=localStorage.getItem(t),r=e?JSON.parse(e):[];return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}catch{return[]}}function T(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function L(t){const e=P(t),r=x.get(e);if(r)return r;const n=v.sidebarGroupOrder(t.orgId,t.userId);let s=!1;try{s=localStorage.getItem(n)!==null}catch{}let o=O(n);if(!s&&o.length===0&&t.userId!=="anon"){const i=O(E(t.orgId));i.length>0&&(o=i)}return x.set(e,o),o}function p(t,e){const r=new Set(e);return L(t).filter(n=>!r.has(n))}function g(t,e){x.set(P(t),e),T(v.sidebarGroupOrder(t.orgId,t.userId),e)}function m(t){const e=I.get(t);if(e)return e;const r=O(v.sidebarOrgPinnedOrder(t));return I.set(t,r),r}function S(t,e){I.set(t,e),T(v.sidebarOrgPinnedOrder(t),e)}function nt(t,e){g(t,e)}function st(t,e){S(t,e)}function k(t,e){return t===e||t===h}function w(t,e){return e.includes(t)}function q(t,e){return t.map(r=>r.virtualMcpId).filter(r=>!k(r,e))}function ot(t,e,r,n){const s=new Set(n);return q(t,r).filter(o=>e==="org"?s.has(o):!s.has(o))}function B(t,e){const r=new Set(t),n=e.filter(s=>!r.has(s));return n.length===0?t:[...t,...n]}function at(t,e,r){const n=new Set(r),s=[],o=[];let i,a;for(const u of t){const d=u.virtualMcpId;if(e&&d===e){i=u;continue}if(d===h){a=u;continue}if(n.has(d)){s.push(u);continue}o.push(u)}return{decopilot:i,orgPinned:s,user:o,toolCallRuns:a}}function $(t,e,r,n=[],s=[]){const o=r?t.find(c=>c.virtualMcpId===r):void 0,i=t.find(c=>c.virtualMcpId===h),a=new Set(n),u=n.filter(c=>!k(c,r)),d=B(s,u),l=e.filter(c=>!a.has(c)),b=new Map(t.map(c=>[c.virtualMcpId,c])),A=c=>{const G=b.get(c);return G||{virtualMcpId:c,threads:[],latestUpdatedAt:""}},_=d.filter(c=>a.has(c)).map(A),D=l.map(A),U=[];return o&&U.push(o),U.push(..._,...D),i&&U.push(i),{groups:U,userOrder:l,orgOrder:_.map(c=>c.virtualMcpId)}}function J(t,e){const r=new Set(e);m(t.orgId).length===0&&e.length>0&&S(t.orgId,[...e]);const s=v.sidebarGroupOrder(t.orgId,t.userId);if(O(s).length>0)return;const o=O(E(t.orgId));if(o.length===0)return;const i=o.filter(a=>!r.has(a));g(t,i)}function Y(t,e){const r=new Set(e),n=L(t),s=n.filter(o=>!r.has(o));s.length!==n.length&&g(t,s)}function it(t,e,r,n=[]){J(t,n),Y(t,n);const s=p(t,n),o=m(t.orgId),{userOrder:i,orgOrder:a}=$(e,s,r,n,o);(i.length!==s.length||i.some((u,d)=>u!==s[d]))&&g(t,i),(a.length!==o.length||a.some((u,d)=>u!==o[d]))&&S(t.orgId,a)}function ut(t,e,r,n=[]){const s=p(t,n),o=m(t.orgId);return $(e,s,r,n,o).groups}function dt(t,e,r){if(r){const o=p(t,[e]).filter(a=>a!==e);g(t,o);const i=m(t.orgId);i.includes(e)||S(t.orgId,[...i,e]);return}const n=m(t.orgId).filter(o=>o!==e);S(t.orgId,n);const s=p(t,[]);s.includes(e)||g(t,[...s,e])}function z(t,e,r=[]){if(r.includes(e))return;const n=p(t,r);n.includes(e)||g(t,[e,...n])}function ct(t,e,r=[]){const n=p(t,r),s=n.filter(o=>o!==e);s.length!==n.length&&g(t,s)}function lt(t,e,r){const n=t.indexOf(e),s=t.indexOf(r);if(n===-1||s===-1||n===s)return t;const o=[...t],[i]=o.splice(n,1);return i===void 0?t:(o.splice(s,0,i),o)}function ft(t,e,r,n){if(t==="org")return n;const s=p(e,r),o=new Set(n),i=s.filter(a=>!o.has(a));return[...n,...i]}function gt(t,e,r){const n=w(t,r),s=w(e,r);return n===s}const y=f.createContext(null);function pt(t){const e=C.c(7),{children:r}=t,[n,s]=f.useState(!1),[o,i]=f.useState(0);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>i(W),e[0]=a):a=e[0];const u=a;let d;e[1]!==n||e[2]!==o?(d={empty:n,setEmpty:s,orderRevision:o,bumpOrderRevision:u},e[1]=n,e[2]=o,e[3]=d):d=e[3];let l;return e[4]!==r||e[5]!==d?(l=K.jsx(y.Provider,{value:d,children:r}),e[4]=r,e[5]=d,e[6]=l):l=e[6],l}function W(t){return t+1}function ht(){return f.useContext(y)?.empty??!1}function Ot(){return f.useContext(y)?.orderRevision??0}function H(){return f.useContext(y)?.bumpOrderRevision??Q}function Q(){}function mt(t){const{value:e}=t,r=f.useContext(y),[n,s]=f.useState(null);return r&&n!==e&&(r.setEmpty(e),s(e)),null}function X(t){return(t??[]).filter(e=>!!e.pinned).map(e=>e.id)}function St(){const t=C.c(9),e=j(),{org:r}=M(),n=F(),{data:s}=N.useSession(),o=s?.user?.id??"anon";let i;t[0]!==n?(i=X(n),t[0]=n,t[1]=i):i=t[1];const a=i,u=H();let d;return t[2]!==u||t[3]!==e||t[4]!==r.id||t[5]!==r.slug||t[6]!==a||t[7]!==o?(d=(l,b)=>{z({orgId:r.id,userId:o},l,a),u();const A=crypto.randomUUID();e({to:"/$org/$taskId",params:{org:r.slug,taskId:A},search:{...b?.search??{},virtualmcpid:l}})},t[2]=u,t[3]=e,t[4]=r.id,t[5]=r.slug,t[6]=a,t[7]=o,t[8]=d):d=t[8],d}export{mt as S,h as T,H as a,z as b,gt as c,ft as d,st as e,nt as f,X as g,it as h,ut as i,Ot as j,rt as k,et as l,St as m,tt as n,ct as o,at as p,dt as q,lt as r,ot as s,pt as t,ht as u};
|
package/dist/client/assets/{use-org-auth-client-FC6WdH_x.js → use-org-auth-client-DEuaxZpa.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,D as j,a as i}from"./index-
|
|
1
|
+
import{c as x,D as j,a as i}from"./index-Djd6TuLO.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,k as S,m as l,d as y,K as c}from"./index-
|
|
1
|
+
import{c as u,k as S,m as l,d as y,K as c}from"./index-Djd6TuLO.js";function w(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoStatus(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/status`);if(!r.ok)throw new Error("Failed to check SSO status");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function m(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoConfig(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`);if(!r.ok)throw new Error("Failed to fetch SSO config");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function q(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!f.ok){const p=await f.json();throw new Error(p.error||"Failed to save SSO config")}return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function C(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`,{method:"DELETE"});if(!r.ok)throw new Error("Failed to delete SSO config");return r.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function O(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:r})});if(!f.ok)throw new Error("Failed to toggle SSO enforcement");return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}export{m as a,q as b,C as c,O as d,w as u};
|
package/dist/client/assets/{use-organization-roles-CEdyJBDf.js → use-organization-roles-DoQvWm8B.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,j as n,l as v,D as T,k as B,K as P}from"./index-
|
|
1
|
+
import{c as S,j as n,l as v,D as T,k as B,K as P}from"./index-Djd6TuLO.js";import{e as k,d as I,a as A,T as L,b as z,c as O}from"./table-D5xuIpUU.js";import{a as K,n as D}from"./SwitchHorizontal01-h5bJ4Pj6.js";import{u as E}from"./use-org-auth-client-DEuaxZpa.js";function H(h){const e=S.c(29),{columns:t,data:m,sortKey:p,sortDirection:d,onSort:o,onRowClick:a,rowClassName:s}=h;let l;e[0]!==d?(l=function(r,N){return n.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&d&&(d==="asc"?n.jsx(K,{size:16,className:"text-muted-foreground transition-colors"}):n.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=d,e[1]=l):l=e[1];const i=l;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=function(r,N){let y="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return r===N-1&&(y="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),y},e[2]=c):c=e[2];const u=c;let f;if(e[3]!==t||e[4]!==o||e[5]!==i||e[6]!==p){let x;e[8]!==t.length||e[9]!==o||e[10]!==i||e[11]!==p?(x=(r,N)=>{const y=p===r.id;return n.jsx(k,{className:v(u(N,t.length),"group transition-colors select-none",r.sortable&&"hover:bg-accent cursor-pointer",r.rowClassName,r.cellClassName),onClick:r.sortable&&o?()=>o(r.id):void 0,children:n.jsxs("span",{className:"flex items-center gap-1",children:[r.header,r.sortable&&i(r.id,y)]})},r.id)},e[8]=t.length,e[9]=o,e[10]=i,e[11]=p,e[12]=x):x=e[12],f=t.map(x),e[3]=t,e[4]=o,e[5]=i,e[6]=p,e[7]=f}else f=e[7];let w;e[13]!==f?(w=n.jsx(I,{className:"border-b-0",children:n.jsx(A,{className:"h-9 hover:bg-transparent border-b border-border",children:f})}),e[13]=f,e[14]=w):w=e[14];let g;if(e[15]!==t||e[16]!==m||e[17]!==a||e[18]!==s){let x;e[20]!==t||e[21]!==a||e[22]!==s?(x=(r,N)=>{const y=s?.(r);return n.jsx(A,{"data-row-index":N,className:v("group/data-row transition-colors border-b-0 hover:bg-accent/50",a?"cursor-pointer":"",y),onClick:a?()=>a(r):void 0,children:t.map(b=>n.jsx(L,{className:v("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:n.jsx("div",{className:v(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(r):b.accessor?b.accessor(r):null})},b.id))},N)},e[20]=t,e[21]=a,e[22]=s,e[23]=x):x=e[23],g=m.map(x),e[15]=t,e[16]=m,e[17]=a,e[18]=s,e[19]=g}else g=e[19];let C;e[24]!==g?(C=n.jsx(z,{children:g}),e[24]=g,e[25]=C):C=e[25];let j;return e[26]!==w||e[27]!==C?(j=n.jsxs(O,{className:"w-full border-collapse",children:[w,C]}),e[26]=w,e[27]=C,e[28]=j):j=e[28],j}function W(h){const e=S.c(12),{columns:t,data:m,isLoading:p,sortKey:d,sortDirection:o,onSort:a,onRowClick:s,emptyState:l}=h;if(p===void 0?!1:p){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("div",{className:"flex items-center justify-center h-full",children:n.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=u):u=e[0],u}if(m.length===0){let u;e[1]!==l?(u=l||n.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=l,e[2]=u):u=e[2];let f;return e[3]!==u?(f=n.jsx("div",{className:"flex items-center justify-center h-full",children:u}),e[3]=u,e[4]=f):f=e[4],f}let c;return e[5]!==t||e[6]!==m||e[7]!==s||e[8]!==a||e[9]!==o||e[10]!==d?(c=n.jsx("div",{className:"flex-1",children:n.jsx(H,{columns:t,data:m,sortKey:d,sortDirection:o,onSort:a,onRowClick:s})}),e[5]=t,e[6]=m,e[7]=s,e[8]=a,e[9]=o,e[10]=d,e[11]=c):c=e[11],c}const R=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function M(h){return h.replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function U(h){if(!h)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const e=[];let t=!1;const m=[];let p=!1;const d=new Set;let o=!1,a=0,s=!1;for(const[l,i]of Object.entries(h)){if(l==="self"){i.includes("*")?t=!0:e.push(...i);continue}if(l==="models"){i.includes("*:*")?s=!0:a=i.length;continue}if(l==="*"){if(p=!0,i.includes("*"))o=!0;else for(const c of i)d.add(c);continue}if(m.push(l),i.includes("*"))o=!0;else for(const c of i)d.add(c)}return{staticPermissions:e,allowsAllStaticPermissions:t,connectionIds:m,allowsAllConnections:p,toolNames:Array.from(d),allowsAllTools:o,modelCount:a,allowsAllModels:s}}function Y(){const{locator:h}=T(),e=E(),{data:t,isLoading:m,error:p,refetch:d}=B({queryKey:P.organizationRoles(h),queryFn:async()=>{try{const s=await e.organization.listRoles();return s?.error?(console.error("[useOrganizationRoles] API error:",s.error),[]):s?.data??[]}catch(s){return console.error("[useOrganizationRoles] Fetch error:",s),[]}},staleTime:3e4}),o=R.map(s=>({role:s.value,label:s.label,isBuiltin:s.isBuiltin}));if(t&&Array.isArray(t))for(const s of t){const l=s.role;if(!l||R.some(x=>x.value===l))continue;const{staticPermissions:i,allowsAllStaticPermissions:c,connectionIds:u,allowsAllConnections:f,toolNames:w,allowsAllTools:g,modelCount:C,allowsAllModels:j}=U(s.permission);o.push({id:s.id,role:l,label:M(l),isBuiltin:!1,permission:s.permission??void 0,staticPermissionCount:c?-1:i.length,allowsAllStaticPermissions:c,connectionCount:f?-1:u.length,allowsAllConnections:f,toolCount:g?-1:w.length,allowsAllTools:g,modelCount:j?-1:C,allowsAllModels:j})}const a=o.filter(s=>!s.isBuiltin);return{roles:o,customRoles:a,builtinRoles:o.filter(s=>s.isBuiltin),isLoading:m,error:p,refetch:d}}export{W as C,Y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K as d,c as l,D as g,k as E,m as I,d as R,r as b}from"./index-
|
|
1
|
+
import{K as d,c as l,D as g,k as E,m as I,d as R,r as b}from"./index-Djd6TuLO.js";import{W as G}from"./use-mcp-client-DIy-B1wr.js";import{c as M,u as Q}from"./studio-tools-gp9mLcnF.js";const N={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null},O={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function w(t,e){return{queryKey:d.organizationSettings(e),queryFn:async()=>{try{return await M(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...N,organizationId:e}}},staleTime:6e4}}function h(t){const e=l.c(6),{org:s}=g();let n;e[0]!==s.id||e[1]!==s.slug?(n=w(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const i=t;let r;return e[3]!==n||e[4]!==i?(r={...n,select:i},e[3]=n,e[4]=i,e[5]=r):r=e[5],E(r)}function W(t,e){const s=l.c(3);let n;s[0]!==t||s[1]!==e?(n=w(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:i}=E(n);return i??null}function S(){const t=l.c(9),{org:e}=g(),s=Q(),n=I();let i;t[0]!==e||t[1]!==s?(i=async u=>{const o=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...u});if(!o)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return o},t[0]=e,t[1]=s,t[2]=i):i=t[2];let r;t[3]!==e||t[4]!==n?(r=u=>{n.setQueryData(d.organizationSettings(e.id),o=>({...o??N,...u}))},t[3]=e,t[4]=n,t[5]=r):r=t[5];let a;return t[6]!==i||t[7]!==r?(a={mutationFn:i,onSuccess:r},t[6]=i,t[7]=r,t[8]=a):a=t[8],R(a)}function C(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}}:O}function Z(){const{data:t}=h(P);return t??O}function P(t){return C(t.simple_mode)}function F(){const t=l.c(7),e=S();let s,n;t[0]!==e?(s=(r,a)=>e.mutate({simple_mode:r},a),n=(r,a)=>e.mutateAsync({simple_mode:r},a),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function $(){const{data:t}=h(k);return t??null}function k(t){return t.registry_config}function j(){const t=l.c(7),e=S();let s,n;t[0]!==e?(s=(r,a)=>e.mutate({registry_config:r},a),n=(r,a)=>e.mutateAsync({registry_config:r},a),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function B(){const{data:t}=h(x);return t??null}function x(t){return t.default_home_agents}function U(){const t=l.c(7),e=S();let s,n;t[0]!==e?(s=(r,a)=>e.mutate({default_home_agents:r},a),n=(r,a)=>e.mutateAsync({default_home_agents:r},a),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function L(){const t=l.c(14),{org:e}=g(),s=U(),n=I();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=Promise.resolve(),t[0]=i):i=t[0];const r=b.useRef(i);let a;t[1]!==e.id?(a=d.organizationSettings(e.id),t[1]=e.id,t[2]=a):a=t[2];const u=a;let o;t[3]!==u||t[4]!==n?(o=()=>n.getQueryData(u)?.default_home_agents?.ids??[],t[3]=u,t[4]=n,t[5]=o):o=t[5];const _=o;let m;t[6]!==u||t[7]!==e.slug||t[8]!==n||t[9]!==s?(m=z=>{const T=r.current.then(async()=>{const A=n.getQueryData(u),p=z(A?.default_home_agents?.ids??[]);if(p!==null){n.setQueryData(u,c=>c&&{...c,default_home_agents:{ids:p}});try{await s.mutateAsync({ids:p}),await n.refetchQueries({queryKey:d.homeNextActions(e.slug),type:"active"})}catch(c){const D=c;throw n.setQueryData(u,A),D}}});return r.current=T.catch(q),T},t[6]=u,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=m):m=t[10];const y=m;let f;return t[11]!==y||t[12]!==_?(f={currentIds:_,apply:y},t[11]=y,t[12]=_,t[13]=f):f=t[13],f}function q(){}function v(){const t=l.c(5),{org:e}=g(),s=$();let n;t[0]!==e.id?(n=G.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const i=n;let r;return t[2]!==i||t[3]!==s?(r=a=>{if(!s)return a===i;const u=s.registries[a];return u?u.enabled:a===i},t[2]=i,t[3]=s,t[4]=r):r=t[4],r}export{L as a,v as b,W as c,Z as d,F as e,$ as f,j as g,w as o,B as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C,D as R}from"./index-
|
|
1
|
+
import{c as C,D as R}from"./index-Djd6TuLO.js";import{u as p}from"./use-connection-d25soQOF.js";import{W as a}from"./use-mcp-client-DIy-B1wr.js";import{f as y}from"./use-organization-settings-BIHpPlmZ.js";function M(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{M as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,D as a,K as c,q as f,m as y,d as m}from"./index-
|
|
1
|
+
import{c as r,D as a,K as c,q as f,m as y,d as m}from"./index-Djd6TuLO.js";import{u as l}from"./studio-tools-gp9mLcnF.js";function C(){const e=r.c(7),{org:o}=a(),u=l();let i;e[0]!==o.id?(i=c.secrets(o.id),e[0]=o.id,e[1]=i):i=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]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:n}=f(s);return n.secrets}function p(){const e=r.c(8),{org:o}=a(),u=l(),i=y();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]!==o||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:c.secrets(o.id)})},e[2]=o,e[3]=i,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],m(n)}export{p as a,C as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as m,J as h}from"./index-
|
|
1
|
+
import{r as o,c as m,J as h}from"./index-Djd6TuLO.js";import{p as R,q as I}from"./question-004-sINsf4GQ.js";import{d as y,D as S}from"./decopilot-sse-pool-p2LEr2W4.js";const b=()=>0;function D(s){const{orgSlug:e,taskId:r,enabled:t=!0,onStep:n,onFinish:u,onTaskStatus:f}=s,l=o.useRef({taskId:r,onStep:n,onFinish:u,onTaskStatus:f});l.current={taskId:r,onStep:n,onFinish:u,onTaskStatus:f};const i=o.useRef(null),p=o.useRef(t),d=o.useRef(e);(!i.current||p.current!==t||d.current!==e)&&(p.current=t,d.current=e,i.current=E=>{if(!t||!e)return()=>{};const k=T=>{let a;try{a=JSON.parse(T.data)}catch{return}const c=l.current;if(!(c.taskId&&a.subject!==c.taskId)){switch(a.type){case S.STEP:c.onStep?.(a);break;case S.FINISH:c.onFinish?.(a);break;case S.THREAD_STATUS:c.onTaskStatus?.(a);break}E()}};return y.subscribe(e,k)}),o.useSyncExternalStore(i.current,b,b)}const O=new Set(["completed","failed","requires_action"]);function U(s){const e=m.c(5),[r]=h();let t;e[0]!==r?(t=u=>{r.enableSounds&&O.has(u.data.status)&&R(I.dataUri).catch(_)},e[0]=r,e[1]=t):t=e[1];let n;e[2]!==s||e[3]!==t?(n={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=n):n=e[4],D(n)}function _(s){console.warn("[status-sounds] playback failed:",s)}export{U as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,r as f}from"./index-
|
|
1
|
+
import{c as p,r as f}from"./index-Djd6TuLO.js";import{u as w}from"./use-mobile-thzrczKW.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,D as d,aK as p,k as P}from"./index-
|
|
1
|
+
import{c as a,D as d,aK as p,k as P}from"./index-Djd6TuLO.js";import{b as L,a as S,u as V,c as _}from"./use-collections-DHsBnI-g.js";import{S as g,u as I}from"./use-mcp-client-DIy-B1wr.js";function v(s){const t=a.c(5);let e;t[0]!==s?(e=s===void 0?{}:s,t[0]=s,t[1]=e):e=t[1];const n=e,{org:i}=d();let o;t[2]!==i.id||t[3]!==i.slug?(o={connectionId:g,orgId:i.id,orgSlug:i.slug},t[2]=i.id,t[3]=i.slug,t[4]=o):o=t[4];const l=I(o);return L(i.id,"VIRTUAL_MCP",l,n)}function R(s,t,e){return _(s,"VIRTUAL_MCP",t??void 0,e)}function b(s){const t=a.c(3),{org:e}=d();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=I(n);return V(e.id,"VIRTUAL_MCP",s??void 0,i)}function E(s){const t=a.c(15),{org:e}=d();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=I(n);let o,l,c;t[3]!==s||t[4]!==e.id?(o=[...s].sort(),c=P,l=p.virtualMcpLastUsed(e.id,o),t[3]=s,t[4]=e.id,t[5]=o,t[6]=l,t[7]=c):(o=t[5],l=t[6],c=t[7]);const C=o.length>0;let u;t[8]!==i||t[9]!==o?(u=async()=>{const M=(await i.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:o}})).structuredContent??{items:[]},f=new Map;for(const m of M.items)f.set(m.id,m);return f},t[8]=i,t[9]=o,t[10]=u):u=t[10];let r;return t[11]!==l||t[12]!==C||t[13]!==u?(r={queryKey:l,enabled:C,staleTime:3e4,queryFn:u},t[11]=l,t[12]=C,t[13]=u,t[14]=r):r=t[14],c(r)}function $(){const s=a.c(3),{org:t}=d();let e;s[0]!==t.id||s[1]!==t.slug?(e={connectionId:g,orgId:t.id,orgSlug:t.slug},s[0]=t.id,s[1]=t.slug,s[2]=e):e=s[2];const n=I(e);return S(t.id,"VIRTUAL_MCP",n)}export{b as a,$ as b,E as c,v as u,R as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as u}from"./use-infinite-scroll-B66e2kY3.js";import{cJ as i}from"./index-Djd6TuLO.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as s}from"./use-infinite-scroll-B66e2kY3.js";import{cJ as u,aC as n}from"./index-Djd6TuLO.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
|
package/dist/client/assets/{useSuspenseQueries-DlzLq1Lb.js → useSuspenseQueries-DxszLLty.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ao as Q,ap as y,aq as w,ar as S,as as E,m as q,at as k,au as x,r as p,av as M,aw as H,ax as B,ay as L,az as O,aA as P,aB as A,aC as T}from"./index-
|
|
1
|
+
import{ao as Q,ap as y,aq as w,ar as S,as as E,m as q,at as k,au as x,r as p,av as M,aw as H,ax as B,ay as L,az as O,aA as P,aB as A,aC as T}from"./index-Djd6TuLO.js";function R(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function z(t,e,s){const r=t.slice(0);return r[e]=s,r}var D=class extends Q{#i;#e;#n;#r;#s;#t;#u;#o;#a;#h=[];constructor(t,e,s){super(),this.#i=t,this.#r=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(t=>{t.subscribe(e=>{this.#f(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(t=>{t.destroy()})}setQueries(t,e){this.#n=t,this.#r=e,y.batch(()=>{const s=this.#s,r=this.#d(this.#n);r.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const i=r.map(u=>u.observer),n=i.map(u=>u.getCurrentResult()),o=s.length!==i.length,c=i.some((u,f)=>u!==s[f]),d=o||c,b=d?!0:n.some((u,f)=>{const g=this.#e[f];return!g||!w(u,g)});!d&&!b||(d&&(this.#h=r,this.#s=i),this.#e=n,this.hasListeners()&&(d&&(R(s,i).forEach(u=>{u.destroy()}),R(i,s).forEach(u=>{u.subscribe(f=>{this.#f(u,f)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(t=>t.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(t,e){const s=this.#d(t),r=s.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=s.map(n=>n.defaultedQueryOptions.queryHash);return[r,n=>this.#l(n??r,e,i),()=>this.#c(r,s)]}#c(t,e){return e.map((s,r)=>{const i=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,n=>{e.forEach(o=>{o.observer.trackProp(n)})})})}#l(t,e,s){if(e){const r=this.#a,i=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((n,o)=>n!==r[o]));return(!this.#t||this.#e!==this.#o||i||e!==this.#u)&&(this.#u=e,this.#o=this.#e,s!==void 0&&(this.#a=s),this.#t=S(this.#t,e(t))),this.#t}return t}#b(){return this.#r?.combine!==void 0&&this.#s.some((t,e)=>t.options.suspense&&this.#e[e]?.data===void 0)}#d(t){const e=new Map;this.#s.forEach(r=>{const i=r.options.queryHash;if(!i)return;const n=e.get(i);n?n.push(r):e.set(i,[r])});const s=[];return t.forEach(r=>{const i=this.#i.defaultQueryOptions(r),o=e.get(i.queryHash)?.shift()??new E(this.#i,i);s.push({defaultedQueryOptions:i,observer:o})}),s}#f(t,e){const s=this.#s.indexOf(t);s!==-1&&(this.#e=z(this.#e,s,e),this.#p())}#p(){if(this.hasListeners()){const t=this.#c(this.#e,this.#h),e=this.#b(),s=this.#t,r=e?s:this.#l(t,this.#r?.combine);(e||s!==r)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function I({queries:t,...e},s){const r=q(s),i=k(),n=x(),o=p.useMemo(()=>t.map(a=>{const h=r.defaultQueryOptions(a);return h._optimisticResults=i?"isRestoring":"optimistic",h}),[t,r,i]);o.forEach(a=>{M(a);const h=r.getQueryCache().get(a.queryHash);H(a,n,h)}),B(n);const[c]=p.useState(()=>new D(r,o,e)),[d,b,u]=c.getOptimisticResult(o,e.combine),f=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(a=>f?c.subscribe(y.batchCalls(a)):L,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setQueries(o,e)},[o,e,c]);const m=d.some((a,h)=>O(o[h],a))?d.flatMap((a,h)=>{const l=o[h];if(l&&O(l,a)){const C=new E(r,l);return P(l,C,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const v=d.find((a,h)=>{const l=o[h];return l&&A({result:a,errorResetBoundary:n,throwOnError:l.throwOnError,query:r.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(v?.error)throw v.error;return b(u())}function j(t,e){return I({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:T,enabled:!0,placeholderData:void 0}))},e)}export{j as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as V,r as U,j as o,l as J,B as Y}from"./index-DLQ4JwZN.js";import{T as et,f as ct}from"./agent-icon-DC15QH5N.js";import{n as mt}from"./ChevronLeft-Cn3JRl7K.js";import{i as dt}from"./ChevronRight-BB8PtdU_.js";import{L as ft}from"./label-TS_o46fE.js";import{S as nt}from"./scroll-area-bUXD_r58.js";import{S as pt}from"./switch-B56_YQh-.js";import{a as ut,T as ht,b as gt}from"./tooltip-BBVKuVWA.js";import{V as xt}from"./view-mode-toggle-CoFBmpiz.js";import"./AlertCircle-CiYXjBCp.js";import"./Tool01-DaG15Hqa.js";import"./SwitchHorizontal01-YTEahx81.js";import"./Settings02-CtG2aS1_.js";import"./XCircle-CAZvEkjb.js";import"./ArrowUpRight-D62C8hBG.js";import"./ZapSquare-DbVR4h30.js";import"./Users03-D9C5BM7D.js";import"./CheckCircle-B0cHPrPi.js";import"./ChevronUp-BCrNzv-A.js";import"./ChevronDown-Ep-T2bbc.js";import"./DotsVertical-21OsfYko.js";import"./Stars02-kHQQc3aX.js";import"./Eye-vPozEeRC.js";import"./ZoomOut-BNzpzje_.js";import"./Globe01-eAXhqoKJ.js";import"./FilterLines-BcHnc4HO.js";import"./Star01-Ccb8Hi5b.js";import"./Globe04-8G7DaJlX.js";import"./HardDrive-BJ-lnZmp.js";import"./Key01-qC4LCntt.js";import"./LayoutLeft-DiBhmi5f.js";import"./LinkExternal01-k2q6wU7l.js";import"./Monitor01-DvPP6kPt.js";import"./Sun-BjBDYy_F.js";import"./Palette-BaoaCY0h.js";import"./Play-CMo8plFz.js";import"./Plus-CexM6aI0.js";import"./SearchMd-BT6OYA0s.js";import"./Shield01-Dwjpxvd-.js";import"./Stars01-Dsl5vjAD.js";import"./Trash01-B5-ciNMB.js";import"./Upload01-DWdtOJ5u.js";import"./User01-4kOfLZMN.js";import"./Users01-dV9sT0dy.js";import"./XClose-ssDuFEQg.js";import"./X-BKm6Fw1t.js";import"./Zap-C-erO5Sh.js";import"./use-clock-tick-10nS2wAD.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CV2s0Bln.js";import"./file-type-icon-DHG3dnn1.js";import"./dialog-CaTEiJVO.js";import"./use-mobile-D49EcQdA.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CFybozjb.js";import"./use-mcp-client-CNXUneAa.js";import"./auth-fUaquGnI.js";import"./chat-context-DAyh5sec.js";import"./hooks-DGQm848Q.js";import"./decopilot-sse-pool-DF7I7n1i.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-37EwEzlF.js";import"./use-collections-olSa4--l.js";import"./use-ai-providers-BI7Dx3UD.js";import"./studio-tools-COOhA4uQ.js";import"./use-organization-settings-I56W3q4b.js";import"./shell-layout-DOpUjfn5.js";import"./avatar-VLg8_8qy.js";import"./required-auth-layout-1Q0s2bde.js";import"./use-org-sso-BFPLcR8G.js";import"./sheet-DAwn9AHA.js";import"./integration-icon-DD9LcA1t.js";import"./use-navigate-to-agent-m-7qnjdO.js";import"./use-connection-n2su9fBK.js";import"./use-mcp-prompts-Dp1bbbjz.js";import"./form-BWIorvmY.js";import"./input-BFLS6IB9.js";import"./select-C0lOOEoK.js";const bt=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),yt=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Tt=new Date(-864e13),vt=new Date(864e13),jt=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,Nt=/\/flags\/multivariate\.ts$/;function wt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function kt(e){if(!e||typeof e!="object")return null;const{start:t,end:n}=e,r=typeof t=="string",l=typeof n=="string";if(!r&&!l)return null;const s=r?new Date(t):Tt,m=l?new Date(n):vt;return Number.isNaN(s.getTime())||Number.isNaN(m.getTime())||r&&l&&m.getTime()<=s.getTime()?null:{start:s,end:m,openStart:!r,openEnd:!l}}function rt(e,t){if(!e||typeof e!="object")return;const n=e.__resolveType;if(typeof n=="string"){if(bt.has(n)){const r=kt(e);r&&t.push(r);return}if(yt.has(n)){const r=e.matchers;if(Array.isArray(r))for(const l of r)rt(l,t)}}}function _t(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!jt.test(t))return!1;const n=e.variants;return Array.isArray(n)}function Mt(e){if(typeof e=="string"){const a=e.trim();if(a.length===0)return null;try{const i=new URL(a).pathname.split("/").filter(Boolean),d=i[i.length-1];if(d)return decodeURIComponent(d)}catch{}return a.length>80?`${a.slice(0,77)}…`:a}if(!e||typeof e!="object")return null;const t=e,n=t.config,l=t.desktop?.media,s=[t.title,t.name,t.label,t.alt,n?.title,n?.name,n?.typeAlert?.message,l?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const a of s)if(typeof a=="string"&&a.trim().length>0)return a.trim();const m=t.__resolveType;if(typeof m=="string"){const c=(m.split("/").pop()??m).replace(/\.(tsx?|jsx?)$/i,"");if(c.length>0)return c}return null}function St(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];typeof r=="number"?t.length>0?t[t.length-1]+=`[${r}]`:t.push(`[${r}]`):t.push(r)}return t.join(" · ")}function W(e,t,n,r,l){if(_t(e)){const s=e.variants,m=e.__resolveType,a=Nt.test(m)?"":St(r);s.forEach((c,i)=>{if(!c||typeof c!="object")return;const d=c,f=[];if(rt(d.rule,f),f.length===0)return;const x=Mt(d.value)??(a||n);for(const h of f)l.push({blockKey:t,blockLabel:n,innerPath:a,variantIndex:i,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:m})});for(let c=0;c<s.length;c++){const i=s[c];i&&typeof i=="object"&&W(i.value,t,n,[...r,"variants",c,"value"],l)}return}if(Array.isArray(e)){for(let s=0;s<e.length;s++)W(e[s],t,n,[...r,s],l);return}if(e&&typeof e=="object")for(const[s,m]of Object.entries(e))s!=="__resolveType"&&W(m,t,n,[...r,s],l)}function Et(e){if(!e)return[];const t=[];for(const[n,r]of Object.entries(e))W(r,n,wt(n),[],t);return t.sort((n,r)=>n.start.getTime()-r.start.getTime())}function At(e){const t=[...new Set(e)].sort(),n=new Map;return t.forEach((r,l)=>{const s=l*137.508%360;n.set(r,{bg:`oklch(0.62 0.14 ${s})`,text:"white",border:`oklch(0.50 0.14 ${s})`})}),n}const Dt={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function st(e,t){return e.get(t)??Dt}const $t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ot=["January","February","March","April","May","June","July","August","September","October","November","December"],it=1440*60*1e3;function P(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function at(e){return new Date(e.getFullYear(),e.getMonth(),1)}function F(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function z(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function K(e,t){return Math.round((P(e).getTime()-P(t).getTime())/it)}function Ct(e){const t=(e.getTime()-P(e).getTime())/it;return Math.min(Math.max(t,0),1)}function q(e,t){return K(e,t)+Ct(e)}function Rt(e){const t=z(e,-e.getDay()),n=[];for(let r=0;r<6;r++){const l=[];for(let s=0;s<7;s++)l.push(z(t,r*7+s));n.push(l)}for(;n.length>0&&n[n.length-1].every(r=>r.getMonth()!==e.getMonth());)n.pop();return n}function Lt(e,t){const n=P(e[0]),r=z(n,7),l=n.getTime(),s=r.getTime(),m=[];for(const i of t){const d=P(i.start),f=P(i.end);if(f.getTime()<n.getTime()||d.getTime()>=r.getTime())continue;const u=d.getTime()<n.getTime()?n:d,x=f.getTime()>=r.getTime()?z(r,-1):f,h=K(u,n),g=K(x,u)+1;if(g<=0)continue;const b=Math.max(i.start.getTime(),l),y=Math.min(i.end.getTime(),s),T=q(new Date(b),n),p=Math.max(q(new Date(y),n)-T,0);p<=0||m.push({variant:i,startCol:h,span:g,leftUnits:T,widthUnits:p})}m.sort((i,d)=>i.startCol-d.startCol||d.span-i.span||i.variant.blockKey.localeCompare(d.variant.blockKey));const a=[],c=[];for(const i of m){let d=a.findIndex(f=>f<=i.startCol);d===-1&&(d=a.length,a.push(0)),a[d]=i.startCol+i.span,c.push({...i,lane:d})}return c}const Q=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Ot(e){const t=e.openStart?"Always":Q.format(e.start),n=e.openEnd?"Ongoing":Q.format(e.end);return`${t} → ${n}`}function Pt(e){const t=V.c(17),{variant:n}=e;let r;t[0]!==n.blockLabel?(r=o.jsx("div",{className:"font-semibold",children:n.blockLabel}),t[0]=n.blockLabel,t[1]=r):r=t[1];let l;t[2]!==n.innerPath?(l=n.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:n.innerPath}),t[2]=n.innerPath,t[3]=l):l=t[3];let s;t[4]!==n.blockLabel||t[5]!==n.innerPath||t[6]!==n.label?(s=n.label!==n.blockLabel&&n.label!==n.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:n.label}),t[4]=n.blockLabel,t[5]=n.innerPath,t[6]=n.label,t[7]=s):s=t[7];let m;t[8]!==n?(m=Ot(n),t[8]=n,t[9]=m):m=t[9];let a;t[10]!==m?(a=o.jsx("div",{className:"mt-1",children:m}),t[10]=m,t[11]=a):a=t[11];let c;return t[12]!==r||t[13]!==l||t[14]!==s||t[15]!==a?(c=o.jsx(gt,{children:o.jsxs("div",{className:"text-xs",children:[r,l,s,a]})}),t[12]=r,t[13]=l,t[14]=s,t[15]=a,t[16]=c):c=t[16],c}const X=16;function It(e,t){const n=e?"transparent":"#000 0",r=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${n}, #000 ${X}px, #000 calc(100% - ${X}px), ${r})`}function lt(e){const t=V.c(26),{variant:n,color:r,style:l,children:s,fadeStart:m,fadeEnd:a}=e,c=m===void 0?!1:m,i=a===void 0?!1:a;let d;t[0]!==i||t[1]!==c?(d=It(c,i),t[0]=i,t[1]=c,t[2]=d):d=t[2];const f=d;let u;t[3]!==c?(u=c&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=c,t[4]=u):u=t[4];let x;t[5]!==i?(x=i&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=i,t[6]=x):x=t[6];let h;t[7]!==f?(h=f&&{maskImage:f,WebkitMaskImage:f},t[7]=f,t[8]=h):h=t[8];let g;t[9]!==r.bg||t[10]!==r.text||t[11]!==l||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:r.bg,color:r.text,borderRadius:4,...u,...x,...h,...l},t[9]=r.bg,t[10]=r.text,t[11]=l,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==s?(b=o.jsx("span",{className:"truncate",children:s}),t[16]=s,t[17]=b):b=t[17];let y;t[18]!==g||t[19]!==b?(y=o.jsx(ut,{asChild:!0,children:o.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=y):y=t[20];let T;t[21]!==n?(T=o.jsx(Pt,{variant:n}),t[21]=n,t[22]=T):T=t[22];let p;return t[23]!==T||t[24]!==y?(p=o.jsxs(ht,{children:[y,T]}),t[23]=T,t[24]=y,t[25]=p):p=t[25],p}function _n(e){const t=V.c(49),{decofile:n}=e,[r,l]=U.useState("calendar"),[s,m]=U.useState(Bt),[a,c]=U.useState(!1);let i,d,f;if(t[0]!==n||t[1]!==a){const E=Et(n);i=E.filter(Ht).length,f=a?E:E.filter(Vt),d=At(f.map(Ft)),t[0]=n,t[1]=a,t[2]=i,t[3]=d,t[4]=f}else i=t[2],d=t[3],f=t[4];const u=d;let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=()=>m(at(new Date)),t[5]=x):x=t[5];const h=x;let g;t[6]!==r?(g=()=>m(E=>r==="calendar"?F(E,-1):F(E,-3)),t[6]=r,t[7]=g):g=t[7];const b=g;let y;t[8]!==r?(y=()=>m(E=>r==="calendar"?F(E,1):F(E,3)),t[8]=r,t[9]=y):y=t[9];const T=y;let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(Y,{variant:"outline",size:"sm",onClick:h,children:"Today"}),t[10]=p):p=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(mt,{size:16}),t[11]=w):w=t[11];let k;t[12]!==b?(k=o.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:b,"aria-label":"Previous",children:w}),t[12]=b,t[13]=k):k=t[13];let _;t[14]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(dt,{size:16}),t[14]=_):_=t[14];let M;t[15]!==T?(M=o.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:T,"aria-label":"Next",children:_}),t[15]=T,t[16]=M):M=t[16];const A=ot[s.getMonth()];let S;t[17]!==s?(S=s.getFullYear(),t[17]=s,t[18]=S):S=t[18];let v;t[19]!==A||t[20]!==S?(v=o.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[A," ",S]}),t[19]=A,t[20]=S,t[21]=v):v=t[21];let j;t[22]!==v||t[23]!==k||t[24]!==M?(j=o.jsxs("div",{className:"flex items-center gap-2",children:[p,k,M,v]}),t[22]=v,t[23]=k,t[24]=M,t[25]=j):j=t[25];let D;t[26]!==i||t[27]!==a?(D=i>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(pt,{id:"show-ongoing",checked:a,onCheckedChange:c}),o.jsxs(ft,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:["Show ongoing (",i,")"]})]}),t[26]=i,t[27]=a,t[28]=D):D=t[28];let L;t[29]===Symbol.for("react.memo_cache_sentinel")?(L={value:"calendar",icon:o.jsx(et,{}),label:"Calendar"},t[29]=L):L=t[29];let I;t[30]===Symbol.for("react.memo_cache_sentinel")?(I=[L,{value:"timeline",icon:o.jsx(ct,{}),label:"Timeline"}],t[30]=I):I=t[30];let N;t[31]!==r?(N=o.jsx(xt,{value:r,onValueChange:l,options:I}),t[31]=r,t[32]=N):N=t[32];let R;t[33]!==D||t[34]!==N?(R=o.jsxs("div",{className:"flex items-center gap-4",children:[D,N]}),t[33]=D,t[34]=N,t[35]=R):R=t[35];let $;t[36]!==j||t[37]!==R?($=o.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,R]}),t[36]=j,t[37]=R,t[38]=$):$=t[38];let C;t[39]!==u||t[40]!==s||t[41]!==i||t[42]!==a||t[43]!==f||t[44]!==r?(C=f.length===0?o.jsx(Wt,{hiddenOngoing:a?0:i}):r==="calendar"?o.jsx(Ut,{monthStart:s,variants:f,colorMap:u}):o.jsx(Jt,{monthStart:s,variants:f,colorMap:u}),t[39]=u,t[40]=s,t[41]=i,t[42]=a,t[43]=f,t[44]=r,t[45]=C):C=t[45];let O;return t[46]!==$||t[47]!==C?(O=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[$,C]}),t[46]=$,t[47]=C,t[48]=O):O=t[48],O}function Ft(e){return e.blockKey}function Vt(e){return!e.openEnd}function Ht(e){return e.openEnd}function Bt(){return at(new Date)}function Wt(e){const t=V.c(3),{hiddenOngoing:n}=e,r=n===void 0?0:n;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(et,{size:24,className:"text-muted-foreground/60"}),t[0]=l):l=t[0];let s;return t[1]!==r?(s=o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[l,r>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{children:"No dated variants in view."}),o.jsxs("div",{className:"text-xs text-muted-foreground/80",children:[r," ongoing"," ",r===1?"variant is":"variants are"," hidden — enable “Show ongoing” to view."]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{children:"No scheduled variants."}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Variants gated by a date matcher appear here."})]})]}),t[1]=r,t[2]=s):s=t[2],s}const G=20,Z=2,tt=28,zt=6;function Ut(e){const t=V.c(17),{monthStart:n,variants:r,colorMap:l}=e;let s,m,a,c,i;if(t[0]!==l||t[1]!==n||t[2]!==r){const u=Rt(n),x=P(new Date);s=nt,i="flex-1 min-h-0",m="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:$t.map(Gt)}),t[8]=a):a=t[8],c=u.map((h,g)=>{const b=Lt(h,r),y=b.reduce(Yt,0),T=tt+y*(G+Z)+8;return o.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[h.map((p,w)=>{const k=p.getMonth()===n.getMonth(),_=p.getTime()===x.getTime();return o.jsx("div",{className:J("border-r last:border-r-0 px-2 pt-1.5 text-xs",k?"bg-background":"bg-muted/30 text-muted-foreground"),children:o.jsx("span",{className:J("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",_&&"bg-primary text-primary-foreground font-semibold"),children:p.getDate()})},w)}),b.map((p,w)=>{const k=st(l,p.variant.blockKey),_=tt+p.lane*(G+Z),M=p.leftUnits/7*100,A=p.widthUnits/7*100,S=p.variant.openStart&&g===0,v=p.variant.openEnd&&g===u.length-1;return o.jsxs(lt,{variant:p.variant,color:k,fadeStart:S,fadeEnd:v,style:{top:_,left:`calc(${M}% + 2px)`,width:`calc(${A}% - 4px)`,minWidth:zt,height:G},children:[p.variant.blockLabel,p.variant.label!==p.variant.blockLabel&&o.jsxs("span",{className:"opacity-70",children:[" · ",p.variant.label]})]},`${g}-${w}`)})]},g)}),t[0]=l,t[1]=n,t[2]=r,t[3]=s,t[4]=m,t[5]=a,t[6]=c,t[7]=i}else s=t[3],m=t[4],a=t[5],c=t[6],i=t[7];let d;t[9]!==m||t[10]!==a||t[11]!==c?(d=o.jsxs("div",{className:m,children:[a,c]}),t[9]=m,t[10]=a,t[11]=c,t[12]=d):d=t[12];let f;return t[13]!==s||t[14]!==i||t[15]!==d?(f=o.jsx(s,{className:i,children:d}),t[13]=s,t[14]=i,t[15]=d,t[16]=f):f=t[16],f}function Yt(e,t){return Math.max(e,t.lane+1)}function Gt(e){return o.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const B=4,Kt=32,H=240;function Jt(e){const t=V.c(27),{monthStart:n,variants:r,colorMap:l}=e,s=n;let m,a,c,i,d,f;if(t[0]!==l||t[1]!==n||t[2]!==s||t[3]!==r){const h=F(n,B),g=new Date,b=new Map;for(const v of r){const j=b.get(v.blockKey)??[];j.push(v),b.set(v.blockKey,j)}const y=Array.from(b.entries()).sort(Xt),T=h.getTime()-s.getTime(),p=v=>(Math.max(s.getTime(),Math.min(h.getTime(),v.getTime()))-s.getTime())/T*100;let w;t[10]!==s?(w=(v,j)=>F(s,j),t[10]=s,t[11]=w):w=t[11];const k=Array.from({length:B},w),_=g.getTime()>=s.getTime()&&g.getTime()<=h.getTime()?p(g):null;m=nt,f="flex-1 min-h-0",a="min-w-[900px] relative";let M;t[12]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:{width:H},children:"Variant / Block"}),t[12]=M):M=t[12];let A;t[13]===Symbol.for("react.memo_cache_sentinel")?(A={gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},t[13]=A):A=t[13];const S=k.map(Qt);t[14]!==S?(c=o.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[M,o.jsx("div",{className:"flex-1 grid",style:A,children:S})]}),t[14]=S,t[15]=c):c=t[15],t[16]!==_?(i=_!==null&&o.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${H}px + (100% - ${H}px) * ${_} / 100)`},children:o.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:"Today"})}),t[16]=_,t[17]=i):i=t[17],d=y.map(v=>{const[j,D]=v,L=st(l,j),I=D[0]?.blockLabel??j;return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:o.jsx("div",{className:"px-3 truncate",style:{width:H},children:I})}),D.map((N,R)=>o.jsxs("div",{className:"flex border-b items-center",style:{height:Kt},children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:H},children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:L.bg}}),o.jsx("span",{className:"truncate text-foreground/80",children:N.label})]}),o.jsxs("div",{className:"relative flex-1 h-full",children:[o.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},children:k.map(qt)}),(()=>{const $=Math.max(N.start.getTime(),s.getTime()),C=Math.min(N.end.getTime(),h.getTime());if(C<=$)return null;const O=p(new Date($)),E=p(new Date(C))-O;return o.jsx(lt,{variant:N,color:L,fadeStart:N.openStart,fadeEnd:N.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${O}%`,width:`calc(${E}% - 2px)`,height:22},children:N.label})})()]})]},R))]},j)}),t[0]=l,t[1]=n,t[2]=s,t[3]=r,t[4]=m,t[5]=a,t[6]=c,t[7]=i,t[8]=d,t[9]=f}else m=t[4],a=t[5],c=t[6],i=t[7],d=t[8],f=t[9];let u;t[18]!==a||t[19]!==c||t[20]!==i||t[21]!==d?(u=o.jsxs("div",{className:a,children:[c,i,d]}),t[18]=a,t[19]=c,t[20]=i,t[21]=d,t[22]=u):u=t[22];let x;return t[23]!==m||t[24]!==f||t[25]!==u?(x=o.jsx(m,{className:f,children:u}),t[23]=m,t[24]=f,t[25]=u,t[26]=x):x=t[26],x}function qt(e,t){return o.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function Qt(e,t){return o.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ot[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function Xt(e,t){return e[0].localeCompare(t[0])}export{_n as VariantCalendar};
|
|
1
|
+
import{c as V,r as U,j as o,l as J,B as Y}from"./index-Djd6TuLO.js";import{T as et,f as ct}from"./agent-icon-CUDD1qQU.js";import{n as mt}from"./ChevronLeft-B5WBGMCf.js";import{i as dt}from"./ChevronRight-ro8pTEbC.js";import{L as ft}from"./label-BzwbJuLA.js";import{S as nt}from"./scroll-area-BnoH8jf-.js";import{S as pt}from"./switch-14YiCb40.js";import{a as ut,T as ht,b as gt}from"./tooltip-DNHEz7H9.js";import{V as xt}from"./view-mode-toggle-CmzDEt1O.js";import"./AlertCircle-BI7qL-zf.js";import"./Tool01-95LOctqu.js";import"./SwitchHorizontal01-h5bJ4Pj6.js";import"./Settings02-DIy8pOAO.js";import"./XCircle-NMY-qxx5.js";import"./ArrowUpRight-Z3BBkuVk.js";import"./ZapSquare-CqtF4LbQ.js";import"./Users03-BnJ4POBL.js";import"./CheckCircle-Ct0IkEsg.js";import"./ChevronUp-D4yp8Sde.js";import"./ChevronDown-c1oSYfs-.js";import"./DotsVertical-Bva5wMia.js";import"./Stars02-Ulg_Ysyf.js";import"./Eye-Dz0LfZhX.js";import"./ZoomOut-D5bsZWrB.js";import"./Globe01-Cat8RRQP.js";import"./FilterLines-CNNSd5My.js";import"./Star01-DhVZBXZp.js";import"./Globe04-CNkdEC4q.js";import"./HardDrive-Bp0ax-t_.js";import"./Key01-CK-dtvzj.js";import"./LayoutLeft-DRgE3-pt.js";import"./LinkExternal01-BMRTG9GY.js";import"./Monitor01-ClILKoXR.js";import"./Sun-DTQS8SC0.js";import"./Palette-DzZpBk45.js";import"./Play-B0tuLbrU.js";import"./Plus-C2AcrVDQ.js";import"./SearchMd-CiOkSnnl.js";import"./Shield01-txQYlyv3.js";import"./Stars01-BpFWqd_D.js";import"./Trash01-CA4eBk7v.js";import"./Upload01-C6hlgF_d.js";import"./User01-Bj4QEnuq.js";import"./Users01-DjqWZa4u.js";import"./XClose-JPFhglUg.js";import"./X-C3pn9FBd.js";import"./Zap-DZT0zVFp.js";import"./use-clock-tick-xyRkceIk.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-dG8egJns.js";import"./file-type-icon-gLx9uWdG.js";import"./dialog-XnZQaCET.js";import"./use-mobile-thzrczKW.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-BpjdnyIn.js";import"./use-mcp-client-DIy-B1wr.js";import"./auth-DEoT60Hp.js";import"./chat-context-CkCIvS-v.js";import"./hooks-Dh6Jo6FF.js";import"./decopilot-sse-pool-p2LEr2W4.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-Cw7Cf-co.js";import"./use-collections-DHsBnI-g.js";import"./use-ai-providers-FEYc1hYo.js";import"./studio-tools-gp9mLcnF.js";import"./use-organization-settings-BIHpPlmZ.js";import"./shell-layout-C1UY2dDO.js";import"./avatar-VM4z7Sph.js";import"./required-auth-layout-D8JzfwRM.js";import"./use-org-sso-CydJi_gG.js";import"./sheet-a31ex1bd.js";import"./integration-icon-Da8Ja8xZ.js";import"./use-navigate-to-agent-BUtLr1-s.js";import"./use-connection-d25soQOF.js";import"./use-mcp-prompts-9snCiqu-.js";import"./form-BCSBsB3M.js";import"./input-BNOGUlQT.js";import"./select-DKj7B0V2.js";const bt=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),yt=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Tt=new Date(-864e13),vt=new Date(864e13),jt=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,Nt=/\/flags\/multivariate\.ts$/;function wt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function kt(e){if(!e||typeof e!="object")return null;const{start:t,end:n}=e,r=typeof t=="string",l=typeof n=="string";if(!r&&!l)return null;const s=r?new Date(t):Tt,m=l?new Date(n):vt;return Number.isNaN(s.getTime())||Number.isNaN(m.getTime())||r&&l&&m.getTime()<=s.getTime()?null:{start:s,end:m,openStart:!r,openEnd:!l}}function rt(e,t){if(!e||typeof e!="object")return;const n=e.__resolveType;if(typeof n=="string"){if(bt.has(n)){const r=kt(e);r&&t.push(r);return}if(yt.has(n)){const r=e.matchers;if(Array.isArray(r))for(const l of r)rt(l,t)}}}function _t(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!jt.test(t))return!1;const n=e.variants;return Array.isArray(n)}function Mt(e){if(typeof e=="string"){const a=e.trim();if(a.length===0)return null;try{const i=new URL(a).pathname.split("/").filter(Boolean),d=i[i.length-1];if(d)return decodeURIComponent(d)}catch{}return a.length>80?`${a.slice(0,77)}…`:a}if(!e||typeof e!="object")return null;const t=e,n=t.config,l=t.desktop?.media,s=[t.title,t.name,t.label,t.alt,n?.title,n?.name,n?.typeAlert?.message,l?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const a of s)if(typeof a=="string"&&a.trim().length>0)return a.trim();const m=t.__resolveType;if(typeof m=="string"){const c=(m.split("/").pop()??m).replace(/\.(tsx?|jsx?)$/i,"");if(c.length>0)return c}return null}function St(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];typeof r=="number"?t.length>0?t[t.length-1]+=`[${r}]`:t.push(`[${r}]`):t.push(r)}return t.join(" · ")}function W(e,t,n,r,l){if(_t(e)){const s=e.variants,m=e.__resolveType,a=Nt.test(m)?"":St(r);s.forEach((c,i)=>{if(!c||typeof c!="object")return;const d=c,f=[];if(rt(d.rule,f),f.length===0)return;const x=Mt(d.value)??(a||n);for(const h of f)l.push({blockKey:t,blockLabel:n,innerPath:a,variantIndex:i,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:m})});for(let c=0;c<s.length;c++){const i=s[c];i&&typeof i=="object"&&W(i.value,t,n,[...r,"variants",c,"value"],l)}return}if(Array.isArray(e)){for(let s=0;s<e.length;s++)W(e[s],t,n,[...r,s],l);return}if(e&&typeof e=="object")for(const[s,m]of Object.entries(e))s!=="__resolveType"&&W(m,t,n,[...r,s],l)}function Et(e){if(!e)return[];const t=[];for(const[n,r]of Object.entries(e))W(r,n,wt(n),[],t);return t.sort((n,r)=>n.start.getTime()-r.start.getTime())}function At(e){const t=[...new Set(e)].sort(),n=new Map;return t.forEach((r,l)=>{const s=l*137.508%360;n.set(r,{bg:`oklch(0.62 0.14 ${s})`,text:"white",border:`oklch(0.50 0.14 ${s})`})}),n}const Dt={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function st(e,t){return e.get(t)??Dt}const $t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ot=["January","February","March","April","May","June","July","August","September","October","November","December"],it=1440*60*1e3;function P(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function at(e){return new Date(e.getFullYear(),e.getMonth(),1)}function F(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function z(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function K(e,t){return Math.round((P(e).getTime()-P(t).getTime())/it)}function Ct(e){const t=(e.getTime()-P(e).getTime())/it;return Math.min(Math.max(t,0),1)}function q(e,t){return K(e,t)+Ct(e)}function Rt(e){const t=z(e,-e.getDay()),n=[];for(let r=0;r<6;r++){const l=[];for(let s=0;s<7;s++)l.push(z(t,r*7+s));n.push(l)}for(;n.length>0&&n[n.length-1].every(r=>r.getMonth()!==e.getMonth());)n.pop();return n}function Lt(e,t){const n=P(e[0]),r=z(n,7),l=n.getTime(),s=r.getTime(),m=[];for(const i of t){const d=P(i.start),f=P(i.end);if(f.getTime()<n.getTime()||d.getTime()>=r.getTime())continue;const u=d.getTime()<n.getTime()?n:d,x=f.getTime()>=r.getTime()?z(r,-1):f,h=K(u,n),g=K(x,u)+1;if(g<=0)continue;const b=Math.max(i.start.getTime(),l),y=Math.min(i.end.getTime(),s),T=q(new Date(b),n),p=Math.max(q(new Date(y),n)-T,0);p<=0||m.push({variant:i,startCol:h,span:g,leftUnits:T,widthUnits:p})}m.sort((i,d)=>i.startCol-d.startCol||d.span-i.span||i.variant.blockKey.localeCompare(d.variant.blockKey));const a=[],c=[];for(const i of m){let d=a.findIndex(f=>f<=i.startCol);d===-1&&(d=a.length,a.push(0)),a[d]=i.startCol+i.span,c.push({...i,lane:d})}return c}const Q=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Ot(e){const t=e.openStart?"Always":Q.format(e.start),n=e.openEnd?"Ongoing":Q.format(e.end);return`${t} → ${n}`}function Pt(e){const t=V.c(17),{variant:n}=e;let r;t[0]!==n.blockLabel?(r=o.jsx("div",{className:"font-semibold",children:n.blockLabel}),t[0]=n.blockLabel,t[1]=r):r=t[1];let l;t[2]!==n.innerPath?(l=n.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:n.innerPath}),t[2]=n.innerPath,t[3]=l):l=t[3];let s;t[4]!==n.blockLabel||t[5]!==n.innerPath||t[6]!==n.label?(s=n.label!==n.blockLabel&&n.label!==n.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:n.label}),t[4]=n.blockLabel,t[5]=n.innerPath,t[6]=n.label,t[7]=s):s=t[7];let m;t[8]!==n?(m=Ot(n),t[8]=n,t[9]=m):m=t[9];let a;t[10]!==m?(a=o.jsx("div",{className:"mt-1",children:m}),t[10]=m,t[11]=a):a=t[11];let c;return t[12]!==r||t[13]!==l||t[14]!==s||t[15]!==a?(c=o.jsx(gt,{children:o.jsxs("div",{className:"text-xs",children:[r,l,s,a]})}),t[12]=r,t[13]=l,t[14]=s,t[15]=a,t[16]=c):c=t[16],c}const X=16;function It(e,t){const n=e?"transparent":"#000 0",r=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${n}, #000 ${X}px, #000 calc(100% - ${X}px), ${r})`}function lt(e){const t=V.c(26),{variant:n,color:r,style:l,children:s,fadeStart:m,fadeEnd:a}=e,c=m===void 0?!1:m,i=a===void 0?!1:a;let d;t[0]!==i||t[1]!==c?(d=It(c,i),t[0]=i,t[1]=c,t[2]=d):d=t[2];const f=d;let u;t[3]!==c?(u=c&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=c,t[4]=u):u=t[4];let x;t[5]!==i?(x=i&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=i,t[6]=x):x=t[6];let h;t[7]!==f?(h=f&&{maskImage:f,WebkitMaskImage:f},t[7]=f,t[8]=h):h=t[8];let g;t[9]!==r.bg||t[10]!==r.text||t[11]!==l||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:r.bg,color:r.text,borderRadius:4,...u,...x,...h,...l},t[9]=r.bg,t[10]=r.text,t[11]=l,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==s?(b=o.jsx("span",{className:"truncate",children:s}),t[16]=s,t[17]=b):b=t[17];let y;t[18]!==g||t[19]!==b?(y=o.jsx(ut,{asChild:!0,children:o.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=y):y=t[20];let T;t[21]!==n?(T=o.jsx(Pt,{variant:n}),t[21]=n,t[22]=T):T=t[22];let p;return t[23]!==T||t[24]!==y?(p=o.jsxs(ht,{children:[y,T]}),t[23]=T,t[24]=y,t[25]=p):p=t[25],p}function _n(e){const t=V.c(49),{decofile:n}=e,[r,l]=U.useState("calendar"),[s,m]=U.useState(Bt),[a,c]=U.useState(!1);let i,d,f;if(t[0]!==n||t[1]!==a){const E=Et(n);i=E.filter(Ht).length,f=a?E:E.filter(Vt),d=At(f.map(Ft)),t[0]=n,t[1]=a,t[2]=i,t[3]=d,t[4]=f}else i=t[2],d=t[3],f=t[4];const u=d;let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=()=>m(at(new Date)),t[5]=x):x=t[5];const h=x;let g;t[6]!==r?(g=()=>m(E=>r==="calendar"?F(E,-1):F(E,-3)),t[6]=r,t[7]=g):g=t[7];const b=g;let y;t[8]!==r?(y=()=>m(E=>r==="calendar"?F(E,1):F(E,3)),t[8]=r,t[9]=y):y=t[9];const T=y;let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(Y,{variant:"outline",size:"sm",onClick:h,children:"Today"}),t[10]=p):p=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(mt,{size:16}),t[11]=w):w=t[11];let k;t[12]!==b?(k=o.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:b,"aria-label":"Previous",children:w}),t[12]=b,t[13]=k):k=t[13];let _;t[14]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(dt,{size:16}),t[14]=_):_=t[14];let M;t[15]!==T?(M=o.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:T,"aria-label":"Next",children:_}),t[15]=T,t[16]=M):M=t[16];const A=ot[s.getMonth()];let S;t[17]!==s?(S=s.getFullYear(),t[17]=s,t[18]=S):S=t[18];let v;t[19]!==A||t[20]!==S?(v=o.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[A," ",S]}),t[19]=A,t[20]=S,t[21]=v):v=t[21];let j;t[22]!==v||t[23]!==k||t[24]!==M?(j=o.jsxs("div",{className:"flex items-center gap-2",children:[p,k,M,v]}),t[22]=v,t[23]=k,t[24]=M,t[25]=j):j=t[25];let D;t[26]!==i||t[27]!==a?(D=i>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(pt,{id:"show-ongoing",checked:a,onCheckedChange:c}),o.jsxs(ft,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:["Show ongoing (",i,")"]})]}),t[26]=i,t[27]=a,t[28]=D):D=t[28];let L;t[29]===Symbol.for("react.memo_cache_sentinel")?(L={value:"calendar",icon:o.jsx(et,{}),label:"Calendar"},t[29]=L):L=t[29];let I;t[30]===Symbol.for("react.memo_cache_sentinel")?(I=[L,{value:"timeline",icon:o.jsx(ct,{}),label:"Timeline"}],t[30]=I):I=t[30];let N;t[31]!==r?(N=o.jsx(xt,{value:r,onValueChange:l,options:I}),t[31]=r,t[32]=N):N=t[32];let R;t[33]!==D||t[34]!==N?(R=o.jsxs("div",{className:"flex items-center gap-4",children:[D,N]}),t[33]=D,t[34]=N,t[35]=R):R=t[35];let $;t[36]!==j||t[37]!==R?($=o.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,R]}),t[36]=j,t[37]=R,t[38]=$):$=t[38];let C;t[39]!==u||t[40]!==s||t[41]!==i||t[42]!==a||t[43]!==f||t[44]!==r?(C=f.length===0?o.jsx(Wt,{hiddenOngoing:a?0:i}):r==="calendar"?o.jsx(Ut,{monthStart:s,variants:f,colorMap:u}):o.jsx(Jt,{monthStart:s,variants:f,colorMap:u}),t[39]=u,t[40]=s,t[41]=i,t[42]=a,t[43]=f,t[44]=r,t[45]=C):C=t[45];let O;return t[46]!==$||t[47]!==C?(O=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[$,C]}),t[46]=$,t[47]=C,t[48]=O):O=t[48],O}function Ft(e){return e.blockKey}function Vt(e){return!e.openEnd}function Ht(e){return e.openEnd}function Bt(){return at(new Date)}function Wt(e){const t=V.c(3),{hiddenOngoing:n}=e,r=n===void 0?0:n;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(et,{size:24,className:"text-muted-foreground/60"}),t[0]=l):l=t[0];let s;return t[1]!==r?(s=o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[l,r>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{children:"No dated variants in view."}),o.jsxs("div",{className:"text-xs text-muted-foreground/80",children:[r," ongoing"," ",r===1?"variant is":"variants are"," hidden — enable “Show ongoing” to view."]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{children:"No scheduled variants."}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Variants gated by a date matcher appear here."})]})]}),t[1]=r,t[2]=s):s=t[2],s}const G=20,Z=2,tt=28,zt=6;function Ut(e){const t=V.c(17),{monthStart:n,variants:r,colorMap:l}=e;let s,m,a,c,i;if(t[0]!==l||t[1]!==n||t[2]!==r){const u=Rt(n),x=P(new Date);s=nt,i="flex-1 min-h-0",m="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:$t.map(Gt)}),t[8]=a):a=t[8],c=u.map((h,g)=>{const b=Lt(h,r),y=b.reduce(Yt,0),T=tt+y*(G+Z)+8;return o.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[h.map((p,w)=>{const k=p.getMonth()===n.getMonth(),_=p.getTime()===x.getTime();return o.jsx("div",{className:J("border-r last:border-r-0 px-2 pt-1.5 text-xs",k?"bg-background":"bg-muted/30 text-muted-foreground"),children:o.jsx("span",{className:J("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",_&&"bg-primary text-primary-foreground font-semibold"),children:p.getDate()})},w)}),b.map((p,w)=>{const k=st(l,p.variant.blockKey),_=tt+p.lane*(G+Z),M=p.leftUnits/7*100,A=p.widthUnits/7*100,S=p.variant.openStart&&g===0,v=p.variant.openEnd&&g===u.length-1;return o.jsxs(lt,{variant:p.variant,color:k,fadeStart:S,fadeEnd:v,style:{top:_,left:`calc(${M}% + 2px)`,width:`calc(${A}% - 4px)`,minWidth:zt,height:G},children:[p.variant.blockLabel,p.variant.label!==p.variant.blockLabel&&o.jsxs("span",{className:"opacity-70",children:[" · ",p.variant.label]})]},`${g}-${w}`)})]},g)}),t[0]=l,t[1]=n,t[2]=r,t[3]=s,t[4]=m,t[5]=a,t[6]=c,t[7]=i}else s=t[3],m=t[4],a=t[5],c=t[6],i=t[7];let d;t[9]!==m||t[10]!==a||t[11]!==c?(d=o.jsxs("div",{className:m,children:[a,c]}),t[9]=m,t[10]=a,t[11]=c,t[12]=d):d=t[12];let f;return t[13]!==s||t[14]!==i||t[15]!==d?(f=o.jsx(s,{className:i,children:d}),t[13]=s,t[14]=i,t[15]=d,t[16]=f):f=t[16],f}function Yt(e,t){return Math.max(e,t.lane+1)}function Gt(e){return o.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const B=4,Kt=32,H=240;function Jt(e){const t=V.c(27),{monthStart:n,variants:r,colorMap:l}=e,s=n;let m,a,c,i,d,f;if(t[0]!==l||t[1]!==n||t[2]!==s||t[3]!==r){const h=F(n,B),g=new Date,b=new Map;for(const v of r){const j=b.get(v.blockKey)??[];j.push(v),b.set(v.blockKey,j)}const y=Array.from(b.entries()).sort(Xt),T=h.getTime()-s.getTime(),p=v=>(Math.max(s.getTime(),Math.min(h.getTime(),v.getTime()))-s.getTime())/T*100;let w;t[10]!==s?(w=(v,j)=>F(s,j),t[10]=s,t[11]=w):w=t[11];const k=Array.from({length:B},w),_=g.getTime()>=s.getTime()&&g.getTime()<=h.getTime()?p(g):null;m=nt,f="flex-1 min-h-0",a="min-w-[900px] relative";let M;t[12]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:{width:H},children:"Variant / Block"}),t[12]=M):M=t[12];let A;t[13]===Symbol.for("react.memo_cache_sentinel")?(A={gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},t[13]=A):A=t[13];const S=k.map(Qt);t[14]!==S?(c=o.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[M,o.jsx("div",{className:"flex-1 grid",style:A,children:S})]}),t[14]=S,t[15]=c):c=t[15],t[16]!==_?(i=_!==null&&o.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${H}px + (100% - ${H}px) * ${_} / 100)`},children:o.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:"Today"})}),t[16]=_,t[17]=i):i=t[17],d=y.map(v=>{const[j,D]=v,L=st(l,j),I=D[0]?.blockLabel??j;return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:o.jsx("div",{className:"px-3 truncate",style:{width:H},children:I})}),D.map((N,R)=>o.jsxs("div",{className:"flex border-b items-center",style:{height:Kt},children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:H},children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:L.bg}}),o.jsx("span",{className:"truncate text-foreground/80",children:N.label})]}),o.jsxs("div",{className:"relative flex-1 h-full",children:[o.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},children:k.map(qt)}),(()=>{const $=Math.max(N.start.getTime(),s.getTime()),C=Math.min(N.end.getTime(),h.getTime());if(C<=$)return null;const O=p(new Date($)),E=p(new Date(C))-O;return o.jsx(lt,{variant:N,color:L,fadeStart:N.openStart,fadeEnd:N.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${O}%`,width:`calc(${E}% - 2px)`,height:22},children:N.label})})()]})]},R))]},j)}),t[0]=l,t[1]=n,t[2]=s,t[3]=r,t[4]=m,t[5]=a,t[6]=c,t[7]=i,t[8]=d,t[9]=f}else m=t[4],a=t[5],c=t[6],i=t[7],d=t[8],f=t[9];let u;t[18]!==a||t[19]!==c||t[20]!==i||t[21]!==d?(u=o.jsxs("div",{className:a,children:[c,i,d]}),t[18]=a,t[19]=c,t[20]=i,t[21]=d,t[22]=u):u=t[22];let x;return t[23]!==m||t[24]!==f||t[25]!==u?(x=o.jsx(m,{className:f,children:u}),t[23]=m,t[24]=f,t[25]=u,t[26]=x):x=t[26],x}function qt(e,t){return o.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function Qt(e,t){return o.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ot[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function Xt(e,t){return e[0].localeCompare(t[0])}export{_n as VariantCalendar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,r as T,l as f,j as i}from"./index-
|
|
1
|
+
import{c as $,r as T,l as f,j as i}from"./index-Djd6TuLO.js";import{T as k,a as I,b as P}from"./tooltip-DNHEz7H9.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function B(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:C,fullWidth:L,className:z}=E,_=C===void 0?"sm":C,b=L===void 0?!1:L;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const R=T.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=T.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),m=R.current[e];m&&S({left:m.offsetLeft,width:m.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),T.useEffect(g,p);const n=M[_];let l;t[6]!==z?(l=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=l):l=t[7];let a;t[8]!==n||t[9]!==b||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,m)=>{const j=i.jsxs("button",{ref:V=>{R.current[m]=V},type:"button",onClick:()=>y(e.value),className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",b?"flex-1 h-12 px-4":e.label?f(n.buttonWithLabel,"px-3"):n.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=n,t[9]=b,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=b?"h-12":n.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==l||t[25]!==a?(v=i.jsxs("div",{className:l,children:[a,u]}),t[23]=u,t[24]=l,t[25]=a,t[26]=v):v=t[26],v}export{B as V};
|
package/dist/client/index.html
CHANGED
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
57
57
|
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
|
|
58
58
|
<meta name="apple-mobile-web-app-title" content="deco Studio" />
|
|
59
|
-
<script type="module" crossorigin src="/assets/index-
|
|
59
|
+
<script type="module" crossorigin src="/assets/index-Djd6TuLO.js"></script>
|
|
60
60
|
<link rel="stylesheet" crossorigin href="/assets/index-NVhaWgyE.css">
|
|
61
61
|
</head>
|
|
62
62
|
<body>
|