decocms 3.89.0 → 3.89.2
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-BMCh3ayd.js → AlertCircle-flSoo6uw.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CwVMUp5O.js → ArrowUpRight-BeOMO89N.js} +1 -1
- package/dist/client/assets/{CheckCircle-BP2lb3AX.js → CheckCircle-B9ekAAw-.js} +1 -1
- package/dist/client/assets/{ChevronDown-CkcGr2qp.js → ChevronDown-BWfuTI7r.js} +1 -1
- package/dist/client/assets/{ChevronLeft-Cgw9JZYG.js → ChevronLeft-BNcg18cx.js} +1 -1
- package/dist/client/assets/{ChevronRight-DYe9AFXl.js → ChevronRight-ChYOVgWd.js} +1 -1
- package/dist/client/assets/{ChevronUp-CiXD4kQk.js → ChevronUp-BhWz3ylT.js} +1 -1
- package/dist/client/assets/{DotsVertical-Z_h1bSB3.js → DotsVertical-C0YWb9xq.js} +1 -1
- package/dist/client/assets/{Eye-B92Ff4dY.js → Eye-DWTUBTZ_.js} +1 -1
- package/dist/client/assets/{FilterLines-CMHeCbJ1.js → FilterLines-Djqj6uj_.js} +1 -1
- package/dist/client/assets/{Form-GDlYmtQN.js → Form-Czxo_N56.js} +1 -1
- package/dist/client/assets/{Globe01-MZlo2_34.js → Globe01-BgRW2EiE.js} +1 -1
- package/dist/client/assets/{Globe04-BPWbnzx0.js → Globe04-XITcP2mp.js} +1 -1
- package/dist/client/assets/{HardDrive-D8FSpDtM.js → HardDrive-DS3VxDtU.js} +1 -1
- package/dist/client/assets/{Key01-CZVV-ceU.js → Key01-DX7L8s0Z.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CuTI_WR9.js → LayoutLeft-BqtFvEWV.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DekFjc9P.js → LinkExternal01-Cf-6A1_h.js} +1 -1
- package/dist/client/assets/{Monitor01-BxGhRsUq.js → Monitor01-CZ30bS8J.js} +1 -1
- package/dist/client/assets/{Palette-BDlA8RUr.js → Palette-Dy2dQgqx.js} +1 -1
- package/dist/client/assets/{Play-BGGUeSDd.js → Play-DvFnuZIO.js} +1 -1
- package/dist/client/assets/{Plus-CQOl41pg.js → Plus-jFajoMCA.js} +1 -1
- package/dist/client/assets/{SearchMd-Da504yGV.js → SearchMd-uzKFlzQB.js} +1 -1
- package/dist/client/assets/{Settings02-ozrzAwut.js → Settings02-47eDNk4K.js} +1 -1
- package/dist/client/assets/{Shield01-CYPtC_lA.js → Shield01-BgRa80OR.js} +1 -1
- package/dist/client/assets/{Star01-BoZIiKCL.js → Star01-BrkbxV-A.js} +1 -1
- package/dist/client/assets/{Stars01-BJuGXG_N.js → Stars01-Daq_eW6a.js} +1 -1
- package/dist/client/assets/{Stars02-C4CXFnp9.js → Stars02-DlImJz_z.js} +1 -1
- package/dist/client/assets/{Sun-2eUdoD8j.js → Sun-9FxiCes3.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DXdcIz27.js → SwitchHorizontal01-CB5mOBIf.js} +1 -1
- package/dist/client/assets/{Tool01-WsqNh4er.js → Tool01-rx0lKYM8.js} +1 -1
- package/dist/client/assets/{Trash01-z6De146C.js → Trash01-DI7qV1ow.js} +1 -1
- package/dist/client/assets/{Upload01-C4sYhZ0M.js → Upload01-Boqk1hvA.js} +1 -1
- package/dist/client/assets/{User01-Cvp121NC.js → User01-B3UbdHmL.js} +1 -1
- package/dist/client/assets/{Users01-DcrlsWI1.js → Users01-BUyczaeV.js} +1 -1
- package/dist/client/assets/{Users03-CJuVy8Iz.js → Users03-gvBLUtvG.js} +1 -1
- package/dist/client/assets/{X-DgKWdqZ1.js → X-B-cRV-7d.js} +1 -1
- package/dist/client/assets/{XCircle-DFBcUexW.js → XCircle-CkhBWURn.js} +1 -1
- package/dist/client/assets/{XClose-BKWXOZkj.js → XClose-Doj89HqF.js} +1 -1
- package/dist/client/assets/{Zap-Cxu6aoRs.js → Zap-BCqTHl-x.js} +1 -1
- package/dist/client/assets/{ZapSquare-DOK7F1oe.js → ZapSquare-DdgE8vy-.js} +1 -1
- package/dist/client/assets/{ZoomOut-ryBmf3S4.js → ZoomOut-BdBjpsIq.js} +1 -1
- package/dist/client/assets/{access-gate-DvuwS2Bs.js → access-gate-BXDE0rsJ.js} +1 -1
- package/dist/client/assets/{add-section-modal-CEyStjwy.js → add-section-modal-7a6BUncs.js} +1 -1
- package/dist/client/assets/{agent-icon-pz8iT5cD.js → agent-icon-C6bJxQ04.js} +1 -1
- package/dist/client/assets/agents-list-sjsqj6Ot.js +1 -0
- package/dist/client/assets/ai-providers-6xIkfdtm.js +1 -0
- package/dist/client/assets/{alert-BwNlkWBE.js → alert-C81LnOX9.js} +1 -1
- package/dist/client/assets/{alert-dialog-CkCCiKt9.js → alert-dialog-HmiP05XU.js} +1 -1
- package/dist/client/assets/app-editor-k7Nl_uKp.js +1 -0
- package/dist/client/assets/{auth-xlfJjVrK.js → auth-B9Q1UUsp.js} +1 -1
- package/dist/client/assets/{auth-catchall-HTDRVC4_.js → auth-catchall-ClOrr_P8.js} +1 -1
- package/dist/client/assets/{auth-entry-BNYZmdvo.js → auth-entry-B7DIloAw.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DuCP9Fwl.js → auth-split-layout-dWTaQKch.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DPn6Vk96.js → authenticate-and-persist-oauth-xCkDryiA.js} +1 -1
- package/dist/client/assets/{automation-list-row-CCZ8TAPg.js → automation-list-row-CLUMzxuG.js} +1 -1
- package/dist/client/assets/{automation-runs-DBQv8Uvp.js → automation-runs-DxPUfxy1.js} +1 -1
- package/dist/client/assets/automations-TTHh4EuE.js +1 -0
- package/dist/client/assets/{avatar-Bh53txVX.js → avatar-oAcdiJ9v.js} +1 -1
- package/dist/client/assets/{badge-CdirlPdy.js → badge-CpKEkIGn.js} +1 -1
- package/dist/client/assets/{block-document-D978uGtK.js → block-document-BVHsyU-9.js} +1 -1
- package/dist/client/assets/brand-context-CwjLKTtp.js +1 -0
- package/dist/client/assets/buckets-CM0nkgpJ.js +1 -0
- package/dist/client/assets/{capability-load-error-DgQyDsKl.js → capability-load-error-CG-hWPTN.js} +1 -1
- package/dist/client/assets/{card-D_tApM0k.js → card-BIwENur_.js} +1 -1
- package/dist/client/assets/category-editor-Bx9oTK3B.js +1 -0
- package/dist/client/assets/{chat-context-Dz9rhizY.js → chat-context-DN0_9Gee.js} +1 -1
- package/dist/client/assets/{checkbox-OtNKSART.js → checkbox-Bi39v4Qa.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BsGnTz93.js → cli-auth-success-pdfiwdy1.js} +1 -1
- package/dist/client/assets/collection-detail-BcWtgoUr.js +1 -0
- package/dist/client/assets/{collection-display-button-BgYBCk8T.js → collection-display-button-Bzf7YHNy.js} +1 -1
- package/dist/client/assets/{collection-search-JfLpXbmD.js → collection-search-DbQr2iji.js} +1 -1
- package/dist/client/assets/{collection-tabs-B5YA_dM5.js → collection-tabs-D77_So6e.js} +1 -1
- package/dist/client/assets/command-DyJgh8wP.js +1 -0
- package/dist/client/assets/commerce-onboarding-CJHzpHob.js +1 -0
- package/dist/client/assets/connect-desktop-dialog-ByWaevjw.js +1 -0
- package/dist/client/assets/{connection-card--7NnoNLM.js → connection-card-DehsL0Sf.js} +1 -1
- package/dist/client/assets/connection-detail-CCaFPgvC.js +1 -0
- package/dist/client/assets/{connection-form-helpers-BW7AB-E3.js → connection-form-helpers-CASdXQaW.js} +1 -1
- package/dist/client/assets/connections-DZYmLj7X.js +1 -0
- package/dist/client/assets/{context-menu-3RQyDKF5.js → context-menu-Bt-E5y3C.js} +1 -1
- package/dist/client/assets/{decopilot-CiHv6XGE.js → decopilot-BXlT8NLf.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DXv2T192.js → decopilot-sse-pool-CKTJhrtc.js} +1 -1
- package/dist/client/assets/{dialog-BFjL_my-.js → dialog-BLvz2lK8.js} +1 -1
- package/dist/client/assets/{domain-settings-CuN5wwNc.js → domain-settings-ed9WclHg.js} +1 -1
- package/dist/client/assets/{drawer-DZMXZPMN.js → drawer-C4RJ4_GY.js} +1 -1
- package/dist/client/assets/{dropdown-menu-B1DaP6vk.js → dropdown-menu-CRyIPZil.js} +1 -1
- package/dist/client/assets/{empty-state-Lmcbk0Zv.js → empty-state-CmZpGujH.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Bau_aQvM.js → extract-connection-data-iACc8UZO.js} +1 -1
- package/dist/client/assets/file-explorer-BveBp463.js +2 -0
- package/dist/client/assets/{file-type-icon-CWgZWEkL.js → file-type-icon-Db262N7w.js} +1 -1
- package/dist/client/assets/{files-C6shWZY2.js → files-BwDocccC.js} +1 -1
- package/dist/client/assets/{form-B6Nf7hvD.js → form-CPJbrMq5.js} +1 -1
- package/dist/client/assets/general-FW5Wth3b.js +1 -0
- package/dist/client/assets/{github-repo-picker-CThHTj5h.js → github-repo-picker-Db_ehY6e.js} +1 -1
- package/dist/client/assets/{hooks-CFfc1t5D.js → hooks-chgqRyLj.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-DnC_H8Us.js → import-from-deco-dialog-Nrpq_g30.js} +1 -1
- package/dist/client/assets/{index-C2QgbLxn.js → index-1ECwD4fs.js} +12 -12
- package/dist/client/assets/{index-CjtDPqlj.js → index-4GXqE9fp.js} +2 -2
- package/dist/client/assets/{index-CurNB2HG.js → index-BkSIY6JJ.js} +3 -3
- package/dist/client/assets/index-D5RW_4sI.js +1 -0
- package/dist/client/assets/{index-BVXtRunj.js → index-D7a1JQHt.js} +2 -2
- package/dist/client/assets/{index-ovnDLwrg.js → index-DAWoaMpc.js} +1 -1
- package/dist/client/assets/{index-BDyN-RAN.js → index-DAmj773w.js} +1 -1
- package/dist/client/assets/{index-BK0DpA7w.js → index-DC36sAC_.js} +2 -2
- package/dist/client/assets/{index-ZANilAX7.js → index-DFNABgCe.js} +1 -1
- package/dist/client/assets/index-DoculpR5.js +1 -0
- package/dist/client/assets/{index-C0_iRWcE.js → index-K-17SMjl.js} +1 -1
- package/dist/client/assets/{index-C_XJPG8Z.js → index-QdluHxPe.js} +1 -1
- package/dist/client/assets/{index-qZ5-LmpP.js → index-RkQpccOp.js} +1 -1
- package/dist/client/assets/index-UgEhsCuR.js +1 -0
- package/dist/client/assets/{index-BzszuDGF.css → index-rS_HhTdz.css} +1 -1
- package/dist/client/assets/{index-redirect-Cc9Y9Kn-.js → index-redirect-DO0D1qdv.js} +1 -1
- package/dist/client/assets/{input-RRjvrcUF.js → input-jkT1z5r1.js} +1 -1
- package/dist/client/assets/{integration-icon-Dpj2NSXY.js → integration-icon-CZDEviNI.js} +1 -1
- package/dist/client/assets/{label-DrXdAtn0.js → label-CETsHBZ0.js} +1 -1
- package/dist/client/assets/{login-CdGM36BM.js → login-eY2xl_Qt.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B5dnAc7V.js → mcp-oauth-BIBzZgcE.js} +1 -1
- package/dist/client/assets/{members-C-wG0rnC.js → members-BAHTTEXJ.js} +2 -2
- package/dist/client/assets/{monaco-editor-zMbhl8rq.js → monaco-editor-tVsx1Jkl.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BnDnFbz0.js → monitoring-stats-row-CivwdnUP.js} +1 -1
- package/dist/client/assets/{oauth-callback-Dkf89E49.js → oauth-callback-BnrL3BsC.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BzTdkWaI.js → oauth-callback-ai-provider-D3_UsvKg.js} +1 -1
- package/dist/client/assets/{onboarding-CK9ke2oh.js → onboarding-Cde-ZfY9.js} +1 -1
- package/dist/client/assets/{org-install-CyaR-8_i.js → org-install-Cri2HTyv.js} +1 -1
- package/dist/client/assets/{org-layout-BDwAg4pd.js → org-layout-DH1oGgfN.js} +1 -1
- package/dist/client/assets/{organization-choice-BcGxKG4I.js → organization-choice-BZIXFBHd.js} +1 -1
- package/dist/client/assets/{page-seo-form-CvCtyrxH.js → page-seo-form-DCgyqE3q.js} +1 -1
- package/dist/client/assets/page-seo-sheet-o3dCAhA-.js +1 -0
- package/dist/client/assets/{popover-D7BamlkK.js → popover-1pFpRX6s.js} +1 -1
- package/dist/client/assets/post-editor-CWr-_gb_.js +1 -0
- package/dist/client/assets/{preview-dialog-C9Rx0Dtg.js → preview-dialog-DRmrGWbh.js} +1 -1
- package/dist/client/assets/{primitives-BmW50XTY.js → primitives-C06Pn9p4.js} +1 -1
- package/dist/client/assets/profile-62y90jm_.js +1 -0
- package/dist/client/assets/project-app-view-BeZFUwcQ.js +1 -0
- package/dist/client/assets/record-editor-BsdzrkRD.js +1 -0
- package/dist/client/assets/registry-DpNbpkzg.js +2 -0
- package/dist/client/assets/{registry-layout-D86NULga.js → registry-layout-Dww7dssY.js} +2 -2
- package/dist/client/assets/{require-capability-CBJ6cwe3.js → require-capability-BC8YsasG.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Be__d9RH.js → required-auth-layout-DjRtF3m8.js} +1 -1
- package/dist/client/assets/{reset-password-CFeeThio.js → reset-password-DNWeSy4_.js} +1 -1
- package/dist/client/assets/roles-Cyz3Z1vr.js +1 -0
- package/dist/client/assets/{save-status-C9pT75mA.js → save-status-BsQDaUlP.js} +1 -1
- package/dist/client/assets/{scroll-area-CbWYdgRA.js → scroll-area-D51A_KQ5.js} +1 -1
- package/dist/client/assets/{search-input-CeqwXCv0.js → search-input-CEqRaXj6.js} +1 -1
- package/dist/client/assets/secrets-C6bKEzDN.js +1 -0
- package/dist/client/assets/{sections-editor-uxePiNCk.js → sections-editor-331tz7B6.js} +2 -2
- package/dist/client/assets/{select-BePf1IJF.js → select-Ct-_FhWe.js} +1 -1
- package/dist/client/assets/select-model-DJ7vH3M2.js +1 -0
- package/dist/client/assets/seo-editor-Ad8X__jc.js +1 -0
- package/dist/client/assets/settings-layout-CSyEHpma.js +1 -0
- package/dist/client/assets/{settings-section-ELYurXQx.js → settings-section-D6f1v8Lb.js} +1 -1
- package/dist/client/assets/{sheet-Djk8ol5s.js → sheet-CUfjkNRy.js} +1 -1
- package/dist/client/assets/{shell-controls-CqOBDieU.js → shell-controls-C6FYdYnB.js} +1 -1
- package/dist/client/assets/{shell-layout-BkVrkYmb.js → shell-layout-CR4YIb2n.js} +1 -1
- package/dist/client/assets/{shell-route-loading-gKBpXu2h.js → shell-route-loading-fK7OWXny.js} +1 -1
- package/dist/client/assets/sidebar-C45GjVmp.js +1 -0
- package/dist/client/assets/{skeleton-DrM35KBr.js → skeleton-h95MLET_.js} +1 -1
- package/dist/client/assets/{sortable.esm-BN6bAoSL.js → sortable.esm-CbeYFn14.js} +2 -2
- package/dist/client/assets/sso-DGooE6a8.js +1 -0
- package/dist/client/assets/store-O5BcQA2t.js +1 -0
- package/dist/client/assets/store-registry-BPQHh-y5.js +2 -0
- package/dist/client/assets/{studio-tools-BvQ8Bli1.js → studio-tools-BgUSKeCY.js} +1 -1
- package/dist/client/assets/{switch-dEe0am9a.js → switch-Cf_WUos9.js} +1 -1
- package/dist/client/assets/{table-D_zHkpnq.js → table-tHeeUiY0.js} +1 -1
- package/dist/client/assets/{tabs-DOJ7e6Z7.js → tabs-CNnqe_sK.js} +1 -1
- package/dist/client/assets/{task-status-DLHF9SZS.js → task-status-DzLkYYrk.js} +1 -1
- package/dist/client/assets/{textarea-C7j7_npp.js → textarea-BzYVaGJ0.js} +1 -1
- package/dist/client/assets/{toggle-group-CSO_yZKm.js → toggle-group-BE1kDwdz.js} +1 -1
- package/dist/client/assets/{toolbar-D9CfLhAB.js → toolbar-D5FkjLVB.js} +1 -1
- package/dist/client/assets/{tools-list-DC6csFT2.js → tools-list-BKN97Z6h.js} +1 -1
- package/dist/client/assets/tooltip-CAEDbADy.js +1 -0
- package/dist/client/assets/{types-CDn4NSje.js → types-Dw2dcWcn.js} +1 -1
- package/dist/client/assets/{use-ai-providers-D-XhQ6_q.js → use-ai-providers-BcLob6tS.js} +1 -1
- package/dist/client/assets/{use-automations-BllXXW29.js → use-automations-CfP4AmpB.js} +1 -1
- package/dist/client/assets/{use-capability-DfdnXTfH.js → use-capability-CbeJheXW.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DmUrmEeM.js → use-clock-tick-DHvuEFIJ.js} +1 -1
- package/dist/client/assets/{use-collections-w44ZyJ1t.js → use-collections-yHRKnSEt.js} +1 -1
- package/dist/client/assets/{use-connection-Cvfufzsw.js → use-connection-BPcAXa47.js} +1 -1
- package/dist/client/assets/{use-copy-BWQBaWRC.js → use-copy-DOTEBoID.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CGofqNOQ.js → use-create-virtual-mcp-C88JBuQM.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CaTQp8tz.js → use-debounced-autosave-BnfFXRc0.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CNA7qawq.js → use-delete-connection-D1yU7B0G.js} +1 -1
- package/dist/client/assets/{use-file-configs-Bg9S5WW4.js → use-file-configs-C8z3zSDD.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BlkXRVRw.js → use-infinite-scroll-V4l3DQJD.js} +1 -1
- package/dist/client/assets/{use-join-requests-ByqDno7o.js → use-join-requests-Duz0LeuZ.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BbOUwA1H.js → use-mcp-client-DYpZuPPA.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Y5le4syR.js → use-mcp-prompts-BxOgLeZF.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-xGr1pN0n.js → use-mcp-tools-xhV-ENX5.js} +1 -1
- package/dist/client/assets/{use-members-blURElyD.js → use-members-CJKZdynB.js} +1 -1
- package/dist/client/assets/use-mobile-CPyq18pe.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-CidcWwFC.js → use-navigate-to-agent-Bhu6dr_a.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-oMz0ubhe.js → use-org-auth-client-Tiq6Yt9b.js} +1 -1
- package/dist/client/assets/{use-org-sso-CIoYIaj1.js → use-org-sso-DGBv3Hvc.js} +1 -1
- package/dist/client/assets/{use-organization-roles-tA96x-8d.js → use-organization-roles-1exN43Rd.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B5L78CqV.js → use-organization-settings-DFnXSR7Z.js} +1 -1
- package/dist/client/assets/{use-registry-connections-3CHe_VwJ.js → use-registry-connections-Czx1u2H6.js} +1 -1
- package/dist/client/assets/{use-secrets-DlUSWVTu.js → use-secrets-DqgJI3yC.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Bbu_XWuO.js → use-status-sounds-DRhhwMt0.js} +1 -1
- package/dist/client/assets/use-view-mode-BB9Jcv_5.js +1 -0
- package/dist/client/assets/{use-virtual-mcp-CLJ6qnG1.js → use-virtual-mcp-DnY7c9gE.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DlRMWoIP.js +1 -0
- package/dist/client/assets/{useQueries-BqFctUi9.js → useQueries-D96G2W1b.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BjlxN-DZ.js +1 -0
- package/dist/client/assets/variant-calendar-BlIkgRxn.js +1 -0
- package/dist/client/assets/{view-mode-toggle-CIiu6iGh.js → view-mode-toggle-ncGR_sPB.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agents-list-C2TIIavL.js +0 -1
- package/dist/client/assets/ai-providers-bb2flxno.js +0 -1
- package/dist/client/assets/app-editor-mcTFLJlr.js +0 -1
- package/dist/client/assets/automations-D1p0mjNs.js +0 -1
- package/dist/client/assets/brand-context-Ds48Bazs.js +0 -1
- package/dist/client/assets/buckets-C6_Hhy5c.js +0 -1
- package/dist/client/assets/category-editor-DMZmSuPk.js +0 -1
- package/dist/client/assets/collection-detail-8pBdQXs6.js +0 -1
- package/dist/client/assets/command-iFNWkWs6.js +0 -1
- package/dist/client/assets/commerce-onboarding-CjPSY7Rg.js +0 -1
- package/dist/client/assets/connect-desktop-dialog-BxJ3X8re.js +0 -1
- package/dist/client/assets/connection-detail-Bak6_MXj.js +0 -1
- package/dist/client/assets/connections-MxbhAMWj.js +0 -1
- package/dist/client/assets/file-explorer-CdToudqs.js +0 -2
- package/dist/client/assets/general-BRjdlS0B.js +0 -1
- package/dist/client/assets/index-BtmyrH9L.js +0 -1
- package/dist/client/assets/index-DqUFDG_W.js +0 -1
- package/dist/client/assets/index-EwbYDv-_.js +0 -1
- package/dist/client/assets/page-seo-sheet-lBchETUb.js +0 -1
- package/dist/client/assets/post-editor-CJXGoikN.js +0 -1
- package/dist/client/assets/profile-CzQbXboe.js +0 -1
- package/dist/client/assets/project-app-view-CMzykg6f.js +0 -1
- package/dist/client/assets/record-editor-B__3b7h2.js +0 -1
- package/dist/client/assets/registry-DpRLil7D.js +0 -2
- package/dist/client/assets/roles-P1-HY2OT.js +0 -1
- package/dist/client/assets/secrets-EVcWk0yc.js +0 -1
- package/dist/client/assets/select-model-CgXZFBIr.js +0 -1
- package/dist/client/assets/seo-editor-BpqPSu1k.js +0 -1
- package/dist/client/assets/settings-layout-ljEOwxAc.js +0 -1
- package/dist/client/assets/sidebar-DLCPSSnc.js +0 -1
- package/dist/client/assets/sso-By4pryNN.js +0 -1
- package/dist/client/assets/store-BSz8T3hr.js +0 -1
- package/dist/client/assets/store-registry-mttn5AI8.js +0 -2
- package/dist/client/assets/tooltip-CUlMaf5E.js +0 -1
- package/dist/client/assets/use-view-mode-Dff0V9fY.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BAIT4yxs.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DpmGs3CS.js +0 -1
- package/dist/client/assets/variant-calendar-CUrfAk6h.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K as d,c as l,w as g,k as E,m as I,d as R,r as b}from"./index-
|
|
1
|
+
import{K as d,c as l,w as g,k as E,m as I,d as R,r as b}from"./index-BkSIY6JJ.js";import{W as G}from"./use-mcp-client-DYpZuPPA.js";import{c as M,u as Q}from"./studio-tools-BgUSKeCY.js";const w={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null},N={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function O(t,e){return{queryKey:d.organizationSettings(e),queryFn:async()=>{try{return await M(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...w,organizationId:e}}},staleTime:6e4}}function h(t){const e=l.c(6),{org:s}=g();let n;e[0]!==s.id||e[1]!==s.slug?(n=O(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const i=t;let r;return e[3]!==n||e[4]!==i?(r={...n,select:i},e[3]=n,e[4]=i,e[5]=r):r=e[5],E(r)}function W(t,e){const s=l.c(3);let n;s[0]!==t||s[1]!==e?(n=O(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:i}=E(n);return i??null}function S(){const t=l.c(9),{org:e}=g(),s=Q(),n=I();let i;t[0]!==e||t[1]!==s?(i=async u=>{const o=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...u});if(!o)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return o},t[0]=e,t[1]=s,t[2]=i):i=t[2];let r;t[3]!==e||t[4]!==n?(r=u=>{n.setQueryData(d.organizationSettings(e.id),o=>({...o??w,...u}))},t[3]=e,t[4]=n,t[5]=r):r=t[5];let a;return t[6]!==i||t[7]!==r?(a={mutationFn:i,onSuccess:r},t[6]=i,t[7]=r,t[8]=a):a=t[8],R(a)}function C(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:N}function Z(){const{data:t}=h(P);return t??N}function P(t){return C(t.simple_mode)}function F(){const t=l.c(7),e=S();let s,n;t[0]!==e?(s=(r,a)=>e.mutate({simple_mode:r},a),n=(r,a)=>e.mutateAsync({simple_mode:r},a),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function $(){const{data:t}=h(k);return t??null}function k(t){return t.registry_config}function j(){const t=l.c(7),e=S();let s,n;t[0]!==e?(s=(r,a)=>e.mutate({registry_config:r},a),n=(r,a)=>e.mutateAsync({registry_config:r},a),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function B(){const{data:t}=h(x);return t??null}function x(t){return t.default_home_agents}function U(){const t=l.c(7),e=S();let s,n;t[0]!==e?(s=(r,a)=>e.mutate({default_home_agents:r},a),n=(r,a)=>e.mutateAsync({default_home_agents:r},a),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function L(){const t=l.c(14),{org:e}=g(),s=U(),n=I();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=Promise.resolve(),t[0]=i):i=t[0];const r=b.useRef(i);let a;t[1]!==e.id?(a=d.organizationSettings(e.id),t[1]=e.id,t[2]=a):a=t[2];const u=a;let o;t[3]!==u||t[4]!==n?(o=()=>n.getQueryData(u)?.default_home_agents?.ids??[],t[3]=u,t[4]=n,t[5]=o):o=t[5];const _=o;let m;t[6]!==u||t[7]!==e.slug||t[8]!==n||t[9]!==s?(m=z=>{const T=r.current.then(async()=>{const A=n.getQueryData(u),p=z(A?.default_home_agents?.ids??[]);if(p!==null){n.setQueryData(u,c=>c&&{...c,default_home_agents:{ids:p}});try{await s.mutateAsync({ids:p}),await n.refetchQueries({queryKey:d.homeNextActions(e.slug),type:"active"})}catch(c){const D=c;throw n.setQueryData(u,A),D}}});return r.current=T.catch(q),T},t[6]=u,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=m):m=t[10];const y=m;let f;return t[11]!==y||t[12]!==_?(f={currentIds:_,apply:y},t[11]=y,t[12]=_,t[13]=f):f=t[13],f}function q(){}function v(){const t=l.c(5),{org:e}=g(),s=$();let n;t[0]!==e.id?(n=G.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const i=n;let r;return t[2]!==i||t[3]!==s?(r=a=>{if(!s)return a===i;const u=s.registries[a];return u?u.enabled:a===i},t[2]=i,t[3]=s,t[4]=r):r=t[4],r}export{L as a,v as b,W as c,Z as d,F as e,$ as f,j as g,O as o,B as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C,w as R}from"./index-
|
|
1
|
+
import{c as C,w as R}from"./index-BkSIY6JJ.js";import{u as p}from"./use-connection-BPcAXa47.js";import{W as a}from"./use-mcp-client-DYpZuPPA.js";import{f as y}from"./use-organization-settings-DFnXSR7Z.js";function E(){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{E as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,w as a,K as c,p as f,m as y,d as m}from"./index-
|
|
1
|
+
import{c as r,w as a,K as c,p as f,m as y,d as m}from"./index-BkSIY6JJ.js";import{u as l}from"./studio-tools-BgUSKeCY.js";function p(){const e=r.c(7),{org:o}=a(),u=l();let i;e[0]!==o.id?(i=c.secrets(o.id),e[0]=o.id,e[1]=i):i=e[1];let t;e[2]!==u?(t=async()=>await u.call("SECRET_LIST",{}),e[2]=u,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:n}=f(s);return n.secrets}function C(){const e=r.c(8),{org:o}=a(),u=l(),i=y();let t;e[0]!==u?(t=async d=>await u.call("SECRET_CREATE",{...d}),e[0]=u,e[1]=t):t=e[1];let s;e[2]!==o||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:c.secrets(o.id)})},e[2]=o,e[3]=i,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],m(n)}export{C as a,p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as m,I as h}from"./index-
|
|
1
|
+
import{r as o,c as m,I as h}from"./index-BkSIY6JJ.js";import{p as R,q as I}from"./question-004-sINsf4GQ.js";import{d as y,D as S}from"./decopilot-sse-pool-CKTJhrtc.js";const b=()=>0;function D(s){const{orgSlug:e,taskId:r,enabled:t=!0,onStep:n,onFinish:u,onTaskStatus:f}=s,l=o.useRef({taskId:r,onStep:n,onFinish:u,onTaskStatus:f});l.current={taskId:r,onStep:n,onFinish:u,onTaskStatus:f};const i=o.useRef(null),p=o.useRef(t),d=o.useRef(e);(!i.current||p.current!==t||d.current!==e)&&(p.current=t,d.current=e,i.current=E=>{if(!t||!e)return()=>{};const k=T=>{let a;try{a=JSON.parse(T.data)}catch{return}const c=l.current;if(!(c.taskId&&a.subject!==c.taskId)){switch(a.type){case S.STEP:c.onStep?.(a);break;case S.FINISH:c.onFinish?.(a);break;case S.THREAD_STATUS:c.onTaskStatus?.(a);break}E()}};return y.subscribe(e,k)}),o.useSyncExternalStore(i.current,b,b)}const O=new Set(["completed","failed","requires_action"]);function U(s){const e=m.c(5),[r]=h();let t;e[0]!==r?(t=u=>{r.enableSounds&&O.has(u.data.status)&&R(I.dataUri).catch(_)},e[0]=r,e[1]=t):t=e[1];let n;e[2]!==s||e[3]!==t?(n={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=n):n=e[4],D(n)}function _(s){console.warn("[status-sounds] playback failed:",s)}export{U as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as p,r as f}from"./index-BkSIY6JJ.js";import{u as w}from"./use-mobile-CPyq18pe.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,w as d,aJ as p,k as P}from"./index-
|
|
1
|
+
import{c as a,w as d,aJ as p,k as P}from"./index-BkSIY6JJ.js";import{b as L,a as S,u as V,c as _}from"./use-collections-yHRKnSEt.js";import{S as g,u as I}from"./use-mcp-client-DYpZuPPA.js";function v(s){const t=a.c(5);let e;t[0]!==s?(e=s===void 0?{}:s,t[0]=s,t[1]=e):e=t[1];const n=e,{org:i}=d();let o;t[2]!==i.id||t[3]!==i.slug?(o={connectionId:g,orgId:i.id,orgSlug:i.slug},t[2]=i.id,t[3]=i.slug,t[4]=o):o=t[4];const l=I(o);return L(i.id,"VIRTUAL_MCP",l,n)}function R(s,t,e){return _(s,"VIRTUAL_MCP",t??void 0,e)}function b(s){const t=a.c(3),{org:e}=d();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=I(n);return V(e.id,"VIRTUAL_MCP",s??void 0,i)}function E(s){const t=a.c(15),{org:e}=d();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=I(n);let o,l,c;t[3]!==s||t[4]!==e.id?(o=[...s].sort(),c=P,l=p.virtualMcpLastUsed(e.id,o),t[3]=s,t[4]=e.id,t[5]=o,t[6]=l,t[7]=c):(o=t[5],l=t[6],c=t[7]);const C=o.length>0;let u;t[8]!==i||t[9]!==o?(u=async()=>{const M=(await i.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:o}})).structuredContent??{items:[]},f=new Map;for(const m of M.items)f.set(m.id,m);return f},t[8]=i,t[9]=o,t[10]=u):u=t[10];let r;return t[11]!==l||t[12]!==C||t[13]!==u?(r={queryKey:l,enabled:C,staleTime:3e4,queryFn:u},t[11]=l,t[12]=C,t[13]=u,t[14]=r):r=t[14],c(r)}function $(){const s=a.c(3),{org:t}=d();let e;s[0]!==t.id||s[1]!==t.slug?(e={connectionId:g,orgId:t.id,orgSlug:t.slug},s[0]=t.id,s[1]=t.slug,s[2]=e):e=s[2];const n=I(e);return S(t.id,"VIRTUAL_MCP",n)}export{b as a,$ as b,E as c,v as u,R as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as u}from"./use-infinite-scroll-V4l3DQJD.js";import{cJ as i}from"./index-BkSIY6JJ.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ao as Q,ap as y,aq as w,ar as S,as as C,m as k,at as x,au as q,r as p,av as M,aw as H,ax as B,ay as L,az as O,aA as P,aB as A}from"./index-
|
|
1
|
+
import{ao as Q,ap as y,aq as w,ar as S,as as C,m as k,at as x,au as q,r as p,av as M,aw as H,ax as B,ay as L,az as O,aA as P,aB as A}from"./index-BkSIY6JJ.js";function R(r,s){const e=new Set(s);return r.filter(t=>!e.has(t))}function z(r,s,e){const t=r.slice(0);return t[s]=e,t}var T=class extends Q{#i;#s;#n;#r;#e;#t;#o;#u;#a;#h=[];constructor(r,s,e){super(),this.#i=r,this.#r=e,this.#n=[],this.#e=[],this.#s=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(r=>{r.subscribe(s=>{this.#d(r,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(r=>{r.destroy()})}setQueries(r,s){this.#n=r,this.#r=s,y.batch(()=>{const e=this.#e,t=this.#f(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=e.length!==i.length,c=i.some((o,d)=>o!==e[d]),f=u||c,b=f?!0:n.some((o,d)=>{const g=this.#s[d];return!g||!w(o,g)});!f&&!b||(f&&(this.#h=t,this.#e=i),this.#s=n,this.hasListeners()&&(f&&(R(e,i).forEach(o=>{o.destroy()}),R(i,e).forEach(o=>{o.subscribe(d=>{this.#d(o,d)})})),this.#p()))})}getCurrentResult(){return this.#s}getQueries(){return this.#e.map(r=>r.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(r,s){const e=this.#f(r),t=e.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=e.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,s,i),()=>this.#c(t,e)]}#c(r,s){return s.map((e,t)=>{const i=r[t];return e.defaultedQueryOptions.notifyOnChangeProps?i:e.observer.trackResult(i,n=>{s.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,s,e){if(s){const t=this.#a,i=e!==void 0&&t!==void 0&&(t.length!==e.length||e.some((n,u)=>n!==t[u]));return(!this.#t||this.#s!==this.#u||i||s!==this.#o)&&(this.#o=s,this.#u=this.#s,e!==void 0&&(this.#a=e),this.#t=S(this.#t,s(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#e.some((r,s)=>r.options.suspense&&this.#s[s]?.data===void 0)}#f(r){const s=new Map;this.#e.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=s.get(i);n?n.push(t):s.set(i,[t])});const e=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=s.get(i.queryHash)?.shift()??new C(this.#i,i);e.push({defaultedQueryOptions:i,observer:u})}),e}#d(r,s){const e=this.#e.indexOf(r);e!==-1&&(this.#s=z(this.#s,e,s),this.#p())}#p(){if(this.hasListeners()){const r=this.#c(this.#s,this.#h),s=this.#b(),e=this.#t,t=s?e:this.#l(r,this.#r?.combine);(s||e!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#s)})})}}};function U({queries:r,...s},e){const t=k(e),i=x(),n=q(),u=p.useMemo(()=>r.map(a=>{const h=t.defaultQueryOptions(a);return h._optimisticResults=i?"isRestoring":"optimistic",h}),[r,t,i]);u.forEach(a=>{M(a);const h=t.getQueryCache().get(a.queryHash);H(a,n,h)}),B(n);const[c]=p.useState(()=>new T(t,u,s)),[f,b,o]=c.getOptimisticResult(u,s.combine),d=!i&&s.subscribed!==!1;p.useSyncExternalStore(p.useCallback(a=>d?c.subscribe(y.batchCalls(a)):L,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setQueries(u,s)},[u,s,c]);const m=f.some((a,h)=>O(u[h],a))?f.flatMap((a,h)=>{const l=u[h];if(l&&O(l,a)){const E=new C(t,l);return P(l,E,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const v=f.find((a,h)=>{const l=u[h];return l&&A({result:a,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(v?.error)throw v.error;return b(o())}export{U as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as s}from"./use-infinite-scroll-V4l3DQJD.js";import{cJ as u,am as n}from"./index-BkSIY6JJ.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as V,r as U,j as o,l as J,B as Y}from"./index-BkSIY6JJ.js";import{T as et,f as ct}from"./agent-icon-C6bJxQ04.js";import{n as mt}from"./ChevronLeft-BNcg18cx.js";import{i as dt}from"./ChevronRight-ChYOVgWd.js";import{L as ft}from"./label-CETsHBZ0.js";import{S as nt}from"./scroll-area-D51A_KQ5.js";import{S as pt}from"./switch-Cf_WUos9.js";import{a as ut,T as ht,b as gt}from"./tooltip-CAEDbADy.js";import{V as xt}from"./view-mode-toggle-ncGR_sPB.js";import"./AlertCircle-flSoo6uw.js";import"./Tool01-rx0lKYM8.js";import"./SwitchHorizontal01-CB5mOBIf.js";import"./Settings02-47eDNk4K.js";import"./XCircle-CkhBWURn.js";import"./ArrowUpRight-BeOMO89N.js";import"./ZapSquare-DdgE8vy-.js";import"./Users03-gvBLUtvG.js";import"./CheckCircle-B9ekAAw-.js";import"./ChevronUp-BhWz3ylT.js";import"./ChevronDown-BWfuTI7r.js";import"./DotsVertical-C0YWb9xq.js";import"./Stars02-DlImJz_z.js";import"./Eye-DWTUBTZ_.js";import"./ZoomOut-BdBjpsIq.js";import"./Globe01-BgRW2EiE.js";import"./FilterLines-Djqj6uj_.js";import"./Star01-BrkbxV-A.js";import"./Globe04-XITcP2mp.js";import"./HardDrive-DS3VxDtU.js";import"./Key01-DX7L8s0Z.js";import"./LayoutLeft-BqtFvEWV.js";import"./LinkExternal01-Cf-6A1_h.js";import"./Monitor01-CZ30bS8J.js";import"./Sun-9FxiCes3.js";import"./Palette-Dy2dQgqx.js";import"./Play-DvFnuZIO.js";import"./Plus-jFajoMCA.js";import"./SearchMd-uzKFlzQB.js";import"./Shield01-BgRa80OR.js";import"./Stars01-Daq_eW6a.js";import"./Trash01-DI7qV1ow.js";import"./Upload01-Boqk1hvA.js";import"./User01-B3UbdHmL.js";import"./Users01-BUyczaeV.js";import"./XClose-Doj89HqF.js";import"./X-B-cRV-7d.js";import"./Zap-BCqTHl-x.js";import"./use-clock-tick-DHvuEFIJ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DOTEBoID.js";import"./file-type-icon-Db262N7w.js";import"./dialog-BLvz2lK8.js";import"./use-mobile-CPyq18pe.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-Dw2dcWcn.js";import"./use-mcp-client-DYpZuPPA.js";import"./auth-B9Q1UUsp.js";import"./chat-context-DN0_9Gee.js";import"./hooks-chgqRyLj.js";import"./decopilot-sse-pool-CKTJhrtc.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-DnY7c9gE.js";import"./use-collections-yHRKnSEt.js";import"./use-ai-providers-BcLob6tS.js";import"./studio-tools-BgUSKeCY.js";import"./use-organization-settings-DFnXSR7Z.js";import"./shell-layout-CR4YIb2n.js";import"./avatar-oAcdiJ9v.js";import"./required-auth-layout-DjRtF3m8.js";import"./use-org-sso-DGBv3Hvc.js";import"./sheet-CUfjkNRy.js";import"./integration-icon-CZDEviNI.js";import"./use-navigate-to-agent-Bhu6dr_a.js";import"./use-connection-BPcAXa47.js";import"./use-mcp-prompts-BxOgLeZF.js";import"./form-CPJbrMq5.js";import"./input-jkT1z5r1.js";import"./index-BdQq_4o_.js";const bt=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),yt=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Tt=new Date(-864e13),vt=new Date(864e13),jt=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,Nt=/\/flags\/multivariate\.ts$/;function wt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function kt(e){if(!e||typeof e!="object")return null;const{start:t,end:n}=e,r=typeof t=="string",l=typeof n=="string";if(!r&&!l)return null;const s=r?new Date(t):Tt,m=l?new Date(n):vt;return Number.isNaN(s.getTime())||Number.isNaN(m.getTime())||r&&l&&m.getTime()<=s.getTime()?null:{start:s,end:m,openStart:!r,openEnd:!l}}function rt(e,t){if(!e||typeof e!="object")return;const n=e.__resolveType;if(typeof n=="string"){if(bt.has(n)){const r=kt(e);r&&t.push(r);return}if(yt.has(n)){const r=e.matchers;if(Array.isArray(r))for(const l of r)rt(l,t)}}}function _t(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!jt.test(t))return!1;const n=e.variants;return Array.isArray(n)}function Mt(e){if(typeof e=="string"){const a=e.trim();if(a.length===0)return null;try{const i=new URL(a).pathname.split("/").filter(Boolean),d=i[i.length-1];if(d)return decodeURIComponent(d)}catch{}return a.length>80?`${a.slice(0,77)}…`:a}if(!e||typeof e!="object")return null;const t=e,n=t.config,l=t.desktop?.media,s=[t.title,t.name,t.label,t.alt,n?.title,n?.name,n?.typeAlert?.message,l?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const a of s)if(typeof a=="string"&&a.trim().length>0)return a.trim();const m=t.__resolveType;if(typeof m=="string"){const c=(m.split("/").pop()??m).replace(/\.(tsx?|jsx?)$/i,"");if(c.length>0)return c}return null}function St(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];typeof r=="number"?t.length>0?t[t.length-1]+=`[${r}]`:t.push(`[${r}]`):t.push(r)}return t.join(" · ")}function W(e,t,n,r,l){if(_t(e)){const s=e.variants,m=e.__resolveType,a=Nt.test(m)?"":St(r);s.forEach((c,i)=>{if(!c||typeof c!="object")return;const d=c,f=[];if(rt(d.rule,f),f.length===0)return;const x=Mt(d.value)??(a||n);for(const h of f)l.push({blockKey:t,blockLabel:n,innerPath:a,variantIndex:i,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:m})});for(let c=0;c<s.length;c++){const i=s[c];i&&typeof i=="object"&&W(i.value,t,n,[...r,"variants",c,"value"],l)}return}if(Array.isArray(e)){for(let s=0;s<e.length;s++)W(e[s],t,n,[...r,s],l);return}if(e&&typeof e=="object")for(const[s,m]of Object.entries(e))s!=="__resolveType"&&W(m,t,n,[...r,s],l)}function Et(e){if(!e)return[];const t=[];for(const[n,r]of Object.entries(e))W(r,n,wt(n),[],t);return t.sort((n,r)=>n.start.getTime()-r.start.getTime())}function At(e){const t=[...new Set(e)].sort(),n=new Map;return t.forEach((r,l)=>{const s=l*137.508%360;n.set(r,{bg:`oklch(0.62 0.14 ${s})`,text:"white",border:`oklch(0.50 0.14 ${s})`})}),n}const Dt={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function st(e,t){return e.get(t)??Dt}const $t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ot=["January","February","March","April","May","June","July","August","September","October","November","December"],it=1440*60*1e3;function P(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function at(e){return new Date(e.getFullYear(),e.getMonth(),1)}function F(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function z(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function K(e,t){return Math.round((P(e).getTime()-P(t).getTime())/it)}function Ct(e){const t=(e.getTime()-P(e).getTime())/it;return Math.min(Math.max(t,0),1)}function q(e,t){return K(e,t)+Ct(e)}function Rt(e){const t=z(e,-e.getDay()),n=[];for(let r=0;r<6;r++){const l=[];for(let s=0;s<7;s++)l.push(z(t,r*7+s));n.push(l)}for(;n.length>0&&n[n.length-1].every(r=>r.getMonth()!==e.getMonth());)n.pop();return n}function Lt(e,t){const n=P(e[0]),r=z(n,7),l=n.getTime(),s=r.getTime(),m=[];for(const i of t){const d=P(i.start),f=P(i.end);if(f.getTime()<n.getTime()||d.getTime()>=r.getTime())continue;const u=d.getTime()<n.getTime()?n:d,x=f.getTime()>=r.getTime()?z(r,-1):f,h=K(u,n),g=K(x,u)+1;if(g<=0)continue;const b=Math.max(i.start.getTime(),l),y=Math.min(i.end.getTime(),s),T=q(new Date(b),n),p=Math.max(q(new Date(y),n)-T,0);p<=0||m.push({variant:i,startCol:h,span:g,leftUnits:T,widthUnits:p})}m.sort((i,d)=>i.startCol-d.startCol||d.span-i.span||i.variant.blockKey.localeCompare(d.variant.blockKey));const a=[],c=[];for(const i of m){let d=a.findIndex(f=>f<=i.startCol);d===-1&&(d=a.length,a.push(0)),a[d]=i.startCol+i.span,c.push({...i,lane:d})}return c}const Q=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Ot(e){const t=e.openStart?"Always":Q.format(e.start),n=e.openEnd?"Ongoing":Q.format(e.end);return`${t} → ${n}`}function Pt(e){const t=V.c(17),{variant:n}=e;let r;t[0]!==n.blockLabel?(r=o.jsx("div",{className:"font-semibold",children:n.blockLabel}),t[0]=n.blockLabel,t[1]=r):r=t[1];let l;t[2]!==n.innerPath?(l=n.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:n.innerPath}),t[2]=n.innerPath,t[3]=l):l=t[3];let s;t[4]!==n.blockLabel||t[5]!==n.innerPath||t[6]!==n.label?(s=n.label!==n.blockLabel&&n.label!==n.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:n.label}),t[4]=n.blockLabel,t[5]=n.innerPath,t[6]=n.label,t[7]=s):s=t[7];let m;t[8]!==n?(m=Ot(n),t[8]=n,t[9]=m):m=t[9];let a;t[10]!==m?(a=o.jsx("div",{className:"mt-1",children:m}),t[10]=m,t[11]=a):a=t[11];let c;return t[12]!==r||t[13]!==l||t[14]!==s||t[15]!==a?(c=o.jsx(gt,{children:o.jsxs("div",{className:"text-xs",children:[r,l,s,a]})}),t[12]=r,t[13]=l,t[14]=s,t[15]=a,t[16]=c):c=t[16],c}const X=16;function It(e,t){const n=e?"transparent":"#000 0",r=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${n}, #000 ${X}px, #000 calc(100% - ${X}px), ${r})`}function lt(e){const t=V.c(26),{variant:n,color:r,style:l,children:s,fadeStart:m,fadeEnd:a}=e,c=m===void 0?!1:m,i=a===void 0?!1:a;let d;t[0]!==i||t[1]!==c?(d=It(c,i),t[0]=i,t[1]=c,t[2]=d):d=t[2];const f=d;let u;t[3]!==c?(u=c&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=c,t[4]=u):u=t[4];let x;t[5]!==i?(x=i&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=i,t[6]=x):x=t[6];let h;t[7]!==f?(h=f&&{maskImage:f,WebkitMaskImage:f},t[7]=f,t[8]=h):h=t[8];let g;t[9]!==r.bg||t[10]!==r.text||t[11]!==l||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:r.bg,color:r.text,borderRadius:4,...u,...x,...h,...l},t[9]=r.bg,t[10]=r.text,t[11]=l,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==s?(b=o.jsx("span",{className:"truncate",children:s}),t[16]=s,t[17]=b):b=t[17];let y;t[18]!==g||t[19]!==b?(y=o.jsx(ut,{asChild:!0,children:o.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=y):y=t[20];let T;t[21]!==n?(T=o.jsx(Pt,{variant:n}),t[21]=n,t[22]=T):T=t[22];let p;return t[23]!==T||t[24]!==y?(p=o.jsxs(ht,{children:[y,T]}),t[23]=T,t[24]=y,t[25]=p):p=t[25],p}function _n(e){const t=V.c(49),{decofile:n}=e,[r,l]=U.useState("calendar"),[s,m]=U.useState(Bt),[a,c]=U.useState(!1);let i,d,f;if(t[0]!==n||t[1]!==a){const E=Et(n);i=E.filter(Ht).length,f=a?E:E.filter(Vt),d=At(f.map(Ft)),t[0]=n,t[1]=a,t[2]=i,t[3]=d,t[4]=f}else i=t[2],d=t[3],f=t[4];const u=d;let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=()=>m(at(new Date)),t[5]=x):x=t[5];const h=x;let g;t[6]!==r?(g=()=>m(E=>r==="calendar"?F(E,-1):F(E,-3)),t[6]=r,t[7]=g):g=t[7];const b=g;let y;t[8]!==r?(y=()=>m(E=>r==="calendar"?F(E,1):F(E,3)),t[8]=r,t[9]=y):y=t[9];const T=y;let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(Y,{variant:"outline",size:"sm",onClick:h,children:"Today"}),t[10]=p):p=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(mt,{size:16}),t[11]=w):w=t[11];let k;t[12]!==b?(k=o.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:b,"aria-label":"Previous",children:w}),t[12]=b,t[13]=k):k=t[13];let _;t[14]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(dt,{size:16}),t[14]=_):_=t[14];let M;t[15]!==T?(M=o.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:T,"aria-label":"Next",children:_}),t[15]=T,t[16]=M):M=t[16];const A=ot[s.getMonth()];let S;t[17]!==s?(S=s.getFullYear(),t[17]=s,t[18]=S):S=t[18];let v;t[19]!==A||t[20]!==S?(v=o.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[A," ",S]}),t[19]=A,t[20]=S,t[21]=v):v=t[21];let j;t[22]!==v||t[23]!==k||t[24]!==M?(j=o.jsxs("div",{className:"flex items-center gap-2",children:[p,k,M,v]}),t[22]=v,t[23]=k,t[24]=M,t[25]=j):j=t[25];let D;t[26]!==i||t[27]!==a?(D=i>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(pt,{id:"show-ongoing",checked:a,onCheckedChange:c}),o.jsxs(ft,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:["Show ongoing (",i,")"]})]}),t[26]=i,t[27]=a,t[28]=D):D=t[28];let L;t[29]===Symbol.for("react.memo_cache_sentinel")?(L={value:"calendar",icon:o.jsx(et,{}),label:"Calendar"},t[29]=L):L=t[29];let I;t[30]===Symbol.for("react.memo_cache_sentinel")?(I=[L,{value:"timeline",icon:o.jsx(ct,{}),label:"Timeline"}],t[30]=I):I=t[30];let N;t[31]!==r?(N=o.jsx(xt,{value:r,onValueChange:l,options:I}),t[31]=r,t[32]=N):N=t[32];let R;t[33]!==D||t[34]!==N?(R=o.jsxs("div",{className:"flex items-center gap-4",children:[D,N]}),t[33]=D,t[34]=N,t[35]=R):R=t[35];let $;t[36]!==j||t[37]!==R?($=o.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,R]}),t[36]=j,t[37]=R,t[38]=$):$=t[38];let C;t[39]!==u||t[40]!==s||t[41]!==i||t[42]!==a||t[43]!==f||t[44]!==r?(C=f.length===0?o.jsx(Wt,{hiddenOngoing:a?0:i}):r==="calendar"?o.jsx(Ut,{monthStart:s,variants:f,colorMap:u}):o.jsx(Jt,{monthStart:s,variants:f,colorMap:u}),t[39]=u,t[40]=s,t[41]=i,t[42]=a,t[43]=f,t[44]=r,t[45]=C):C=t[45];let O;return t[46]!==$||t[47]!==C?(O=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[$,C]}),t[46]=$,t[47]=C,t[48]=O):O=t[48],O}function Ft(e){return e.blockKey}function Vt(e){return!e.openEnd}function Ht(e){return e.openEnd}function Bt(){return at(new Date)}function Wt(e){const t=V.c(3),{hiddenOngoing:n}=e,r=n===void 0?0:n;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(et,{size:24,className:"text-muted-foreground/60"}),t[0]=l):l=t[0];let s;return t[1]!==r?(s=o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[l,r>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{children:"No dated variants in view."}),o.jsxs("div",{className:"text-xs text-muted-foreground/80",children:[r," ongoing"," ",r===1?"variant is":"variants are"," hidden — enable “Show ongoing” to view."]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{children:"No scheduled variants."}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Variants gated by a date matcher appear here."})]})]}),t[1]=r,t[2]=s):s=t[2],s}const G=20,Z=2,tt=28,zt=6;function Ut(e){const t=V.c(17),{monthStart:n,variants:r,colorMap:l}=e;let s,m,a,c,i;if(t[0]!==l||t[1]!==n||t[2]!==r){const u=Rt(n),x=P(new Date);s=nt,i="flex-1 min-h-0",m="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:$t.map(Gt)}),t[8]=a):a=t[8],c=u.map((h,g)=>{const b=Lt(h,r),y=b.reduce(Yt,0),T=tt+y*(G+Z)+8;return o.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[h.map((p,w)=>{const k=p.getMonth()===n.getMonth(),_=p.getTime()===x.getTime();return o.jsx("div",{className:J("border-r last:border-r-0 px-2 pt-1.5 text-xs",k?"bg-background":"bg-muted/30 text-muted-foreground"),children:o.jsx("span",{className:J("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",_&&"bg-primary text-primary-foreground font-semibold"),children:p.getDate()})},w)}),b.map((p,w)=>{const k=st(l,p.variant.blockKey),_=tt+p.lane*(G+Z),M=p.leftUnits/7*100,A=p.widthUnits/7*100,S=p.variant.openStart&&g===0,v=p.variant.openEnd&&g===u.length-1;return o.jsxs(lt,{variant:p.variant,color:k,fadeStart:S,fadeEnd:v,style:{top:_,left:`calc(${M}% + 2px)`,width:`calc(${A}% - 4px)`,minWidth:zt,height:G},children:[p.variant.blockLabel,p.variant.label!==p.variant.blockLabel&&o.jsxs("span",{className:"opacity-70",children:[" · ",p.variant.label]})]},`${g}-${w}`)})]},g)}),t[0]=l,t[1]=n,t[2]=r,t[3]=s,t[4]=m,t[5]=a,t[6]=c,t[7]=i}else s=t[3],m=t[4],a=t[5],c=t[6],i=t[7];let d;t[9]!==m||t[10]!==a||t[11]!==c?(d=o.jsxs("div",{className:m,children:[a,c]}),t[9]=m,t[10]=a,t[11]=c,t[12]=d):d=t[12];let f;return t[13]!==s||t[14]!==i||t[15]!==d?(f=o.jsx(s,{className:i,children:d}),t[13]=s,t[14]=i,t[15]=d,t[16]=f):f=t[16],f}function Yt(e,t){return Math.max(e,t.lane+1)}function Gt(e){return o.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const B=4,Kt=32,H=240;function Jt(e){const t=V.c(27),{monthStart:n,variants:r,colorMap:l}=e,s=n;let m,a,c,i,d,f;if(t[0]!==l||t[1]!==n||t[2]!==s||t[3]!==r){const h=F(n,B),g=new Date,b=new Map;for(const v of r){const j=b.get(v.blockKey)??[];j.push(v),b.set(v.blockKey,j)}const y=Array.from(b.entries()).sort(Xt),T=h.getTime()-s.getTime(),p=v=>(Math.max(s.getTime(),Math.min(h.getTime(),v.getTime()))-s.getTime())/T*100;let w;t[10]!==s?(w=(v,j)=>F(s,j),t[10]=s,t[11]=w):w=t[11];const k=Array.from({length:B},w),_=g.getTime()>=s.getTime()&&g.getTime()<=h.getTime()?p(g):null;m=nt,f="flex-1 min-h-0",a="min-w-[900px] relative";let M;t[12]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:{width:H},children:"Variant / Block"}),t[12]=M):M=t[12];let A;t[13]===Symbol.for("react.memo_cache_sentinel")?(A={gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},t[13]=A):A=t[13];const S=k.map(Qt);t[14]!==S?(c=o.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[M,o.jsx("div",{className:"flex-1 grid",style:A,children:S})]}),t[14]=S,t[15]=c):c=t[15],t[16]!==_?(i=_!==null&&o.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${H}px + (100% - ${H}px) * ${_} / 100)`},children:o.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:"Today"})}),t[16]=_,t[17]=i):i=t[17],d=y.map(v=>{const[j,D]=v,L=st(l,j),I=D[0]?.blockLabel??j;return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:o.jsx("div",{className:"px-3 truncate",style:{width:H},children:I})}),D.map((N,R)=>o.jsxs("div",{className:"flex border-b items-center",style:{height:Kt},children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:H},children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:L.bg}}),o.jsx("span",{className:"truncate text-foreground/80",children:N.label})]}),o.jsxs("div",{className:"relative flex-1 h-full",children:[o.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},children:k.map(qt)}),(()=>{const $=Math.max(N.start.getTime(),s.getTime()),C=Math.min(N.end.getTime(),h.getTime());if(C<=$)return null;const O=p(new Date($)),E=p(new Date(C))-O;return o.jsx(lt,{variant:N,color:L,fadeStart:N.openStart,fadeEnd:N.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${O}%`,width:`calc(${E}% - 2px)`,height:22},children:N.label})})()]})]},R))]},j)}),t[0]=l,t[1]=n,t[2]=s,t[3]=r,t[4]=m,t[5]=a,t[6]=c,t[7]=i,t[8]=d,t[9]=f}else m=t[4],a=t[5],c=t[6],i=t[7],d=t[8],f=t[9];let u;t[18]!==a||t[19]!==c||t[20]!==i||t[21]!==d?(u=o.jsxs("div",{className:a,children:[c,i,d]}),t[18]=a,t[19]=c,t[20]=i,t[21]=d,t[22]=u):u=t[22];let x;return t[23]!==m||t[24]!==f||t[25]!==u?(x=o.jsx(m,{className:f,children:u}),t[23]=m,t[24]=f,t[25]=u,t[26]=x):x=t[26],x}function qt(e,t){return o.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function Qt(e,t){return o.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ot[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function Xt(e,t){return e[0].localeCompare(t[0])}export{_n as VariantCalendar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,r as T,l as f,j as i}from"./index-
|
|
1
|
+
import{c as $,r as T,l as f,j as i}from"./index-BkSIY6JJ.js";import{T as k,a as I,b as P}from"./tooltip-CAEDbADy.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function B(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:C,fullWidth:L,className:z}=E,_=C===void 0?"sm":C,b=L===void 0?!1:L;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const R=T.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=T.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),m=R.current[e];m&&S({left:m.offsetLeft,width:m.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),T.useEffect(g,p);const n=M[_];let l;t[6]!==z?(l=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=l):l=t[7];let a;t[8]!==n||t[9]!==b||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,m)=>{const j=i.jsxs("button",{ref:V=>{R.current[m]=V},type:"button",onClick:()=>y(e.value),className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",b?"flex-1 h-12 px-4":e.label?f(n.buttonWithLabel,"px-3"):n.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=n,t[9]=b,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=b?"h-12":n.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==l||t[25]!==a?(v=i.jsxs("div",{className:l,children:[a,u]}),t[23]=u,t[24]=l,t[25]=a,t[26]=v):v=t[26],v}export{B as V};
|
package/dist/client/index.html
CHANGED
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
57
57
|
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
|
|
58
58
|
<meta name="apple-mobile-web-app-title" content="deco Studio" />
|
|
59
|
-
<script type="module" crossorigin src="/assets/index-
|
|
60
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
59
|
+
<script type="module" crossorigin src="/assets/index-BkSIY6JJ.js"></script>
|
|
60
|
+
<link rel="stylesheet" crossorigin href="/assets/index-rS_HhTdz.css">
|
|
61
61
|
</head>
|
|
62
62
|
<body>
|
|
63
63
|
<div id="root"></div>
|
package/dist/server/cli.js
CHANGED
|
@@ -80750,7 +80750,7 @@ ${$}`;_(Z);return}if(E(null,B),t.strategy==="count"){if(w--,w===0)_()}if(t.strat
|
|
|
80750
80750
|
SELECT * FROM link_sandboxes WHERE handle = $handle
|
|
80751
80751
|
`);function _(v){if(t===void 0)return!0;let h=$M(v),D=h&&$M(t)?GVu(t):t,g=h?GVu(v):kVu(v),O=nQt(D,g);return O===""||!O.startsWith("..")&&!IQt(O)}return{upsert(v){f.run({$handle:v.handle,$status:v.status,$sandboxPath:v.sandboxPath,$port:v.port??null,$previewUrl:v.previewUrl??null,$repoCloneUrl:v.repoCloneUrl??null,$branch:v.branch??null,$projectName:v.projectName??null,$error:v.error??null,$now:Date.now()})},list(){return l.all().map(k1i)},reconcile(){let v=Date.now();for(let h of l.all().map(k1i)){if(!_(h.sandboxPath)){c.run({$handle:h.handle,$now:v});continue}if(!$M(h.sandboxPath)){E.run({$handle:h.handle,$now:v});continue}if(h.status==="spawning"||h.status==="ready"||h.status==="failed"||h.status==="missing")$.run({$handle:h.handle,$now:v})}return l.all().map(k1i)},prune(v){let h=[],D=[],g=this.reconcile();for(let O of g){if(!_(O.sandboxPath)){D.push({handle:O.handle,sandboxPath:O.sandboxPath,reason:"outside_root",deletedFiles:!1});continue}if(v.missing&&O.status==="missing"){w.run({$handle:O.handle}),h.push({handle:O.handle,sandboxPath:O.sandboxPath,reason:"missing",deletedFiles:!1});continue}if(!v.merged||!$M(O.sandboxPath))continue;if(O.branch===null||O.branch.trim()===""){D.push({handle:O.handle,sandboxPath:O.sandboxPath,reason:"no_branch",deletedFiles:!1});continue}if(!p2(O.sandboxPath,["rev-parse","--is-inside-work-tree"]).ok){D.push({handle:O.handle,sandboxPath:O.sandboxPath,reason:"git_unavailable",deletedFiles:!1});continue}let Z=p2(O.sandboxPath,["status","--porcelain"]);if(!Z.ok){D.push({handle:O.handle,sandboxPath:O.sandboxPath,reason:"git_unavailable",deletedFiles:!1});continue}if(Z.stdout.trim()!==""){D.push({handle:O.handle,sandboxPath:O.sandboxPath,reason:"dirty_worktree",deletedFiles:!1});continue}let B=KVu(O.sandboxPath,O.branch);if(B===null){D.push({handle:O.handle,sandboxPath:O.sandboxPath,reason:"git_unavailable",deletedFiles:!1});continue}if(!B){D.push({handle:O.handle,sandboxPath:O.sandboxPath,reason:"branch_not_merged",deletedFiles:!1});continue}PQt(O.sandboxPath,{recursive:!0,force:!0}),w.run({$handle:O.handle}),h.push({handle:O.handle,sandboxPath:O.sandboxPath,reason:"merged",deletedFiles:!0})}return{removed:h,skipped:D}},delete(v){w.run({$handle:v})},inspect(v){let h=d.get({$handle:v});if(h===null)return null;let D=k1i(h),g=0,O=null;if($M(D.sandboxPath)&&p2(D.sandboxPath,["rev-parse","--is-inside-work-tree"]).ok){let Z=p2(D.sandboxPath,["status","--porcelain"]);if(Z.ok){let B=Z.stdout.trim();g=B===""?0:B.split(`
|
|
80752
80752
|
`).length}if(D.branch!==null&&D.branch.trim()!=="")O=KVu(D.sandboxPath,D.branch)}return{handle:D.handle,branch:D.branch,sandboxPath:D.sandboxPath,dirtyCount:g,merged:O}},close(){u.close()}}}var EHi=()=>{};function JVu(i,u){let t=u?[["umount","-f",i]]:[["fusermount","-u",i],["umount",i]];for(let f of t)if(Bun.spawnSync(f,{stdout:"ignore",stderr:"ignore",timeout:5000}).exitCode===0)break}import{existsSync as KQt,readdirSync as XQt,rmSync as JQt}from"fs";import{join as SVu}from"path";function YVu(i,u={}){let t=u.detach??SQt,f=u.exists??KQt,l=u.readdir??(($)=>XQt($)),c=u.rm??(($)=>JQt($,{recursive:!0,force:!0})),E=SVu(i,"org");if(f(E))for(let $ of l(E))t(SVu(E,$));c(i)}var SQt=(i)=>JVu(i,process.platform==="darwin");var LVu=()=>{};import{join as YQt}from"path";function WVu(i){let u=i.purge??YVu;return{stopSandbox(t){return i.provider.deleteSandbox(t)},inspectSandbox(t){return i.registry.inspect(t)},async removeSandbox(t){if(await i.provider.deleteSandbox(t),i.provider.hasHandle(t))return{ok:!1,error:"Can't delete \u2014 run in progress"};try{let l=i.registry.inspect(t)?.sandboxPath??YQt(i.dataDir,"sandboxes",t);return u(l),i.registry.delete(t),{ok:!0}}catch(f){return{ok:!1,error:f instanceof Error?f.message:String(f)}}}}}var zVu=N(()=>{LVu()});import{randomBytes as LQt}from"crypto";import{mkdir as WQt}from"fs/promises";import{createServer as zQt}from"net";import{join as QQt}from"path";function QVu(i,u){return Error(`sandbox failed to start: ${i}`,{cause:u})}function HQt(i){if(!(i instanceof Error))return!1;return i.name==="TimeoutError"||/timed out|timeout|operation was aborted|aborted/i.test(i.message)}function HVu(i){if(i instanceof Error){let u=i.cause;if(u instanceof Error&&u.message)return u.message;return i.message}return String(i)}function bQt(i){if(!i)return null;let u=i.trim().replace(/\/+$/,"");if(!u)return null;let t=u.split(/[/:]/).filter(Boolean).at(-1);if(!t)return null;return t.replace(/\.git$/i,"")||null}function RQt(i){return{repoCloneUrl:i.repo?.cloneUrl??null,branch:i.repo?.branch??null,projectName:bQt(i.repo?.cloneUrl)}}function bVu(i){let u=i.maxSandboxes??20,t=new Map,f=i.pickPort??CQt,l=i.fetchImpl??fetch,c=i.resolvePreviewUrl??((g,O)=>`http://127.0.0.1:${O}`),E=(g)=>QQt(i.dataDir,"sandboxes",g),$=(g)=>{try{i.registry?.upsert(g)}catch(O){console.warn(`[user-desktop] failed to persist sandbox lifecycle handle=${g.handle} status=${g.status}:`,O)}},w=(g)=>{try{i.onEvent?.(g)}catch{}},d=async(g)=>{let O=new AbortController,Z=setTimeout(()=>O.abort(),1500);try{let B=await l(`${g}/health`,{signal:O.signal});if(!B.ok)console.warn(`[user-desktop] probe ${g}/health \u2192 ${B.status} (treating as dead)`);return B.ok}catch(B){return console.warn(`[user-desktop] probe ${g}/health failed: ${B instanceof Error?B.message:String(B)} (treating as dead)`),!1}finally{clearTimeout(Z)}},_=(g)=>{console.warn(`[user-desktop] evicting dead daemon handle=${g.handle} port=${g.port}`);try{g.process.kill("SIGTERM")}catch{}if(t.get(g.handle)===g)t.delete(g.handle),$({handle:g.handle,status:"stopped",sandboxPath:E(g.handle),port:null,previewUrl:null,...g.registryMetadata,error:null}),w({handle:g.handle,phase:"evicted"})},v=new Map;function h(){if(t.size<u)return;let g=[...t.values()].filter((Z)=>Z.activeDispatchCount===0).sort((Z,B)=>Z.lastUsedAt-B.lastUsedAt);if(g.length===0){console.warn(`[user-desktop] at cap ${t.size}/${u} but every sandbox is pinned (active dispatch) \u2014 exceeding cap temporarily`);return}let O=g[0];console.log(`[user-desktop] evicting LRU victim handle=${O.handle} port=${O.port} (cap ${u} reached, size=${t.size})`);try{O.process.kill("SIGTERM")}catch{}t.delete(O.handle),$({handle:O.handle,status:"stopped",sandboxPath:E(O.handle),port:null,previewUrl:null,...O.registryMetadata,error:null}),w({handle:O.handle,phase:"evicted"})}let D=async(g)=>{let O=RQt(g),Z=E(g.handle);$({handle:g.handle,status:"spawning",sandboxPath:Z,port:null,previewUrl:null,...O,error:null}),w({handle:g.handle,phase:"spawning"}),h();let B,F=null,y;try{await WQt(Z,{recursive:!0}),console.log(`[user-desktop] ensure handle=${g.handle} repo=${g.repo?.cloneUrl??"(none)"} branch=${g.repo?.branch??"(none)"} runtime=${g.workload?.runtime??"(autodetect)"} pm=${g.workload?.packageManager??"(autodetect)"}`),y=LQt(24).toString("hex");let[j,A]=await Promise.all([f(),f()]);B=j,console.log(`[user-desktop] spawn handle=${g.handle} port=${B} devPort=${A} workdir=${Z}`),F=await Promise.resolve(i.spawnDaemon({workdir:Z,handle:g.handle,port:B,daemonToken:y,offloadAllowedHosts:g.offloadAllowedHosts??[],offloadAllowSameHostDev:g.offloadAllowSameHostDev??!1,orgFsConfigJson:g.orgFsConfigJson}));try{await i.waitForHealth(B)}catch(G){throw QVu("the sandbox didn't come online in time",G)}console.log(`[user-desktop] healthy handle=${g.handle} port=${B} \u2014 posting config`);try{await i.postConfig(B,A,{repo:g.repo,workload:g.workload,operator:g.operator},y)}catch(G){throw QVu(HQt(G)?"configuration timed out":"the sandbox rejected its configuration",G)}}catch(j){if(console.error(`[user-desktop] sandbox bring-up failed handle=${g.handle} port=${B??"(none)"}${F?" (killing daemon)":""}:`,j),F)try{F.kill("SIGKILL")}catch{}throw w({handle:g.handle,phase:"failed",error:HVu(j)}),$({handle:g.handle,status:"failed",sandboxPath:Z,port:null,previewUrl:null,...O,error:HVu(j)}),j}if(!F||B===void 0)throw Error("sandbox bring-up invariant violated");let T=`http://127.0.0.1:${B}`,U=c(g.handle,B);console.log(`[user-desktop] ready handle=${g.handle} port=${B} sandboxApiUrl=${T} previewUrl=${U}`);let I={handle:g.handle,port:B,process:F,sandboxApiUrl:T,previewUrl:U,lastUsedAt:Date.now(),activeDispatchCount:0,daemonToken:y,registryMetadata:O};if(t.set(g.handle,I),$({handle:g.handle,status:"ready",sandboxPath:Z,port:B,previewUrl:U,...O,error:null}),w({handle:g.handle,phase:"ready",port:B,previewUrl:U}),F.exited)F.exited.then(()=>{if(t.get(g.handle)===I)console.warn(`[user-desktop] daemon process exited unexpectedly handle=${g.handle} port=${B} \u2014 removing from cache`),t.delete(g.handle),$({handle:g.handle,status:"stopped",sandboxPath:Z,port:null,previewUrl:null,...O,error:null}),w({handle:g.handle,phase:"evicted"});else console.log(`[user-desktop] daemon process exited handle=${g.handle} port=${B} (already replaced/removed)`)});return{sandboxApiUrl:T,previewUrl:U,port:B}};return{async ensureSandbox(g){let O=t.get(g.handle);if(O){if(await d(O.sandboxApiUrl))return console.log(`[user-desktop] cache hit handle=${g.handle} port=${O.port} (alive)`),O.lastUsedAt=Date.now(),{sandboxApiUrl:O.sandboxApiUrl,previewUrl:O.previewUrl,port:O.port};console.warn(`[user-desktop] cache stale handle=${g.handle} port=${O.port} \u2014 respawning`),_(O)}let Z=v.get(g.handle);if(Z)return console.log(`[user-desktop] joining in-flight ensure handle=${g.handle}`),Z;let B=D(g).finally(()=>{v.delete(g.handle)});return v.set(g.handle,B),B},proxyPort(g){let O=t.get(g);if(O)O.lastUsedAt=Date.now();return O?.port??null},getDaemonToken(g){return t.get(g)?.daemonToken??null},hasHandle(g){return t.has(g)||v.has(g)},recordHit(g){let O=t.get(g);if(O)O.lastUsedAt=Date.now()},acquireDispatch(g){let O=t.get(g);if(!O)return()=>{};O.activeDispatchCount+=1;let Z=!1;return()=>{if(Z)return;Z=!0;let B=t.get(g);if(B)B.activeDispatchCount=Math.max(0,B.activeDispatchCount-1)}},listSandboxes(){return[...t.values()]},async deleteSandbox(g){let O=t.get(g);if(!O){console.log(`[user-desktop] delete handle=${g} (not found, no-op)`);return}if(O.activeDispatchCount>0){console.warn(`[user-desktop] delete handle=${g} port=${O.port} REFUSED \u2014 ${O.activeDispatchCount} active dispatch(es) in flight`);return}console.log(`[user-desktop] delete handle=${g} port=${O.port}`);try{O.process.kill("SIGTERM")}catch{}t.delete(g),$({handle:g,status:"stopped",sandboxPath:E(g),port:null,previewUrl:null,repoCloneUrl:null,branch:null,projectName:null,error:null}),w({handle:g,phase:"deleted"})},async shutdown(){console.log(`[user-desktop] shutdown \u2014 killing ${t.size} sandbox(es)`);for(let g of t.values())try{g.process.kill("SIGTERM")}catch{}t.clear()}}}function CQt(){return new Promise((i,u)=>{let t=zQt();t.unref(),t.on("error",u),t.listen(0,"127.0.0.1",()=>{let f=t.address();if(f&&typeof f==="object"){let l=f.port;t.close(()=>i(l))}else t.close(()=>u(Error("could not allocate port")))})})}var RVu=()=>{};import{randomUUID as MQt}from"crypto";import{hostname as qQt}from"os";async function CVu(i){let u=qQt()||void 0;i.monitor?.onMachine?.(u??"this machine");let t=xHu(i.dataDir,{outFd:i.logFd,perSandboxLog:i.perSandboxLogs,hotReload:i.hotReload}),f=K1i({path:j1i(i.dataDir),managedSandboxRoot:`${i.dataDir}/sandboxes`}),l=!1,c=()=>{if(l)return;l=!0;try{f.close()}catch{}};try{let E=0,$=bVu({dataDir:i.dataDir,registry:f,resolvePreviewUrl:(G,q)=>E>0?`http://${G}.localhost:${E}`:`http://127.0.0.1:${q}`,spawnDaemon:async(G)=>{let q={DAEMON_BOOT_ID:MQt(),APP_ROOT:G.workdir,PROXY_PORT:String(G.port),DAEMON_TOKEN:G.daemonToken,OFFLOAD_ALLOWED_HOSTS:G.offloadAllowedHosts.join(","),...G.offloadAllowSameHostDev?{OFFLOAD_ALLOW_SAME_HOST_DEV:"1"}:{}};if(G.orgFsConfigJson){let Y=await GHu(i.dataDir);if(Y)q.ORGFS_CONFIG=G.orgFsConfigJson,q.ORGFS_RCLONE_PATH=Y}let S=await t({workdir:G.workdir,env:q,daemonPort:G.port});return{port:G.port,kill:(Y)=>S.kill(Y),exited:S.exited.then(()=>{return})}},postConfig:async(G,q,S,Y)=>{let V={port:q};if(S.workload)V.runtime=S.workload.runtime,V.packageManager={name:S.workload.packageManager,...S.workload.packageManagerPath?{path:S.workload.packageManagerPath}:{}};let W={application:V},Ei=od(S.operator??null);if(Ei)W.operator=Ei;if(S.repo)W.git={repository:{cloneUrl:S.repo.cloneUrl,branch:S.repo.branch},...S.repo.userName&&S.repo.userEmail?{identity:{userName:S.repo.userName,userEmail:S.repo.userEmail}}:{}};await cO(`http://127.0.0.1:${G}`,Y,W)},waitForHealth:async(G)=>{await K4i(`http://127.0.0.1:${G}`)},maxSandboxes:20,onEvent:i.monitor?.onEvent}),w=await OVu({port:i.port,lookupSandboxPort:(G)=>$.proxyPort(G)});E=w.port,console.log(`Local ingress listening on http://127.0.0.1:${w.port} (use http://<handle>.localhost:${w.port}/)`),i.monitor?.onIngress?.(w.port);let d=jHu({provider:$}),_=async()=>{let G=await R2({dataDir:i.dataDir,target:i.clusterBaseUrl});if(!G)throw Object.assign(Error(`Session for ${i.clusterBaseUrl} is no longer valid \u2014 run \`deco auth login --target ${i.clusterBaseUrl}\` and restart \`deco link\`.`),{fatal:!0});return G.accessToken},v=await AVu(i.dataDir),h=process.env.npm_package_version??"0.0.0",D=await cHi(),g=xVu(D,{onChange:(G)=>{console.log(`[link-daemon] capabilities detected: +${G.join(",")} (now: ${D.join(",")})`)}}),O=mWi({path:`${i.dataDir}/link/outbox.sqlite`});O.clear();let Z=()=>{},B=new AbortController,F={clusterBaseUrl:i.clusterBaseUrl,getAccessToken:_,provider:$,outbox:O,controlHandler:d,capabilities:D,machineId:v,cliVersion:h,previewPort:w.port,onConnected:()=>{i.monitor?.onCluster?.("linked"),console.log(`Linked to ${i.clusterBaseUrl}`)},onShutdown:()=>Z(),runLifetimeSignal:B.signal};console.log(`[link-daemon] transport=tunnel cluster=${i.clusterBaseUrl}`);let y=await lVu(F);console.log("[link-daemon] active transport=tunnel");let T,U=new Promise((G)=>{T=G}),I=!1,j=async()=>{if(I)return;I=!0,B.abort(),console.log(`
|
|
80753
|
-
Shutting down\u2026`),g();try{await y.close()}catch{}try{await w.stop()}catch{}try{await $.shutdown()}catch{}try{O.close()}catch{}c(),T(0)};process.on("SIGINT",()=>void j()),process.on("SIGTERM",()=>void j()),Z=()=>{console.log("Disconnect requested from the Studio web UI \u2014 shutting down. Run `bunx decocms@latest link` to reconnect."),j()},y.closed.then(()=>{if(i.monitor?.onCluster?.("closed"),!I)console.error("Cluster connection closed permanently; exiting."),j()});let A=WVu({provider:$,registry:f,dataDir:i.dataDir});return{stopped:U,stop:j,stopSandbox:A.stopSandbox,removeSandbox:A.removeSandbox,inspectSandbox:A.inspectSandbox}}catch(E){throw c(),E}}var MVu=N(()=>{bWi();KC();IHu();kHu();KHu();eWi();cVu();ZVu();IVu();nVu();jC();EHi();zVu();RVu()});function $Hi(i){return i.map((u)=>typeof u==="string"?u:String(u)).join(" ")}var X1i;var wHi=N(()=>{X1i={name:"decocms",version:"3.89.0",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/mesh"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:'bun run migrate && concurrently "bun run dev:client" "bun run dev:server"',"dev:servers":'concurrently "bun run dev:client" "bun run dev:server"',"dev:client":"vite dev","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts","build:client":"bun --bun vite build","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","db:migrate":"bun run ./dist/server/migrate.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts",test:"bun test","test:ct":"playwright test -c playwright-ct.config.ts","test:ct:ui":"playwright test -c playwright-ct.config.ts --ui","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts","smoke:link":"bun run scripts/smoke-link.ts",prepublishOnly:"bun run build:client && bun run build:server"},optionalDependencies:{"@anthropic-ai/claude-agent-sdk":"^0.3.181","@duckdb/node-api":"^1.5.0-r.1","@openai/codex":"0.141.0","@openai/codex-darwin-arm64":"npm:@openai/codex@0.141.0-darwin-arm64","@openai/codex-darwin-x64":"npm:@openai/codex@0.141.0-darwin-x64","@openai/codex-linux-arm64":"npm:@openai/codex@0.141.0-linux-arm64","@openai/codex-linux-x64":"npm:@openai/codex@0.141.0-linux-x64","@openai/codex-win32-arm64":"npm:@openai/codex@0.141.0-win32-arm64","@openai/codex-win32-x64":"npm:@openai/codex@0.141.0-win32-x64"},dependencies:{"@ai-sdk/anthropic":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@inkjs/ui":"^2.0.0","@modelcontextprotocol/ext-apps":"^1.7.1","@openrouter/ai-sdk-provider":"^2.9.1","@opentelemetry/core":"^2.6.0","@tanstack/react-virtual":"3.13.24","@xterm/addon-fit":"^0.11.0","@xterm/xterm":"^6.0.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0",kysely:"^0.28.12","node-pty":"^1.0.0","posthog-js":"^1.371.1","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@ai-sdk/react":"^3.0.210","@better-auth/sso":"1.4.1","@daveyplate/better-auth-ui":"^3.2.7","@deco/ui":"workspace:*","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/harness":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/mesh-sdk":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/std":"workspace:*","@decocms/tunnel":"workspace:*","@floating-ui/react":"^0.27.16","@happy-dom/global-registrator":"^20.9.0","@hookform/resolvers":"^5.2.2","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@monaco-editor/react":"^4.7.0","@nats-io/jwt":"0.0.10-5","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@playwright/experimental-ct-react":"1.59.1","@playwright/test":"^1.58.2","@radix-ui/react-avatar":"^1.1.10","@radix-ui/react-checkbox":"^1.3.3","@radix-ui/react-dialog":"^1.1.15","@radix-ui/react-dropdown-menu":"^2.1.16","@radix-ui/react-label":"^2.1.7","@radix-ui/react-select":"^2.2.6","@radix-ui/react-separator":"^1.1.7","@radix-ui/react-slot":"^1.2.3","@radix-ui/react-tabs":"^1.1.13","@rjsf/core":"^6.1.2","@rjsf/shadcn":"^6.1.2","@rjsf/utils":"^6.1.2","@rjsf/validator-ajv8":"^6.1.2","@tailwindcss/vite":"^4.1.17","@tanstack/react-query":"5.100.10","@tanstack/react-router":"1.169.2","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.2","@tiptap/core":"3.20.2","@tiptap/extension-placeholder":"3.20.2","@tiptap/pm":"3.20.2","@tiptap/react":"3.20.2","@tiptap/starter-kit":"3.20.2","@tiptap/suggestion":"3.20.2","@types/bun":"^1.3.1","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@untitledui/icons":"^0.0.19","@vercel/nft":"^1.1.1","@vitejs/plugin-react":"^5.1.0",ai:"^6.0.208","babel-plugin-react-compiler":"^1.0.0","better-auth":"1.4.22","class-variance-authority":"^0.7.1",clsx:"^2.1.1",concurrently:"^9.2.1",croner:"^9.1.0","date-fns":"^4.1.0",degit:"^2.8.4",hono:"^4.10.7","input-otp":"^1.4.2",jose:"^6.0.11","lucide-react":"^0.468.0",marked:"^15.0.6",nanoid:"^5.1.6",pg:"^8.16.3",prettier:"^3.4.2","react-hook-form":"^7.66.0","react-markdown":"^10.1.0","react-resizable-panels":"^2.1.7","react-syntax-highlighter":"^15.6.1",recharts:"^3.6.0","rehype-raw":"^7.0.0","remark-gfm":"^4.0.0","sass-embedded":"^1.97.2",sonner:"^2.0.7","tailwind-merge":"^3.3.1",tailwindcss:"^4.1.17",typescript:"^5.9.3",vite:"^7.2.1","vite-tsconfig-paths":"^5.1.4",zod:"^4.0.0"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","mesh","tools"],license:"MIT",publishConfig:{access:"public"}}});var wM={};Qi(wM,{printBanner:()=>mQt,bannerLines:()=>qVu,BANNER_LINES:()=>J1i,BANNER_GRADIENT:()=>S1i});function rQt(i){let u=Number.parseInt(i.slice(1),16);return[u>>16&255,u>>8&255,u&255]}function qVu(i){let u=J1i.map((t,f)=>{let[l,c,E]=rQt(S1i[f]);return`\x1B[38;2;${l};${c};${E}m${t}\x1B[39m`});if(i!==void 0)u.push(`\x1B[2m v${i}\x1B[22m`);return u}function mQt(i){console.log("");for(let u of qVu(i))console.log(u);console.log("")}var J1i,S1i;var FY=N(()=>{J1i=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 ","\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588 \u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588 \u2591 \u2588\u2588\u2588 \u2591\u2591\u2591 \u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588"," \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588"," \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2591\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588"," \u2591\u2588\u2588\u2588 \u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591 \u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588 "," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591 ","\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591 "],S1i=["#00ff64","#00ee5e","#00dc56","#00c84e","#00b444","#00a03c","#008832","#006e28"]});import{Box as eQt,Text as VVu}from"ink";import{jsx as aQt,jsxs as rVu}from"react/jsx-runtime";function Y1i({version:i}){return rVu(eQt,{flexDirection:"column",marginTop:1,children:[J1i.map((u,t)=>aQt(VVu,{color:S1i[t],children:u},t)),rVu(VVu,{dimColor:!0,children:[" v",i]})]})}var dHi=N(()=>{FY()});function mVu(i){let u=i.branch??i.handle,t=[];if(i.dirtyCount>0)t.push(`${i.dirtyCount} uncommitted file${i.dirtyCount===1?"":"s"}`);if(i.merged===!1)t.push("branch not merged");return t.length>0?`\u26A0 ${t.join(", ")} \u2014 delete ${u}? (y/n)`:`Delete ${u}? (y/n)`}function yY(i){return[...i.values()].map((u)=>u.handle).sort((u,t)=>u.localeCompare(t))}function eVu(i,u,t){if(i.length===0)return null;let f=u===null?-1:i.indexOf(u);if(f===-1)return t>0?i[0]:i[i.length-1];let l=Math.max(0,Math.min(i.length-1,f+t));return i[l]}function aVu(i,u,t){if(t!==u)return t;let f=i.indexOf(u);if(f===-1)return t;return i[f+1]??i[f-1]??null}var DHi={};Qi(DHi,{subscribeLinkState:()=>_Hi,setSelectedHandle:()=>vHi,setPersistedSandboxes:()=>EHt,setPendingConfirm:()=>_M,setMachine:()=>tHt,setLogPath:()=>lHt,setLinkActions:()=>cHt,setIngress:()=>uHt,setDaemonError:()=>fHt,setClusterUrl:()=>iHt,setCluster:()=>pQt,setActionError:()=>W1i,resetLinkStateForTests:()=>wHt,removeSandboxRow:()=>hHi,pushSandboxEvent:()=>$Ht,getLinkState:()=>dM,applySandboxEvent:()=>oVu});function sQt(i){return i==="spawning"||i==="ready"||i==="failed"}function oVu(i,u){let t=new Map(i),f=t.get(u.handle);if(u.phase==="evicted"||u.phase==="deleted"){if(f)t.set(u.handle,{...f,port:null,previewUrl:null,status:"stopped",error:null});return t}return t.set(u.handle,{handle:u.handle,port:u.port??f?.port??null,previewUrl:u.previewUrl??f?.previewUrl??null,status:u.phase,error:u.phase==="failed"?u.error??"failed":null,projectName:f?.projectName??null,branch:f?.branch??null,sandboxPath:f?.sandboxPath??null}),t}function sVu(){return{cluster:"connecting",clusterUrl:null,ingressUrl:null,ingressPort:null,machine:null,cap:oQt,sandboxes:new Map,daemonError:null,logPath:null,selectedHandle:null,pendingConfirm:null,actionError:null,actions:null}}function Ww(){for(let i of L1i)i()}function dM(){return rf}function _Hi(i){return L1i.add(i),()=>L1i.delete(i)}function pQt(i){rf={...rf,cluster:i},Ww()}function iHt(i){rf={...rf,clusterUrl:i},Ww()}function uHt(i,u){rf={...rf,ingressPort:i,ingressUrl:u},Ww()}function tHt(i){rf={...rf,machine:i},Ww()}function fHt(i){rf={...rf,daemonError:i},Ww()}function lHt(i){rf={...rf,logPath:i},Ww()}function vHi(i){rf={...rf,selectedHandle:i},Ww()}function _M(i){rf={...rf,pendingConfirm:i},Ww()}function W1i(i){rf={...rf,actionError:i},Ww()}function cHt(i){rf={...rf,actions:i},Ww()}function hHi(i){let u=yY(rf.sandboxes),t=aVu(u,i,rf.selectedHandle),f=new Map(rf.sandboxes);f.delete(i),rf={...rf,sandboxes:f,selectedHandle:t,pendingConfirm:null},Ww()}function EHt(i){let u=new Map;for(let t of i)u.set(t.handle,{handle:t.handle,port:t.port,previewUrl:t.previewUrl,status:t.status,error:t.error,projectName:t.projectName,branch:t.branch,sandboxPath:t.sandboxPath});for(let[t,f]of rf.sandboxes)if(sQt(f.status))u.set(t,f);rf={...rf,sandboxes:u},Ww()}function $Ht(i){rf={...rf,sandboxes:oVu(rf.sandboxes,i)},Ww()}function wHt(){rf=sVu(),L1i.clear()}var oQt=20,rf,L1i;var vM=N(()=>{rf=sVu(),L1i=new Set});import{spawn as dHt}from"child_process";function _Ht(i){if(i==="darwin")return"open";if(i==="win32")return"start";return"xdg-open"}function pVu(i,u=process.platform){let t=_Ht(u);try{dHt(t,[i],{stdio:"ignore",detached:!0}).unref()}catch{}}var iru=()=>{};function uru(i,u={}){let t=u.openUrl??pVu,f=dM(),l=yY(f.sandboxes),c=f.selectedHandle!==null&&l.includes(f.selectedHandle)?f.selectedHandle:l[0]??null,E=f.actions;switch(i.type){case"move":vHi(eVu(l,f.selectedHandle,i.delta));return;case"open":{if(c===null)return;let $=f.sandboxes.get(c);if($?.status==="ready"&&$.previewUrl)t($.previewUrl);return}case"stop":if(c!==null&&E)E.stopSandbox(c);return;case"delete":{if(c===null||!E)return;let $=E.inspectSandbox(c),w=f.sandboxes.get(c);W1i(null),_M({handle:c,branch:$?.branch??w?.branch??null,dirtyCount:$?.dirtyCount??0,merged:$?.merged??null});return}case"confirmYes":{let $=f.pendingConfirm;if(_M(null),$===null||!E)return;E.removeSandbox($.handle).then((w)=>{if(w.ok)hHi($.handle);else W1i(w.error)});return}case"confirmNo":_M(null);return;case"quit":if(E)E.quit();return}}var tru=N(()=>{vM();iru()});function fru(i,u,t){if(t)return i==="y"||i==="Y"?{type:"confirmYes"}:{type:"confirmNo"};if(u.upArrow||i==="k")return{type:"move",delta:-1};if(u.downArrow||i==="j")return{type:"move",delta:1};if(i==="s")return{type:"stop"};if(i==="d")return{type:"delete"};if(i==="o")return{type:"open"};if(i==="q"||u.ctrl===!0&&i==="c")return{type:"quit"};return null}var lru={};Qi(lru,{LinkApp:()=>gHt});import{Box as H1,Text as cl,useInput as vHt}from"ink";import{useSyncExternalStore as hHt}from"react";import{jsx as Pf,jsxs as w_}from"react/jsx-runtime";function DHt(i){if(i.status==="ready")return{color:"green",text:"\u25CF Live"};if(i.status==="spawning")return{color:"yellow",text:"\u25CC Starting\u2026"};if(i.status==="stopped")return{color:"gray",text:"\u25A0 Stopped"};if(i.status==="missing")return{color:"yellow",text:"\u25A1 Missing"};if(i.status==="merged")return{color:"cyan",text:"\u2713 Merged"};if(i.status==="invalid")return{color:"red",text:"\u2717 Invalid"};if(i.status==="failed")return{color:"red",text:`\u2717 Failed: ${i.error??"failed"}`};return{color:"red",text:`\u2717 Error: ${i.error??""}`}}function gHt(){let i=hHt(_Hi,dM),u=[...i.sandboxes.values()].sort((l,c)=>l.handle.localeCompare(c.handle)),t=yY(i.sandboxes),f=i.selectedHandle!==null&&t.includes(i.selectedHandle)?i.selectedHandle:t[0]??null;return vHt((l,c)=>{let E=fru(l,c,i.pendingConfirm!==null);if(E!==null)uru(E)}),w_(H1,{flexDirection:"column",children:[Pf(Y1i,{version:X1i.version}),Pf(H1,{marginBottom:1,children:Pf(cl,{dimColor:!0,children:"\u2500".repeat(80)})}),Pf(H1,{children:i.cluster==="linked"?w_(cl,{color:"green",children:["\u2713 Connected to ",i.clusterUrl??"deco"]}):i.cluster==="connecting"?w_(cl,{color:"yellow",children:["\u25CC Connecting to ",i.clusterUrl??"deco","\u2026"]}):w_(cl,{color:"red",children:["\u2717 Disconnected from ",i.clusterUrl??"deco"]})}),Pf(H1,{children:i.ingressUrl?w_(cl,{color:"green",children:["\u2713 Serving at ",i.ingressUrl]}):Pf(cl,{dimColor:!0,children:"\u25CC Starting local server\u2026"})}),Pf(H1,{marginBottom:1,children:Pf(cl,{dimColor:!0,children:`${"Computer".padEnd(16)}${i.machine??"this computer"} \xB7 ${u.length} of ${i.cap} previews`})}),u.length===0?Pf(cl,{dimColor:!0,children:"No previews running yet."}):w_(H1,{flexDirection:"column",children:[w_(H1,{children:[Pf(H1,{width:2,flexShrink:0}),Pf(H1,{width:TY.project,flexShrink:0,marginRight:1,children:Pf(cl,{dimColor:!0,wrap:"truncate-end",children:"PROJECT"})}),Pf(H1,{width:TY.branch,flexShrink:0,marginRight:1,children:Pf(cl,{dimColor:!0,wrap:"truncate-end",children:"BRANCH"})}),Pf(H1,{width:TY.status,flexShrink:0,marginRight:1,children:Pf(cl,{dimColor:!0,wrap:"truncate-end",children:"STATUS"})}),Pf(H1,{flexGrow:1,children:Pf(cl,{dimColor:!0,wrap:"truncate-end",children:"PREVIEW URL"})})]}),u.map((l)=>{let c=DHt(l),E=l.handle===f;return w_(H1,{children:[Pf(H1,{width:2,flexShrink:0,children:Pf(cl,{color:"cyan",children:E?"\u203A":" "})}),Pf(H1,{width:TY.project,flexShrink:0,marginRight:1,children:Pf(cl,{bold:E,wrap:"truncate-end",children:l.projectName??l.handle})}),Pf(H1,{width:TY.branch,flexShrink:0,marginRight:1,children:Pf(cl,{bold:E,wrap:"truncate-end",children:l.branch??"\u2014"})}),Pf(H1,{width:TY.status,flexShrink:0,marginRight:1,children:Pf(cl,{color:c.color,bold:E,wrap:"truncate-end",children:c.text})}),Pf(H1,{flexGrow:1,children:Pf(cl,{dimColor:!0,wrap:"truncate-end",children:l.previewUrl??"\u2014"})})]},l.handle)})]}),i.daemonError?Pf(H1,{marginTop:1,children:w_(cl,{color:"red",children:["\u26A0 ",i.daemonError]})}):null,i.logPath?Pf(H1,{marginTop:1,children:w_(cl,{dimColor:!0,children:["Logs: ",i.logPath]})}):null,i.pendingConfirm?Pf(H1,{marginTop:1,children:Pf(cl,{color:"yellow",children:mVu(i.pendingConfirm)})}):null,i.actionError?Pf(H1,{marginTop:1,children:w_(cl,{color:"red",children:["\u2717 ",i.actionError]})}):null,Pf(H1,{marginTop:1,children:Pf(cl,{dimColor:!0,children:"\u2191\u2193 move \xB7 s stop \xB7 d delete \xB7 o open \xB7 q quit"})})]})}var TY;var cru=N(()=>{wHi();dHi();tru();vM();TY={project:18,branch:22,status:14}});var Eru={};Qi(Eru,{runLinkCommand:()=>UHt});import{closeSync as NHt,mkdirSync as OHt,openSync as ZHt,writeSync as BHt}from"fs";import{homedir as FHt}from"os";import{join as gHi}from"path";function yHt(i,u){let t={log:console.log,warn:console.warn,error:console.error},f=(l)=>{if(u===void 0)return;try{BHt(u,`${$Hi(l)}
|
|
80753
|
+
Shutting down\u2026`),g();try{await y.close()}catch{}try{await w.stop()}catch{}try{await $.shutdown()}catch{}try{O.close()}catch{}c(),T(0)};process.on("SIGINT",()=>void j()),process.on("SIGTERM",()=>void j()),Z=()=>{console.log("Disconnect requested from the Studio web UI \u2014 shutting down. Run `bunx decocms@latest link` to reconnect."),j()},y.closed.then(()=>{if(i.monitor?.onCluster?.("closed"),!I)console.error("Cluster connection closed permanently; exiting."),j()});let A=WVu({provider:$,registry:f,dataDir:i.dataDir});return{stopped:U,stop:j,stopSandbox:A.stopSandbox,removeSandbox:A.removeSandbox,inspectSandbox:A.inspectSandbox}}catch(E){throw c(),E}}var MVu=N(()=>{bWi();KC();IHu();kHu();KHu();eWi();cVu();ZVu();IVu();nVu();jC();EHi();zVu();RVu()});function $Hi(i){return i.map((u)=>typeof u==="string"?u:String(u)).join(" ")}var X1i;var wHi=N(()=>{X1i={name:"decocms",version:"3.89.2",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/mesh"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:'bun run migrate && concurrently "bun run dev:client" "bun run dev:server"',"dev:servers":'concurrently "bun run dev:client" "bun run dev:server"',"dev:client":"vite dev","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts","build:client":"bun --bun vite build","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","db:migrate":"bun run ./dist/server/migrate.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts",test:"bun test","test:ct":"playwright test -c playwright-ct.config.ts","test:ct:ui":"playwright test -c playwright-ct.config.ts --ui","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts","smoke:link":"bun run scripts/smoke-link.ts",prepublishOnly:"bun run build:client && bun run build:server"},optionalDependencies:{"@anthropic-ai/claude-agent-sdk":"^0.3.181","@duckdb/node-api":"^1.5.0-r.1","@openai/codex":"0.141.0","@openai/codex-darwin-arm64":"npm:@openai/codex@0.141.0-darwin-arm64","@openai/codex-darwin-x64":"npm:@openai/codex@0.141.0-darwin-x64","@openai/codex-linux-arm64":"npm:@openai/codex@0.141.0-linux-arm64","@openai/codex-linux-x64":"npm:@openai/codex@0.141.0-linux-x64","@openai/codex-win32-arm64":"npm:@openai/codex@0.141.0-win32-arm64","@openai/codex-win32-x64":"npm:@openai/codex@0.141.0-win32-x64"},dependencies:{"@ai-sdk/anthropic":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@inkjs/ui":"^2.0.0","@modelcontextprotocol/ext-apps":"^1.7.1","@openrouter/ai-sdk-provider":"^2.9.1","@opentelemetry/core":"^2.6.0","@tanstack/react-virtual":"3.13.24","@xterm/addon-fit":"^0.11.0","@xterm/xterm":"^6.0.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0",kysely:"^0.28.12","node-pty":"^1.0.0","posthog-js":"^1.371.1","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@ai-sdk/react":"^3.0.210","@better-auth/sso":"1.4.1","@daveyplate/better-auth-ui":"^3.2.7","@deco/ui":"workspace:*","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/harness":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/mesh-sdk":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/std":"workspace:*","@decocms/tunnel":"workspace:*","@floating-ui/react":"^0.27.16","@happy-dom/global-registrator":"^20.9.0","@hookform/resolvers":"^5.2.2","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@monaco-editor/react":"^4.7.0","@nats-io/jwt":"0.0.10-5","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@playwright/experimental-ct-react":"1.59.1","@playwright/test":"^1.58.2","@radix-ui/react-avatar":"^1.1.10","@radix-ui/react-checkbox":"^1.3.3","@radix-ui/react-dialog":"^1.1.15","@radix-ui/react-dropdown-menu":"^2.1.16","@radix-ui/react-label":"^2.1.7","@radix-ui/react-select":"^2.2.6","@radix-ui/react-separator":"^1.1.7","@radix-ui/react-slot":"^1.2.3","@radix-ui/react-tabs":"^1.1.13","@rjsf/core":"^6.1.2","@rjsf/shadcn":"^6.1.2","@rjsf/utils":"^6.1.2","@rjsf/validator-ajv8":"^6.1.2","@tailwindcss/vite":"^4.1.17","@tanstack/react-query":"5.100.10","@tanstack/react-router":"1.169.2","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.2","@tiptap/core":"3.20.2","@tiptap/extension-placeholder":"3.20.2","@tiptap/pm":"3.20.2","@tiptap/react":"3.20.2","@tiptap/starter-kit":"3.20.2","@tiptap/suggestion":"3.20.2","@types/bun":"^1.3.1","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@untitledui/icons":"^0.0.19","@vercel/nft":"^1.1.1","@vitejs/plugin-react":"^5.1.0",ai:"^6.0.208","babel-plugin-react-compiler":"^1.0.0","better-auth":"1.4.22","class-variance-authority":"^0.7.1",clsx:"^2.1.1",concurrently:"^9.2.1",croner:"^9.1.0","date-fns":"^4.1.0",degit:"^2.8.4",hono:"^4.10.7","input-otp":"^1.4.2",jose:"^6.0.11","lucide-react":"^0.468.0",marked:"^15.0.6",nanoid:"^5.1.6",pg:"^8.16.3",prettier:"^3.4.2","react-hook-form":"^7.66.0","react-markdown":"^10.1.0","react-resizable-panels":"^2.1.7","react-syntax-highlighter":"^15.6.1",recharts:"^3.6.0","rehype-raw":"^7.0.0","remark-gfm":"^4.0.0","sass-embedded":"^1.97.2",sonner:"^2.0.7","tailwind-merge":"^3.3.1",tailwindcss:"^4.1.17",typescript:"^5.9.3",vite:"^7.2.1","vite-tsconfig-paths":"^5.1.4",zod:"^4.0.0"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","mesh","tools"],license:"MIT",publishConfig:{access:"public"}}});var wM={};Qi(wM,{printBanner:()=>mQt,bannerLines:()=>qVu,BANNER_LINES:()=>J1i,BANNER_GRADIENT:()=>S1i});function rQt(i){let u=Number.parseInt(i.slice(1),16);return[u>>16&255,u>>8&255,u&255]}function qVu(i){let u=J1i.map((t,f)=>{let[l,c,E]=rQt(S1i[f]);return`\x1B[38;2;${l};${c};${E}m${t}\x1B[39m`});if(i!==void 0)u.push(`\x1B[2m v${i}\x1B[22m`);return u}function mQt(i){console.log("");for(let u of qVu(i))console.log(u);console.log("")}var J1i,S1i;var FY=N(()=>{J1i=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 ","\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588 \u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588 \u2591 \u2588\u2588\u2588 \u2591\u2591\u2591 \u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588"," \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588"," \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2591\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588"," \u2591\u2588\u2588\u2588 \u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591 \u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588 "," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591 ","\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591 "],S1i=["#00ff64","#00ee5e","#00dc56","#00c84e","#00b444","#00a03c","#008832","#006e28"]});import{Box as eQt,Text as VVu}from"ink";import{jsx as aQt,jsxs as rVu}from"react/jsx-runtime";function Y1i({version:i}){return rVu(eQt,{flexDirection:"column",marginTop:1,children:[J1i.map((u,t)=>aQt(VVu,{color:S1i[t],children:u},t)),rVu(VVu,{dimColor:!0,children:[" v",i]})]})}var dHi=N(()=>{FY()});function mVu(i){let u=i.branch??i.handle,t=[];if(i.dirtyCount>0)t.push(`${i.dirtyCount} uncommitted file${i.dirtyCount===1?"":"s"}`);if(i.merged===!1)t.push("branch not merged");return t.length>0?`\u26A0 ${t.join(", ")} \u2014 delete ${u}? (y/n)`:`Delete ${u}? (y/n)`}function yY(i){return[...i.values()].map((u)=>u.handle).sort((u,t)=>u.localeCompare(t))}function eVu(i,u,t){if(i.length===0)return null;let f=u===null?-1:i.indexOf(u);if(f===-1)return t>0?i[0]:i[i.length-1];let l=Math.max(0,Math.min(i.length-1,f+t));return i[l]}function aVu(i,u,t){if(t!==u)return t;let f=i.indexOf(u);if(f===-1)return t;return i[f+1]??i[f-1]??null}var DHi={};Qi(DHi,{subscribeLinkState:()=>_Hi,setSelectedHandle:()=>vHi,setPersistedSandboxes:()=>EHt,setPendingConfirm:()=>_M,setMachine:()=>tHt,setLogPath:()=>lHt,setLinkActions:()=>cHt,setIngress:()=>uHt,setDaemonError:()=>fHt,setClusterUrl:()=>iHt,setCluster:()=>pQt,setActionError:()=>W1i,resetLinkStateForTests:()=>wHt,removeSandboxRow:()=>hHi,pushSandboxEvent:()=>$Ht,getLinkState:()=>dM,applySandboxEvent:()=>oVu});function sQt(i){return i==="spawning"||i==="ready"||i==="failed"}function oVu(i,u){let t=new Map(i),f=t.get(u.handle);if(u.phase==="evicted"||u.phase==="deleted"){if(f)t.set(u.handle,{...f,port:null,previewUrl:null,status:"stopped",error:null});return t}return t.set(u.handle,{handle:u.handle,port:u.port??f?.port??null,previewUrl:u.previewUrl??f?.previewUrl??null,status:u.phase,error:u.phase==="failed"?u.error??"failed":null,projectName:f?.projectName??null,branch:f?.branch??null,sandboxPath:f?.sandboxPath??null}),t}function sVu(){return{cluster:"connecting",clusterUrl:null,ingressUrl:null,ingressPort:null,machine:null,cap:oQt,sandboxes:new Map,daemonError:null,logPath:null,selectedHandle:null,pendingConfirm:null,actionError:null,actions:null}}function Ww(){for(let i of L1i)i()}function dM(){return rf}function _Hi(i){return L1i.add(i),()=>L1i.delete(i)}function pQt(i){rf={...rf,cluster:i},Ww()}function iHt(i){rf={...rf,clusterUrl:i},Ww()}function uHt(i,u){rf={...rf,ingressPort:i,ingressUrl:u},Ww()}function tHt(i){rf={...rf,machine:i},Ww()}function fHt(i){rf={...rf,daemonError:i},Ww()}function lHt(i){rf={...rf,logPath:i},Ww()}function vHi(i){rf={...rf,selectedHandle:i},Ww()}function _M(i){rf={...rf,pendingConfirm:i},Ww()}function W1i(i){rf={...rf,actionError:i},Ww()}function cHt(i){rf={...rf,actions:i},Ww()}function hHi(i){let u=yY(rf.sandboxes),t=aVu(u,i,rf.selectedHandle),f=new Map(rf.sandboxes);f.delete(i),rf={...rf,sandboxes:f,selectedHandle:t,pendingConfirm:null},Ww()}function EHt(i){let u=new Map;for(let t of i)u.set(t.handle,{handle:t.handle,port:t.port,previewUrl:t.previewUrl,status:t.status,error:t.error,projectName:t.projectName,branch:t.branch,sandboxPath:t.sandboxPath});for(let[t,f]of rf.sandboxes)if(sQt(f.status))u.set(t,f);rf={...rf,sandboxes:u},Ww()}function $Ht(i){rf={...rf,sandboxes:oVu(rf.sandboxes,i)},Ww()}function wHt(){rf=sVu(),L1i.clear()}var oQt=20,rf,L1i;var vM=N(()=>{rf=sVu(),L1i=new Set});import{spawn as dHt}from"child_process";function _Ht(i){if(i==="darwin")return"open";if(i==="win32")return"start";return"xdg-open"}function pVu(i,u=process.platform){let t=_Ht(u);try{dHt(t,[i],{stdio:"ignore",detached:!0}).unref()}catch{}}var iru=()=>{};function uru(i,u={}){let t=u.openUrl??pVu,f=dM(),l=yY(f.sandboxes),c=f.selectedHandle!==null&&l.includes(f.selectedHandle)?f.selectedHandle:l[0]??null,E=f.actions;switch(i.type){case"move":vHi(eVu(l,f.selectedHandle,i.delta));return;case"open":{if(c===null)return;let $=f.sandboxes.get(c);if($?.status==="ready"&&$.previewUrl)t($.previewUrl);return}case"stop":if(c!==null&&E)E.stopSandbox(c);return;case"delete":{if(c===null||!E)return;let $=E.inspectSandbox(c),w=f.sandboxes.get(c);W1i(null),_M({handle:c,branch:$?.branch??w?.branch??null,dirtyCount:$?.dirtyCount??0,merged:$?.merged??null});return}case"confirmYes":{let $=f.pendingConfirm;if(_M(null),$===null||!E)return;E.removeSandbox($.handle).then((w)=>{if(w.ok)hHi($.handle);else W1i(w.error)});return}case"confirmNo":_M(null);return;case"quit":if(E)E.quit();return}}var tru=N(()=>{vM();iru()});function fru(i,u,t){if(t)return i==="y"||i==="Y"?{type:"confirmYes"}:{type:"confirmNo"};if(u.upArrow||i==="k")return{type:"move",delta:-1};if(u.downArrow||i==="j")return{type:"move",delta:1};if(i==="s")return{type:"stop"};if(i==="d")return{type:"delete"};if(i==="o")return{type:"open"};if(i==="q"||u.ctrl===!0&&i==="c")return{type:"quit"};return null}var lru={};Qi(lru,{LinkApp:()=>gHt});import{Box as H1,Text as cl,useInput as vHt}from"ink";import{useSyncExternalStore as hHt}from"react";import{jsx as Pf,jsxs as w_}from"react/jsx-runtime";function DHt(i){if(i.status==="ready")return{color:"green",text:"\u25CF Live"};if(i.status==="spawning")return{color:"yellow",text:"\u25CC Starting\u2026"};if(i.status==="stopped")return{color:"gray",text:"\u25A0 Stopped"};if(i.status==="missing")return{color:"yellow",text:"\u25A1 Missing"};if(i.status==="merged")return{color:"cyan",text:"\u2713 Merged"};if(i.status==="invalid")return{color:"red",text:"\u2717 Invalid"};if(i.status==="failed")return{color:"red",text:`\u2717 Failed: ${i.error??"failed"}`};return{color:"red",text:`\u2717 Error: ${i.error??""}`}}function gHt(){let i=hHt(_Hi,dM),u=[...i.sandboxes.values()].sort((l,c)=>l.handle.localeCompare(c.handle)),t=yY(i.sandboxes),f=i.selectedHandle!==null&&t.includes(i.selectedHandle)?i.selectedHandle:t[0]??null;return vHt((l,c)=>{let E=fru(l,c,i.pendingConfirm!==null);if(E!==null)uru(E)}),w_(H1,{flexDirection:"column",children:[Pf(Y1i,{version:X1i.version}),Pf(H1,{marginBottom:1,children:Pf(cl,{dimColor:!0,children:"\u2500".repeat(80)})}),Pf(H1,{children:i.cluster==="linked"?w_(cl,{color:"green",children:["\u2713 Connected to ",i.clusterUrl??"deco"]}):i.cluster==="connecting"?w_(cl,{color:"yellow",children:["\u25CC Connecting to ",i.clusterUrl??"deco","\u2026"]}):w_(cl,{color:"red",children:["\u2717 Disconnected from ",i.clusterUrl??"deco"]})}),Pf(H1,{children:i.ingressUrl?w_(cl,{color:"green",children:["\u2713 Serving at ",i.ingressUrl]}):Pf(cl,{dimColor:!0,children:"\u25CC Starting local server\u2026"})}),Pf(H1,{marginBottom:1,children:Pf(cl,{dimColor:!0,children:`${"Computer".padEnd(16)}${i.machine??"this computer"} \xB7 ${u.length} of ${i.cap} previews`})}),u.length===0?Pf(cl,{dimColor:!0,children:"No previews running yet."}):w_(H1,{flexDirection:"column",children:[w_(H1,{children:[Pf(H1,{width:2,flexShrink:0}),Pf(H1,{width:TY.project,flexShrink:0,marginRight:1,children:Pf(cl,{dimColor:!0,wrap:"truncate-end",children:"PROJECT"})}),Pf(H1,{width:TY.branch,flexShrink:0,marginRight:1,children:Pf(cl,{dimColor:!0,wrap:"truncate-end",children:"BRANCH"})}),Pf(H1,{width:TY.status,flexShrink:0,marginRight:1,children:Pf(cl,{dimColor:!0,wrap:"truncate-end",children:"STATUS"})}),Pf(H1,{flexGrow:1,children:Pf(cl,{dimColor:!0,wrap:"truncate-end",children:"PREVIEW URL"})})]}),u.map((l)=>{let c=DHt(l),E=l.handle===f;return w_(H1,{children:[Pf(H1,{width:2,flexShrink:0,children:Pf(cl,{color:"cyan",children:E?"\u203A":" "})}),Pf(H1,{width:TY.project,flexShrink:0,marginRight:1,children:Pf(cl,{bold:E,wrap:"truncate-end",children:l.projectName??l.handle})}),Pf(H1,{width:TY.branch,flexShrink:0,marginRight:1,children:Pf(cl,{bold:E,wrap:"truncate-end",children:l.branch??"\u2014"})}),Pf(H1,{width:TY.status,flexShrink:0,marginRight:1,children:Pf(cl,{color:c.color,bold:E,wrap:"truncate-end",children:c.text})}),Pf(H1,{flexGrow:1,children:Pf(cl,{dimColor:!0,wrap:"truncate-end",children:l.previewUrl??"\u2014"})})]},l.handle)})]}),i.daemonError?Pf(H1,{marginTop:1,children:w_(cl,{color:"red",children:["\u26A0 ",i.daemonError]})}):null,i.logPath?Pf(H1,{marginTop:1,children:w_(cl,{dimColor:!0,children:["Logs: ",i.logPath]})}):null,i.pendingConfirm?Pf(H1,{marginTop:1,children:Pf(cl,{color:"yellow",children:mVu(i.pendingConfirm)})}):null,i.actionError?Pf(H1,{marginTop:1,children:w_(cl,{color:"red",children:["\u2717 ",i.actionError]})}):null,Pf(H1,{marginTop:1,children:Pf(cl,{dimColor:!0,children:"\u2191\u2193 move \xB7 s stop \xB7 d delete \xB7 o open \xB7 q quit"})})]})}var TY;var cru=N(()=>{wHi();dHi();tru();vM();TY={project:18,branch:22,status:14}});var Eru={};Qi(Eru,{runLinkCommand:()=>UHt});import{closeSync as NHt,mkdirSync as OHt,openSync as ZHt,writeSync as BHt}from"fs";import{homedir as FHt}from"os";import{join as gHi}from"path";function yHt(i,u){let t={log:console.log,warn:console.warn,error:console.error},f=(l)=>{if(u===void 0)return;try{BHt(u,`${$Hi(l)}
|
|
80754
80754
|
`)}catch{}};return console.log=(...l)=>f(l),console.warn=(...l)=>f(l),console.error=(...l)=>{f(l),i($Hi(l))},()=>{console.log=t.log,console.warn=t.warn,console.error=t.error}}async function THt(i,u){let t;try{t=await fetch(`${i}/api/links/me`,{headers:{authorization:`Bearer ${u}`},signal:AbortSignal.timeout(1e4)})}catch{return}if(t.status===401||t.status===403)throw Error(`Authentication rejected by ${i} \u2014 the session token was not accepted. `+`Run \`deco auth login --target ${i}\` and try again.`)}async function UHt(i={}){let u=i.port??5174,t=i.dataDir??process.env.DATA_DIR??process.env.DECOCMS_HOME??gHi(FHt(),"deco"),f=i.clusterBaseUrl??process.env.MESH_CLUSTER_URL??"https://studio.decocms.com",l,c,E,$=()=>{if(E===void 0)return;try{E.close()}catch{}finally{E=void 0}};try{let w=gHi(t,"sandboxes");E=K1i({path:j1i(t),managedSandboxRoot:w});let d=await n4i({dataDir:t,intent:"Link",target:f});if(process.env.DECOCMS_LINK_MANAGED!=="1")await THt(f,d.accessToken);let _=E.reconcile();if(i.prune){let g=E.prune({missing:!0,merged:!0});if(!i.tui)console.log(`Pruned local sandboxes: removed ${g.removed.length}, skipped ${g.skipped.length}.`);_=E.reconcile()}let v;if(i.tui){let{render:g}=await import("ink"),{createElement:O}=await import("react"),{LinkApp:Z}=await Promise.resolve().then(() => (cru(),lru)),{pushSandboxEvent:B,setCluster:F,setClusterUrl:y,setDaemonError:T,setIngress:U,setLogPath:I,setMachine:j,setPersistedSandboxes:A}=await Promise.resolve().then(() => (vM(),DHi));OHt(t,{recursive:!0});let G=gHi(t,"link.log");c=ZHt(G,"w"),I(G),A(_),y(f),F("connecting"),v={onEvent:(q)=>B(q),onIngress:(q)=>U(q,`http://127.0.0.1:${q}`),onCluster:(q)=>F(q),onMachine:(q)=>j(q)},l=yHt(T,c),g(O(Z),{patchConsole:!1})}else if(i.banner!==!1){let{printBanner:g}=await Promise.resolve().then(() => (FY(),wM));g(i.version??"0.0.0")}$();let h=process.env.DECOCMS_LINK_MANAGED!=="1",D=await CVu({port:u,clusterBaseUrl:f,dataDir:t,session:d,monitor:v,logFd:c,perSandboxLogs:h,hotReload:i.hotReload});if(i.tui){let{setLinkActions:g}=await Promise.resolve().then(() => (vM(),DHi));g({stopSandbox:D.stopSandbox,removeSandbox:D.removeSandbox,inspectSandbox:D.inspectSandbox,quit:D.stop})}return await D.stopped}catch(w){return l?.(),console.error(w instanceof Error?w.message:String(w)),1}finally{if(l?.(),c!==void 0)try{NHt(c)}catch{}$()}}var $ru=N(()=>{HWi();MVu();EHi()});var yHi={};Qi(yHi,{resolveDevLinkClusterUrl:()=>AHt,populateDevLinkToxiProxy:()=>Dru,isDevLinkToxiProxyEnabled:()=>IHt,ensureDevLinkToxiProxy:()=>KHt,buildDevLinkToxiProxyConfig:()=>vru,DEV_LINK_TOXIPROXY_SERVICE_NAME:()=>dru,DEV_LINK_TOXIPROXY_PROXY_NAME:()=>_ru});function IHt(i=process.env){return i.DECO_DEV_LINK_TOXIPROXY==="1"}function NHi(i,u){if(!Number.isInteger(i)||i<1||i>65535)throw Error(`${u} must be an integer port in 1..65535`);return i}function vru(i){let u=new URL(i.serverUrl);if(u.protocol!=="http:")throw Error("DECO_DEV_LINK_TOXIPROXY only supports http local Studio URLs");let t=NHi(i.apiPort,"apiPort"),f=NHi(i.listenPort,"listenPort");if(u.port.length===0)throw Error("serverUrl must include an explicit valid port");let l=NHi(Number.parseInt(u.port,10),"upstreamPort"),c=`http://127.0.0.1:${l}`,E=`http://127.0.0.1:${f}`;return{serviceName:dru,proxyName:_ru,apiUrl:`http://127.0.0.1:${t}`,listen:`0.0.0.0:${f}`,upstream:`host.docker.internal:${l}`,publicTargetUrl:c,clusterUrl:E,logLine:`[dev-link-toxiproxy] ready: ${E} -> ${c}`}}function AHt(i){return i.toxiproxy?.clusterUrl??i.serverUrl}async function OHi(i,u,t){if(i.ok)return;let f=await i.text();throw Error(`ToxiProxy ${u} failed for ${t}: status=${i.status} statusText=${i.statusText} body=${f}`)}function FHi(i){if(i instanceof Error)return i.name==="Error"?i.message:`${i.name}: ${i.message}`;return String(i)}function hru(i){if(!(i instanceof Error))return!1;if(i.name==="TimeoutError")return!0;return hru(i.cause)}async function ZHi(i,u,t,f){try{return await i(t,f)}catch(l){throw Error(`ToxiProxy ${u} failed for ${t}: ${FHi(l)}`,{cause:l})}}async function Dru(i,u=fetch){let t=`${i.apiUrl}/reset`,f=await ZHi(u,"reset",t,{method:"POST"});await OHi(f,"reset",t);let l=`${i.apiUrl}/populate`,c=await ZHi(u,"populate",l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([{name:i.proxyName,listen:i.listen,upstream:i.upstream,enabled:!0}])});await OHi(c,"populate",l)}async function nHt(i,u){let t=`${i.apiUrl}/version`;try{await ic(async()=>{let f=await ZHi(u,"readiness check",t,{method:"GET",signal:AbortSignal.timeout(xHt)});await OHi(f,"readiness check",t)},{maxAttempts:PHt,minTimeout:wru,maxTimeout:wru,multiplier:1,jitter:0,isRetriable:(f)=>!hru(f)})}catch(f){let l=f instanceof qc?f.cause:f;throw Error(`ToxiProxy API did not become ready at ${t}: ${FHi(l)}`,{cause:l})}}async function GHt(i){if(i===null)return"";return await new Response(i).text()}async function BHi(i,u={}){let t=["docker",...i].join(" "),f=(()=>{try{return Bun.spawn(["docker",...i],{stdout:"ignore",stderr:"pipe"})}catch($){throw Error(`Docker command failed to start (${t}): ${FHi($)}`,{cause:$})}})(),[l,c]=await Promise.all([f.exited,GHt(f.stderr)]);if(l===0||u.ignoreFailure===!0)return;let E=c.trim().length>0?`: ${c.trim()}`:"";throw Error(`Docker command failed (${t}) with exit ${l}${E}`)}async function kHt(i,u){let t=`deco-dev-link-toxiproxy-${i}`;await BHi(["rm","-f",t],{ignoreFailure:!0}),await BHi(["run","--rm","-d","--name",t,"-p",`127.0.0.1:${i}:8474`,"-p",`127.0.0.1:${u}:${u}`,"ghcr.io/shopify/toxiproxy:2.12.0","-host=0.0.0.0"])}async function jHt(i,u){let t=`deco-dev-link-toxiproxy-${i}`;await BHi(["rm","-f",t],{ignoreFailure:!0})}async function KHt(i){let u=vru(i),t=i.startDaemon??kHt,f=i.stopDaemon??(i.startDaemon===void 0?jHt:void 0);await t(i.apiPort,i.listenPort);let l=i.fetchImpl??fetch;try{await nHt(u,l),await Dru(u,l)}catch(c){if(f!==void 0)try{await f(i.apiPort,i.listenPort)}catch{}throw c}return{config:u,stop:async()=>{if(f!==void 0)await f(i.apiPort,i.listenPort)}}}var dru="ToxiProxy",_ru="dev_link_studio",PHt=20,wru=100,xHt=100;var THi=N(()=>{Wl()});var gru={};Qi(gru,{migrateBetterAuth:()=>UHi});import{getMigrations as XHt}from"better-auth/db";import{sso as JHt}from"@better-auth/sso";import{organization as SHt}from"@decocms/better-auth/plugins";import{admin as YHt,apiKey as LHt,jwt as WHt,magicLink as zHt,mcp as QHt,openAPI as HHt}from"better-auth/plugins";import{emailOTP as bHt}from"better-auth/plugins/email-otp";async function UHi(i){let t={database:xC(i||z2()),plugins:[SHt({dynamicAccessControl:{enabled:!0,enableCustomResources:!0}}),YHt(),LHt(),WHt(),HHt(),QHt({loginPage:"/login"}),JHt(),zHt({sendMagicLink:async()=>{}}),bHt({sendVerificationOTP:async()=>{}})]},{toBeAdded:f,toBeCreated:l,runMigrations:c}=await XHt(t);if(!f.length&&!l.length)return"up to date";return await c(),`${l.length+f.length} table(s) migrated`}var PHi=N(()=>{zE()});var xHi={};Qi(xHi,{up:()=>RHt,down:()=>CHt});import{sql as V5}from"kysely";async function RHt(i){await i.schema.createTable("connections").addColumn("id","text",(u)=>u.primaryKey()).addColumn("organizationId","text",(u)=>u.notNull().references("organization.id").onDelete("cascade")).addColumn("createdById","text",(u)=>u.notNull().references("user.id").onDelete("cascade")).addColumn("name","text",(u)=>u.notNull()).addColumn("description","text").addColumn("icon","text").addColumn("appName","text").addColumn("appId","text").addColumn("connectionType","text",(u)=>u.notNull()).addColumn("connectionUrl","text",(u)=>u.notNull()).addColumn("connectionToken","text").addColumn("connectionHeaders","text").addColumn("oauthConfig","text").addColumn("metadata","text").addColumn("tools","text").addColumn("bindings","text").addColumn("status","text",(u)=>u.notNull().defaultTo("active")).addColumn("createdAt","text",(u)=>u.notNull().defaultTo(V5`CURRENT_TIMESTAMP`)).addColumn("updatedAt","text",(u)=>u.notNull().defaultTo(V5`CURRENT_TIMESTAMP`)).execute(),await i.schema.createTable("api_keys").addColumn("id","text",(u)=>u.primaryKey()).addColumn("userId","text",(u)=>u.notNull().references("user.id").onDelete("cascade")).addColumn("name","text",(u)=>u.notNull()).addColumn("hashedKey","text",(u)=>u.notNull().unique()).addColumn("permissions","text",(u)=>u.notNull()).addColumn("expiresAt","text").addColumn("remaining","integer").addColumn("metadata","text").addColumn("createdAt","text",(u)=>u.notNull().defaultTo(V5`CURRENT_TIMESTAMP`)).addColumn("updatedAt","text",(u)=>u.notNull().defaultTo(V5`CURRENT_TIMESTAMP`)).execute(),await i.schema.createTable("audit_logs").addColumn("id","text",(u)=>u.primaryKey()).addColumn("organizationId","text").addColumn("userId","text",(u)=>u.references("user.id").onDelete("set null")).addColumn("connectionId","text",(u)=>u.references("connections.id").onDelete("set null")).addColumn("toolName","text",(u)=>u.notNull()).addColumn("allowed","integer",(u)=>u.notNull()).addColumn("duration","integer").addColumn("timestamp","text",(u)=>u.notNull().defaultTo(V5`CURRENT_TIMESTAMP`)).addColumn("requestMetadata","text").execute(),await i.schema.createTable("oauth_clients").addColumn("id","text",(u)=>u.primaryKey()).addColumn("clientId","text",(u)=>u.notNull().unique()).addColumn("clientSecret","text").addColumn("clientName","text",(u)=>u.notNull()).addColumn("redirectUris","text",(u)=>u.notNull()).addColumn("grantTypes","text",(u)=>u.notNull()).addColumn("scope","text").addColumn("clientUri","text").addColumn("logoUri","text").addColumn("createdAt","text",(u)=>u.notNull().defaultTo(V5`CURRENT_TIMESTAMP`)).execute(),await i.schema.createTable("oauth_authorization_codes").addColumn("code","text",(u)=>u.primaryKey()).addColumn("clientId","text",(u)=>u.notNull().references("oauth_clients.clientId").onDelete("cascade")).addColumn("userId","text",(u)=>u.notNull().references("user.id").onDelete("cascade")).addColumn("redirectUri","text",(u)=>u.notNull()).addColumn("scope","text").addColumn("codeChallenge","text").addColumn("codeChallengeMethod","text").addColumn("expiresAt","text",(u)=>u.notNull()).addColumn("createdAt","text",(u)=>u.notNull().defaultTo(V5`CURRENT_TIMESTAMP`)).execute(),await i.schema.createTable("oauth_refresh_tokens").addColumn("token","text",(u)=>u.primaryKey()).addColumn("clientId","text",(u)=>u.notNull().references("oauth_clients.clientId").onDelete("cascade")).addColumn("userId","text",(u)=>u.notNull().references("user.id").onDelete("cascade")).addColumn("scope","text").addColumn("expiresAt","text").addColumn("createdAt","text",(u)=>u.notNull().defaultTo(V5`CURRENT_TIMESTAMP`)).execute(),await i.schema.createTable("downstream_tokens").addColumn("id","text",(u)=>u.primaryKey()).addColumn("connectionId","text",(u)=>u.notNull().references("connections.id").onDelete("cascade")).addColumn("userId","text",(u)=>u.references("user.id").onDelete("cascade")).addColumn("accessToken","text",(u)=>u.notNull()).addColumn("refreshToken","text").addColumn("scope","text").addColumn("expiresAt","text").addColumn("createdAt","text",(u)=>u.notNull().defaultTo(V5`CURRENT_TIMESTAMP`)).addColumn("updatedAt","text",(u)=>u.notNull().defaultTo(V5`CURRENT_TIMESTAMP`)).execute(),await i.schema.createIndex("idx_connections_organizationId").on("connections").column("organizationId").execute(),await i.schema.createIndex("idx_audit_logs_organizationId").on("audit_logs").column("organizationId").execute(),await i.schema.createIndex("idx_audit_logs_userId").on("audit_logs").column("userId").execute(),await i.schema.createIndex("idx_audit_logs_timestamp").on("audit_logs").column("timestamp").execute()}async function CHt(i){await i.schema.dropTable("downstream_tokens").execute(),await i.schema.dropTable("oauth_refresh_tokens").execute(),await i.schema.dropTable("oauth_authorization_codes").execute(),await i.schema.dropTable("oauth_clients").execute(),await i.schema.dropTable("audit_logs").execute(),await i.schema.dropTable("api_keys").execute(),await i.schema.dropTable("connections").execute()}var Nru=()=>{};var IHi={};Qi(IHi,{up:()=>MHt,down:()=>qHt});import{sql as Oru}from"kysely";async function MHt(i){await i.schema.createTable("organization_settings").addColumn("organizationId","text",(u)=>u.primaryKey().references("organization.id").onDelete("cascade")).addColumn("modelsBindingConnectionId","text",(u)=>u.references("connections.id").onDelete("set null")).addColumn("createdAt","text",(u)=>u.notNull().defaultTo(Oru`CURRENT_TIMESTAMP`)).addColumn("updatedAt","text",(u)=>u.notNull().defaultTo(Oru`CURRENT_TIMESTAMP`)).execute()}async function qHt(i){await i.schema.dropTable("organization_settings").execute()}var Zru=()=>{};var AHi={};Qi(AHi,{up:()=>VHt,down:()=>rHt});async function VHt(i){await i.schema.alterTable("connections").renameColumn("name","title").execute(),await i.schema.alterTable("connections").renameColumn("createdById","created_by").execute(),await i.schema.alterTable("connections").renameColumn("createdAt","created_at").execute(),await i.schema.alterTable("connections").renameColumn("updatedAt","updated_at").execute(),await i.schema.alterTable("connections").renameColumn("organizationId","organization_id").execute(),await i.schema.alterTable("connections").renameColumn("connectionType","connection_type").execute(),await i.schema.alterTable("connections").renameColumn("connectionUrl","connection_url").execute(),await i.schema.alterTable("connections").renameColumn("connectionToken","connection_token").execute(),await i.schema.alterTable("connections").renameColumn("connectionHeaders","connection_headers").execute(),await i.schema.alterTable("connections").renameColumn("oauthConfig","oauth_config").execute(),await i.schema.alterTable("connections").renameColumn("appName","app_name").execute(),await i.schema.alterTable("connections").renameColumn("appId","app_id").execute()}async function rHt(i){await i.schema.alterTable("connections").renameColumn("title","name").execute(),await i.schema.alterTable("connections").renameColumn("created_by","createdById").execute(),await i.schema.alterTable("connections").renameColumn("created_at","createdAt").execute(),await i.schema.alterTable("connections").renameColumn("updated_at","updatedAt").execute(),await i.schema.alterTable("connections").renameColumn("organization_id","organizationId").execute(),await i.schema.alterTable("connections").renameColumn("connection_type","connectionType").execute(),await i.schema.alterTable("connections").renameColumn("connection_url","connectionUrl").execute(),await i.schema.alterTable("connections").renameColumn("connection_token","connectionToken").execute(),await i.schema.alterTable("connections").renameColumn("connection_headers","connectionHeaders").execute(),await i.schema.alterTable("connections").renameColumn("oauth_config","oauthConfig").execute(),await i.schema.alterTable("connections").renameColumn("app_name","appName").execute(),await i.schema.alterTable("connections").renameColumn("app_id","appId").execute()}var nHi={};Qi(nHi,{up:()=>mHt,down:()=>eHt});async function mHt(i){await i.schema.createTable("organization_settings_new").addColumn("organizationId","text",(u)=>u.primaryKey().references("organization.id").onDelete("cascade")).addColumn("createdAt","text",(u)=>u.notNull()).addColumn("updatedAt","text",(u)=>u.notNull()).execute(),await i.insertInto("organization_settings_new").columns(["organizationId","createdAt","updatedAt"]).expression((u)=>u.selectFrom("organization_settings").select(["organizationId","createdAt","updatedAt"])).execute(),await i.schema.dropTable("organization_settings").execute(),await i.schema.alterTable("organization_settings_new").renameTo("organization_settings").execute()}async function eHt(i){await i.schema.createTable("organization_settings_new").addColumn("organizationId","text",(u)=>u.primaryKey().references("organization.id").onDelete("cascade")).addColumn("modelsBindingConnectionId","text",(u)=>u.references("connections.id").onDelete("set null")).addColumn("createdAt","text",(u)=>u.notNull()).addColumn("updatedAt","text",(u)=>u.notNull()).execute(),await i.insertInto("organization_settings_new").columns(["organizationId","modelsBindingConnectionId","createdAt","updatedAt"]).expression((u)=>u.selectFrom("organization_settings").select(["organizationId",u.val(null).as("modelsBindingConnectionId"),"createdAt","updatedAt"])).execute(),await i.schema.dropTable("organization_settings").execute(),await i.schema.alterTable("organization_settings_new").renameTo("organization_settings").execute()}var GHi={};Qi(GHi,{up:()=>aHt,down:()=>oHt});async function aHt(i){await i.schema.alterTable("connections").addColumn("configuration_state","text").execute(),await i.schema.alterTable("connections").addColumn("configuration_scopes","text").execute()}async function oHt(i){await i.schema.alterTable("connections").dropColumn("configuration_state").execute(),await i.schema.alterTable("connections").dropColumn("configuration_scopes").execute()}var kHi={};Qi(kHi,{up:()=>pHt,down:()=>ibt});import{sql as sHt}from"kysely";async function pHt(i){await i.schema.alterTable("organization_settings").addColumn("sidebar_items",sHt`text`).execute()}async function ibt(i){await i.schema.alterTable("organization_settings").dropColumn("sidebar_items").execute()}var Bru=()=>{};var jHi={};Qi(jHi,{up:()=>ubt,down:()=>tbt});async function ubt(i){await i.schema.createTable("monitoring_logs").addColumn("id","text",(u)=>u.primaryKey()).addColumn("organization_id","text",(u)=>u.notNull().references("organization.id").onDelete("cascade")).addColumn("connection_id","text",(u)=>u.notNull().references("connections.id").onDelete("cascade")).addColumn("connection_title","text",(u)=>u.notNull()).addColumn("tool_name","text",(u)=>u.notNull()).addColumn("input","text",(u)=>u.notNull()).addColumn("output","text",(u)=>u.notNull()).addColumn("is_error","integer",(u)=>u.notNull()).addColumn("error_message","text").addColumn("duration_ms","integer",(u)=>u.notNull()).addColumn("timestamp","text",(u)=>u.notNull()).addColumn("user_id","text").addColumn("request_id","text",(u)=>u.notNull()).execute(),await i.schema.createIndex("monitoring_logs_org_timestamp").on("monitoring_logs").columns(["organization_id","timestamp"]).execute(),await i.schema.createIndex("monitoring_logs_connection_timestamp").on("monitoring_logs").columns(["connection_id","timestamp"]).execute(),await i.schema.createIndex("monitoring_logs_is_error").on("monitoring_logs").columns(["organization_id","is_error","timestamp"]).execute()}async function tbt(i){await i.schema.dropIndex("monitoring_logs_is_error").execute(),await i.schema.dropIndex("monitoring_logs_connection_timestamp").execute(),await i.schema.dropIndex("monitoring_logs_org_timestamp").execute(),await i.schema.dropTable("monitoring_logs").execute()}var KHi={};Qi(KHi,{up:()=>fbt,down:()=>lbt});import{sql as hM}from"kysely";async function fbt(i){await i.schema.createTable("events").addColumn("id","text",(u)=>u.primaryKey()).addColumn("organization_id","text",(u)=>u.notNull().references("organization.id").onDelete("cascade")).addColumn("type","text",(u)=>u.notNull()).addColumn("source","text",(u)=>u.notNull()).addColumn("specversion","text",(u)=>u.notNull().defaultTo("1.0")).addColumn("subject","text").addColumn("time","text",(u)=>u.notNull()).addColumn("datacontenttype","text",(u)=>u.notNull().defaultTo("application/json")).addColumn("dataschema","text").addColumn("data","text").addColumn("cron","varchar(255)").addColumn("status","text",(u)=>u.notNull().defaultTo("pending")).addColumn("attempts","integer",(u)=>u.notNull().defaultTo(0)).addColumn("last_error","text").addColumn("next_retry_at","text").addColumn("created_at","text",(u)=>u.notNull().defaultTo(hM`CURRENT_TIMESTAMP`)).addColumn("updated_at","text",(u)=>u.notNull().defaultTo(hM`CURRENT_TIMESTAMP`)).execute(),await i.schema.createTable("event_subscriptions").addColumn("id","text",(u)=>u.primaryKey()).addColumn("organization_id","text",(u)=>u.notNull().references("organization.id").onDelete("cascade")).addColumn("connection_id","text",(u)=>u.notNull().references("connections.id").onDelete("cascade")).addColumn("publisher","text").addColumn("event_type","text",(u)=>u.notNull()).addColumn("filter","text").addColumn("enabled","integer",(u)=>u.notNull().defaultTo(1)).addColumn("created_at","text",(u)=>u.notNull().defaultTo(hM`CURRENT_TIMESTAMP`)).addColumn("updated_at","text",(u)=>u.notNull().defaultTo(hM`CURRENT_TIMESTAMP`)).execute(),await i.schema.createTable("event_deliveries").addColumn("id","text",(u)=>u.primaryKey()).addColumn("event_id","text",(u)=>u.notNull()).addColumn("subscription_id","text",(u)=>u.notNull().references("event_subscriptions.id").onDelete("cascade")).addColumn("status","text",(u)=>u.notNull().defaultTo("pending")).addColumn("attempts","integer",(u)=>u.notNull().defaultTo(0)).addColumn("last_error","text").addColumn("delivered_at","text").addColumn("next_retry_at","text").addColumn("created_at","text",(u)=>u.notNull().defaultTo(hM`CURRENT_TIMESTAMP`)).execute(),await i.schema.createIndex("idx_events_org_status").on("events").columns(["organization_id","status"]).execute(),await i.schema.createIndex("idx_events_source").on("events").columns(["source"]).execute(),await i.schema.createIndex("idx_events_type").on("events").columns(["type"]).execute(),await i.schema.createIndex("idx_events_retry").on("events").columns(["status","next_retry_at"]).execute(),await i.schema.createIndex("idx_subscriptions_connection").on("event_subscriptions").columns(["connection_id"]).execute(),await i.schema.createIndex("idx_subscriptions_type").on("event_subscriptions").columns(["event_type"]).execute(),await i.schema.createIndex("idx_subscriptions_org_enabled").on("event_subscriptions").columns(["organization_id","enabled"]).execute(),await i.schema.createIndex("idx_subscriptions_unique").on("event_subscriptions").columns(["connection_id","event_type","publisher","filter"]).unique().execute(),await i.schema.createIndex("idx_deliveries_event").on("event_deliveries").columns(["event_id"]).execute(),await i.schema.createIndex("idx_deliveries_subscription_status").on("event_deliveries").columns(["subscription_id","status"]).execute(),await i.schema.createIndex("idx_deliveries_retry").on("event_deliveries").columns(["status","next_retry_at"]).execute()}async function lbt(i){await i.schema.dropIndex("idx_deliveries_retry").execute(),await i.schema.dropIndex("idx_deliveries_subscription_status").execute(),await i.schema.dropIndex("idx_deliveries_event").execute(),await i.schema.dropIndex("idx_subscriptions_unique").execute(),await i.schema.dropIndex("idx_subscriptions_org_enabled").execute(),await i.schema.dropIndex("idx_subscriptions_type").execute(),await i.schema.dropIndex("idx_subscriptions_connection").execute(),await i.schema.dropIndex("idx_events_retry").execute(),await i.schema.dropIndex("idx_events_type").execute(),await i.schema.dropIndex("idx_events_source").execute(),await i.schema.dropIndex("idx_events_org_status").execute(),await i.schema.dropTable("event_deliveries").execute(),await i.schema.dropTable("event_subscriptions").execute(),await i.schema.dropTable("events").execute()}var Fru=()=>{};var XHi={};Qi(XHi,{up:()=>Ebt,down:()=>$bt});import{sql as cbt}from"kysely";async function Ebt(i){await i.schema.dropTable("audit_logs").ifExists().execute()}async function $bt(i){await i.schema.createTable("audit_logs").ifNotExists().addColumn("id","text",(u)=>u.primaryKey()).addColumn("organizationId","text").addColumn("userId","text",(u)=>u.references("user.id").onDelete("set null")).addColumn("connectionId","text",(u)=>u.references("connections.id").onDelete("set null")).addColumn("toolName","text",(u)=>u.notNull()).addColumn("allowed","integer",(u)=>u.notNull()).addColumn("duration","integer").addColumn("timestamp","text",(u)=>u.notNull().defaultTo(cbt`CURRENT_TIMESTAMP`)).addColumn("requestMetadata","text").execute(),await i.schema.createIndex("idx_audit_logs_organizationId").on("audit_logs").column("organizationId").execute(),await i.schema.createIndex("idx_audit_logs_userId").on("audit_logs").column("userId").execute(),await i.schema.createIndex("idx_audit_logs_timestamp").on("audit_logs").column("timestamp").execute()}var yru=()=>{};var JHi={};Qi(JHi,{up:()=>wbt,down:()=>dbt});import{sql as z1i}from"kysely";async function wbt(i){await i.schema.createTable("gateways").addColumn("id","text",(u)=>u.primaryKey()).addColumn("organization_id","text",(u)=>u.notNull().references("organization.id").onDelete("cascade")).addColumn("title","text",(u)=>u.notNull()).addColumn("description","text").addColumn("tool_selection_strategy","text").addColumn("status","text",(u)=>u.notNull().defaultTo("active")).addColumn("is_default","integer",(u)=>u.notNull().defaultTo(0)).addColumn("created_at","text",(u)=>u.notNull().defaultTo(z1i`CURRENT_TIMESTAMP`)).addColumn("updated_at","text",(u)=>u.notNull().defaultTo(z1i`CURRENT_TIMESTAMP`)).addColumn("created_by","text",(u)=>u.notNull().references("user.id").onDelete("cascade")).addColumn("updated_by","text").execute(),await i.schema.createTable("gateway_connections").addColumn("id","text",(u)=>u.primaryKey()).addColumn("gateway_id","text",(u)=>u.notNull().references("gateways.id").onDelete("cascade")).addColumn("connection_id","text",(u)=>u.notNull().references("connections.id").onDelete("cascade")).addColumn("selected_tools","text").addColumn("created_at","text",(u)=>u.notNull().defaultTo(z1i`CURRENT_TIMESTAMP`)).execute(),await i.schema.createIndex("idx_gateways_org").on("gateways").columns(["organization_id"]).execute(),await i.schema.createIndex("idx_gateways_org_status").on("gateways").columns(["organization_id","status"]).execute(),await z1i`CREATE UNIQUE INDEX idx_gateways_default_per_org ON gateways (organization_id) WHERE is_default = 1`.execute(i),await i.schema.createIndex("idx_gateway_connections_gateway").on("gateway_connections").columns(["gateway_id"]).execute(),await i.schema.createIndex("idx_gateway_connections_connection").on("gateway_connections").columns(["connection_id"]).execute(),await i.schema.createIndex("idx_gateway_connections_unique").on("gateway_connections").columns(["gateway_id","connection_id"]).unique().execute()}async function dbt(i){await i.schema.dropIndex("idx_gateway_connections_unique").execute(),await i.schema.dropIndex("idx_gateway_connections_connection").execute(),await i.schema.dropIndex("idx_gateway_connections_gateway").execute(),await i.schema.dropIndex("idx_gateways_default_per_org").execute(),await i.schema.dropIndex("idx_gateways_org_status").execute(),await i.schema.dropIndex("idx_gateways_org").execute(),await i.schema.dropTable("gateway_connections").execute(),await i.schema.dropTable("gateways").execute()}var Tru=()=>{};var SHi={};Qi(SHi,{up:()=>_bt,down:()=>vbt});async function _bt(i){await i.schema.alterTable("gateways").addColumn("icon","text").execute()}async function vbt(i){await i.schema.alterTable("gateways").dropColumn("icon").execute()}var YHi={};Qi(YHi,{up:()=>hbt,down:()=>Dbt});import{sql as Q1i}from"kysely";async function hbt(i){await i.schema.alterTable("gateways").addColumn("tool_selection_mode","text",(u)=>u.notNull().defaultTo("inclusion")).execute(),await Q1i`
|
|
80755
80755
|
UPDATE gateways
|
|
80756
80756
|
SET tool_selection_mode = CASE
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as se,j as s,B as Z,w as me,r as Y,s as v,t as de}from"./index-CurNB2HG.js";import{c as w,b as ne,a as ee,D as te}from"./dropdown-menu-B1DaP6vk.js";import{s as pe}from"./Star01-BoZIiKCL.js";import{a as fe}from"./Users03-CJuVy8Iz.js";import{a as ge,G as ue}from"./github-repo-picker-CThHTj5h.js";import{S as he,u as xe,H as ie,W as oe,I as je}from"./import-from-deco-dialog-DnC_H8Us.js";import{u as _e,b as Ce,c as be}from"./use-virtual-mcp-CLJ6qnG1.js";import{P as K}from"./index-qZ5-LmpP.js";import{a as ye}from"./DotsVertical-Z_h1bSB3.js";import{a as Ne}from"./Settings02-ozrzAwut.js";import{s as Se}from"./Trash01-z6De146C.js";import{A as De,at as ve}from"./agent-icon-pz8iT5cD.js";import{m as Ae}from"./use-navigate-to-agent-CidcWwFC.js";import{C as we}from"./card-D_tApM0k.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as ke}from"./use-capability-DfdnXTfH.js";import{E as Te}from"./empty-state-Lmcbk0Zv.js";import{u as ze}from"./use-create-virtual-mcp-CGofqNOQ.js";import{c as Ie,b as Pe,d as He,A as Ee,e as Me,g as Oe,a as Be,f as Ge}from"./alert-dialog-CkCCiKt9.js";import{S as $e}from"./search-input-CeqwXCv0.js";import{s as le}from"./Plus-CQOl41pg.js";import"./ChevronUp-CiXD4kQk.js";import"./ChevronRight-DYe9AFXl.js";import"./dialog-BFjL_my-.js";import"./X-DgKWdqZ1.js";import"./checkbox-OtNKSART.js";import"./collection-search-JfLpXbmD.js";import"./SearchMd-Da504yGV.js";import"./use-connection-Cvfufzsw.js";import"./use-collections-w44ZyJ1t.js";import"./use-mcp-client-BbOUwA1H.js";import"./auth-xlfJjVrK.js";import"./authenticate-and-persist-oauth-DPn6Vk96.js";import"./mcp-oauth-B5dnAc7V.js";import"./use-mcp-tools-xGr1pN0n.js";import"./extract-connection-data-Bau_aQvM.js";import"./sidebar-DLCPSSnc.js";import"./LayoutLeft-CuTI_WR9.js";import"./tooltip-CUlMaf5E.js";import"./sheet-Djk8ol5s.js";import"./AlertCircle-BMCh3ayd.js";import"./Tool01-WsqNh4er.js";import"./SwitchHorizontal01-DXdcIz27.js";import"./XCircle-DFBcUexW.js";import"./ArrowUpRight-CwVMUp5O.js";import"./ZapSquare-DOK7F1oe.js";import"./CheckCircle-BP2lb3AX.js";import"./ChevronDown-CkcGr2qp.js";import"./ChevronLeft-Cgw9JZYG.js";import"./Stars02-C4CXFnp9.js";import"./Eye-B92Ff4dY.js";import"./ZoomOut-ryBmf3S4.js";import"./Globe01-MZlo2_34.js";import"./FilterLines-CMHeCbJ1.js";import"./Globe04-BPWbnzx0.js";import"./HardDrive-D8FSpDtM.js";import"./Key01-CZVV-ceU.js";import"./LinkExternal01-DekFjc9P.js";import"./Monitor01-BxGhRsUq.js";import"./Sun-2eUdoD8j.js";import"./Palette-BDlA8RUr.js";import"./Play-BGGUeSDd.js";import"./Shield01-CYPtC_lA.js";import"./Stars01-BJuGXG_N.js";import"./Upload01-C4sYhZ0M.js";import"./User01-Cvp121NC.js";import"./Users01-DcrlsWI1.js";import"./XClose-BKWXOZkj.js";import"./Zap-Cxu6aoRs.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(w,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(w,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:he,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(w,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ge,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(w,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(w,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(w,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(w,{variant:"destructive",onClick:k=>{k.stopPropagation(),l(k)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(we,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function rs(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=xe(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=ke("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=K,A=K,k=K;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(K.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const q=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==k.Body||t[19]!==I||t[20]!==q?(P=s.jsxs(k.Body,{children:[I,q,J]}),t[17]=J,t[18]=k.Body,t[19]=I,t[20]=q,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(ue,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{rs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as B,C as N,aC as ae,aE as le,aF as he,aD as xe,b6 as me,c as U,F as ge,G as be,r as O,j as s,ae as Ee,t as Q,ad as ye,w as re,m as oe,d as J,K as G,k as ve,l as ue,B as V,s as je,E as Fe}from"./index-CurNB2HG.js";import{i as $e}from"./AlertCircle-BMCh3ayd.js";import{P as te}from"./index-qZ5-LmpP.js";import{S as ne}from"./skeleton-DrM35KBr.js";import{b as _e,a as ce,S as de,c as Re}from"./settings-section-ELYurXQx.js";import{u as X,b as se,c as Se}from"./use-ai-providers-D-XhQ6_q.js";import{i as Oe}from"./CheckCircle-BP2lb3AX.js";import{i as Me,j as Te,p as Ue,S as ze}from"./chat-context-Dz9rhizY.js";import{d as qe,e as Le}from"./use-organization-settings-B5L78CqV.js";import{M as Ve}from"./select-model-CgXZFBIr.js";import{u as Be}from"./use-debounced-autosave-CaTQp8tz.js";import{I as ie}from"./input-RRjvrcUF.js";import{a as fe,T as Ge}from"./toggle-group-CSO_yZKm.js";import{b as ke,c as Ie,d as Ce,A as Ne,a as Pe,e as we,g as De,f as Ae}from"./alert-dialog-CkCCiKt9.js";import{u as H}from"./studio-tools-BvQ8Bli1.js";import{s as Qe}from"./Plus-CQOl41pg.js";import{b as Ye}from"./Tool01-WsqNh4er.js";import{s as We}from"./Trash01-z6De146C.js";import{A as He}from"./avatar-Bh53txVX.js";import{O as Ke,P as Je,C as pe}from"./decopilot-CiHv6XGE.js";import{b as Xe}from"./Settings02-ozrzAwut.js";import{s as Ze}from"./Eye-B92Ff4dY.js";import{e as et,D as tt,a as st,c as it,d as rt}from"./dialog-BFjL_my-.js";import{f as ot}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as lt}from"./require-capability-CBJ6cwe3.js";import"./sidebar-DLCPSSnc.js";import"./LayoutLeft-CuTI_WR9.js";import"./tooltip-CUlMaf5E.js";import"./sheet-Djk8ol5s.js";import"./X-DgKWdqZ1.js";import"./card-D_tApM0k.js";import"./ArrowUpRight-CwVMUp5O.js";import"./hooks-CFfc1t5D.js";import"./use-mcp-client-BbOUwA1H.js";import"./auth-xlfJjVrK.js";import"./decopilot-sse-pool-DXv2T192.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CLJ6qnG1.js";import"./use-collections-w44ZyJ1t.js";import"./tab-id-BptcWVWa.js";import"./drawer-DZMXZPMN.js";import"./connect-desktop-dialog-BxJ3X8re.js";import"./ChevronUp-CiXD4kQk.js";import"./User01-Cvp121NC.js";import"./checkbox-OtNKSART.js";import"./select-BePf1IJF.js";import"./index-BdQq_4o_.js";import"./ChevronDown-CkcGr2qp.js";import"./Key01-CZVV-ceU.js";import"./SearchMd-Da504yGV.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-BxGhRsUq.js";import"./ChevronRight-DYe9AFXl.js";import"./Stars01-BJuGXG_N.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-DfdnXTfH.js";import"./access-gate-DvuwS2Bs.js";import"./capability-load-error-DgQyDsKl.js";B({title:N(),url:N(),icon:N()});B({registries:le(N(),B({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ae(N()).describe("List of MCP app_name or app_id values to hide from the store.")});const W=B({keyId:N(),modelId:N(),title:N().optional()}).nullable();xe(["fast","smart","thinking","image","web_search","deep_research"]);xe(["fast","smart","thinking"]);const at=B({tiers:B({fast:W,smart:W,thinking:W,image:W,web_search:W,deep_research:W})});B({ids:ae(N()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:N().describe("Brand context ID"),name:N().describe("Company name"),domain:N().describe("Company domain (e.g. example.com)"),overview:N().describe("Company overview / description"),logo:N().nullable().optional().describe("Logo URL"),favicon:N().nullable().optional().describe("Favicon URL"),ogImage:N().nullable().optional().describe("OG image URL"),fonts:B({heading:N().optional().describe("Font family for headings"),body:N().optional().describe("Font family for body text"),code:N().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:N().optional().describe("Primary brand color (hex)"),secondary:N().optional().describe("Secondary brand color (hex)"),accent:N().optional().describe("Accent / highlight color (hex)"),background:N().optional().describe("Background color (hex)"),foreground:N().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ae(le(N(),me())).nullable().optional().describe("Brand images"),metadata:le(N(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:N().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const nt=e=>e.capabilities?.includes("image")===!0,ct=e=>Me(e),dt=e=>Te(e),mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:nt},{key:"web_search",label:"Web search",description:"Quick, up-to-date answers from the web",filter:ct},{key:"deep_research",label:"Deep research",description:"In-depth, multi-source research reports",filter:dt}];function ut(e){const t=U.c(20),{slot:i,onSlotChange:a,filterModels:r,defaultKeyId:l}=e,o=X(),[x,S]=O.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&S(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let n;t[2]!==d?(n=[d],t[2]=d,t[3]=n):n=t[3],O.useEffect(b,n);const m=x??l;let c;t[4]!==m||t[5]!==o?(c=m?o.find(y=>y.id===m):null,t[4]=m,t[5]=o,t[6]=c):c=t[6];const u=c,{models:g,isLoading:j}=se(r?m??void 0:void 0),_=r?j||g.some(r):!0;let f;t[7]!==i||t[8]!==u?.providerId?(f=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=f):f=t[9];const k=f;if(r&&!_){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>S(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==a?(h=y=>{const $=y.keyId??m??"";S($),a({keyId:$,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=a,t[14]=h):h=t[14];let p;return t[15]!==m||t[16]!==r||t[17]!==k||t[18]!==h?(p=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:r,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=r,t[17]=k,t[18]=h,t[19]=p):p=t[19],p}function ft(e){const t=U.c(2),{isPending:i,showSaved:a}=e;if(i){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=r):r=t[0],r}if(a){let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Oe,{size:12}),"Saved"]}),t[1]=r):r=t[1],r}return null}function pt(){const e=U.c(42),t=X(),i=qe(),a=t.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ge(at),e[0]=r):r=e[0];let l;e[1]!==i?(l={resolver:r,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const o=be(l),{mutate:x,isPending:S,isSuccess:b}=Le(),d=o.formState.isDirty;let n;e[3]!==o||e[4]!==i||e[5]!==x?(n={delayMs:250,save:async()=>{const v=o.getValues();x(v,{onSuccess:()=>o.reset(v,{keepValues:!0}),onError:w=>{o.reset(i),Q.error(`Failed to save: ${w.message}`)}})}},e[3]=o,e[4]=i,e[5]=x,e[6]=n):n=e[6];const{schedule:m}=Be(n),c=t[0],u=t[1],g=t[2],{models:j}=se(c?.id),{models:_}=se(u?.id),{models:f}=se(g?.id);let k,I;e[7]!==o||e[8]!==a?(k=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},I=[a,o],e[7]=o,e[8]=a,e[9]=k,e[10]=I):(k=e[9],I=e[10]),O.useEffect(k,I);let h;e[11]!==t||e[12]!==o||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==j||e[17]!==_||e[18]!==f?(h=()=>{const v=o.getValues(),w=new Set(t.map(ht)),F={};c?.id&&(F[c.id]=j),u?.id&&(F[u.id]=_),g?.id&&(F[g.id]=f);const P=Y=>Y!=null&&!w.has(Y.keyId),C={fast:P(v.tiers.fast)?null:v.tiers.fast,smart:P(v.tiers.smart)?null:v.tiers.smart,thinking:P(v.tiers.thinking)?null:v.tiers.thinking,image:P(v.tiers.image)?null:v.tiers.image,web_search:P(v.tiers.web_search)?null:v.tiers.web_search,deep_research:P(v.tiers.deep_research)?null:v.tiers.deep_research},q=!C.fast||!C.smart||!C.thinking||!C.image||!C.web_search||!C.deep_research,z=C.fast===v.tiers.fast&&C.smart===v.tiers.smart&&C.thinking===v.tiers.thinking&&C.image===v.tiers.image&&C.web_search===v.tiers.web_search&&C.deep_research===v.tiers.deep_research;if(!q&&z)return;const L=Ue(t,F);o.reset({tiers:{fast:C.fast??L.chat.fast,smart:C.smart??L.chat.smart,thinking:C.thinking??L.chat.thinking,image:C.image??L.image,web_search:C.web_search??L.webSearch,deep_research:C.deep_research??L.deepResearch}},{keepDirty:!0})},e[11]=t,e[12]=o,e[13]=c,e[14]=u,e[15]=g,e[16]=j,e[17]=_,e[18]=f,e[19]=h):h=e[19];const p=c?.id,y=u?.id,$=g?.id;let M;e[20]!==t||e[21]!==o||e[22]!==j||e[23]!==_||e[24]!==f||e[25]!==p||e[26]!==y||e[27]!==$?(M=[o,t,j,_,f,p,y,$],e[20]=t,e[21]=o,e[22]=j,e[23]=_,e[24]=f,e[25]=p,e[26]=y,e[27]=$,e[28]=M):M=e[28],O.useEffect(h,M);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const R=b&&!d;let D;e[30]!==S||e[31]!==R?(D=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(ft,{isPending:S,showSaved:R})]}),e[30]=S,e[31]=R,e[32]=D):D=e[32];let A;e[33]!==t[0]?.id||e[34]!==o.control||e[35]!==m?(A=mt.map(v=>s.jsx(Ee,{control:o.control,name:`tiers.${v.key}`,render:w=>{const{field:F}=w;return s.jsx(_e,{title:v.label,description:v.description,action:s.jsx(ut,{slot:F.value,defaultKeyId:t[0]?.id??null,filterModels:v.filter,onSlotChange:P=>{F.onChange(P),m()}})})}},v.key)),e[33]=t[0]?.id,e[34]=o.control,e[35]=m,e[36]=A):A=e[36];let K;e[37]!==A?(K=s.jsx(ce,{children:A}),e[37]=A,e[38]=K):K=e[38];let E;return e[39]!==D||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[D,K]}),e[39]=D,e[40]=K,e[41]=E):E=e[41],E}function ht(e){return e.id}const xt={usd:[10,20,100],brl:[50,100,500]};function gt(){const e=U.c(26),t=H(),[i,a]=O.useState(!1),{mutate:r,isPending:l}=J({mutationFn:async h=>{const{url:p}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return p},onSuccess:yt,onError:bt}),[o,x]=O.useState(""),[S,b]=O.useState("usd"),d=S,n=parseFloat(o),m=!isNaN(n)&&n>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,j;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),j=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=j):(g=e[2],j=e[3]);let _;e[4]!==d||e[5]!==u?(_=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,j]}),e[4]=d,e[5]=u,e[6]=_):_=e[6];let f;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==r?(f=!i&&s.jsxs(s.Fragment,{children:[xt[d].map(h=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(h*100),children:[c,h]},h)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=r,e[12]=f):f=e[12];let k;e[13]!==c||e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==r?(k=i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:o,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!m||l,onClick:()=>r(Math.round(n*100)),children:l?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=o,e[15]=n,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=r,e[21]=k):k=e[21];let I;return e[22]!==_||e[23]!==f||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_,f,k]})}),e[22]=_,e[23]=f,e[24]=k,e[25]=I):I=e[25],I}function bt(e){Q.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function jt(){const e=U.c(58),{org:t}=re(),i=H(),a=oe(),r=X();let l;e[0]!==r?(l=r.find(St),e[0]=r,e[1]=l):l=e[1];const o=l,[x,S]=O.useState(!1);let b;e[2]!==o||e[3]!==i?(b=async()=>{o&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==a?(d=()=>{a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),S(!1)},e[5]=t.id,e[6]=a,e[7]=d):d=e[7];let n;e[8]!==b||e[9]!==d?(n={mutationFn:b,onSuccess:d,onError:_t},e[8]=b,e[9]=d,e[10]=n):n=e[10];const{mutate:m,isPending:c}=J(n);let u;e[11]!==t.id?(u=G.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!o;let j;e[13]!==i?(j=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=j):j=e[14];let _;e[15]!==u||e[16]!==g||e[17]!==j?(_={queryKey:u,enabled:g,staleTime:6e4,queryFn:j},e[15]=u,e[16]=g,e[17]=j,e[18]=_):_=e[18];const{data:f,isLoading:k,refetch:I,isFetching:h}=ve(_);if(!o)return null;const p=f?.balanceCents!=null?f.balanceCents/100:null;let y;e[19]!==p?(y=p!=null?`$${p.toFixed(2)}`:"—",e[19]=p,e[20]=y):y=e[20];const $=y;let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=M):M=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>S(!0),e[22]=T):T=e[22];let R;e[23]!==c?(R=s.jsxs("div",{className:"flex items-center justify-between",children:[M,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=R):R=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(ke,{children:[s.jsx(Ie,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ce,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=D):D=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{children:"Cancel"}),e[26]=A):A=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[D,s.jsxs(we,{children:[A,s.jsx(De,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(Ae,{open:x,onOpenChange:S,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let v;e[32]!==p||e[33]!==$||e[34]!==h||e[35]!==k?(v=k||h?s.jsx(ne,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",p!=null&&vt(p)),children:$}),e[32]=p,e[33]=$,e[34]=h,e[35]=k,e[36]=v):v=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const F=h&&"animate-spin";let P;e[39]!==F?(P=ue(F),e[39]=F,e[40]=P):P=e[40];let C;e[41]!==P?(C=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=C):C=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==C?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:C}),e[43]=h,e[44]=w,e[45]=C,e[46]=q):q=e[46];let z;e[47]!==v||e[48]!==q?(z=s.jsxs("div",{className:"flex items-baseline gap-2",children:[v,q]}),e[47]=v,e[48]=q,e[49]=z):z=e[49];let L;e[50]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=L):L=e[50];let Y;e[51]!==z?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[z,L]}),e[51]=z,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(gt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==R||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[R,E,Y,Z]})})}),e[54]=R,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function _t(e){Q.error(`Failed to disconnect: ${e.message}`)}function St(e){return e.providerId==="deco"}function kt(){const e=U.c(8),{org:t}=re(),i=H(),a=oe();let r;e[0]!==i?(r=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=r):r=e[1];let l;e[2]!==t||e[3]!==a?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=a,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o={mutationFn:r,onSuccess:l,onError:It},e[5]=r,e[6]=l,e[7]=o):o=e[7],J(o)}function It(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=U.c(10),{mutate:t,isPending:i}=kt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=o):o=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const S=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==S?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[r,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,o,s.jsx(V,{variant:"outline",disabled:i,onClick:x,children:S})]})]}),e[6]=i,e[7]=x,e[8]=S,e[9]=b):b=e[9],b}const Nt=B({label:N().min(1,"Label is required").max(100),apiKey:N().optional(),baseUrl:N().optional()});function Pt({providerKey:e,provider:t,preset:i,maskedKey:a,currentLabel:r,currentBaseUrl:l,onCancel:o,onSuccess:x}){const{org:S}=re(),b=H(),d=oe(),[n,m]=O.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:j,watch:_,formState:{errors:f}}=be({resolver:ge(Nt),defaultValues:{label:r,apiKey:"",baseUrl:l??""}}),k=_("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async p=>{let y;p.apiKey?c?y=JSON.stringify({baseUrl:p.baseUrl||l||"",apiKey:p.apiKey}):y=p.apiKey:c&&p.baseUrl&&p.baseUrl!==l&&(y=JSON.stringify({baseUrl:p.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:p.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:G.aiProviderKeys(S.id)}),d.invalidateQueries({queryKey:G.aiProviders(S.id)}),Q.success("Provider updated"),x()},onError:p=>Q.error(`Failed to update: ${p.message}`)});return s.jsxs("form",{onSubmit:j(p=>I(p)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),f.label&&s.jsx("p",{className:"text-xs text-destructive",children:f.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:n&&k?"text":"password",placeholder:a,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!n),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:n?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:o,disabled:h,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function wt(e){const t=U.c(28),{providerKey:i,provider:a,open:r,onOpenChange:l}=e,o=H();let x;t[0]!==a.id||t[1]!==i.presetId?(x=a.id==="openai-compatible"&&i.presetId?Ke.find(k=>k.id===i.presetId):void 0,t[0]=a.id,t[1]=i.presetId,t[2]=x):x=t[2];const S=x,b=S?.name??a.name;let d;t[3]!==i.id?(d=G.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let n;t[5]!==i.id||t[6]!==o?(n=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=o,t[7]=n):n=t[7];let m;t[8]!==r||t[9]!==d||t[10]!==n?(m={queryKey:d,queryFn:n,enabled:r,staleTime:0},t[8]=r,t[9]=d,t[10]=n,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let j;t[14]!==u||t[15]!==l||t[16]!==S||t[17]!==c||t[18]!==a||t[19]!==i?(j=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ze,{})}):s.jsx(Pt,{providerKey:i,provider:a,preset:S,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=S,t[17]=c,t[18]=a,t[19]=i,t[20]=j):j=t[20];let _;t[21]!==g||t[22]!==j?(_=s.jsxs(it,{className:"sm:max-w-md",children:[g,j]}),t[21]=g,t[22]=j,t[23]=_):_=t[23];let f;return t[24]!==l||t[25]!==r||t[26]!==_?(f=s.jsx(rt,{open:r,onOpenChange:l,children:_}),t[24]=l,t[25]=r,t[26]=_,t[27]=f):f=t[27],f}function Dt(e){const t=U.c(48),{providerKey:i,provider:a}=e,{org:r}=re(),l=H(),o=oe(),[x,S]=O.useState(!1),[b,d]=O.useState(!1),n=a.id==="openai-compatible";let m;t[0]!==n||t[1]!==i.presetId?(m=n&&i.presetId?Ke.find(q=>q.id===i.presetId):void 0,t[0]=n,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:n?"Custom OpenAI-compatible":a.name,g=c?.logo??a.logo;let j;e:{if(n){j=i.label;break e}const q=i.label;let z;t[3]!==i.createdAt?(z=ot(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=z):z=t[4],j=`${q} · added ${z} ago`}const _=j;let f;t[5]!==i.id||t[6]!==l?(f=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=f):f=t[7];let k;t[8]!==r||t[9]!==i.id||t[10]!==o?(k=()=>{o.invalidateQueries({queryKey:G.aiProviderKeys(r.id)}),o.invalidateQueries({queryKey:G.aiProviders(r.id)}),o.invalidateQueries({queryKey:G.aiProviderModels(r.id,i.id)}),Q.success("Key deleted"),S(!1)},t[8]=r,t[9]=i.id,t[10]=o,t[11]=k):k=t[11];let I;t[12]!==f||t[13]!==k?(I={mutationFn:f,onSuccess:k,onError:At},t[12]=f,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:p}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(He,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let $;t[18]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(Ye,{size:14})}),t[18]=$):$=t[18];let M,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>S(!0),T=s.jsx(We,{size:14}),t[19]=M,t[20]=T):(M=t[19],T=t[20]);let R;t[21]!==p?(R=s.jsxs("div",{className:"flex items-center gap-0.5",children:[$,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:p,onClick:M,children:T})]}),t[21]=p,t[22]=R):R=t[22];let D;t[23]!==_||t[24]!==u||t[25]!==R||t[26]!==y?(D=s.jsx(_e,{icon:y,title:u,description:_,action:R}),t[23]=_,t[24]=u,t[25]=R,t[26]=y,t[27]=D):D=t[27];let A;t[28]!==b||t[29]!==a||t[30]!==i?(A=s.jsx(wt,{providerKey:i,provider:a,open:b,onOpenChange:d}),t[28]=b,t[29]=a,t[30]=i,t[31]=A):A=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(ke,{children:[K,s.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let v;t[35]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ne,{children:"Cancel"}),t[35]=v):v=t[35];let w;t[36]!==h?(w=s.jsxs(we,{children:[v,s.jsx(De,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let F;t[38]!==E||t[39]!==w?(F=s.jsxs(Pe,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=F):F=t[40];let P;t[41]!==x||t[42]!==F?(P=s.jsx(Ae,{open:x,onOpenChange:S,children:F}),t[41]=x,t[42]=F,t[43]=P):P=t[43];let C;return t[44]!==D||t[45]!==A||t[46]!==P?(C=s.jsxs(s.Fragment,{children:[D,A,P]}),t[44]=D,t[45]=A,t[46]=P,t[47]=C):C=t[47],C}function At(e){return Q.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=U.c(11),{onConnectClick:i}=e,a=X(),r=Se();let l;t[0]!==r?.providers?(l=r?.providers??[],t[0]=r?.providers,t[1]=l):l=t[1];const o=l;let x;if(t[2]!==a||t[3]!==i||t[4]!==o){let S;t[6]!==o?(S=m=>({key:m,provider:o.find(c=>c.id===m.providerId)}),t[6]=o,t[7]=S):S=t[7];const b=a.filter($t).map(S).filter(Ft);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Qe,{size:14}),t[8]=d):d=t[8];let n;t[9]!==i?(n=s.jsxs(V,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=n):n=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:n,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(Et)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=x}else x=t[5];return x}function Et(e){const{key:t,provider:i}=e;return s.jsx(Dt,{providerKey:t,provider:i},t.id)}function Ft(e){return e.provider!==void 0}function $t(e){return e.providerId!=="deco"}function Rt(e){const t=U.c(3),{error:i}=e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx($e,{size:16}),t[0]=a):a=t[0];let r;return t[1]!==i.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=r):r=t[2],r}function Ot(){const e=U.c(23),t=X();let i;e[0]!==t?(i=t.some(Mt),e[0]=t,e[1]=i):i=e[1];const a=i,r=t.length>0,[l,o]=O.useState(!1),[x,S]=O.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const n=d;if(!r){let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(!0),e[4]=_):_=e[4];let f;e[5]!==n?(f=s.jsx(Je,{providers:n,onSelect:S,onShowAll:_}),e[5]=n,e[6]=f):f=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=$=>{$||(S(null),o(!1))},e[7]=I):I=e[7];const h=x??void 0;let p;e[8]!==k||e[9]!==h?(p=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=p):p=e[10];let y;return e[11]!==f||e[12]!==p?(y=s.jsxs(s.Fragment,{children:[f,p]}),e[11]=f,e[12]=p,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-16 w-full"}),children:s.jsx(pt,{})}),e[14]=m):m=e[14];let c;e[15]!==a?(c=a?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=a,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Kt,{onConnectClick:()=>o(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:o}),e[18]=l,e[19]=g):g=e[19];let j;return e[20]!==c||e[21]!==g?(j=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=j):j=e[22],j}function Mt(e){return e.providerId==="deco"}function Tt(){const e=U.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs(Re,{children:[t,s.jsx(Fe,{fallback:Ut,children:s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-64 w-full"}),children:s.jsx(Ot,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx(Rt,{error:t??new Error("Failed to load AI providers")})}function Gs(){const e=U.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(lt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Tt,{})}),e[0]=t):t=e[0],t}export{Gs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ge,r as w,j as o,l as ye,t as ue,i as Se}from"./index-CurNB2HG.js";import{i as je}from"./ChevronRight-DYe9AFXl.js";import{S as ke}from"./scroll-area-CbWYdgRA.js";import{A as _e}from"./add-section-modal-CEyStjwy.js";import{ao as Be,ap as we,aq as Ae,j as Ne,k as Re,ar as Ce,U as Ee,ab as Ke}from"./index-C2QgbLxn.js";import{S as Te}from"./save-status-C9pT75mA.js";import"./agent-icon-pz8iT5cD.js";import"./AlertCircle-BMCh3ayd.js";import"./Tool01-WsqNh4er.js";import"./SwitchHorizontal01-DXdcIz27.js";import"./Settings02-ozrzAwut.js";import"./XCircle-DFBcUexW.js";import"./ArrowUpRight-CwVMUp5O.js";import"./ZapSquare-DOK7F1oe.js";import"./Users03-CJuVy8Iz.js";import"./CheckCircle-BP2lb3AX.js";import"./ChevronUp-CiXD4kQk.js";import"./ChevronDown-CkcGr2qp.js";import"./ChevronLeft-Cgw9JZYG.js";import"./DotsVertical-Z_h1bSB3.js";import"./Stars02-C4CXFnp9.js";import"./Eye-B92Ff4dY.js";import"./ZoomOut-ryBmf3S4.js";import"./Globe01-MZlo2_34.js";import"./FilterLines-CMHeCbJ1.js";import"./Star01-BoZIiKCL.js";import"./Globe04-BPWbnzx0.js";import"./HardDrive-D8FSpDtM.js";import"./Key01-CZVV-ceU.js";import"./LayoutLeft-CuTI_WR9.js";import"./LinkExternal01-DekFjc9P.js";import"./Monitor01-BxGhRsUq.js";import"./Sun-2eUdoD8j.js";import"./Palette-BDlA8RUr.js";import"./Play-BGGUeSDd.js";import"./Plus-CQOl41pg.js";import"./SearchMd-Da504yGV.js";import"./Shield01-CYPtC_lA.js";import"./Stars01-BJuGXG_N.js";import"./Trash01-z6De146C.js";import"./Upload01-C4sYhZ0M.js";import"./User01-Cvp121NC.js";import"./Users01-DcrlsWI1.js";import"./XClose-BKWXOZkj.js";import"./X-DgKWdqZ1.js";import"./Zap-Cxu6aoRs.js";import"./use-clock-tick-DmUrmEeM.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BWQBaWRC.js";import"./tooltip-CUlMaf5E.js";import"./file-type-icon-CWgZWEkL.js";import"./dialog-BFjL_my-.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CDn4NSje.js";import"./use-mcp-client-BbOUwA1H.js";import"./auth-xlfJjVrK.js";import"./chat-context-Dz9rhizY.js";import"./hooks-CFfc1t5D.js";import"./decopilot-sse-pool-DXv2T192.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CLJ6qnG1.js";import"./use-collections-w44ZyJ1t.js";import"./use-ai-providers-D-XhQ6_q.js";import"./studio-tools-BvQ8Bli1.js";import"./use-organization-settings-B5L78CqV.js";import"./shell-layout-BkVrkYmb.js";import"./avatar-Bh53txVX.js";import"./required-auth-layout-Be__d9RH.js";import"./use-org-sso-CIoYIaj1.js";import"./sheet-Djk8ol5s.js";import"./integration-icon-Dpj2NSXY.js";import"./use-navigate-to-agent-CidcWwFC.js";import"./use-connection-Cvfufzsw.js";import"./use-mcp-prompts-Y5le4syR.js";import"./form-B6Nf7hvD.js";import"./label-DrXdAtn0.js";import"./input-RRjvrcUF.js";import"./index-BdQq_4o_.js";import"./index-BVXtRunj.js";import"./drawer-DZMXZPMN.js";import"./collection-search-JfLpXbmD.js";import"./select-BePf1IJF.js";import"./tabs-DOJ7e6Z7.js";import"./toggle-group-CSO_yZKm.js";import"./sortable.esm-BN6bAoSL.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card--7NnoNLM.js";import"./use-registry-connections-3CHe_VwJ.js";import"./useInfiniteQuery-BAIT4yxs.js";import"./use-infinite-scroll-BlkXRVRw.js";import"./extract-connection-data-Bau_aQvM.js";import"./card-D_tApM0k.js";import"./collection-tabs-B5YA_dM5.js";import"./badge-CdirlPdy.js";import"./textarea-C7j7_npp.js";import"./connection-form-helpers-BW7AB-E3.js";import"./authenticate-and-persist-oauth-DPn6Vk96.js";import"./mcp-oauth-B5dnAc7V.js";import"./useSuspenseInfiniteQuery-DpmGs3CS.js";import"./connect-desktop-dialog-BxJ3X8re.js";import"./decopilot-CiHv6XGE.js";import"./checkbox-OtNKSART.js";import"./skeleton-DrM35KBr.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-ELYurXQx.js";import"./popover-D7BamlkK.js";import"./command-iFNWkWs6.js";import"./index-BDyN-RAN.js";import"./dropdown-menu-B1DaP6vk.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bbu_XWuO.js";import"./empty-state-Lmcbk0Zv.js";import"./toolbar-D9CfLhAB.js";import"./preview-dialog-C9Rx0Dtg.js";import"./index-ZANilAX7.js";import"./use-mcp-tools-xGr1pN0n.js";import"./use-capability-DfdnXTfH.js";import"./shell-route-loading-gKBpXu2h.js";import"./tools-list-DC6csFT2.js";import"./alert-dialog-CkCCiKt9.js";import"./switch-dEe0am9a.js";import"./use-debounced-autosave-CaTQp8tz.js";import"./index-qZ5-LmpP.js";import"./sidebar-DLCPSSnc.js";import"./search-input-CeqwXCv0.js";import"./github-repo-picker-CThHTj5h.js";import"./use-secrets-DlUSWVTu.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-CIiu6iGh.js";import"./index-ovnDLwrg.js";import"./automation-runs-DBQv8Uvp.js";import"./table-D_zHkpnq.js";import"./use-members-blURElyD.js";import"./use-org-auth-client-oMz0ubhe.js";import"./task-status-DLHF9SZS.js";import"./use-automations-BllXXW29.js";import"./use-file-configs-Bg9S5WW4.js";import"./monaco-editor-zMbhl8rq.js";import"./select-model-CgXZFBIr.js";import"./automation-list-row-CCZ8TAPg.js";function $e(l,e){const m=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",a=Be(e,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function br(l){const e=ge.c(77),{orgSlug:m,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:s,decofile:c,title:D,excludeFields:H,schemaPending:ae,previewBaseUrl:ne}=l,G=ae===void 0?!1:ae,u=ne===void 0?null:ne,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let R;e[0]!==H||e[1]!==s||e[2]!==x?(R=we(x,s,H),e[0]=H,e[1]=s,e[2]=x,e[3]=R):R=e[3];const h=R;let C;e[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,e[4]=h,e[5]=C):C=e[5];const J=C;let E;e[6]!==n||e[7]!==i||e[8]!==s||e[9]!==D?(E=D??(n?Ae(i,n,s):i),e[6]=n,e[7]=i,e[8]=s,e[9]=D,e[10]=E):E=e[10];const v=E;let K;e[11]!==a||e[12]!==m||e[13]!==f?(K={orgSlug:m,virtualMcpId:f,branch:a},e[11]=a,e[12]=m,e[13]=f,e[14]=K):K=e[14];const{save:b,flush:Q,isPending:W}=Ne(K);let T;e[15]!==a||e[16]!==m||e[17]!==f?(T={orgSlug:m,virtualMcpId:f,branch:a},e[15]=a,e[16]=m,e[17]=f,e[18]=T):T=e[18];const X=Re(T);let $;e[19]!==b?($=Ee((t,r)=>b(t,r)),e[19]=b,e[20]=$):$=e[20];const Y=$,[he,xe]=w.useState(i),[ee,ce]=w.useState(null),[te,de]=w.useState(0);let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],e[21]=F):F=e[21];const[p,fe]=w.useState(F),[oe,re]=w.useState(!1),P=w.useRef(null);he!==i&&(xe(i),ce(null),de(Pe),fe([]));let O;e[22]!==n?(O=n??{},e[22]=n,e[23]=O):O=e[23];const ie=O;let g;e[24]!==ee?(g=ee??{},e[24]=ee,e[25]=g):g=e[25];let q;e[26]!==ie||e[27]!==g?(q={...ie,...g},e[26]=ie,e[27]=g,e[28]=q):q=e[28];const se=q;let z;e[29]!==i||e[30]!==x||e[31]!==b?(z=t=>{const r=t;ce(r),b(i,{...r,__resolveType:x})},e[29]=i,e[30]=x,e[31]=b,e[32]=z):z=e[32];const me=z;let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t=>{fe(t)},e[33]=L):L=e[33];const pe=L;let U;e[34]!==c||e[35]!==Q||e[36]!==X?(U=async(t,r)=>{try{const{blockKey:d,data:N}=$e(t,c);await X.mutateAsync({blockKey:d,data:N}),ue.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,be=N instanceof Error?N.message:"Could not add section";throw ue.error(be),N}},e[34]=c,e[35]=Q,e[36]=X,e[37]=U):U=e[37];const y=U;let V;e[38]===Symbol.for("react.memo_cache_sentinel")?(V=t=>{P.current=t.append,re(!0)},e[38]=V):V=e[38];const ve=V;let I;e[39]!==y?(I=async t=>{const r=P.current;if(r)try{await y(t,d=>{r(d),re(!1),P.current=null})}catch{}},e[39]=y,e[40]=I):I=e[40];const le=I;let M;e[41]!==p||e[42]!==v?(M=p.length>0?[v,...p]:[],e[41]=p,e[42]=v,e[43]=M):M=e[43];const A=M;let S;e[44]!==p||e[45]!==A||e[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((t,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(je,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pe(r===0?[]:Ce(p,r)),de(Fe)},title:t,className:ye("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),e[44]=p,e[45]=A,e[46]=v,e[47]=S):S=e[47];let j;e[48]!==W?(j=o.jsx(Te,{isPending:W,isError:!1}),e[48]=W,e[49]=j):j=e[49];let k;e[50]!==S||e[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),e[50]=S,e[51]=j,e[52]=k):k=e[52];let _;e[53]!==i||e[54]!==p||e[55]!==c||e[56]!==se||e[57]!==te||e[58]!==y||e[59]!==me||e[60]!==J||e[61]!==s||e[62]!==u||e[63]!==Y||e[64]!==h||e[65]!==G?(_=o.jsx(ke,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Ke,{schema:h,value:se,onChange:me,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pe,decofile:c,meta:s,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:ve},`${i}:${te}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(Se,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),e[53]=i,e[54]=p,e[55]=c,e[56]=se,e[57]=te,e[58]=y,e[59]=me,e[60]=J,e[61]=s,e[62]=u,e[63]=Y,e[64]=h,e[65]=G,e[66]=_):_=e[66];let B;e[67]!==oe||e[68]!==c||e[69]!==le||e[70]!==s||e[71]!==u?(B=u&&o.jsx(_e,{open:oe,onOpenChange:t=>{re(t),t||(P.current=null)},meta:s,decofile:c,previewBaseUrl:u,onSelect:t=>{le(t)}}),e[67]=oe,e[68]=c,e[69]=le,e[70]=s,e[71]=u,e[72]=B):B=e[72];let Z;return e[73]!==k||e[74]!==_||e[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),e[73]=k,e[74]=_,e[75]=B,e[76]=Z):Z=e[76],Z}function Fe(l){return l+1}function Pe(l){return l+1}export{br as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as B,j as o,w as L,b as T,r as $,B as M,s as N}from"./index-CurNB2HG.js";import{s as q}from"./Plus-CQOl41pg.js";import{i as S}from"./Zap-Cxu6aoRs.js";import{S as D}from"./search-input-CeqwXCv0.js";import{P as l}from"./index-qZ5-LmpP.js";import{E as b}from"./empty-state-Lmcbk0Zv.js";import{c as O}from"./use-automations-BllXXW29.js";import{m as V}from"./use-navigate-to-agent-CidcWwFC.js";import{A as F}from"./automation-list-row-CCZ8TAPg.js";import{o as G}from"./use-mcp-client-BbOUwA1H.js";import{u as H}from"./use-virtual-mcp-CLJ6qnG1.js";import{R as J}from"./require-capability-CBJ6cwe3.js";import"./SearchMd-Da504yGV.js";import"./sidebar-DLCPSSnc.js";import"./LayoutLeft-CuTI_WR9.js";import"./tooltip-CUlMaf5E.js";import"./sheet-Djk8ol5s.js";import"./X-DgKWdqZ1.js";import"./studio-tools-BvQ8Bli1.js";import"./alert-dialog-CkCCiKt9.js";import"./dropdown-menu-B1DaP6vk.js";import"./ChevronUp-CiXD4kQk.js";import"./ChevronRight-DYe9AFXl.js";import"./DotsVertical-Z_h1bSB3.js";import"./Stars02-C4CXFnp9.js";import"./Trash01-z6De146C.js";import"./agent-icon-pz8iT5cD.js";import"./AlertCircle-BMCh3ayd.js";import"./Tool01-WsqNh4er.js";import"./SwitchHorizontal01-DXdcIz27.js";import"./Settings02-ozrzAwut.js";import"./XCircle-DFBcUexW.js";import"./ArrowUpRight-CwVMUp5O.js";import"./ZapSquare-DOK7F1oe.js";import"./Users03-CJuVy8Iz.js";import"./CheckCircle-BP2lb3AX.js";import"./ChevronDown-CkcGr2qp.js";import"./ChevronLeft-Cgw9JZYG.js";import"./Eye-B92Ff4dY.js";import"./ZoomOut-ryBmf3S4.js";import"./Globe01-MZlo2_34.js";import"./FilterLines-CMHeCbJ1.js";import"./Star01-BoZIiKCL.js";import"./Globe04-BPWbnzx0.js";import"./HardDrive-D8FSpDtM.js";import"./Key01-CZVV-ceU.js";import"./LinkExternal01-DekFjc9P.js";import"./Monitor01-BxGhRsUq.js";import"./Sun-2eUdoD8j.js";import"./Palette-BDlA8RUr.js";import"./Play-BGGUeSDd.js";import"./Shield01-CYPtC_lA.js";import"./Stars01-BJuGXG_N.js";import"./Upload01-C4sYhZ0M.js";import"./User01-Cvp121NC.js";import"./Users01-DcrlsWI1.js";import"./XClose-BKWXOZkj.js";import"./auth-xlfJjVrK.js";import"./use-collections-w44ZyJ1t.js";import"./use-capability-DfdnXTfH.js";import"./access-gate-DvuwS2Bs.js";import"./capability-load-error-DgQyDsKl.js";function K(){const t=B.c(16),{org:i}=L(),{data:v}=O(void 0),u=v===void 0?[]:v,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const m=y.get(e.virtual_mcp_id);if(m&&m.title.toLowerCase().includes(g))return!0}return!1}),P=(e,m)=>{const A=m&&y.has(m)?m:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const w=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==w?(s=o.jsxs(j.Body,{children:[r,w]}),t[6]=j.Body,t[7]=r,t[8]=w,t[9]=s):s=t[9];let a;t[10]!==h.Content||t[11]!==s?(a=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=a):a=t[12];let c;return t[13]!==x||t[14]!==a?(c=o.jsx(x,{children:a}),t[13]=x,t[14]=a,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function eo(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{eo as default};
|