decocms 3.110.0 → 3.112.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-3a42Y32Q.js → AlertCircle-D6HasNW-.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-kXfJCOtG.js → ArrowUpRight-DarqXpya.js} +1 -1
- package/dist/client/assets/{CheckCircle-n8jdawLU.js → CheckCircle-DgZI-dJ-.js} +1 -1
- package/dist/client/assets/{ChevronDown-G62nfa2N.js → ChevronDown-_sskHIVZ.js} +1 -1
- package/dist/client/assets/{ChevronLeft-BFEbzxr2.js → ChevronLeft-C7H01O7a.js} +1 -1
- package/dist/client/assets/{ChevronRight-_-iVnMDM.js → ChevronRight-BQ1fiATv.js} +1 -1
- package/dist/client/assets/{ChevronUp-CvLg0JD0.js → ChevronUp-ChWPCMH3.js} +1 -1
- package/dist/client/assets/{DotsVertical-Cwultgek.js → DotsVertical-5NZ2dMEg.js} +1 -1
- package/dist/client/assets/{Eye-DvWAO5gf.js → Eye-PLJ1fYwC.js} +1 -1
- package/dist/client/assets/{FilterLines-BHkqBGr7.js → FilterLines-NA8LOhaU.js} +1 -1
- package/dist/client/assets/{Globe01-CDttDk96.js → Globe01--W_dtnQf.js} +1 -1
- package/dist/client/assets/{Globe04-DB_Sdapa.js → Globe04-DUuK26Wl.js} +1 -1
- package/dist/client/assets/{HardDrive-DMH3VLW5.js → HardDrive-BAaAqmC-.js} +1 -1
- package/dist/client/assets/{Key01-PPoquOD0.js → Key01-CFLNAquO.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Ddkt9171.js → LayoutLeft-N8Oux15V.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CfgaruN6.js → LinkExternal01-DkenSEpb.js} +1 -1
- package/dist/client/assets/{Monitor01-DH6AP0w9.js → Monitor01-CpWpRKNE.js} +1 -1
- package/dist/client/assets/{Palette-FlQGtYwX.js → Palette-CfXbqPzj.js} +1 -1
- package/dist/client/assets/{Play-ehXX0Q38.js → Play-BqVncmgO.js} +1 -1
- package/dist/client/assets/{Plus-Dx_wxVWe.js → Plus-CPye9s7a.js} +1 -1
- package/dist/client/assets/{SearchLg-C7qnbpDa.js → SearchLg-BhiSi-wl.js} +1 -1
- package/dist/client/assets/{SearchMd-BLh-9N8v.js → SearchMd-BsEoQWSJ.js} +1 -1
- package/dist/client/assets/{Settings02-DQ036CAG.js → Settings02-DmYcSN0N.js} +1 -1
- package/dist/client/assets/{Shield01-CjUxgjnh.js → Shield01-BO4-Up-4.js} +1 -1
- package/dist/client/assets/{Star01-BDb11yyu.js → Star01-P3xDQ9k4.js} +1 -1
- package/dist/client/assets/{Stars01-VH93BVY_.js → Stars01-NEQyyj5W.js} +1 -1
- package/dist/client/assets/{Stars02-jjLUIqwc.js → Stars02-D0IIJb7B.js} +1 -1
- package/dist/client/assets/{Sun-BuMidyKX.js → Sun-CXIHWJ0C.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-3qBzKHi7.js → SwitchHorizontal01-Dj-h7Wqz.js} +1 -1
- package/dist/client/assets/{Tool01-D8z2EmLx.js → Tool01-fWWPtzoO.js} +1 -1
- package/dist/client/assets/{Trash01-wsF4DycC.js → Trash01-DNQen9pn.js} +1 -1
- package/dist/client/assets/{Upload01-Dq8q0rQz.js → Upload01-BrA4sfL7.js} +1 -1
- package/dist/client/assets/{User01-Ddj-LeQV.js → User01-CJxzFzi0.js} +1 -1
- package/dist/client/assets/{Users01-DwZAeWye.js → Users01-DKlIV4Ua.js} +1 -1
- package/dist/client/assets/{Users03-DnUEh8JP.js → Users03-BhVEfEx8.js} +1 -1
- package/dist/client/assets/{X-DRAd27QV.js → X-DNS57nVr.js} +1 -1
- package/dist/client/assets/{XCircle-DEac6B60.js → XCircle-xBrLw9m3.js} +1 -1
- package/dist/client/assets/{XClose-DoitZjeT.js → XClose-MtXX-cEC.js} +1 -1
- package/dist/client/assets/{Zap-BeCXSxio.js → Zap-xjrRUs0Z.js} +1 -1
- package/dist/client/assets/{ZapSquare-CxU3wnk2.js → ZapSquare-D_ssX_qd.js} +1 -1
- package/dist/client/assets/{ZoomOut-CXIIR5Xs.js → ZoomOut-OTDI-_Gu.js} +1 -1
- package/dist/client/assets/{access-gate-dSU8i6d5.js → access-gate-w0rRY34b.js} +1 -1
- package/dist/client/assets/{add-section-modal-pvZF0M9Y.js → add-section-modal-QeH6AOQr.js} +1 -1
- package/dist/client/assets/{agent-icon-z9a7P-VJ.js → agent-icon-BCyrrW8E.js} +1 -1
- package/dist/client/assets/{agents-list-nY8NLyGz.js → agents-list-TyDoc_Ig.js} +1 -1
- package/dist/client/assets/{ai-providers-Dn_-maPJ.js → ai-providers-BFEkcrvC.js} +1 -1
- package/dist/client/assets/{alert-eW0A0Ad6.js → alert-NYnSBv_x.js} +1 -1
- package/dist/client/assets/{alert-dialog-6mhzPWM-.js → alert-dialog-BkCAyKr6.js} +1 -1
- package/dist/client/assets/{app-editor-C-SvUqpt.js → app-editor-BbwOXES2.js} +1 -1
- package/dist/client/assets/{auth-DI4UdzcA.js → auth-DirVcjKE.js} +1 -1
- package/dist/client/assets/{auth-catchall-CrPnwWxI.js → auth-catchall-C-POfBBT.js} +1 -1
- package/dist/client/assets/{auth-entry-CUC-1yt-.js → auth-entry-hwQ5KM13.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Dp-cvbwA.js → auth-split-layout-CYBRRYAC.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DFUhqBKz.js → authenticate-and-persist-oauth-9Ha3hzU6.js} +1 -1
- package/dist/client/assets/{automation-list-row-CsXsL2m3.js → automation-list-row-DFfRCpxK.js} +1 -1
- package/dist/client/assets/{automation-runs-FRZz1Jxo.js → automation-runs-1hQAeLWE.js} +1 -1
- package/dist/client/assets/{automations-D-kCfyB-.js → automations-B6_EueRi.js} +1 -1
- package/dist/client/assets/{avatar-B1XYxCEI.js → avatar-B56O9wfS.js} +1 -1
- package/dist/client/assets/{badge-BENqSIMW.js → badge-BfCtIWQN.js} +1 -1
- package/dist/client/assets/{block-document-D447TgwM.js → block-document-GKm3UBca.js} +1 -1
- package/dist/client/assets/{brand-context-5lPcZBdC.js → brand-context-DON2yt9k.js} +1 -1
- package/dist/client/assets/{buckets-Duo7UnZq.js → buckets-Cr6WnAWk.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CsLa0pfY.js → bulk-category-panel-uAc4QkMQ.js} +1 -1
- package/dist/client/assets/{capability-load-error-BbpMI8qO.js → capability-load-error-Blvw5kP1.js} +1 -1
- package/dist/client/assets/{card-cvfFGOFn.js → card-CYHjw_1d.js} +1 -1
- package/dist/client/assets/category-editor-BEvlvxjD.js +1 -0
- package/dist/client/assets/{chat-context-BYQB5zQ3.js → chat-context-jbndmT3E.js} +1 -1
- package/dist/client/assets/{checkbox-CExBS06F.js → checkbox-Cbzc0Zfr.js} +1 -1
- package/dist/client/assets/{cli-auth-success-B1qAPb3J.js → cli-auth-success-IfCem3No.js} +1 -1
- package/dist/client/assets/{collection-detail-CsIeWL-Q.js → collection-detail-BnkC8OFX.js} +1 -1
- package/dist/client/assets/{collection-display-button-CfHHbXGO.js → collection-display-button-BGN6hWOJ.js} +1 -1
- package/dist/client/assets/{collection-search-VqRze0Jz.js → collection-search-CJpzCV-R.js} +1 -1
- package/dist/client/assets/{collection-tabs-BPPqRvP7.js → collection-tabs-Cc3VGli5.js} +1 -1
- package/dist/client/assets/{command-C2FYWVqe.js → command-CylKrZB7.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-pQ4pxRKH.js → commerce-onboarding-DZjyl3DN.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BCCJMJVg.js → connect-desktop-dialog-Laa7lx3F.js} +1 -1
- package/dist/client/assets/{connection-card-DxDSEKb0.js → connection-card-CGsbdWAC.js} +1 -1
- package/dist/client/assets/{connection-detail-3-BysWH5.js → connection-detail-TaBxKr8o.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Bfw04B7m.js → connection-form-helpers-BBf_mOnK.js} +1 -1
- package/dist/client/assets/{connections-BQhJ97tw.js → connections-_3MD9DyV.js} +1 -1
- package/dist/client/assets/{context-menu-DD5eZv-o.js → context-menu-BUIgu4wE.js} +1 -1
- package/dist/client/assets/{decopilot-Dr8wUhH8.js → decopilot-D4vVuZQY.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-D0AHvthA.js → decopilot-sse-pool-BeQdfNEl.js} +1 -1
- package/dist/client/assets/{dialog-DI9uZOw1.js → dialog-DfYTB-e5.js} +1 -1
- package/dist/client/assets/{domain-settings-DldUFjmA.js → domain-settings-Cc6CW1L3.js} +1 -1
- package/dist/client/assets/{drawer-BpieeJCx.js → drawer-6BiJF7q1.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DXo7FbtM.js → dropdown-menu-Cwmtnb3G.js} +1 -1
- package/dist/client/assets/{empty-state-DW4CjYnI.js → empty-state-zZd3SPcH.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CWyRtB18.js → extract-connection-data-DWbEhSQh.js} +1 -1
- package/dist/client/assets/{file-explorer-CRJd0jPm.js → file-explorer-BdtnY0fM.js} +2 -2
- package/dist/client/assets/{file-type-icon-r28WvKg7.js → file-type-icon-2QgME0cN.js} +1 -1
- package/dist/client/assets/{files-C8-d4s_6.js → files-CYLUljlT.js} +1 -1
- package/dist/client/assets/{form-Bz2znigu.js → form-Bfmld57D.js} +1 -1
- package/dist/client/assets/{general-DgTxonnC.js → general-E-stFLm5.js} +1 -1
- package/dist/client/assets/{github-repo-picker-8V-SSku2.js → github-repo-picker-C_5_qfvI.js} +1 -1
- package/dist/client/assets/{hooks-E0hrfxwb.js → hooks-BL663Psa.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-B84yppT8.js → import-from-deco-dialog-IcTJC1LG.js} +1 -1
- package/dist/client/assets/{index-tdWeLBAc.js → index-4Acgz49X.js} +1 -1
- package/dist/client/assets/index-6OTBVIp9.js +3 -0
- package/dist/client/assets/{index-AuYmUEf7.js → index-6wwVWMP0.js} +1 -1
- package/dist/client/assets/{index-BCtvMzkJ.js → index-BKhzmumK.js} +1 -1
- package/dist/client/assets/index-BjMZoXhm.js +503 -0
- package/dist/client/assets/{index-nEYHKdqS.js → index-Bu1gd3tb.js} +3 -3
- package/dist/client/assets/{index-YA3tOhz8.js → index-Bv510vAp.js} +1 -1
- package/dist/client/assets/{index-cH88pHf5.js → index-C962buSu.js} +1 -1
- package/dist/client/assets/{index-DfC-bGLv.js → index-CNyRj6Il.js} +1 -1
- package/dist/client/assets/{index-B6lhx2Nx.js → index-Cj7LPcxw.js} +1 -1
- package/dist/client/assets/{index-B0e3q3tq.js → index-CoJyjw7H.js} +1 -1
- package/dist/client/assets/{index-NHU49YBK.js → index-D5-tWVw8.js} +3 -3
- package/dist/client/assets/{index-CT2vaQmC.js → index-Dn6ecndj.js} +1 -1
- package/dist/client/assets/{index-B2gsdQaf.js → index-DxOgft7I.js} +1 -1
- package/dist/client/assets/index-oc0Wc4Zm.css +1 -0
- package/dist/client/assets/{index-redirect-o4wKabTo.js → index-redirect-C58OqTeD.js} +1 -1
- package/dist/client/assets/{input-BM2AMR43.js → input-DK_JWiht.js} +1 -1
- package/dist/client/assets/{integration-icon-B5YbyPfI.js → integration-icon-UdjY5O8-.js} +1 -1
- package/dist/client/assets/{label-D5BdX0dr.js → label-B3e1_J35.js} +1 -1
- package/dist/client/assets/{login-D3BUvM2g.js → login-Dfd6j6Pk.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CELJ6lWl.js → mcp-oauth-GwlPrvnc.js} +1 -1
- package/dist/client/assets/{members-BR4dIeq1.js → members-BzdqVw73.js} +1 -1
- package/dist/client/assets/{monaco-editor-jmD3XQpJ.js → monaco-editor-BW9qP89y.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-_Kz_Cagz.js → monitoring-stats-row-BuC_Wzkq.js} +1 -1
- package/dist/client/assets/{oauth-callback-0EduvBqB.js → oauth-callback-CL3COSGD.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Cw0JfGXH.js → oauth-callback-ai-provider-7Qjbg1x-.js} +1 -1
- package/dist/client/assets/{onboarding-FtnThbkI.js → onboarding-Cpc__28Z.js} +1 -1
- package/dist/client/assets/{org-install-CQkZOnCg.js → org-install-DjvLG2kc.js} +1 -1
- package/dist/client/assets/{org-layout-B4ew0nrf.js → org-layout-CEGAw2m_.js} +1 -1
- package/dist/client/assets/{organization-choice-DOuEChRE.js → organization-choice-DiUV9LVG.js} +1 -1
- package/dist/client/assets/{page-seo-form-CmDnFXj0.js → page-seo-form-BhO6686T.js} +1 -1
- package/dist/client/assets/page-seo-sheet-D4Kk6yQA.js +1 -0
- package/dist/client/assets/{popover-CgDHu-zS.js → popover-Dqj0yzwD.js} +1 -1
- package/dist/client/assets/{post-editor-qeX4BlSI.js → post-editor-CFS_qVuQ.js} +1 -1
- package/dist/client/assets/{preview-dialog-D5E4FgCw.js → preview-dialog-COZ3D0f3.js} +1 -1
- package/dist/client/assets/{primitives-DzrgzW9n.js → primitives-DGBi-x4C.js} +1 -1
- package/dist/client/assets/{profile-Czu4XqTy.js → profile-CgqJnts8.js} +1 -1
- package/dist/client/assets/project-app-view-DI4sqEcv.js +1 -0
- package/dist/client/assets/record-editor-DvFuLz5W.js +1 -0
- package/dist/client/assets/registry--3DNGJOR.js +2 -0
- package/dist/client/assets/{registry-layout-DRn7mFJE.js → registry-layout-YWHAEIbP.js} +1 -1
- package/dist/client/assets/{require-capability-CvAULB3o.js → require-capability-Bc7H1UEg.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CVZjAF6p.js → required-auth-layout-CuUNRvzB.js} +1 -1
- package/dist/client/assets/{reset-password-GiIibj_X.js → reset-password-nCF6LEBU.js} +1 -1
- package/dist/client/assets/{roles-25LF7sLR.js → roles-BSVTlbOP.js} +1 -1
- package/dist/client/assets/scroll-area-CH7TYGAW.js +188 -0
- package/dist/client/assets/{search-input-DMv2zQbT.js → search-input-CHLgByt-.js} +1 -1
- package/dist/client/assets/{secrets-EJqX3Y8_.js → secrets-C4LaaYcs.js} +1 -1
- package/dist/client/assets/{sections-editor-DpUaA-UK.js → sections-editor-C9evaCRx.js} +2 -2
- package/dist/client/assets/{select-DTXnEmNM.js → select-Xifthtl5.js} +1 -1
- package/dist/client/assets/{select-model-D-GnzJTk.js → select-model-Rg01OpBz.js} +1 -1
- package/dist/client/assets/{seo-editor-aNxCjIBb.js → seo-editor-8QUzpNfh.js} +1 -1
- package/dist/client/assets/{settings-layout-zuxw_LPF.js → settings-layout-DcSguvGs.js} +1 -1
- package/dist/client/assets/{settings-section-C05qMf5J.js → settings-section-CuGcJrcV.js} +1 -1
- package/dist/client/assets/{sheet-Cm9vy-is.js → sheet-D_1HDWbN.js} +1 -1
- package/dist/client/assets/{shell-controls-BJYHrPZL.js → shell-controls-Bq_gIKFE.js} +1 -1
- package/dist/client/assets/{shell-layout-B3LSdloo.js → shell-layout-BqcUfT34.js} +1 -1
- package/dist/client/assets/{shell-route-loading-BHxQVa3P.js → shell-route-loading-B2zJ9IvU.js} +1 -1
- package/dist/client/assets/{sidebar-CUCRALlI.js → sidebar-DemNT0uk.js} +1 -1
- package/dist/client/assets/{skeleton-Dhj_RMRP.js → skeleton-B013TrXY.js} +1 -1
- package/dist/client/assets/{sortable.esm-D8Xq7o-p.js → sortable.esm-CQcA1lzK.js} +1 -1
- package/dist/client/assets/{sso-COCP_Ig_.js → sso-Bh-2EJmx.js} +1 -1
- package/dist/client/assets/store-registry-CNkcudJM.js +2 -0
- package/dist/client/assets/{store-DNNf9CWj.js → store-sv5yfguA.js} +1 -1
- package/dist/client/assets/{studio-tools-B3ETtzpq.js → studio-tools-B4987TWs.js} +1 -1
- package/dist/client/assets/{switch-yQ4MeBWb.js → switch-C_iIRuCa.js} +1 -1
- package/dist/client/assets/{table-FMe6hb4W.js → table-Cbl4lNdy.js} +1 -1
- package/dist/client/assets/{tabs-ByKhbrL3.js → tabs-Bp7Vm1cJ.js} +1 -1
- package/dist/client/assets/{task-status-CKBnAgo0.js → task-status-D2dTm5T9.js} +1 -1
- package/dist/client/assets/{textarea-C2v8p5Q_.js → textarea-DjPPJktu.js} +1 -1
- package/dist/client/assets/{toggle-group-DRPAcqSk.js → toggle-group-CcTdAzLD.js} +1 -1
- package/dist/client/assets/{toolbar-BHV_OeGM.js → toolbar-CN0hwc8s.js} +1 -1
- package/dist/client/assets/{tools-list-DRrZln_E.js → tools-list-Bv_RPs94.js} +1 -1
- package/dist/client/assets/{tooltip-DNOJd4mB.js → tooltip-CNdlhom-.js} +1 -1
- package/dist/client/assets/{types-D8ya3q3L.js → types-CwehcXq2.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CNL3O4hK.js → use-ai-providers-BKx3CmhJ.js} +1 -1
- package/dist/client/assets/{use-automations-Cb4DxEgv.js → use-automations-EJ3eboK9.js} +1 -1
- package/dist/client/assets/{use-capability-Dok_Iq_h.js → use-capability-CsDG8LVx.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BHfy0ujs.js → use-clock-tick-CmYQsF-l.js} +1 -1
- package/dist/client/assets/{use-collections-D-agNER0.js → use-collections-Bg2TGwVs.js} +1 -1
- package/dist/client/assets/{use-connection-D5Yn6X1k.js → use-connection-CGLrKow0.js} +1 -1
- package/dist/client/assets/{use-copy-BYD2opl9.js → use-copy-CRnTuLhA.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D6uaYgOg.js → use-create-virtual-mcp-C0vIOqnP.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-EQlvKcut.js → use-debounced-autosave-Q7_cOJHo.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D2OoRIdo.js → use-debounced-value-BkKh9lCg.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-T9FNzBJ-.js → use-decopilot-events-CkYI8WVy.js} +1 -1
- package/dist/client/assets/{use-delete-connection-4o5XFeP8.js → use-delete-connection-Wi6XpPzB.js} +1 -1
- package/dist/client/assets/{use-file-configs-kMgI5hml.js → use-file-configs-CpZIUUol.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Bv5wQ7Wg.js → use-infinite-scroll-DYYAUXOv.js} +1 -1
- package/dist/client/assets/{use-join-requests-C-31y_Ou.js → use-join-requests-DqT8Ii-1.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BGOUlx-P.js → use-mcp-client-DnEaqsA8.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CRVg9LFk.js → use-mcp-prompts-DySWGVEH.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C8njypSm.js → use-mcp-tools-BZSwjfcP.js} +1 -1
- package/dist/client/assets/{use-members-CEkjXPIb.js → use-members-CPUDXmnu.js} +1 -1
- package/dist/client/assets/{use-mobile-BdtUaG2t.js → use-mobile-BjvjP3oD.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-0B1rE19_.js → use-navigate-to-agent-C7L_A9rz.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BfIW_pQg.js → use-org-auth-client-cRiepXtH.js} +1 -1
- package/dist/client/assets/{use-org-fs-CXhVHffG.js → use-org-fs-MsK_DTuJ.js} +1 -1
- package/dist/client/assets/{use-org-sso-D4XCcGiP.js → use-org-sso-DA4c734J.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DvgOklyZ.js → use-organization-roles-Cbnzl-le.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D3N4P1sO.js → use-organization-settings-BVTzY09K.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BerlzPAj.js → use-registry-connections-DygDEnSf.js} +1 -1
- package/dist/client/assets/{use-secrets-BqevFm2t.js → use-secrets-hx78ErdY.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CjYwKkX8.js → use-status-sounds-5CopyC6f.js} +1 -1
- package/dist/client/assets/{use-view-mode-BhlKr6oi.js → use-view-mode-Br244JFx.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CE3-zMFE.js → use-virtual-mcp-KWNiHBjH.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-d1TS9t4t.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DHFTUYCE.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-C75zNcpN.js → useSuspenseQueries-C22PSu5q.js} +1 -1
- package/dist/client/assets/{variant-calendar-OqJgLmkv.js → variant-calendar-BZU0U5h7.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CFNxBK9n.js → view-mode-toggle-BG5m1hvZ.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +21 -2
- package/package.json +7 -6
- package/dist/client/assets/category-editor-CvGgeomu.js +0 -1
- package/dist/client/assets/index-BHCX-9ZH.js +0 -3
- package/dist/client/assets/index-Cer6DaC0.js +0 -503
- package/dist/client/assets/index-D5onFusR.css +0 -1
- package/dist/client/assets/page-seo-sheet-gHrDU_lX.js +0 -1
- package/dist/client/assets/project-app-view-DN3elPYd.js +0 -1
- package/dist/client/assets/record-editor-BH8xIS6B.js +0 -1
- package/dist/client/assets/registry-BZrOa-jA.js +0 -2
- package/dist/client/assets/scroll-area-DFJYrpdW.js +0 -188
- package/dist/client/assets/store-registry-DKlw16c3.js +0 -2
- package/dist/client/assets/useInfiniteQuery-D57fVIoS.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DEsj7KSO.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as V,r as U,j as o,l as J,B as Y}from"./index-NHU49YBK.js";import{U as et,f as ct}from"./agent-icon-z9a7P-VJ.js";import{n as mt}from"./ChevronLeft-BFEbzxr2.js";import{i as dt}from"./ChevronRight-_-iVnMDM.js";import{L as ft}from"./label-D5BdX0dr.js";import{S as nt}from"./scroll-area-DFJYrpdW.js";import{S as pt}from"./switch-yQ4MeBWb.js";import{a as ut,T as ht,b as gt}from"./tooltip-DNOJd4mB.js";import{V as xt}from"./view-mode-toggle-CFNxBK9n.js";import"./AlertCircle-3a42Y32Q.js";import"./Tool01-D8z2EmLx.js";import"./SwitchHorizontal01-3qBzKHi7.js";import"./Settings02-DQ036CAG.js";import"./XCircle-DEac6B60.js";import"./ArrowUpRight-kXfJCOtG.js";import"./ZapSquare-CxU3wnk2.js";import"./Users03-DnUEh8JP.js";import"./CheckCircle-n8jdawLU.js";import"./ChevronUp-CvLg0JD0.js";import"./ChevronDown-G62nfa2N.js";import"./DotsVertical-Cwultgek.js";import"./Stars02-jjLUIqwc.js";import"./Eye-DvWAO5gf.js";import"./ZoomOut-CXIIR5Xs.js";import"./Globe01-CDttDk96.js";import"./FilterLines-BHkqBGr7.js";import"./Star01-BDb11yyu.js";import"./Globe04-DB_Sdapa.js";import"./HardDrive-DMH3VLW5.js";import"./Key01-PPoquOD0.js";import"./LayoutLeft-Ddkt9171.js";import"./LinkExternal01-CfgaruN6.js";import"./Monitor01-DH6AP0w9.js";import"./Sun-BuMidyKX.js";import"./Palette-FlQGtYwX.js";import"./Play-ehXX0Q38.js";import"./Plus-Dx_wxVWe.js";import"./SearchLg-C7qnbpDa.js";import"./SearchMd-BLh-9N8v.js";import"./Shield01-CjUxgjnh.js";import"./Stars01-VH93BVY_.js";import"./Trash01-wsF4DycC.js";import"./Upload01-Dq8q0rQz.js";import"./User01-Ddj-LeQV.js";import"./Users01-DwZAeWye.js";import"./XClose-DoitZjeT.js";import"./X-DRAd27QV.js";import"./Zap-BeCXSxio.js";import"./use-clock-tick-BHfy0ujs.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BYD2opl9.js";import"./file-type-icon-r28WvKg7.js";import"./dialog-DI9uZOw1.js";import"./use-mobile-BdtUaG2t.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-D8ya3q3L.js";import"./use-mcp-client-BGOUlx-P.js";import"./auth-DI4UdzcA.js";import"./chat-context-BYQB5zQ3.js";import"./hooks-E0hrfxwb.js";import"./decopilot-sse-pool-D0AHvthA.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CE3-zMFE.js";import"./use-collections-D-agNER0.js";import"./use-ai-providers-CNL3O4hK.js";import"./studio-tools-B3ETtzpq.js";import"./use-decopilot-events-T9FNzBJ-.js";import"./use-organization-settings-D3N4P1sO.js";import"./shell-layout-B3LSdloo.js";import"./avatar-B1XYxCEI.js";import"./required-auth-layout-CVZjAF6p.js";import"./use-org-sso-D4XCcGiP.js";import"./sheet-Cm9vy-is.js";import"./integration-icon-B5YbyPfI.js";import"./use-navigate-to-agent-0B1rE19_.js";import"./use-connection-D5Yn6X1k.js";import"./use-mcp-prompts-CRVg9LFk.js";import"./form-Bz2znigu.js";import"./input-BM2AMR43.js";import"./select-DTXnEmNM.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 Sn(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{Sn as VariantCalendar};
|
|
1
|
+
import{c as V,r as U,j as o,l as J,B as Y}from"./index-D5-tWVw8.js";import{V as et,f as ct}from"./agent-icon-BCyrrW8E.js";import{n as mt}from"./ChevronLeft-C7H01O7a.js";import{i as dt}from"./ChevronRight-BQ1fiATv.js";import{L as ft}from"./label-B3e1_J35.js";import{S as nt}from"./scroll-area-CH7TYGAW.js";import{S as pt}from"./switch-C_iIRuCa.js";import{a as ut,T as ht,b as gt}from"./tooltip-CNdlhom-.js";import{V as xt}from"./view-mode-toggle-BG5m1hvZ.js";import"./AlertCircle-D6HasNW-.js";import"./Tool01-fWWPtzoO.js";import"./SwitchHorizontal01-Dj-h7Wqz.js";import"./Settings02-DmYcSN0N.js";import"./XCircle-xBrLw9m3.js";import"./ArrowUpRight-DarqXpya.js";import"./ZapSquare-D_ssX_qd.js";import"./Users03-BhVEfEx8.js";import"./CheckCircle-DgZI-dJ-.js";import"./ChevronUp-ChWPCMH3.js";import"./ChevronDown-_sskHIVZ.js";import"./DotsVertical-5NZ2dMEg.js";import"./Stars02-D0IIJb7B.js";import"./Eye-PLJ1fYwC.js";import"./ZoomOut-OTDI-_Gu.js";import"./Globe01--W_dtnQf.js";import"./FilterLines-NA8LOhaU.js";import"./Star01-P3xDQ9k4.js";import"./Globe04-DUuK26Wl.js";import"./HardDrive-BAaAqmC-.js";import"./Key01-CFLNAquO.js";import"./LayoutLeft-N8Oux15V.js";import"./LinkExternal01-DkenSEpb.js";import"./Monitor01-CpWpRKNE.js";import"./Sun-CXIHWJ0C.js";import"./Palette-CfXbqPzj.js";import"./Play-BqVncmgO.js";import"./Plus-CPye9s7a.js";import"./SearchLg-BhiSi-wl.js";import"./SearchMd-BsEoQWSJ.js";import"./Shield01-BO4-Up-4.js";import"./Stars01-NEQyyj5W.js";import"./Trash01-DNQen9pn.js";import"./Upload01-BrA4sfL7.js";import"./User01-CJxzFzi0.js";import"./Users01-DKlIV4Ua.js";import"./XClose-MtXX-cEC.js";import"./X-DNS57nVr.js";import"./Zap-xjrRUs0Z.js";import"./use-clock-tick-CmYQsF-l.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CRnTuLhA.js";import"./file-type-icon-2QgME0cN.js";import"./dialog-DfYTB-e5.js";import"./use-mobile-BjvjP3oD.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CwehcXq2.js";import"./use-mcp-client-DnEaqsA8.js";import"./auth-DirVcjKE.js";import"./chat-context-jbndmT3E.js";import"./hooks-BL663Psa.js";import"./decopilot-sse-pool-BeQdfNEl.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-KWNiHBjH.js";import"./use-collections-Bg2TGwVs.js";import"./use-ai-providers-BKx3CmhJ.js";import"./studio-tools-B4987TWs.js";import"./use-decopilot-events-CkYI8WVy.js";import"./use-organization-settings-BVTzY09K.js";import"./shell-layout-BqcUfT34.js";import"./avatar-B56O9wfS.js";import"./required-auth-layout-CuUNRvzB.js";import"./use-org-sso-DA4c734J.js";import"./sheet-D_1HDWbN.js";import"./integration-icon-UdjY5O8-.js";import"./use-navigate-to-agent-C7L_A9rz.js";import"./use-connection-CGLrKow0.js";import"./use-mcp-prompts-DySWGVEH.js";import"./form-Bfmld57D.js";import"./input-DK_JWiht.js";import"./select-Xifthtl5.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 Sn(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{Sn 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-D5-tWVw8.js";import{T as k,a as I,b as P}from"./tooltip-CNdlhom-.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-D5-tWVw8.js"></script>
|
|
60
|
+
<link rel="stylesheet" crossorigin href="/assets/index-oc0Wc4Zm.css">
|
|
61
61
|
</head>
|
|
62
62
|
<body>
|
|
63
63
|
<div id="root"></div>
|
package/dist/server/cli.js
CHANGED
|
@@ -78210,6 +78210,15 @@ function makeExecHandler(deps) {
|
|
|
78210
78210
|
const mode = body.mode === "await" ? "await" : "background";
|
|
78211
78211
|
const env = buildDevEnv(config2, { ...config2.env, ...body.env });
|
|
78212
78212
|
const { cmd, label } = pmRunCommand(config2.runtimePathPrefix, cwd, pmConf.runPrefix, name24);
|
|
78213
|
+
if (WELL_KNOWN_STARTERS.includes(name24)) {
|
|
78214
|
+
if (deps.getStatus().state === "error") {
|
|
78215
|
+
deps.setStatus({ state: "running" });
|
|
78216
|
+
}
|
|
78217
|
+
const phase = deps.lifecycle.current().phase;
|
|
78218
|
+
if (phase === "idle" || phase === "start-failed" || phase === "crashed") {
|
|
78219
|
+
deps.lifecycle.transition({ phase: "starting" });
|
|
78220
|
+
}
|
|
78221
|
+
}
|
|
78213
78222
|
const task = await deps.taskManager.spawn({
|
|
78214
78223
|
command: cmd,
|
|
78215
78224
|
cwd,
|
|
@@ -79659,6 +79668,9 @@ class SetupOrchestrator {
|
|
|
79659
79668
|
});
|
|
79660
79669
|
}
|
|
79661
79670
|
resumeFrom(step) {
|
|
79671
|
+
if (this.deps.getStatus().state === "error") {
|
|
79672
|
+
this.deps.setStatus({ state: "running" });
|
|
79673
|
+
}
|
|
79662
79674
|
this.enqueueStep(step);
|
|
79663
79675
|
}
|
|
79664
79676
|
handle(transition) {
|
|
@@ -79940,6 +79952,10 @@ class SetupOrchestrator {
|
|
|
79940
79952
|
if (running?.command === command.cmd && running?.cwd === command.cwd) {
|
|
79941
79953
|
this.chunk(\`[orchestrator] dev already running (\${command.source}) \\u2014 skipping restart\\r
|
|
79942
79954
|
\`);
|
|
79955
|
+
const cur = this.deps.lifecycle.current().phase;
|
|
79956
|
+
if (cur !== "running" && cur !== "starting") {
|
|
79957
|
+
this.deps.lifecycle.transition({ phase: "starting" });
|
|
79958
|
+
}
|
|
79943
79959
|
return;
|
|
79944
79960
|
}
|
|
79945
79961
|
await this.stopDevTask();
|
|
@@ -80664,7 +80680,10 @@ var gitRebaseH = makeGitRebaseHandler(gitDeps);
|
|
|
80664
80680
|
var execH = makeExecHandler({
|
|
80665
80681
|
repoDir,
|
|
80666
80682
|
store,
|
|
80667
|
-
taskManager
|
|
80683
|
+
taskManager,
|
|
80684
|
+
lifecycle,
|
|
80685
|
+
getStatus: () => currentStatus,
|
|
80686
|
+
setStatus
|
|
80668
80687
|
});
|
|
80669
80688
|
var tasksListH = makeTasksListHandler({ taskManager });
|
|
80670
80689
|
var tasksGetH = makeTasksGetHandler({ taskManager });
|
|
@@ -81245,7 +81264,7 @@ ${$}`;_(Z);return}if(E(null,B),t.strategy==="count"){if(w--,w===0)_()}if(t.strat
|
|
|
81245
81264
|
SELECT * FROM link_sandboxes WHERE handle = $handle
|
|
81246
81265
|
`);function _(v){if(t===void 0)return!0;let h=hM(v),D=h&&hM(t)?eVu(t):t,g=h?eVu(v):aVu(v),O=cHt(D,g);return O===""||!O.startsWith("..")&&!fHt(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(L1i)},reconcile(){let v=Date.now();for(let h of l.all().map(L1i)){if(!_(h.sandboxPath)){c.run({$handle:h.handle,$now:v});continue}if(!hM(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(L1i)},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||!hM(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(!f7(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=f7(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=sVu(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}uHt(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=L1i(h),g=0,O=null;if(hM(D.sandboxPath)&&f7(D.sandboxPath,["rev-parse","--is-inside-work-tree"]).ok){let Z=f7(D.sandboxPath,["status","--porcelain"]);if(Z.ok){let B=Z.stdout.trim();g=B===""?0:B.split(`
|
|
81247
81266
|
`).length}if(D.branch!==null&&D.branch.trim()!=="")O=sVu(D.sandboxPath,D.branch)}return{handle:D.handle,branch:D.branch,sandboxPath:D.sandboxPath,dirtyCount:g,merged:O}},close(){u.close()}}}var PHi=()=>{};function iru(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 dHt,readdirSync as _Ht}from"fs";import{rm as vHt}from"fs/promises";import{join as uru}from"path";async function tru(i,u={}){let t=u.detach??hHt,f=u.exists??dHt,l=u.readdir??(($)=>_Ht($)),c=u.rm??(($)=>vHt($,{recursive:!0,force:!0})),E=uru(i,"org");if(f(E))for(let $ of l(E))t(uru(E,$));await c(i)}var hHt=(i)=>iru(i,process.platform==="darwin");var fru=()=>{};import{join as DHt}from"path";function lru(i){let u=i.purge??tru;return{stopSandbox(t){return i.provider.deleteSandbox(t)},inspectSandbox(t){return i.registry.inspect(t)},async removeSandbox(t){try{return await u6(async()=>{if(await i.provider.deleteSandbox(t),i.provider.hasHandle(t))throw Error("Can't delete \u2014 run in progress");let l=i.registry.inspect(t)?.sandboxPath??DHt(i.dataDir,"sandboxes",t);await u(l)},{maxAttempts:2,minTimeout:250,jitter:0}),i.registry.delete(t),{ok:!0}}catch(f){let l=f instanceof J6?f.cause:f;return{ok:!1,error:l instanceof Error?l.message:String(l)}}}}}var cru=N(()=>{Bl();fru()});import{randomBytes as gHt}from"crypto";import{mkdir as NHt}from"fs/promises";import{createServer as OHt}from"net";import{join as ZHt}from"path";function Eru(i,u){return Error(`sandbox failed to start: ${i}`,{cause:u})}function BHt(i){if(!(i instanceof Error))return!1;return i.name==="TimeoutError"||/timed out|timeout|operation was aborted|aborted/i.test(i.message)}function $ru(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 yHt(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 FHt(i){return{repoCloneUrl:i.repo?.cloneUrl??null,branch:i.repo?.branch??null,projectName:yHt(i.repo?.cloneUrl)}}function wru(i){let u=i.maxSandboxes??20,t=new Map,f=i.pickPort??THt,l=i.fetchImpl??fetch,c=i.resolvePreviewUrl??((g,O)=>`http://127.0.0.1:${O}`),E=(g)=>ZHt(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=FHt(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,y=null,F;try{await NHt(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)"}`),F=gHt(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}`),y=await Promise.resolve(i.spawnDaemon({workdir:Z,handle:g.handle,port:B,daemonToken:F,offloadAllowedHosts:g.offloadAllowedHosts??[],offloadAllowSameHostDev:g.offloadAllowSameHostDev??!1,orgFsConfigJson:g.orgFsConfigJson}));try{await i.waitForHealth(B)}catch(G){throw Eru("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},F)}catch(G){throw Eru(BHt(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)"}${y?" (killing daemon)":""}:`,j),y)try{y.kill("SIGKILL")}catch{}throw w({handle:g.handle,phase:"failed",error:$ru(j)}),$({handle:g.handle,status:"failed",sandboxPath:Z,port:null,previewUrl:null,...O,error:$ru(j)}),j}if(!y||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:y,sandboxApiUrl:T,previewUrl:U,lastUsedAt:Date.now(),activeDispatchCount:0,daemonToken:F,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}),y.exited)y.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 THt(){return new Promise((i,u)=>{let t=OHt();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 dru=()=>{};import{randomUUID as UHt}from"crypto";import{hostname as PHt}from"os";async function _ru(i){let u=PHt()||void 0;i.monitor?.onMachine?.(u??"this machine");let t=qHu(i.dataDir,{outFd:i.logFd,perSandboxLog:i.perSandboxLogs,hotReload:i.hotReload}),f=z1i({path:Q1i(i.dataDir),managedSandboxRoot:`${i.dataDir}/sandboxes`}),l=!1,c=()=>{if(l)return;l=!0;try{f.close()}catch{}};try{let E=0,$=wru({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:UHt(),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 eHu(i.dataDir);if(Y)q.ORGFS_CONFIG=G.orgFsConfigJson,q.ORGFS_RCLONE_PATH=Y}let K=await t({workdir:G.workdir,env:q,daemonPort:G.port});return{port:G.port,kill:(Y)=>K.kill(Y),exited:K.exited.then(()=>{return})}},postConfig:async(G,q,K,Y)=>{let r={port:q};if(K.workload)r.runtime=K.workload.runtime,r.packageManager={name:K.workload.packageManager,...K.workload.packageManagerPath?{path:K.workload.packageManagerPath}:{}};let Q={application:r},di=i_(K.operator??null);if(di)Q.operator=di;if(K.repo)Q.git={repository:{cloneUrl:K.repo.cloneUrl,branch:K.repo.branch},...K.repo.userName&&K.repo.userEmail?{identity:{userName:K.repo.userName,userEmail:K.repo.userEmail}}:{}};await V2(`http://127.0.0.1:${G}`,Y,Q)},waitForHealth:async(G)=>{await z4i(`http://127.0.0.1:${G}`)},maxSandboxes:20,onEvent:i.monitor?.onEvent}),w=await LVu({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=oHu({provider:$}),_=async()=>{let G=await q2({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 rVu(i.dataDir),h=process.env.npm_package_version??"0.0.0",D=await UHi(),g=qVu(D,{onChange:(G)=>{console.log(`[link-daemon] capabilities detected: +${G.join(",")} (now: ${D.join(",")})`)}}),O=vQi({path:`${i.dataDir}/link/outbox.sqlite`});O.clear();let Z=()=>{},B=new AbortController,y={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 F=await IVu(y);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(`
|
|
81248
|
-
Shutting down\u2026`),g();try{await F.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()},F.closed.then(()=>{if(i.monitor?.onCluster?.("closed"),!I)console.error("Cluster connection closed permanently; exiting."),j()});let A=lru({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 vru=N(()=>{lQi();WC();VHu();aHu();sHu();hQi();AVu();QVu();VVu();mVu();YC();PHi();cru();dru()});function xHi(i){return i.map((u)=>typeof u==="string"?u:String(u)).join(" ")}var H1i;var IHi=N(()=>{H1i={name:"decocms",version:"3.110.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/shadcn":"^6.6.2","@rjsf/utils":"^6.6.2","@rjsf/validator-ajv8":"^6.6.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/google.maps":"^3.65.2","@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 DM={};Li(DM,{printBanner:()=>AHt,bannerLines:()=>hru,BANNER_LINES:()=>b1i,BANNER_GRADIENT:()=>R1i});function IHt(i){let u=Number.parseInt(i.slice(1),16);return[u>>16&255,u>>8&255,u&255]}function hru(i){let u=b1i.map((t,f)=>{let[l,c,E]=IHt(R1i[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 AHt(i){console.log("");for(let u of hru(i))console.log(u);console.log("")}var b1i,R1i;var xY=N(()=>{b1i=[" \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 "],R1i=["#00ff64","#00ee5e","#00dc56","#00c84e","#00b444","#00a03c","#008832","#006e28"]});import{Box as nHt,Text as Dru}from"ink";import{jsx as GHt,jsxs as gru}from"react/jsx-runtime";function C1i({version:i}){return gru(nHt,{flexDirection:"column",marginTop:1,children:[b1i.map((u,t)=>GHt(Dru,{color:R1i[t],children:u},t)),gru(Dru,{dimColor:!0,children:[" v",i]})]})}var AHi=N(()=>{xY()});function Nru(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 IY(i){return[...i.values()].map((u)=>u.handle).sort((u,t)=>u.localeCompare(t))}function Oru(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 Zru(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 jHi={};Li(jHi,{subscribeLinkState:()=>nHi,setSelectedHandle:()=>GHi,setRemoving:()=>V1i,setPersistedSandboxes:()=>QHt,setPendingConfirm:()=>NM,setMachine:()=>SHt,setLogPath:()=>WHt,setLinkActions:()=>LHt,setIngress:()=>KHt,setDaemonError:()=>YHt,setClusterUrl:()=>JHt,setCluster:()=>XHt,setActionError:()=>q1i,resetLinkStateForTests:()=>HHt,removeSandboxRow:()=>kHi,pushSandboxEvent:()=>zHt,getLinkState:()=>gM,applySandboxEvent:()=>Bru});function jHt(i){return i==="spawning"||i==="ready"||i==="failed"}function Bru(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 yru(){return{cluster:"connecting",clusterUrl:null,ingressUrl:null,ingressPort:null,machine:null,cap:kHt,sandboxes:new Map,daemonError:null,logPath:null,selectedHandle:null,pendingConfirm:null,removingHandles:new Set,actionError:null,actions:null}}function J$(){for(let i of M1i)i()}function gM(){return tf}function nHi(i){return M1i.add(i),()=>M1i.delete(i)}function XHt(i){tf={...tf,cluster:i},J$()}function JHt(i){tf={...tf,clusterUrl:i},J$()}function KHt(i,u){tf={...tf,ingressPort:i,ingressUrl:u},J$()}function SHt(i){tf={...tf,machine:i},J$()}function YHt(i){tf={...tf,daemonError:i},J$()}function WHt(i){tf={...tf,logPath:i},J$()}function GHi(i){tf={...tf,selectedHandle:i},J$()}function NM(i){tf={...tf,pendingConfirm:i},J$()}function q1i(i){tf={...tf,actionError:i},J$()}function V1i(i,u){if(tf.removingHandles.has(i)===u)return;let t=new Set(tf.removingHandles);if(u)t.add(i);else t.delete(i);tf={...tf,removingHandles:t},J$()}function LHt(i){tf={...tf,actions:i},J$()}function kHi(i){let u=IY(tf.sandboxes),t=Zru(u,i,tf.selectedHandle),f=new Map(tf.sandboxes);f.delete(i);let l=new Set(tf.removingHandles);l.delete(i),tf={...tf,sandboxes:f,selectedHandle:t,pendingConfirm:null,removingHandles:l},J$()}function QHt(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 tf.sandboxes)if(jHt(f.status))u.set(t,f);tf={...tf,sandboxes:u},J$()}function zHt(i){tf={...tf,sandboxes:Bru(tf.sandboxes,i)},J$()}function HHt(){tf=yru(),M1i.clear()}var kHt=20,tf,M1i;var OM=N(()=>{tf=yru(),M1i=new Set});import{spawn as bHt}from"child_process";function RHt(i){if(i==="darwin")return"open";if(i==="win32")return"start";return"xdg-open"}function Fru(i,u=process.platform){let t=RHt(u);try{bHt(t,[i],{stdio:"ignore",detached:!0}).unref()}catch{}}var Tru=()=>{};function Uru(i,u={}){let t=u.openUrl??Fru,f=gM(),l=IY(f.sandboxes),c=f.selectedHandle!==null&&l.includes(f.selectedHandle)?f.selectedHandle:l[0]??null,E=f.actions;switch(i.type){case"move":GHi(Oru(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);q1i(null),NM({handle:c,branch:$?.branch??w?.branch??null,dirtyCount:$?.dirtyCount??0,merged:$?.merged??null});return}case"confirmYes":{let $=f.pendingConfirm;if(NM(null),$===null||!E)return;V1i($.handle,!0),E.removeSandbox($.handle).then((w)=>{if(w.ok)kHi($.handle);else V1i($.handle,!1),q1i(w.error)});return}case"confirmNo":NM(null);return;case"quit":if(E)E.quit();return}}var Pru=N(()=>{OM();Tru()});function xru(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 Iru={};Li(Iru,{LinkApp:()=>VHt});import{Box as H1,Text as cl,useInput as CHt}from"ink";import{useSyncExternalStore as MHt}from"react";import{jsx as xf,jsxs as v_}from"react/jsx-runtime";function qHt(i,u){if(u)return{color:"yellow",text:"\u25CC Removing\u2026"};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 VHt(){let i=MHt(nHi,gM),u=[...i.sandboxes.values()].sort((l,c)=>l.handle.localeCompare(c.handle)),t=IY(i.sandboxes),f=i.selectedHandle!==null&&t.includes(i.selectedHandle)?i.selectedHandle:t[0]??null;return CHt((l,c)=>{let E=xru(l,c,i.pendingConfirm!==null);if(E!==null)Uru(E)}),v_(H1,{flexDirection:"column",children:[xf(C1i,{version:H1i.version}),xf(H1,{marginBottom:1,children:xf(cl,{dimColor:!0,children:"\u2500".repeat(80)})}),xf(H1,{children:i.cluster==="linked"?v_(cl,{color:"green",children:["\u2713 Connected to ",i.clusterUrl??"deco"]}):i.cluster==="connecting"?v_(cl,{color:"yellow",children:["\u25CC Connecting to ",i.clusterUrl??"deco","\u2026"]}):v_(cl,{color:"red",children:["\u2717 Disconnected from ",i.clusterUrl??"deco"]})}),xf(H1,{children:i.ingressUrl?v_(cl,{color:"green",children:["\u2713 Serving at ",i.ingressUrl]}):xf(cl,{dimColor:!0,children:"\u25CC Starting local server\u2026"})}),xf(H1,{marginBottom:1,children:xf(cl,{dimColor:!0,children:`${"Computer".padEnd(16)}${i.machine??"this computer"} \xB7 ${u.length} of ${i.cap} previews`})}),u.length===0?xf(cl,{dimColor:!0,children:"No previews running yet."}):v_(H1,{flexDirection:"column",children:[v_(H1,{children:[xf(H1,{width:2,flexShrink:0}),xf(H1,{width:AY.project,flexShrink:0,marginRight:1,children:xf(cl,{dimColor:!0,wrap:"truncate-end",children:"PROJECT"})}),xf(H1,{width:AY.branch,flexShrink:0,marginRight:1,children:xf(cl,{dimColor:!0,wrap:"truncate-end",children:"BRANCH"})}),xf(H1,{width:AY.status,flexShrink:0,marginRight:1,children:xf(cl,{dimColor:!0,wrap:"truncate-end",children:"STATUS"})}),xf(H1,{flexGrow:1,children:xf(cl,{dimColor:!0,wrap:"truncate-end",children:"PREVIEW URL"})})]}),u.map((l)=>{let c=qHt(l,i.removingHandles.has(l.handle)),E=l.handle===f;return v_(H1,{children:[xf(H1,{width:2,flexShrink:0,children:xf(cl,{color:"cyan",children:E?"\u203A":" "})}),xf(H1,{width:AY.project,flexShrink:0,marginRight:1,children:xf(cl,{bold:E,wrap:"truncate-end",children:l.projectName??l.handle})}),xf(H1,{width:AY.branch,flexShrink:0,marginRight:1,children:xf(cl,{bold:E,wrap:"truncate-end",children:l.branch??"\u2014"})}),xf(H1,{width:AY.status,flexShrink:0,marginRight:1,children:xf(cl,{color:c.color,bold:E,wrap:"truncate-end",children:c.text})}),xf(H1,{flexGrow:1,children:xf(cl,{dimColor:!0,wrap:"truncate-end",children:l.previewUrl??"\u2014"})})]},l.handle)})]}),i.daemonError?xf(H1,{marginTop:1,children:v_(cl,{color:"red",children:["\u26A0 ",i.daemonError]})}):null,i.logPath?xf(H1,{marginTop:1,children:v_(cl,{dimColor:!0,children:["Logs: ",i.logPath]})}):null,i.pendingConfirm?xf(H1,{marginTop:1,children:xf(cl,{color:"yellow",children:Nru(i.pendingConfirm)})}):null,i.actionError?xf(H1,{marginTop:1,children:v_(cl,{color:"red",children:["\u2717 ",i.actionError]})}):null,xf(H1,{marginTop:1,children:xf(cl,{dimColor:!0,children:"\u2191\u2193 move \xB7 s stop \xB7 d delete \xB7 o open \xB7 q quit"})})]})}var AY;var Aru=N(()=>{IHi();AHi();Pru();OM();AY={project:18,branch:22,status:14}});var nru={};Li(nru,{runLinkCommand:()=>ibt});import{closeSync as rHt,mkdirSync as mHt,openSync as eHt,writeSync as aHt}from"fs";import{homedir as oHt}from"os";import{join as XHi}from"path";function sHt(i,u){let t={log:console.log,warn:console.warn,error:console.error},f=(l)=>{if(u===void 0)return;try{aHt(u,`${xHi(l)}
|
|
81267
|
+
Shutting down\u2026`),g();try{await F.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()},F.closed.then(()=>{if(i.monitor?.onCluster?.("closed"),!I)console.error("Cluster connection closed permanently; exiting."),j()});let A=lru({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 vru=N(()=>{lQi();WC();VHu();aHu();sHu();hQi();AVu();QVu();VVu();mVu();YC();PHi();cru();dru()});function xHi(i){return i.map((u)=>typeof u==="string"?u:String(u)).join(" ")}var H1i;var IHi=N(()=>{H1i={name:"decocms",version:"3.112.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","@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","@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",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","use-stick-to-bottom":"^1.1.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/shadcn":"^6.6.2","@rjsf/utils":"^6.6.2","@rjsf/validator-ajv8":"^6.6.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/google.maps":"^3.65.2","@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 DM={};Li(DM,{printBanner:()=>AHt,bannerLines:()=>hru,BANNER_LINES:()=>b1i,BANNER_GRADIENT:()=>R1i});function IHt(i){let u=Number.parseInt(i.slice(1),16);return[u>>16&255,u>>8&255,u&255]}function hru(i){let u=b1i.map((t,f)=>{let[l,c,E]=IHt(R1i[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 AHt(i){console.log("");for(let u of hru(i))console.log(u);console.log("")}var b1i,R1i;var xY=N(()=>{b1i=[" \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 "],R1i=["#00ff64","#00ee5e","#00dc56","#00c84e","#00b444","#00a03c","#008832","#006e28"]});import{Box as nHt,Text as Dru}from"ink";import{jsx as GHt,jsxs as gru}from"react/jsx-runtime";function C1i({version:i}){return gru(nHt,{flexDirection:"column",marginTop:1,children:[b1i.map((u,t)=>GHt(Dru,{color:R1i[t],children:u},t)),gru(Dru,{dimColor:!0,children:[" v",i]})]})}var AHi=N(()=>{xY()});function Nru(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 IY(i){return[...i.values()].map((u)=>u.handle).sort((u,t)=>u.localeCompare(t))}function Oru(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 Zru(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 jHi={};Li(jHi,{subscribeLinkState:()=>nHi,setSelectedHandle:()=>GHi,setRemoving:()=>V1i,setPersistedSandboxes:()=>QHt,setPendingConfirm:()=>NM,setMachine:()=>SHt,setLogPath:()=>WHt,setLinkActions:()=>LHt,setIngress:()=>KHt,setDaemonError:()=>YHt,setClusterUrl:()=>JHt,setCluster:()=>XHt,setActionError:()=>q1i,resetLinkStateForTests:()=>HHt,removeSandboxRow:()=>kHi,pushSandboxEvent:()=>zHt,getLinkState:()=>gM,applySandboxEvent:()=>Bru});function jHt(i){return i==="spawning"||i==="ready"||i==="failed"}function Bru(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 yru(){return{cluster:"connecting",clusterUrl:null,ingressUrl:null,ingressPort:null,machine:null,cap:kHt,sandboxes:new Map,daemonError:null,logPath:null,selectedHandle:null,pendingConfirm:null,removingHandles:new Set,actionError:null,actions:null}}function J$(){for(let i of M1i)i()}function gM(){return tf}function nHi(i){return M1i.add(i),()=>M1i.delete(i)}function XHt(i){tf={...tf,cluster:i},J$()}function JHt(i){tf={...tf,clusterUrl:i},J$()}function KHt(i,u){tf={...tf,ingressPort:i,ingressUrl:u},J$()}function SHt(i){tf={...tf,machine:i},J$()}function YHt(i){tf={...tf,daemonError:i},J$()}function WHt(i){tf={...tf,logPath:i},J$()}function GHi(i){tf={...tf,selectedHandle:i},J$()}function NM(i){tf={...tf,pendingConfirm:i},J$()}function q1i(i){tf={...tf,actionError:i},J$()}function V1i(i,u){if(tf.removingHandles.has(i)===u)return;let t=new Set(tf.removingHandles);if(u)t.add(i);else t.delete(i);tf={...tf,removingHandles:t},J$()}function LHt(i){tf={...tf,actions:i},J$()}function kHi(i){let u=IY(tf.sandboxes),t=Zru(u,i,tf.selectedHandle),f=new Map(tf.sandboxes);f.delete(i);let l=new Set(tf.removingHandles);l.delete(i),tf={...tf,sandboxes:f,selectedHandle:t,pendingConfirm:null,removingHandles:l},J$()}function QHt(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 tf.sandboxes)if(jHt(f.status))u.set(t,f);tf={...tf,sandboxes:u},J$()}function zHt(i){tf={...tf,sandboxes:Bru(tf.sandboxes,i)},J$()}function HHt(){tf=yru(),M1i.clear()}var kHt=20,tf,M1i;var OM=N(()=>{tf=yru(),M1i=new Set});import{spawn as bHt}from"child_process";function RHt(i){if(i==="darwin")return"open";if(i==="win32")return"start";return"xdg-open"}function Fru(i,u=process.platform){let t=RHt(u);try{bHt(t,[i],{stdio:"ignore",detached:!0}).unref()}catch{}}var Tru=()=>{};function Uru(i,u={}){let t=u.openUrl??Fru,f=gM(),l=IY(f.sandboxes),c=f.selectedHandle!==null&&l.includes(f.selectedHandle)?f.selectedHandle:l[0]??null,E=f.actions;switch(i.type){case"move":GHi(Oru(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);q1i(null),NM({handle:c,branch:$?.branch??w?.branch??null,dirtyCount:$?.dirtyCount??0,merged:$?.merged??null});return}case"confirmYes":{let $=f.pendingConfirm;if(NM(null),$===null||!E)return;V1i($.handle,!0),E.removeSandbox($.handle).then((w)=>{if(w.ok)kHi($.handle);else V1i($.handle,!1),q1i(w.error)});return}case"confirmNo":NM(null);return;case"quit":if(E)E.quit();return}}var Pru=N(()=>{OM();Tru()});function xru(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 Iru={};Li(Iru,{LinkApp:()=>VHt});import{Box as H1,Text as cl,useInput as CHt}from"ink";import{useSyncExternalStore as MHt}from"react";import{jsx as xf,jsxs as v_}from"react/jsx-runtime";function qHt(i,u){if(u)return{color:"yellow",text:"\u25CC Removing\u2026"};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 VHt(){let i=MHt(nHi,gM),u=[...i.sandboxes.values()].sort((l,c)=>l.handle.localeCompare(c.handle)),t=IY(i.sandboxes),f=i.selectedHandle!==null&&t.includes(i.selectedHandle)?i.selectedHandle:t[0]??null;return CHt((l,c)=>{let E=xru(l,c,i.pendingConfirm!==null);if(E!==null)Uru(E)}),v_(H1,{flexDirection:"column",children:[xf(C1i,{version:H1i.version}),xf(H1,{marginBottom:1,children:xf(cl,{dimColor:!0,children:"\u2500".repeat(80)})}),xf(H1,{children:i.cluster==="linked"?v_(cl,{color:"green",children:["\u2713 Connected to ",i.clusterUrl??"deco"]}):i.cluster==="connecting"?v_(cl,{color:"yellow",children:["\u25CC Connecting to ",i.clusterUrl??"deco","\u2026"]}):v_(cl,{color:"red",children:["\u2717 Disconnected from ",i.clusterUrl??"deco"]})}),xf(H1,{children:i.ingressUrl?v_(cl,{color:"green",children:["\u2713 Serving at ",i.ingressUrl]}):xf(cl,{dimColor:!0,children:"\u25CC Starting local server\u2026"})}),xf(H1,{marginBottom:1,children:xf(cl,{dimColor:!0,children:`${"Computer".padEnd(16)}${i.machine??"this computer"} \xB7 ${u.length} of ${i.cap} previews`})}),u.length===0?xf(cl,{dimColor:!0,children:"No previews running yet."}):v_(H1,{flexDirection:"column",children:[v_(H1,{children:[xf(H1,{width:2,flexShrink:0}),xf(H1,{width:AY.project,flexShrink:0,marginRight:1,children:xf(cl,{dimColor:!0,wrap:"truncate-end",children:"PROJECT"})}),xf(H1,{width:AY.branch,flexShrink:0,marginRight:1,children:xf(cl,{dimColor:!0,wrap:"truncate-end",children:"BRANCH"})}),xf(H1,{width:AY.status,flexShrink:0,marginRight:1,children:xf(cl,{dimColor:!0,wrap:"truncate-end",children:"STATUS"})}),xf(H1,{flexGrow:1,children:xf(cl,{dimColor:!0,wrap:"truncate-end",children:"PREVIEW URL"})})]}),u.map((l)=>{let c=qHt(l,i.removingHandles.has(l.handle)),E=l.handle===f;return v_(H1,{children:[xf(H1,{width:2,flexShrink:0,children:xf(cl,{color:"cyan",children:E?"\u203A":" "})}),xf(H1,{width:AY.project,flexShrink:0,marginRight:1,children:xf(cl,{bold:E,wrap:"truncate-end",children:l.projectName??l.handle})}),xf(H1,{width:AY.branch,flexShrink:0,marginRight:1,children:xf(cl,{bold:E,wrap:"truncate-end",children:l.branch??"\u2014"})}),xf(H1,{width:AY.status,flexShrink:0,marginRight:1,children:xf(cl,{color:c.color,bold:E,wrap:"truncate-end",children:c.text})}),xf(H1,{flexGrow:1,children:xf(cl,{dimColor:!0,wrap:"truncate-end",children:l.previewUrl??"\u2014"})})]},l.handle)})]}),i.daemonError?xf(H1,{marginTop:1,children:v_(cl,{color:"red",children:["\u26A0 ",i.daemonError]})}):null,i.logPath?xf(H1,{marginTop:1,children:v_(cl,{dimColor:!0,children:["Logs: ",i.logPath]})}):null,i.pendingConfirm?xf(H1,{marginTop:1,children:xf(cl,{color:"yellow",children:Nru(i.pendingConfirm)})}):null,i.actionError?xf(H1,{marginTop:1,children:v_(cl,{color:"red",children:["\u2717 ",i.actionError]})}):null,xf(H1,{marginTop:1,children:xf(cl,{dimColor:!0,children:"\u2191\u2193 move \xB7 s stop \xB7 d delete \xB7 o open \xB7 q quit"})})]})}var AY;var Aru=N(()=>{IHi();AHi();Pru();OM();AY={project:18,branch:22,status:14}});var nru={};Li(nru,{runLinkCommand:()=>ibt});import{closeSync as rHt,mkdirSync as mHt,openSync as eHt,writeSync as aHt}from"fs";import{homedir as oHt}from"os";import{join as XHi}from"path";function sHt(i,u){let t={log:console.log,warn:console.warn,error:console.error},f=(l)=>{if(u===void 0)return;try{aHt(u,`${xHi(l)}
|
|
81249
81268
|
`)}catch{}};return console.log=(...l)=>f(l),console.warn=(...l)=>f(l),console.error=(...l)=>{f(l),i(xHi(l))},()=>{console.log=t.log,console.warn=t.warn,console.error=t.error}}async function pHt(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 ibt(i={}){let u=i.port??5174,t=i.dataDir??process.env.DATA_DIR??process.env.DECOCMS_HOME??XHi(oHt(),"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=XHi(t,"sandboxes");E=z1i({path:Q1i(t),managedSandboxRoot:w});let d=await Y4i({dataDir:t,intent:"Link",target:f});if(process.env.DECOCMS_LINK_MANAGED!=="1")await pHt(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(() => (Aru(),Iru)),{pushSandboxEvent:B,setCluster:y,setClusterUrl:F,setDaemonError:T,setIngress:U,setLogPath:I,setMachine:j,setPersistedSandboxes:A}=await Promise.resolve().then(() => (OM(),jHi));mHt(t,{recursive:!0});let G=XHi(t,"link.log");c=eHt(G,"w"),I(G),A(_),F(f),y("connecting"),v={onEvent:(q)=>B(q),onIngress:(q)=>U(q,`http://127.0.0.1:${q}`),onCluster:(q)=>y(q),onMachine:(q)=>j(q)},l=sHt(T,c),g(O(Z),{patchConsole:!1})}else if(i.banner!==!1){let{printBanner:g}=await Promise.resolve().then(() => (xY(),DM));g(i.version??"0.0.0")}$();let h=process.env.DECOCMS_LINK_MANAGED!=="1",D=await _ru({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(() => (OM(),jHi));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{rHt(c)}catch{}$()}}var Gru=N(()=>{fQi();vru();PHi()});var LHi={};Li(LHi,{resolveDevLinkClusterUrl:()=>lbt,populateDevLinkToxiProxy:()=>Sru,isDevLinkToxiProxyEnabled:()=>fbt,ensureDevLinkToxiProxy:()=>dbt,buildDevLinkToxiProxyConfig:()=>Jru,DEV_LINK_TOXIPROXY_SERVICE_NAME:()=>jru,DEV_LINK_TOXIPROXY_PROXY_NAME:()=>Xru});function fbt(i=process.env){return i.DECO_DEV_LINK_TOXIPROXY==="1"}function JHi(i,u){if(!Number.isInteger(i)||i<1||i>65535)throw Error(`${u} must be an integer port in 1..65535`);return i}function Jru(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=JHi(i.apiPort,"apiPort"),f=JHi(i.listenPort,"listenPort");if(u.port.length===0)throw Error("serverUrl must include an explicit valid port");let l=JHi(Number.parseInt(u.port,10),"upstreamPort"),c=`http://127.0.0.1:${l}`,E=`http://127.0.0.1:${f}`;return{serviceName:jru,proxyName:Xru,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 lbt(i){return i.toxiproxy?.clusterUrl??i.serverUrl}async function KHi(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 WHi(i){if(i instanceof Error)return i.name==="Error"?i.message:`${i.name}: ${i.message}`;return String(i)}function Kru(i){if(!(i instanceof Error))return!1;if(i.name==="TimeoutError")return!0;return Kru(i.cause)}async function SHi(i,u,t,f){try{return await i(t,f)}catch(l){throw Error(`ToxiProxy ${u} failed for ${t}: ${WHi(l)}`,{cause:l})}}async function Sru(i,u=fetch){let t=`${i.apiUrl}/reset`,f=await SHi(u,"reset",t,{method:"POST"});await KHi(f,"reset",t);let l=`${i.apiUrl}/populate`,c=await SHi(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 KHi(c,"populate",l)}async function cbt(i,u){let t=`${i.apiUrl}/version`;try{await u6(async()=>{let f=await SHi(u,"readiness check",t,{method:"GET",signal:AbortSignal.timeout(tbt)});await KHi(f,"readiness check",t)},{maxAttempts:ubt,minTimeout:kru,maxTimeout:kru,multiplier:1,jitter:0,isRetriable:(f)=>!Kru(f)})}catch(f){let l=f instanceof J6?f.cause:f;throw Error(`ToxiProxy API did not become ready at ${t}: ${WHi(l)}`,{cause:l})}}async function Ebt(i){if(i===null)return"";return await new Response(i).text()}async function YHi(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}): ${WHi($)}`,{cause:$})}})(),[l,c]=await Promise.all([f.exited,Ebt(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 $bt(i,u){let t=`deco-dev-link-toxiproxy-${i}`;await YHi(["rm","-f",t],{ignoreFailure:!0}),await YHi(["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 wbt(i,u){let t=`deco-dev-link-toxiproxy-${i}`;await YHi(["rm","-f",t],{ignoreFailure:!0})}async function dbt(i){let u=Jru(i),t=i.startDaemon??$bt,f=i.stopDaemon??(i.startDaemon===void 0?wbt:void 0);await t(i.apiPort,i.listenPort);let l=i.fetchImpl??fetch;try{await cbt(u,l),await Sru(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 jru="ToxiProxy",Xru="dev_link_studio",ubt=20,kru=100,tbt=100;var QHi=N(()=>{Bl()});var Yru={};Li(Yru,{migrateBetterAuth:()=>zHi});import{getMigrations as _bt}from"better-auth/db";import{sso as vbt}from"@better-auth/sso";import{organization as hbt}from"@decocms/better-auth/plugins";import{admin as Dbt,apiKey as gbt,jwt as Nbt,magicLink as Obt,mcp as Zbt,openAPI as Bbt}from"better-auth/plugins";import{emailOTP as ybt}from"better-auth/plugins/email-otp";async function zHi(i){let t={database:kC(i||b2()),plugins:[hbt({dynamicAccessControl:{enabled:!0,enableCustomResources:!0}}),Dbt(),gbt(),Nbt(),Bbt(),Zbt({loginPage:"/login"}),vbt(),Obt({sendMagicLink:async()=>{}}),ybt({sendVerificationOTP:async()=>{}})]},{toBeAdded:f,toBeCreated:l,runMigrations:c}=await _bt(t);if(!f.length&&!l.length)return"up to date";return await c(),`${l.length+f.length} table(s) migrated`}var HHi=N(()=>{QE()});var bHi={};Li(bHi,{up:()=>Fbt,down:()=>Tbt});import{sql as a5}from"kysely";async function Fbt(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(a5`CURRENT_TIMESTAMP`)).addColumn("updatedAt","text",(u)=>u.notNull().defaultTo(a5`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(a5`CURRENT_TIMESTAMP`)).addColumn("updatedAt","text",(u)=>u.notNull().defaultTo(a5`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(a5`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(a5`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(a5`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(a5`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(a5`CURRENT_TIMESTAMP`)).addColumn("updatedAt","text",(u)=>u.notNull().defaultTo(a5`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 Tbt(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 Wru=()=>{};var RHi={};Li(RHi,{up:()=>Ubt,down:()=>Pbt});import{sql as Lru}from"kysely";async function Ubt(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(Lru`CURRENT_TIMESTAMP`)).addColumn("updatedAt","text",(u)=>u.notNull().defaultTo(Lru`CURRENT_TIMESTAMP`)).execute()}async function Pbt(i){await i.schema.dropTable("organization_settings").execute()}var Qru=()=>{};var CHi={};Li(CHi,{up:()=>xbt,down:()=>Ibt});async function xbt(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 Ibt(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 MHi={};Li(MHi,{up:()=>Abt,down:()=>nbt});async function Abt(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 nbt(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 qHi={};Li(qHi,{up:()=>Gbt,down:()=>kbt});async function Gbt(i){await i.schema.alterTable("connections").addColumn("configuration_state","text").execute(),await i.schema.alterTable("connections").addColumn("configuration_scopes","text").execute()}async function kbt(i){await i.schema.alterTable("connections").dropColumn("configuration_state").execute(),await i.schema.alterTable("connections").dropColumn("configuration_scopes").execute()}var VHi={};Li(VHi,{up:()=>Xbt,down:()=>Jbt});import{sql as jbt}from"kysely";async function Xbt(i){await i.schema.alterTable("organization_settings").addColumn("sidebar_items",jbt`text`).execute()}async function Jbt(i){await i.schema.alterTable("organization_settings").dropColumn("sidebar_items").execute()}var zru=()=>{};var rHi={};Li(rHi,{up:()=>Kbt,down:()=>Sbt});async function Kbt(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 Sbt(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 mHi={};Li(mHi,{up:()=>Ybt,down:()=>Wbt});import{sql as ZM}from"kysely";async function Ybt(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(ZM`CURRENT_TIMESTAMP`)).addColumn("updated_at","text",(u)=>u.notNull().defaultTo(ZM`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(ZM`CURRENT_TIMESTAMP`)).addColumn("updated_at","text",(u)=>u.notNull().defaultTo(ZM`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(ZM`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 Wbt(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 Hru=()=>{};var eHi={};Li(eHi,{up:()=>Qbt,down:()=>zbt});import{sql as Lbt}from"kysely";async function Qbt(i){await i.schema.dropTable("audit_logs").ifExists().execute()}async function zbt(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(Lbt`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 bru=()=>{};var aHi={};Li(aHi,{up:()=>Hbt,down:()=>bbt});import{sql as r1i}from"kysely";async function Hbt(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(r1i`CURRENT_TIMESTAMP`)).addColumn("updated_at","text",(u)=>u.notNull().defaultTo(r1i`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(r1i`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 r1i`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 bbt(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 Rru=()=>{};var oHi={};Li(oHi,{up:()=>Rbt,down:()=>Cbt});async function Rbt(i){await i.schema.alterTable("gateways").addColumn("icon","text").execute()}async function Cbt(i){await i.schema.alterTable("gateways").dropColumn("icon").execute()}var sHi={};Li(sHi,{up:()=>Mbt,down:()=>qbt});import{sql as m1i}from"kysely";async function Mbt(i){await i.schema.alterTable("gateways").addColumn("tool_selection_mode","text",(u)=>u.notNull().defaultTo("inclusion")).execute(),await m1i`
|
|
81250
81269
|
UPDATE gateways
|
|
81251
81270
|
SET tool_selection_mode = CASE
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "decocms",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.112.0",
|
|
4
4
|
"description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
|
|
5
5
|
"author": "Deco team",
|
|
6
6
|
"repository": {
|
|
@@ -63,6 +63,10 @@
|
|
|
63
63
|
"@dnd-kit/utilities": "^3.2.2",
|
|
64
64
|
"@inkjs/ui": "^2.0.0",
|
|
65
65
|
"@modelcontextprotocol/ext-apps": "^1.7.1",
|
|
66
|
+
"@nats-io/jetstream": "3.4.0",
|
|
67
|
+
"@nats-io/kv": "3.4.0",
|
|
68
|
+
"@nats-io/nats-core": "3.4.0",
|
|
69
|
+
"@nats-io/transport-node": "3.4.0",
|
|
66
70
|
"@openrouter/ai-sdk-provider": "^2.9.1",
|
|
67
71
|
"@opentelemetry/core": "^2.6.0",
|
|
68
72
|
"@tanstack/react-virtual": "3.13.24",
|
|
@@ -70,16 +74,13 @@
|
|
|
70
74
|
"@xterm/xterm": "^6.0.0",
|
|
71
75
|
"embedded-postgres": "^18.3.0-beta.16",
|
|
72
76
|
"ink": "^6.8.0",
|
|
73
|
-
"@nats-io/jetstream": "3.4.0",
|
|
74
|
-
"@nats-io/kv": "3.4.0",
|
|
75
|
-
"@nats-io/nats-core": "3.4.0",
|
|
76
|
-
"@nats-io/transport-node": "3.4.0",
|
|
77
77
|
"kysely": "^0.28.12",
|
|
78
78
|
"node-pty": "^1.0.0",
|
|
79
79
|
"posthog-js": "^1.371.1",
|
|
80
80
|
"posthog-node": "^5.0.0",
|
|
81
81
|
"react": "^19.2.6",
|
|
82
|
-
"react-dom": "^19.2.6"
|
|
82
|
+
"react-dom": "^19.2.6",
|
|
83
|
+
"use-stick-to-bottom": "^1.1.6"
|
|
83
84
|
},
|
|
84
85
|
"devDependencies": {
|
|
85
86
|
"@ai-sdk/provider": "^3.0.10",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as G,r as S,l as J,j as t,B as U,i as Q,t as I}from"./index-NHU49YBK.js";import{i as X}from"./XCircle-DEac6B60.js";import{aB as Y,V as T}from"./agent-icon-z9a7P-VJ.js";import{n as Z}from"./LinkExternal01-CfgaruN6.js";import{f as _,a as K,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-6mhzPWM-.js";import{I as L}from"./input-BM2AMR43.js";import{L as M}from"./label-D5BdX0dr.js";import{au as at,av as nt,aD as mt,at as lt,aw as R,ay as pt,aE as ct}from"./index-Cer6DaC0.js";import{c as dt,B as ut,a as gt}from"./block-document-D447TgwM.js";import{u as xt,s as v,E as ft}from"./primitives-DzrgzW9n.js";import{t as ht}from"./ChevronDown-G62nfa2N.js";import{f as yt,h as jt,e as vt}from"./scroll-area-DFJYrpdW.js";import"./AlertCircle-3a42Y32Q.js";import"./Tool01-D8z2EmLx.js";import"./SwitchHorizontal01-3qBzKHi7.js";import"./Settings02-DQ036CAG.js";import"./ArrowUpRight-kXfJCOtG.js";import"./ZapSquare-CxU3wnk2.js";import"./Users03-DnUEh8JP.js";import"./CheckCircle-n8jdawLU.js";import"./ChevronUp-CvLg0JD0.js";import"./ChevronLeft-BFEbzxr2.js";import"./ChevronRight-_-iVnMDM.js";import"./DotsVertical-Cwultgek.js";import"./Stars02-jjLUIqwc.js";import"./Eye-DvWAO5gf.js";import"./ZoomOut-CXIIR5Xs.js";import"./Globe01-CDttDk96.js";import"./FilterLines-BHkqBGr7.js";import"./Star01-BDb11yyu.js";import"./Globe04-DB_Sdapa.js";import"./HardDrive-DMH3VLW5.js";import"./Key01-PPoquOD0.js";import"./LayoutLeft-Ddkt9171.js";import"./Monitor01-DH6AP0w9.js";import"./Sun-BuMidyKX.js";import"./Palette-FlQGtYwX.js";import"./Play-ehXX0Q38.js";import"./Plus-Dx_wxVWe.js";import"./SearchLg-C7qnbpDa.js";import"./SearchMd-BLh-9N8v.js";import"./Shield01-CjUxgjnh.js";import"./Stars01-VH93BVY_.js";import"./Trash01-wsF4DycC.js";import"./Upload01-Dq8q0rQz.js";import"./User01-Ddj-LeQV.js";import"./Users01-DwZAeWye.js";import"./XClose-DoitZjeT.js";import"./X-DRAd27QV.js";import"./Zap-BeCXSxio.js";import"./index-BHCX-9ZH.js";import"./chat-context-BYQB5zQ3.js";import"./hooks-E0hrfxwb.js";import"./use-mcp-client-BGOUlx-P.js";import"./auth-DI4UdzcA.js";import"./decopilot-sse-pool-D0AHvthA.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CE3-zMFE.js";import"./use-collections-D-agNER0.js";import"./use-ai-providers-CNL3O4hK.js";import"./studio-tools-B3ETtzpq.js";import"./use-decopilot-events-T9FNzBJ-.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-D3N4P1sO.js";import"./tooltip-DNOJd4mB.js";import"./dialog-DI9uZOw1.js";import"./drawer-BpieeJCx.js";import"./collection-search-VqRze0Jz.js";import"./use-mobile-BdtUaG2t.js";import"./use-mcp-prompts-CRVg9LFk.js";import"./shell-layout-B3LSdloo.js";import"./avatar-B1XYxCEI.js";import"./required-auth-layout-CVZjAF6p.js";import"./use-org-sso-D4XCcGiP.js";import"./form-Bz2znigu.js";import"./select-DTXnEmNM.js";import"./tabs-ByKhbrL3.js";import"./toggle-group-DRPAcqSk.js";import"./sortable.esm-D8Xq7o-p.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DxDSEKb0.js";import"./use-registry-connections-BerlzPAj.js";import"./use-connection-D5Yn6X1k.js";import"./useInfiniteQuery-D57fVIoS.js";import"./use-infinite-scroll-Bv5wQ7Wg.js";import"./extract-connection-data-CWyRtB18.js";import"./card-cvfFGOFn.js";import"./integration-icon-B5YbyPfI.js";import"./collection-tabs-BPPqRvP7.js";import"./badge-BENqSIMW.js";import"./textarea-C2v8p5Q_.js";import"./connection-form-helpers-Bfw04B7m.js";import"./authenticate-and-persist-oauth-DFUhqBKz.js";import"./mcp-oauth-CELJ6lWl.js";import"./useSuspenseInfiniteQuery-DEsj7KSO.js";import"./connect-desktop-dialog-BCCJMJVg.js";import"./decopilot-Dr8wUhH8.js";import"./checkbox-CExBS06F.js";import"./skeleton-Dhj_RMRP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-C05qMf5J.js";import"./popover-CgDHu-zS.js";import"./command-C2FYWVqe.js";import"./index-B6lhx2Nx.js";import"./use-org-fs-CXhVHffG.js";import"./dropdown-menu-DXo7FbtM.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CjYwKkX8.js";import"./empty-state-DW4CjYnI.js";import"./toolbar-BHV_OeGM.js";import"./preview-dialog-D5E4FgCw.js";import"./index-DfC-bGLv.js";import"./file-type-icon-r28WvKg7.js";import"./use-mcp-tools-C8njypSm.js";import"./types-D8ya3q3L.js";import"./use-capability-Dok_Iq_h.js";import"./shell-route-loading-BHxQVa3P.js";import"./tools-list-DRrZln_E.js";import"./switch-yQ4MeBWb.js";import"./use-debounced-autosave-EQlvKcut.js";import"./index-CT2vaQmC.js";import"./sidebar-CUCRALlI.js";import"./sheet-Cm9vy-is.js";import"./search-input-DMv2zQbT.js";import"./github-repo-picker-8V-SSku2.js";import"./use-debounced-value-D2OoRIdo.js";import"./use-navigate-to-agent-0B1rE19_.js";import"./use-secrets-BqevFm2t.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./view-mode-toggle-CFNxBK9n.js";import"./automation-runs-FRZz1Jxo.js";import"./table-FMe6hb4W.js";import"./use-members-CEkjXPIb.js";import"./use-org-auth-client-BfIW_pQg.js";import"./task-status-CKBnAgo0.js";import"./use-automations-Cb4DxEgv.js";import"./use-file-configs-kMgI5hml.js";import"./monaco-editor-jmD3XQpJ.js";import"./select-model-D-GnzJTk.js";import"./automation-list-row-CsXsL2m3.js";import"./use-clock-tick-BHfy0ujs.js";import"./use-copy-BYD2opl9.js";import"./content-blocks-o63cs2vh.js";function bt(k){const e=G.c(18),{icon:f,title:m,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==m?(i=t.jsx("span",{className:"flex-1 text-left",children:m}),e[2]=m,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=J("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(jt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function ar({orgSlug:k,virtualMcpId:e,branch:f,blockKey:m,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=nt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:m,data:R(m,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,y]=S.useState(a),[n,C]=S.useState(null),[N,E]=S.useState(!1),$=a?mt(d).filter(o=>o.categorySlugs.includes(a)):[],j=$.length,H=o=>s("slug",o),V=async(o,w)=>{const q=v(r.name);E(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:q,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:R(P,"posts",F)}),g+=1)}const z={...r,slug:w};await i.mutateAsync({blockKey:m,data:R(m,"categories",z)}),c(z),I.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){y(o),C(null),I.error(g instanceof Error?g.message:"Rename failed")}finally{E(!1)}},W=()=>{const o=B.trim();if(o===a){B!==o&&y(o);return}if(!o){y(a);return}if(j===0){H(o);return}C({oldSlug:a,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:W,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:$.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(_,{open:!!n,onOpenChange:o=>{o||N||(y(a),C(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:n?`Changing the slug from "${n.oldSlug}" to "${n.newSlug}" will update ${n.count} ${n.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),n&&V(n.oldSlug,n.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Q,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{ar as CategoryEditor};
|