decocms 3.79.2 → 3.80.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-Diz6uT7Y.js → AlertCircle-CzPpSV3W.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Bo4YThIl.js → ArrowUpRight-BefNTATY.js} +1 -1
- package/dist/client/assets/{CheckCircle-BSFt0_RZ.js → CheckCircle-BRNW9lmT.js} +1 -1
- package/dist/client/assets/{ChevronDown-C_njLrOU.js → ChevronDown-Di-ZHzN-.js} +1 -1
- package/dist/client/assets/{ChevronLeft-ByQFERqp.js → ChevronLeft-ByolOLbh.js} +1 -1
- package/dist/client/assets/{ChevronRight-D1duQehP.js → ChevronRight-CmB8MBzZ.js} +1 -1
- package/dist/client/assets/{ChevronUp-_gM_dQkt.js → ChevronUp-BurUkCqE.js} +1 -1
- package/dist/client/assets/{DotsVertical-BJnhQ8u0.js → DotsVertical-Dsznav3Y.js} +1 -1
- package/dist/client/assets/{Eye-SUXNGsVY.js → Eye-B8NUm9Br.js} +1 -1
- package/dist/client/assets/{FilterLines-CxIQYlMz.js → FilterLines-DMbodALc.js} +1 -1
- package/dist/client/assets/{Globe01-CNw0uMhK.js → Globe01-BG9Wm5DJ.js} +1 -1
- package/dist/client/assets/{Globe04-B24hCYmg.js → Globe04-Fg_TSPLj.js} +1 -1
- package/dist/client/assets/{HardDrive-IPJJMMij.js → HardDrive-BLr46_IN.js} +1 -1
- package/dist/client/assets/{Key01-CES8n-fG.js → Key01-Dc0MTS9j.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D3mZzNi0.js → LayoutLeft-nNhAa0Dy.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B8zRpPza.js → LinkExternal01-D0OVTAOa.js} +1 -1
- package/dist/client/assets/{Monitor01-Uh-3HvZI.js → Monitor01-D_VMj6ZB.js} +1 -1
- package/dist/client/assets/{Palette-Du66341h.js → Palette-BmXFbt3l.js} +1 -1
- package/dist/client/assets/{Play-CVoFjR5I.js → Play-CAiQqhjZ.js} +1 -1
- package/dist/client/assets/{Plus-DoMNANl8.js → Plus-DHDiWYHk.js} +1 -1
- package/dist/client/assets/{SearchMd-B-bL1wjq.js → SearchMd-DaWHy1GV.js} +1 -1
- package/dist/client/assets/{Settings02-BvivcyYL.js → Settings02-B7jENSJZ.js} +1 -1
- package/dist/client/assets/{Shield01-BewRt7sw.js → Shield01-YoAzrA51.js} +1 -1
- package/dist/client/assets/{Star01-Ds91SJzA.js → Star01-CaB7lNB9.js} +1 -1
- package/dist/client/assets/{Stars01-PS518Jif.js → Stars01-a6WqibZn.js} +1 -1
- package/dist/client/assets/{Stars02-CVb_b-OZ.js → Stars02-D2Vky1vN.js} +1 -1
- package/dist/client/assets/{Sun-tLN4vA6M.js → Sun-vyxrPcie.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-vo5MpXEz.js → SwitchHorizontal01-C3K-vKiU.js} +1 -1
- package/dist/client/assets/{Tool01-BgzvuPeY.js → Tool01-CTw8qR4v.js} +1 -1
- package/dist/client/assets/{Trash01-D84eyfFz.js → Trash01-BzTEx-hS.js} +1 -1
- package/dist/client/assets/{Upload01-BA5iKtAl.js → Upload01-DwgHgRix.js} +1 -1
- package/dist/client/assets/{User01-CeCQHgwg.js → User01-BtO-AoKy.js} +1 -1
- package/dist/client/assets/{Users01-DtmLcsFN.js → Users01-BRTza8nY.js} +1 -1
- package/dist/client/assets/{Users03-ClWrctLP.js → Users03-9LUo_raC.js} +1 -1
- package/dist/client/assets/{X-2HGWB7Oo.js → X-1BuEzBGR.js} +1 -1
- package/dist/client/assets/{XCircle-B88UxHjD.js → XCircle-DtHr5hnB.js} +1 -1
- package/dist/client/assets/{XClose-DcfEQwVh.js → XClose-qpXD94Yo.js} +1 -1
- package/dist/client/assets/{Zap-BeB31T8Y.js → Zap-DluXKGP1.js} +1 -1
- package/dist/client/assets/{ZapSquare-BfSTQonf.js → ZapSquare-C2q_71C5.js} +1 -1
- package/dist/client/assets/{ZoomOut-Csc4IU4b.js → ZoomOut-DHX-bR9F.js} +1 -1
- package/dist/client/assets/{access-gate-BI-B2IAv.js → access-gate-CGKEhEok.js} +1 -1
- package/dist/client/assets/add-section-modal-SzJO4niJ.js +1 -0
- package/dist/client/assets/{agent-icon-BMQHBhP6.js → agent-icon-B8qJNw4_.js} +1 -1
- package/dist/client/assets/{agents-list-XJ_b0Boo.js → agents-list-BCVql_rD.js} +1 -1
- package/dist/client/assets/{ai-providers-BT9tXzcJ.js → ai-providers-DfbrzvnV.js} +1 -1
- package/dist/client/assets/{alert-BFF74cGy.js → alert-BdFRtqYC.js} +1 -1
- package/dist/client/assets/{alert-dialog-0uOi3HqZ.js → alert-dialog-CSRFWtbt.js} +3 -3
- package/dist/client/assets/app-editor-CSxGjHmN.js +1 -0
- package/dist/client/assets/{auth-CCI_mhgC.js → auth-DOooeHhC.js} +1 -1
- package/dist/client/assets/{auth-catchall-DFuEeSui.js → auth-catchall-esDJNOF7.js} +1 -1
- package/dist/client/assets/{auth-entry-BE0f6I0U.js → auth-entry-CJkDGWB9.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DTKSSrMT.js → auth-split-layout-BHOeLJSB.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-eSHjAd3t.js → authenticate-and-persist-oauth-CAo_oHNJ.js} +1 -1
- package/dist/client/assets/{automation-list-row-Ct9jaHYX.js → automation-list-row-CBS-1Qac.js} +1 -1
- package/dist/client/assets/automation-runs-BhCrA9zN.js +1 -0
- package/dist/client/assets/{automations-DAlCMK2H.js → automations-DgOam79q.js} +1 -1
- package/dist/client/assets/{avatar-CtVVLapD.js → avatar-BnBqk-2k.js} +1 -1
- package/dist/client/assets/{badge-BFvLiE20.js → badge-CpxlbcB7.js} +1 -1
- package/dist/client/assets/{block-document-CZwjF0EN.js → block-document-DJ0g8qfo.js} +2 -2
- package/dist/client/assets/{brand-context-Dc4UEvfb.js → brand-context-COIa0n8O.js} +1 -1
- package/dist/client/assets/{buckets-CY1G8BoT.js → buckets-BINQS-Su.js} +1 -1
- package/dist/client/assets/{capability-load-error-CNUOCvDx.js → capability-load-error-HdFgr5IE.js} +1 -1
- package/dist/client/assets/{card-DZtTT5Es.js → card-DQnbTJFb.js} +1 -1
- package/dist/client/assets/category-editor-vCwJctBK.js +1 -0
- package/dist/client/assets/{chat-context-Dqu5Dj_J.js → chat-context-CmZjYRTw.js} +1 -1
- package/dist/client/assets/{checkbox-CHXOcnVE.js → checkbox-DokO2DXd.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BSe4zAji.js → cli-auth-success-NPtl5xjH.js} +1 -1
- package/dist/client/assets/collection-detail-DgzIzvmX.js +1 -0
- package/dist/client/assets/{collection-display-button-Dn_LJLmj.js → collection-display-button-hKaFuGbc.js} +1 -1
- package/dist/client/assets/{collection-search-D6nD206z.js → collection-search-9oxtR-cY.js} +1 -1
- package/dist/client/assets/{collection-tabs-cs02GObx.js → collection-tabs-CvHGsfW_.js} +1 -1
- package/dist/client/assets/{command-DhLgZpjn.js → command-Bw5g6PzP.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CTTgJmu9.js → commerce-onboarding-QQ9bqrwx.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DNAK4U2K.js → connect-desktop-dialog-BktLGd3J.js} +1 -1
- package/dist/client/assets/{connection-card-BwnCXxRf.js → connection-card-BZz5WDR5.js} +1 -1
- package/dist/client/assets/connection-detail-DNAdeiIH.js +1 -0
- package/dist/client/assets/{connection-form-helpers-Csy5hutj.js → connection-form-helpers-CltinQul.js} +1 -1
- package/dist/client/assets/connections-BSiahnsQ.js +1 -0
- package/dist/client/assets/context-menu-ByPsUX7u.js +1 -0
- package/dist/client/assets/{decopilot-CLVJpS6M.js → decopilot-DjAEZRNX.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-_mJQvJZ7.js → decopilot-sse-pool-R-AtQW2s.js} +1 -1
- package/dist/client/assets/{dialog-AE8ChAe3.js → dialog-L9SFsS1U.js} +1 -1
- package/dist/client/assets/{domain-settings-Dika0U17.js → domain-settings-BDbjH98X.js} +1 -1
- package/dist/client/assets/{drawer-Di9WrlRG.js → drawer-D-LP9Hh8.js} +1 -1
- package/dist/client/assets/{dropdown-menu-ecBYljKf.js → dropdown-menu-ByaGrYAQ.js} +1 -1
- package/dist/client/assets/{empty-state-CegPWPc0.js → empty-state-BoeIt5Fh.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BumzxLvt.js → extract-connection-data-Rczvmr_Y.js} +1 -1
- package/dist/client/assets/file-explorer-QNJW4EAt.js +2 -0
- package/dist/client/assets/{file-type-icon-BOraV8Gq.js → file-type-icon-C96ES1WD.js} +1 -1
- package/dist/client/assets/{files-7E0LjJ-5.js → files-CK2ZpMSb.js} +1 -1
- package/dist/client/assets/{form-teSq_9QK.js → form-Ci3Mfx5E.js} +1 -1
- package/dist/client/assets/{general-DCnSVDK9.js → general-Dt135lsN.js} +1 -1
- package/dist/client/assets/{github-repo-picker-LA1Jld2f.js → github-repo-picker-CLrsrBV_.js} +1 -1
- package/dist/client/assets/{hooks-DwlYXenh.js → hooks-BBwQx9Hj.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-D3BPX6JW.js → import-from-deco-dialog-D3nDDNau.js} +1 -1
- package/dist/client/assets/{index-CKtGWWKI.js → index-28ylgXoe.js} +2 -2
- package/dist/client/assets/{index-DnokqHCE.js → index-B-wtw2cV.js} +3 -3
- package/dist/client/assets/{index-3BvM9m2F.js → index-BRqNUInJ.js} +1 -1
- package/dist/client/assets/{index-DJiEBchG.js → index-BYWWr4r7.js} +1 -1
- package/dist/client/assets/index-Bh2oT8fz.css +1 -0
- package/dist/client/assets/index-CuZWA4Jo.js +1 -0
- package/dist/client/assets/index-D4eNxtKO.js +503 -0
- package/dist/client/assets/{index-DR6YHYZo.js → index-DF_aAsrE.js} +1 -1
- package/dist/client/assets/{index-dCmm-GRp.js → index-DM3CipuA.js} +1 -1
- package/dist/client/assets/{index-C4YdUUl9.js → index-DUXTdmoE.js} +1 -1
- package/dist/client/assets/{index-UyzF2Wxm.js → index-DrM3Gy-E.js} +3 -3
- package/dist/client/assets/{index-DnjeTCJ0.js → index-Dtsr5F6p.js} +1 -1
- package/dist/client/assets/{index-BonkSf20.js → index-JnEot5Hj.js} +1 -1
- package/dist/client/assets/index-Y9nbouYw.js +1 -0
- package/dist/client/assets/{index-DnCrG3F_.js → index-_BBnqQdQ.js} +1 -1
- package/dist/client/assets/{index-redirect-CiKtg2BH.js → index-redirect-DmPoZnz_.js} +1 -1
- package/dist/client/assets/{input-CTZybS4f.js → input-BiM4A7Ep.js} +1 -1
- package/dist/client/assets/{integration-icon-CslqVkci.js → integration-icon-g_GK3RAr.js} +1 -1
- package/dist/client/assets/{label-Djcog1jo.js → label-CjJncELr.js} +1 -1
- package/dist/client/assets/{login-E5h2Z5UF.js → login-BOHERlR0.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BcPuGj2k.js → mcp-oauth-CEKI9gHX.js} +1 -1
- package/dist/client/assets/{members-w9nno9lo.js → members-BRt8WHan.js} +1 -1
- package/dist/client/assets/{monaco-editor-DnGtg8Ra.js → monaco-editor-BiUexVQ3.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BqgDsRP3.js → monitoring-stats-row-CwoDwl1p.js} +1 -1
- package/dist/client/assets/{oauth-callback-azsKM8N9.js → oauth-callback-BuVPnEYV.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DUI7fLPI.js → oauth-callback-ai-provider-YJv6IQM9.js} +1 -1
- package/dist/client/assets/{onboarding-DQTGvP19.js → onboarding-CYpSkBDm.js} +1 -1
- package/dist/client/assets/{org-install-BIHuRdOB.js → org-install-DCy7wocy.js} +1 -1
- package/dist/client/assets/{org-layout-enkFWMsq.js → org-layout-RT_U7zH8.js} +1 -1
- package/dist/client/assets/{organization-choice-CqCgStKm.js → organization-choice-bTsrQb1b.js} +1 -1
- package/dist/client/assets/page-seo-form-oftq8ir_.js +1 -0
- package/dist/client/assets/page-seo-sheet-CAgRh54V.js +1 -0
- package/dist/client/assets/{popover-DG0h5msu.js → popover-CdhOYhn4.js} +1 -1
- package/dist/client/assets/post-editor-B3gQokNp.js +1 -0
- package/dist/client/assets/{preview-dialog-Bnu3vr0P.js → preview-dialog-vDgojfWg.js} +2 -2
- package/dist/client/assets/{primitives-BVa9_bXR.js → primitives-CPVg2JCk.js} +1 -1
- package/dist/client/assets/{profile-Dp5DSYPN.js → profile-C8hjNf5c.js} +1 -1
- package/dist/client/assets/project-app-view-CVZVC5T9.js +1 -0
- package/dist/client/assets/record-editor-BZDypwa5.js +1 -0
- package/dist/client/assets/registry-BSMljcPA.js +2 -0
- package/dist/client/assets/{registry-layout-DSIR5CP1.js → registry-layout-BuJ69l8z.js} +1 -1
- package/dist/client/assets/{require-capability-Cj0iYy81.js → require-capability-7xlqOMAl.js} +1 -1
- package/dist/client/assets/{required-auth-layout-clm6boiC.js → required-auth-layout-DMkbzFqw.js} +1 -1
- package/dist/client/assets/{reset-password-B-IQNmbh.js → reset-password-CANGclZQ.js} +1 -1
- package/dist/client/assets/{roles-Cba1TfDM.js → roles-BsbFpQdA.js} +1 -1
- package/dist/client/assets/{save-status-CDIs_R_V.js → save-status-BZrjQZNL.js} +1 -1
- package/dist/client/assets/{scroll-area-BBReqUns.js → scroll-area-DaDHqFsI.js} +2 -2
- package/dist/client/assets/{search-input-D9asghaf.js → search-input-CA0juGKQ.js} +1 -1
- package/dist/client/assets/{secrets-CN8bUJoZ.js → secrets-2KI9BQIB.js} +1 -1
- package/dist/client/assets/sections-editor-DAz_riff.js +2 -0
- package/dist/client/assets/{select-CYFnhI-Q.js → select-lfhjFS6i.js} +1 -1
- package/dist/client/assets/{select-model-35S1fWTq.js → select-model-DhPTkTLZ.js} +1 -1
- package/dist/client/assets/seo-editor-qYixYUVP.js +1 -0
- package/dist/client/assets/{settings-layout-BBO5MmT3.js → settings-layout-D8_yU3Dv.js} +1 -1
- package/dist/client/assets/{settings-section-DOlV_atx.js → settings-section-uGwPOE8T.js} +1 -1
- package/dist/client/assets/{sheet-DALs-qBg.js → sheet-nKeubIDJ.js} +1 -1
- package/dist/client/assets/{shell-controls-B6QkcDFu.js → shell-controls-Nhg6txWq.js} +1 -1
- package/dist/client/assets/{shell-layout-Ch8BfEKU.js → shell-layout-DJP1UAvL.js} +1 -1
- package/dist/client/assets/{shell-route-loading-RsrwOcS1.js → shell-route-loading-BQkX9uZV.js} +1 -1
- package/dist/client/assets/{sidebar-hZIrovG4.js → sidebar-BDxhgXc-.js} +1 -1
- package/dist/client/assets/{skeleton-BqZgigOh.js → skeleton-CQjs3VsL.js} +1 -1
- package/dist/client/assets/sortable.esm-DaR8hxU_.js +5 -0
- package/dist/client/assets/{sso-BXwKoXqN.js → sso-hQT21VNe.js} +1 -1
- package/dist/client/assets/{store-CRZGNrMb.js → store-BEmqzV80.js} +1 -1
- package/dist/client/assets/store-registry-BoeF7jFP.js +2 -0
- package/dist/client/assets/{studio-tools-C1AZbzwg.js → studio-tools-CAUx-JUt.js} +1 -1
- package/dist/client/assets/{switch-DRDIUTD7.js → switch-Vf_P6Fjw.js} +1 -1
- package/dist/client/assets/{table-tYYVDDAQ.js → table-Df43OI16.js} +1 -1
- package/dist/client/assets/{tabs-D__sk4iN.js → tabs-B7LOh75O.js} +1 -1
- package/dist/client/assets/{task-status-CftQiZKN.js → task-status-CNl7XTqg.js} +1 -1
- package/dist/client/assets/{textarea-DmmCVjU6.js → textarea-CoSni5ST.js} +1 -1
- package/dist/client/assets/{toggle-group-5CInie8P.js → toggle-group-Dpya1ElG.js} +1 -1
- package/dist/client/assets/{toolbar-Bm-rdLjh.js → toolbar-C-FtiPvy.js} +1 -1
- package/dist/client/assets/{tooltip-C7L4o0rn.js → tooltip-Cs_BNuMF.js} +1 -1
- package/dist/client/assets/{types-CppGS_VJ.js → types-GBPItn3L.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Deso-Vyj.js → use-ai-providers-Cyy4e6Er.js} +1 -1
- package/dist/client/assets/{use-automations-DdPVJNl5.js → use-automations-jx__re2k.js} +1 -1
- package/dist/client/assets/{use-capability-CGVlaZtI.js → use-capability-_e3uVe_7.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Bp0qVbdD.js → use-clock-tick-g2v6P087.js} +1 -1
- package/dist/client/assets/{use-collections-CXeEMOwb.js → use-collections-B_GMLsdD.js} +1 -1
- package/dist/client/assets/{use-connection-DqvYiUe3.js → use-connection-DKt0DY8s.js} +1 -1
- package/dist/client/assets/{use-copy-H4KuRxx2.js → use-copy-CgtuLhVL.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp--tV5feR-.js → use-create-virtual-mcp-3Gcq1gem.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Ct9kek4B.js → use-debounced-autosave-EPMbx34N.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B2XplI5F.js → use-delete-connection-CWY-Tuh_.js} +1 -1
- package/dist/client/assets/{use-file-configs-CJ5VKJt7.js → use-file-configs-Ci1h3IZS.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BpnVw1p2.js → use-infinite-scroll-Dt6SxdrG.js} +1 -1
- package/dist/client/assets/{use-join-requests-rgaNUN9B.js → use-join-requests-Dtt8rzJS.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Cv0jyhEU.js → use-mcp-client-lyJJArps.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CPZOOi8c.js → use-mcp-prompts-82Xtua4M.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-z50pjVux.js → use-mcp-tools-CdHM3tvY.js} +1 -1
- package/dist/client/assets/{use-members-jM6HOjam.js → use-members-CR5Y6qBg.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CytgRfBH.js → use-navigate-to-agent-DKc1WVEH.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DjPrRX3t.js → use-org-auth-client-DyCA15LL.js} +1 -1
- package/dist/client/assets/{use-org-sso-QBVELOwd.js → use-org-sso-DzO_wPSE.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DHxcYiQL.js → use-organization-roles-CfNQzskd.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DPqJ7ETy.js → use-organization-settings-DmFrFel5.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DQ1fpeHW.js → use-registry-connections-grv_p5nm.js} +1 -1
- package/dist/client/assets/{use-secrets-C3RMGjE2.js → use-secrets-DzWb-lJi.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BaJ0EN3G.js → use-status-sounds-CeAiKW9f.js} +1 -1
- package/dist/client/assets/{use-view-mode-DMk0VP0I.js → use-view-mode-PWJQxDpL.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-iRRxKkRN.js → use-virtual-mcp-Bglvu7_H.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-v9qNAGwf.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-Bu3QWDEr.js +1 -0
- package/dist/client/assets/{variant-calendar-Cn9DL04u.js → variant-calendar-BwPeBwqf.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DnLJJSFI.js → view-mode-toggle-B_Gx2-J_.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-BBef0kzW.js +0 -1
- package/dist/client/assets/app-editor-DB3LZKk9.js +0 -1
- package/dist/client/assets/automation-runs-CNqGFhXQ.js +0 -1
- package/dist/client/assets/calendar-Cof0eQRR.js +0 -1
- package/dist/client/assets/category-editor-CqVdn-A-.js +0 -1
- package/dist/client/assets/collection-detail-CGFO7Nxa.js +0 -1
- package/dist/client/assets/connection-detail-jhV3T5Vf.js +0 -1
- package/dist/client/assets/connections-RSAnGIGn.js +0 -1
- package/dist/client/assets/context-menu-CwmbYH1X.js +0 -1
- package/dist/client/assets/file-explorer-pkuer-wd.js +0 -2
- package/dist/client/assets/image-field-ycul5miD.js +0 -1
- package/dist/client/assets/index-BB0hMJf7.js +0 -1
- package/dist/client/assets/index-Bcj3iVpr.js +0 -1
- package/dist/client/assets/index-CqVkj8du.js +0 -502
- package/dist/client/assets/index-wICsQ-2V.css +0 -1
- package/dist/client/assets/page-seo-form-CLI6M5cV.js +0 -1
- package/dist/client/assets/page-seo-sheet-ClPikk0g.js +0 -1
- package/dist/client/assets/post-editor-BVwj0umw.js +0 -1
- package/dist/client/assets/project-app-view-r7Nmocf7.js +0 -1
- package/dist/client/assets/record-editor-DoT_RQtf.js +0 -1
- package/dist/client/assets/registry-Do0X3IQW.js +0 -2
- package/dist/client/assets/save-referenced-block-BJospazn.js +0 -1
- package/dist/client/assets/schema-form-B6Wg-hy1.js +0 -2
- package/dist/client/assets/sections-editor-BojFR4GO.js +0 -2
- package/dist/client/assets/seo-editor-DBNUZ0fG.js +0 -1
- package/dist/client/assets/sortable.esm-BtnRUgUU.js +0 -5
- package/dist/client/assets/store-registry-C5xb_cZe.js +0 -2
- package/dist/client/assets/use-deco-credits-rzfxapgg.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DVN2QYOz.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BKCXXvPp.js +0 -1
package/dist/client/assets/{use-navigate-to-agent-CytgRfBH.js → use-navigate-to-agent-DKc1WVEH.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as v,r as f,c as C,j,b as D,v as M,a as N}from"./index-
|
|
1
|
+
import{L as v,r as f,c as C,j,b as D,v as M,a as N}from"./index-DrM3Gy-E.js";import{u as F}from"./use-virtual-mcp-Bglvu7_H.js";const h="__tool_call_runs__",R=["requires_action","in_progress","failed","expired","completed"];function tt(t){const e=new Map(R.map(r=>[r,[]]));for(const r of t){const n=r.status??"completed";(e.get(n)??e.get("completed")).push(r)}return R.map(r=>({status:r,threads:e.get(r)}))}function et(t,e){const r=new Map;for(const a of t){if(a.id.startsWith("thrd_welcome_"))continue;const u=a.virtual_mcp_id??h,d=r.get(u);d?(d.threads.push(a),(a.updated_at??"")>d.latestUpdatedAt&&(d.latestUpdatedAt=a.updated_at??"")):r.set(u,{virtualMcpId:u,threads:[a],latestUpdatedAt:a.updated_at??""})}const n=e!==null?r.get(e):void 0;n&&e&&r.delete(e);const s=r.get(h);s&&r.delete(h);const o=[...r.values()].sort((a,u)=>u.latestUpdatedAt.localeCompare(a.latestUpdatedAt)),i=[];return e&&i.push(n??{virtualMcpId:e,threads:[],latestUpdatedAt:""}),i.push(...o),s&&s.threads.length>0&&i.push(s),i}function rt(t,e){if(e.size===0)return t;const r=[],n=new Map;for(const s of t){const o=e.get(s.virtualMcpId);if(o){const a=n.get(o);if(a)a.threads=[...a.threads,...s.threads],s.latestUpdatedAt>a.latestUpdatedAt&&(a.latestUpdatedAt=s.latestUpdatedAt);else{const u={virtualMcpId:o,threads:[...s.threads],latestUpdatedAt:s.latestUpdatedAt};n.set(o,u),r.push(u)}continue}const i=n.get(s.virtualMcpId);if(i)i.threads=[...s.threads,...i.threads],s.latestUpdatedAt>i.latestUpdatedAt&&(i.latestUpdatedAt=s.latestUpdatedAt);else{const a={...s,threads:[...s.threads]};n.set(s.virtualMcpId,a),r.push(a)}}return r}const x=new Map,I=new Map;function P(t){return`${t.orgId}:${t.userId}`}function E(t){return`sidebar.group-order.${t}`}function O(t){try{const e=localStorage.getItem(t),r=e?JSON.parse(e):[];return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}catch{return[]}}function T(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function L(t){const e=P(t),r=x.get(e);if(r)return r;const n=v.sidebarGroupOrder(t.orgId,t.userId);let s=!1;try{s=localStorage.getItem(n)!==null}catch{}let o=O(n);if(!s&&o.length===0&&t.userId!=="anon"){const i=O(E(t.orgId));i.length>0&&(o=i)}return x.set(e,o),o}function p(t,e){const r=new Set(e);return L(t).filter(n=>!r.has(n))}function g(t,e){x.set(P(t),e),T(v.sidebarGroupOrder(t.orgId,t.userId),e)}function m(t){const e=I.get(t);if(e)return e;const r=O(v.sidebarOrgPinnedOrder(t));return I.set(t,r),r}function S(t,e){I.set(t,e),T(v.sidebarOrgPinnedOrder(t),e)}function nt(t,e){g(t,e)}function st(t,e){S(t,e)}function k(t,e){return t===e||t===h}function w(t,e){return e.includes(t)}function q(t,e){return t.map(r=>r.virtualMcpId).filter(r=>!k(r,e))}function ot(t,e,r,n){const s=new Set(n);return q(t,r).filter(o=>e==="org"?s.has(o):!s.has(o))}function B(t,e){const r=new Set(t),n=e.filter(s=>!r.has(s));return n.length===0?t:[...t,...n]}function at(t,e,r){const n=new Set(r),s=[],o=[];let i,a;for(const u of t){const d=u.virtualMcpId;if(e&&d===e){i=u;continue}if(d===h){a=u;continue}if(n.has(d)){s.push(u);continue}o.push(u)}return{decopilot:i,orgPinned:s,user:o,toolCallRuns:a}}function $(t,e,r,n=[],s=[]){const o=r?t.find(c=>c.virtualMcpId===r):void 0,i=t.find(c=>c.virtualMcpId===h),a=new Set(n),u=n.filter(c=>!k(c,r)),d=B(s,u),l=e.filter(c=>!a.has(c)),b=new Map(t.map(c=>[c.virtualMcpId,c])),A=c=>{const G=b.get(c);return G||{virtualMcpId:c,threads:[],latestUpdatedAt:""}},_=d.filter(c=>a.has(c)).map(A),K=l.map(A),U=[];return o&&U.push(o),U.push(..._,...K),i&&U.push(i),{groups:U,userOrder:l,orgOrder:_.map(c=>c.virtualMcpId)}}function J(t,e){const r=new Set(e);m(t.orgId).length===0&&e.length>0&&S(t.orgId,[...e]);const s=v.sidebarGroupOrder(t.orgId,t.userId);if(O(s).length>0)return;const o=O(E(t.orgId));if(o.length===0)return;const i=o.filter(a=>!r.has(a));g(t,i)}function Y(t,e){const r=new Set(e),n=L(t),s=n.filter(o=>!r.has(o));s.length!==n.length&&g(t,s)}function it(t,e,r,n=[]){J(t,n),Y(t,n);const s=p(t,n),o=m(t.orgId),{userOrder:i,orgOrder:a}=$(e,s,r,n,o);(i.length!==s.length||i.some((u,d)=>u!==s[d]))&&g(t,i),(a.length!==o.length||a.some((u,d)=>u!==o[d]))&&S(t.orgId,a)}function ut(t,e,r,n=[]){const s=p(t,n),o=m(t.orgId);return $(e,s,r,n,o).groups}function dt(t,e,r){if(r){const o=p(t,[e]).filter(a=>a!==e);g(t,o);const i=m(t.orgId);i.includes(e)||S(t.orgId,[...i,e]);return}const n=m(t.orgId).filter(o=>o!==e);S(t.orgId,n);const s=p(t,[]);s.includes(e)||g(t,[...s,e])}function z(t,e,r=[]){if(r.includes(e))return;const n=p(t,r);n.includes(e)||g(t,[e,...n])}function ct(t,e,r=[]){const n=p(t,r),s=n.filter(o=>o!==e);s.length!==n.length&&g(t,s)}function lt(t,e,r){const n=t.indexOf(e),s=t.indexOf(r);if(n===-1||s===-1||n===s)return t;const o=[...t],[i]=o.splice(n,1);return i===void 0?t:(o.splice(s,0,i),o)}function ft(t,e,r,n){if(t==="org")return n;const s=p(e,r),o=new Set(n),i=s.filter(a=>!o.has(a));return[...n,...i]}function gt(t,e,r){const n=w(t,r),s=w(e,r);return n===s}const y=f.createContext(null);function pt(t){const e=C.c(7),{children:r}=t,[n,s]=f.useState(!1),[o,i]=f.useState(0);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>i(W),e[0]=a):a=e[0];const u=a;let d;e[1]!==n||e[2]!==o?(d={empty:n,setEmpty:s,orderRevision:o,bumpOrderRevision:u},e[1]=n,e[2]=o,e[3]=d):d=e[3];let l;return e[4]!==r||e[5]!==d?(l=j.jsx(y.Provider,{value:d,children:r}),e[4]=r,e[5]=d,e[6]=l):l=e[6],l}function W(t){return t+1}function ht(){return f.useContext(y)?.empty??!1}function Ot(){return f.useContext(y)?.orderRevision??0}function H(){return f.useContext(y)?.bumpOrderRevision??Q}function Q(){}function mt(t){const{value:e}=t,r=f.useContext(y),[n,s]=f.useState(null);return r&&n!==e&&(r.setEmpty(e),s(e)),null}function X(t){return(t??[]).filter(e=>!!e.pinned).map(e=>e.id)}function St(){const t=C.c(9),e=D(),{org:r}=M(),n=F(),{data:s}=N.useSession(),o=s?.user?.id??"anon";let i;t[0]!==n?(i=X(n),t[0]=n,t[1]=i):i=t[1];const a=i,u=H();let d;return t[2]!==u||t[3]!==e||t[4]!==r.id||t[5]!==r.slug||t[6]!==a||t[7]!==o?(d=(l,b)=>{z({orgId:r.id,userId:o},l,a),u();const A=crypto.randomUUID();e({to:"/$org/$taskId",params:{org:r.slug,taskId:A},search:{...b?.search??{},virtualmcpid:l}})},t[2]=u,t[3]=e,t[4]=r.id,t[5]=r.slug,t[6]=a,t[7]=o,t[8]=d):d=t[8],d}export{mt as S,h as T,H as a,z as b,gt as c,ft as d,st as e,nt as f,X as g,it as h,ut as i,Ot as j,rt as k,et as l,St as m,tt as n,ct as o,at as p,dt as q,lt as r,ot as s,pt as t,ht as u};
|
package/dist/client/assets/{use-org-auth-client-DjPrRX3t.js → use-org-auth-client-DyCA15LL.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,v as j,a as i}from"./index-
|
|
1
|
+
import{c as x,v as j,a as i}from"./index-DrM3Gy-E.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,k as S,m as l,d as y,K as c}from"./index-
|
|
1
|
+
import{c as u,k as S,m as l,d as y,K as c}from"./index-DrM3Gy-E.js";function w(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoStatus(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/status`);if(!r.ok)throw new Error("Failed to check SSO status");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function m(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoConfig(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`);if(!r.ok)throw new Error("Failed to fetch SSO config");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function q(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!f.ok){const p=await f.json();throw new Error(p.error||"Failed to save SSO config")}return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function C(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`,{method:"DELETE"});if(!r.ok)throw new Error("Failed to delete SSO config");return r.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function O(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:r})});if(!f.ok)throw new Error("Failed to toggle SSO enforcement");return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}export{m as a,q as b,C as c,O as d,w as u};
|
package/dist/client/assets/{use-organization-roles-DHxcYiQL.js → use-organization-roles-CfNQzskd.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,j as n,l as v,v as T,k as B,K as P}from"./index-
|
|
1
|
+
import{c as S,j as n,l as v,v as T,k as B,K as P}from"./index-DrM3Gy-E.js";import{e as k,d as I,a as A,T as L,b as z,c as O}from"./table-Df43OI16.js";import{a as K,n as E}from"./SwitchHorizontal01-C3K-vKiU.js";import{u as H}from"./use-org-auth-client-DyCA15LL.js";function D(h){const e=S.c(29),{columns:t,data:m,sortKey:p,sortDirection:d,onSort:o,onRowClick:a,rowClassName:s}=h;let l;e[0]!==d?(l=function(r,N){return n.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&d&&(d==="asc"?n.jsx(K,{size:16,className:"text-muted-foreground transition-colors"}):n.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=d,e[1]=l):l=e[1];const i=l;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=function(r,N){let y="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return r===N-1&&(y="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),y},e[2]=c):c=e[2];const u=c;let f;if(e[3]!==t||e[4]!==o||e[5]!==i||e[6]!==p){let x;e[8]!==t.length||e[9]!==o||e[10]!==i||e[11]!==p?(x=(r,N)=>{const y=p===r.id;return n.jsx(k,{className:v(u(N,t.length),"group transition-colors select-none",r.sortable&&"hover:bg-accent cursor-pointer",r.rowClassName,r.cellClassName),onClick:r.sortable&&o?()=>o(r.id):void 0,children:n.jsxs("span",{className:"flex items-center gap-1",children:[r.header,r.sortable&&i(r.id,y)]})},r.id)},e[8]=t.length,e[9]=o,e[10]=i,e[11]=p,e[12]=x):x=e[12],f=t.map(x),e[3]=t,e[4]=o,e[5]=i,e[6]=p,e[7]=f}else f=e[7];let w;e[13]!==f?(w=n.jsx(I,{className:"border-b-0",children:n.jsx(A,{className:"h-9 hover:bg-transparent border-b border-border",children:f})}),e[13]=f,e[14]=w):w=e[14];let g;if(e[15]!==t||e[16]!==m||e[17]!==a||e[18]!==s){let x;e[20]!==t||e[21]!==a||e[22]!==s?(x=(r,N)=>{const y=s?.(r);return n.jsx(A,{"data-row-index":N,className:v("group/data-row transition-colors border-b-0 hover:bg-accent/50",a?"cursor-pointer":"",y),onClick:a?()=>a(r):void 0,children:t.map(b=>n.jsx(L,{className:v("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:n.jsx("div",{className:v(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(r):b.accessor?b.accessor(r):null})},b.id))},N)},e[20]=t,e[21]=a,e[22]=s,e[23]=x):x=e[23],g=m.map(x),e[15]=t,e[16]=m,e[17]=a,e[18]=s,e[19]=g}else g=e[19];let C;e[24]!==g?(C=n.jsx(z,{children:g}),e[24]=g,e[25]=C):C=e[25];let j;return e[26]!==w||e[27]!==C?(j=n.jsxs(O,{className:"w-full border-collapse",children:[w,C]}),e[26]=w,e[27]=C,e[28]=j):j=e[28],j}function W(h){const e=S.c(12),{columns:t,data:m,isLoading:p,sortKey:d,sortDirection:o,onSort:a,onRowClick:s,emptyState:l}=h;if(p===void 0?!1:p){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("div",{className:"flex items-center justify-center h-full",children:n.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=u):u=e[0],u}if(m.length===0){let u;e[1]!==l?(u=l||n.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=l,e[2]=u):u=e[2];let f;return e[3]!==u?(f=n.jsx("div",{className:"flex items-center justify-center h-full",children:u}),e[3]=u,e[4]=f):f=e[4],f}let c;return e[5]!==t||e[6]!==m||e[7]!==s||e[8]!==a||e[9]!==o||e[10]!==d?(c=n.jsx("div",{className:"flex-1",children:n.jsx(D,{columns:t,data:m,sortKey:d,sortDirection:o,onSort:a,onRowClick:s})}),e[5]=t,e[6]=m,e[7]=s,e[8]=a,e[9]=o,e[10]=d,e[11]=c):c=e[11],c}const R=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function M(h){return h.replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function U(h){if(!h)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const e=[];let t=!1;const m=[];let p=!1;const d=new Set;let o=!1,a=0,s=!1;for(const[l,i]of Object.entries(h)){if(l==="self"){i.includes("*")?t=!0:e.push(...i);continue}if(l==="models"){i.includes("*:*")?s=!0:a=i.length;continue}if(l==="*"){if(p=!0,i.includes("*"))o=!0;else for(const c of i)d.add(c);continue}if(m.push(l),i.includes("*"))o=!0;else for(const c of i)d.add(c)}return{staticPermissions:e,allowsAllStaticPermissions:t,connectionIds:m,allowsAllConnections:p,toolNames:Array.from(d),allowsAllTools:o,modelCount:a,allowsAllModels:s}}function Y(){const{locator:h}=T(),e=H(),{data:t,isLoading:m,error:p,refetch:d}=B({queryKey:P.organizationRoles(h),queryFn:async()=>{try{const s=await e.organization.listRoles();return s?.error?(console.error("[useOrganizationRoles] API error:",s.error),[]):s?.data??[]}catch(s){return console.error("[useOrganizationRoles] Fetch error:",s),[]}},staleTime:3e4}),o=R.map(s=>({role:s.value,label:s.label,isBuiltin:s.isBuiltin}));if(t&&Array.isArray(t))for(const s of t){const l=s.role;if(!l||R.some(x=>x.value===l))continue;const{staticPermissions:i,allowsAllStaticPermissions:c,connectionIds:u,allowsAllConnections:f,toolNames:w,allowsAllTools:g,modelCount:C,allowsAllModels:j}=U(s.permission);o.push({id:s.id,role:l,label:M(l),isBuiltin:!1,permission:s.permission??void 0,staticPermissionCount:c?-1:i.length,allowsAllStaticPermissions:c,connectionCount:f?-1:u.length,allowsAllConnections:f,toolCount:g?-1:w.length,allowsAllTools:g,modelCount:j?-1:C,allowsAllModels:j})}const a=o.filter(s=>!s.isBuiltin);return{roles:o,customRoles:a,builtinRoles:o.filter(s=>s.isBuiltin),isLoading:m,error:p,refetch:d}}export{W as C,Y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K as d,c as l,v as g,k as E,m as I,d as R,r as b}from"./index-
|
|
1
|
+
import{K as d,c as l,v as g,k as E,m as I,d as R,r as b}from"./index-DrM3Gy-E.js";import{W as G}from"./use-mcp-client-lyJJArps.js";import{c as M,u as Q}from"./studio-tools-CAUx-JUt.js";const N={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null},O={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function w(t,e){return{queryKey:d.organizationSettings(e),queryFn:async()=>{try{return await M(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...N,organizationId:e}}},staleTime:6e4}}function h(t){const e=l.c(6),{org:s}=g();let n;e[0]!==s.id||e[1]!==s.slug?(n=w(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const i=t;let r;return e[3]!==n||e[4]!==i?(r={...n,select:i},e[3]=n,e[4]=i,e[5]=r):r=e[5],E(r)}function W(t,e){const s=l.c(3);let n;s[0]!==t||s[1]!==e?(n=w(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:i}=E(n);return i??null}function S(){const t=l.c(9),{org:e}=g(),s=Q(),n=I();let i;t[0]!==e||t[1]!==s?(i=async u=>{const o=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...u});if(!o)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return o},t[0]=e,t[1]=s,t[2]=i):i=t[2];let r;t[3]!==e||t[4]!==n?(r=u=>{n.setQueryData(d.organizationSettings(e.id),o=>({...o??N,...u}))},t[3]=e,t[4]=n,t[5]=r):r=t[5];let a;return t[6]!==i||t[7]!==r?(a={mutationFn:i,onSuccess:r},t[6]=i,t[7]=r,t[8]=a):a=t[8],R(a)}function C(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:O}function Z(){const{data:t}=h(P);return t??O}function P(t){return C(t.simple_mode)}function F(){const t=l.c(7),e=S();let s,n;t[0]!==e?(s=(r,a)=>e.mutate({simple_mode:r},a),n=(r,a)=>e.mutateAsync({simple_mode:r},a),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function $(){const{data:t}=h(k);return t??null}function k(t){return t.registry_config}function j(){const t=l.c(7),e=S();let s,n;t[0]!==e?(s=(r,a)=>e.mutate({registry_config:r},a),n=(r,a)=>e.mutateAsync({registry_config:r},a),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function v(){const{data:t}=h(x);return t??null}function x(t){return t.default_home_agents}function U(){const t=l.c(7),e=S();let s,n;t[0]!==e?(s=(r,a)=>e.mutate({default_home_agents:r},a),n=(r,a)=>e.mutateAsync({default_home_agents:r},a),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function B(){const t=l.c(14),{org:e}=g(),s=U(),n=I();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=Promise.resolve(),t[0]=i):i=t[0];const r=b.useRef(i);let a;t[1]!==e.id?(a=d.organizationSettings(e.id),t[1]=e.id,t[2]=a):a=t[2];const u=a;let o;t[3]!==u||t[4]!==n?(o=()=>n.getQueryData(u)?.default_home_agents?.ids??[],t[3]=u,t[4]=n,t[5]=o):o=t[5];const _=o;let m;t[6]!==u||t[7]!==e.slug||t[8]!==n||t[9]!==s?(m=z=>{const T=r.current.then(async()=>{const A=n.getQueryData(u),p=z(A?.default_home_agents?.ids??[]);if(p!==null){n.setQueryData(u,c=>c&&{...c,default_home_agents:{ids:p}});try{await s.mutateAsync({ids:p}),await n.refetchQueries({queryKey:d.homeNextActions(e.slug),type:"active"})}catch(c){const D=c;throw n.setQueryData(u,A),D}}});return r.current=T.catch(q),T},t[6]=u,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=m):m=t[10];const y=m;let f;return t[11]!==y||t[12]!==_?(f={currentIds:_,apply:y},t[11]=y,t[12]=_,t[13]=f):f=t[13],f}function q(){}function L(){const t=l.c(5),{org:e}=g(),s=$();let n;t[0]!==e.id?(n=G.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const i=n;let r;return t[2]!==i||t[3]!==s?(r=a=>{if(!s)return a===i;const u=s.registries[a];return u?u.enabled:a===i},t[2]=i,t[3]=s,t[4]=r):r=t[4],r}export{B as a,L as b,W as c,Z as d,F as e,$ as f,j as g,w as o,v as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C,v as R}from"./index-
|
|
1
|
+
import{c as C,v as R}from"./index-DrM3Gy-E.js";import{u as p}from"./use-connection-DKt0DY8s.js";import{W as a}from"./use-mcp-client-lyJJArps.js";import{f as y}from"./use-organization-settings-DmFrFel5.js";function M(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{M as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,v as r,K as c,a5 as f,m as y,d as m}from"./index-
|
|
1
|
+
import{c as n,v as r,K as c,a5 as f,m as y,d as m}from"./index-DrM3Gy-E.js";import{u as l}from"./studio-tools-CAUx-JUt.js";function C(){const e=n.c(7),{org:o}=r(),u=l();let i;e[0]!==o.id?(i=c.secrets(o.id),e[0]=o.id,e[1]=i):i=e[1];let t;e[2]!==u?(t=async()=>await u.call("SECRET_LIST",{}),e[2]=u,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:a}=f(s);return a.secrets}function p(){const e=n.c(8),{org:o}=r(),u=l(),i=y();let t;e[0]!==u?(t=async d=>await u.call("SECRET_CREATE",{...d}),e[0]=u,e[1]=t):t=e[1];let s;e[2]!==o||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:c.secrets(o.id)})},e[2]=o,e[3]=i,e[4]=s):s=e[4];let a;return e[5]!==t||e[6]!==s?(a={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=a):a=e[7],m(a)}export{p as a,C as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as m,G as h}from"./index-
|
|
1
|
+
import{r as o,c as m,G as h}from"./index-DrM3Gy-E.js";import{p as R,q as I}from"./question-004-sINsf4GQ.js";import{d as y,D as S}from"./decopilot-sse-pool-R-AtQW2s.js";const b=()=>0;function D(s){const{orgSlug:e,taskId:r,enabled:t=!0,onStep:n,onFinish:u,onTaskStatus:f}=s,l=o.useRef({taskId:r,onStep:n,onFinish:u,onTaskStatus:f});l.current={taskId:r,onStep:n,onFinish:u,onTaskStatus:f};const i=o.useRef(null),p=o.useRef(t),d=o.useRef(e);(!i.current||p.current!==t||d.current!==e)&&(p.current=t,d.current=e,i.current=E=>{if(!t||!e)return()=>{};const k=T=>{let a;try{a=JSON.parse(T.data)}catch{return}const c=l.current;if(!(c.taskId&&a.subject!==c.taskId)){switch(a.type){case S.STEP:c.onStep?.(a);break;case S.FINISH:c.onFinish?.(a);break;case S.THREAD_STATUS:c.onTaskStatus?.(a);break}E()}};return y.subscribe(e,k)}),o.useSyncExternalStore(i.current,b,b)}const O=new Set(["completed","failed","requires_action"]);function U(s){const e=m.c(5),[r]=h();let t;e[0]!==r?(t=u=>{r.enableSounds&&O.has(u.data.status)&&R(I.dataUri).catch(_)},e[0]=r,e[1]=t):t=e[1];let n;e[2]!==s||e[3]!==t?(n={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=n):n=e[4],D(n)}function _(s){console.warn("[status-sounds] playback failed:",s)}export{U as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,r as f}from"./index-
|
|
1
|
+
import{c as p,r as f}from"./index-DrM3Gy-E.js";import{u as w}from"./tooltip-Cs_BNuMF.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,v as d,aI as p,k as P}from"./index-
|
|
1
|
+
import{c as a,v as d,aI as p,k as P}from"./index-DrM3Gy-E.js";import{b as L,a as S,u as V,c as _}from"./use-collections-B_GMLsdD.js";import{S as g,u as I}from"./use-mcp-client-lyJJArps.js";function v(s){const t=a.c(5);let e;t[0]!==s?(e=s===void 0?{}:s,t[0]=s,t[1]=e):e=t[1];const n=e,{org:i}=d();let o;t[2]!==i.id||t[3]!==i.slug?(o={connectionId:g,orgId:i.id,orgSlug:i.slug},t[2]=i.id,t[3]=i.slug,t[4]=o):o=t[4];const l=I(o);return L(i.id,"VIRTUAL_MCP",l,n)}function R(s,t,e){return _(s,"VIRTUAL_MCP",t??void 0,e)}function b(s){const t=a.c(3),{org:e}=d();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=I(n);return V(e.id,"VIRTUAL_MCP",s??void 0,i)}function E(s){const t=a.c(15),{org:e}=d();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=I(n);let o,l,c;t[3]!==s||t[4]!==e.id?(o=[...s].sort(),c=P,l=p.virtualMcpLastUsed(e.id,o),t[3]=s,t[4]=e.id,t[5]=o,t[6]=l,t[7]=c):(o=t[5],l=t[6],c=t[7]);const C=o.length>0;let u;t[8]!==i||t[9]!==o?(u=async()=>{const M=(await i.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:o}})).structuredContent??{items:[]},f=new Map;for(const m of M.items)f.set(m.id,m);return f},t[8]=i,t[9]=o,t[10]=u):u=t[10];let r;return t[11]!==l||t[12]!==C||t[13]!==u?(r={queryKey:l,enabled:C,staleTime:3e4,queryFn:u},t[11]=l,t[12]=C,t[13]=u,t[14]=r):r=t[14],c(r)}function $(){const s=a.c(3),{org:t}=d();let e;s[0]!==t.id||s[1]!==t.slug?(e={connectionId:g,orgId:t.id,orgSlug:t.slug},s[0]=t.id,s[1]=t.slug,s[2]=e):e=s[2];const n=I(e);return S(t.id,"VIRTUAL_MCP",n)}export{b as a,$ as b,E as c,v as u,R as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as u}from"./use-infinite-scroll-Dt6SxdrG.js";import{cI as i}from"./index-DrM3Gy-E.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as s}from"./use-infinite-scroll-Dt6SxdrG.js";import{cI as u,az as n}from"./index-DrM3Gy-E.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as R,r as K,j as a,l as W,B as O}from"./index-UyzF2Wxm.js";import{P as Q,f as it}from"./agent-icon-BMQHBhP6.js";import{n as at}from"./ChevronLeft-ByQFERqp.js";import{i as lt}from"./ChevronRight-D1duQehP.js";import{S as X}from"./scroll-area-BBReqUns.js";import{T as ct,b as mt,a as pt}from"./tooltip-C7L4o0rn.js";import{V as ft}from"./view-mode-toggle-DnLJJSFI.js";import"./AlertCircle-Diz6uT7Y.js";import"./Tool01-BgzvuPeY.js";import"./SwitchHorizontal01-vo5MpXEz.js";import"./Settings02-BvivcyYL.js";import"./XCircle-B88UxHjD.js";import"./ArrowUpRight-Bo4YThIl.js";import"./ZapSquare-BfSTQonf.js";import"./Users03-ClWrctLP.js";import"./CheckCircle-BSFt0_RZ.js";import"./ChevronUp-_gM_dQkt.js";import"./ChevronDown-C_njLrOU.js";import"./DotsVertical-BJnhQ8u0.js";import"./Stars02-CVb_b-OZ.js";import"./Eye-SUXNGsVY.js";import"./ZoomOut-Csc4IU4b.js";import"./Globe01-CNw0uMhK.js";import"./FilterLines-CxIQYlMz.js";import"./Star01-Ds91SJzA.js";import"./Globe04-B24hCYmg.js";import"./HardDrive-IPJJMMij.js";import"./Key01-CES8n-fG.js";import"./LayoutLeft-D3mZzNi0.js";import"./LinkExternal01-B8zRpPza.js";import"./Monitor01-Uh-3HvZI.js";import"./Sun-tLN4vA6M.js";import"./Palette-Du66341h.js";import"./Play-CVoFjR5I.js";import"./Plus-DoMNANl8.js";import"./SearchMd-B-bL1wjq.js";import"./Shield01-BewRt7sw.js";import"./Stars01-PS518Jif.js";import"./Trash01-D84eyfFz.js";import"./Upload01-BA5iKtAl.js";import"./User01-CeCQHgwg.js";import"./Users01-DtmLcsFN.js";import"./XClose-DcfEQwVh.js";import"./X-2HGWB7Oo.js";import"./Zap-BeB31T8Y.js";import"./use-clock-tick-Bp0qVbdD.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-H4KuRxx2.js";import"./file-type-icon-BOraV8Gq.js";import"./dialog-AE8ChAe3.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CppGS_VJ.js";import"./use-mcp-client-Cv0jyhEU.js";import"./auth-CCI_mhgC.js";import"./chat-context-Dqu5Dj_J.js";import"./hooks-DwlYXenh.js";import"./decopilot-sse-pool-_mJQvJZ7.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-iRRxKkRN.js";import"./use-collections-CXeEMOwb.js";import"./use-ai-providers-Deso-Vyj.js";import"./studio-tools-C1AZbzwg.js";import"./use-organization-settings-DPqJ7ETy.js";import"./shell-layout-Ch8BfEKU.js";import"./avatar-CtVVLapD.js";import"./required-auth-layout-clm6boiC.js";import"./use-org-sso-QBVELOwd.js";import"./sheet-DALs-qBg.js";import"./integration-icon-CslqVkci.js";import"./use-navigate-to-agent-CytgRfBH.js";import"./use-connection-DqvYiUe3.js";import"./use-mcp-prompts-CPZOOi8c.js";import"./form-teSq_9QK.js";import"./label-Djcog1jo.js";import"./input-CTZybS4f.js";import"./select-CYFnhI-Q.js";const dt=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),ut=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),ht=/\/flags\/multivariate\/[^/]+\.ts$/;function xt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function gt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e;if(typeof t!="string"||typeof r!="string")return null;const n=new Date(t),c=new Date(r);return Number.isNaN(n.getTime())||Number.isNaN(c.getTime())||c.getTime()<=n.getTime()?null:{start:n,end:c}}function Z(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(dt.has(r)){const n=gt(e);n&&t.push(n);return}if(ut.has(r)){const n=e.matchers;if(Array.isArray(n))for(const c of n)Z(c,t)}}}function bt(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!ht.test(t))return!1;const r=e.variants;return Array.isArray(r)}function yt(e){if(typeof e=="string"){const i=e.trim();if(i.length===0)return null;try{const m=new URL(i).pathname.split("/").filter(Boolean),p=m[m.length-1];if(p)return decodeURIComponent(p)}catch{}return i.length>80?`${i.slice(0,77)}…`:i}if(!e||typeof e!="object")return null;const t=e,r=t.config,c=t.desktop?.media,o=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,c?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const i of o)if(typeof i=="string"&&i.trim().length>0)return i.trim();const l=t.__resolveType;if(typeof l=="string"){const s=(l.split("/").pop()??l).replace(/\.(tsx?|jsx?)$/i,"");if(s.length>0)return s}return null}function vt(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];typeof n=="number"?t.length>0?t[t.length-1]+=`[${n}]`:t.push(`[${n}]`):t.push(n)}return t.join(" · ")}function H(e,t,r,n,c){if(bt(e)){const o=vt(n),l=e.variants,i=e.__resolveType;l.forEach((s,m)=>{if(!s||typeof s!="object")return;const p=s,d=[];if(Z(p.rule,d),d.length===0)return;const x=yt(p.value)??(o||r);for(const g of d)c.push({blockKey:t,blockLabel:r,innerPath:o,variantIndex:m,start:g.start,end:g.end,label:x,flagResolveType:i})});for(let s=0;s<l.length;s++){const m=l[s];m&&typeof m=="object"&&H(m.value,t,r,[...n,"variants",s,"value"],c)}return}if(Array.isArray(e)){for(let o=0;o<e.length;o++)H(e[o],t,r,[...n,o],c);return}if(e&&typeof e=="object")for(const[o,l]of Object.entries(e))o!=="__resolveType"&&H(l,t,r,[...n,o],c)}function Tt(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))H(n,r,xt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function jt(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,c)=>{const o=c*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${o})`,text:"white",border:`oklch(0.50 0.14 ${o})`})}),r}const Nt={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function tt(e,t){return e.get(t)??Nt}const kt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],et=["January","February","March","April","May","June","July","August","September","October","November","December"],wt=1440*60*1e3;function L(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function rt(e){return new Date(e.getFullYear(),e.getMonth(),1)}function $(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function I(e,t){const r=new Date(e);return r.setDate(r.getDate()+t),r}function G(e,t){return Math.round((L(e).getTime()-L(t).getTime())/wt)}function _t(e){const t=I(e,-e.getDay()),r=[];for(let n=0;n<6;n++){const c=[];for(let o=0;o<7;o++)c.push(I(t,n*7+o));r.push(c)}for(;r.length>0&&r[r.length-1].every(n=>n.getMonth()!==e.getMonth());)r.pop();return r}function Mt(e,t){const r=L(e[0]),n=I(r,7),c=[];for(const i of t){const s=L(i.start),m=L(i.end);if(m.getTime()<r.getTime()||s.getTime()>=n.getTime())continue;const p=s.getTime()<r.getTime()?r:s,d=m.getTime()>=n.getTime()?I(n,-1):m,u=G(p,r),x=G(d,p)+1;x<=0||c.push({variant:i,startCol:u,span:x})}c.sort((i,s)=>i.startCol-s.startCol||s.span-i.span||i.variant.blockKey.localeCompare(s.variant.blockKey));const o=[],l=[];for(const i of c){let s=o.findIndex(m=>m<=i.startCol);s===-1&&(s=o.length,o.push(0)),o[s]=i.startCol+i.span,l.push({...i,lane:s})}return l}const U=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function St(e){return`${U.format(e.start)} → ${U.format(e.end)}`}function At(e){const t=R.c(17),{variant:r}=e;let n;t[0]!==r.blockLabel?(n=a.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=n):n=t[1];let c;t[2]!==r.innerPath?(c=r.innerPath&&a.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=c):c=t[3];let o;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(o=r.label!==r.blockLabel&&r.label!==r.innerPath&&a.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=o):o=t[7];let l;t[8]!==r?(l=St(r),t[8]=r,t[9]=l):l=t[9];let i;t[10]!==l?(i=a.jsx("div",{className:"mt-1",children:l}),t[10]=l,t[11]=i):i=t[11];let s;return t[12]!==n||t[13]!==c||t[14]!==o||t[15]!==i?(s=a.jsx(pt,{children:a.jsxs("div",{className:"text-xs",children:[n,c,o,i]})}),t[12]=n,t[13]=c,t[14]=o,t[15]=i,t[16]=s):s=t[16],s}function nt(e){const t=R.c(14),{variant:r,color:n,style:c,children:o}=e;let l;t[0]!==n.bg||t[1]!==n.text||t[2]!==c?(l={background:n.bg,color:n.text,borderRadius:4,...c},t[0]=n.bg,t[1]=n.text,t[2]=c,t[3]=l):l=t[3];let i;t[4]!==o?(i=a.jsx("span",{className:"truncate",children:o}),t[4]=o,t[5]=i):i=t[5];let s;t[6]!==l||t[7]!==i?(s=a.jsx(ct,{asChild:!0,children:a.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:l,children:i})}),t[6]=l,t[7]=i,t[8]=s):s=t[8];let m;t[9]!==r?(m=a.jsx(At,{variant:r}),t[9]=r,t[10]=m):m=t[10];let p;return t[11]!==s||t[12]!==m?(p=a.jsxs(mt,{children:[s,m]}),t[11]=s,t[12]=m,t[13]=p):p=t[13],p}function pr(e){const t=R.c(39),{decofile:r}=e,[n,c]=K.useState("calendar"),[o,l]=K.useState(Ct);let i,s;t[0]!==r?(s=Tt(r),i=jt(s.map(Et)),t[0]=r,t[1]=i,t[2]=s):(i=t[1],s=t[2]);const m=i;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=()=>l(rt(new Date)),t[3]=p):p=t[3];const d=p;let u;t[4]!==n?(u=()=>l(k=>n==="calendar"?$(k,-1):$(k,-3)),t[4]=n,t[5]=u):u=t[5];const x=u;let g;t[6]!==n?(g=()=>l(k=>n==="calendar"?$(k,1):$(k,3)),t[6]=n,t[7]=g):g=t[7];const w=g;let N;t[8]===Symbol.for("react.memo_cache_sentinel")?(N=a.jsx(O,{variant:"outline",size:"sm",onClick:d,children:"Today"}),t[8]=N):N=t[8];let E;t[9]===Symbol.for("react.memo_cache_sentinel")?(E=a.jsx(at,{size:16}),t[9]=E):E=t[9];let _;t[10]!==x?(_=a.jsx(O,{variant:"ghost",size:"icon",className:"size-8",onClick:x,"aria-label":"Previous",children:E}),t[10]=x,t[11]=_):_=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(lt,{size:16}),t[12]=f):f=t[12];let b;t[13]!==w?(b=a.jsx(O,{variant:"ghost",size:"icon",className:"size-8",onClick:w,"aria-label":"Next",children:f}),t[13]=w,t[14]=b):b=t[14];const M=et[o.getMonth()];let y;t[15]!==o?(y=o.getFullYear(),t[15]=o,t[16]=y):y=t[16];let v;t[17]!==M||t[18]!==y?(v=a.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[M," ",y]}),t[17]=M,t[18]=y,t[19]=v):v=t[19];let T;t[20]!==v||t[21]!==_||t[22]!==b?(T=a.jsxs("div",{className:"flex items-center gap-2",children:[N,_,b,v]}),t[20]=v,t[21]=_,t[22]=b,t[23]=T):T=t[23];let C;t[24]===Symbol.for("react.memo_cache_sentinel")?(C={value:"calendar",icon:a.jsx(Q,{}),label:"Calendar"},t[24]=C):C=t[24];let j;t[25]===Symbol.for("react.memo_cache_sentinel")?(j=[C,{value:"timeline",icon:a.jsx(it,{}),label:"Timeline"}],t[25]=j):j=t[25];let h;t[26]!==n?(h=a.jsx(ft,{value:n,onValueChange:c,options:j}),t[26]=n,t[27]=h):h=t[27];let S;t[28]!==T||t[29]!==h?(S=a.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[T,h]}),t[28]=T,t[29]=h,t[30]=S):S=t[30];let A;t[31]!==m||t[32]!==o||t[33]!==s||t[34]!==n?(A=s.length===0?a.jsx(Dt,{}):n==="calendar"?a.jsx($t,{monthStart:o,variants:s,colorMap:m}):a.jsx(Vt,{monthStart:o,variants:s,colorMap:m}),t[31]=m,t[32]=o,t[33]=s,t[34]=n,t[35]=A):A=t[35];let D;return t[36]!==S||t[37]!==A?(D=a.jsxs("div",{className:"flex h-full w-full flex-col",children:[S,A]}),t[36]=S,t[37]=A,t[38]=D):D=t[38],D}function Et(e){return e.blockKey}function Ct(){return rt(new Date)}function Dt(){const e=R.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[a.jsx(Q,{size:24,className:"text-muted-foreground/60"}),a.jsx("div",{children:"No scheduled variants."}),a.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Variants gated by a date matcher appear here."})]}),e[0]=t):t=e[0],t}const z=20,J=2,q=28;function $t(e){const t=R.c(17),{monthStart:r,variants:n,colorMap:c}=e;let o,l,i,s,m;if(t[0]!==c||t[1]!==r||t[2]!==n){const u=_t(r),x=L(new Date);o=X,m="flex-1 min-h-0",l="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:kt.map(Rt)}),t[8]=i):i=t[8],s=u.map((g,w)=>{const N=Mt(g,n),E=N.reduce(Lt,0),_=q+E*(z+J)+8;return a.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:_},children:[g.map((f,b)=>{const M=f.getMonth()===r.getMonth(),y=f.getTime()===x.getTime();return a.jsx("div",{className:W("border-r last:border-r-0 px-2 pt-1.5 text-xs",M?"bg-background":"bg-muted/30 text-muted-foreground"),children:a.jsx("span",{className:W("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",y&&"bg-primary text-primary-foreground font-semibold"),children:f.getDate()})},b)}),N.map((f,b)=>{const M=tt(c,f.variant.blockKey),y=q+f.lane*(z+J),v=f.startCol/7*100,T=f.span/7*100;return a.jsxs(nt,{variant:f.variant,color:M,style:{top:y,left:`calc(${v}% + 2px)`,width:`calc(${T}% - 4px)`,height:z},children:[f.variant.blockLabel,f.variant.label!==f.variant.blockLabel&&a.jsxs("span",{className:"opacity-70",children:[" · ",f.variant.label]})]},`${w}-${b}`)})]},w)}),t[0]=c,t[1]=r,t[2]=n,t[3]=o,t[4]=l,t[5]=i,t[6]=s,t[7]=m}else o=t[3],l=t[4],i=t[5],s=t[6],m=t[7];let p;t[9]!==l||t[10]!==i||t[11]!==s?(p=a.jsxs("div",{className:l,children:[i,s]}),t[9]=l,t[10]=i,t[11]=s,t[12]=p):p=t[12];let d;return t[13]!==o||t[14]!==m||t[15]!==p?(d=a.jsx(o,{className:m,children:p}),t[13]=o,t[14]=m,t[15]=p,t[16]=d):d=t[16],d}function Lt(e,t){return Math.max(e,t.lane+1)}function Rt(e){return a.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const V=4,Pt=32,P=240;function Vt(e){const t=R.c(27),{monthStart:r,variants:n,colorMap:c}=e,o=r;let l,i,s,m,p,d;if(t[0]!==c||t[1]!==r||t[2]!==o||t[3]!==n){const g=$(r,V),w=new Date,N=new Map;for(const j of n){const h=N.get(j.blockKey)??[];h.push(j),N.set(j.blockKey,h)}const E=Array.from(N.entries()).sort(Ot),_=g.getTime()-o.getTime(),f=j=>(Math.max(o.getTime(),Math.min(g.getTime(),j.getTime()))-o.getTime())/_*100;let b;t[10]!==o?(b=(j,h)=>$(o,h),t[10]=o,t[11]=b):b=t[11];const M=Array.from({length:V},b),y=w.getTime()>=o.getTime()&&w.getTime()<=g.getTime()?f(w):null;l=X,d="flex-1 min-h-0",i="min-w-[900px] relative";let v;t[12]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:{width:P},children:"Variant / Block"}),t[12]=v):v=t[12];let T;t[13]===Symbol.for("react.memo_cache_sentinel")?(T={gridTemplateColumns:`repeat(${V}, minmax(0, 1fr))`},t[13]=T):T=t[13];const C=M.map(It);t[14]!==C?(s=a.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[v,a.jsx("div",{className:"flex-1 grid",style:T,children:C})]}),t[14]=C,t[15]=s):s=t[15],t[16]!==y?(m=y!==null&&a.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${P}px + (100% - ${P}px) * ${y} / 100)`},children:a.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]=y,t[17]=m):m=t[17],p=E.map(j=>{const[h,S]=j,A=tt(c,h),D=S[0]?.blockLabel??h;return a.jsxs("div",{children:[a.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:a.jsx("div",{className:"px-3 truncate",style:{width:P},children:D})}),S.map((k,st)=>a.jsxs("div",{className:"flex border-b items-center",style:{height:Pt},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:P},children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:A.bg}}),a.jsx("span",{className:"truncate text-foreground/80",children:k.label})]}),a.jsxs("div",{className:"relative flex-1 h-full",children:[a.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${V}, minmax(0, 1fr))`},children:M.map(Ht)}),(()=>{const B=Math.max(k.start.getTime(),o.getTime()),F=Math.min(k.end.getTime(),g.getTime());if(F<=B)return null;const Y=f(new Date(B)),ot=f(new Date(F))-Y;return a.jsx(nt,{variant:k,color:A,style:{top:"50%",transform:"translateY(-50%)",left:`${Y}%`,width:`calc(${ot}% - 2px)`,height:22},children:k.label})})()]})]},st))]},h)}),t[0]=c,t[1]=r,t[2]=o,t[3]=n,t[4]=l,t[5]=i,t[6]=s,t[7]=m,t[8]=p,t[9]=d}else l=t[4],i=t[5],s=t[6],m=t[7],p=t[8],d=t[9];let u;t[18]!==i||t[19]!==s||t[20]!==m||t[21]!==p?(u=a.jsxs("div",{className:i,children:[s,m,p]}),t[18]=i,t[19]=s,t[20]=m,t[21]=p,t[22]=u):u=t[22];let x;return t[23]!==l||t[24]!==d||t[25]!==u?(x=a.jsx(l,{className:d,children:u}),t[23]=l,t[24]=d,t[25]=u,t[26]=x):x=t[26],x}function Ht(e,t){return a.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function It(e,t){return a.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[et[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function Ot(e,t){return e[0].localeCompare(t[0])}export{pr as VariantCalendar};
|
|
1
|
+
import{c as R,r as K,j as a,l as W,B as O}from"./index-DrM3Gy-E.js";import{T as Q,f as it}from"./agent-icon-B8qJNw4_.js";import{n as at}from"./ChevronLeft-ByolOLbh.js";import{i as lt}from"./ChevronRight-CmB8MBzZ.js";import{S as X}from"./scroll-area-DaDHqFsI.js";import{T as ct,b as mt,a as pt}from"./tooltip-Cs_BNuMF.js";import{V as ft}from"./view-mode-toggle-B_Gx2-J_.js";import"./AlertCircle-CzPpSV3W.js";import"./Tool01-CTw8qR4v.js";import"./SwitchHorizontal01-C3K-vKiU.js";import"./Settings02-B7jENSJZ.js";import"./XCircle-DtHr5hnB.js";import"./ArrowUpRight-BefNTATY.js";import"./ZapSquare-C2q_71C5.js";import"./Users03-9LUo_raC.js";import"./CheckCircle-BRNW9lmT.js";import"./ChevronUp-BurUkCqE.js";import"./ChevronDown-Di-ZHzN-.js";import"./DotsVertical-Dsznav3Y.js";import"./Stars02-D2Vky1vN.js";import"./Eye-B8NUm9Br.js";import"./ZoomOut-DHX-bR9F.js";import"./Globe01-BG9Wm5DJ.js";import"./FilterLines-DMbodALc.js";import"./Star01-CaB7lNB9.js";import"./Globe04-Fg_TSPLj.js";import"./HardDrive-BLr46_IN.js";import"./Key01-Dc0MTS9j.js";import"./LayoutLeft-nNhAa0Dy.js";import"./LinkExternal01-D0OVTAOa.js";import"./Monitor01-D_VMj6ZB.js";import"./Sun-vyxrPcie.js";import"./Palette-BmXFbt3l.js";import"./Play-CAiQqhjZ.js";import"./Plus-DHDiWYHk.js";import"./SearchMd-DaWHy1GV.js";import"./Shield01-YoAzrA51.js";import"./Stars01-a6WqibZn.js";import"./Trash01-BzTEx-hS.js";import"./Upload01-DwgHgRix.js";import"./User01-BtO-AoKy.js";import"./Users01-BRTza8nY.js";import"./XClose-qpXD94Yo.js";import"./X-1BuEzBGR.js";import"./Zap-DluXKGP1.js";import"./use-clock-tick-g2v6P087.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CgtuLhVL.js";import"./file-type-icon-C96ES1WD.js";import"./dialog-L9SFsS1U.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-GBPItn3L.js";import"./use-mcp-client-lyJJArps.js";import"./auth-DOooeHhC.js";import"./chat-context-CmZjYRTw.js";import"./hooks-BBwQx9Hj.js";import"./decopilot-sse-pool-R-AtQW2s.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-Bglvu7_H.js";import"./use-collections-B_GMLsdD.js";import"./use-ai-providers-Cyy4e6Er.js";import"./studio-tools-CAUx-JUt.js";import"./use-organization-settings-DmFrFel5.js";import"./shell-layout-DJP1UAvL.js";import"./avatar-BnBqk-2k.js";import"./required-auth-layout-DMkbzFqw.js";import"./use-org-sso-DzO_wPSE.js";import"./sheet-nKeubIDJ.js";import"./integration-icon-g_GK3RAr.js";import"./use-navigate-to-agent-DKc1WVEH.js";import"./use-connection-DKt0DY8s.js";import"./use-mcp-prompts-82Xtua4M.js";import"./form-Ci3Mfx5E.js";import"./label-CjJncELr.js";import"./input-BiM4A7Ep.js";import"./select-lfhjFS6i.js";const dt=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),ut=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),ht=/\/flags\/multivariate\/[^/]+\.ts$/;function xt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function gt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e;if(typeof t!="string"||typeof r!="string")return null;const n=new Date(t),c=new Date(r);return Number.isNaN(n.getTime())||Number.isNaN(c.getTime())||c.getTime()<=n.getTime()?null:{start:n,end:c}}function Z(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(dt.has(r)){const n=gt(e);n&&t.push(n);return}if(ut.has(r)){const n=e.matchers;if(Array.isArray(n))for(const c of n)Z(c,t)}}}function bt(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!ht.test(t))return!1;const r=e.variants;return Array.isArray(r)}function yt(e){if(typeof e=="string"){const i=e.trim();if(i.length===0)return null;try{const m=new URL(i).pathname.split("/").filter(Boolean),p=m[m.length-1];if(p)return decodeURIComponent(p)}catch{}return i.length>80?`${i.slice(0,77)}…`:i}if(!e||typeof e!="object")return null;const t=e,r=t.config,c=t.desktop?.media,o=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,c?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const i of o)if(typeof i=="string"&&i.trim().length>0)return i.trim();const l=t.__resolveType;if(typeof l=="string"){const s=(l.split("/").pop()??l).replace(/\.(tsx?|jsx?)$/i,"");if(s.length>0)return s}return null}function vt(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];typeof n=="number"?t.length>0?t[t.length-1]+=`[${n}]`:t.push(`[${n}]`):t.push(n)}return t.join(" · ")}function H(e,t,r,n,c){if(bt(e)){const o=vt(n),l=e.variants,i=e.__resolveType;l.forEach((s,m)=>{if(!s||typeof s!="object")return;const p=s,d=[];if(Z(p.rule,d),d.length===0)return;const x=yt(p.value)??(o||r);for(const g of d)c.push({blockKey:t,blockLabel:r,innerPath:o,variantIndex:m,start:g.start,end:g.end,label:x,flagResolveType:i})});for(let s=0;s<l.length;s++){const m=l[s];m&&typeof m=="object"&&H(m.value,t,r,[...n,"variants",s,"value"],c)}return}if(Array.isArray(e)){for(let o=0;o<e.length;o++)H(e[o],t,r,[...n,o],c);return}if(e&&typeof e=="object")for(const[o,l]of Object.entries(e))o!=="__resolveType"&&H(l,t,r,[...n,o],c)}function Tt(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))H(n,r,xt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function jt(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,c)=>{const o=c*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${o})`,text:"white",border:`oklch(0.50 0.14 ${o})`})}),r}const Nt={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function tt(e,t){return e.get(t)??Nt}const kt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],et=["January","February","March","April","May","June","July","August","September","October","November","December"],wt=1440*60*1e3;function L(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function rt(e){return new Date(e.getFullYear(),e.getMonth(),1)}function $(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function I(e,t){const r=new Date(e);return r.setDate(r.getDate()+t),r}function G(e,t){return Math.round((L(e).getTime()-L(t).getTime())/wt)}function _t(e){const t=I(e,-e.getDay()),r=[];for(let n=0;n<6;n++){const c=[];for(let o=0;o<7;o++)c.push(I(t,n*7+o));r.push(c)}for(;r.length>0&&r[r.length-1].every(n=>n.getMonth()!==e.getMonth());)r.pop();return r}function Mt(e,t){const r=L(e[0]),n=I(r,7),c=[];for(const i of t){const s=L(i.start),m=L(i.end);if(m.getTime()<r.getTime()||s.getTime()>=n.getTime())continue;const p=s.getTime()<r.getTime()?r:s,d=m.getTime()>=n.getTime()?I(n,-1):m,u=G(p,r),x=G(d,p)+1;x<=0||c.push({variant:i,startCol:u,span:x})}c.sort((i,s)=>i.startCol-s.startCol||s.span-i.span||i.variant.blockKey.localeCompare(s.variant.blockKey));const o=[],l=[];for(const i of c){let s=o.findIndex(m=>m<=i.startCol);s===-1&&(s=o.length,o.push(0)),o[s]=i.startCol+i.span,l.push({...i,lane:s})}return l}const U=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function St(e){return`${U.format(e.start)} → ${U.format(e.end)}`}function At(e){const t=R.c(17),{variant:r}=e;let n;t[0]!==r.blockLabel?(n=a.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=n):n=t[1];let c;t[2]!==r.innerPath?(c=r.innerPath&&a.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=c):c=t[3];let o;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(o=r.label!==r.blockLabel&&r.label!==r.innerPath&&a.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=o):o=t[7];let l;t[8]!==r?(l=St(r),t[8]=r,t[9]=l):l=t[9];let i;t[10]!==l?(i=a.jsx("div",{className:"mt-1",children:l}),t[10]=l,t[11]=i):i=t[11];let s;return t[12]!==n||t[13]!==c||t[14]!==o||t[15]!==i?(s=a.jsx(pt,{children:a.jsxs("div",{className:"text-xs",children:[n,c,o,i]})}),t[12]=n,t[13]=c,t[14]=o,t[15]=i,t[16]=s):s=t[16],s}function nt(e){const t=R.c(14),{variant:r,color:n,style:c,children:o}=e;let l;t[0]!==n.bg||t[1]!==n.text||t[2]!==c?(l={background:n.bg,color:n.text,borderRadius:4,...c},t[0]=n.bg,t[1]=n.text,t[2]=c,t[3]=l):l=t[3];let i;t[4]!==o?(i=a.jsx("span",{className:"truncate",children:o}),t[4]=o,t[5]=i):i=t[5];let s;t[6]!==l||t[7]!==i?(s=a.jsx(ct,{asChild:!0,children:a.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:l,children:i})}),t[6]=l,t[7]=i,t[8]=s):s=t[8];let m;t[9]!==r?(m=a.jsx(At,{variant:r}),t[9]=r,t[10]=m):m=t[10];let p;return t[11]!==s||t[12]!==m?(p=a.jsxs(mt,{children:[s,m]}),t[11]=s,t[12]=m,t[13]=p):p=t[13],p}function pr(e){const t=R.c(39),{decofile:r}=e,[n,c]=K.useState("calendar"),[o,l]=K.useState(Ct);let i,s;t[0]!==r?(s=Tt(r),i=jt(s.map(Et)),t[0]=r,t[1]=i,t[2]=s):(i=t[1],s=t[2]);const m=i;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=()=>l(rt(new Date)),t[3]=p):p=t[3];const d=p;let u;t[4]!==n?(u=()=>l(k=>n==="calendar"?$(k,-1):$(k,-3)),t[4]=n,t[5]=u):u=t[5];const x=u;let g;t[6]!==n?(g=()=>l(k=>n==="calendar"?$(k,1):$(k,3)),t[6]=n,t[7]=g):g=t[7];const w=g;let N;t[8]===Symbol.for("react.memo_cache_sentinel")?(N=a.jsx(O,{variant:"outline",size:"sm",onClick:d,children:"Today"}),t[8]=N):N=t[8];let E;t[9]===Symbol.for("react.memo_cache_sentinel")?(E=a.jsx(at,{size:16}),t[9]=E):E=t[9];let _;t[10]!==x?(_=a.jsx(O,{variant:"ghost",size:"icon",className:"size-8",onClick:x,"aria-label":"Previous",children:E}),t[10]=x,t[11]=_):_=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(lt,{size:16}),t[12]=f):f=t[12];let b;t[13]!==w?(b=a.jsx(O,{variant:"ghost",size:"icon",className:"size-8",onClick:w,"aria-label":"Next",children:f}),t[13]=w,t[14]=b):b=t[14];const M=et[o.getMonth()];let y;t[15]!==o?(y=o.getFullYear(),t[15]=o,t[16]=y):y=t[16];let v;t[17]!==M||t[18]!==y?(v=a.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[M," ",y]}),t[17]=M,t[18]=y,t[19]=v):v=t[19];let T;t[20]!==v||t[21]!==_||t[22]!==b?(T=a.jsxs("div",{className:"flex items-center gap-2",children:[N,_,b,v]}),t[20]=v,t[21]=_,t[22]=b,t[23]=T):T=t[23];let C;t[24]===Symbol.for("react.memo_cache_sentinel")?(C={value:"calendar",icon:a.jsx(Q,{}),label:"Calendar"},t[24]=C):C=t[24];let j;t[25]===Symbol.for("react.memo_cache_sentinel")?(j=[C,{value:"timeline",icon:a.jsx(it,{}),label:"Timeline"}],t[25]=j):j=t[25];let h;t[26]!==n?(h=a.jsx(ft,{value:n,onValueChange:c,options:j}),t[26]=n,t[27]=h):h=t[27];let S;t[28]!==T||t[29]!==h?(S=a.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[T,h]}),t[28]=T,t[29]=h,t[30]=S):S=t[30];let A;t[31]!==m||t[32]!==o||t[33]!==s||t[34]!==n?(A=s.length===0?a.jsx(Dt,{}):n==="calendar"?a.jsx($t,{monthStart:o,variants:s,colorMap:m}):a.jsx(Vt,{monthStart:o,variants:s,colorMap:m}),t[31]=m,t[32]=o,t[33]=s,t[34]=n,t[35]=A):A=t[35];let D;return t[36]!==S||t[37]!==A?(D=a.jsxs("div",{className:"flex h-full w-full flex-col",children:[S,A]}),t[36]=S,t[37]=A,t[38]=D):D=t[38],D}function Et(e){return e.blockKey}function Ct(){return rt(new Date)}function Dt(){const e=R.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[a.jsx(Q,{size:24,className:"text-muted-foreground/60"}),a.jsx("div",{children:"No scheduled variants."}),a.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Variants gated by a date matcher appear here."})]}),e[0]=t):t=e[0],t}const z=20,J=2,q=28;function $t(e){const t=R.c(17),{monthStart:r,variants:n,colorMap:c}=e;let o,l,i,s,m;if(t[0]!==c||t[1]!==r||t[2]!==n){const u=_t(r),x=L(new Date);o=X,m="flex-1 min-h-0",l="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:kt.map(Rt)}),t[8]=i):i=t[8],s=u.map((g,w)=>{const N=Mt(g,n),E=N.reduce(Lt,0),_=q+E*(z+J)+8;return a.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:_},children:[g.map((f,b)=>{const M=f.getMonth()===r.getMonth(),y=f.getTime()===x.getTime();return a.jsx("div",{className:W("border-r last:border-r-0 px-2 pt-1.5 text-xs",M?"bg-background":"bg-muted/30 text-muted-foreground"),children:a.jsx("span",{className:W("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",y&&"bg-primary text-primary-foreground font-semibold"),children:f.getDate()})},b)}),N.map((f,b)=>{const M=tt(c,f.variant.blockKey),y=q+f.lane*(z+J),v=f.startCol/7*100,T=f.span/7*100;return a.jsxs(nt,{variant:f.variant,color:M,style:{top:y,left:`calc(${v}% + 2px)`,width:`calc(${T}% - 4px)`,height:z},children:[f.variant.blockLabel,f.variant.label!==f.variant.blockLabel&&a.jsxs("span",{className:"opacity-70",children:[" · ",f.variant.label]})]},`${w}-${b}`)})]},w)}),t[0]=c,t[1]=r,t[2]=n,t[3]=o,t[4]=l,t[5]=i,t[6]=s,t[7]=m}else o=t[3],l=t[4],i=t[5],s=t[6],m=t[7];let p;t[9]!==l||t[10]!==i||t[11]!==s?(p=a.jsxs("div",{className:l,children:[i,s]}),t[9]=l,t[10]=i,t[11]=s,t[12]=p):p=t[12];let d;return t[13]!==o||t[14]!==m||t[15]!==p?(d=a.jsx(o,{className:m,children:p}),t[13]=o,t[14]=m,t[15]=p,t[16]=d):d=t[16],d}function Lt(e,t){return Math.max(e,t.lane+1)}function Rt(e){return a.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const V=4,Pt=32,P=240;function Vt(e){const t=R.c(27),{monthStart:r,variants:n,colorMap:c}=e,o=r;let l,i,s,m,p,d;if(t[0]!==c||t[1]!==r||t[2]!==o||t[3]!==n){const g=$(r,V),w=new Date,N=new Map;for(const j of n){const h=N.get(j.blockKey)??[];h.push(j),N.set(j.blockKey,h)}const E=Array.from(N.entries()).sort(Ot),_=g.getTime()-o.getTime(),f=j=>(Math.max(o.getTime(),Math.min(g.getTime(),j.getTime()))-o.getTime())/_*100;let b;t[10]!==o?(b=(j,h)=>$(o,h),t[10]=o,t[11]=b):b=t[11];const M=Array.from({length:V},b),y=w.getTime()>=o.getTime()&&w.getTime()<=g.getTime()?f(w):null;l=X,d="flex-1 min-h-0",i="min-w-[900px] relative";let v;t[12]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:{width:P},children:"Variant / Block"}),t[12]=v):v=t[12];let T;t[13]===Symbol.for("react.memo_cache_sentinel")?(T={gridTemplateColumns:`repeat(${V}, minmax(0, 1fr))`},t[13]=T):T=t[13];const C=M.map(It);t[14]!==C?(s=a.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[v,a.jsx("div",{className:"flex-1 grid",style:T,children:C})]}),t[14]=C,t[15]=s):s=t[15],t[16]!==y?(m=y!==null&&a.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${P}px + (100% - ${P}px) * ${y} / 100)`},children:a.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]=y,t[17]=m):m=t[17],p=E.map(j=>{const[h,S]=j,A=tt(c,h),D=S[0]?.blockLabel??h;return a.jsxs("div",{children:[a.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:a.jsx("div",{className:"px-3 truncate",style:{width:P},children:D})}),S.map((k,st)=>a.jsxs("div",{className:"flex border-b items-center",style:{height:Pt},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:P},children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:A.bg}}),a.jsx("span",{className:"truncate text-foreground/80",children:k.label})]}),a.jsxs("div",{className:"relative flex-1 h-full",children:[a.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${V}, minmax(0, 1fr))`},children:M.map(Ht)}),(()=>{const B=Math.max(k.start.getTime(),o.getTime()),F=Math.min(k.end.getTime(),g.getTime());if(F<=B)return null;const Y=f(new Date(B)),ot=f(new Date(F))-Y;return a.jsx(nt,{variant:k,color:A,style:{top:"50%",transform:"translateY(-50%)",left:`${Y}%`,width:`calc(${ot}% - 2px)`,height:22},children:k.label})})()]})]},st))]},h)}),t[0]=c,t[1]=r,t[2]=o,t[3]=n,t[4]=l,t[5]=i,t[6]=s,t[7]=m,t[8]=p,t[9]=d}else l=t[4],i=t[5],s=t[6],m=t[7],p=t[8],d=t[9];let u;t[18]!==i||t[19]!==s||t[20]!==m||t[21]!==p?(u=a.jsxs("div",{className:i,children:[s,m,p]}),t[18]=i,t[19]=s,t[20]=m,t[21]=p,t[22]=u):u=t[22];let x;return t[23]!==l||t[24]!==d||t[25]!==u?(x=a.jsx(l,{className:d,children:u}),t[23]=l,t[24]=d,t[25]=u,t[26]=x):x=t[26],x}function Ht(e,t){return a.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function It(e,t){return a.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[et[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function Ot(e,t){return e[0].localeCompare(t[0])}export{pr 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-DrM3Gy-E.js";import{b as k,T as I,a as P}from"./tooltip-Cs_BNuMF.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-DrM3Gy-E.js"></script>
|
|
60
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Bh2oT8fz.css">
|
|
61
61
|
</head>
|
|
62
62
|
<body>
|
|
63
63
|
<div id="root"></div>
|
package/dist/server/cli.js
CHANGED
|
@@ -80698,7 +80698,7 @@ ${$}`;_(Z);return}if(E(null,B),t.strategy==="count"){if(w--,w===0)_()}if(t.strat
|
|
|
80698
80698
|
DELETE FROM link_sandboxes
|
|
80699
80699
|
WHERE handle = $handle
|
|
80700
80700
|
`);function d(_){if(t===void 0)return!0;let v=P1i(_),h=v&&P1i(t)?yVu(t):t,D=v?yVu(_):TVu(_),g=EQt(h,D);return g===""||!g.startsWith("..")&&!lQt(g)}return{upsert(_){f.run({$handle:_.handle,$status:_.status,$sandboxPath:_.sandboxPath,$port:_.port??null,$previewUrl:_.previewUrl??null,$repoCloneUrl:_.repoCloneUrl??null,$branch:_.branch??null,$projectName:_.projectName??null,$error:_.error??null,$now:Date.now()})},list(){return l.all().map(sQi)},reconcile(){let _=Date.now();for(let v of l.all().map(sQi)){if(!d(v.sandboxPath)){c.run({$handle:v.handle,$now:_});continue}if(!P1i(v.sandboxPath)){E.run({$handle:v.handle,$now:_});continue}if(v.status==="spawning"||v.status==="ready"||v.status==="failed"||v.status==="missing")$.run({$handle:v.handle,$now:_})}return l.all().map(sQi)},prune(_){let v=[],h=[],D=this.reconcile();for(let g of D){if(!d(g.sandboxPath)){h.push({handle:g.handle,sandboxPath:g.sandboxPath,reason:"outside_root",deletedFiles:!1});continue}if(_.missing&&g.status==="missing"){w.run({$handle:g.handle}),v.push({handle:g.handle,sandboxPath:g.sandboxPath,reason:"missing",deletedFiles:!1});continue}if(!_.merged||!P1i(g.sandboxPath))continue;if(g.branch===null||g.branch.trim()===""){h.push({handle:g.handle,sandboxPath:g.sandboxPath,reason:"no_branch",deletedFiles:!1});continue}if(!BY(g.sandboxPath,["rev-parse","--is-inside-work-tree"]).ok){h.push({handle:g.handle,sandboxPath:g.sandboxPath,reason:"git_unavailable",deletedFiles:!1});continue}let N=BY(g.sandboxPath,["status","--porcelain"]);if(!N.ok){h.push({handle:g.handle,sandboxPath:g.sandboxPath,reason:"git_unavailable",deletedFiles:!1});continue}if(N.stdout.trim()!==""){h.push({handle:g.handle,sandboxPath:g.sandboxPath,reason:"dirty_worktree",deletedFiles:!1});continue}let Z=_Qt(g.sandboxPath,g.branch);if(Z===null){h.push({handle:g.handle,sandboxPath:g.sandboxPath,reason:"git_unavailable",deletedFiles:!1});continue}if(!Z){h.push({handle:g.handle,sandboxPath:g.sandboxPath,reason:"branch_not_merged",deletedFiles:!1});continue}tQt(g.sandboxPath,{recursive:!0,force:!0}),w.run({$handle:g.handle}),v.push({handle:g.handle,sandboxPath:g.sandboxPath,reason:"merged",deletedFiles:!0})}return{removed:v,skipped:h}},close(){u.close()}}}var pQi=()=>{};import{randomBytes as vQt}from"crypto";import{mkdir as hQt}from"fs/promises";import{createServer as DQt}from"net";import{join as gQt}from"path";function xVu(i,u){return Error(`sandbox failed to start: ${i}`,{cause:u})}function OQt(i){if(!(i instanceof Error))return!1;return i.name==="TimeoutError"||/timed out|timeout|operation was aborted|aborted/i.test(i.message)}function IVu(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 NQt(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 ZQt(i){return{repoCloneUrl:i.repo?.cloneUrl??null,branch:i.repo?.branch??null,projectName:NQt(i.repo?.cloneUrl)}}function AVu(i){let u=i.maxSandboxes??20,t=new Map,f=i.pickPort??BQt,l=i.fetchImpl??fetch,c=i.resolvePreviewUrl??((g,N)=>`http://127.0.0.1:${N}`),E=(g)=>gQt(i.dataDir,"sandboxes",g),$=(g)=>{try{i.registry?.upsert(g)}catch(N){console.warn(`[user-desktop] failed to persist sandbox lifecycle handle=${g.handle} status=${g.status}:`,N)}},w=(g)=>{try{i.onEvent?.(g)}catch{}},d=async(g)=>{let N=new AbortController,Z=setTimeout(()=>N.abort(),1500);try{let B=await l(`${g}/health`,{signal:N.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 N=g[0];console.log(`[user-desktop] evicting LRU victim handle=${N.handle} port=${N.port} (cap ${u} reached, size=${t.size})`);try{N.process.kill("SIGTERM")}catch{}t.delete(N.handle),$({handle:N.handle,status:"stopped",sandboxPath:E(N.handle),port:null,previewUrl:null,...N.registryMetadata,error:null}),w({handle:N.handle,phase:"evicted"})}let D=async(g)=>{let N=ZQt(g),Z=E(g.handle);$({handle:g.handle,status:"spawning",sandboxPath:Z,port:null,previewUrl:null,...N,error:null}),w({handle:g.handle,phase:"spawning"}),h();let B,F=null,y;try{await hQt(Z,{recursive:!0}),console.log(`[user-desktop] ensure handle=${g.handle} repo=${g.repo?.cloneUrl??"(none)"} branch=${g.repo?.branch??"(none)"} runtime=${g.workload?.runtime??"(autodetect)"} pm=${g.workload?.packageManager??"(autodetect)"}`),y=vQt(24).toString("hex");let[j,A]=await Promise.all([f(),f()]);B=j,console.log(`[user-desktop] spawn handle=${g.handle} port=${B} devPort=${A} workdir=${Z}`),F=await Promise.resolve(i.spawnDaemon({workdir:Z,handle:g.handle,port:B,daemonToken:y,offloadAllowedHosts:g.offloadAllowedHosts??[],offloadAllowSameHostDev:g.offloadAllowSameHostDev??!1,orgFsConfigJson:g.orgFsConfigJson}));try{await i.waitForHealth(B)}catch(n){throw xVu("the sandbox didn't come online in time",n)}console.log(`[user-desktop] healthy handle=${g.handle} port=${B} \u2014 posting config`);try{await i.postConfig(B,A,{repo:g.repo,workload:g.workload,operator:g.operator},y)}catch(n){throw xVu(OQt(n)?"configuration timed out":"the sandbox rejected its configuration",n)}}catch(j){if(console.error(`[user-desktop] sandbox bring-up failed handle=${g.handle} port=${B??"(none)"}${F?" (killing daemon)":""}:`,j),F)try{F.kill("SIGKILL")}catch{}throw w({handle:g.handle,phase:"failed",error:IVu(j)}),$({handle:g.handle,status:"failed",sandboxPath:Z,port:null,previewUrl:null,...N,error:IVu(j)}),j}if(!F||B===void 0)throw Error("sandbox bring-up invariant violated");let T=`http://127.0.0.1:${B}`,U=c(g.handle,B);console.log(`[user-desktop] ready handle=${g.handle} port=${B} sandboxApiUrl=${T} previewUrl=${U}`);let I={handle:g.handle,port:B,process:F,sandboxApiUrl:T,previewUrl:U,lastUsedAt:Date.now(),activeDispatchCount:0,daemonToken:y,registryMetadata:N};if(t.set(g.handle,I),$({handle:g.handle,status:"ready",sandboxPath:Z,port:B,previewUrl:U,...N,error:null}),w({handle:g.handle,phase:"ready",port:B,previewUrl:U}),F.exited)F.exited.then(()=>{if(t.get(g.handle)===I)console.warn(`[user-desktop] daemon process exited unexpectedly handle=${g.handle} port=${B} \u2014 removing from cache`),t.delete(g.handle),$({handle:g.handle,status:"stopped",sandboxPath:Z,port:null,previewUrl:null,...N,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 N=t.get(g.handle);if(N){if(await d(N.sandboxApiUrl))return console.log(`[user-desktop] cache hit handle=${g.handle} port=${N.port} (alive)`),N.lastUsedAt=Date.now(),{sandboxApiUrl:N.sandboxApiUrl,previewUrl:N.previewUrl,port:N.port};console.warn(`[user-desktop] cache stale handle=${g.handle} port=${N.port} \u2014 respawning`),_(N)}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 N=t.get(g);if(N)N.lastUsedAt=Date.now();return N?.port??null},getDaemonToken(g){return t.get(g)?.daemonToken??null},hasHandle(g){return t.has(g)||v.has(g)},recordHit(g){let N=t.get(g);if(N)N.lastUsedAt=Date.now()},acquireDispatch(g){let N=t.get(g);if(!N)return()=>{};N.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 N=t.get(g);if(!N){console.log(`[user-desktop] delete handle=${g} (not found, no-op)`);return}if(N.activeDispatchCount>0){console.warn(`[user-desktop] delete handle=${g} port=${N.port} REFUSED \u2014 ${N.activeDispatchCount} active dispatch(es) in flight`);return}console.log(`[user-desktop] delete handle=${g} port=${N.port}`);try{N.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 BQt(){return new Promise((i,u)=>{let t=DQt();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 GVu=()=>{};import{randomUUID as FQt}from"crypto";import{hostname as yQt}from"os";async function nVu(i){let u=yQt()||void 0;i.monitor?.onMachine?.(u??"this machine");let t=NHu(i.dataDir,{outFd:i.logFd,perSandboxLog:i.perSandboxLogs,hotReload:i.hotReload}),f=I1i({path:x1i(i.dataDir),managedSandboxRoot:`${i.dataDir}/sandboxes`}),l=!1,c=()=>{if(l)return;l=!0;try{f.close()}catch{}};try{let E=0,$=AVu({dataDir:i.dataDir,registry:f,resolvePreviewUrl:(A,n)=>E>0?`http://${A}.localhost:${E}`:`http://127.0.0.1:${n}`,spawnDaemon:async(A)=>{let n={DAEMON_BOOT_ID:FQt(),APP_ROOT:A.workdir,PROXY_PORT:String(A.port),DAEMON_TOKEN:A.daemonToken,OFFLOAD_ALLOWED_HOSTS:A.offloadAllowedHosts.join(","),...A.offloadAllowSameHostDev?{OFFLOAD_ALLOW_SAME_HOST_DEV:"1"}:{}};if(A.orgFsConfigJson){let S=await yHu(i.dataDir);if(S)n.ORGFS_CONFIG=A.orgFsConfigJson,n.ORGFS_RCLONE_PATH=S}let M=await t({workdir:A.workdir,env:n,daemonPort:A.port});return{port:A.port,kill:(S)=>M.kill(S),exited:M.exited.then(()=>{return})}},postConfig:async(A,n,M,S)=>{let Y={port:n};if(M.workload)Y.runtime=M.workload.runtime,Y.packageManager={name:M.workload.packageManager,...M.workload.packageManagerPath?{path:M.workload.packageManagerPath}:{}};let V={application:Y},W=ed(M.operator??null);if(W)V.operator=W;if(M.repo)V.git={repository:{cloneUrl:M.repo.cloneUrl,branch:M.repo.branch},...M.repo.userName&&M.repo.userEmail?{identity:{userName:M.repo.userName,userEmail:M.repo.userEmail}}:{}};await lN(`http://127.0.0.1:${A}`,S,V)},waitForHealth:async(A)=>{await I4i(`http://127.0.0.1:${A}`)},maxSandboxes:20,onEvent:i.monitor?.onEvent}),w=await wVu({port:i.port,lookupSandboxPort:(A)=>$.proxyPort(A)});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=UHu({provider:$}),_=async()=>{let A=await H2({dataDir:i.dataDir,target:i.clusterBaseUrl});if(!A)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 A.accessToken},v=await BVu(i.dataDir),h=process.env.npm_package_version??"0.0.0",D=await oQi(),g=NVu(D,{onChange:(A)=>{console.log(`[link-daemon] capabilities detected: +${A.join(",")} (now: ${D.join(",")})`)}}),N=HWi({path:`${i.dataDir}/link/outbox.sqlite`});N.clear();let Z=()=>{},B=new AbortController,F={clusterBaseUrl:i.clusterBaseUrl,getAccessToken:_,provider:$,outbox:N,controlHandler:d,capabilities:D,machineId:v,cliVersion:h,previewPort:w.port,onConnected:()=>{i.monitor?.onCluster?.("linked"),console.log(`Linked to ${i.clusterBaseUrl}`)},onShutdown:()=>Z(),runLifetimeSignal:B.signal};console.log(`[link-daemon] transport=tunnel cluster=${i.clusterBaseUrl}`);let y=await aqu(F);console.log("[link-daemon] active transport=tunnel");let T,U=new Promise((A)=>{T=A}),I=!1,j=async()=>{if(I)return;I=!0,B.abort(),console.log(`
|
|
80701
|
-
Shutting down\u2026`),g();try{await y.close()}catch{}try{await w.stop()}catch{}try{await $.shutdown()}catch{}try{N.close()}catch{}c(),T(0)};return process.on("SIGINT",()=>void j()),process.on("SIGTERM",()=>void j()),Z=()=>{console.log("Disconnect requested from the Studio web UI \u2014 shutting down. Run `bunx decocms@latest link` to reconnect."),j()},y.closed.then(()=>{if(i.monitor?.onCluster?.("closed"),!I)console.error("Cluster connection closed permanently; exiting."),j()}),{stopped:U,stop:j}}catch(E){throw c(),E}}var kVu=O(()=>{JWi();jC();ZHu();THu();PHu();bWi();oqu();dVu();ZVu();FVu();kC();pQi();GVu()});function iHi(i){return i.map((u)=>typeof u==="string"?u:String(u)).join(" ")}var A1i;var uHi=O(()=>{A1i={name:"decocms",version:"3.79.2",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/mesh"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:'bun run migrate && concurrently "bun run dev:client" "bun run dev:server"',"dev:servers":'concurrently "bun run dev:client" "bun run dev:server"',"dev:client":"vite dev","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts","build:client":"bun --bun vite build","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","db:migrate":"bun run ./dist/server/migrate.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts",test:"bun test","test:ct":"playwright test -c playwright-ct.config.ts","test:ct:ui":"playwright test -c playwright-ct.config.ts --ui","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts","smoke:link":"bun run scripts/smoke-link.ts",prepublishOnly:"bun run build:client && bun run build:server"},optionalDependencies:{"@anthropic-ai/claude-agent-sdk":"^0.3.181","@duckdb/node-api":"^1.5.0-r.1","@openai/codex":"0.141.0","@openai/codex-darwin-arm64":"npm:@openai/codex@0.141.0-darwin-arm64","@openai/codex-darwin-x64":"npm:@openai/codex@0.141.0-darwin-x64","@openai/codex-linux-arm64":"npm:@openai/codex@0.141.0-linux-arm64","@openai/codex-linux-x64":"npm:@openai/codex@0.141.0-linux-x64","@openai/codex-win32-arm64":"npm:@openai/codex@0.141.0-win32-arm64","@openai/codex-win32-x64":"npm:@openai/codex@0.141.0-win32-x64"},dependencies:{"@ai-sdk/anthropic":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@inkjs/ui":"^2.0.0","@modelcontextprotocol/ext-apps":"^1.7.1","@openrouter/ai-sdk-provider":"^2.9.1","@opentelemetry/core":"^2.6.0","@tanstack/react-virtual":"3.13.24","@xterm/addon-fit":"^0.11.0","@xterm/xterm":"^6.0.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0",kysely:"^0.28.12","node-pty":"^1.0.0","posthog-js":"^1.371.1","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@ai-sdk/react":"^3.0.210","@better-auth/sso":"1.4.1","@daveyplate/better-auth-ui":"^3.2.7","@deco/ui":"workspace:*","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/harness":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/mesh-sdk":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/std":"workspace:*","@decocms/tunnel":"workspace:*","@floating-ui/react":"^0.27.16","@happy-dom/global-registrator":"^20.9.0","@hookform/resolvers":"^5.2.2","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@monaco-editor/react":"^4.7.0","@nats-io/jwt":"0.0.10-5","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@playwright/experimental-ct-react":"1.59.1","@playwright/test":"^1.58.2","@radix-ui/react-avatar":"^1.1.10","@radix-ui/react-checkbox":"^1.3.3","@radix-ui/react-dialog":"^1.1.15","@radix-ui/react-dropdown-menu":"^2.1.16","@radix-ui/react-label":"^2.1.7","@radix-ui/react-select":"^2.2.6","@radix-ui/react-separator":"^1.1.7","@radix-ui/react-slot":"^1.2.3","@radix-ui/react-tabs":"^1.1.13","@rjsf/core":"^6.1.2","@rjsf/shadcn":"^6.1.2","@rjsf/utils":"^6.1.2","@rjsf/validator-ajv8":"^6.1.2","@tailwindcss/vite":"^4.1.17","@tanstack/react-query":"5.100.10","@tanstack/react-router":"1.169.2","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.2","@tiptap/core":"3.20.2","@tiptap/extension-placeholder":"3.20.2","@tiptap/pm":"3.20.2","@tiptap/react":"3.20.2","@tiptap/starter-kit":"3.20.2","@tiptap/suggestion":"3.20.2","@types/bun":"^1.3.1","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@untitledui/icons":"^0.0.19","@vercel/nft":"^1.1.1","@vitejs/plugin-react":"^5.1.0",ai:"^6.0.208","babel-plugin-react-compiler":"^1.0.0","better-auth":"1.4.22","class-variance-authority":"^0.7.1",clsx:"^2.1.1",concurrently:"^9.2.1",croner:"^9.1.0","date-fns":"^4.1.0",degit:"^2.8.4",hono:"^4.10.7","input-otp":"^1.4.2",jose:"^6.0.11","lucide-react":"^0.468.0",marked:"^15.0.6",nanoid:"^5.1.6",pg:"^8.16.3",prettier:"^3.4.2","react-hook-form":"^7.66.0","react-markdown":"^10.1.0","react-resizable-panels":"^2.1.7","react-syntax-highlighter":"^15.6.1",recharts:"^3.6.0","rehype-raw":"^7.0.0","remark-gfm":"^4.0.0","sass-embedded":"^1.97.2",sonner:"^2.0.7","tailwind-merge":"^3.3.1",tailwindcss:"^4.1.17",typescript:"^5.9.3",vite:"^7.2.1","vite-tsconfig-paths":"^5.1.4",zod:"^4.0.0"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","mesh","tools"],license:"MIT",publishConfig:{access:"public"}}});var EM={};Qi(EM,{printBanner:()=>PQt,bannerLines:()=>jVu,BANNER_LINES:()=>G1i,BANNER_GRADIENT:()=>n1i});function UQt(i){let u=Number.parseInt(i.slice(1),16);return[u>>16&255,u>>8&255,u&255]}function jVu(i){let u=G1i.map((t,f)=>{let[l,c,E]=UQt(n1i[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 PQt(i){console.log("");for(let u of jVu(i))console.log(u);console.log("")}var G1i,n1i;var FY=O(()=>{G1i=[" \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 "],n1i=["#00ff64","#00ee5e","#00dc56","#00c84e","#00b444","#00a03c","#008832","#006e28"]});import{Box as xQt,Text as KVu}from"ink";import{jsx as IQt,jsxs as XVu}from"react/jsx-runtime";function k1i({version:i}){return XVu(xQt,{flexDirection:"column",marginTop:1,children:[G1i.map((u,t)=>IQt(KVu,{color:n1i[t],children:u},t)),XVu(KVu,{dimColor:!0,children:[" v",i]})]})}var tHi=O(()=>{FY()});var YVu={};Qi(YVu,{subscribeLinkState:()=>lHi,setPersistedSandboxes:()=>JQt,setMachine:()=>jQt,setLogPath:()=>XQt,setIngress:()=>kQt,setDaemonError:()=>KQt,setClusterUrl:()=>nQt,setCluster:()=>GQt,resetLinkStateForTests:()=>YQt,pushSandboxEvent:()=>SQt,getLinkState:()=>fHi,applySandboxEvent:()=>JVu});function AQt(i){return i==="spawning"||i==="ready"||i==="failed"}function JVu(i,u){let t=new Map(i),f=t.get(u.handle);if(u.phase==="evicted"||u.phase==="deleted"){if(f)t.set(u.handle,{...f,port:null,previewUrl:null,status:"stopped",error:null});return t}return t.set(u.handle,{handle:u.handle,port:u.port??f?.port??null,previewUrl:u.previewUrl??f?.previewUrl??null,status:u.phase,error:u.phase==="failed"?u.error??"failed":null,projectName:f?.projectName??null,branch:f?.branch??null,sandboxPath:f?.sandboxPath??null}),t}function SVu(){return{cluster:"connecting",clusterUrl:null,ingressUrl:null,ingressPort:null,machine:null,cap:20,sandboxes:new Map,daemonError:null,logPath:null}}function o2(){for(let i of j1i)i()}function fHi(){return zl}function lHi(i){return j1i.add(i),()=>j1i.delete(i)}function GQt(i){zl={...zl,cluster:i},o2()}function nQt(i){zl={...zl,clusterUrl:i},o2()}function kQt(i,u){zl={...zl,ingressPort:i,ingressUrl:u},o2()}function jQt(i){zl={...zl,machine:i},o2()}function KQt(i){zl={...zl,daemonError:i},o2()}function XQt(i){zl={...zl,logPath:i},o2()}function JQt(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 zl.sandboxes)if(AQt(f.status))u.set(t,f);zl={...zl,sandboxes:u},o2()}function SQt(i){zl={...zl,sandboxes:JVu(zl.sandboxes,i)},o2()}function YQt(){zl=SVu(),j1i.clear()}var zl,j1i;var cHi=O(()=>{zl=SVu(),j1i=new Set});var LVu={};Qi(LVu,{LinkApp:()=>zQt});import{Box as L6,Text as W6}from"ink";import{useSyncExternalStore as LQt}from"react";import{jsx as V4,jsxs as M5}from"react/jsx-runtime";function WQt(i){if(i.status==="ready")return{color:"green",text:"\u25CF Live"};if(i.status==="spawning")return{color:"yellow",text:"\u25CC Starting\u2026"};if(i.status==="stopped")return{color:"gray",text:"\u25A0 Stopped"};if(i.status==="missing")return{color:"yellow",text:"\u25A1 Missing"};if(i.status==="merged")return{color:"cyan",text:"\u2713 Merged"};if(i.status==="invalid")return{color:"red",text:"\u2717 Invalid"};if(i.status==="failed")return{color:"red",text:`\u2717 Failed: ${i.error??"failed"}`};return{color:"red",text:`\u2717 Error: ${i.error??""}`}}function zQt(){let i=LQt(lHi,fHi),u=[...i.sandboxes.values()].sort((t,f)=>t.handle.localeCompare(f.handle));return M5(L6,{flexDirection:"column",children:[V4(k1i,{version:A1i.version}),V4(L6,{marginBottom:1,children:V4(W6,{dimColor:!0,children:"\u2500".repeat(80)})}),V4(L6,{children:i.cluster==="linked"?M5(W6,{color:"green",children:["\u2713 Connected to ",i.clusterUrl??"deco"]}):i.cluster==="connecting"?M5(W6,{color:"yellow",children:["\u25CC Connecting to ",i.clusterUrl??"deco","\u2026"]}):M5(W6,{color:"red",children:["\u2717 Disconnected from ",i.clusterUrl??"deco"]})}),V4(L6,{children:i.ingressUrl?M5(W6,{color:"green",children:["\u2713 Serving at ",i.ingressUrl]}):V4(W6,{dimColor:!0,children:"\u25CC Starting local server\u2026"})}),V4(L6,{marginBottom:1,children:V4(W6,{dimColor:!0,children:`${"Computer".padEnd(16)}${i.machine??"this computer"} \xB7 ${u.length} of ${i.cap} previews`})}),u.length===0?V4(W6,{dimColor:!0,children:"No previews running yet."}):M5(L6,{flexDirection:"column",children:[M5(L6,{children:[V4(L6,{width:yY.project,flexShrink:0,marginRight:1,children:V4(W6,{dimColor:!0,wrap:"truncate-end",children:"PROJECT"})}),V4(L6,{width:yY.branch,flexShrink:0,marginRight:1,children:V4(W6,{dimColor:!0,wrap:"truncate-end",children:"BRANCH"})}),V4(L6,{width:yY.status,flexShrink:0,marginRight:1,children:V4(W6,{dimColor:!0,wrap:"truncate-end",children:"STATUS"})}),V4(L6,{flexGrow:1,children:V4(W6,{dimColor:!0,wrap:"truncate-end",children:"PREVIEW URL"})})]}),u.map((t)=>{let f=WQt(t);return M5(L6,{children:[V4(L6,{width:yY.project,flexShrink:0,marginRight:1,children:V4(W6,{wrap:"truncate-end",children:t.projectName??t.handle})}),V4(L6,{width:yY.branch,flexShrink:0,marginRight:1,children:V4(W6,{wrap:"truncate-end",children:t.branch??"\u2014"})}),V4(L6,{width:yY.status,flexShrink:0,marginRight:1,children:V4(W6,{color:f.color,wrap:"truncate-end",children:f.text})}),V4(L6,{flexGrow:1,children:V4(W6,{dimColor:!0,wrap:"truncate-end",children:t.previewUrl??"\u2014"})})]},t.handle)})]}),i.daemonError?V4(L6,{marginTop:1,children:M5(W6,{color:"red",children:["\u26A0 ",i.daemonError]})}):null,i.logPath?V4(L6,{marginTop:1,children:M5(W6,{dimColor:!0,children:["Logs: ",i.logPath]})}):null]})}var yY;var WVu=O(()=>{uHi();tHi();cHi();yY={project:18,branch:22,status:14}});var zVu={};Qi(zVu,{runLinkCommand:()=>VQt});import{closeSync as QQt,mkdirSync as HQt,openSync as bQt,writeSync as RQt}from"fs";import{homedir as CQt}from"os";import{join as EHi}from"path";function MQt(i,u){let t={log:console.log,warn:console.warn,error:console.error},f=(l)=>{if(u===void 0)return;try{RQt(u,`${iHi(l)}
|
|
80701
|
+
Shutting down\u2026`),g();try{await y.close()}catch{}try{await w.stop()}catch{}try{await $.shutdown()}catch{}try{N.close()}catch{}c(),T(0)};return process.on("SIGINT",()=>void j()),process.on("SIGTERM",()=>void j()),Z=()=>{console.log("Disconnect requested from the Studio web UI \u2014 shutting down. Run `bunx decocms@latest link` to reconnect."),j()},y.closed.then(()=>{if(i.monitor?.onCluster?.("closed"),!I)console.error("Cluster connection closed permanently; exiting."),j()}),{stopped:U,stop:j}}catch(E){throw c(),E}}var kVu=O(()=>{JWi();jC();ZHu();THu();PHu();bWi();oqu();dVu();ZVu();FVu();kC();pQi();GVu()});function iHi(i){return i.map((u)=>typeof u==="string"?u:String(u)).join(" ")}var A1i;var uHi=O(()=>{A1i={name:"decocms",version:"3.80.0",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/mesh"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:'bun run migrate && concurrently "bun run dev:client" "bun run dev:server"',"dev:servers":'concurrently "bun run dev:client" "bun run dev:server"',"dev:client":"vite dev","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts","build:client":"bun --bun vite build","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","db:migrate":"bun run ./dist/server/migrate.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts",test:"bun test","test:ct":"playwright test -c playwright-ct.config.ts","test:ct:ui":"playwright test -c playwright-ct.config.ts --ui","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts","smoke:link":"bun run scripts/smoke-link.ts",prepublishOnly:"bun run build:client && bun run build:server"},optionalDependencies:{"@anthropic-ai/claude-agent-sdk":"^0.3.181","@duckdb/node-api":"^1.5.0-r.1","@openai/codex":"0.141.0","@openai/codex-darwin-arm64":"npm:@openai/codex@0.141.0-darwin-arm64","@openai/codex-darwin-x64":"npm:@openai/codex@0.141.0-darwin-x64","@openai/codex-linux-arm64":"npm:@openai/codex@0.141.0-linux-arm64","@openai/codex-linux-x64":"npm:@openai/codex@0.141.0-linux-x64","@openai/codex-win32-arm64":"npm:@openai/codex@0.141.0-win32-arm64","@openai/codex-win32-x64":"npm:@openai/codex@0.141.0-win32-x64"},dependencies:{"@ai-sdk/anthropic":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@inkjs/ui":"^2.0.0","@modelcontextprotocol/ext-apps":"^1.7.1","@openrouter/ai-sdk-provider":"^2.9.1","@opentelemetry/core":"^2.6.0","@tanstack/react-virtual":"3.13.24","@xterm/addon-fit":"^0.11.0","@xterm/xterm":"^6.0.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0",kysely:"^0.28.12","node-pty":"^1.0.0","posthog-js":"^1.371.1","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@ai-sdk/react":"^3.0.210","@better-auth/sso":"1.4.1","@daveyplate/better-auth-ui":"^3.2.7","@deco/ui":"workspace:*","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/harness":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/mesh-sdk":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/std":"workspace:*","@decocms/tunnel":"workspace:*","@floating-ui/react":"^0.27.16","@happy-dom/global-registrator":"^20.9.0","@hookform/resolvers":"^5.2.2","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@monaco-editor/react":"^4.7.0","@nats-io/jwt":"0.0.10-5","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@playwright/experimental-ct-react":"1.59.1","@playwright/test":"^1.58.2","@radix-ui/react-avatar":"^1.1.10","@radix-ui/react-checkbox":"^1.3.3","@radix-ui/react-dialog":"^1.1.15","@radix-ui/react-dropdown-menu":"^2.1.16","@radix-ui/react-label":"^2.1.7","@radix-ui/react-select":"^2.2.6","@radix-ui/react-separator":"^1.1.7","@radix-ui/react-slot":"^1.2.3","@radix-ui/react-tabs":"^1.1.13","@rjsf/core":"^6.1.2","@rjsf/shadcn":"^6.1.2","@rjsf/utils":"^6.1.2","@rjsf/validator-ajv8":"^6.1.2","@tailwindcss/vite":"^4.1.17","@tanstack/react-query":"5.100.10","@tanstack/react-router":"1.169.2","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.2","@tiptap/core":"3.20.2","@tiptap/extension-placeholder":"3.20.2","@tiptap/pm":"3.20.2","@tiptap/react":"3.20.2","@tiptap/starter-kit":"3.20.2","@tiptap/suggestion":"3.20.2","@types/bun":"^1.3.1","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@untitledui/icons":"^0.0.19","@vercel/nft":"^1.1.1","@vitejs/plugin-react":"^5.1.0",ai:"^6.0.208","babel-plugin-react-compiler":"^1.0.0","better-auth":"1.4.22","class-variance-authority":"^0.7.1",clsx:"^2.1.1",concurrently:"^9.2.1",croner:"^9.1.0","date-fns":"^4.1.0",degit:"^2.8.4",hono:"^4.10.7","input-otp":"^1.4.2",jose:"^6.0.11","lucide-react":"^0.468.0",marked:"^15.0.6",nanoid:"^5.1.6",pg:"^8.16.3",prettier:"^3.4.2","react-hook-form":"^7.66.0","react-markdown":"^10.1.0","react-resizable-panels":"^2.1.7","react-syntax-highlighter":"^15.6.1",recharts:"^3.6.0","rehype-raw":"^7.0.0","remark-gfm":"^4.0.0","sass-embedded":"^1.97.2",sonner:"^2.0.7","tailwind-merge":"^3.3.1",tailwindcss:"^4.1.17",typescript:"^5.9.3",vite:"^7.2.1","vite-tsconfig-paths":"^5.1.4",zod:"^4.0.0"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","mesh","tools"],license:"MIT",publishConfig:{access:"public"}}});var EM={};Qi(EM,{printBanner:()=>PQt,bannerLines:()=>jVu,BANNER_LINES:()=>G1i,BANNER_GRADIENT:()=>n1i});function UQt(i){let u=Number.parseInt(i.slice(1),16);return[u>>16&255,u>>8&255,u&255]}function jVu(i){let u=G1i.map((t,f)=>{let[l,c,E]=UQt(n1i[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 PQt(i){console.log("");for(let u of jVu(i))console.log(u);console.log("")}var G1i,n1i;var FY=O(()=>{G1i=[" \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 "],n1i=["#00ff64","#00ee5e","#00dc56","#00c84e","#00b444","#00a03c","#008832","#006e28"]});import{Box as xQt,Text as KVu}from"ink";import{jsx as IQt,jsxs as XVu}from"react/jsx-runtime";function k1i({version:i}){return XVu(xQt,{flexDirection:"column",marginTop:1,children:[G1i.map((u,t)=>IQt(KVu,{color:n1i[t],children:u},t)),XVu(KVu,{dimColor:!0,children:[" v",i]})]})}var tHi=O(()=>{FY()});var YVu={};Qi(YVu,{subscribeLinkState:()=>lHi,setPersistedSandboxes:()=>JQt,setMachine:()=>jQt,setLogPath:()=>XQt,setIngress:()=>kQt,setDaemonError:()=>KQt,setClusterUrl:()=>nQt,setCluster:()=>GQt,resetLinkStateForTests:()=>YQt,pushSandboxEvent:()=>SQt,getLinkState:()=>fHi,applySandboxEvent:()=>JVu});function AQt(i){return i==="spawning"||i==="ready"||i==="failed"}function JVu(i,u){let t=new Map(i),f=t.get(u.handle);if(u.phase==="evicted"||u.phase==="deleted"){if(f)t.set(u.handle,{...f,port:null,previewUrl:null,status:"stopped",error:null});return t}return t.set(u.handle,{handle:u.handle,port:u.port??f?.port??null,previewUrl:u.previewUrl??f?.previewUrl??null,status:u.phase,error:u.phase==="failed"?u.error??"failed":null,projectName:f?.projectName??null,branch:f?.branch??null,sandboxPath:f?.sandboxPath??null}),t}function SVu(){return{cluster:"connecting",clusterUrl:null,ingressUrl:null,ingressPort:null,machine:null,cap:20,sandboxes:new Map,daemonError:null,logPath:null}}function o2(){for(let i of j1i)i()}function fHi(){return zl}function lHi(i){return j1i.add(i),()=>j1i.delete(i)}function GQt(i){zl={...zl,cluster:i},o2()}function nQt(i){zl={...zl,clusterUrl:i},o2()}function kQt(i,u){zl={...zl,ingressPort:i,ingressUrl:u},o2()}function jQt(i){zl={...zl,machine:i},o2()}function KQt(i){zl={...zl,daemonError:i},o2()}function XQt(i){zl={...zl,logPath:i},o2()}function JQt(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 zl.sandboxes)if(AQt(f.status))u.set(t,f);zl={...zl,sandboxes:u},o2()}function SQt(i){zl={...zl,sandboxes:JVu(zl.sandboxes,i)},o2()}function YQt(){zl=SVu(),j1i.clear()}var zl,j1i;var cHi=O(()=>{zl=SVu(),j1i=new Set});var LVu={};Qi(LVu,{LinkApp:()=>zQt});import{Box as L6,Text as W6}from"ink";import{useSyncExternalStore as LQt}from"react";import{jsx as V4,jsxs as M5}from"react/jsx-runtime";function WQt(i){if(i.status==="ready")return{color:"green",text:"\u25CF Live"};if(i.status==="spawning")return{color:"yellow",text:"\u25CC Starting\u2026"};if(i.status==="stopped")return{color:"gray",text:"\u25A0 Stopped"};if(i.status==="missing")return{color:"yellow",text:"\u25A1 Missing"};if(i.status==="merged")return{color:"cyan",text:"\u2713 Merged"};if(i.status==="invalid")return{color:"red",text:"\u2717 Invalid"};if(i.status==="failed")return{color:"red",text:`\u2717 Failed: ${i.error??"failed"}`};return{color:"red",text:`\u2717 Error: ${i.error??""}`}}function zQt(){let i=LQt(lHi,fHi),u=[...i.sandboxes.values()].sort((t,f)=>t.handle.localeCompare(f.handle));return M5(L6,{flexDirection:"column",children:[V4(k1i,{version:A1i.version}),V4(L6,{marginBottom:1,children:V4(W6,{dimColor:!0,children:"\u2500".repeat(80)})}),V4(L6,{children:i.cluster==="linked"?M5(W6,{color:"green",children:["\u2713 Connected to ",i.clusterUrl??"deco"]}):i.cluster==="connecting"?M5(W6,{color:"yellow",children:["\u25CC Connecting to ",i.clusterUrl??"deco","\u2026"]}):M5(W6,{color:"red",children:["\u2717 Disconnected from ",i.clusterUrl??"deco"]})}),V4(L6,{children:i.ingressUrl?M5(W6,{color:"green",children:["\u2713 Serving at ",i.ingressUrl]}):V4(W6,{dimColor:!0,children:"\u25CC Starting local server\u2026"})}),V4(L6,{marginBottom:1,children:V4(W6,{dimColor:!0,children:`${"Computer".padEnd(16)}${i.machine??"this computer"} \xB7 ${u.length} of ${i.cap} previews`})}),u.length===0?V4(W6,{dimColor:!0,children:"No previews running yet."}):M5(L6,{flexDirection:"column",children:[M5(L6,{children:[V4(L6,{width:yY.project,flexShrink:0,marginRight:1,children:V4(W6,{dimColor:!0,wrap:"truncate-end",children:"PROJECT"})}),V4(L6,{width:yY.branch,flexShrink:0,marginRight:1,children:V4(W6,{dimColor:!0,wrap:"truncate-end",children:"BRANCH"})}),V4(L6,{width:yY.status,flexShrink:0,marginRight:1,children:V4(W6,{dimColor:!0,wrap:"truncate-end",children:"STATUS"})}),V4(L6,{flexGrow:1,children:V4(W6,{dimColor:!0,wrap:"truncate-end",children:"PREVIEW URL"})})]}),u.map((t)=>{let f=WQt(t);return M5(L6,{children:[V4(L6,{width:yY.project,flexShrink:0,marginRight:1,children:V4(W6,{wrap:"truncate-end",children:t.projectName??t.handle})}),V4(L6,{width:yY.branch,flexShrink:0,marginRight:1,children:V4(W6,{wrap:"truncate-end",children:t.branch??"\u2014"})}),V4(L6,{width:yY.status,flexShrink:0,marginRight:1,children:V4(W6,{color:f.color,wrap:"truncate-end",children:f.text})}),V4(L6,{flexGrow:1,children:V4(W6,{dimColor:!0,wrap:"truncate-end",children:t.previewUrl??"\u2014"})})]},t.handle)})]}),i.daemonError?V4(L6,{marginTop:1,children:M5(W6,{color:"red",children:["\u26A0 ",i.daemonError]})}):null,i.logPath?V4(L6,{marginTop:1,children:M5(W6,{dimColor:!0,children:["Logs: ",i.logPath]})}):null]})}var yY;var WVu=O(()=>{uHi();tHi();cHi();yY={project:18,branch:22,status:14}});var zVu={};Qi(zVu,{runLinkCommand:()=>VQt});import{closeSync as QQt,mkdirSync as HQt,openSync as bQt,writeSync as RQt}from"fs";import{homedir as CQt}from"os";import{join as EHi}from"path";function MQt(i,u){let t={log:console.log,warn:console.warn,error:console.error},f=(l)=>{if(u===void 0)return;try{RQt(u,`${iHi(l)}
|
|
80702
80702
|
`)}catch{}};return console.log=(...l)=>f(l),console.warn=(...l)=>f(l),console.error=(...l)=>{f(l),i(iHi(l))},()=>{console.log=t.log,console.warn=t.warn,console.error=t.error}}async function qQt(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 VQt(i={}){let u=i.port??5174,t=i.dataDir??process.env.DATA_DIR??process.env.DECOCMS_HOME??EHi(CQt(),"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=EHi(t,"sandboxes");E=I1i({path:x1i(t),managedSandboxRoot:w});let d=await T4i({dataDir:t,intent:"Link",target:f});if(process.env.DECOCMS_LINK_MANAGED!=="1")await qQt(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:N}=await import("react"),{LinkApp:Z}=await Promise.resolve().then(() => (WVu(),LVu)),{pushSandboxEvent:B,setCluster:F,setClusterUrl:y,setDaemonError:T,setIngress:U,setLogPath:I,setMachine:j,setPersistedSandboxes:A}=await Promise.resolve().then(() => (cHi(),YVu));HQt(t,{recursive:!0});let n=EHi(t,"link.log");c=bQt(n,"w"),I(n),A(_),y(f),F("connecting"),v={onEvent:(M)=>B(M),onIngress:(M)=>U(M,`http://127.0.0.1:${M}`),onCluster:(M)=>F(M),onMachine:(M)=>j(M)},l=MQt(T,c),g(N(Z),{patchConsole:!1})}else if(i.banner!==!1){let{printBanner:g}=await Promise.resolve().then(() => (FY(),EM));g(i.version??"0.0.0")}$();let h=process.env.DECOCMS_LINK_MANAGED!=="1";return await(await nVu({port:u,clusterBaseUrl:f,dataDir:t,session:d,monitor:v,logFd:c,perSandboxLogs:h,hotReload:i.hotReload})).stopped}catch(w){return l?.(),console.error(w instanceof Error?w.message:String(w)),1}finally{if(l?.(),c!==void 0)try{QQt(c)}catch{}$()}}var QVu=O(()=>{XWi();kVu();pQi()});var hHi={};Qi(hHi,{resolveDevLinkClusterUrl:()=>aQt,populateDevLinkToxiProxy:()=>qVu,isDevLinkToxiProxyEnabled:()=>eQt,ensureDevLinkToxiProxy:()=>uHt,buildDevLinkToxiProxyConfig:()=>CVu,DEV_LINK_TOXIPROXY_SERVICE_NAME:()=>bVu,DEV_LINK_TOXIPROXY_PROXY_NAME:()=>RVu});function eQt(i=process.env){return i.DECO_DEV_LINK_TOXIPROXY==="1"}function $Hi(i,u){if(!Number.isInteger(i)||i<1||i>65535)throw Error(`${u} must be an integer port in 1..65535`);return i}function CVu(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=$Hi(i.apiPort,"apiPort"),f=$Hi(i.listenPort,"listenPort");if(u.port.length===0)throw Error("serverUrl must include an explicit valid port");let l=$Hi(Number.parseInt(u.port,10),"upstreamPort"),c=`http://127.0.0.1:${l}`,E=`http://127.0.0.1:${f}`;return{serviceName:bVu,proxyName:RVu,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 aQt(i){return i.toxiproxy?.clusterUrl??i.serverUrl}async function wHi(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 vHi(i){if(i instanceof Error)return i.name==="Error"?i.message:`${i.name}: ${i.message}`;return String(i)}function MVu(i){if(!(i instanceof Error))return!1;if(i.name==="TimeoutError")return!0;return MVu(i.cause)}async function dHi(i,u,t,f){try{return await i(t,f)}catch(l){throw Error(`ToxiProxy ${u} failed for ${t}: ${vHi(l)}`,{cause:l})}}async function qVu(i,u=fetch){let t=`${i.apiUrl}/reset`,f=await dHi(u,"reset",t,{method:"POST"});await wHi(f,"reset",t);let l=`${i.apiUrl}/populate`,c=await dHi(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 wHi(c,"populate",l)}async function oQt(i,u){let t=`${i.apiUrl}/version`;try{await jE(async()=>{let f=await dHi(u,"readiness check",t,{method:"GET",signal:AbortSignal.timeout(mQt)});await wHi(f,"readiness check",t)},{maxAttempts:rQt,minTimeout:HVu,maxTimeout:HVu,multiplier:1,jitter:0,isRetriable:(f)=>!MVu(f)})}catch(f){let l=f instanceof Mc?f.cause:f;throw Error(`ToxiProxy API did not become ready at ${t}: ${vHi(l)}`,{cause:l})}}async function sQt(i){if(i===null)return"";return await new Response(i).text()}async function _Hi(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}): ${vHi($)}`,{cause:$})}})(),[l,c]=await Promise.all([f.exited,sQt(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 pQt(i,u){let t=`deco-dev-link-toxiproxy-${i}`;await _Hi(["rm","-f",t],{ignoreFailure:!0}),await _Hi(["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 iHt(i,u){let t=`deco-dev-link-toxiproxy-${i}`;await _Hi(["rm","-f",t],{ignoreFailure:!0})}async function uHt(i){let u=CVu(i),t=i.startDaemon??pQt,f=i.stopDaemon??(i.startDaemon===void 0?iHt:void 0);await t(i.apiPort,i.listenPort);let l=i.fetchImpl??fetch;try{await oQt(u,l),await qVu(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 bVu="ToxiProxy",RVu="dev_link_studio",rQt=20,HVu=100,mQt=100;var DHi=O(()=>{Sl()});var VVu={};Qi(VVu,{migrateBetterAuth:()=>gHi});import{getMigrations as tHt}from"better-auth/db";import{sso as fHt}from"@better-auth/sso";import{organization as lHt}from"@decocms/better-auth/plugins";import{admin as cHt,apiKey as EHt,jwt as $Ht,magicLink as wHt,mcp as dHt,openAPI as _Ht}from"better-auth/plugins";import{emailOTP as vHt}from"better-auth/plugins/email-otp";async function gHi(i){let t={database:PC(i||L2()),plugins:[lHt({dynamicAccessControl:{enabled:!0,enableCustomResources:!0}}),cHt(),EHt(),$Ht(),_Ht(),dHt({loginPage:"/login"}),fHt(),wHt({sendMagicLink:async()=>{}}),vHt({sendVerificationOTP:async()=>{}})]},{toBeAdded:f,toBeCreated:l,runMigrations:c}=await tHt(t);if(!f.length&&!l.length)return"up to date";return await c(),`${l.length+f.length} table(s) migrated`}var OHi=O(()=>{zE()});var NHi={};Qi(NHi,{up:()=>hHt,down:()=>DHt});import{sql as q5}from"kysely";async function hHt(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(q5`CURRENT_TIMESTAMP`)).addColumn("updatedAt","text",(u)=>u.notNull().defaultTo(q5`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(q5`CURRENT_TIMESTAMP`)).addColumn("updatedAt","text",(u)=>u.notNull().defaultTo(q5`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(q5`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(q5`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(q5`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(q5`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(q5`CURRENT_TIMESTAMP`)).addColumn("updatedAt","text",(u)=>u.notNull().defaultTo(q5`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 DHt(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 rVu=()=>{};var ZHi={};Qi(ZHi,{up:()=>gHt,down:()=>OHt});import{sql as mVu}from"kysely";async function gHt(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(mVu`CURRENT_TIMESTAMP`)).addColumn("updatedAt","text",(u)=>u.notNull().defaultTo(mVu`CURRENT_TIMESTAMP`)).execute()}async function OHt(i){await i.schema.dropTable("organization_settings").execute()}var eVu=()=>{};var BHi={};Qi(BHi,{up:()=>NHt,down:()=>ZHt});async function NHt(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 ZHt(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 FHi={};Qi(FHi,{up:()=>BHt,down:()=>FHt});async function BHt(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 FHt(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 yHi={};Qi(yHi,{up:()=>yHt,down:()=>THt});async function yHt(i){await i.schema.alterTable("connections").addColumn("configuration_state","text").execute(),await i.schema.alterTable("connections").addColumn("configuration_scopes","text").execute()}async function THt(i){await i.schema.alterTable("connections").dropColumn("configuration_state").execute(),await i.schema.alterTable("connections").dropColumn("configuration_scopes").execute()}var THi={};Qi(THi,{up:()=>PHt,down:()=>xHt});import{sql as UHt}from"kysely";async function PHt(i){await i.schema.alterTable("organization_settings").addColumn("sidebar_items",UHt`text`).execute()}async function xHt(i){await i.schema.alterTable("organization_settings").dropColumn("sidebar_items").execute()}var aVu=()=>{};var UHi={};Qi(UHi,{up:()=>IHt,down:()=>AHt});async function IHt(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 AHt(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 PHi={};Qi(PHi,{up:()=>GHt,down:()=>nHt});import{sql as $M}from"kysely";async function GHt(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($M`CURRENT_TIMESTAMP`)).addColumn("updated_at","text",(u)=>u.notNull().defaultTo($M`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($M`CURRENT_TIMESTAMP`)).addColumn("updated_at","text",(u)=>u.notNull().defaultTo($M`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($M`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 nHt(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 oVu=()=>{};var xHi={};Qi(xHi,{up:()=>jHt,down:()=>KHt});import{sql as kHt}from"kysely";async function jHt(i){await i.schema.dropTable("audit_logs").ifExists().execute()}async function KHt(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(kHt`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 sVu=()=>{};var IHi={};Qi(IHi,{up:()=>XHt,down:()=>JHt});import{sql as K1i}from"kysely";async function XHt(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(K1i`CURRENT_TIMESTAMP`)).addColumn("updated_at","text",(u)=>u.notNull().defaultTo(K1i`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(K1i`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 K1i`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 JHt(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 pVu=()=>{};var AHi={};Qi(AHi,{up:()=>SHt,down:()=>YHt});async function SHt(i){await i.schema.alterTable("gateways").addColumn("icon","text").execute()}async function YHt(i){await i.schema.alterTable("gateways").dropColumn("icon").execute()}var GHi={};Qi(GHi,{up:()=>LHt,down:()=>WHt});import{sql as X1i}from"kysely";async function LHt(i){await i.schema.alterTable("gateways").addColumn("tool_selection_mode","text",(u)=>u.notNull().defaultTo("inclusion")).execute(),await X1i`
|
|
80703
80703
|
UPDATE gateways
|
|
80704
80704
|
SET tool_selection_mode = CASE
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as $,r as g,j as r,l as H}from"./index-UyzF2Wxm.js";import{K as _}from"./agent-icon-BMQHBhP6.js";import{i as V}from"./SearchMd-B-bL1wjq.js";import{d as K,c as X,a as J,D as Q}from"./dialog-AE8ChAe3.js";import{I as Y}from"./input-CTZybS4f.js";import{ab as Z,a9 as ee,ac as te,ad as G,G as re}from"./index-CqVkj8du.js";import"./AlertCircle-Diz6uT7Y.js";import"./Tool01-BgzvuPeY.js";import"./SwitchHorizontal01-vo5MpXEz.js";import"./Settings02-BvivcyYL.js";import"./XCircle-B88UxHjD.js";import"./ArrowUpRight-Bo4YThIl.js";import"./ZapSquare-BfSTQonf.js";import"./Users03-ClWrctLP.js";import"./CheckCircle-BSFt0_RZ.js";import"./ChevronUp-_gM_dQkt.js";import"./ChevronDown-C_njLrOU.js";import"./ChevronLeft-ByQFERqp.js";import"./ChevronRight-D1duQehP.js";import"./DotsVertical-BJnhQ8u0.js";import"./Stars02-CVb_b-OZ.js";import"./Eye-SUXNGsVY.js";import"./ZoomOut-Csc4IU4b.js";import"./Globe01-CNw0uMhK.js";import"./FilterLines-CxIQYlMz.js";import"./Star01-Ds91SJzA.js";import"./Globe04-B24hCYmg.js";import"./HardDrive-IPJJMMij.js";import"./Key01-CES8n-fG.js";import"./LayoutLeft-D3mZzNi0.js";import"./LinkExternal01-B8zRpPza.js";import"./Monitor01-Uh-3HvZI.js";import"./Sun-tLN4vA6M.js";import"./Palette-Du66341h.js";import"./Play-CVoFjR5I.js";import"./Plus-DoMNANl8.js";import"./Shield01-BewRt7sw.js";import"./Stars01-PS518Jif.js";import"./Trash01-D84eyfFz.js";import"./Upload01-BA5iKtAl.js";import"./User01-CeCQHgwg.js";import"./Users01-DtmLcsFN.js";import"./XClose-DcfEQwVh.js";import"./X-2HGWB7Oo.js";import"./Zap-BeB31T8Y.js";import"./index-CKtGWWKI.js";import"./chat-context-Dqu5Dj_J.js";import"./hooks-DwlYXenh.js";import"./use-mcp-client-Cv0jyhEU.js";import"./auth-CCI_mhgC.js";import"./decopilot-sse-pool-_mJQvJZ7.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-iRRxKkRN.js";import"./use-collections-CXeEMOwb.js";import"./use-ai-providers-Deso-Vyj.js";import"./studio-tools-C1AZbzwg.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-DPqJ7ETy.js";import"./scroll-area-BBReqUns.js";import"./use-clock-tick-Bp0qVbdD.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-H4KuRxx2.js";import"./tooltip-C7L4o0rn.js";import"./file-type-icon-BOraV8Gq.js";import"./content-blocks-o63cs2vh.js";import"./types-CppGS_VJ.js";import"./shell-layout-Ch8BfEKU.js";import"./avatar-CtVVLapD.js";import"./required-auth-layout-clm6boiC.js";import"./use-org-sso-QBVELOwd.js";import"./sheet-DALs-qBg.js";import"./integration-icon-CslqVkci.js";import"./use-navigate-to-agent-CytgRfBH.js";import"./use-connection-DqvYiUe3.js";import"./use-mcp-prompts-CPZOOi8c.js";import"./form-teSq_9QK.js";import"./label-Djcog1jo.js";import"./select-CYFnhI-Q.js";import"./drawer-Di9WrlRG.js";import"./collection-search-D6nD206z.js";import"./tabs-D__sk4iN.js";import"./toggle-group-5CInie8P.js";import"./use-deco-credits-rzfxapgg.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BwnCXxRf.js";import"./use-registry-connections-DQ1fpeHW.js";import"./useInfiniteQuery-DVN2QYOz.js";import"./use-infinite-scroll-BpnVw1p2.js";import"./extract-connection-data-BumzxLvt.js";import"./card-DZtTT5Es.js";import"./collection-tabs-cs02GObx.js";import"./badge-BFvLiE20.js";import"./textarea-DmmCVjU6.js";import"./connection-form-helpers-Csy5hutj.js";import"./authenticate-and-persist-oauth-eSHjAd3t.js";import"./mcp-oauth-BcPuGj2k.js";import"./useSuspenseInfiniteQuery-BKCXXvPp.js";import"./connect-desktop-dialog-DNAK4U2K.js";import"./decopilot-CLVJpS6M.js";import"./checkbox-CHXOcnVE.js";import"./skeleton-BqZgigOh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DOlV_atx.js";import"./popover-DG0h5msu.js";import"./command-DhLgZpjn.js";import"./index-DnCrG3F_.js";import"./dropdown-menu-ecBYljKf.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BaJ0EN3G.js";import"./empty-state-CegPWPc0.js";import"./toolbar-Bm-rdLjh.js";import"./preview-dialog-Bnu3vr0P.js";import"./index-DR6YHYZo.js";import"./use-mcp-tools-z50pjVux.js";import"./use-capability-CGVlaZtI.js";import"./shell-route-loading-RsrwOcS1.js";import"./index-C4YdUUl9.js";import"./alert-dialog-0uOi3HqZ.js";import"./switch-DRDIUTD7.js";import"./use-debounced-autosave-Ct9kek4B.js";import"./index-DJiEBchG.js";import"./sidebar-hZIrovG4.js";import"./search-input-D9asghaf.js";import"./github-repo-picker-LA1Jld2f.js";import"./use-secrets-C3RMGjE2.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DnLJJSFI.js";import"./select-model-35S1fWTq.js";import"./use-automations-DdPVJNl5.js";import"./monaco-editor-DnGtg8Ra.js";import"./automation-runs-CNqGFhXQ.js";import"./table-tYYVDDAQ.js";import"./use-members-jM6HOjam.js";import"./use-org-auth-client-DjPrRX3t.js";import"./task-status-CftQiZKN.js";import"./automation-list-row-Ct9jaHYX.js";const oe=12,E=new Set,D=new Set;function ie(){for(const l of D)l()}function se(l){return E.has(l)?!0:E.size>=oe?!1:(E.add(l),!0)}function F(l){E.delete(l)&&ie()}function le(l){return D.add(l),()=>{D.delete(l)}}function ne(l,e){const t=g.useRef(!1),[v,m]=g.useState(!1),n=g.useRef(null),p=g.useRef(null),i=g.useRef(null),o=g.useRef(l);o.current=l;const[x]=g.useState(()=>{const s=()=>{i.current?.(),i.current=null},c=()=>t.current?!0:se(e)?(t.current=!0,m(!0),s(),!0):!1;return f=>{if(p.current=f,n.current&&(n.current.disconnect(),n.current=null),s(),!f){t.current&&(F(e),t.current=!1,m(!1));return}queueMicrotask(()=>{if(p.current!==f)return;const a=new IntersectionObserver(u=>{if(u[0]?.isIntersecting??!1){!c()&&!i.current&&(i.current=le(()=>{p.current===f&&c()}));return}s(),t.current&&(F(e),t.current=!1,m(!1))},{root:o.current.current,rootMargin:"160px 0px"});a.observe(f),n.current=a})}});return{ref:x,iframeActive:v}}function me(l){const e=$.c(8),{previewUrl:t,title:v,scrollRootRef:m,slotId:n}=l,{ref:p,iframeActive:i}=ne(m,n),[o,x]=g.useState(!1);let s;e[0]!==i||e[1]!==o||e[2]!==t||e[3]!==v?(s=i?r.jsxs(r.Fragment,{children:[!o&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:r.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),r.jsx("iframe",{src:t,title:`Preview ${v}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>x(!0)})]}):r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=i,e[1]=o,e[2]=t,e[3]=v,e[4]=s):s=e[4];let c;return e[5]!==p||e[6]!==s?(c=r.jsx("div",{ref:p,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:s}),e[5]=p,e[6]=s,e[7]=c):c=e[7],c}function pe(l){const e=$.c(26),{entry:t,previewUrl:v,scrollRootRef:m,onSelect:n}=l,p=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let i;e[0]!==p?(i=H("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",p),e[0]=p,e[1]=i):i=e[1];let o;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==v||e[5]!==m?(o=r.jsx(me,{previewUrl:v,title:t.title,scrollRootRef:m,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=v,e[5]=m,e[6]=o):o=e[6];let x;e[7]!==t.isSavedBlock?(x=t.isSavedBlock?{color:re}:void 0,e[7]=t.isSavedBlock,e[8]=x):x=e[8];let s;e[9]!==x?(s=r.jsx(_,{className:"h-4 w-4 shrink-0",style:x}),e[9]=x,e[10]=s):s=e[10];let c;e[11]!==t.title?(c=r.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=c):c=e[12];let f;e[13]!==t.description?(f=t.description&&r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=f):f=e[14];let a;e[15]!==c||e[16]!==f?(a=r.jsxs("div",{className:"min-w-0 flex-1",children:[c,f]}),e[15]=c,e[16]=f,e[17]=a):a=e[17];let u;e[18]!==s||e[19]!==a?(u=r.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[s,a]}),e[18]=s,e[19]=a,e[20]=u):u=e[20];let h;return e[21]!==n||e[22]!==i||e[23]!==o||e[24]!==u?(h=r.jsxs("button",{type:"button",onClick:n,className:i,children:[o,u]}),e[21]=n,e[22]=i,e[23]=o,e[24]=u,e[25]=h):h=e[25],h}function Dr(l){const e=$.c(41),{open:t,onOpenChange:v,meta:m,decofile:n,previewBaseUrl:p,onSelect:i}=l,[o,x]=g.useState(""),[s,c]=g.useState(t),f=g.useRef(null);t!==s&&(c(t),t&&x(""));let a,u,h,b,S,j,N,y,w,R,C;if(e[0]!==n||e[1]!==m||e[2]!==v||e[3]!==i||e[4]!==t||e[5]!==p||e[6]!==o){const U=t&&m&&n?Z(m,n):[],M=m?ee(m):"",z=n?te(n):void 0,W=new Map;if(t&&M)for(const d of U)W.set(d.resolveType,G(p,M,d.previewBlock,z));const A=o.trim().toLowerCase(),q=A?U.filter(d=>d.title.toLowerCase().includes(A)||d.resolveType.toLowerCase().includes(A)||d.description?.toLowerCase().includes(A)):U;u=K,R=t,C=v,a=X,N="top-3 right-3",y="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let O;e[18]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(J,{children:"Add section"}),e[18]=O):O=e[18];let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(V,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[19]=k):k=e[19];let B;e[20]===Symbol.for("react.memo_cache_sentinel")?(B=d=>x(d.target.value),e[20]=B):B=e[20],e[21]!==o?(w=r.jsxs(Q,{className:"shrink-0 border-b px-4 py-3 text-left",children:[O,r.jsxs("div",{className:"relative pt-2",children:[k,r.jsx(Y,{value:o,onChange:B,placeholder:"Search sections...",className:"h-9 pl-8"})]})]}),e[21]=o,e[22]=w):w=e[22],S=f,j="min-h-0 flex-1 overflow-y-auto",h="p-4",b=q.length===0?r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No sections found."}):r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:q.map(d=>r.jsx(pe,{entry:d,scrollRootRef:f,previewUrl:W.get(d.resolveType)??G(p,M,d.previewBlock,z),onSelect:()=>i(d)},d.resolveType))}),e[0]=n,e[1]=m,e[2]=v,e[3]=i,e[4]=t,e[5]=p,e[6]=o,e[7]=a,e[8]=u,e[9]=h,e[10]=b,e[11]=S,e[12]=j,e[13]=N,e[14]=y,e[15]=w,e[16]=R,e[17]=C}else a=e[7],u=e[8],h=e[9],b=e[10],S=e[11],j=e[12],N=e[13],y=e[14],w=e[15],R=e[16],C=e[17];let T;e[23]!==h||e[24]!==b?(T=r.jsx("div",{className:h,children:b}),e[23]=h,e[24]=b,e[25]=T):T=e[25];let I;e[26]!==T||e[27]!==S||e[28]!==j?(I=r.jsx("div",{ref:S,className:j,children:T}),e[26]=T,e[27]=S,e[28]=j,e[29]=I):I=e[29];let L;e[30]!==a||e[31]!==I||e[32]!==N||e[33]!==y||e[34]!==w?(L=r.jsxs(a,{closeButtonClassName:N,className:y,children:[w,I]}),e[30]=a,e[31]=I,e[32]=N,e[33]=y,e[34]=w,e[35]=L):L=e[35];let P;return e[36]!==u||e[37]!==L||e[38]!==R||e[39]!==C?(P=r.jsx(u,{open:R,onOpenChange:C,children:L}),e[36]=u,e[37]=L,e[38]=R,e[39]=C,e[40]=P):P=e[40],P}export{Dr as AddSectionModal};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as gt,r as w,j as o,l as St,t as ut,i as yt}from"./index-UyzF2Wxm.js";import{i as jt}from"./ChevronRight-D1duQehP.js";import{S as kt}from"./scroll-area-BBReqUns.js";import{AddSectionModal as _t}from"./add-section-modal-BBef0kzW.js";import{ah as wt,ai as Bt,f as Nt,g as Rt,aj as At}from"./index-CqVkj8du.js";import{c as Ct}from"./save-referenced-block-BJospazn.js";import{d as Et,b as Kt}from"./schema-form-B6Wg-hy1.js";import{S as Ft}from"./save-status-CDIs_R_V.js";import"./agent-icon-BMQHBhP6.js";import"./AlertCircle-Diz6uT7Y.js";import"./Tool01-BgzvuPeY.js";import"./SwitchHorizontal01-vo5MpXEz.js";import"./Settings02-BvivcyYL.js";import"./XCircle-B88UxHjD.js";import"./ArrowUpRight-Bo4YThIl.js";import"./ZapSquare-BfSTQonf.js";import"./Users03-ClWrctLP.js";import"./CheckCircle-BSFt0_RZ.js";import"./ChevronUp-_gM_dQkt.js";import"./ChevronDown-C_njLrOU.js";import"./ChevronLeft-ByQFERqp.js";import"./DotsVertical-BJnhQ8u0.js";import"./Stars02-CVb_b-OZ.js";import"./Eye-SUXNGsVY.js";import"./ZoomOut-Csc4IU4b.js";import"./Globe01-CNw0uMhK.js";import"./FilterLines-CxIQYlMz.js";import"./Star01-Ds91SJzA.js";import"./Globe04-B24hCYmg.js";import"./HardDrive-IPJJMMij.js";import"./Key01-CES8n-fG.js";import"./LayoutLeft-D3mZzNi0.js";import"./LinkExternal01-B8zRpPza.js";import"./Monitor01-Uh-3HvZI.js";import"./Sun-tLN4vA6M.js";import"./Palette-Du66341h.js";import"./Play-CVoFjR5I.js";import"./Plus-DoMNANl8.js";import"./SearchMd-B-bL1wjq.js";import"./Shield01-BewRt7sw.js";import"./Stars01-PS518Jif.js";import"./Trash01-D84eyfFz.js";import"./Upload01-BA5iKtAl.js";import"./User01-CeCQHgwg.js";import"./Users01-DtmLcsFN.js";import"./XClose-DcfEQwVh.js";import"./X-2HGWB7Oo.js";import"./Zap-BeB31T8Y.js";import"./use-clock-tick-Bp0qVbdD.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-H4KuRxx2.js";import"./tooltip-C7L4o0rn.js";import"./file-type-icon-BOraV8Gq.js";import"./dialog-AE8ChAe3.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CppGS_VJ.js";import"./use-mcp-client-Cv0jyhEU.js";import"./auth-CCI_mhgC.js";import"./chat-context-Dqu5Dj_J.js";import"./hooks-DwlYXenh.js";import"./decopilot-sse-pool-_mJQvJZ7.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-iRRxKkRN.js";import"./use-collections-CXeEMOwb.js";import"./use-ai-providers-Deso-Vyj.js";import"./studio-tools-C1AZbzwg.js";import"./use-organization-settings-DPqJ7ETy.js";import"./shell-layout-Ch8BfEKU.js";import"./avatar-CtVVLapD.js";import"./required-auth-layout-clm6boiC.js";import"./use-org-sso-QBVELOwd.js";import"./sheet-DALs-qBg.js";import"./integration-icon-CslqVkci.js";import"./use-navigate-to-agent-CytgRfBH.js";import"./use-connection-DqvYiUe3.js";import"./use-mcp-prompts-CPZOOi8c.js";import"./form-teSq_9QK.js";import"./label-Djcog1jo.js";import"./input-CTZybS4f.js";import"./select-CYFnhI-Q.js";import"./index-CKtGWWKI.js";import"./drawer-Di9WrlRG.js";import"./collection-search-D6nD206z.js";import"./tabs-D__sk4iN.js";import"./toggle-group-5CInie8P.js";import"./use-deco-credits-rzfxapgg.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BwnCXxRf.js";import"./use-registry-connections-DQ1fpeHW.js";import"./useInfiniteQuery-DVN2QYOz.js";import"./use-infinite-scroll-BpnVw1p2.js";import"./extract-connection-data-BumzxLvt.js";import"./card-DZtTT5Es.js";import"./collection-tabs-cs02GObx.js";import"./badge-BFvLiE20.js";import"./textarea-DmmCVjU6.js";import"./connection-form-helpers-Csy5hutj.js";import"./authenticate-and-persist-oauth-eSHjAd3t.js";import"./mcp-oauth-BcPuGj2k.js";import"./useSuspenseInfiniteQuery-BKCXXvPp.js";import"./connect-desktop-dialog-DNAK4U2K.js";import"./decopilot-CLVJpS6M.js";import"./checkbox-CHXOcnVE.js";import"./skeleton-BqZgigOh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DOlV_atx.js";import"./popover-DG0h5msu.js";import"./command-DhLgZpjn.js";import"./index-DnCrG3F_.js";import"./dropdown-menu-ecBYljKf.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BaJ0EN3G.js";import"./empty-state-CegPWPc0.js";import"./toolbar-Bm-rdLjh.js";import"./preview-dialog-Bnu3vr0P.js";import"./index-DR6YHYZo.js";import"./use-mcp-tools-z50pjVux.js";import"./use-capability-CGVlaZtI.js";import"./shell-route-loading-RsrwOcS1.js";import"./index-C4YdUUl9.js";import"./alert-dialog-0uOi3HqZ.js";import"./switch-DRDIUTD7.js";import"./use-debounced-autosave-Ct9kek4B.js";import"./index-DJiEBchG.js";import"./sidebar-hZIrovG4.js";import"./search-input-D9asghaf.js";import"./github-repo-picker-LA1Jld2f.js";import"./use-secrets-C3RMGjE2.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DnLJJSFI.js";import"./select-model-35S1fWTq.js";import"./use-automations-DdPVJNl5.js";import"./monaco-editor-DnGtg8Ra.js";import"./automation-runs-CNqGFhXQ.js";import"./table-tYYVDDAQ.js";import"./use-members-jM6HOjam.js";import"./use-org-auth-client-DjPrRX3t.js";import"./task-status-CftQiZKN.js";import"./automation-list-row-Ct9jaHYX.js";import"./calendar-Cof0eQRR.js";import"./sortable.esm-BtnRUgUU.js";import"./image-field-ycul5miD.js";import"./use-file-configs-CJ5VKJt7.js";function Sr(B){const t=gt.c(77),{orgSlug:d,virtualMcpId:f,branch:u,blockKey:i,block:p,meta:m,decofile:l,title:H,excludeFields:G,schemaPending:at,previewBaseUrl:nt}=B,J=at===void 0?!1:at,n=nt===void 0?null:nt,h=typeof p?.__resolveType=="string"?p.__resolveType:"";let A;t[0]!==G||t[1]!==m||t[2]!==h?(A=wt(h,m,G),t[0]=G,t[1]=m,t[2]=h,t[3]=A):A=t[3];const c=A;let C;t[4]!==c?(C=!!c&&Object.keys(c.properties??{}).length>0,t[4]=c,t[5]=C):C=t[5];const Q=C;let E;t[6]!==p||t[7]!==i||t[8]!==m||t[9]!==H?(E=H??(p?Bt(i,p,m):i),t[6]=p,t[7]=i,t[8]=m,t[9]=H,t[10]=E):E=t[10];const x=E;let K;t[11]!==u||t[12]!==d||t[13]!==f?(K={orgSlug:d,virtualMcpId:f,branch:u},t[11]=u,t[12]=d,t[13]=f,t[14]=K):K=t[14];const{save:v,flush:W,isPending:X}=Nt(K);let F;t[15]!==u||t[16]!==d||t[17]!==f?(F={orgSlug:d,virtualMcpId:f,branch:u},t[15]=u,t[16]=d,t[17]=f,t[18]=F):F=t[18];const Y=Rt(F);let $;t[19]!==v?($=Ct((e,r)=>v(e,r)),t[19]=v,t[20]=$):$=t[20];const Z=$,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let P;t[21]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[21]=P):P=t[21];const[s,ft]=w.useState(P),[ot,rt]=w.useState(!1),O=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let T;t[22]!==p?(T=p??{},t[22]=p,t[23]=T):T=t[23];const it=T;let b;t[24]!==tt?(b=tt??{},t[24]=tt,t[25]=b):b=t[25];let V;t[26]!==it||t[27]!==b?(V={...it,...b},t[26]=it,t[27]=b,t[28]=V):V=t[28];const mt=V;let I;t[29]!==i||t[30]!==h||t[31]!==v?(I=e=>{const r=e;ct(r),v(i,{...r,__resolveType:h})},t[29]=i,t[30]=h,t[31]=v,t[32]=I):I=t[32];const st=I;let L;t[33]===Symbol.for("react.memo_cache_sentinel")?(L=e=>{ft(e)},t[33]=L):L=t[33];const pt=L;let q;t[34]!==l||t[35]!==W||t[36]!==Y?(q=async(e,r)=>{try{const{blockKey:a,data:R}=At(e,l);await Y.mutateAsync({blockKey:a,data:R}),ut.success(`Created section "${a}"`),r({__resolveType:a}),W()}catch(a){const R=a,bt=R instanceof Error?R.message:"Could not add section";throw ut.error(bt),R}},t[34]=l,t[35]=W,t[36]=Y,t[37]=q):q=t[37];const g=q;let z;t[38]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{O.current=e.append,rt(!0)},t[38]=z):z=t[38];const vt=z;let M;t[39]!==g?(M=async e=>{const r=O.current;if(r)try{await g(e,a=>{r(a),rt(!1),O.current=null})}catch{}},t[39]=g,t[40]=M):M=t[40];const lt=M;let U;t[41]!==s||t[42]!==x?(U=s.length>0?[x,...s]:[],t[41]=s,t[42]=x,t[43]=U):U=t[43];const N=U;let S;t[44]!==s||t[45]!==N||t[46]!==x?(S=N.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:N.map((e,r)=>{const a=r===N.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Et(s,r)),dt($t)},title:e,className:St("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:x}),t[44]=s,t[45]=N,t[46]=x,t[47]=S):S=t[47];let y;t[48]!==X?(y=o.jsx(Ft,{isPending:X,isError:!1}),t[48]=X,t[49]=y):y=t[49];let j;t[50]!==S||t[51]!==y?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,y]}),t[50]=S,t[51]=y,t[52]=j):j=t[52];let k;t[53]!==i||t[54]!==s||t[55]!==l||t[56]!==mt||t[57]!==et||t[58]!==g||t[59]!==st||t[60]!==Q||t[61]!==m||t[62]!==n||t[63]!==Z||t[64]!==c||t[65]!==J?(k=o.jsx(kt,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:Q?o.jsx(Kt,{schema:c,value:mt,onChange:st,basePath:"",breadcrumbPath:s,onBreadcrumbChange:pt,decofile:l,meta:m,onSaveReferencedBlock:Z,previewBaseUrl:n,onAddSectionItem:g,onRequestAddSection:vt},`${i}:${et}`):J?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(yt,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[53]=i,t[54]=s,t[55]=l,t[56]=mt,t[57]=et,t[58]=g,t[59]=st,t[60]=Q,t[61]=m,t[62]=n,t[63]=Z,t[64]=c,t[65]=J,t[66]=k):k=t[66];let _;t[67]!==ot||t[68]!==l||t[69]!==lt||t[70]!==m||t[71]!==n?(_=n&&o.jsx(_t,{open:ot,onOpenChange:e=>{rt(e),e||(O.current=null)},meta:m,decofile:l,previewBaseUrl:n,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=l,t[69]=lt,t[70]=m,t[71]=n,t[72]=_):_=t[72];let D;return t[73]!==j||t[74]!==k||t[75]!==_?(D=o.jsxs("div",{className:"flex h-full flex-col",children:[j,k,_]}),t[73]=j,t[74]=k,t[75]=_,t[76]=D):D=t[76],D}function $t(B){return B+1}function Pt(B){return B+1}export{Sr as AppEditor};
|