decocms 4.294.2 → 4.294.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-qZDg2e-H.js → AlertCircle-DLj-rBLn.js} +1 -1
- package/dist/client/assets/{AreaChart-D1rWRcUm.js → AreaChart-9FGrcqfj.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CatEVOI7.js → ArrowLeft-Bz-VyTFg.js} +1 -1
- package/dist/client/assets/{ArrowUp-DMDdMhAA.js → ArrowUp-C9wijSHC.js} +1 -1
- package/dist/client/assets/{Check-C5RWnyNL.js → Check-CTKt7DPp.js} +1 -1
- package/dist/client/assets/{CheckCircle-V0GvWvtd.js → CheckCircle-DOOBCpT9.js} +1 -1
- package/dist/client/assets/{ChevronDown-CeGZsBnS.js → ChevronDown-DCBuHd0m.js} +1 -1
- package/dist/client/assets/{ChevronRight-Dh8_6pj1.js → ChevronRight-CO9K42kJ.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Im3Lz_4E.js → ChevronSelectorVertical-Iu37Jtvz.js} +1 -1
- package/dist/client/assets/{ChevronUp-DCx43qHY.js → ChevronUp-D6fZUTvM.js} +1 -1
- package/dist/client/assets/{Copy01-DhfruII6.js → Copy01-C-9zesbF.js} +1 -1
- package/dist/client/assets/{CreditCard01-Cy0s6gAf.js → CreditCard01-CKM-Jz3x.js} +1 -1
- package/dist/client/assets/{DotsVertical-B39kxqbi.js → DotsVertical-CSkWlHZt.js} +1 -1
- package/dist/client/assets/{Download01-C1FmC7JV.js → Download01-DYsmBrAR.js} +1 -1
- package/dist/client/assets/{Eye-m8QZKf2Y.js → Eye-Bf1344cz.js} +1 -1
- package/dist/client/assets/{FilterLines-BBF-m2ZJ.js → FilterLines-D4VZo9JH.js} +1 -1
- package/dist/client/assets/{Globe01-C2F_PPuX.js → Globe01-Mlkbzavy.js} +1 -1
- package/dist/client/assets/{Globe04-CMCnFTSr.js → Globe04-CcZwBZDM.js} +1 -1
- package/dist/client/assets/{HardDrive-DmqNZKD8.js → HardDrive-rv6yXW9l.js} +1 -1
- package/dist/client/assets/{Key01-DbCU9LZF.js → Key01-C71Bncy8.js} +1 -1
- package/dist/client/assets/{LinkExternal01-kQnRXU4w.js → LinkExternal01-Bd5qXJx-.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-D5OpQeQe.js → LockUnlocked01-xUxyOLI6.js} +1 -1
- package/dist/client/assets/{LogOut01-BePTyd5L.js → LogOut01-CFPuWi87.js} +1 -1
- package/dist/client/assets/{Monitor01-DPqlemzQ.js → Monitor01-Db3wK3MU.js} +1 -1
- package/dist/client/assets/{Palette-DzT0S9Gl.js → Palette-Wf7ieWzf.js} +1 -1
- package/dist/client/assets/{Play-Btu3v5FX.js → Play-CTzOPD4i.js} +1 -1
- package/dist/client/assets/{Plus-B7vTVmKH.js → Plus-C20besyI.js} +1 -1
- package/dist/client/assets/{SearchLg-CAAIuTYj.js → SearchLg-BoAF9n4o.js} +1 -1
- package/dist/client/assets/{SearchMd-COQJLRw-.js → SearchMd-DbgBw9S_.js} +1 -1
- package/dist/client/assets/{Settings02-xEBQxvJD.js → Settings02-DVdySYD4.js} +1 -1
- package/dist/client/assets/{Share07-CLkT7SlV.js → Share07-TLJEQyW1.js} +1 -1
- package/dist/client/assets/{Shield01-C2USnj9G.js → Shield01-CVEumGx3.js} +1 -1
- package/dist/client/assets/{Stars01-DkoqcM4j.js → Stars01-BLlf5jfX.js} +1 -1
- package/dist/client/assets/{Stars02-4GZ9SjIq.js → Stars02-DSl09LS3.js} +1 -1
- package/dist/client/assets/{Sun-D0KW7MLF.js → Sun-D8Cz2KrR.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DwxljZOI.js → SwitchHorizontal01-DxrMcxk-.js} +1 -1
- package/dist/client/assets/{Tool01-tn2PFBHQ.js → Tool01-C-r-Zf-I.js} +1 -1
- package/dist/client/assets/{Tool02-BalBR7uK.js → Tool02-CQfhYBA-.js} +1 -1
- package/dist/client/assets/{Trash01-CwqV1gzD.js → Trash01-BaF7-rQA.js} +1 -1
- package/dist/client/assets/{TrendUp01-6TR_k_0Y.js → TrendUp01-DrIbuukS.js} +1 -1
- package/dist/client/assets/{Upload01-mqAHBbZV.js → Upload01-Eo8Y8gwt.js} +1 -1
- package/dist/client/assets/{User01-DWaPmCwS.js → User01-BmKTu46m.js} +1 -1
- package/dist/client/assets/{UserSquare-ClSByuB-.js → UserSquare-D5oHibl1.js} +1 -1
- package/dist/client/assets/{Users01-CFDNbxgJ.js → Users01-DdYj89q4.js} +1 -1
- package/dist/client/assets/{Users03-BT3gPqQL.js → Users03-BvmFpFso.js} +1 -1
- package/dist/client/assets/{XCircle-BOrCVYLf.js → XCircle-BLGxEUt7.js} +1 -1
- package/dist/client/assets/{XClose-DMSeuF30.js → XClose-KYQfxNAH.js} +1 -1
- package/dist/client/assets/{YAxis-CjueDU_j.js → YAxis-BzTUlY5S.js} +1 -1
- package/dist/client/assets/{Zap-CwYGo5D6.js → Zap-DSuzhrFd.js} +1 -1
- package/dist/client/assets/{ZapSquare-DkKtoQ7W.js → ZapSquare-B03SIXBG.js} +1 -1
- package/dist/client/assets/{access-gate-DXIgG9H-.js → access-gate-DXpndi2J.js} +1 -1
- package/dist/client/assets/{agent-icon-C9_7Msf7.js → agent-icon-LbhnjHwi.js} +1 -1
- package/dist/client/assets/{agents-list-CrYr2LdT.js → agents-list-BWtnoYa9.js} +1 -1
- package/dist/client/assets/{ai-providers-9B822Ytz.js → ai-providers-C9TvV_lY.js} +1 -1
- package/dist/client/assets/{alert-DeOSO_Ec.js → alert-Brn68O_I.js} +1 -1
- package/dist/client/assets/{alert-dialog-BWONJIzw.js → alert-dialog-CDXDBEVz.js} +1 -1
- package/dist/client/assets/{api-keys-BHGQjiZT.js → api-keys-C0YiI_0_.js} +1 -1
- package/dist/client/assets/{app-editor-GCmyfLNC.js → app-editor-ByjOzHF0.js} +1 -1
- package/dist/client/assets/{auth-BqxUQw-v.js → auth-CMC5pcXA.js} +1 -1
- package/dist/client/assets/{auth-catchall-q5v2tPZU.js → auth-catchall-C1obS0DM.js} +1 -1
- package/dist/client/assets/{auth-entry-Dx-_gZ2g.js → auth-entry-L4MYHhmA.js} +1 -1
- package/dist/client/assets/{auth-split-layout-YdeWuYN1.js → auth-split-layout-p8RpZGj-.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DRVU48ic.js → authenticate-and-persist-oauth-B1awg6G_.js} +1 -1
- package/dist/client/assets/{automation-list-row-BMiRTeOK.js → automation-list-row-DSW4dqyo.js} +1 -1
- package/dist/client/assets/{automation-runs-CzcGADVN.js → automation-runs-DwCd_zFP.js} +1 -1
- package/dist/client/assets/{automations-DDnrk0LJ.js → automations-C4N4GC8F.js} +1 -1
- package/dist/client/assets/{avatar-1XE5IjoT.js → avatar-DKKheiwZ.js} +1 -1
- package/dist/client/assets/{badge-CXIV4O-0.js → badge-BCfyeFAT.js} +1 -1
- package/dist/client/assets/{block-document-BufBxpL6.js → block-document-D9NoKYRN.js} +1 -1
- package/dist/client/assets/{breadcrumb-FUX_wv57.js → breadcrumb-DwyVLr-T.js} +1 -1
- package/dist/client/assets/{buckets-DQPGFSM3.js → buckets-NENIH_rY.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CNgfZPUK.js → bulk-category-panel-CWOO5lMW.js} +1 -1
- package/dist/client/assets/{capability-load-error-BKGEHfpt.js → capability-load-error-Bu5AJKz_.js} +1 -1
- package/dist/client/assets/{cards-DJSm_nho.js → cards-AP5XpAV6.js} +1 -1
- package/dist/client/assets/{category-editor-ByRsnfkE.js → category-editor-CAPnyo_p.js} +1 -1
- package/dist/client/assets/{chart-Bgue_7DQ.js → chart-D1jgldPO.js} +1 -1
- package/dist/client/assets/{chat-context-C-BdNZCf.js → chat-context-DQqAI1Uh.js} +1 -1
- package/dist/client/assets/{checkbox-DvC3nAT5.js → checkbox-BdDEdRtX.js} +1 -1
- package/dist/client/assets/{choose-editor-CFBXNqp3.js → choose-editor-d1jVshXq.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CUav6RQy.js → cli-auth-success-DZNcV7RU.js} +1 -1
- package/dist/client/assets/{collection-detail-LByozjyF.js → collection-detail-DCdfqXH6.js} +1 -1
- package/dist/client/assets/{collection-display-button-D4ItaSc8.js → collection-display-button-BkVeJ-Ht.js} +1 -1
- package/dist/client/assets/{collection-search-DBnGb4Zg.js → collection-search-swq3mYpH.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DCUZlFkx.js → collection-table-wrapper-BFeQBjk_.js} +1 -1
- package/dist/client/assets/{collection-tabs-CAUEdmSI.js → collection-tabs-B31Xr--3.js} +1 -1
- package/dist/client/assets/{command-Ct_4mokr.js → command-CtzJnf3P.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-C2UgJ-TR.js → commerce-onboarding-B6IdGbvD.js} +1 -1
- package/dist/client/assets/{config-DG69PD1X.js → config-CbfHHHdK.js} +1 -1
- package/dist/client/assets/{connect-DLRRtQi0.js → connect-28y6QTSQ.js} +1 -1
- package/dist/client/assets/{connection-Dg1mnPcO.js → connection-BuSysa2G.js} +1 -1
- package/dist/client/assets/{connection-card-CgUgSGsh.js → connection-card-BllYSe_U.js} +1 -1
- package/dist/client/assets/{connection-detail-CAhXUEiD.js → connection-detail-_XYLLvoB.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-gU6TF210.js → connection-form-helpers-C6PcVFY-.js} +1 -1
- package/dist/client/assets/{connections-tQk1fh_m.js → connections-Cu1bTJAX.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DDszDk42.js → decopilot-sse-pool-CvmARxhG.js} +1 -1
- package/dist/client/assets/{dialog-DYg0AoO0.js → dialog-D4htx8Dz.js} +1 -1
- package/dist/client/assets/{domain-settings-xR7ZmjBb.js → domain-settings-DEIyOLUp.js} +1 -1
- package/dist/client/assets/{drawer-DrqU_8fl.js → drawer-CuMUVmYp.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BGreHXNg.js → dropdown-menu-BE_ym3Aq.js} +1 -1
- package/dist/client/assets/{empty-state-DNKOHljA.js → empty-state-DANnu2Dm.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BI_gbc3h.js → extract-connection-data-BIGQQYkp.js} +1 -1
- package/dist/client/assets/{file-explorer-D9_-DWtI.js → file-explorer-DyEzRtBa.js} +1 -1
- package/dist/client/assets/{file-type-icon-Cr_jiDFe.js → file-type-icon-BenR9kqm.js} +1 -1
- package/dist/client/assets/{form-DUYaeuN1.js → form-DxT0qd-2.js} +1 -1
- package/dist/client/assets/{general-CVMzbMNL.js → general-BgW26EXn.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BjTlfZRh.js → github-repo-picker-DuwsdpzE.js} +1 -1
- package/dist/client/assets/{hooks-DvV-YCly.js → hooks-rNJx2Yiz.js} +1 -1
- package/dist/client/assets/{index-Bk7mmffp.js → index-BNizG_r4.js} +1 -1
- package/dist/client/assets/{index-DHLutK6v.js → index-BWXyDl1J.js} +3 -3
- package/dist/client/assets/{index-pYJ2-T-r.js → index-BXn0NwIo.js} +1 -1
- package/dist/client/assets/{index-RXRS2M8q.js → index-CdvEA4gL.js} +1 -1
- package/dist/client/assets/{index-CXtbLiKC.js → index-ChcGUNSF.js} +1 -1
- package/dist/client/assets/{index-CxsfTXSQ.js → index-DeW3li9q.js} +1 -1
- package/dist/client/assets/{index-BOALwCeh.js → index-Dstu6oca.js} +1 -1
- package/dist/client/assets/{index-BWVLjCpL.js → index-eyTxS6Bz.js} +6 -6
- package/dist/client/assets/{index-CgA3qf5E.js → index-ke_XwP2X.js} +1 -1
- package/dist/client/assets/{index-redirect-CUFx5Ci3.js → index-redirect-BJVKALX7.js} +1 -1
- package/dist/client/assets/{infra-billing-C7HR_T7J.js → infra-billing-CcvA504_.js} +1 -1
- package/dist/client/assets/{input-zNG5Uz1T.js → input-BmuxVBRq.js} +1 -1
- package/dist/client/assets/{integration-icon-CVsQlE88.js → integration-icon-BIrESC5L.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BocroOxJ.js → invite-member-dialog-DIItbiti.js} +1 -1
- package/dist/client/assets/{label-CEq9oqa2.js → label-CpzYUQhx.js} +1 -1
- package/dist/client/assets/{layout-DFoH_xu7.js → layout-DUzsu4c4.js} +1 -1
- package/dist/client/assets/{login-DQ-omlrv.js → login-RKrGsWpi.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DGSZYZtZ.js → mcp-oauth-fsNn1czb.js} +1 -1
- package/dist/client/assets/{members-1vFWUjqy.js → members-BrDpNquF.js} +1 -1
- package/dist/client/assets/{monaco-editor-BIUU4YtT.js → monaco-editor-CMqzV6OC.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Drb7zrQ3.js → monitoring-stats-row-B-2cTzBQ.js} +1 -1
- package/dist/client/assets/{multi-select-CeA0LiDA.js → multi-select-BQDrB1yk.js} +1 -1
- package/dist/client/assets/{oauth-callback-BLBnsV0m.js → oauth-callback-Ba4XCWyw.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-_ZIgbe1k.js → oauth-callback-ai-provider-JZoeFXxW.js} +1 -1
- package/dist/client/assets/{onboarding-DHEpPKxX.js → onboarding-Bk8dPUg3.js} +1 -1
- package/dist/client/assets/{org-layout-CZwey9tp.js → org-layout-Di5sK1cd.js} +1 -1
- package/dist/client/assets/{organization-choice-CinweDu8.js → organization-choice-CHzFbea4.js} +1 -1
- package/dist/client/assets/{orgs-Cewt5f_m.js → orgs-CKI_JjMZ.js} +1 -1
- package/dist/client/assets/{page-seo-form-DCXZwoTq.js → page-seo-form-DC6yxtgW.js} +1 -1
- package/dist/client/assets/{popover-CPDUuAsK.js → popover-3-nXGxsG.js} +1 -1
- package/dist/client/assets/{post-calendar-B2MLz9zN.js → post-calendar-_RxbEjvs.js} +1 -1
- package/dist/client/assets/{post-editor-xPbcpUyS.js → post-editor-htgRFHsC.js} +1 -1
- package/dist/client/assets/{primitives-bdzFl9KQ.js → primitives-By-oabkM.js} +1 -1
- package/dist/client/assets/{profile-DRVuFWo1.js → profile-itQSWHS0.js} +1 -1
- package/dist/client/assets/{project-app-view-C0-tH6m6.js → project-app-view-BtD2dHc2.js} +1 -1
- package/dist/client/assets/{prompts-DHayAFpv.js → prompts-B4jycXmo.js} +1 -1
- package/dist/client/assets/record-editor-DmWjrMIo.js +1 -0
- package/dist/client/assets/{redirect-editor-OElGvzsY.js → redirect-editor-CyQNXT5k.js} +1 -1
- package/dist/client/assets/registry-BokCitrd.js +2 -0
- package/dist/client/assets/{registry-layout-BTzECwAf.js → registry-layout-BjtKfm0C.js} +1 -1
- package/dist/client/assets/{reports-BlhyDDdZ.js → reports-D2AnuGQl.js} +1 -1
- package/dist/client/assets/{require-capability-BJjD7GXa.js → require-capability-DYqEh_0t.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Bi3hMcfQ.js → required-auth-layout-DPe5oune.js} +1 -1
- package/dist/client/assets/{reset-password-BLXOXnD3.js → reset-password-BcbVGV-U.js} +1 -1
- package/dist/client/assets/{review-settings-0bpnzbvB.js → review-settings-DET5Awcp.js} +1 -1
- package/dist/client/assets/{roles-C9DLuLWB.js → roles-Cm1qg0ow.js} +1 -1
- package/dist/client/assets/{scroll-area-Dw0578rC.js → scroll-area-BsxuvxbS.js} +1 -1
- package/dist/client/assets/{search-input-lOvS7ZZY.js → search-input-i6XUS8wH.js} +1 -1
- package/dist/client/assets/{secrets-DEtSas2W.js → secrets-DmB_3wh4.js} +1 -1
- package/dist/client/assets/{sections-editor-DDSHgrQf.js → sections-editor-CQaXh0aN.js} +1 -1
- package/dist/client/assets/{select-W8jorDji.js → select-OkaoLf52.js} +1 -1
- package/dist/client/assets/{select-model-CVJuTB71.js → select-model-DQ1JGbZ1.js} +1 -1
- package/dist/client/assets/{self-tool-result-DYCZ2dxI.js → self-tool-result-_Gq4fS8Q.js} +1 -1
- package/dist/client/assets/{seo-editor-CqSjFrJe.js → seo-editor-D3_wyic8.js} +1 -1
- package/dist/client/assets/{settings-layout-Cj60dDE0.js → settings-layout-ClrVUhfB.js} +1 -1
- package/dist/client/assets/{shell-controls-CcajpdEy.js → shell-controls-DkHGCWDm.js} +1 -1
- package/dist/client/assets/{shell-layout-BbKgiGKQ.js → shell-layout-H_tjyvHd.js} +1 -1
- package/dist/client/assets/{spinner-DEaGcbnH.js → spinner-BNsOVOLB.js} +1 -1
- package/dist/client/assets/{sso-DFyPw3S-.js → sso-CVRSygMq.js} +1 -1
- package/dist/client/assets/{store-B-DY1jsG.js → store-EFK86dJx.js} +1 -1
- package/dist/client/assets/store-registry-CAgXmIVJ.js +2 -0
- package/dist/client/assets/{super-agent-icon-DxowWKwv.js → super-agent-icon-uUxotzmO.js} +1 -1
- package/dist/client/assets/{switch-BsAR0Ue8.js → switch-jAw5NRFm.js} +1 -1
- package/dist/client/assets/{synced-repos-BxJ8BZWX.js → synced-repos-DHWcDJ5i.js} +1 -1
- package/dist/client/assets/{table-RKi74_kY.js → table-DSRHVWxU.js} +1 -1
- package/dist/client/assets/{tabs-DFRRVuh7.js → tabs-CkF_fW0Q.js} +1 -1
- package/dist/client/assets/{task-board-D9PHUZff.js → task-board-DmX2VpFs.js} +1 -1
- package/dist/client/assets/{tasks-CiijDgSs.js → tasks-C6LaWTXG.js} +1 -1
- package/dist/client/assets/{textarea-XbuS70jj.js → textarea-DzCWtryj.js} +1 -1
- package/dist/client/assets/{toggle-group-WZyFFujP.js → toggle-group-hvwloSYQ.js} +1 -1
- package/dist/client/assets/{toolbar-CmaLqa3-.js → toolbar-D9gkmlH9.js} +1 -1
- package/dist/client/assets/{track-BFh4WctH.js → track-CwWn2JFQ.js} +1 -1
- package/dist/client/assets/{types-CrdXjhQP.js → types-D8IG_8eU.js} +1 -1
- package/dist/client/assets/{use-ai-providers-WmO5B1wa.js → use-ai-providers-DZwpIJ4W.js} +1 -1
- package/dist/client/assets/{use-api-keys-CHuWewKt.js → use-api-keys-D39Ow3Yy.js} +1 -1
- package/dist/client/assets/{use-automations-g--nS4Go.js → use-automations-D--Rxx-_.js} +1 -1
- package/dist/client/assets/{use-autosave-BsqWx81g.js → use-autosave-BDzRVdw8.js} +1 -1
- package/dist/client/assets/{use-connection-D8j2CnOC.js → use-connection-tOCjDBfx.js} +1 -1
- package/dist/client/assets/{use-copy-lK-vhEre.js → use-copy-ICpw0Yw-.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bdpos1w0.js → use-create-virtual-mcp-DKiTnBa-.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DsCulVkO.js → use-debounced-autosave-C706dtM7.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D5wCJf5h.js → use-debounced-value-DBMZQqKo.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CEhAvB_E.js → use-decopilot-events-DFaxDB0Z.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BAty9GWK.js → use-delete-connection-DY1dO96h.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CD-qM4Qw.js → use-deployment-admin-CwPi-zHy.js} +1 -1
- package/dist/client/assets/{use-destination-route-BMJNYrmL.js → use-destination-route-C8wZaTLq.js} +1 -1
- package/dist/client/assets/{use-file-configs-CEny8PB8.js → use-file-configs-rXyGhpyn.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DzHJHyr0.js → use-infinite-scroll-BUgjJwY5.js} +1 -1
- package/dist/client/assets/{use-join-requests-z_I5qiFl.js → use-join-requests-CbCMIasb.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-dyqIaOq0.js → use-mcp-auth-status-CyITsP1y.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bac4vccq.js → use-mcp-client-DHZ5WVmn.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-FenH0JaE.js → use-mcp-tools-C69l20dV.js} +1 -1
- package/dist/client/assets/{use-members-_2HCzEHc.js → use-members-CAd4YLUd.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-yAkGdje4.js → use-navigate-to-agent-BWgdcI3Z.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Cb5lYh1t.js → use-org-auth-client-DPBNI0km.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DbzFw6wJ.js → use-org-repo-syncs-Df_iQEGc.js} +1 -1
- package/dist/client/assets/{use-org-sso-cefqXe6X.js → use-org-sso-Y-cX0M9u.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DA6OSxjH.js → use-organization-roles-Cazh8-rd.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BsgcrCz-.js → use-organization-settings-CGbImq1L.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-C8-xot4V.js → use-panel-navigate-CzBWJmh4.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BoC6e9Ko.js → use-registry-connections--wEDOuCo.js} +1 -1
- package/dist/client/assets/{use-secrets-CNOFekf-.js → use-secrets-BUOK8Q3X.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CFAiIdAN.js → use-section-preview-base-CQ_HgNgO.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CdtGOM4G.js → use-status-sounds-BcDDyChz.js} +1 -1
- package/dist/client/assets/{use-tags-CnmdA4eJ.js → use-tags-DQhkcWVg.js} +1 -1
- package/dist/client/assets/{use-view-mode-DHrNQrCI.js → use-view-mode-DyvonuSr.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-X7MaI4-V.js → use-virtual-mcp-zkag_-cI.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CHJpyz-t.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-uqFTRGN7.js +1 -0
- package/dist/client/assets/{users-CNOqKONO.js → users-DBLID0_X.js} +1 -1
- package/dist/client/assets/{variant-calendar-DzbjSxwP.js → variant-calendar-pfbXNZPy.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C_beZllv.js → view-mode-toggle-ChPfg34r.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/record-editor-BabiokFj.js +0 -1
- package/dist/client/assets/registry-Bpp0Gik6.js +0 -2
- package/dist/client/assets/store-registry-CW8CS7Je.js +0 -2
- package/dist/client/assets/useInfiniteQuery-CP11XfQS.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-vPet_vok.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{eo as le,ep as ue,eq as de,dd as he,er as fe,cR as _,cS as g,es as pe,et as me,eu as _e,ev as M,ew as we,ex as D,ey as ge,ez as q,eA as Te,eB as L,eC as ye,eD as ke,eE as ve,eF as J,cw as Se,cy as Ce,ct as Re,d8 as te,dk as be,dr as Ie,dp as Ee,dR as qe,eG as Pe,eH as $e,eI as A,eJ as Me,eK as Ae,dq as He,dl as Oe,dm as Ue,dn as xe,cu as Ne,eL as je,eM as Fe,eN as De,df as Le,eO as Ve,eP as ze,dN as U,eQ as Qe,cs as N,c as se,z as re,K as z}from"./index-DHLutK6v.js";import{S as Je}from"./constants-dLUUoWH7.js";import{U as P,a as H,e as W}from"./auth-BqxUQw-v.js";function x(a){return!!a._zod}function R(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 b(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=R(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(!b(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(b(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(b(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},b(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=R(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),b(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(b(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),b(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function B(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Be(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];B(n)&&B(o)?t[r]={...n,...o}:t[r]=o}return t}var Ze=Ce();const Ye=Se(Ze);function Xe(){const a=new Ye({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(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",be,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=Be(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=R(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=R(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=R(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=R(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=R(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=R(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 Z 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{eo as le,ep as ue,eq as de,dd as he,er as fe,cR as _,cS as g,es as pe,et as me,eu as _e,ev as M,ew as we,ex as D,ey as ge,ez as q,eA as Te,eB as L,eC as ye,eD as ke,eE as ve,eF as J,cw as Se,cy as Ce,ct as Re,d8 as te,dk as be,dr as Ie,dp as Ee,dR as qe,eG as Pe,eH as $e,eI as A,eJ as Me,eK as Ae,dq as He,dl as Oe,dm as Ue,dn as xe,cu as Ne,eL as je,eM as Fe,eN as De,df as Le,eO as Ve,eP as ze,dN as U,eQ as Qe,cs as N,c as se,z as re,K as z}from"./index-BWXyDl1J.js";import{S as Je}from"./constants-dLUUoWH7.js";import{U as P,a as H,e as W}from"./auth-CMC5pcXA.js";function x(a){return!!a._zod}function R(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 b(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=R(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(!b(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(b(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(b(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},b(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=R(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),b(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(b(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),b(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function B(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Be(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];B(n)&&B(o)?t[r]={...n,...o}:t[r]=o}return t}var Ze=Ce();const Ye=Se(Ze);function Xe(){const a=new Ye({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(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",be,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=Be(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=R(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=R(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=R(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=R(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=R(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=R(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 Z 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-BWXyDl1J.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-BWXyDl1J.js";import{u as y}from"./use-org-auth-client-DPBNI0km.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-yAkGdje4.js → use-navigate-to-agent-BWgdcI3Z.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as R}from"./use-destination-route-
|
|
1
|
+
import{D as R}from"./use-destination-route-C8wZaTLq.js";import{I as O,r as c,c as v,j as A,d as x,H as C,a as E,dF as T}from"./index-BWXyDl1J.js";import{u as _}from"./use-virtual-mcp-zkag_-cI.js";import{u as N}from"./hooks-rNJx2Yiz.js";import{p as w,d as P}from"./session-runtime-wVXsCwcJ.js";const f=new Map;function y(r){return`${r.orgId}:${r.userId}`}function U(r){return`sidebar.group-order.${r}`}function h(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 G(r,e){try{localStorage.setItem(r,JSON.stringify(e))}catch{}}function j(r){const e=y(r),t=f.get(e);if(t)return t;const n=O.sidebarGroupOrder(r.orgId,r.userId);let s=!1;try{s=localStorage.getItem(n)!==null}catch{}let o=h(n);if(!s&&o.length===0&&r.userId!=="anon"){const d=h(U(r.orgId));d.length>0&&(o=d)}return f.set(e,o),o}function D(r,e){const t=new Set(e);return j(r).filter(n=>!t.has(n))}function K(r,e){f.set(y(r),e),G(O.sidebarGroupOrder(r.orgId,r.userId),e)}function $(r,e,t=[]){if(t.includes(e))return;const n=D(r,t);n.includes(e)||K(r,[e,...n])}const m=c.createContext(null);function X(r){const e=v.c(7),{children:t}=r,[n,s]=c.useState(!1),[o,d]=c.useState(0);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>d(L),e[0]=i):i=e[0];const l=i;let a;e[1]!==n||e[2]!==o?(a={empty:n,setEmpty:s,orderRevision:o,bumpOrderRevision:l},e[1]=n,e[2]=o,e[3]=a):a=e[3];let u;return e[4]!==t||e[5]!==a?(u=A.jsx(m.Provider,{value:a,children:t}),e[4]=t,e[5]=a,e[6]=u):u=e[6],u}function L(r){return r+1}function Z(){return c.useContext(m)?.empty??!1}function k(){return c.useContext(m)?.bumpOrderRevision??F}function F(){}function H(r,e,t,n){return r.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===t&&s.title==="New chat"&&!s.harness_id&&J(s,n))}function J(r,e){if(!e)return!0;if(r.partial)return!1;const t=w(r.metadata?.runtime);return t===null||t===e}const S=[],B=()=>()=>{};function V(r){return(r??[]).filter(e=>!!e.pinned).map(e=>e.id)}function M(){const r=x(),{org:e}=C(),t=_(),{data:n}=E.useSession(),s=n?.user?.id??"anon",o=V(t),d=k(),i=N(),l=c.useSyncExternalStore(i?.threads.subscribe??B,i?.threads.get??(()=>S),i?.threads.get??(()=>S));return(a,u)=>{$({orgId:e.id,userId:s},a,o),d();const g=(t??[]).find(I=>I.id===a),b=H(l,a,n?.user?.id,g?P(g.metadata):void 0)?.id??crypto.randomUUID(),p=u?.panel?T(u.panel):null;r({to:R.agents,params:{org:e.slug,project:a,panel:p?.panel},search:{...p?.payload??{},thread:b}})}}export{X as S,k as a,$ as b,M as c,H as f,V as g,Z as u};
|
package/dist/client/assets/{use-org-auth-client-Cb5lYh1t.js → use-org-auth-client-DPBNI0km.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-BWXyDl1J.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-DbzFw6wJ.js → use-org-repo-syncs-Df_iQEGc.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,H as f,ac as y,K as S,o as _,p as d,e as R}from"./index-
|
|
1
|
+
import{c as r,H as f,ac as y,K as S,o as _,p as d,e as R}from"./index-BWXyDl1J.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 T(){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,T 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-BWXyDl1J.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-DA6OSxjH.js → use-organization-roles-Cazh8-rd.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as R}from"./use-org-auth-client-
|
|
1
|
+
import{u as R}from"./use-org-auth-client-DPBNI0km.js";import{H as b,o as P,K as y}from"./index-BWXyDl1J.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{c as o,H as y,o as T,aY as $,K as _,ac as z,p as I,e as D,r as M}from"./index-
|
|
1
|
+
import{c as o,H as y,o as T,aY as $,K as _,ac as z,p as I,e as D,r as M}from"./index-BWXyDl1J.js";import{W as G}from"./constants-dLUUoWH7.js";import{d as P,o as Q,r as C}from"./task-board-DmX2VpFs.js";const O={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null,main_agent_id:null},w={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function N(t,e){return{queryKey:_.organizationSettings(e),queryFn:async()=>{try{return await $(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...O,organizationId:e}}},staleTime:6e4}}function c(t){const e=o.c(6),{org:s}=y();let n;e[0]!==s.id||e[1]!==s.slug?(n=N(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const i=t;let a;return e[3]!==n||e[4]!==i?(a={...n,select:i},e[3]=n,e[4]=i,e[5]=a):a=e[5],T(a)}function B(t,e){const s=o.c(3);let n;s[0]!==t||s[1]!==e?(n=N(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:i}=T(n);return i??null}function f(){const t=o.c(9),{org:e}=y(),s=z(),n=I();let i;t[0]!==e||t[1]!==s?(i=async u=>{const l=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...u});if(!l)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return l},t[0]=e,t[1]=s,t[2]=i):i=t[2];let a;t[3]!==e||t[4]!==n?(a=u=>{n.setQueryData(_.organizationSettings(e.id),l=>({...l??O,...u}))},t[3]=e,t[4]=n,t[5]=a):a=t[5];let r;return t[6]!==i||t[7]!==a?(r={mutationFn:i,onSuccess:a},t[6]=i,t[7]=a,t[8]=r):r=t[8],D(r)}function F(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:w}function J(){const{data:t}=c(U);return t??w}function U(t){return F(t.simple_mode)}function V(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r)=>e.mutate({simple_mode:a},r),n=(a,r)=>e.mutateAsync({simple_mode:a},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function X(){return k("reports_only")}function k(t){const e=o.c(5);let s;e[0]!==t?(s=a=>Q(a.flags,t),e[0]=t,e[1]=s):s=e[1];const{data:n}=c(s);let i;return e[2]!==n||e[3]!==t?(i=n??P.has(t),e[2]=n,e[3]=t,e[4]=i):i=e[4],i}function tt(){const{data:t}=c(x);return t??!0}function x(t){return C(t.flags)}function et(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r,u)=>e.mutate({flags:{[a]:r}},u),n=(a,r,u)=>e.mutateAsync({flags:{[a]:r}},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function q(){const{data:t}=c(K);return t??null}function K(t){return t.registry_config}function nt(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r)=>e.mutate({registry_config:a},r),n=(a,r)=>e.mutateAsync({registry_config:a},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function st(){const{data:t}=c(Y);return t??null}function Y(t){return t.default_home_agents}function H(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r)=>e.mutate({default_home_agents:a},r),n=(a,r)=>e.mutateAsync({default_home_agents:a},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function it(){const t=o.c(14),{org:e}=y(),s=H(),n=I();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=Promise.resolve(),t[0]=i):i=t[0];const a=M.useRef(i);let r;t[1]!==e.id?(r=_.organizationSettings(e.id),t[1]=e.id,t[2]=r):r=t[2];const u=r;let l;t[3]!==u||t[4]!==n?(l=()=>n.getQueryData(u)?.default_home_agents?.ids??[],t[3]=u,t[4]=n,t[5]=l):l=t[5];const p=l;let d;t[6]!==u||t[7]!==e.slug||t[8]!==n||t[9]!==s?(d=b=>{const S=a.current.then(async()=>{const E=n.getQueryData(u),A=b(E?.default_home_agents?.ids??[]);if(A!==null){n.setQueryData(u,m=>m&&{...m,default_home_agents:{ids:A}});try{await s.mutateAsync({ids:A}),await n.refetchQueries({queryKey:_.homeNextActions(e.slug),type:"active"})}catch(m){const R=m;throw n.setQueryData(u,E),R}}});return a.current=S.catch(L),S},t[6]=u,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=d):d=t[10];const h=d;let g;return t[11]!==h||t[12]!==p?(g={currentIds:p,apply:h},t[11]=h,t[12]=p,t[13]=g):g=t[13],g}function L(){}function at(){const t=o.c(3),{data:e,isPending:s}=c(W),n=e??null;let i;return t[0]!==s||t[1]!==n?(i={mainAgentId:n,isPending:s},t[0]=s,t[1]=n,t[2]=i):i=t[2],i}function W(t){return t.main_agent_id??null}function rt(){const t=o.c(7),e=f();let s,n;t[0]!==e?(s=(a,r)=>e.mutate({main_agent_id:a},r),n=(a,r)=>e.mutateAsync({main_agent_id:a},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function ut(){const t=o.c(5),{org:e}=y(),s=q();let n;t[0]!==e.id?(n=G.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const i=n;let a;return t[2]!==i||t[3]!==s?(a=r=>{if(!s)return r===i;const u=s.registries[r];return u?u.enabled:r===i},t[2]=i,t[3]=s,t[4]=a):a=t[4],a}export{X as a,J as b,st as c,it as d,tt as e,at as f,ut as g,B as h,rt as i,V as j,q as k,et as l,nt as m,k as u};
|
package/dist/client/assets/{use-panel-navigate-C8-xot4V.js → use-panel-navigate-CzBWJmh4.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as y,b as D,j as d,B as E,r as B,I as z,u as k,f as _,H as $,d as M,a4 as F,bM as L,dF as C,dG as K,dH as G,dI as J}from"./index-DHLutK6v.js";import{b as Y,h as Q,a as W,d as X,e as q}from"./dialog-DYg0AoO0.js";import{i as Z}from"./Check-C5RWnyNL.js";import{a as ee}from"./Copy01-DhfruII6.js";import{n as te}from"./Download01-C1FmC7JV.js";import{u as O,D as b}from"./use-destination-route-BMJNYrmL.js";import{a as U}from"./constants-dLUUoWH7.js";const ne="https://github.com/decocms/studio/releases";function ae(){return`curl -fsSL ${window.location.origin}/install.sh | sh`}function re(e){return`https://github.com/decocms/studio/releases/download/native-v${e}/deco-${e}-linux-x86_64.AppImage`}function Le(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)&&!("ontouchend"in document)}function oe(){return typeof navigator<"u"&&/Linux/.test(navigator.platform)&&!/Android/.test(navigator.userAgent)&&!("ontouchend"in document)}async function se(e,t){if(!e)return!1;try{return await e.writeText(t),!0}catch{return!1}}function V(e){const t=y.c(12),{copiedLabel:n}=e,a=D(),[r,o]=B.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=ae(),t[0]=l):l=t[0];const s=l;let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx("code",{className:"block rounded-md border bg-muted px-3 py-2.5 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap select-all",children:s}),t[1]=c):c=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{se(navigator.clipboard,s).then(p=>{p&&(o(!0),setTimeout(()=>o(!1),2e3))})},t[2]=i):i=t[2];let u;t[3]!==r?(u=r?d.jsx(Z,{size:16}):d.jsx(ee,{size:16}),t[3]=r,t[4]=u):u=t[4];let f;t[5]!==r||t[6]!==n||t[7]!==a?(f=r?n:a("downloadApp.copyLabel"),t[5]=r,t[6]=n,t[7]=a,t[8]=f):f=t[8];let m;return t[9]!==u||t[10]!==f?(m=d.jsxs("div",{className:"flex flex-col gap-3",children:[c,d.jsxs(E,{type:"button",className:"w-full gap-2",onClick:i,children:[u,f]})]}),t[9]=u,t[10]=f,t[11]=m):m=t[11],m}function le(){const e=y.c(18),t=D();let n;e[0]!==t?(n=t("downloadApp.copiedLabel"),e[0]=t,e[1]=n):n=e[1];let a;e[2]!==n?(a=d.jsx(V,{copiedLabel:n}),e[2]=n,e[3]=a):a=e[3];let r;e[4]!==t?(r=t("downloadApp.terminalHint"),e[4]=t,e[5]=r):r=e[5];let o;e[6]!==r?(o=d.jsx("p",{children:r}),e[6]=r,e[7]=o):o=e[7];let l;e[8]!==t?(l=t("downloadApp.appleSiliconNote"),e[8]=t,e[9]=l):l=e[9];let s;e[10]!==l?(s=d.jsx("p",{children:l}),e[10]=l,e[11]=s):s=e[11];let c;e[12]!==o||e[13]!==s?(c=d.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[o,s]}),e[12]=o,e[13]=s,e[14]=c):c=e[14];let i;return e[15]!==a||e[16]!==c?(i=d.jsxs(d.Fragment,{children:[a,c]}),e[15]=a,e[16]=c,e[17]=i):i=e[17],i}function ce(){const e=y.c(42),t=D();let n;e[0]!==t?(n=t("downloadApp.copiedLabelLinux"),e[0]=t,e[1]=n):n=e[1];let a;e[2]!==n?(a=d.jsx(V,{copiedLabel:n}),e[2]=n,e[3]=a):a=e[3];let r;e[4]!==t?(r=t("downloadApp.linuxInstallerHint"),e[4]=t,e[5]=r):r=e[5];let o;e[6]!==r?(o=d.jsx("p",{children:r}),e[6]=r,e[7]=o):o=e[7];let l;e[8]!==t?(l=t("downloadApp.linuxArchNote"),e[8]=t,e[9]=l):l=e[9];let s;e[10]!==l?(s=d.jsx("p",{children:l}),e[10]=l,e[11]=s):s=e[11];let c;e[12]!==o||e[13]!==s?(c=d.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[o,s]}),e[12]=o,e[13]=s,e[14]=c):c=e[14];let i;e[15]!==t?(i=t("downloadApp.linuxDirectDownloadHint"),e[15]=t,e[16]=i):i=e[16];let u;e[17]!==i?(u=d.jsx("p",{children:i}),e[17]=i,e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=re("4.294.2"),e[19]=f):f=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=d.jsx(te,{size:14}),e[20]=m):m=e[20];let p;e[21]!==t?(p=t("downloadApp.downloadAppImage"),e[21]=t,e[22]=p):p=e[22];let x;e[23]!==p?(x=d.jsx(E,{asChild:!0,variant:"outline",size:"sm",className:"gap-2",children:d.jsxs("a",{href:f,rel:"noreferrer",children:[m,p]})}),e[23]=p,e[24]=x):x=e[24];let v;e[25]!==t?(v=t("downloadApp.linuxChmodHint"),e[25]=t,e[26]=v):v=e[26];let h;e[27]!==v?(h=d.jsx("p",{children:v}),e[27]=v,e[28]=h):h=e[28];let S;e[29]!==t?(S=t("downloadApp.allReleases"),e[29]=t,e[30]=S):S=e[30];let g;e[31]!==S?(g=d.jsx("a",{href:ne,target:"_blank",rel:"noreferrer",className:"underline-offset-2 hover:text-foreground hover:underline",children:S}),e[31]=S,e[32]=g):g=e[32];let I;e[33]!==x||e[34]!==h||e[35]!==g||e[36]!==u?(I=d.jsxs("div",{className:"flex flex-col items-start gap-2 border-t pt-4 text-xs text-muted-foreground",children:[u,x,h,g]}),e[33]=x,e[34]=h,e[35]=g,e[36]=u,e[37]=I):I=e[37];let j;return e[38]!==a||e[39]!==I||e[40]!==c?(j=d.jsxs(d.Fragment,{children:[a,c,I]}),e[38]=a,e[39]=I,e[40]=c,e[41]=j):j=e[41],j}function Re(e){const t=y.c(19),{open:n,onOpenChange:a}=e,r=D();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=oe(),t[0]=o):o=t[0];const l=o;let s;t[1]!==r?(s=r("downloadApp.title"),t[1]=r,t[2]=s):s=t[2];let c;t[3]!==s?(c=d.jsx(Y,{children:s}),t[3]=s,t[4]=c):c=t[4];let i;t[5]!==r?(i=r(l?"downloadApp.linuxDescription":"downloadApp.description"),t[5]=r,t[6]=i):i=t[6];let u;t[7]!==i?(u=d.jsx(Q,{children:i}),t[7]=i,t[8]=u):u=t[8];let f;t[9]!==c||t[10]!==u?(f=d.jsxs(W,{children:[c,u]}),t[9]=c,t[10]=u,t[11]=f):f=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=l?d.jsx(ce,{}):d.jsx(le,{}),t[12]=m):m=t[12];let p;t[13]!==f?(p=d.jsxs(X,{className:"sm:max-w-md",children:[f,m]}),t[13]=f,t[14]=p):p=t[14];let x;return t[15]!==a||t[16]!==n||t[17]!==p?(x=d.jsx(q,{open:n,onOpenChange:a,children:p}),t[15]=a,t[16]=n,t[17]=p,t[18]=x):x=t[18],x}const ie=1e4,Ee="true",P=2;function N(e,t){return z.chatAutosend(e,t)}function de(e){return e==="pending"||e==="sending"}function ue(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;const n=t;let a=0;n.status==="sending"?a=n.retryAt===void 0?1:P:n.retryAt!==void 0&&(a=1);const r=n.attempt===void 0?a:n.attempt;return typeof n.createdAt!="number"||typeof n.message!="object"||!de(n.status)||n.retryAt!==void 0&&typeof n.retryAt!="number"||typeof r!="number"||!Number.isInteger(r)||r<0||r>P?null:{...t,attempt:r}}function $e(e,t,n,a,r=Date.now()){const o={message:a,createdAt:r,status:"pending",attempt:0};return e.setItem(N(t,n),JSON.stringify(o)),o}function fe(e,t,n){const a=N(t,n),r=ue(e.getItem(a));return r||(e.removeItem(a),null)}function Me(e,t,n,a=Date.now()){const r=N(t,n),o=fe(e,t,n);if(!o||o.status!=="pending")return null;if(o.attempt>=P)return e.removeItem(r),null;const l=o.retryAt??o.createdAt;if(a-l>=ie)return e.removeItem(r),null;const s={...o,status:"sending",attempt:o.attempt+1};return e.setItem(r,JSON.stringify(s)),{message:s.message,createdAt:s.createdAt,attempt:s.attempt}}function Ce(e,t,n){e.removeItem(N(t,n))}const pe="/shell/$org/org-shell/agent-shell";function me(e){return e.threadInSearch||!e.threadId?{to:"."}:{to:"/$org/$taskId",params:{org:e.orgSlug,taskId:e.threadId}}}function he(e){return e.taskIdParam??e.threadSearch??null}function Oe(){const e=y.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=_(t);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const r=k(a);let o;return e[2]!==n.taskId||e[3]!==r.thread?(o=he({taskIdParam:n.taskId,threadSearch:r.thread}),e[2]=n.taskId,e[3]=r.thread,e[4]=o):o=e[4],o}function ge(e){return e.projectParam?e.projectParam:e.legacyRoute?e.virtualMcpIdSearch:void 0}function H(){const e=y.c(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=_(t);let a;return e[1]!==n.panel||e[2]!==n.project?(a=L({project:n.project,panel:n.panel}),e[1]=n.panel,e[2]=n.project,e[3]=a):a=e[3],a}function xe(){return H().project}function je(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0],_(t).taskId!==void 0}function Ie(){const e=y.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=k(t),a=xe(),r=je();let o;return e[1]!==r||e[2]!==a||e[3]!==n.virtualmcpid?(o=ge({projectParam:a,virtualMcpIdSearch:n.virtualmcpid,legacyRoute:r}),e[1]=r,e[2]=a,e[3]=n.virtualmcpid,e[4]=o):o=e[4],o}function Ue(){const e=y.c(3),{org:t}=$(),n=Ie();let a;return e[0]!==t||e[1]!==n?(a=n??U(t.id).id,e[0]=t,e[1]=n,e[2]=a):a=e[2],a}function Se(e){const t={...e.prev,...e.changes,thread:e.threadId};return delete t.virtualmcpid,t}function Ve(e){return e.routeAgentId??e.threadVirtualMcpId??null}function ve(e){if(e.targetVirtualMcpId===void 0)return{kind:"stay",project:e.currentProject};const t=e.targetVirtualMcpId===e.decopilotId?void 0:e.targetVirtualMcpId;return t!==void 0&&e.currentProject===void 0?{kind:"relocate",project:t}:{kind:"stay",project:t}}function ye(){const e=y.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=_(t);let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:pe,shouldThrow:!1},e[1]=a):a=e[1],!!F(a)&&n.taskId===void 0}function He(){const e=y.c(12),t=M();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const a=_(n),r=ye(),{org:o}=$(),l=a.org??"",{project:s,panel:c}=H(),i=s!==void 0,u=O()===b.agents;let f;e[1]!==o.id?(f=U(o.id),e[1]=o.id,e[2]=f):f=e[2];const m=f.id;let p;return e[3]!==c||e[4]!==s||e[5]!==m||e[6]!==t||e[7]!==u||e[8]!==l||e[9]!==i||e[10]!==r?(p=(x,v,h)=>{const S=me({threadInSearch:r,orgSlug:l,threadId:x}),g=h?.replace??!1;if(S.to==="/$org/$taskId")return t({to:S.to,params:S.params,search:v,replace:g});const I=ve({currentProject:s,targetVirtualMcpId:h?.virtualMcpId,decopilotId:m}),j=h?.view&&h.view.tabId!==void 0?C(h.view.tabId):h?.view?{panel:void 0,payload:K()}:null,T=I.kind==="relocate"&&!u,w=A=>Se({prev:T?{sidepanel:A.sidepanel}:A,changes:{...v(A),...j?.payload??{}},threadId:x});return I.kind==="relocate"?t({to:b.agents,params:{org:l,project:I.project,panel:j?j.panel:c},search:w,replace:g}):t({to:".",params:A=>{const R=i?{...A,project:I.project}:A;return j?{...R,panel:j.panel}:R},search:w,replace:g})},e[3]=c,e[4]=s,e[5]=m,e[6]=t,e[7]=u,e[8]=l,e[9]=i,e[10]=r,e[11]=p):p=e[11],p}const Ae={board:b.tasks,files:b.library,reports:b.reports,overview:b.home};function Be(){const e=y.c(6);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=_(t);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const r=k(a);let o;if(e[2]!==n.panel||e[3]!==n.project||e[4]!==r){const{panel:l}=L({project:n.project,panel:n.panel});o=G(l,r),e[2]=n.panel,e[3]=n.project,e[4]=r,e[5]=o}else o=e[5];return o}function ze(){const e=y.c(17),t=M();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const a=_(n);let r;e[1]!==a.panel||e[2]!==a.project?(r=L({project:a.project,panel:a.panel}),e[1]=a.panel,e[2]=a.project,e[3]=r):r=e[3];const{project:o}=r,l=a.org??"",s=O()===b.agents,c=a.taskId;let i;e[4]!==c?(i=(h,S,g)=>I=>{const j=S?{...I}:{thread:I.thread,sidepanel:I.sidepanel};return c&&(j.thread=c),{...g?.search?g.search(j):j,...h,mainpanel:void 0}},e[4]=c,e[5]=i):i=e[5];const u=i;let f;e[6]!==o||e[7]!==t||e[8]!==u||e[9]!==s||e[10]!==l?(f=(h,S)=>{const{panel:g,payload:I}=C(h),j=S?.replace??!0,T=!!g&&J(g),w=u(I,s&&!T,S);if(g&&T){const A=Ae[g];if(A===b.tasks){t({to:A,params:{org:l,taskKey:void 0},search:w,replace:j});return}t({to:A,params:{org:l},search:w,replace:j});return}t({to:b.agents,params:{org:l,project:S?.project??o,panel:g},search:w,replace:j})},e[6]=o,e[7]=t,e[8]=u,e[9]=s,e[10]=l,e[11]=f):f=e[11];const m=f;let p;e[12]!==t?(p=h=>t({to:".",search:be,replace:h?.replace??!0}),e[12]=t,e[13]=p):p=e[13];const x=p;let v;return e[14]!==x||e[15]!==m?(v={openPanel:m,closePanel:x},e[14]=x,e[15]=m,e[16]=v):v=e[16],v}function be(e){return{...e,mainpanel:!1}}export{Ee as A,Re as D,oe as a,Oe as b,ze as c,He as d,Be as e,Ie as f,Ue as g,Me as h,Le as i,Ce as j,Ve as r,xe as u,$e as w};
|
|
1
|
+
import{c as y,b as D,j as d,B as E,r as B,I as z,u as k,f as _,H as $,d as M,a4 as F,bM as L,dF as C,dG as K,dH as G,dI as J}from"./index-BWXyDl1J.js";import{b as Y,h as Q,a as W,d as X,e as q}from"./dialog-D4htx8Dz.js";import{i as Z}from"./Check-CTKt7DPp.js";import{a as ee}from"./Copy01-C-9zesbF.js";import{n as te}from"./Download01-DYsmBrAR.js";import{u as O,D as b}from"./use-destination-route-C8wZaTLq.js";import{a as U}from"./constants-dLUUoWH7.js";const ne="https://github.com/decocms/studio/releases";function ae(){return`curl -fsSL ${window.location.origin}/install.sh | sh`}function re(e){return`https://github.com/decocms/studio/releases/download/native-v${e}/deco-${e}-linux-x86_64.AppImage`}function Le(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)&&!("ontouchend"in document)}function oe(){return typeof navigator<"u"&&/Linux/.test(navigator.platform)&&!/Android/.test(navigator.userAgent)&&!("ontouchend"in document)}async function se(e,t){if(!e)return!1;try{return await e.writeText(t),!0}catch{return!1}}function V(e){const t=y.c(12),{copiedLabel:n}=e,a=D(),[r,o]=B.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=ae(),t[0]=l):l=t[0];const s=l;let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx("code",{className:"block rounded-md border bg-muted px-3 py-2.5 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap select-all",children:s}),t[1]=c):c=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{se(navigator.clipboard,s).then(p=>{p&&(o(!0),setTimeout(()=>o(!1),2e3))})},t[2]=i):i=t[2];let u;t[3]!==r?(u=r?d.jsx(Z,{size:16}):d.jsx(ee,{size:16}),t[3]=r,t[4]=u):u=t[4];let f;t[5]!==r||t[6]!==n||t[7]!==a?(f=r?n:a("downloadApp.copyLabel"),t[5]=r,t[6]=n,t[7]=a,t[8]=f):f=t[8];let m;return t[9]!==u||t[10]!==f?(m=d.jsxs("div",{className:"flex flex-col gap-3",children:[c,d.jsxs(E,{type:"button",className:"w-full gap-2",onClick:i,children:[u,f]})]}),t[9]=u,t[10]=f,t[11]=m):m=t[11],m}function le(){const e=y.c(18),t=D();let n;e[0]!==t?(n=t("downloadApp.copiedLabel"),e[0]=t,e[1]=n):n=e[1];let a;e[2]!==n?(a=d.jsx(V,{copiedLabel:n}),e[2]=n,e[3]=a):a=e[3];let r;e[4]!==t?(r=t("downloadApp.terminalHint"),e[4]=t,e[5]=r):r=e[5];let o;e[6]!==r?(o=d.jsx("p",{children:r}),e[6]=r,e[7]=o):o=e[7];let l;e[8]!==t?(l=t("downloadApp.appleSiliconNote"),e[8]=t,e[9]=l):l=e[9];let s;e[10]!==l?(s=d.jsx("p",{children:l}),e[10]=l,e[11]=s):s=e[11];let c;e[12]!==o||e[13]!==s?(c=d.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[o,s]}),e[12]=o,e[13]=s,e[14]=c):c=e[14];let i;return e[15]!==a||e[16]!==c?(i=d.jsxs(d.Fragment,{children:[a,c]}),e[15]=a,e[16]=c,e[17]=i):i=e[17],i}function ce(){const e=y.c(42),t=D();let n;e[0]!==t?(n=t("downloadApp.copiedLabelLinux"),e[0]=t,e[1]=n):n=e[1];let a;e[2]!==n?(a=d.jsx(V,{copiedLabel:n}),e[2]=n,e[3]=a):a=e[3];let r;e[4]!==t?(r=t("downloadApp.linuxInstallerHint"),e[4]=t,e[5]=r):r=e[5];let o;e[6]!==r?(o=d.jsx("p",{children:r}),e[6]=r,e[7]=o):o=e[7];let l;e[8]!==t?(l=t("downloadApp.linuxArchNote"),e[8]=t,e[9]=l):l=e[9];let s;e[10]!==l?(s=d.jsx("p",{children:l}),e[10]=l,e[11]=s):s=e[11];let c;e[12]!==o||e[13]!==s?(c=d.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[o,s]}),e[12]=o,e[13]=s,e[14]=c):c=e[14];let i;e[15]!==t?(i=t("downloadApp.linuxDirectDownloadHint"),e[15]=t,e[16]=i):i=e[16];let u;e[17]!==i?(u=d.jsx("p",{children:i}),e[17]=i,e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=re("4.294.3"),e[19]=f):f=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=d.jsx(te,{size:14}),e[20]=m):m=e[20];let p;e[21]!==t?(p=t("downloadApp.downloadAppImage"),e[21]=t,e[22]=p):p=e[22];let x;e[23]!==p?(x=d.jsx(E,{asChild:!0,variant:"outline",size:"sm",className:"gap-2",children:d.jsxs("a",{href:f,rel:"noreferrer",children:[m,p]})}),e[23]=p,e[24]=x):x=e[24];let v;e[25]!==t?(v=t("downloadApp.linuxChmodHint"),e[25]=t,e[26]=v):v=e[26];let h;e[27]!==v?(h=d.jsx("p",{children:v}),e[27]=v,e[28]=h):h=e[28];let S;e[29]!==t?(S=t("downloadApp.allReleases"),e[29]=t,e[30]=S):S=e[30];let g;e[31]!==S?(g=d.jsx("a",{href:ne,target:"_blank",rel:"noreferrer",className:"underline-offset-2 hover:text-foreground hover:underline",children:S}),e[31]=S,e[32]=g):g=e[32];let I;e[33]!==x||e[34]!==h||e[35]!==g||e[36]!==u?(I=d.jsxs("div",{className:"flex flex-col items-start gap-2 border-t pt-4 text-xs text-muted-foreground",children:[u,x,h,g]}),e[33]=x,e[34]=h,e[35]=g,e[36]=u,e[37]=I):I=e[37];let j;return e[38]!==a||e[39]!==I||e[40]!==c?(j=d.jsxs(d.Fragment,{children:[a,c,I]}),e[38]=a,e[39]=I,e[40]=c,e[41]=j):j=e[41],j}function Re(e){const t=y.c(19),{open:n,onOpenChange:a}=e,r=D();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=oe(),t[0]=o):o=t[0];const l=o;let s;t[1]!==r?(s=r("downloadApp.title"),t[1]=r,t[2]=s):s=t[2];let c;t[3]!==s?(c=d.jsx(Y,{children:s}),t[3]=s,t[4]=c):c=t[4];let i;t[5]!==r?(i=r(l?"downloadApp.linuxDescription":"downloadApp.description"),t[5]=r,t[6]=i):i=t[6];let u;t[7]!==i?(u=d.jsx(Q,{children:i}),t[7]=i,t[8]=u):u=t[8];let f;t[9]!==c||t[10]!==u?(f=d.jsxs(W,{children:[c,u]}),t[9]=c,t[10]=u,t[11]=f):f=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=l?d.jsx(ce,{}):d.jsx(le,{}),t[12]=m):m=t[12];let p;t[13]!==f?(p=d.jsxs(X,{className:"sm:max-w-md",children:[f,m]}),t[13]=f,t[14]=p):p=t[14];let x;return t[15]!==a||t[16]!==n||t[17]!==p?(x=d.jsx(q,{open:n,onOpenChange:a,children:p}),t[15]=a,t[16]=n,t[17]=p,t[18]=x):x=t[18],x}const ie=1e4,Ee="true",P=2;function N(e,t){return z.chatAutosend(e,t)}function de(e){return e==="pending"||e==="sending"}function ue(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;const n=t;let a=0;n.status==="sending"?a=n.retryAt===void 0?1:P:n.retryAt!==void 0&&(a=1);const r=n.attempt===void 0?a:n.attempt;return typeof n.createdAt!="number"||typeof n.message!="object"||!de(n.status)||n.retryAt!==void 0&&typeof n.retryAt!="number"||typeof r!="number"||!Number.isInteger(r)||r<0||r>P?null:{...t,attempt:r}}function $e(e,t,n,a,r=Date.now()){const o={message:a,createdAt:r,status:"pending",attempt:0};return e.setItem(N(t,n),JSON.stringify(o)),o}function fe(e,t,n){const a=N(t,n),r=ue(e.getItem(a));return r||(e.removeItem(a),null)}function Me(e,t,n,a=Date.now()){const r=N(t,n),o=fe(e,t,n);if(!o||o.status!=="pending")return null;if(o.attempt>=P)return e.removeItem(r),null;const l=o.retryAt??o.createdAt;if(a-l>=ie)return e.removeItem(r),null;const s={...o,status:"sending",attempt:o.attempt+1};return e.setItem(r,JSON.stringify(s)),{message:s.message,createdAt:s.createdAt,attempt:s.attempt}}function Ce(e,t,n){e.removeItem(N(t,n))}const pe="/shell/$org/org-shell/agent-shell";function me(e){return e.threadInSearch||!e.threadId?{to:"."}:{to:"/$org/$taskId",params:{org:e.orgSlug,taskId:e.threadId}}}function he(e){return e.taskIdParam??e.threadSearch??null}function Oe(){const e=y.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=_(t);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const r=k(a);let o;return e[2]!==n.taskId||e[3]!==r.thread?(o=he({taskIdParam:n.taskId,threadSearch:r.thread}),e[2]=n.taskId,e[3]=r.thread,e[4]=o):o=e[4],o}function ge(e){return e.projectParam?e.projectParam:e.legacyRoute?e.virtualMcpIdSearch:void 0}function H(){const e=y.c(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=_(t);let a;return e[1]!==n.panel||e[2]!==n.project?(a=L({project:n.project,panel:n.panel}),e[1]=n.panel,e[2]=n.project,e[3]=a):a=e[3],a}function xe(){return H().project}function je(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0],_(t).taskId!==void 0}function Ie(){const e=y.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=k(t),a=xe(),r=je();let o;return e[1]!==r||e[2]!==a||e[3]!==n.virtualmcpid?(o=ge({projectParam:a,virtualMcpIdSearch:n.virtualmcpid,legacyRoute:r}),e[1]=r,e[2]=a,e[3]=n.virtualmcpid,e[4]=o):o=e[4],o}function Ue(){const e=y.c(3),{org:t}=$(),n=Ie();let a;return e[0]!==t||e[1]!==n?(a=n??U(t.id).id,e[0]=t,e[1]=n,e[2]=a):a=e[2],a}function Se(e){const t={...e.prev,...e.changes,thread:e.threadId};return delete t.virtualmcpid,t}function Ve(e){return e.routeAgentId??e.threadVirtualMcpId??null}function ve(e){if(e.targetVirtualMcpId===void 0)return{kind:"stay",project:e.currentProject};const t=e.targetVirtualMcpId===e.decopilotId?void 0:e.targetVirtualMcpId;return t!==void 0&&e.currentProject===void 0?{kind:"relocate",project:t}:{kind:"stay",project:t}}function ye(){const e=y.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=_(t);let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:pe,shouldThrow:!1},e[1]=a):a=e[1],!!F(a)&&n.taskId===void 0}function He(){const e=y.c(12),t=M();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const a=_(n),r=ye(),{org:o}=$(),l=a.org??"",{project:s,panel:c}=H(),i=s!==void 0,u=O()===b.agents;let f;e[1]!==o.id?(f=U(o.id),e[1]=o.id,e[2]=f):f=e[2];const m=f.id;let p;return e[3]!==c||e[4]!==s||e[5]!==m||e[6]!==t||e[7]!==u||e[8]!==l||e[9]!==i||e[10]!==r?(p=(x,v,h)=>{const S=me({threadInSearch:r,orgSlug:l,threadId:x}),g=h?.replace??!1;if(S.to==="/$org/$taskId")return t({to:S.to,params:S.params,search:v,replace:g});const I=ve({currentProject:s,targetVirtualMcpId:h?.virtualMcpId,decopilotId:m}),j=h?.view&&h.view.tabId!==void 0?C(h.view.tabId):h?.view?{panel:void 0,payload:K()}:null,T=I.kind==="relocate"&&!u,w=A=>Se({prev:T?{sidepanel:A.sidepanel}:A,changes:{...v(A),...j?.payload??{}},threadId:x});return I.kind==="relocate"?t({to:b.agents,params:{org:l,project:I.project,panel:j?j.panel:c},search:w,replace:g}):t({to:".",params:A=>{const R=i?{...A,project:I.project}:A;return j?{...R,panel:j.panel}:R},search:w,replace:g})},e[3]=c,e[4]=s,e[5]=m,e[6]=t,e[7]=u,e[8]=l,e[9]=i,e[10]=r,e[11]=p):p=e[11],p}const Ae={board:b.tasks,files:b.library,reports:b.reports,overview:b.home};function Be(){const e=y.c(6);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=_(t);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const r=k(a);let o;if(e[2]!==n.panel||e[3]!==n.project||e[4]!==r){const{panel:l}=L({project:n.project,panel:n.panel});o=G(l,r),e[2]=n.panel,e[3]=n.project,e[4]=r,e[5]=o}else o=e[5];return o}function ze(){const e=y.c(17),t=M();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const a=_(n);let r;e[1]!==a.panel||e[2]!==a.project?(r=L({project:a.project,panel:a.panel}),e[1]=a.panel,e[2]=a.project,e[3]=r):r=e[3];const{project:o}=r,l=a.org??"",s=O()===b.agents,c=a.taskId;let i;e[4]!==c?(i=(h,S,g)=>I=>{const j=S?{...I}:{thread:I.thread,sidepanel:I.sidepanel};return c&&(j.thread=c),{...g?.search?g.search(j):j,...h,mainpanel:void 0}},e[4]=c,e[5]=i):i=e[5];const u=i;let f;e[6]!==o||e[7]!==t||e[8]!==u||e[9]!==s||e[10]!==l?(f=(h,S)=>{const{panel:g,payload:I}=C(h),j=S?.replace??!0,T=!!g&&J(g),w=u(I,s&&!T,S);if(g&&T){const A=Ae[g];if(A===b.tasks){t({to:A,params:{org:l,taskKey:void 0},search:w,replace:j});return}t({to:A,params:{org:l},search:w,replace:j});return}t({to:b.agents,params:{org:l,project:S?.project??o,panel:g},search:w,replace:j})},e[6]=o,e[7]=t,e[8]=u,e[9]=s,e[10]=l,e[11]=f):f=e[11];const m=f;let p;e[12]!==t?(p=h=>t({to:".",search:be,replace:h?.replace??!0}),e[12]=t,e[13]=p):p=e[13];const x=p;let v;return e[14]!==x||e[15]!==m?(v={openPanel:m,closePanel:x},e[14]=x,e[15]=m,e[16]=v):v=e[16],v}function be(e){return{...e,mainpanel:!1}}export{Ee as A,Re as D,oe as a,Oe as b,ze as c,He as d,Be as e,Ie as f,Ue as g,Me as h,Le as i,Ce as j,Ve as r,xe as u,$e as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C,H as R}from"./index-
|
|
1
|
+
import{c as C,H as R}from"./index-BWXyDl1J.js";import{u as p}from"./use-connection-tOCjDBfx.js";import{W as a}from"./constants-dLUUoWH7.js";import{k as y}from"./use-organization-settings-CGbImq1L.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 o,H as u,ac as r,K as l,z as d,p as f,e as S}from"./index-
|
|
1
|
+
import{c as o,H as u,ac as r,K as l,z as d,p as f,e as S}from"./index-BWXyDl1J.js";function C(){const e=o.c(7),{org:a}=u(),c=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]!==c?(t=async()=>await c.call("SECRET_LIST",{}),e[2]=c,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:n}=d(s);return n.secrets}function m(){const e=o.c(8),{org:a}=u(),c=r(),i=f();let t;e[0]!==c?(t=async y=>await c.call("SECRET_CREATE",{...y}),e[0]=c,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 n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{m as a,C as u};
|
|
@@ -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-BWXyDl1J.js";import{ag as q}from"./agent-icon-LbhnjHwi.js";import{i as Y}from"./SearchMd-DbgBw9S_.js";import{e as Z,d as ee,b as te,a as se}from"./dialog-D4htx8Dz.js";import{I as re}from"./input-BmuxVBRq.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-eyTxS6Bz.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-BWXyDl1J.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-DFaxDB0Z.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,ac 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,ac as y,o as m,p as g,e as T,K as l,t as E}from"./index-BWXyDl1J.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-BWXyDl1J.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,fe as P,cc as p,K as L,cb as S,o as V}from"./index-
|
|
1
|
+
import{c as d,H as a,fe as P,cc as p,K as L,cb as S,o as V}from"./index-BWXyDl1J.js";import{u as g}from"./use-mcp-client-DHZ5WVmn.js";import{S as f}from"./constants-dLUUoWH7.js";function y(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:f,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 b(s){const t=d.c(3),{org:e}=a();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:f,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:f,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,u;t[3]!==s||t[4]!==e.id?(o=[...s].sort(),u=V,l=L.virtualMcpLastUsed(e.id,o),t[3]=s,t[4]=e.id,t[5]=o,t[6]=l,t[7]=u):(o=t[5],l=t[6],u=t[7]);const C=o.length>0;let c;t[8]!==i||t[9]!==o?(c=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]=c):c=t[10];let r;return t[11]!==l||t[12]!==C||t[13]!==c?(r={queryKey:l,enabled:C,staleTime:3e4,queryFn:c},t[11]=l,t[12]=C,t[13]=c,t[14]=r):r=t[14],u(r)}function E(){const s=d.c(3),{org:t}=a();let e;s[0]!==t.id||s[1]!==t.slug?(e={connectionId:f,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{b as a,E as b,R as c,y as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as i}from"./use-infinite-scroll-BUgjJwY5.js";import{fi as u}from"./index-BWXyDl1J.js";function t(e,r){return u(e,i,r)}export{t as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as s}from"./use-infinite-scroll-BUgjJwY5.js";import{fi as u,b$ as n}from"./index-BWXyDl1J.js";function i(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{i 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-BWXyDl1J.js";import{C as G}from"./collection-table-wrapper-BFeQBjk_.js";import{E as L}from"./empty-state-DANnu2Dm.js";import{S as H}from"./search-input-i6XUS8wH.js";import{A as X}from"./avatar-DKKheiwZ.js";import{B as D}from"./badge-BCfyeFAT.js";import{u as Z}from"./use-debounced-value-DBMZQqKo.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-DSRHVWxU.js";import"./ArrowUp-C9wijSHC.js";import"./SearchMd-DbgBw9S_.js";import"./User01-BmKTu46m.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};
|