decocms 4.263.2 → 4.263.3
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-DL3U1yq7.js → AlertCircle-C8ZNKM0T.js} +1 -1
- package/dist/client/assets/{AreaChart-DTwkuP_y.js → AreaChart-BYK2gWYF.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BDtQVDZJ.js → ArrowLeft-C4S3t4gh.js} +1 -1
- package/dist/client/assets/{ArrowUp-DUua93WQ.js → ArrowUp-BjteiNgF.js} +1 -1
- package/dist/client/assets/{Check-CFdAuLVR.js → Check-7fxTQqwV.js} +1 -1
- package/dist/client/assets/{CheckCircle-Ccs86bUg.js → CheckCircle-Ds0VlJAl.js} +1 -1
- package/dist/client/assets/{ChevronDown-Bh9AZv82.js → ChevronDown-DC3VmpPs.js} +1 -1
- package/dist/client/assets/{ChevronRight-Bt0Ps5hy.js → ChevronRight-DB1jERJP.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-CbP69kXl.js → ChevronSelectorVertical-B9rG_ZYr.js} +1 -1
- package/dist/client/assets/{ChevronUp-CYbM4ZwP.js → ChevronUp-DklUcnpq.js} +1 -1
- package/dist/client/assets/{Copy01-CKmyRUyl.js → Copy01-0rsYyxBd.js} +1 -1
- package/dist/client/assets/{CreditCard01-DXJKk1Wt.js → CreditCard01-C02kJIQ-.js} +1 -1
- package/dist/client/assets/{DotsVertical-C5qhPHKZ.js → DotsVertical-CtEAbV8O.js} +1 -1
- package/dist/client/assets/{Download01-DZdiDQUS.js → Download01-B_W2m-uX.js} +1 -1
- package/dist/client/assets/{Eye-DFHNhYtx.js → Eye-CCl0QwVV.js} +1 -1
- package/dist/client/assets/{FilterLines-C01-F8gV.js → FilterLines-v44MczT5.js} +1 -1
- package/dist/client/assets/{Globe01-qBOiIpcJ.js → Globe01-Dr2wIPy6.js} +1 -1
- package/dist/client/assets/{Globe04-DyPo8R4R.js → Globe04-BlbLK8Qh.js} +1 -1
- package/dist/client/assets/{HardDrive-DMA6WwJi.js → HardDrive-DKQRwLSP.js} +1 -1
- package/dist/client/assets/{Key01-CQ2Pckpa.js → Key01-kpUUZaqy.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CDWxDAhW.js → LinkExternal01-NyjdMVf7.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-BJDlnHNP.js → LockUnlocked01-DsKz0Xl2.js} +1 -1
- package/dist/client/assets/{LogOut01-DYTwrIyB.js → LogOut01-Dd8QdhEu.js} +1 -1
- package/dist/client/assets/{Monitor01-CW9D8oQR.js → Monitor01-CCXNZQlH.js} +1 -1
- package/dist/client/assets/{Palette-CYMwYnzJ.js → Palette-BffjPXio.js} +1 -1
- package/dist/client/assets/{Play-D5VBgg81.js → Play-D8AheaUt.js} +1 -1
- package/dist/client/assets/{Plus-DJBOKCXM.js → Plus-DfL6u6I_.js} +1 -1
- package/dist/client/assets/{SearchLg-D05XfMH4.js → SearchLg-D1p_gJI8.js} +1 -1
- package/dist/client/assets/{SearchMd-Bvk6cmtM.js → SearchMd-DVItXoZb.js} +1 -1
- package/dist/client/assets/{Settings02-BXfVk1mb.js → Settings02-Bvo1tVwA.js} +1 -1
- package/dist/client/assets/{Share07-DRhhhSu7.js → Share07-3Y0P_W3_.js} +1 -1
- package/dist/client/assets/{Shield01--vYJckXn.js → Shield01-C4putjAN.js} +1 -1
- package/dist/client/assets/{Stars01-Cfn7XpKF.js → Stars01-ClK-g0zk.js} +1 -1
- package/dist/client/assets/{Stars02-BEZaBHTc.js → Stars02-DTCJxH0_.js} +1 -1
- package/dist/client/assets/{Sun-CxlEqCDi.js → Sun-DBnfC6xb.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BPoIdNhd.js → SwitchHorizontal01-CQZ9t4Uh.js} +1 -1
- package/dist/client/assets/{Tool01-D15DzDIB.js → Tool01-K1KtrUp3.js} +1 -1
- package/dist/client/assets/{Tool02-DcVuymPV.js → Tool02-CaMOVLUq.js} +1 -1
- package/dist/client/assets/{Trash01-rd-vb1MA.js → Trash01-Hh3vb-pV.js} +1 -1
- package/dist/client/assets/{TrendUp01-BBA3UF71.js → TrendUp01-Cpu4_O9X.js} +1 -1
- package/dist/client/assets/{Upload01-CURnTiOx.js → Upload01-PO1Z12J3.js} +1 -1
- package/dist/client/assets/{User01-CGWss5jM.js → User01-ClQH_5NK.js} +1 -1
- package/dist/client/assets/{UserSquare-DNzPXyDT.js → UserSquare-DtGKXF0N.js} +1 -1
- package/dist/client/assets/{Users01-B043Q3B_.js → Users01-Bvqsn2Z0.js} +1 -1
- package/dist/client/assets/{Users03-CeFJXyBc.js → Users03-C1f0X_bD.js} +1 -1
- package/dist/client/assets/{XCircle-vpb-OIYV.js → XCircle-qXvFFF3a.js} +1 -1
- package/dist/client/assets/{XClose-Ca1B07wN.js → XClose-F4_KA-E6.js} +1 -1
- package/dist/client/assets/{YAxis-CEmbkD2K.js → YAxis-Bwjlsmrn.js} +1 -1
- package/dist/client/assets/{Zap-DoBPpnDg.js → Zap-DK06ViId.js} +1 -1
- package/dist/client/assets/{ZapSquare-B52zBMI0.js → ZapSquare-B8eYKtXE.js} +1 -1
- package/dist/client/assets/{access-gate-BT3_V_pA.js → access-gate-C5Y4THSz.js} +1 -1
- package/dist/client/assets/{agent-icon-Dt8TTBNR.js → agent-icon-BRsJ64Gp.js} +1 -1
- package/dist/client/assets/{agents-list-BVmLhzQp.js → agents-list-Cb5QyV0J.js} +1 -1
- package/dist/client/assets/{ai-providers-nCIA03hu.js → ai-providers-F9sUAX3N.js} +1 -1
- package/dist/client/assets/{alert-CVrfLuO_.js → alert-DjabJJJC.js} +1 -1
- package/dist/client/assets/{alert-dialog-COKsRPdB.js → alert-dialog-C6uvTNV5.js} +1 -1
- package/dist/client/assets/{api-keys-B2kzULLm.js → api-keys-DmdCnjmd.js} +1 -1
- package/dist/client/assets/{app-editor-Bq3jQAI6.js → app-editor-CCEPa5_q.js} +1 -1
- package/dist/client/assets/{auth-Dff1xvcy.js → auth-BjDvWFq6.js} +1 -1
- package/dist/client/assets/{auth-catchall-BXu-XwcE.js → auth-catchall-CpusPL_F.js} +1 -1
- package/dist/client/assets/{auth-entry-BjUIXBC9.js → auth-entry-DhkykqHc.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DyTFtZvs.js → auth-split-layout-BvVQruwK.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BpXFlbw1.js → authenticate-and-persist-oauth-CfcfVqDI.js} +1 -1
- package/dist/client/assets/{automation-list-row-BcptvIDe.js → automation-list-row-BO2X7Ov7.js} +1 -1
- package/dist/client/assets/{automation-runs-l52V2CDe.js → automation-runs-BQpimZeU.js} +1 -1
- package/dist/client/assets/{automations-A1r9cPLm.js → automations-CYoHIEOo.js} +1 -1
- package/dist/client/assets/{avatar-CKLVepem.js → avatar-CiQyTRfd.js} +1 -1
- package/dist/client/assets/{badge-B2mtA9Oj.js → badge-Dp3mR27V.js} +1 -1
- package/dist/client/assets/{block-document-CTUlzaXj.js → block-document-By6966PS.js} +1 -1
- package/dist/client/assets/{buckets-CqwW0fPK.js → buckets-BtAjuTXp.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DOf0qDJu.js → bulk-category-panel-Crj0FXFd.js} +1 -1
- package/dist/client/assets/{capability-load-error-Bu1DMqyM.js → capability-load-error-DcN5DOFH.js} +1 -1
- package/dist/client/assets/{cards-CnXEidEU.js → cards-BKUYovMU.js} +1 -1
- package/dist/client/assets/{category-editor-C2Penmxb.js → category-editor-BrklTiAF.js} +1 -1
- package/dist/client/assets/{chart-mQfq8dm_.js → chart-56471C1Y.js} +1 -1
- package/dist/client/assets/{chat-context-IctGRlpl.js → chat-context-_CA_JeeY.js} +1 -1
- package/dist/client/assets/{checkbox-DjvUsSry.js → checkbox-C1bUrPvW.js} +1 -1
- package/dist/client/assets/{choose-editor-D2hlr7Vq.js → choose-editor-nese6qE5.js} +1 -1
- package/dist/client/assets/{cli-auth-success-odBhJDfC.js → cli-auth-success-CCmWyNoP.js} +1 -1
- package/dist/client/assets/{collection-detail-EdlXGuH5.js → collection-detail-B90a00NV.js} +1 -1
- package/dist/client/assets/{collection-display-button-BeWwcB8v.js → collection-display-button-FKEWPN7M.js} +1 -1
- package/dist/client/assets/{collection-search-BcNT9wqV.js → collection-search-Bd6xu3h9.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DEX-95qA.js → collection-table-wrapper-15zlEhjP.js} +1 -1
- package/dist/client/assets/{collection-tabs-QBx9fiO8.js → collection-tabs-3ta98PDW.js} +1 -1
- package/dist/client/assets/{command-Bciip2fK.js → command-pFth6-af.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BrgV_E6e.js → commerce-onboarding-BQlfD3LU.js} +1 -1
- package/dist/client/assets/{connect-CJeRXYpO.js → connect-DMudoU2M.js} +1 -1
- package/dist/client/assets/{connection-CIVlVP4z.js → connection-QHosBlKh.js} +1 -1
- package/dist/client/assets/{connection-card-DLmi_xFL.js → connection-card-DXUN0HbG.js} +1 -1
- package/dist/client/assets/{connection-detail-DLHrsg7S.js → connection-detail-BQZMFHWj.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Bd1zJpcE.js → connection-form-helpers-Dw_uRR_o.js} +1 -1
- package/dist/client/assets/{connections-CaZTNlzO.js → connections-Cdozilw9.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-0EWVughz.js → decopilot-sse-pool-B2gldwFf.js} +1 -1
- package/dist/client/assets/{dialog-BVOhf6JL.js → dialog-CLVbCjMu.js} +1 -1
- package/dist/client/assets/{domain-settings-1pFiPcDs.js → domain-settings-DoR6E0N1.js} +1 -1
- package/dist/client/assets/{drawer-ygpURzdE.js → drawer-Ckbm2CWJ.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BpdWhSA7.js → dropdown-menu-D2aUCLYk.js} +1 -1
- package/dist/client/assets/{empty-state-CMCoRH7w.js → empty-state-BF41trPY.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BRWpOoZu.js → extract-connection-data-A9qAyYQA.js} +1 -1
- package/dist/client/assets/{file-explorer-DLBtkOjU.js → file-explorer-ws1ucCZl.js} +1 -1
- package/dist/client/assets/{file-type-icon-DQDAdTqu.js → file-type-icon-wuRfMh_5.js} +1 -1
- package/dist/client/assets/{form-DJoSkHk7.js → form-BI3-Eb2L.js} +1 -1
- package/dist/client/assets/{general-CBRT6s1c.js → general-Dkq5x-QZ.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CPPjWOCA.js → github-repo-picker-BMkV5srU.js} +1 -1
- package/dist/client/assets/{hooks-CtnSCLIe.js → hooks-DlPXzzl8.js} +1 -1
- package/dist/client/assets/{index-BJiFP4oP.js → index-B1veCTx1.js} +1 -1
- package/dist/client/assets/{index-DTM9lZbn.js → index-B_Ad5QPQ.js} +1 -1
- package/dist/client/assets/{index-CVkGlHYs.js → index-C2XLHMiw.js} +1 -1
- package/dist/client/assets/{index-D9nsJyXn.js → index-CV8Bfh5R.js} +43 -43
- package/dist/client/assets/{index-BeW-gOXM.js → index-Cssg9t23.js} +1 -1
- package/dist/client/assets/{index-Bks1FS3f.js → index-DAPcjavx.js} +1 -1
- package/dist/client/assets/{index-xXm-vpSs.js → index-DJM5ojUf.js} +1 -1
- package/dist/client/assets/{index-fZpMDfe6.js → index-DS_PtpmP.js} +3 -3
- package/dist/client/assets/{index-DZsKkAKU.js → index-Dh9w3kQB.js} +1 -1
- package/dist/client/assets/{index-AZvP0lkz.js → index-Dl5uUBVr.js} +1 -1
- package/dist/client/assets/{index-redirect-iRkpwVGO.js → index-redirect-DO74fkKf.js} +1 -1
- package/dist/client/assets/{infra-billing-DFpE7R9j.js → infra-billing-DLGhuOLw.js} +1 -1
- package/dist/client/assets/{input-v4c8p5Ob.js → input-Dsyfk4jo.js} +1 -1
- package/dist/client/assets/{integration-icon-DKqG-Mpx.js → integration-icon-DQzHhbi_.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-3-Aihs7O.js → invite-member-dialog-6MS0bODt.js} +1 -1
- package/dist/client/assets/{label-DOL_dkX5.js → label-AZH9h-dP.js} +1 -1
- package/dist/client/assets/{layout-DHLrZup9.js → layout-jQzTnGd2.js} +1 -1
- package/dist/client/assets/login-B5ShBVQi.js +1 -0
- package/dist/client/assets/{mcp-oauth-MtFdjicX.js → mcp-oauth-CV7iuGWl.js} +1 -1
- package/dist/client/assets/{members-jHzwIadJ.js → members-DyI3pT9y.js} +1 -1
- package/dist/client/assets/{monaco-editor-DOnHAZIR.js → monaco-editor-CEXQCwfP.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-8XgEvO3D.js → monitoring-stats-row-C3Te4mdv.js} +1 -1
- package/dist/client/assets/{multi-select-DxScFuSI.js → multi-select-DPBlx32W.js} +1 -1
- package/dist/client/assets/{oauth-callback-DTWHq_Fr.js → oauth-callback-CrdVqleB.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DjoClVq8.js → oauth-callback-ai-provider-KyQ1PZrQ.js} +1 -1
- package/dist/client/assets/{onboarding-CyYYA_IO.js → onboarding-BslW1pcP.js} +1 -1
- package/dist/client/assets/{org-layout-DsGm5b87.js → org-layout-CO6jG1v2.js} +1 -1
- package/dist/client/assets/{organization-choice-WY-H2NEY.js → organization-choice-CoM8gu7M.js} +1 -1
- package/dist/client/assets/{orgs-DggiyP30.js → orgs-CwehcPGm.js} +1 -1
- package/dist/client/assets/{page-seo-form-BoZrAFLO.js → page-seo-form-9OJihF4x.js} +1 -1
- package/dist/client/assets/{popover-DSZP75un.js → popover-BRZicoZW.js} +1 -1
- package/dist/client/assets/{post-calendar-BTuD64kJ.js → post-calendar-hEguUc5o.js} +1 -1
- package/dist/client/assets/{post-editor-Dwh3Mrlh.js → post-editor-pLSbc6mp.js} +1 -1
- package/dist/client/assets/{primitives-aZbwao0Z.js → primitives-CtBKfa_X.js} +1 -1
- package/dist/client/assets/{profile-B_6pDwzu.js → profile-n9hx6gY-.js} +1 -1
- package/dist/client/assets/{project-app-view-LijoL6le.js → project-app-view-DoK4zGoF.js} +1 -1
- package/dist/client/assets/record-editor-BiTWcS2C.js +1 -0
- package/dist/client/assets/{redirect-editor-bt0UR5sd.js → redirect-editor-feQIS-ih.js} +1 -1
- package/dist/client/assets/{registry-layout-Da3tVRcY.js → registry-layout-DaMCQA8V.js} +1 -1
- package/dist/client/assets/registry-zK072Ecp.js +2 -0
- package/dist/client/assets/{reports-DjBTZdT2.js → reports-DGCK2_12.js} +1 -1
- package/dist/client/assets/{require-capability-CF9r_mzF.js → require-capability-BuB0VaIt.js} +1 -1
- package/dist/client/assets/{required-auth-layout-XqEbPK8M.js → required-auth-layout-C8K6T2Dl.js} +1 -1
- package/dist/client/assets/{reset-password-DEL_G7hS.js → reset-password-Bv3lK8g1.js} +1 -1
- package/dist/client/assets/{roles-DDOKq874.js → roles-04svMQ-w.js} +1 -1
- package/dist/client/assets/{search-input-4SLm_iMt.js → search-input-BMFjaZW8.js} +1 -1
- package/dist/client/assets/{secrets-CJLKcRa3.js → secrets-CAom0Pas.js} +1 -1
- package/dist/client/assets/{sections-editor-CLwG1W2k.js → sections-editor-DYATNkxM.js} +1 -1
- package/dist/client/assets/{select-model-pYcHYqNY.js → select-model-DbrnwWTj.js} +1 -1
- package/dist/client/assets/{select-D9OtHuoQ.js → select-v0HyS5wV.js} +1 -1
- package/dist/client/assets/{self-tool-result-C2SaSBOS.js → self-tool-result-r1jsmu7J.js} +1 -1
- package/dist/client/assets/{seo-editor-DGd5xF_D.js → seo-editor-BqjKMW9L.js} +1 -1
- package/dist/client/assets/{settings-layout-UMPp-PK8.js → settings-layout-D3s-EDDq.js} +1 -1
- package/dist/client/assets/{shell-controls-CEjTnZRA.js → shell-controls-BH090Ymi.js} +1 -1
- package/dist/client/assets/{shell-layout-0_Y9WTC5.js → shell-layout-Ca7ET_6R.js} +1 -1
- package/dist/client/assets/{spinner-DnK6LAO-.js → spinner-Dzoa8exR.js} +1 -1
- package/dist/client/assets/{sprints-DTKQS9tP.js → sprints-BDnw_QJc.js} +1 -1
- package/dist/client/assets/{sso-Bj9k9yp_.js → sso-Br3gVbj4.js} +1 -1
- package/dist/client/assets/{store-DofhpRf4.js → store-TksVzK51.js} +1 -1
- package/dist/client/assets/store-registry-CH-meU9J.js +2 -0
- package/dist/client/assets/{switch-Dd8SWBtK.js → switch-CPOt6c8D.js} +1 -1
- package/dist/client/assets/{synced-repos-0UH9NuJE.js → synced-repos-DMsM8gK7.js} +1 -1
- package/dist/client/assets/{tab-id-W4sfonX1.js → tab-id-BOj9dZWT.js} +1 -1
- package/dist/client/assets/{table-B28U6WCV.js → table-yXN-B6JM.js} +1 -1
- package/dist/client/assets/{tabs-CNvz9wkq.js → tabs-DMoGi1te.js} +1 -1
- package/dist/client/assets/{task-key-CTiJU5_h.js → task-key-C2W_oYAM.js} +1 -1
- package/dist/client/assets/{tasks-BsRXKJkD.js → tasks-BrWj9zEH.js} +1 -1
- package/dist/client/assets/{textarea-BmWik9O5.js → textarea-CegtzxU_.js} +1 -1
- package/dist/client/assets/{toggle-group-B1ujv-Tj.js → toggle-group-5omFh11U.js} +1 -1
- package/dist/client/assets/{toolbar-Cos-gS1a.js → toolbar-DORhO8If.js} +1 -1
- package/dist/client/assets/{track-Cth4u5b_.js → track-B8qKGWO9.js} +1 -1
- package/dist/client/assets/{types-Da-6shE5.js → types-CE4AuZSY.js} +1 -1
- package/dist/client/assets/{use-ai-providers-bDkOAByr.js → use-ai-providers-DAYMp9NI.js} +1 -1
- package/dist/client/assets/{use-api-keys-Bi2l36nz.js → use-api-keys-DnFSxnvy.js} +1 -1
- package/dist/client/assets/{use-automations-BeKjYp7F.js → use-automations-DWv6iLeU.js} +1 -1
- package/dist/client/assets/{use-autosave-ImljMikW.js → use-autosave-iV8J_MuB.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BIn9fxJl.js → use-clock-tick-BuVoJTdT.js} +1 -1
- package/dist/client/assets/{use-commerce-diagnostic-UqRl5JGR.js → use-commerce-diagnostic-KLE4UXiE.js} +1 -1
- package/dist/client/assets/{use-connection-DJ5BvXkS.js → use-connection-BJir_wda.js} +1 -1
- package/dist/client/assets/{use-copy-BHeXFKUG.js → use-copy-Ddcpb0Jm.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CTghZh27.js → use-create-virtual-mcp-D0oAOlYC.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BEoE5zu3.js → use-debounced-autosave-DYJOZB4t.js} +1 -1
- package/dist/client/assets/{use-debounced-value-d2xvAJAf.js → use-debounced-value-DXPF8RW0.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-U00f_DNo.js → use-decopilot-events-CUYP3xa6.js} +1 -1
- package/dist/client/assets/{use-delete-connection-KttG6pDD.js → use-delete-connection-CaYWV75o.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BxGtVq0R.js → use-deployment-admin-DiSPyrP4.js} +1 -1
- package/dist/client/assets/{use-file-configs-ivKLtwVT.js → use-file-configs-BZNx7FRl.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C3woVgJJ.js → use-infinite-scroll-DGa9MpTS.js} +1 -1
- package/dist/client/assets/{use-join-requests-Ce2D10xE.js → use-join-requests-_j9mGSpf.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BixLZLmc.js → use-mcp-client-Zz1TwEAh.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DhYUR3cu.js → use-mcp-tools-CXwtpaPy.js} +1 -1
- package/dist/client/assets/{use-members-DqBCB9wB.js → use-members--D0gY-Nz.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-COcz3Nee.js → use-navigate-to-agent-BTDz1KOs.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Bm7ydyvS.js → use-org-auth-client-C8dt2CEh.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-B_4SIVWY.js → use-org-repo-syncs-BMPkdDGr.js} +1 -1
- package/dist/client/assets/{use-org-sso-9a_THghN.js → use-org-sso-DAANUxzR.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CNEl3NFe.js → use-organization-roles-C4JrUmJs.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B4nKr0f2.js → use-organization-settings-BZyz9Mop.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C7LyRS1M.js → use-registry-connections-DrNpncD0.js} +1 -1
- package/dist/client/assets/{use-secrets-Chh3ojOY.js → use-secrets-XCXR_vh8.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Db24sM6t.js → use-section-preview-base-BuCg0_G0.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DFis4MWx.js → use-status-sounds-CjE1Nwyt.js} +1 -1
- package/dist/client/assets/{use-tags-DSiXReOW.js → use-tags-CtHBcu1c.js} +1 -1
- package/dist/client/assets/{use-view-mode-5S7L8whl.js → use-view-mode-D2QnCor3.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CxECG99q.js → use-virtual-mcp-BHOLpD1P.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DrLMltTg.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-bgdhkmFx.js +1 -0
- package/dist/client/assets/{users-DegqgBxw.js → users-BdTetp54.js} +1 -1
- package/dist/client/assets/{variant-calendar-Ca_JbtN7.js → variant-calendar-OvwXqvaE.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-rkJlH4vl.js → view-mode-toggle-DYMYSHNc.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +456 -452
- package/dist/server/migrate.js +113 -109
- package/dist/server/server.js +4 -4
- package/package.json +1 -1
- package/dist/client/assets/login-BAB1aLje.js +0 -1
- package/dist/client/assets/record-editor-BJycqOk0.js +0 -1
- package/dist/client/assets/registry-D7lhOlQc.js +0 -2
- package/dist/client/assets/store-registry-Cuo4Kfxl.js +0 -2
- package/dist/client/assets/useInfiniteQuery-D6nR9UJf.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BfIWoPo8.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O,H as T,av as v,bF as A,K as I,o as _,p as b,b as J,e as N,t as p}from"./index-
|
|
1
|
+
import{c as O,H as T,av as v,bF as A,K as I,o as _,p as b,b as J,e as N,t as p}from"./index-DS_PtpmP.js";function F(){const e=O.c(10),{org:u}=T(),d=v(),{capabilities:c,isPrivileged:f}=A(),s=f||!!c["members:manage"];let i;e[0]!==u.id?(i=I.organizationJoinRequests(u.id),e[0]=u.id,e[1]=i):i=e[1];let t;e[2]!==d?(t=()=>d.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=d,e[3]=t):t=e[3];const o=!!u.id&&s;let n;e[4]!==i||e[5]!==t||e[6]!==o?(n={queryKey:i,queryFn:t,enabled:o},e[4]=i,e[5]=t,e[6]=o,e[7]=n):n=e[7];const{data:a}=_(n);let l;return e[8]!==a?.requests?(l=a?.requests??[],e[8]=a?.requests,e[9]=l):l=e[9],l}function j(){const e=O.c(29),{org:u,locator:d}=T(),c=v(),f=b(),s=J();let i;e[0]!==d||e[1]!==u||e[2]!==f?(i=()=>{f.invalidateQueries({queryKey:I.organizationJoinRequests(u.id)}),f.invalidateQueries({queryKey:I.members(d)})},e[0]=d,e[1]=u,e[2]=f,e[3]=i):i=e[3];const t=i;let o;e[4]!==c?(o=r=>c.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:r}),e[4]=c,e[5]=o):o=e[5];let n;e[6]!==t||e[7]!==s?(n=()=>{t(),p.success(s("settings.joinRequestsSection.approved"))},e[6]=t,e[7]=s,e[8]=n):n=e[8];let a;e[9]!==s?(a=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.approveFailed")),e[9]=s,e[10]=a):a=e[10];let l;e[11]!==o||e[12]!==n||e[13]!==a?(l={mutationFn:o,onSuccess:n,onError:a},e[11]=o,e[12]=n,e[13]=a,e[14]=l):l=e[14];const y=N(l);let q;e[15]!==c?(q=r=>c.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:r}),e[15]=c,e[16]=q):q=e[16];let R;e[17]!==t||e[18]!==s?(R=()=>{t(),p.success(s("settings.joinRequestsSection.denied"))},e[17]=t,e[18]=s,e[19]=R):R=e[19];let g;e[20]!==s?(g=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.denyFailed")),e[20]=s,e[21]=g):g=e[21];let E;e[22]!==q||e[23]!==R||e[24]!==g?(E={mutationFn:q,onSuccess:R,onError:g},e[22]=q,e[23]=R,e[24]=g,e[25]=E):E=e[25];const S=N(E);let m;return e[26]!==y||e[27]!==S?(m={approve:y,deny:S},e[26]=y,e[27]=S,e[28]=m):m=e[28],m}export{j as a,F as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{dX as le,dY as ue,dZ as de,cS as he,d_ as fe,cv as _,cw as g,d$ as pe,e0 as me,e1 as _e,e2 as M,e3 as we,e4 as D,e5 as ge,e6 as q,e7 as Te,e8 as L,e9 as ye,ea as ke,eb as ve,ec as J,c9 as Se,cb as Ce,c6 as be,cN as te,cZ as Re,d3 as Ie,d1 as Ee,dn as qe,ed as Pe,ee as $e,ef as A,eg as Me,eh as Ae,d2 as He,c_ as Oe,c$ as Ue,d0 as xe,c7 as Ne,ei as je,ej as Fe,ek as De,cU as Le,el as Ve,em as ze,dj as U,en as Qe,c5 as N,c as se,z as re,K as z}from"./index-fZpMDfe6.js";import{S as Je}from"./constants-_08zpzmT.js";import{U as P,a as H,e as W}from"./auth-Dff1xvcy.js";function x(a){return!!a._zod}function b(a,e){return x(a)?le(a,e):a.safeParse(e)}function oe(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function We(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function K(a){const t=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=We(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function G(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ke=6e4;class Ge{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(ue,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(he,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(fe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(pe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(me,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new _(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(_e,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new _(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new _(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||we(o)?this._onresponse(o):D(o)?this._onrequest(o,n):ge(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=Te(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 d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(g.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=_.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 _?n:new _(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[q]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const w=c instanceof _?c:new _(g.RequestTimeout,String(c));l(w)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const w=b(t,c.result);w.success?p(w.data):l(w.error)}catch(w){l(w)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??Ke,k=()=>T(_.fromError(g.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=w=>{const v=this._responseHandlers.get(f);v?v(w):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(f),l(w)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ye,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},ke,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,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=K(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=G(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=K(e);this._notificationHandlers.set(s,r=>{const o=G(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&D(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new _(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=J.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new _(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=J.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ze(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var Be=Ce();const Ye=Se(Be);function Xe(){const a=new Ye({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return be(a),a}class et{constructor(e){this._ajv=e??Xe()}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 tt{constructor(e){this._client=e}async*callToolStream(e,t=te,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function st(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function rt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function ot(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let at=class extends Ge{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 et,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Re,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ie,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ee,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new tt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ze(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(Fe,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=ot(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(g.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(g.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(L,T);if(!c.success){const w=c.error instanceof Error?c.error.message:String(c.error);throw new _(g.InvalidParams,`Invalid task creation result: ${w}`)}return c.data}const y=b(De,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&k.action==="accept"&&k.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{O(h,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Le,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const k=b(L,f);if(!k.success){const h=k.error instanceof Error?k.error.message:String(k.error);throw new _(g.InvalidParams,`Invalid task creation result: ${h}`)}return k.data}const T=d.tools||d.toolChoice?Ve:ze,y=b(T,f);if(!y.success){const k=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid sampling result: ${k}`)}return y.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:qe,capabilities:this._capabilities,clientInfo:this._clientInfo}},Pe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!$e.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){st(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&rt(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Me,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Ae,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},He,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Oe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ue,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=te,s){if(this.isToolTaskRequired(e.name))throw new _(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=je.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);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 j=a=>[{type:"text",text:a}];function nt(a){const e=U(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function it(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...V(e.headers),...V(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Y=10,ct=13,I=32;function F(a){}function lt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const v=f(h);v!==""&&o.push(v);return}if(h.indexOf(`
|
|
1
|
+
import{dX as le,dY as ue,dZ as de,cS as he,d_ as fe,cv as _,cw as g,d$ as pe,e0 as me,e1 as _e,e2 as M,e3 as we,e4 as D,e5 as ge,e6 as q,e7 as Te,e8 as L,e9 as ye,ea as ke,eb as ve,ec as J,c9 as Se,cb as Ce,c6 as be,cN as te,cZ as Re,d3 as Ie,d1 as Ee,dn as qe,ed as Pe,ee as $e,ef as A,eg as Me,eh as Ae,d2 as He,c_ as Oe,c$ as Ue,d0 as xe,c7 as Ne,ei as je,ej as Fe,ek as De,cU as Le,el as Ve,em as ze,dj as U,en as Qe,c5 as N,c as se,z as re,K as z}from"./index-DS_PtpmP.js";import{S as Je}from"./constants-_08zpzmT.js";import{U as P,a as H,e as W}from"./auth-BjDvWFq6.js";function x(a){return!!a._zod}function b(a,e){return x(a)?le(a,e):a.safeParse(e)}function oe(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function We(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function K(a){const t=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=We(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function G(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ke=6e4;class Ge{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(ue,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(he,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(fe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(pe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(me,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new _(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(_e,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new _(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new _(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||we(o)?this._onresponse(o):D(o)?this._onrequest(o,n):ge(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=Te(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 d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(g.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=_.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 _?n:new _(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[q]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const w=c instanceof _?c:new _(g.RequestTimeout,String(c));l(w)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const w=b(t,c.result);w.success?p(w.data):l(w.error)}catch(w){l(w)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??Ke,k=()=>T(_.fromError(g.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=w=>{const v=this._responseHandlers.get(f);v?v(w):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(f),l(w)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ye,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},ke,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,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=K(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=G(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=K(e);this._notificationHandlers.set(s,r=>{const o=G(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&D(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new _(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=J.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new _(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=J.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ze(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var Be=Ce();const Ye=Se(Be);function Xe(){const a=new Ye({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return be(a),a}class et{constructor(e){this._ajv=e??Xe()}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 tt{constructor(e){this._client=e}async*callToolStream(e,t=te,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function st(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function rt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function ot(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let at=class extends Ge{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 et,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Re,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ie,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ee,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new tt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ze(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(Fe,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=ot(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(g.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(g.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(L,T);if(!c.success){const w=c.error instanceof Error?c.error.message:String(c.error);throw new _(g.InvalidParams,`Invalid task creation result: ${w}`)}return c.data}const y=b(De,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&k.action==="accept"&&k.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{O(h,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Le,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const k=b(L,f);if(!k.success){const h=k.error instanceof Error?k.error.message:String(k.error);throw new _(g.InvalidParams,`Invalid task creation result: ${h}`)}return k.data}const T=d.tools||d.toolChoice?Ve:ze,y=b(T,f);if(!y.success){const k=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid sampling result: ${k}`)}return y.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:qe,capabilities:this._capabilities,clientInfo:this._clientInfo}},Pe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!$e.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){st(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&rt(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Me,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Ae,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},He,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Oe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ue,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=te,s){if(this.isToolTaskRequired(e.name))throw new _(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=je.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);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 j=a=>[{type:"text",text:a}];function nt(a){const e=U(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function it(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...V(e.headers),...V(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Y=10,ct=13,I=32;function F(a){}function lt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const v=f(h);v!==""&&o.push(v);return}if(h.indexOf(`
|
|
2
2
|
`)===-1&&h.indexOf("\r")===-1){o.push(h);return}o.push(h);const c=o.join("");o.length=0;const w=f(c);w!==""&&o.push(w)}function f(h){let c=0;if(h.indexOf("\r")===-1){let w=h.indexOf(`
|
|
3
3
|
`,c);for(;w!==-1;){if(c===w){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=w+1,w=h.indexOf(`
|
|
4
4
|
`,c);continue}const v=h.charCodeAt(c);if(X(h,c,v)){const S=h.charCodeAt(c+5)===I?c+6:c+5,C=h.slice(S,w);if(p===0&&h.charCodeAt(w+1)===Y){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=w+2,w=h.indexOf(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,o as p,z as q,K as T}from"./index-
|
|
1
|
+
import{c as m,o as p,z as q,K as T}from"./index-DS_PtpmP.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,H as m,z as b,o as M,K as f}from"./index-
|
|
1
|
+
import{c,H as m,z as b,o as M,K as f}from"./index-DS_PtpmP.js";import{u as y}from"./use-org-auth-client-C8dt2CEh.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),r=y();let o;t[0]!==e?(o=f.members(e),t[0]=e,t[1]=o):o=t[1];let s;t[2]!==r?(s=()=>r.organization.listMembers(),t[2]=r,t[3]=s):s=t[3];let n;return t[4]!==o||t[5]!==s?(n={queryKey:o,queryFn:s},t[4]=o,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let r;e[0]!==t?(r=t===void 0?{}:t,e[0]=t,e[1]=r):r=e[1];const{enabled:o}=r,s=o===void 0?!0:o,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{d as a,q as u};
|
package/dist/client/assets/{use-navigate-to-agent-COcz3Nee.js → use-navigate-to-agent-BTDz1KOs.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as h,r as c,c as I,j as R,d as v,H as x,a as A}from"./index-
|
|
1
|
+
import{I as h,r as c,c as I,j as R,d as v,H as x,a as A}from"./index-DS_PtpmP.js";import{u as C}from"./use-virtual-mcp-BHOLpD1P.js";import{b as E}from"./hooks-DlPXzzl8.js";import{f as P}from"./reusable-new-chat-CzvRy4Pe.js";import{d as w}from"./session-runtime-wVXsCwcJ.js";const l=new Map;function O(r){return`${r.orgId}:${r.userId}`}function G(r){return`sidebar.group-order.${r}`}function p(r){try{const e=localStorage.getItem(r),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function N(r,e){try{localStorage.setItem(r,JSON.stringify(e))}catch{}}function T(r){const e=O(r),t=l.get(e);if(t)return t;const n=h.sidebarGroupOrder(r.orgId,r.userId);let i=!1;try{i=localStorage.getItem(n)!==null}catch{}let o=p(n);if(!i&&o.length===0&&r.userId!=="anon"){const u=p(G(r.orgId));u.length>0&&(o=u)}return l.set(e,o),o}function U(r,e){const t=new Set(e);return T(r).filter(n=>!t.has(n))}function _(r,e){l.set(O(r),e),N(h.sidebarGroupOrder(r.orgId,r.userId),e)}function $(r,e,t=[]){if(t.includes(e))return;const n=U(r,t);n.includes(e)||_(r,[e,...n])}const g=c.createContext(null);function q(r){const e=I.c(7),{children:t}=r,[n,i]=c.useState(!1),[o,u]=c.useState(0);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>u(j),e[0]=a):a=e[0];const f=a;let s;e[1]!==n||e[2]!==o?(s={empty:n,setEmpty:i,orderRevision:o,bumpOrderRevision:f},e[1]=n,e[2]=o,e[3]=s):s=e[3];let d;return e[4]!==t||e[5]!==s?(d=R.jsx(g.Provider,{value:s,children:t}),e[4]=t,e[5]=s,e[6]=d):d=e[6],d}function j(r){return r+1}function z(){return c.useContext(g)?.empty??!1}function K(){return c.useContext(g)?.bumpOrderRevision??k}function k(){}const S=[],D=()=>()=>{};function H(r){return(r??[]).filter(e=>!!e.pinned).map(e=>e.id)}function F(){const r=v(),{org:e}=x(),t=C(),{data:n}=A.useSession(),i=n?.user?.id??"anon",o=H(t),u=K(),a=E(),f=c.useSyncExternalStore(a?.threads.subscribe??D,a?.threads.get??(()=>S),a?.threads.get??(()=>S));return(s,d)=>{$({orgId:e.id,userId:i},s,o),u();const m=(t??[]).find(b=>b.id===s),y=P(f,s,n?.user?.id,m?w(m.metadata):void 0)?.id??crypto.randomUUID();r({to:"/$org/$taskId",params:{org:e.slug,taskId:y},search:{...d?.search??{},virtualmcpid:s}})}}export{q as S,K as a,$ as b,F as c,H as g,z as u};
|
package/dist/client/assets/{use-org-auth-client-Bm7ydyvS.js → use-org-auth-client-C8dt2CEh.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,H as j,a as i}from"./index-
|
|
1
|
+
import{c as x,H as j,a as i}from"./index-DS_PtpmP.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};
|
package/dist/client/assets/{use-org-repo-syncs-B_4SIVWY.js → use-org-repo-syncs-BMPkdDGr.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,H as f,av as y,K as S,o as _,p as d,e as R}from"./index-
|
|
1
|
+
import{c as r,H as f,av as y,K as S,o as _,p as d,e as R}from"./index-DS_PtpmP.js";const p=5e3;function m(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=r.c(7),{org:n}=f(),t=y();let c;e[0]!==n.id?(c=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=c):c=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==c||e[5]!==s?(o={queryKey:c,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=c,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return m(e.state.data)?p:!1}function P(){const e=r.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function q(){const e=r.c(12),{org:n}=f(),t=y(),c=d();let s;e[0]!==n||e[1]!==c?(s=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=c,e[2]=s):s=e[2];const o=s;let i;e[3]!==t?(i=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==t?(a=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=a):a=e[7];let l;return e[8]!==o||e[9]!==i||e[10]!==a?(l={mutationFn:i,onSuccess:a,onSettled:o},e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],R(l)}function C(){return null}function v(){const e=r.c(8),{org:n}=f(),t=y(),c=d();let s;e[0]!==t?(s=a=>t.call("ORG_REPO_SYNC_DELETE",{id:a}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==c?(o=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=c,e[4]=o):o=e[4];let i;return e[5]!==s||e[6]!==o?(i={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=i):i=e[7],R(i)}export{P as a,q as b,v as c,g as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,o as S,p as r,e as y,K as c}from"./index-
|
|
1
|
+
import{c as u,o as S,p as r,e as y,K as c}from"./index-DS_PtpmP.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function m(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{C as a,O as b,m as c,h as d,q as u};
|
package/dist/client/assets/{use-organization-roles-CNEl3NFe.js → use-organization-roles-C4JrUmJs.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as R}from"./use-org-auth-client-
|
|
1
|
+
import{u as R}from"./use-org-auth-client-C8dt2CEh.js";import{H as b,o as P,K as y}from"./index-DS_PtpmP.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ak as c,am as r,al as C,aq as k,ar as d,an as D,bl as G,bL as T,c as u,H as v,o as E,aQ as q,K as y,av as z,p as O,e as L,r as Q}from"./index-fZpMDfe6.js";import{W as U}from"./constants-_08zpzmT.js";c({title:r(),url:r(),icon:r()});c({registries:k(r(),c({enabled:d()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:C(r()).describe("List of MCP app_name or app_id values to hide from the store.")});const f=c({keyId:r(),modelId:r(),title:r().optional()}).nullable();D(["fast","smart","thinking","image","web_search","deep_research"]);D(["fast","smart","thinking"]);const ie=c({tiers:c({fast:f,smart:f,thinking:f,image:f,web_search:f,deep_research:f})});c({tiers:c({fast:f.optional(),smart:f.optional(),thinking:f.optional()})});c({ids:C(r()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});function W(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;const t=Date.parse(`${e}T00:00:00.000Z`);return Number.isNaN(t)?null:new Date(t).toISOString().slice(0,10)===e?t:null}c({enabled:d().describe("Whether the board shows the sprint property and its filter. Off hides both; tasks keep any sprint already assigned."),weeks:G().int().min(1).max(12).describe("How many weeks one sprint lasts."),startDate:r().regex(/^\d{4}-\d{2}-\d{2}$/).refine(e=>W(e)!==null,{message:"startDate must be a real calendar day"}).describe("Calendar day sprint 1 starts on (YYYY-MM-DD, read as UTC). Every later sprint is counted from here.")});c({demo_mode:d().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:d().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),nav_v2:d().optional().describe("First-class navigation: the sidebar lists destinations (Reports, Library, Tasks) instead of chat threads, and the thread list moves into a menu at the top of the chat panel. Seeded on for newly created orgs (see NEW_ORG_DEFAULT_FLAGS) and defaults on for reports_only orgs; an explicit false wins over both."),qa_agent_enabled:d().optional().describe("Run the QA Agent on a task's pull request once it's In Review — it verifies the task actually solved the problem (exercises the feature, not just the diff)."),code_reviewer_enabled:d().optional().describe("Run the Code Reviewer on a task's pull request once it's In Review — it reviews the code using the repo's stack-appropriate review skills."),auto_merge:d().optional().describe("When every enabled reviewer (QA Agent / Code Reviewer) approves a task's pull request, merge it automatically instead of leaving the merge to a human. If the merge is blocked by a conflict with the base branch, hand the PR back to the Super Agent to resolve the conflict (check out the branch, merge the base, push) so it can then merge."),cheap_reviewer_model:d().optional().describe("Run the QA Agent and Code Reviewer on a cheaper model than the Super Agent. A review reads a diff and reaches a verdict; it does not need the model that wrote the code. Off by default — turning it on trades some review depth for cost."),coding_agent_org_mcps:d().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow task-run surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),auto_assign_report_tasks_to_super_agent:d().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned.")});const x=new Set(["qa_agent_enabled","code_reviewer_enabled"]);function Y(e,t){const n=e?.[t];return x.has(t)?n!==!1:n===!0}c({id:r().describe("Brand context ID"),name:r().describe("Company name"),domain:r().describe("Company domain (e.g. example.com)"),overview:r().describe("Company overview / description"),logo:r().nullable().optional().describe("Logo URL"),favicon:r().nullable().optional().describe("Favicon URL"),ogImage:r().nullable().optional().describe("OG image URL"),fonts:c({heading:r().optional().describe("Font family for headings"),body:r().optional().describe("Font family for body text"),code:r().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:c({primary:r().optional().describe("Primary brand color (hex)"),secondary:r().optional().describe("Secondary brand color (hex)"),accent:r().optional().describe("Accent / highlight color (hex)"),background:r().optional().describe("Background color (hex)"),foreground:r().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:C(k(r(),T())).nullable().optional().describe("Brand images"),metadata:k(r(),T()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:r().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:d().optional().describe("Whether this is the default brand for the organization")});const M={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null,main_agent_id:null,sprint_config:null},N={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function $(e,t){return{queryKey:y.organizationSettings(t),queryFn:async()=>{try{return await q(e,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...M,organizationId:t}}},staleTime:6e4}}function g(e){const t=u.c(6),{org:n}=v();let a;t[0]!==n.id||t[1]!==n.slug?(a=$(n.slug,n.id),t[0]=n.id,t[1]=n.slug,t[2]=a):a=t[2];const s=e;let o;return t[3]!==a||t[4]!==s?(o={...a,select:s},t[3]=a,t[4]=s,t[5]=o):o=t[5],E(o)}function re(e,t){const n=u.c(3);let a;n[0]!==e||n[1]!==t?(a=$(t,e),n[0]=e,n[1]=t,n[2]=a):a=n[2];const{data:s}=E(a);return s??null}function p(){const e=u.c(9),{org:t}=v(),n=z(),a=O();let s;e[0]!==t||e[1]!==n?(s=async l=>{const m=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:t.id,...l});if(!m)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return m},e[0]=t,e[1]=n,e[2]=s):s=e[2];let o;e[3]!==t||e[4]!==a?(o=l=>{a.setQueryData(y.organizationSettings(t.id),m=>({...m??M,...l}))},e[3]=t,e[4]=a,e[5]=o):o=e[5];let i;return e[6]!==s||e[7]!==o?(i={mutationFn:s,onSuccess:o},e[6]=s,e[7]=o,e[8]=i):i=e[8],L(i)}function K(e){return e?.tiers?{tiers:{fast:e.tiers.fast??null,smart:e.tiers.smart??null,thinking:e.tiers.thinking??null,image:e.tiers.image??null,web_search:e.tiers.web_search??null,deep_research:e.tiers.deep_research??null}}:N}function le(){const{data:e}=g(H);return e??N}function H(e){return K(e.simple_mode)}function ce(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(o,i)=>t.mutate({simple_mode:o},i),a=(o,i)=>t.mutateAsync({simple_mode:o},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let s;return e[3]!==t||e[4]!==n||e[5]!==a?(s={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=s):s=e[6],s}function ue(){return B("reports_only")}function de(){const{data:e}=g(j);return e??!1}function j(e){return e.flags?.nav_v2??e.flags?.reports_only??!1}function B(e){const t=u.c(5);let n;t[0]!==e?(n=o=>Y(o.flags,e),t[0]=e,t[1]=n):n=t[1];const{data:a}=g(n);let s;return t[2]!==a||t[3]!==e?(s=a??x.has(e),t[2]=a,t[3]=e,t[4]=s):s=t[4],s}function me(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(o,i,l)=>t.mutate({flags:{[o]:i}},l),a=(o,i,l)=>t.mutateAsync({flags:{[o]:i}},l),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let s;return e[3]!==t||e[4]!==n||e[5]!==a?(s={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=s):s=e[6],s}function fe(){const{data:e}=g(Z);return e??null}function Z(e){return e.sprint_config}function ge(){const e=u.c(3),{data:t,isSuccess:n}=g(V),a=t??null;let s;return e[0]!==n||e[1]!==a?(s={config:a,isLoaded:n},e[0]=n,e[1]=a,e[2]=s):s=e[2],s}function V(e){return e.sprint_config}function pe(){const e=u.c(5),t=p();let n;e[0]!==t?(n=(s,o)=>t.mutate({sprint_config:s},o),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==t||e[3]!==n?(a={...t,mutate:n},e[2]=t,e[3]=n,e[4]=a):a=e[4],a}function J(){const{data:e}=g(X);return e??null}function X(e){return e.registry_config}function he(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(o,i)=>t.mutate({registry_config:o},i),a=(o,i)=>t.mutateAsync({registry_config:o},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let s;return e[3]!==t||e[4]!==n||e[5]!==a?(s={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=s):s=e[6],s}function be(){const{data:e}=g(ee);return e??null}function ee(e){return e.default_home_agents}function te(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(o,i)=>t.mutate({default_home_agents:o},i),a=(o,i)=>t.mutateAsync({default_home_agents:o},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let s;return e[3]!==t||e[4]!==n||e[5]!==a?(s={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=s):s=e[6],s}function _e(){const e=u.c(14),{org:t}=v(),n=te(),a=O();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Promise.resolve(),e[0]=s):s=e[0];const o=Q.useRef(s);let i;e[1]!==t.id?(i=y.organizationSettings(t.id),e[1]=t.id,e[2]=i):i=e[2];const l=i;let m;e[3]!==l||e[4]!==a?(m=()=>a.getQueryData(l)?.default_home_agents?.ids??[],e[3]=l,e[4]=a,e[5]=m):m=e[5];const S=m;let b;e[6]!==l||e[7]!==t.slug||e[8]!==a||e[9]!==n?(b=F=>{const I=o.current.then(async()=>{const R=a.getQueryData(l),A=F(R?.default_home_agents?.ids??[]);if(A!==null){a.setQueryData(l,h=>h&&{...h,default_home_agents:{ids:A}});try{await n.mutateAsync({ids:A}),await a.refetchQueries({queryKey:y.homeNextActions(t.slug),type:"active"})}catch(h){const P=h;throw a.setQueryData(l,R),P}}});return o.current=I.catch(ne),I},e[6]=l,e[7]=t.slug,e[8]=a,e[9]=n,e[10]=b):b=e[10];const w=b;let _;return e[11]!==w||e[12]!==S?(_={currentIds:S,apply:w},e[11]=w,e[12]=S,e[13]=_):_=e[13],_}function ne(){}function ye(){const e=u.c(3),{data:t,isPending:n}=g(ae),a=t??null;let s;return e[0]!==n||e[1]!==a?(s={mainAgentId:a,isPending:n},e[0]=n,e[1]=a,e[2]=s):s=e[2],s}function ae(e){return e.main_agent_id??null}function ve(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(o,i)=>t.mutate({main_agent_id:o},i),a=(o,i)=>t.mutateAsync({main_agent_id:o},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let s;return e[3]!==t||e[4]!==n||e[5]!==a?(s={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=s):s=e[6],s}function Se(){const e=u.c(5),{org:t}=v(),n=J();let a;e[0]!==t.id?(a=U.REGISTRY(t.id),e[0]=t.id,e[1]=a):a=e[1];const s=a;let o;return e[2]!==s||e[3]!==n?(o=i=>{if(!n)return i===s;const l=n.registries[i];return l?l.enabled:i===s},e[2]=s,e[3]=n,e[4]=o):o=e[4],o}export{ie as S,ue as a,de as b,le as c,be as d,_e as e,fe as f,ye as g,Se as h,re as i,ve as j,me as k,ce as l,J as m,ge as n,pe as o,W as p,he as q,B as u};
|
|
1
|
+
import{ak as c,am as r,al as C,aq as k,ar as d,an as D,bl as G,bL as T,c as u,H as v,o as E,aQ as q,K as y,av as z,p as O,e as L,r as Q}from"./index-DS_PtpmP.js";import{W as U}from"./constants-_08zpzmT.js";c({title:r(),url:r(),icon:r()});c({registries:k(r(),c({enabled:d()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:C(r()).describe("List of MCP app_name or app_id values to hide from the store.")});const f=c({keyId:r(),modelId:r(),title:r().optional()}).nullable();D(["fast","smart","thinking","image","web_search","deep_research"]);D(["fast","smart","thinking"]);const ie=c({tiers:c({fast:f,smart:f,thinking:f,image:f,web_search:f,deep_research:f})});c({tiers:c({fast:f.optional(),smart:f.optional(),thinking:f.optional()})});c({ids:C(r()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});function W(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;const t=Date.parse(`${e}T00:00:00.000Z`);return Number.isNaN(t)?null:new Date(t).toISOString().slice(0,10)===e?t:null}c({enabled:d().describe("Whether the board shows the sprint property and its filter. Off hides both; tasks keep any sprint already assigned."),weeks:G().int().min(1).max(12).describe("How many weeks one sprint lasts."),startDate:r().regex(/^\d{4}-\d{2}-\d{2}$/).refine(e=>W(e)!==null,{message:"startDate must be a real calendar day"}).describe("Calendar day sprint 1 starts on (YYYY-MM-DD, read as UTC). Every later sprint is counted from here.")});c({demo_mode:d().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:d().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),nav_v2:d().optional().describe("First-class navigation: the sidebar lists destinations (Reports, Library, Tasks) instead of chat threads, and the thread list moves into a menu at the top of the chat panel. Seeded on for newly created orgs (see NEW_ORG_DEFAULT_FLAGS) and defaults on for reports_only orgs; an explicit false wins over both."),qa_agent_enabled:d().optional().describe("Run the QA Agent on a task's pull request once it's In Review — it verifies the task actually solved the problem (exercises the feature, not just the diff)."),code_reviewer_enabled:d().optional().describe("Run the Code Reviewer on a task's pull request once it's In Review — it reviews the code using the repo's stack-appropriate review skills."),auto_merge:d().optional().describe("When every enabled reviewer (QA Agent / Code Reviewer) approves a task's pull request, merge it automatically instead of leaving the merge to a human. If the merge is blocked by a conflict with the base branch, hand the PR back to the Super Agent to resolve the conflict (check out the branch, merge the base, push) so it can then merge."),cheap_reviewer_model:d().optional().describe("Run the QA Agent and Code Reviewer on a cheaper model than the Super Agent. A review reads a diff and reaches a verdict; it does not need the model that wrote the code. Off by default — turning it on trades some review depth for cost."),coding_agent_org_mcps:d().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow task-run surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),auto_assign_report_tasks_to_super_agent:d().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned.")});const x=new Set(["qa_agent_enabled","code_reviewer_enabled"]);function Y(e,t){const n=e?.[t];return x.has(t)?n!==!1:n===!0}c({id:r().describe("Brand context ID"),name:r().describe("Company name"),domain:r().describe("Company domain (e.g. example.com)"),overview:r().describe("Company overview / description"),logo:r().nullable().optional().describe("Logo URL"),favicon:r().nullable().optional().describe("Favicon URL"),ogImage:r().nullable().optional().describe("OG image URL"),fonts:c({heading:r().optional().describe("Font family for headings"),body:r().optional().describe("Font family for body text"),code:r().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:c({primary:r().optional().describe("Primary brand color (hex)"),secondary:r().optional().describe("Secondary brand color (hex)"),accent:r().optional().describe("Accent / highlight color (hex)"),background:r().optional().describe("Background color (hex)"),foreground:r().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:C(k(r(),T())).nullable().optional().describe("Brand images"),metadata:k(r(),T()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:r().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:d().optional().describe("Whether this is the default brand for the organization")});const M={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null,main_agent_id:null,sprint_config:null},N={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function $(e,t){return{queryKey:y.organizationSettings(t),queryFn:async()=>{try{return await q(e,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...M,organizationId:t}}},staleTime:6e4}}function g(e){const t=u.c(6),{org:n}=v();let a;t[0]!==n.id||t[1]!==n.slug?(a=$(n.slug,n.id),t[0]=n.id,t[1]=n.slug,t[2]=a):a=t[2];const s=e;let o;return t[3]!==a||t[4]!==s?(o={...a,select:s},t[3]=a,t[4]=s,t[5]=o):o=t[5],E(o)}function re(e,t){const n=u.c(3);let a;n[0]!==e||n[1]!==t?(a=$(t,e),n[0]=e,n[1]=t,n[2]=a):a=n[2];const{data:s}=E(a);return s??null}function p(){const e=u.c(9),{org:t}=v(),n=z(),a=O();let s;e[0]!==t||e[1]!==n?(s=async l=>{const m=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:t.id,...l});if(!m)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return m},e[0]=t,e[1]=n,e[2]=s):s=e[2];let o;e[3]!==t||e[4]!==a?(o=l=>{a.setQueryData(y.organizationSettings(t.id),m=>({...m??M,...l}))},e[3]=t,e[4]=a,e[5]=o):o=e[5];let i;return e[6]!==s||e[7]!==o?(i={mutationFn:s,onSuccess:o},e[6]=s,e[7]=o,e[8]=i):i=e[8],L(i)}function K(e){return e?.tiers?{tiers:{fast:e.tiers.fast??null,smart:e.tiers.smart??null,thinking:e.tiers.thinking??null,image:e.tiers.image??null,web_search:e.tiers.web_search??null,deep_research:e.tiers.deep_research??null}}:N}function le(){const{data:e}=g(H);return e??N}function H(e){return K(e.simple_mode)}function ce(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(o,i)=>t.mutate({simple_mode:o},i),a=(o,i)=>t.mutateAsync({simple_mode:o},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let s;return e[3]!==t||e[4]!==n||e[5]!==a?(s={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=s):s=e[6],s}function ue(){return B("reports_only")}function de(){const{data:e}=g(j);return e??!1}function j(e){return e.flags?.nav_v2??e.flags?.reports_only??!1}function B(e){const t=u.c(5);let n;t[0]!==e?(n=o=>Y(o.flags,e),t[0]=e,t[1]=n):n=t[1];const{data:a}=g(n);let s;return t[2]!==a||t[3]!==e?(s=a??x.has(e),t[2]=a,t[3]=e,t[4]=s):s=t[4],s}function me(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(o,i,l)=>t.mutate({flags:{[o]:i}},l),a=(o,i,l)=>t.mutateAsync({flags:{[o]:i}},l),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let s;return e[3]!==t||e[4]!==n||e[5]!==a?(s={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=s):s=e[6],s}function fe(){const{data:e}=g(Z);return e??null}function Z(e){return e.sprint_config}function ge(){const e=u.c(3),{data:t,isSuccess:n}=g(V),a=t??null;let s;return e[0]!==n||e[1]!==a?(s={config:a,isLoaded:n},e[0]=n,e[1]=a,e[2]=s):s=e[2],s}function V(e){return e.sprint_config}function pe(){const e=u.c(5),t=p();let n;e[0]!==t?(n=(s,o)=>t.mutate({sprint_config:s},o),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==t||e[3]!==n?(a={...t,mutate:n},e[2]=t,e[3]=n,e[4]=a):a=e[4],a}function J(){const{data:e}=g(X);return e??null}function X(e){return e.registry_config}function he(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(o,i)=>t.mutate({registry_config:o},i),a=(o,i)=>t.mutateAsync({registry_config:o},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let s;return e[3]!==t||e[4]!==n||e[5]!==a?(s={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=s):s=e[6],s}function be(){const{data:e}=g(ee);return e??null}function ee(e){return e.default_home_agents}function te(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(o,i)=>t.mutate({default_home_agents:o},i),a=(o,i)=>t.mutateAsync({default_home_agents:o},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let s;return e[3]!==t||e[4]!==n||e[5]!==a?(s={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=s):s=e[6],s}function _e(){const e=u.c(14),{org:t}=v(),n=te(),a=O();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Promise.resolve(),e[0]=s):s=e[0];const o=Q.useRef(s);let i;e[1]!==t.id?(i=y.organizationSettings(t.id),e[1]=t.id,e[2]=i):i=e[2];const l=i;let m;e[3]!==l||e[4]!==a?(m=()=>a.getQueryData(l)?.default_home_agents?.ids??[],e[3]=l,e[4]=a,e[5]=m):m=e[5];const S=m;let b;e[6]!==l||e[7]!==t.slug||e[8]!==a||e[9]!==n?(b=F=>{const I=o.current.then(async()=>{const R=a.getQueryData(l),A=F(R?.default_home_agents?.ids??[]);if(A!==null){a.setQueryData(l,h=>h&&{...h,default_home_agents:{ids:A}});try{await n.mutateAsync({ids:A}),await a.refetchQueries({queryKey:y.homeNextActions(t.slug),type:"active"})}catch(h){const P=h;throw a.setQueryData(l,R),P}}});return o.current=I.catch(ne),I},e[6]=l,e[7]=t.slug,e[8]=a,e[9]=n,e[10]=b):b=e[10];const w=b;let _;return e[11]!==w||e[12]!==S?(_={currentIds:S,apply:w},e[11]=w,e[12]=S,e[13]=_):_=e[13],_}function ne(){}function ye(){const e=u.c(3),{data:t,isPending:n}=g(ae),a=t??null;let s;return e[0]!==n||e[1]!==a?(s={mainAgentId:a,isPending:n},e[0]=n,e[1]=a,e[2]=s):s=e[2],s}function ae(e){return e.main_agent_id??null}function ve(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(o,i)=>t.mutate({main_agent_id:o},i),a=(o,i)=>t.mutateAsync({main_agent_id:o},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let s;return e[3]!==t||e[4]!==n||e[5]!==a?(s={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=s):s=e[6],s}function Se(){const e=u.c(5),{org:t}=v(),n=J();let a;e[0]!==t.id?(a=U.REGISTRY(t.id),e[0]=t.id,e[1]=a):a=e[1];const s=a;let o;return e[2]!==s||e[3]!==n?(o=i=>{if(!n)return i===s;const l=n.registries[i];return l?l.enabled:i===s},e[2]=s,e[3]=n,e[4]=o):o=e[4],o}export{ie as S,ue as a,de as b,le as c,be as d,_e as e,fe as f,ye as g,Se as h,re as i,ve as j,me as k,ce as l,J as m,ge as n,pe as o,W as p,he as q,B as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C,H as R}from"./index-
|
|
1
|
+
import{c as C,H as R}from"./index-DS_PtpmP.js";import{u as p}from"./use-connection-BJir_wda.js";import{W as a}from"./constants-_08zpzmT.js";import{m as y}from"./use-organization-settings-BZyz9Mop.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 u,H as c,av as r,K as l,z as d,p as f,e as S}from"./index-
|
|
1
|
+
import{c as u,H as c,av as r,K as l,z as d,p as f,e as S}from"./index-DS_PtpmP.js";function C(){const e=u.c(7),{org:a}=c(),n=r();let i;e[0]!==a.id?(i=l.secrets(a.id),e[0]=a.id,e[1]=i):i=e[1];let t;e[2]!==n?(t=async()=>await n.call("SECRET_LIST",{}),e[2]=n,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:o}=d(s);return o.secrets}function m(){const e=u.c(8),{org:a}=c(),n=r(),i=f();let t;e[0]!==n?(t=async y=>await n.call("SECRET_CREATE",{...y}),e[0]=n,e[1]=t):t=e[1];let s;e[2]!==a||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:l.secrets(a.id)})},e[2]=a,e[3]=i,e[4]=s):s=e[4];let o;return e[5]!==t||e[6]!==s?(o={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=o):o=e[7],S(o)}export{m as a,C as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as D,b as J,r as w,j as s,n as K}from"./index-
|
|
1
|
+
import{c as D,b as J,r as w,j as s,n as K}from"./index-DS_PtpmP.js";import{ah as q}from"./agent-icon-BRsJ64Gp.js";import{i as Y}from"./SearchMd-DVItXoZb.js";import{e as Z,d as ee,b as te,a as se}from"./dialog-CLVbCjMu.js";import{I as re}from"./input-Dsyfk4jo.js";import{L as le,M as oe,N as ie,O as Q,P as ne,Q as ce,R as ae}from"./index-CV8Bfh5R.js";const fe=12,z=new Set,F=new Set;function ue(){for(const r of F)r()}function de(r){return z.has(r)?!0:z.size>=fe?!1:(z.add(r),!0)}function X(r){z.delete(r)&&ue()}function me(r){return F.add(r),()=>{F.delete(r)}}function ve(r,e){const t=w.useRef(!1),[d,i]=w.useState(!1),o=w.useRef(null),f=w.useRef(null),c=w.useRef(null),l=w.useRef(r);l.current=r;const[a]=w.useState(()=>{const n=()=>{c.current?.(),c.current=null},u=()=>t.current?!0:de(e)?(t.current=!0,i(!0),n(),!0):!1;return v=>{if(f.current=v,o.current&&(o.current.disconnect(),o.current=null),n(),!v){t.current&&(X(e),t.current=!1,i(!1));return}queueMicrotask(()=>{if(f.current!==v)return;const x=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!u()&&!c.current&&(c.current=me(()=>{f.current===v&&u()}));return}n(),t.current&&(X(e),t.current=!1,i(!1))},{root:l.current.current,rootMargin:"160px 0px"});x.observe(v),o.current=x})}});return{ref:a,iframeActive:d}}function pe(r){const e=D.c(8),{previewUrl:t,title:d,scrollRootRef:i,slotId:o}=r,{ref:f,iframeActive:c}=ve(i,o),[l,a]=w.useState(!1);let n;e[0]!==c||e[1]!==l||e[2]!==t||e[3]!==d?(n=c?s.jsxs(s.Fragment,{children:[!l&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:s.jsx(q,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),s.jsx("iframe",{src:t,title:`Preview ${d}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>a(!0)})]}):s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(q,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=c,e[1]=l,e[2]=t,e[3]=d,e[4]=n):n=e[4];let u;return e[5]!==f||e[6]!==n?(u=s.jsx("div",{ref:f,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:n}),e[5]=f,e[6]=n,e[7]=u):u=e[7],u}function xe(r){const e=D.c(26),{entry:t,previewUrl:d,scrollRootRef:i,onSelect:o}=r,f=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let c;e[0]!==f?(c=K("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",f),e[0]=f,e[1]=c):c=e[1];let l;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==d||e[5]!==i?(l=s.jsx(pe,{previewUrl:d,title:t.title,scrollRootRef:i,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=d,e[5]=i,e[6]=l):l=e[6];let a;e[7]!==t.isSavedBlock?(a=t.isSavedBlock?{color:ne}:void 0,e[7]=t.isSavedBlock,e[8]=a):a=e[8];let n;e[9]!==a?(n=s.jsx(q,{className:"h-4 w-4 shrink-0",style:a}),e[9]=a,e[10]=n):n=e[10];let u;e[11]!==t.title?(u=s.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=u):u=e[12];let v;e[13]!==t.description?(v=t.description&&s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=v):v=e[14];let x;e[15]!==u||e[16]!==v?(x=s.jsxs("div",{className:"min-w-0 flex-1",children:[u,v]}),e[15]=u,e[16]=v,e[17]=x):x=e[17];let m;e[18]!==n||e[19]!==x?(m=s.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[n,x]}),e[18]=n,e[19]=x,e[20]=m):m=e[20];let h;return e[21]!==o||e[22]!==c||e[23]!==l||e[24]!==m?(h=s.jsxs("button",{type:"button",onClick:o,className:c,children:[l,m]}),e[21]=o,e[22]=c,e[23]=l,e[24]=m,e[25]=h):h=e[25],h}function Ne(r){const e=D.c(51),{open:t,onOpenChange:d,meta:i,decofile:o,previewBaseUrl:f,onSelect:c}=r,l=J(),[a,n]=w.useState(""),[u,v]=w.useState(t),x=w.useRef(null);t!==u&&(v(t),t&&n(""));let m,h,S,b,j,N,R,y,g,C,P;if(e[0]!==o||e[1]!==i||e[2]!==d||e[3]!==c||e[4]!==t||e[5]!==f||e[6]!==a||e[7]!==l){const W=t&&i&&o?le(i,o):[],_=i?oe(i):"",G=o?ie(o):void 0,H=new Map;if(t&&_)for(const p of W)H.set(p.resolveType,Q(f,_,p.previewBlock,G));const E=a.trim().toLowerCase(),V=E?W.filter(p=>p.title.toLowerCase().includes(E)||p.resolveType.toLowerCase().includes(E)||p.description?.toLowerCase().includes(E)):W;h=Z,C=t,P=d,m=ee,R="top-3 right-3",y="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let U;e[19]!==l?(U=l("sectionsEditor.addSectionModal.title"),e[19]=l,e[20]=U):U=e[20];let A;e[21]!==U?(A=s.jsx(te,{children:U}),e[21]=U,e[22]=A):A=e[22];let k;e[23]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Y,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=k):k=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=p=>n(p.target.value),e[24]=$):$=e[24];let B;e[25]!==l?(B=l("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=l,e[26]=B):B=e[26];let M;e[27]!==a||e[28]!==B?(M=s.jsxs("div",{className:"relative pt-2",children:[k,s.jsx(re,{value:a,onChange:$,placeholder:B,className:"h-9 pl-8"})]}),e[27]=a,e[28]=B,e[29]=M):M=e[29],e[30]!==A||e[31]!==M?(g=s.jsxs(se,{className:"shrink-0 border-b px-4 py-3 text-left",children:[A,M]}),e[30]=A,e[31]=M,e[32]=g):g=e[32],j=x,N="min-h-0 flex-1 overflow-y-auto",S="p-4",b=V.length===0?s.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l("sectionsEditor.addSectionModal.noSectionsFound")}):s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:V.map(p=>s.jsx(xe,{entry:p,scrollRootRef:x,previewUrl:H.get(p.resolveType)??Q(f,_,p.previewBlock,G),onSelect:()=>c(p)},p.resolveType))}),e[0]=o,e[1]=i,e[2]=d,e[3]=c,e[4]=t,e[5]=f,e[6]=a,e[7]=l,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=R,e[15]=y,e[16]=g,e[17]=C,e[18]=P}else m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],R=e[14],y=e[15],g=e[16],C=e[17],P=e[18];let T;e[33]!==S||e[34]!==b?(T=s.jsx("div",{className:S,children:b}),e[33]=S,e[34]=b,e[35]=T):T=e[35];let I;e[36]!==T||e[37]!==j||e[38]!==N?(I=s.jsx("div",{ref:j,className:N,children:T}),e[36]=T,e[37]=j,e[38]=N,e[39]=I):I=e[39];let L;e[40]!==m||e[41]!==I||e[42]!==R||e[43]!==y||e[44]!==g?(L=s.jsxs(m,{closeButtonClassName:R,className:y,children:[g,I]}),e[40]=m,e[41]=I,e[42]=R,e[43]=y,e[44]=g,e[45]=L):L=e[45];let O;return e[46]!==h||e[47]!==L||e[48]!==C||e[49]!==P?(O=s.jsx(h,{open:C,onOpenChange:P,children:L}),e[46]=h,e[47]=L,e[48]=C,e[49]=P,e[50]=O):O=e[50],O}function Re(r){const e=D.c(4),{previewServerUrl:t,runtime:d}=ce(r.virtualMcpId),i=d==="cms";let o;return e[0]!==i||e[1]!==r.sandboxUrl||e[2]!==t?(o=ae({sandboxUrl:r.sandboxUrl,previewServerUrl:t,fastPreviewActive:i}),e[0]=i,e[1]=r.sandboxUrl,e[2]=t,e[3]=o):o=e[3],o}export{Ne as A,Re as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,x as u}from"./index-
|
|
1
|
+
import{c as r,x as u}from"./index-DS_PtpmP.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-CUYP3xa6.js";const p=new Set(["completed","failed","requires_action"]);function q(s){const e=r.c(5),[n]=u();let t;e[0]!==n?(t=o=>{n.enableSounds&&p.has(o.data.status)&&i(c.dataUri).catch(l)},e[0]=n,e[1]=t):t=e[1];let a;e[2]!==s||e[3]!==t?(a={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=a):a=e[4],f(a)}function l(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,H as f,av as y,o as m,p as g,e as T,K as l,t as E}from"./index-
|
|
1
|
+
import{c as u,H as f,av as y,o as m,p as g,e as T,K as l,t as E}from"./index-DS_PtpmP.js";function F(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],m(a)}function K(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){E.error(e instanceof Error?e.message:"Failed to create tag")}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){E.error(e instanceof Error?e.message:"Failed to delete tag")}function M(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],m(c)}function A(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){E.error(e instanceof Error?e.message:"Failed to update member tags")}export{K as a,C as b,M as c,A as d,F as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,a5 as w,r as f}from"./index-
|
|
1
|
+
import{c as p,a5 as w,r as f}from"./index-DS_PtpmP.js";function I(M,b){const e=p.c(12),d=b===void 0?"cards":b,o=w(),g=f.useRef(o),s=M?`deco-view-mode-${M}`:"deco-view-mode";let i;e[0]!==d||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:d},e[0]=d,e[1]=s,e[2]=i):i=e[2];const[t,m]=f.useState(i);let l;e[3]!==s?(l=r=>{m(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const u=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!g.current&&o&&t==="table"&&m("cards"),g.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]!==u||e[10]!==t?(n=[t,u],e[9]=u,e[10]=t,e[11]=n):n=e[11],n}export{I as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,H as a,eN as P,bQ as p,K as L,bP as S,o as V}from"./index-
|
|
1
|
+
import{c as d,H as a,eN as P,bQ as p,K as L,bP as S,o as V}from"./index-DS_PtpmP.js";import{u as g}from"./use-mcp-client-Zz1TwEAh.js";import{S as C}from"./constants-_08zpzmT.js";function b(s){const t=d.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}=a();let o;t[2]!==i.id||t[3]!==i.slug?(o={connectionId:C,orgId:i.id,orgSlug:i.slug},t[2]=i.id,t[3]=i.slug,t[4]=o):o=t[4];const l=g(o);return P(i.id,"VIRTUAL_MCP",l,n)}function y(s){const t=d.c(3),{org:e}=a();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:C,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=g(n);return S(e.id,"VIRTUAL_MCP",s??void 0,i)}function R(s){const t=d.c(15),{org:e}=a();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:C,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=g(n);let o,l,c;t[3]!==s||t[4]!==e.id?(o=[...s].sort(),c=V,l=L.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 f=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:[]},I=new Map;for(const m of M.items)I.set(m.id,m);return I},t[8]=i,t[9]=o,t[10]=u):u=t[10];let r;return t[11]!==l||t[12]!==f||t[13]!==u?(r={queryKey:l,enabled:f,staleTime:3e4,queryFn:u},t[11]=l,t[12]=f,t[13]=u,t[14]=r):r=t[14],c(r)}function E(){const s=d.c(3),{org:t}=a();let e;s[0]!==t.id||s[1]!==t.slug?(e={connectionId:C,orgId:t.id,orgSlug:t.slug},s[0]=t.id,s[1]=t.slug,s[2]=e):e=s[2];const n=g(e);return p(t.id,"VIRTUAL_MCP",n)}export{y as a,E as b,R as c,b as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as u}from"./use-infinite-scroll-DGa9MpTS.js";import{eR as i}from"./index-DS_PtpmP.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-DGa9MpTS.js";import{eR as u,bD as n}from"./index-DS_PtpmP.js";function a(e,r){return u({...e,enabled:!0,suspense:!0,throwOnError:n},s,r)}export{a as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as V,b as q,r as z,a as O,o as Y,e as $,j as t,P as I,K as J,t as Q,B as W}from"./index-
|
|
1
|
+
import{c as V,b as q,r as z,a as O,o as Y,e as $,j as t,P as I,K as J,t as Q,B as W}from"./index-DS_PtpmP.js";import{C as G}from"./collection-table-wrapper-15zlEhjP.js";import{E as L}from"./empty-state-BF41trPY.js";import{S as H}from"./search-input-BMFjaZW8.js";import{A as X}from"./avatar-CiQyTRfd.js";import{B as D}from"./badge-Dp3mR27V.js";import{u as Z}from"./use-debounced-value-DXPF8RW0.js";import{a as K}from"./admin-fetch-CCSvjTk1.js";import{f as ee}from"./format-time-BnbuEtat.js";import{g as se}from"./get-initials-D-f_fDFw.js";import"./table-yXN-B6JM.js";import"./ArrowUp-BjteiNgF.js";import"./SearchMd-DVItXoZb.js";import"./User01-ClQH_5NK.js";import"./differenceInSeconds-NQ4PDo0z.js";function ve(){const e=V.c(58),s=q(),[r,M]=z.useState("");let N;e[0]!==r?(N=r.trim(),e[0]=r,e[1]=N):N=e[1];const a=Z(N,300),{data:R}=O.useSession(),P=R?.user?.id;let n;e[2]!==a?(n=J.deploymentAdminUsers(a),e[2]=a,e[3]=n):n=e[3];let l;e[4]!==a?(l=()=>{const i=new URLSearchParams({limit:"100"});return a&&i.set("searchValue",a),K(`/api/_admin/users?${i}`)},e[4]=a,e[5]=l):l=e[5];let y;e[6]!==n||e[7]!==l?(y={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=y):y=e[8];const{data:k,isLoading:_,isError:A}=Y(y);let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=ie,e[9]=C):C=e[9];let w;e[10]!==s?(w={mutationFn:ae,onSuccess:C,onError:i=>{Q.error(i instanceof Error?i.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=w):w=e[11];const E=$(w);let b;e[12]!==k?.users?(b=k?.users??[],e[12]=k?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=i=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(X,{url:i.image??void 0,fallback:se(i.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=i=>i.emailVerified?t.jsx(D,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(D,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:te,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==P||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:i=>t.jsx(W,{variant:"outline",size:"sm",disabled:i.id===P||E.isPending,onClick:()=>E.mutate(i.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=P,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==r||e[44]!==j?(g=t.jsx(H,{value:r,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=r,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==a||e[47]!==A||e[48]!==s?(S=A?t.jsx(L,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(L,{title:s("admin.users.noUsersFoundTitle"),description:a?s("admin.users.noUsersMatchSearch",{search:a}):s("admin.users.noUsersYet")}),e[46]=a,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(G,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(I,{children:t.jsx(I.Content,{children:t.jsx(I.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function te(e){return t.jsx("span",{className:"text-sm text-foreground",children:ee(e.createdAt)})}function ie(){window.location.href="/"}function ae(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{ve as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as K,b as Q,r as Z,j as o,n as rt,a8 as ut,ab as ht,B as tt,a9 as xt}from"./index-fZpMDfe6.js";import{w as gt,a9 as at,aL as bt}from"./agent-icon-Dt8TTBNR.js";import{i as vt}from"./ChevronRight-Bt0Ps5hy.js";import{L as yt}from"./label-DOL_dkX5.js";import{B as lt}from"./automation-runs-l52V2CDe.js";import{S as jt}from"./switch-Dd8SWBtK.js";import{V as Tt}from"./view-mode-toggle-rkJlH4vl.js";import{bR as ct,bS as mt,bT as Nt,bU as _t,bV as kt,bW as U,bX as wt}from"./index-D9nsJyXn.js";import"./AlertCircle-DL3U1yq7.js";import"./Tool01-D15DzDIB.js";import"./ArrowUp-DUua93WQ.js";import"./ArrowLeft-BDtQVDZJ.js";import"./Tool02-DcVuymPV.js";import"./XCircle-vpb-OIYV.js";import"./TrendUp01-BBA3UF71.js";import"./ZapSquare-B52zBMI0.js";import"./Users03-CeFJXyBc.js";import"./UserSquare-DNzPXyDT.js";import"./CheckCircle-Ccs86bUg.js";import"./Check-CFdAuLVR.js";import"./ChevronDown-Bh9AZv82.js";import"./ChevronSelectorVertical-CbP69kXl.js";import"./ChevronUp-CYbM4ZwP.js";import"./DotsVertical-C5qhPHKZ.js";import"./Stars02-BEZaBHTc.js";import"./Copy01-CKmyRUyl.js";import"./CreditCard01-DXJKk1Wt.js";import"./Download01-DZdiDQUS.js";import"./Settings02-BXfVk1mb.js";import"./Eye-DFHNhYtx.js";import"./FilterLines-C01-F8gV.js";import"./Share07-DRhhhSu7.js";import"./Globe01-qBOiIpcJ.js";import"./Globe04-DyPo8R4R.js";import"./SwitchHorizontal01-BPoIdNhd.js";import"./HardDrive-DMA6WwJi.js";import"./Key01-CQ2Pckpa.js";import"./LinkExternal01-CDWxDAhW.js";import"./LockUnlocked01-BJDlnHNP.js";import"./LogOut01-DYTwrIyB.js";import"./Monitor01-CW9D8oQR.js";import"./Sun-CxlEqCDi.js";import"./Palette-CYMwYnzJ.js";import"./Play-D5VBgg81.js";import"./Plus-DJBOKCXM.js";import"./SearchLg-D05XfMH4.js";import"./SearchMd-Bvk6cmtM.js";import"./Shield01--vYJckXn.js";import"./Stars01-Cfn7XpKF.js";import"./Trash01-rd-vb1MA.js";import"./Upload01-CURnTiOx.js";import"./User01-CGWss5jM.js";import"./Users01-B043Q3B_.js";import"./XClose-Ca1B07wN.js";import"./Zap-DoBPpnDg.js";import"./select-D9OtHuoQ.js";import"./useInfiniteQuery-D6nR9UJf.js";import"./use-infinite-scroll-C3woVgJJ.js";import"./use-connection-DJ5BvXkS.js";import"./use-mcp-client-BixLZLmc.js";import"./constants-_08zpzmT.js";import"./auth-Dff1xvcy.js";import"./use-virtual-mcp-CxECG99q.js";import"./table-B28U6WCV.js";import"./empty-state-CMCoRH7w.js";import"./use-members-DqBCB9wB.js";import"./use-org-auth-client-Bm7ydyvS.js";import"./use-clock-tick-BIn9fxJl.js";import"./use-automations-BeKjYp7F.js";import"./useSuspenseInfiniteQuery-BfIWoPo8.js";import"./avatar-CKLVepem.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BHeXFKUG.js";import"./dialog-BVOhf6JL.js";import"./tab-id-W4sfonX1.js";import"./hooks-CtnSCLIe.js";import"./decopilot-sse-pool-0EWVughz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-IctGRlpl.js";import"./session-runtime-wVXsCwcJ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-bDkOAByr.js";import"./use-decopilot-events-U00f_DNo.js";import"./use-organization-settings-B4nKr0f2.js";import"./monaco-editor-DOnHAZIR.js";import"./spinner-DnK6LAO-.js";import"./types-Da-6shE5.js";import"./shell-layout-0_Y9WTC5.js";import"./required-auth-layout-XqEbPK8M.js";import"./use-org-sso-9a_THghN.js";import"./integration-icon-DKqG-Mpx.js";import"./use-navigate-to-agent-COcz3Nee.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./chart-mQfq8dm_.js";import"./index-DTM9lZbn.js";import"./form-DJoSkHk7.js";import"./input-v4c8p5Ob.js";import"./file-type-icon-DQDAdTqu.js";import"./drawer-ygpURzdE.js";import"./collection-search-BcNT9wqV.js";import"./tabs-CNvz9wkq.js";import"./toggle-group-B1ujv-Tj.js";import"./use-commerce-diagnostic-UqRl5JGR.js";import"./popover-DSZP75un.js";import"./self-tool-result-C2SaSBOS.js";import"./alert-dialog-COKsRPdB.js";import"./extract-connection-data-BRWpOoZu.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-d2xvAJAf.js";import"./authenticate-and-persist-oauth-BpXFlbw1.js";import"./mcp-oauth-MtFdjicX.js";import"./track-Cth4u5b_.js";import"./toolbar-Cos-gS1a.js";import"./github-repo-picker-CPPjWOCA.js";import"./use-mcp-tools-DhYUR3cu.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-DLmi_xFL.js";import"./use-registry-connections-C7LyRS1M.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BmWik9O5.js";import"./connection-form-helpers-Bd1zJpcE.js";import"./collection-tabs-QBx9fiO8.js";import"./badge-B2mtA9Oj.js";import"./command-Bciip2fK.js";import"./index-BJiFP4oP.js";import"./select-model-pYcHYqNY.js";import"./checkbox-DjvUsSry.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-CnXEidEU.js";import"./dropdown-menu-BpdWhSA7.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DFis4MWx.js";import"./use-file-configs-ivKLtwVT.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-BEoE5zu3.js";import"./search-input-4SLm_iMt.js";import"./index-CVkGlHYs.js";import"./use-secrets-Chh3ojOY.js";import"./AreaChart-DTwkuP_y.js";import"./task-key-CTiJU5_h.js";import"./sprints-DTKQS9tP.js";import"./use-tags-DSiXReOW.js";import"./get-initials-D-f_fDFw.js";import"./automation-list-row-BcptvIDe.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-B_4SIVWY.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Mt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Lt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Rt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e,n=typeof t=="string",s=typeof r=="string";if(!n&&!s)return null;const i=n?new Date(t):Ct,a=s?new Date(r):Mt;return Number.isNaN(i.getTime())||Number.isNaN(a.getTime())||n&&s&&a.getTime()<=i.getTime()?null:{start:i,end:a,openStart:!n,openEnd:!s}}function pt(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(Et.has(r)){const n=Rt(e);n&&t.push(n);return}if(St.has(r)){const n=e.matchers;if(Array.isArray(n))for(const s of n)pt(s,t)}}}function Dt(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const r=e.variants;return Array.isArray(r)}function Ot(e){if(typeof e=="string"){const c=e.trim();if(c.length===0)return null;try{const m=new URL(c).pathname.split("/").filter(Boolean),p=m[m.length-1];if(p)return decodeURIComponent(p)}catch{}return c.length>80?`${c.slice(0,77)}…`:c}if(!e||typeof e!="object")return null;const t=e,r=t.config,s=t.desktop?.media,i=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,s?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const c of i)if(typeof c=="string"&&c.trim().length>0)return c.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];typeof n=="number"?t.length>0?t[t.length-1]+=`[${n}]`:t.push(`[${n}]`):t.push(n)}return t.join(" · ")}function J(e,t,r,n,s){if(Dt(e)){const i=e.variants,a=e.__resolveType,c=$t.test(a)?"":Pt(n);i.forEach((l,m)=>{if(!l||typeof l!="object")return;const p=l,h=[];if(pt(p.rule,h),h.length===0)return;const g=Ot(p.value)??(c||r);for(const u of h)s.push({blockKey:t,blockLabel:r,innerPath:c,variantIndex:m,start:u.start,end:u.end,openStart:u.openStart,openEnd:u.openEnd,label:g,flagResolveType:a})});for(let l=0;l<i.length;l++){const m=i[l];m&&typeof m=="object"&&J(m.value,t,r,[...n,"variants",l,"value"],s)}return}if(Array.isArray(e)){for(let i=0;i<e.length;i++)J(e[i],t,r,[...n,i],s);return}if(e&&typeof e=="object")for(const[i,a]of Object.entries(e))i!=="__resolveType"&&J(a,t,r,[...n,i],s)}function Vt(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))J(n,r,Lt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function It(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,s)=>{const i=s*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${i})`,text:"white",border:`oklch(0.50 0.14 ${i})`})}),r}const Bt={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function dt(e,t){return e.get(t)??Bt}const nt=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Ht(e,t){const r=e.openStart?t("sandbox.variantCalendar.always"):nt.format(e.start),n=e.openEnd?t("sandbox.variantCalendar.ongoing"):nt.format(e.end);return`${r} → ${n}`}function Ft(e){const t=K.c(18),{variant:r}=e,n=Q();let s;t[0]!==r.blockLabel?(s=o.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=s):s=t[1];let i;t[2]!==r.innerPath?(i=r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=i):i=t[3];let a;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(a=r.label!==r.blockLabel&&r.label!==r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=a):a=t[7];let c;t[8]!==n||t[9]!==r?(c=Ht(r,n),t[8]=n,t[9]=r,t[10]=c):c=t[10];let l;t[11]!==c?(l=o.jsx("div",{className:"mt-1",children:c}),t[11]=c,t[12]=l):l=t[12];let m;return t[13]!==s||t[14]!==i||t[15]!==a||t[16]!==l?(m=o.jsx(xt,{children:o.jsxs("div",{className:"text-xs",children:[s,i,a,l]})}),t[13]=s,t[14]=i,t[15]=a,t[16]=l,t[17]=m):m=t[17],m}const ot=16;function zt(e,t){const r=e?"transparent":"#000 0",n=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${r}, #000 ${ot}px, #000 calc(100% - ${ot}px), ${n})`}function ft(e){const t=K.c(26),{variant:r,color:n,style:s,children:i,fadeStart:a,fadeEnd:c}=e,l=a===void 0?!1:a,m=c===void 0?!1:c;let p;t[0]!==m||t[1]!==l?(p=zt(l,m),t[0]=m,t[1]=l,t[2]=p):p=t[2];const h=p;let f;t[3]!==l?(f=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=f):f=t[4];let g;t[5]!==m?(g=m&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=m,t[6]=g):g=t[6];let u;t[7]!==h?(u=h&&{maskImage:h,WebkitMaskImage:h},t[7]=h,t[8]=u):u=t[8];let x;t[9]!==n.bg||t[10]!==n.text||t[11]!==s||t[12]!==f||t[13]!==g||t[14]!==u?(x={background:n.bg,color:n.text,borderRadius:4,...f,...g,...u,...s},t[9]=n.bg,t[10]=n.text,t[11]=s,t[12]=f,t[13]=g,t[14]=u,t[15]=x):x=t[15];let b;t[16]!==i?(b=o.jsx("span",{className:"truncate",children:i}),t[16]=i,t[17]=b):b=t[17];let E;t[18]!==x||t[19]!==b?(E=o.jsx(ut,{asChild:!0,children:o.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:x,children:b})}),t[18]=x,t[19]=b,t[20]=E):E=t[20];let T;t[21]!==r?(T=o.jsx(Ft,{variant:r}),t[21]=r,t[22]=T):T=t[22];let d;return t[23]!==T||t[24]!==E?(d=o.jsxs(ht,{children:[E,T]}),t[23]=T,t[24]=E,t[25]=d):d=t[25],d}function Kn(e){const t=K.c(72),{decofile:r}=e,n=Q(),[s,i]=Z.useState("calendar"),[a,c]=Z.useState(Kt),[l,m]=Z.useState(!1);let p,h,f;if(t[0]!==r||t[1]!==l){const V=Vt(r);p=V.filter(Ut).length,f=l?V:V.filter(Gt),h=It(f.map(Wt)),t[0]=r,t[1]=l,t[2]=p,t[3]=h,t[4]=f}else p=t[2],h=t[3],f=t[4];const g=h;let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=()=>c(mt(new Date)),t[5]=u):u=t[5];const x=u;let b;t[6]!==s?(b=()=>c(V=>s==="calendar"?U(V,-1):U(V,-3)),t[6]=s,t[7]=b):b=t[7];const E=b;let T;t[8]!==s?(T=()=>c(V=>s==="calendar"?U(V,1):U(V,3)),t[8]=s,t[9]=T):T=t[9];const d=T;let v;t[10]!==n?(v=n("sandbox.variantCalendar.today"),t[10]=n,t[11]=v):v=t[11];let y;t[12]!==v?(y=o.jsx(tt,{variant:"outline",size:"sm",onClick:x,children:v}),t[12]=v,t[13]=y):y=t[13];let N;t[14]!==n?(N=n("sandbox.variantCalendar.previous"),t[14]=n,t[15]=N):N=t[15];let A;t[16]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(gt,{size:16}),t[16]=A):A=t[16];let _;t[17]!==E||t[18]!==N?(_=o.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:E,"aria-label":N,children:A}),t[17]=E,t[18]=N,t[19]=_):_=t[19];let k;t[20]!==n?(k=n("sandbox.variantCalendar.next"),t[20]=n,t[21]=k):k=t[21];let C;t[22]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(vt,{size:16}),t[22]=C):C=t[22];let $;t[23]!==d||t[24]!==k?($=o.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:d,"aria-label":k,children:C}),t[23]=d,t[24]=k,t[25]=$):$=t[25];const L=ct[a.getMonth()];let M;t[26]!==a?(M=a.getFullYear(),t[26]=a,t[27]=M):M=t[27];let w;t[28]!==L||t[29]!==M?(w=o.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[L," ",M]}),t[28]=L,t[29]=M,t[30]=w):w=t[30];let j;t[31]!==$||t[32]!==w||t[33]!==y||t[34]!==_?(j=o.jsxs("div",{className:"flex items-center gap-2",children:[y,_,$,w]}),t[31]=$,t[32]=w,t[33]=y,t[34]=_,t[35]=j):j=t[35];let R;t[36]!==p||t[37]!==l||t[38]!==n?(R=p>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(jt,{id:"show-ongoing",checked:l,onCheckedChange:m}),o.jsx(yt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:n("sandbox.variantCalendar.showOngoing",{count:p})})]}),t[36]=p,t[37]=l,t[38]=n,t[39]=R):R=t[39];let H;t[40]===Symbol.for("react.memo_cache_sentinel")?(H=o.jsx(at,{}),t[40]=H):H=t[40];let I;t[41]!==n?(I=n("sandbox.variantCalendar.calendarMode"),t[41]=n,t[42]=I):I=t[42];let S;t[43]!==I?(S={value:"calendar",icon:H,label:I},t[43]=I,t[44]=S):S=t[44];let F;t[45]===Symbol.for("react.memo_cache_sentinel")?(F=o.jsx(bt,{}),t[45]=F):F=t[45];let D;t[46]!==n?(D=n("sandbox.variantCalendar.timelineMode"),t[46]=n,t[47]=D):D=t[47];let O;t[48]!==D?(O={value:"timeline",icon:F,label:D},t[48]=D,t[49]=O):O=t[49];let P;t[50]!==S||t[51]!==O?(P=[S,O],t[50]=S,t[51]=O,t[52]=P):P=t[52];let B;t[53]!==P||t[54]!==s?(B=o.jsx(Tt,{value:s,onValueChange:i,options:P}),t[53]=P,t[54]=s,t[55]=B):B=t[55];let z;t[56]!==R||t[57]!==B?(z=o.jsxs("div",{className:"flex items-center gap-4",children:[R,B]}),t[56]=R,t[57]=B,t[58]=z):z=t[58];let W;t[59]!==j||t[60]!==z?(W=o.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,z]}),t[59]=j,t[60]=z,t[61]=W):W=t[61];let G;t[62]!==g||t[63]!==a||t[64]!==p||t[65]!==l||t[66]!==f||t[67]!==s?(G=f.length===0?o.jsx(Yt,{hiddenOngoing:l?0:p}):s==="calendar"?o.jsx(qt,{monthStart:a,variants:f,colorMap:g}):o.jsx(te,{monthStart:a,variants:f,colorMap:g}),t[62]=g,t[63]=a,t[64]=p,t[65]=l,t[66]=f,t[67]=s,t[68]=G):G=t[68];let X;return t[69]!==W||t[70]!==G?(X=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[W,G]}),t[69]=W,t[70]=G,t[71]=X):X=t[71],X}function Wt(e){return e.blockKey}function Gt(e){return!e.openEnd}function Ut(e){return e.openEnd}function Kt(){return mt(new Date)}function Yt(e){const t=K.c(4),{hiddenOngoing:r}=e,n=r===void 0?0:r,s=Q();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(at,{size:24,className:"text-muted-foreground/60"}),t[0]=i):i=t[0];let a;return t[1]!==n||t[2]!==s?(a=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:[i,n>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noDatedVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.hiddenOngoingVariants",{count:n})})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noScheduledVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=n,t[2]=s,t[3]=a):a=t[3],a}const et=20,it=2,st=28,Xt=6;function qt(e){const t=K.c(17),{monthStart:r,variants:n,colorMap:s}=e;let i,a,c,l,m;if(t[0]!==s||t[1]!==r||t[2]!==n){const f=Nt(r),g=_t(new Date);i=lt,m="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:wt.map(Qt)}),t[8]=c):c=t[8],l=f.map((u,x)=>{const b=kt(u,n),E=b.reduce(Jt,0),T=st+E*(et+it)+8;return o.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[u.map((d,v)=>{const y=d.getMonth()===r.getMonth(),N=d.getTime()===g.getTime();return o.jsx("div",{className:rt("border-r last:border-r-0 px-2 pt-1.5 text-xs",y?"bg-background":"bg-muted/30 text-muted-foreground"),children:o.jsx("span",{className:rt("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:d.getDate()})},v)}),b.map((d,v)=>{const y=dt(s,d.variant.blockKey),N=st+d.lane*(et+it),A=d.leftUnits/7*100,_=d.widthUnits/7*100,k=d.variant.openStart&&x===0,C=d.variant.openEnd&&x===f.length-1;return o.jsxs(ft,{variant:d.variant,color:y,fadeStart:k,fadeEnd:C,style:{top:N,left:`calc(${A}% + 2px)`,width:`calc(${_}% - 4px)`,minWidth:Xt,height:et},children:[d.variant.blockLabel,d.variant.label!==d.variant.blockLabel&&o.jsxs("span",{className:"opacity-70",children:[" · ",d.variant.label]})]},`${x}-${v}`)})]},x)}),t[0]=s,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=c,t[6]=l,t[7]=m}else i=t[3],a=t[4],c=t[5],l=t[6],m=t[7];let p;t[9]!==a||t[10]!==c||t[11]!==l?(p=o.jsxs("div",{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=p):p=t[12];let h;return t[13]!==i||t[14]!==m||t[15]!==p?(h=o.jsx(i,{className:m,children:p}),t[13]=i,t[14]=m,t[15]=p,t[16]=h):h=t[16],h}function Jt(e,t){return Math.max(e,t.lane+1)}function Qt(e){return o.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const q=4,Zt=32,Y=240;function te(e){const t=K.c(23),{monthStart:r,variants:n,colorMap:s}=e,i=r,a=U(r,q),c=new Date,l=new Map;for(const w of n){const j=l.get(w.blockKey)??[];j.push(w),l.set(w.blockKey,j)}const m=Array.from(l.entries()).sort(ne),p=a.getTime()-i.getTime(),h=w=>(Math.max(i.getTime(),Math.min(a.getTime(),w.getTime()))-i.getTime())/p*100;let f;t[0]!==i?(f=(w,j)=>U(i,j),t[0]=i,t[1]=f):f=t[1];const g=Array.from({length:q},f),u=c.getTime()>=i.getTime()&&c.getTime()<=a.getTime()?h(c):null,x=Q(),b=lt,E="flex-1 min-h-0",T="min-w-[900px] relative";let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={width:Y},t[2]=d):d=t[2];let v;t[3]!==x?(v=x("sandbox.variantCalendar.variantBlock"),t[3]=x,t[4]=v):v=t[4];let y;t[5]!==v?(y=o.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:d,children:v}),t[5]=v,t[6]=y):y=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},t[7]=N):N=t[7];const A=g.map(re);let _;t[8]!==A?(_=o.jsx("div",{className:"flex-1 grid",style:N,children:A}),t[8]=A,t[9]=_):_=t[9];let k;t[10]!==y||t[11]!==_?(k=o.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[y,_]}),t[10]=y,t[11]=_,t[12]=k):k=t[12];let C;t[13]!==x||t[14]!==u?(C=u!==null&&o.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${Y}px + (100% - ${Y}px) * ${u} / 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:x("sandbox.variantCalendar.todayLabel")})}),t[13]=x,t[14]=u,t[15]=C):C=t[15];const $=m.map(w=>{const[j,R]=w,H=dt(s,j),I=R[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:Y},children:I})}),R.map((S,F)=>o.jsxs("div",{className:"flex border-b items-center",style:{height:Zt},children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:Y},children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:H.bg}}),o.jsx("span",{className:"truncate text-foreground/80",children:S.label})]}),o.jsxs("div",{className:"relative flex-1 h-full",children:[o.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},children:g.map(ee)}),(()=>{const D=Math.max(S.start.getTime(),i.getTime()),O=Math.min(S.end.getTime(),a.getTime());if(O<=D)return null;const P=h(new Date(D)),B=h(new Date(O))-P;return o.jsx(ft,{variant:S,color:H,fadeStart:S.openStart,fadeEnd:S.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${P}%`,width:`calc(${B}% - 2px)`,height:22},children:S.label})})()]})]},F))]},j)});let L;t[16]!==k||t[17]!==C||t[18]!==$?(L=o.jsxs("div",{className:T,children:[k,C,$]}),t[16]=k,t[17]=C,t[18]=$,t[19]=L):L=t[19];let M;return t[20]!==b||t[21]!==L?(M=o.jsx(b,{className:E,children:L}),t[20]=b,t[21]=L,t[22]=M):M=t[22],M}function ee(e,t){return o.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function re(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:[ct[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function ne(e,t){return e[0].localeCompare(t[0])}export{Kn as VariantCalendar};
|
|
1
|
+
import{c as K,b as Q,r as Z,j as o,n as rt,a8 as ut,ab as ht,B as tt,a9 as xt}from"./index-DS_PtpmP.js";import{w as gt,a9 as at,aL as bt}from"./agent-icon-BRsJ64Gp.js";import{i as vt}from"./ChevronRight-DB1jERJP.js";import{L as yt}from"./label-AZH9h-dP.js";import{B as lt}from"./automation-runs-BQpimZeU.js";import{S as jt}from"./switch-CPOt6c8D.js";import{V as Tt}from"./view-mode-toggle-DYMYSHNc.js";import{bR as ct,bS as mt,bT as Nt,bU as _t,bV as kt,bW as U,bX as wt}from"./index-CV8Bfh5R.js";import"./AlertCircle-C8ZNKM0T.js";import"./Tool01-K1KtrUp3.js";import"./ArrowUp-BjteiNgF.js";import"./ArrowLeft-C4S3t4gh.js";import"./Tool02-CaMOVLUq.js";import"./XCircle-qXvFFF3a.js";import"./TrendUp01-Cpu4_O9X.js";import"./ZapSquare-B8eYKtXE.js";import"./Users03-C1f0X_bD.js";import"./UserSquare-DtGKXF0N.js";import"./CheckCircle-Ds0VlJAl.js";import"./Check-7fxTQqwV.js";import"./ChevronDown-DC3VmpPs.js";import"./ChevronSelectorVertical-B9rG_ZYr.js";import"./ChevronUp-DklUcnpq.js";import"./DotsVertical-CtEAbV8O.js";import"./Stars02-DTCJxH0_.js";import"./Copy01-0rsYyxBd.js";import"./CreditCard01-C02kJIQ-.js";import"./Download01-B_W2m-uX.js";import"./Settings02-Bvo1tVwA.js";import"./Eye-CCl0QwVV.js";import"./FilterLines-v44MczT5.js";import"./Share07-3Y0P_W3_.js";import"./Globe01-Dr2wIPy6.js";import"./Globe04-BlbLK8Qh.js";import"./SwitchHorizontal01-CQZ9t4Uh.js";import"./HardDrive-DKQRwLSP.js";import"./Key01-kpUUZaqy.js";import"./LinkExternal01-NyjdMVf7.js";import"./LockUnlocked01-DsKz0Xl2.js";import"./LogOut01-Dd8QdhEu.js";import"./Monitor01-CCXNZQlH.js";import"./Sun-DBnfC6xb.js";import"./Palette-BffjPXio.js";import"./Play-D8AheaUt.js";import"./Plus-DfL6u6I_.js";import"./SearchLg-D1p_gJI8.js";import"./SearchMd-DVItXoZb.js";import"./Shield01-C4putjAN.js";import"./Stars01-ClK-g0zk.js";import"./Trash01-Hh3vb-pV.js";import"./Upload01-PO1Z12J3.js";import"./User01-ClQH_5NK.js";import"./Users01-Bvqsn2Z0.js";import"./XClose-F4_KA-E6.js";import"./Zap-DK06ViId.js";import"./select-v0HyS5wV.js";import"./useInfiniteQuery-DrLMltTg.js";import"./use-infinite-scroll-DGa9MpTS.js";import"./use-connection-BJir_wda.js";import"./use-mcp-client-Zz1TwEAh.js";import"./constants-_08zpzmT.js";import"./auth-BjDvWFq6.js";import"./use-virtual-mcp-BHOLpD1P.js";import"./table-yXN-B6JM.js";import"./empty-state-BF41trPY.js";import"./use-members--D0gY-Nz.js";import"./use-org-auth-client-C8dt2CEh.js";import"./use-clock-tick-BuVoJTdT.js";import"./use-automations-DWv6iLeU.js";import"./useSuspenseInfiniteQuery-bgdhkmFx.js";import"./avatar-CiQyTRfd.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Ddcpb0Jm.js";import"./dialog-CLVbCjMu.js";import"./tab-id-BOj9dZWT.js";import"./hooks-DlPXzzl8.js";import"./decopilot-sse-pool-B2gldwFf.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-_CA_JeeY.js";import"./session-runtime-wVXsCwcJ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-DAYMp9NI.js";import"./use-decopilot-events-CUYP3xa6.js";import"./use-organization-settings-BZyz9Mop.js";import"./monaco-editor-CEXQCwfP.js";import"./spinner-Dzoa8exR.js";import"./types-CE4AuZSY.js";import"./shell-layout-Ca7ET_6R.js";import"./required-auth-layout-C8K6T2Dl.js";import"./use-org-sso-DAANUxzR.js";import"./integration-icon-DQzHhbi_.js";import"./use-navigate-to-agent-BTDz1KOs.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./chart-56471C1Y.js";import"./index-B_Ad5QPQ.js";import"./form-BI3-Eb2L.js";import"./input-Dsyfk4jo.js";import"./file-type-icon-wuRfMh_5.js";import"./drawer-Ckbm2CWJ.js";import"./collection-search-Bd6xu3h9.js";import"./tabs-DMoGi1te.js";import"./toggle-group-5omFh11U.js";import"./use-commerce-diagnostic-KLE4UXiE.js";import"./popover-BRZicoZW.js";import"./self-tool-result-r1jsmu7J.js";import"./alert-dialog-C6uvTNV5.js";import"./extract-connection-data-A9qAyYQA.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-DXPF8RW0.js";import"./authenticate-and-persist-oauth-CfcfVqDI.js";import"./mcp-oauth-CV7iuGWl.js";import"./track-B8qKGWO9.js";import"./toolbar-DORhO8If.js";import"./github-repo-picker-BMkV5srU.js";import"./use-mcp-tools-CXwtpaPy.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-DXUN0HbG.js";import"./use-registry-connections-DrNpncD0.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-CegtzxU_.js";import"./connection-form-helpers-Dw_uRR_o.js";import"./collection-tabs-3ta98PDW.js";import"./badge-Dp3mR27V.js";import"./command-pFth6-af.js";import"./index-B1veCTx1.js";import"./select-model-DbrnwWTj.js";import"./checkbox-C1bUrPvW.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-BKUYovMU.js";import"./dropdown-menu-D2aUCLYk.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CjE1Nwyt.js";import"./use-file-configs-BZNx7FRl.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-DYJOZB4t.js";import"./search-input-BMFjaZW8.js";import"./index-C2XLHMiw.js";import"./use-secrets-XCXR_vh8.js";import"./AreaChart-BYK2gWYF.js";import"./task-key-C2W_oYAM.js";import"./sprints-BDnw_QJc.js";import"./use-tags-CtHBcu1c.js";import"./get-initials-D-f_fDFw.js";import"./automation-list-row-BO2X7Ov7.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-BMPkdDGr.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Mt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Lt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Rt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e,n=typeof t=="string",s=typeof r=="string";if(!n&&!s)return null;const i=n?new Date(t):Ct,a=s?new Date(r):Mt;return Number.isNaN(i.getTime())||Number.isNaN(a.getTime())||n&&s&&a.getTime()<=i.getTime()?null:{start:i,end:a,openStart:!n,openEnd:!s}}function pt(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(Et.has(r)){const n=Rt(e);n&&t.push(n);return}if(St.has(r)){const n=e.matchers;if(Array.isArray(n))for(const s of n)pt(s,t)}}}function Dt(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const r=e.variants;return Array.isArray(r)}function Ot(e){if(typeof e=="string"){const c=e.trim();if(c.length===0)return null;try{const m=new URL(c).pathname.split("/").filter(Boolean),p=m[m.length-1];if(p)return decodeURIComponent(p)}catch{}return c.length>80?`${c.slice(0,77)}…`:c}if(!e||typeof e!="object")return null;const t=e,r=t.config,s=t.desktop?.media,i=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,s?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const c of i)if(typeof c=="string"&&c.trim().length>0)return c.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];typeof n=="number"?t.length>0?t[t.length-1]+=`[${n}]`:t.push(`[${n}]`):t.push(n)}return t.join(" · ")}function J(e,t,r,n,s){if(Dt(e)){const i=e.variants,a=e.__resolveType,c=$t.test(a)?"":Pt(n);i.forEach((l,m)=>{if(!l||typeof l!="object")return;const p=l,h=[];if(pt(p.rule,h),h.length===0)return;const g=Ot(p.value)??(c||r);for(const u of h)s.push({blockKey:t,blockLabel:r,innerPath:c,variantIndex:m,start:u.start,end:u.end,openStart:u.openStart,openEnd:u.openEnd,label:g,flagResolveType:a})});for(let l=0;l<i.length;l++){const m=i[l];m&&typeof m=="object"&&J(m.value,t,r,[...n,"variants",l,"value"],s)}return}if(Array.isArray(e)){for(let i=0;i<e.length;i++)J(e[i],t,r,[...n,i],s);return}if(e&&typeof e=="object")for(const[i,a]of Object.entries(e))i!=="__resolveType"&&J(a,t,r,[...n,i],s)}function Vt(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))J(n,r,Lt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function It(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,s)=>{const i=s*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${i})`,text:"white",border:`oklch(0.50 0.14 ${i})`})}),r}const Bt={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function dt(e,t){return e.get(t)??Bt}const nt=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Ht(e,t){const r=e.openStart?t("sandbox.variantCalendar.always"):nt.format(e.start),n=e.openEnd?t("sandbox.variantCalendar.ongoing"):nt.format(e.end);return`${r} → ${n}`}function Ft(e){const t=K.c(18),{variant:r}=e,n=Q();let s;t[0]!==r.blockLabel?(s=o.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=s):s=t[1];let i;t[2]!==r.innerPath?(i=r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=i):i=t[3];let a;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(a=r.label!==r.blockLabel&&r.label!==r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=a):a=t[7];let c;t[8]!==n||t[9]!==r?(c=Ht(r,n),t[8]=n,t[9]=r,t[10]=c):c=t[10];let l;t[11]!==c?(l=o.jsx("div",{className:"mt-1",children:c}),t[11]=c,t[12]=l):l=t[12];let m;return t[13]!==s||t[14]!==i||t[15]!==a||t[16]!==l?(m=o.jsx(xt,{children:o.jsxs("div",{className:"text-xs",children:[s,i,a,l]})}),t[13]=s,t[14]=i,t[15]=a,t[16]=l,t[17]=m):m=t[17],m}const ot=16;function zt(e,t){const r=e?"transparent":"#000 0",n=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${r}, #000 ${ot}px, #000 calc(100% - ${ot}px), ${n})`}function ft(e){const t=K.c(26),{variant:r,color:n,style:s,children:i,fadeStart:a,fadeEnd:c}=e,l=a===void 0?!1:a,m=c===void 0?!1:c;let p;t[0]!==m||t[1]!==l?(p=zt(l,m),t[0]=m,t[1]=l,t[2]=p):p=t[2];const h=p;let f;t[3]!==l?(f=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=f):f=t[4];let g;t[5]!==m?(g=m&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=m,t[6]=g):g=t[6];let u;t[7]!==h?(u=h&&{maskImage:h,WebkitMaskImage:h},t[7]=h,t[8]=u):u=t[8];let x;t[9]!==n.bg||t[10]!==n.text||t[11]!==s||t[12]!==f||t[13]!==g||t[14]!==u?(x={background:n.bg,color:n.text,borderRadius:4,...f,...g,...u,...s},t[9]=n.bg,t[10]=n.text,t[11]=s,t[12]=f,t[13]=g,t[14]=u,t[15]=x):x=t[15];let b;t[16]!==i?(b=o.jsx("span",{className:"truncate",children:i}),t[16]=i,t[17]=b):b=t[17];let E;t[18]!==x||t[19]!==b?(E=o.jsx(ut,{asChild:!0,children:o.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:x,children:b})}),t[18]=x,t[19]=b,t[20]=E):E=t[20];let T;t[21]!==r?(T=o.jsx(Ft,{variant:r}),t[21]=r,t[22]=T):T=t[22];let d;return t[23]!==T||t[24]!==E?(d=o.jsxs(ht,{children:[E,T]}),t[23]=T,t[24]=E,t[25]=d):d=t[25],d}function Kn(e){const t=K.c(72),{decofile:r}=e,n=Q(),[s,i]=Z.useState("calendar"),[a,c]=Z.useState(Kt),[l,m]=Z.useState(!1);let p,h,f;if(t[0]!==r||t[1]!==l){const V=Vt(r);p=V.filter(Ut).length,f=l?V:V.filter(Gt),h=It(f.map(Wt)),t[0]=r,t[1]=l,t[2]=p,t[3]=h,t[4]=f}else p=t[2],h=t[3],f=t[4];const g=h;let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=()=>c(mt(new Date)),t[5]=u):u=t[5];const x=u;let b;t[6]!==s?(b=()=>c(V=>s==="calendar"?U(V,-1):U(V,-3)),t[6]=s,t[7]=b):b=t[7];const E=b;let T;t[8]!==s?(T=()=>c(V=>s==="calendar"?U(V,1):U(V,3)),t[8]=s,t[9]=T):T=t[9];const d=T;let v;t[10]!==n?(v=n("sandbox.variantCalendar.today"),t[10]=n,t[11]=v):v=t[11];let y;t[12]!==v?(y=o.jsx(tt,{variant:"outline",size:"sm",onClick:x,children:v}),t[12]=v,t[13]=y):y=t[13];let N;t[14]!==n?(N=n("sandbox.variantCalendar.previous"),t[14]=n,t[15]=N):N=t[15];let A;t[16]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(gt,{size:16}),t[16]=A):A=t[16];let _;t[17]!==E||t[18]!==N?(_=o.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:E,"aria-label":N,children:A}),t[17]=E,t[18]=N,t[19]=_):_=t[19];let k;t[20]!==n?(k=n("sandbox.variantCalendar.next"),t[20]=n,t[21]=k):k=t[21];let C;t[22]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(vt,{size:16}),t[22]=C):C=t[22];let $;t[23]!==d||t[24]!==k?($=o.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:d,"aria-label":k,children:C}),t[23]=d,t[24]=k,t[25]=$):$=t[25];const L=ct[a.getMonth()];let M;t[26]!==a?(M=a.getFullYear(),t[26]=a,t[27]=M):M=t[27];let w;t[28]!==L||t[29]!==M?(w=o.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[L," ",M]}),t[28]=L,t[29]=M,t[30]=w):w=t[30];let j;t[31]!==$||t[32]!==w||t[33]!==y||t[34]!==_?(j=o.jsxs("div",{className:"flex items-center gap-2",children:[y,_,$,w]}),t[31]=$,t[32]=w,t[33]=y,t[34]=_,t[35]=j):j=t[35];let R;t[36]!==p||t[37]!==l||t[38]!==n?(R=p>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(jt,{id:"show-ongoing",checked:l,onCheckedChange:m}),o.jsx(yt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:n("sandbox.variantCalendar.showOngoing",{count:p})})]}),t[36]=p,t[37]=l,t[38]=n,t[39]=R):R=t[39];let H;t[40]===Symbol.for("react.memo_cache_sentinel")?(H=o.jsx(at,{}),t[40]=H):H=t[40];let I;t[41]!==n?(I=n("sandbox.variantCalendar.calendarMode"),t[41]=n,t[42]=I):I=t[42];let S;t[43]!==I?(S={value:"calendar",icon:H,label:I},t[43]=I,t[44]=S):S=t[44];let F;t[45]===Symbol.for("react.memo_cache_sentinel")?(F=o.jsx(bt,{}),t[45]=F):F=t[45];let D;t[46]!==n?(D=n("sandbox.variantCalendar.timelineMode"),t[46]=n,t[47]=D):D=t[47];let O;t[48]!==D?(O={value:"timeline",icon:F,label:D},t[48]=D,t[49]=O):O=t[49];let P;t[50]!==S||t[51]!==O?(P=[S,O],t[50]=S,t[51]=O,t[52]=P):P=t[52];let B;t[53]!==P||t[54]!==s?(B=o.jsx(Tt,{value:s,onValueChange:i,options:P}),t[53]=P,t[54]=s,t[55]=B):B=t[55];let z;t[56]!==R||t[57]!==B?(z=o.jsxs("div",{className:"flex items-center gap-4",children:[R,B]}),t[56]=R,t[57]=B,t[58]=z):z=t[58];let W;t[59]!==j||t[60]!==z?(W=o.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,z]}),t[59]=j,t[60]=z,t[61]=W):W=t[61];let G;t[62]!==g||t[63]!==a||t[64]!==p||t[65]!==l||t[66]!==f||t[67]!==s?(G=f.length===0?o.jsx(Yt,{hiddenOngoing:l?0:p}):s==="calendar"?o.jsx(qt,{monthStart:a,variants:f,colorMap:g}):o.jsx(te,{monthStart:a,variants:f,colorMap:g}),t[62]=g,t[63]=a,t[64]=p,t[65]=l,t[66]=f,t[67]=s,t[68]=G):G=t[68];let X;return t[69]!==W||t[70]!==G?(X=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[W,G]}),t[69]=W,t[70]=G,t[71]=X):X=t[71],X}function Wt(e){return e.blockKey}function Gt(e){return!e.openEnd}function Ut(e){return e.openEnd}function Kt(){return mt(new Date)}function Yt(e){const t=K.c(4),{hiddenOngoing:r}=e,n=r===void 0?0:r,s=Q();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(at,{size:24,className:"text-muted-foreground/60"}),t[0]=i):i=t[0];let a;return t[1]!==n||t[2]!==s?(a=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:[i,n>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noDatedVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.hiddenOngoingVariants",{count:n})})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noScheduledVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=n,t[2]=s,t[3]=a):a=t[3],a}const et=20,it=2,st=28,Xt=6;function qt(e){const t=K.c(17),{monthStart:r,variants:n,colorMap:s}=e;let i,a,c,l,m;if(t[0]!==s||t[1]!==r||t[2]!==n){const f=Nt(r),g=_t(new Date);i=lt,m="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:wt.map(Qt)}),t[8]=c):c=t[8],l=f.map((u,x)=>{const b=kt(u,n),E=b.reduce(Jt,0),T=st+E*(et+it)+8;return o.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[u.map((d,v)=>{const y=d.getMonth()===r.getMonth(),N=d.getTime()===g.getTime();return o.jsx("div",{className:rt("border-r last:border-r-0 px-2 pt-1.5 text-xs",y?"bg-background":"bg-muted/30 text-muted-foreground"),children:o.jsx("span",{className:rt("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:d.getDate()})},v)}),b.map((d,v)=>{const y=dt(s,d.variant.blockKey),N=st+d.lane*(et+it),A=d.leftUnits/7*100,_=d.widthUnits/7*100,k=d.variant.openStart&&x===0,C=d.variant.openEnd&&x===f.length-1;return o.jsxs(ft,{variant:d.variant,color:y,fadeStart:k,fadeEnd:C,style:{top:N,left:`calc(${A}% + 2px)`,width:`calc(${_}% - 4px)`,minWidth:Xt,height:et},children:[d.variant.blockLabel,d.variant.label!==d.variant.blockLabel&&o.jsxs("span",{className:"opacity-70",children:[" · ",d.variant.label]})]},`${x}-${v}`)})]},x)}),t[0]=s,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=c,t[6]=l,t[7]=m}else i=t[3],a=t[4],c=t[5],l=t[6],m=t[7];let p;t[9]!==a||t[10]!==c||t[11]!==l?(p=o.jsxs("div",{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=p):p=t[12];let h;return t[13]!==i||t[14]!==m||t[15]!==p?(h=o.jsx(i,{className:m,children:p}),t[13]=i,t[14]=m,t[15]=p,t[16]=h):h=t[16],h}function Jt(e,t){return Math.max(e,t.lane+1)}function Qt(e){return o.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const q=4,Zt=32,Y=240;function te(e){const t=K.c(23),{monthStart:r,variants:n,colorMap:s}=e,i=r,a=U(r,q),c=new Date,l=new Map;for(const w of n){const j=l.get(w.blockKey)??[];j.push(w),l.set(w.blockKey,j)}const m=Array.from(l.entries()).sort(ne),p=a.getTime()-i.getTime(),h=w=>(Math.max(i.getTime(),Math.min(a.getTime(),w.getTime()))-i.getTime())/p*100;let f;t[0]!==i?(f=(w,j)=>U(i,j),t[0]=i,t[1]=f):f=t[1];const g=Array.from({length:q},f),u=c.getTime()>=i.getTime()&&c.getTime()<=a.getTime()?h(c):null,x=Q(),b=lt,E="flex-1 min-h-0",T="min-w-[900px] relative";let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={width:Y},t[2]=d):d=t[2];let v;t[3]!==x?(v=x("sandbox.variantCalendar.variantBlock"),t[3]=x,t[4]=v):v=t[4];let y;t[5]!==v?(y=o.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:d,children:v}),t[5]=v,t[6]=y):y=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},t[7]=N):N=t[7];const A=g.map(re);let _;t[8]!==A?(_=o.jsx("div",{className:"flex-1 grid",style:N,children:A}),t[8]=A,t[9]=_):_=t[9];let k;t[10]!==y||t[11]!==_?(k=o.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[y,_]}),t[10]=y,t[11]=_,t[12]=k):k=t[12];let C;t[13]!==x||t[14]!==u?(C=u!==null&&o.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${Y}px + (100% - ${Y}px) * ${u} / 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:x("sandbox.variantCalendar.todayLabel")})}),t[13]=x,t[14]=u,t[15]=C):C=t[15];const $=m.map(w=>{const[j,R]=w,H=dt(s,j),I=R[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:Y},children:I})}),R.map((S,F)=>o.jsxs("div",{className:"flex border-b items-center",style:{height:Zt},children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:Y},children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:H.bg}}),o.jsx("span",{className:"truncate text-foreground/80",children:S.label})]}),o.jsxs("div",{className:"relative flex-1 h-full",children:[o.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},children:g.map(ee)}),(()=>{const D=Math.max(S.start.getTime(),i.getTime()),O=Math.min(S.end.getTime(),a.getTime());if(O<=D)return null;const P=h(new Date(D)),B=h(new Date(O))-P;return o.jsx(ft,{variant:S,color:H,fadeStart:S.openStart,fadeEnd:S.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${P}%`,width:`calc(${B}% - 2px)`,height:22},children:S.label})})()]})]},F))]},j)});let L;t[16]!==k||t[17]!==C||t[18]!==$?(L=o.jsxs("div",{className:T,children:[k,C,$]}),t[16]=k,t[17]=C,t[18]=$,t[19]=L):L=t[19];let M;return t[20]!==b||t[21]!==L?(M=o.jsx(b,{className:E,children:L}),t[20]=b,t[21]=L,t[22]=M):M=t[22],M}function ee(e,t){return o.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function re(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:[ct[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function ne(e,t){return e[0].localeCompare(t[0])}export{Kn as VariantCalendar};
|