decocms 2.285.0 → 2.286.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-0nxz1rX8.js → AlertCircle-DTmaHldD.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-C2eNhBDd.js → ArrowNarrowLeft-DlPeFc4v.js} +1 -1
- package/dist/client/assets/{CheckCircle-CkYTxj_S.js → CheckCircle-DJ3lme5R.js} +1 -1
- package/dist/client/assets/{ChevronDown-CYzIAmcr.js → ChevronDown-DGnjAtqs.js} +1 -1
- package/dist/client/assets/{ChevronRight-DeEIl6Ga.js → ChevronRight-DV9No7GF.js} +1 -1
- package/dist/client/assets/{ChevronUp-MMJijhLH.js → ChevronUp-BkSgkwhO.js} +1 -1
- package/dist/client/assets/{Container-Co8nThxH.js → Container-B1nHZdmn.js} +1 -1
- package/dist/client/assets/DotsVertical-Bp2tW8JI.js +1 -0
- package/dist/client/assets/{LinkExternal01-B1CK34My.js → LinkExternal01-BBbCPDtX.js} +1 -1
- package/dist/client/assets/{Lock01-D0hjzmk2.js → Lock01-DpPIS3K7.js} +1 -1
- package/dist/client/assets/{Palette-Dk9Jb8jx.js → Palette-CI8n49a8.js} +1 -1
- package/dist/client/assets/{Play-BxeG5fNv.js → Play-DKFUTU3G.js} +1 -1
- package/dist/client/assets/{Plus-gZScqBbn.js → Plus-oXFwCrYz.js} +1 -1
- package/dist/client/assets/RefreshCcw01-B10mKiE2.js +1 -0
- package/dist/client/assets/SearchMd-BRJBvWf4.js +1 -0
- package/dist/client/assets/{Settings02-BF97-Fnm.js → Settings02-Dm9dFDqk.js} +1 -1
- package/dist/client/assets/Shield01-BZJVBd5S.js +1 -0
- package/dist/client/assets/{Star01-yc5vq0ru.js → Star01-_IJK5Yjt.js} +1 -1
- package/dist/client/assets/{Sun-B0IvK7nO.js → Sun-QqE1VnS_.js} +1 -1
- package/dist/client/assets/{Tool01-BtxOSAs7.js → Tool01-CKowkGsd.js} +1 -1
- package/dist/client/assets/{Trash01-Cv5TKLdc.js → Trash01-C6bAXG6g.js} +1 -1
- package/dist/client/assets/{User01-Bm0y4lC0.js → User01-C2-anwoO.js} +1 -1
- package/dist/client/assets/{Users03-BjqYs6sm.js → Users03-DqYvPeZM.js} +1 -1
- package/dist/client/assets/{X-D_cmo_DI.js → X-i9zBn6Hn.js} +1 -1
- package/dist/client/assets/XCircle-C1sJYG9R.js +1 -0
- package/dist/client/assets/XClose-BbIo6xHe.js +1 -0
- package/dist/client/assets/{Zap-MBVwanCx.js → Zap-KmbRMccM.js} +1 -1
- package/dist/client/assets/{ZapSquare-Acx_yvzd.js → ZapSquare-DT93lGV4.js} +1 -1
- package/dist/client/assets/{accordion-Bs6iOXfP.js → accordion-BV3tm7bj.js} +1 -1
- package/dist/client/assets/agent-icon-CyE6nkC1.js +1 -0
- package/dist/client/assets/agents-list-7o6gZt-q.js +1 -0
- package/dist/client/assets/ai-providers-DI3UF9nU.js +1 -0
- package/dist/client/assets/{alert-dialog-CGn0S0CC.js → alert-dialog-CicrCOay.js} +2 -2
- package/dist/client/assets/{auth-catchall-LYMGDHGY.js → auth-catchall-Cyd7fWQv.js} +1 -1
- package/dist/client/assets/automation-list-row-B4Vfg4UC.js +1 -0
- package/dist/client/assets/automations-DRM_lJom.js +1 -0
- package/dist/client/assets/{avatar-B4iYr4Pn.js → avatar-CF1bgUpD.js} +1 -1
- package/dist/client/assets/{badge-BKbfqB0P.js → badge-s_TAXGUN.js} +1 -1
- package/dist/client/assets/{brand-context-eZ6U4eZs.js → brand-context-iopLFZ2k.js} +1 -1
- package/dist/client/assets/{card-C6TLc-pg.js → card-CaekC2K0.js} +1 -1
- package/dist/client/assets/{chat-context-bxvplF3Z.js → chat-context-DP5UfIrn.js} +1 -1
- package/dist/client/assets/{checkbox-BafUZKEr.js → checkbox-DznLgPgR.js} +1 -1
- package/dist/client/assets/collection-detail-CTQuhG7N.js +1 -0
- package/dist/client/assets/collection-display-button-BgYKhoGQ.js +1 -0
- package/dist/client/assets/{collection-search-BSwS6tWM.js → collection-search-Bo2bOvRn.js} +1 -1
- package/dist/client/assets/{collection-search-_WhBw8st.js → collection-search-DMqppne6.js} +1 -1
- package/dist/client/assets/collection-table-wrapper-KnWZIddd.js +1 -0
- package/dist/client/assets/{collection-tabs-Cegi88gO.js → collection-tabs-CU6MCzSn.js} +1 -1
- package/dist/client/assets/{collections-CJcBtWs5.js → collections-DHmXATua.js} +1 -1
- package/dist/client/assets/command-D4w2xkZT.js +1 -0
- package/dist/client/assets/{connection-card-pbt5_GMK.js → connection-card-DBz-rrLk.js} +1 -1
- package/dist/client/assets/connection-detail-zHqb5ZSw.js +1 -0
- package/dist/client/assets/{connection-form-helpers-B-iFdAbF.js → connection-form-helpers-CBEV0IXi.js} +1 -1
- package/dist/client/assets/connections-CHiGbl1F.js +1 -0
- package/dist/client/assets/{constants-BgpFj97_.js → constants-DDHDU3PV.js} +1 -1
- package/dist/client/assets/{constants-Dp_2h6cY.js → constants-v4RUVkEN.js} +1 -1
- package/dist/client/assets/{dialog-BlDJEasr.js → dialog-C4lREl-t.js} +1 -1
- package/dist/client/assets/{drawer-n2769KGk.js → drawer-BTCEaGGQ.js} +1 -1
- package/dist/client/assets/dropdown-menu-v2GifVOh.js +1 -0
- package/dist/client/assets/{dynamic-plugin-layout-D7LPOea8.js → dynamic-plugin-layout-CVBBnlEt.js} +1 -1
- package/dist/client/assets/{empty-state-Di9idjlO.js → empty-state-BdQTFnZA.js} +1 -1
- package/dist/client/assets/{empty-state-CCV3q11p.js → empty-state-DdKZ_is7.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BkZ-2zmr.js → extract-connection-data-CfXvFcGA.js} +1 -1
- package/dist/client/assets/{features-BnFC3Zii.js → features-fsR9zLkr.js} +1 -1
- package/dist/client/assets/{form-2LsJQI5E.js → form-D7DN8UcB.js} +1 -1
- package/dist/client/assets/general-WQbdllPl.js +1 -0
- package/dist/client/assets/{github-repo-picker-DnkATBdp.js → github-repo-picker-DZqLC6FL.js} +2 -2
- package/dist/client/assets/index-BCwsJqWc.css +1 -0
- package/dist/client/assets/{index-DRvZCWzg.js → index-C5AR7k1c.js} +1 -1
- package/dist/client/assets/{index-BqgOT0Li.js → index-CHKi_s_a.js} +1 -1
- package/dist/client/assets/{index-DAwDZKfR.js → index-D-RCnwJQ.js} +1 -1
- package/dist/client/assets/{index-DHvfV22T.js → index-D34n6J5J.js} +22 -22
- package/dist/client/assets/{index-BZMU1-Zz.js → index-DBclwIf_.js} +3 -3
- package/dist/client/assets/{index-CYT7K8Th.js → index-DnJZfbsP.js} +3 -3
- package/dist/client/assets/{index-D748RB59.js → index-FnxI6OGR.js} +1 -1
- package/dist/client/assets/{index-CWVXiaiz.js → index-e3AFJ_dX.js} +1 -1
- package/dist/client/assets/{index-DGbBxceU.js → index-qXZ0t4XR.js} +25 -25
- package/dist/client/assets/{index-BXweTbWN.js → index-zDq2Zqio.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BgQN01Hf.js → infiniteQueryObserver-1_M-sq16.js} +1 -1
- package/dist/client/assets/{input-CDeKOB27.js → input-urtyHxks.js} +1 -1
- package/dist/client/assets/{integration-icon-CI13mmaS.js → integration-icon-Cdkk9YPE.js} +1 -1
- package/dist/client/assets/{label-CnjZ_mJO.js → label-Bt4h_QUk.js} +1 -1
- package/dist/client/assets/{layout-BiEb87aZ.js → layout-B5SDe6IW.js} +1 -1
- package/dist/client/assets/{login-BfsLvipz.js → login-7zFMf3C1.js} +1 -1
- package/dist/client/assets/members-Dy7hWkQ8.js +3 -0
- package/dist/client/assets/{monaco-editor-CtX0YP6U.js → monaco-editor-lveN-AoO.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BQ4J0Yec.js → monitoring-stats-row-D3x0_phM.js} +1 -1
- package/dist/client/assets/{oauth-callback-BN4EOUXR.js → oauth-callback-BJALVgfT.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BaqShyIl.js → oauth-callback-ai-provider-o8Hfz-wL.js} +1 -1
- package/dist/client/assets/{onboarding-DsfytkRm.js → onboarding-DlI3PsIA.js} +1 -1
- package/dist/client/assets/{org-layout-BfWUJisr.js → org-layout-DPzm8vzJ.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-BBYslPfT.js → org-plugin-layout-DB72TzxO.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-B5LlIWxc.js → plugin-empty-state-BzyxU1IF.js} +1 -1
- package/dist/client/assets/{plugin-header-Bk48Ukf6.js → plugin-header-hJH6-4Nr.js} +1 -1
- package/dist/client/assets/{plugin-layout-BKF_beSo.js → plugin-layout-l_MDXBYc.js} +1 -1
- package/dist/client/assets/{popover-xVRU-oRu.js → popover-j_PzMtdY.js} +1 -1
- package/dist/client/assets/{profile-D-jM1gw3.js → profile-lf_QL3Ye.js} +1 -1
- package/dist/client/assets/project-app-view-DuFzKNXE.js +1 -0
- package/dist/client/assets/registry-D3m_WKwq.js +2 -0
- package/dist/client/assets/{registry-layout-DnwI9vdC.js → registry-layout-DRb_iR_v.js} +3 -3
- package/dist/client/assets/{required-auth-layout-B1r3oQ4H.js → required-auth-layout-C2o7AZ4K.js} +1 -1
- package/dist/client/assets/{reset-password-DSTvsN7x.js → reset-password-DTEY3I_i.js} +1 -1
- package/dist/client/assets/roles-DW1_Kn6r.js +1 -0
- package/dist/client/assets/{scroll-area-D5mZ0hRE.js → scroll-area-BebfgLv6.js} +1 -1
- package/dist/client/assets/{search-input-Dq6mcRO6.js → search-input-dmuYGYsk.js} +1 -1
- package/dist/client/assets/{select-DVBzN73v.js → select-CePxsPeP.js} +1 -1
- package/dist/client/assets/{select-model-CT_wRRZk.js → select-model-QQ7yjZl9.js} +2 -2
- package/dist/client/assets/settings-layout-Cd1tdTnr.js +1 -0
- package/dist/client/assets/{shell-layout-DaX2wZ77.js → shell-layout-BE22YA40.js} +1 -1
- package/dist/client/assets/{skeleton-BZGew3qV.js → skeleton-C9NsUzIb.js} +1 -1
- package/dist/client/assets/{sso-CSm1qVA0.js → sso-QSGlyP2n.js} +1 -1
- package/dist/client/assets/{store-BLxzwqyY.js → store-BB9yi6PD.js} +1 -1
- package/dist/client/assets/store-registry-BSp-W72J.js +2 -0
- package/dist/client/assets/{switch-DhZAgC2R.js → switch-VBeL01bM.js} +1 -1
- package/dist/client/assets/{table-PpA3iGsP.js → table-CQMW-Toa.js} +1 -1
- package/dist/client/assets/{tabs-CqvMN_xV.js → tabs-DOoLL5wa.js} +1 -1
- package/dist/client/assets/{task-status-fLMf5O9c.js → task-status-vvRP86lz.js} +7 -7
- package/dist/client/assets/{textarea-8UV3LDMX.js → textarea-Ie4QUdo5.js} +1 -1
- package/dist/client/assets/{toggle-group-Brc7WatS.js → toggle-group-C077Smww.js} +1 -1
- package/dist/client/assets/tools-list-UnPsMGhr.js +1 -0
- package/dist/client/assets/{types-C318llZ2.js → types-D4PfKOFF.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Do6DYo3A.js → use-ai-providers-DHuVj1kn.js} +1 -1
- package/dist/client/assets/{use-collections-B6b08eGL.js → use-collections-DRlHpXQL.js} +1 -1
- package/dist/client/assets/{use-connection-B4n7P5ZX.js → use-connection-Cif-LY0f.js} +1 -1
- package/dist/client/assets/{use-copy-D_fZmQan.js → use-copy-uiSuMvtc.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-jrLS8Jsa.js → use-create-virtual-mcp-CBpw3zXA.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BaTABZmJ.js → use-decopilot-events-Dpt6CcIN.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CRBBtM2M.js → use-delete-connection-BZmW9ZAz.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-E-ClEQ_w.js → use-infinite-scroll-CWlV3gJA.js} +1 -1
- package/dist/client/assets/{use-list-state-DueB6o1G.js → use-list-state-BJZWeXjY.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BGEi8TMH.js → use-mcp-tools-BYVtg7WH.js} +1 -1
- package/dist/client/assets/{use-members-C-n0fYdD.js → use-members-M_p47epa.js} +1 -1
- package/dist/client/assets/{use-mobile-DHF6z3l-.js → use-mobile-CxvYCzu9.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CVVCVmb_.js → use-navigate-to-agent-CFIKBq0L.js} +1 -1
- package/dist/client/assets/{use-org-sso-CVSlB5eM.js → use-org-sso-CACnH9GQ.js} +1 -1
- package/dist/client/assets/use-organization-roles-o4lVU0iD.js +1 -0
- package/dist/client/assets/{use-organization-settings-hZWDePgg.js → use-organization-settings-BD9CIHH5.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DE87auCx.js → use-registry-connections-DR_etJ2H.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DmiUFixH.js → use-status-sounds-Ce7WandB.js} +1 -1
- package/dist/client/assets/{use-tasks-BtKmvszc.js → use-tasks-Dpp1DK1f.js} +1 -1
- package/dist/client/assets/{use-view-mode-C4RBFxYO.js → use-view-mode-CZPzVaxj.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-ByUoWLLO.js → use-virtual-mcp-0vHwLInn.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B4w-6TrV.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-WURyRq6p.js +1 -0
- package/dist/client/assets/{user-xlREBAPA.js → user-xj80BAo3.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DhKikjfW.js → view-mode-toggle-D5CGwPOj.js} +1 -1
- package/dist/client/assets/workflow-CD_DiE5j.js +1 -0
- package/dist/client/assets/workflow-detail-CxWEb-ID.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +2 -2
- package/dist/server/node_modules/{postgres-bytea/license → pg/LICENSE} +6 -6
- package/dist/server/node_modules/pg/README.md +95 -0
- package/dist/server/node_modules/pg/esm/index.mjs +20 -0
- package/dist/server/node_modules/pg/lib/client.js +743 -0
- package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
- package/dist/server/node_modules/pg/lib/connection.js +221 -0
- package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
- package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
- package/dist/server/node_modules/pg/lib/defaults.js +91 -0
- package/dist/server/node_modules/pg/lib/index.js +73 -0
- package/dist/server/node_modules/pg/lib/native/client.js +323 -0
- package/dist/server/node_modules/pg/lib/native/index.js +2 -0
- package/dist/server/node_modules/pg/lib/native/query.js +165 -0
- package/dist/server/node_modules/pg/lib/query.js +252 -0
- package/dist/server/node_modules/pg/lib/result.js +109 -0
- package/dist/server/node_modules/pg/lib/stream.js +83 -0
- package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
- package/dist/server/node_modules/pg/lib/utils.js +217 -0
- package/dist/server/node_modules/pg/package.json +76 -0
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/SearchMd-DmmmzJIi.js +0 -1
- package/dist/client/assets/XCircle-DofWfDB_.js +0 -1
- package/dist/client/assets/agent-icon-B4FOoeEp.js +0 -1
- package/dist/client/assets/agents-list-CCDumukV.js +0 -1
- package/dist/client/assets/ai-providers-DmtetLwH.js +0 -1
- package/dist/client/assets/automation-list-row-CKWNl7Xx.js +0 -1
- package/dist/client/assets/automations-t-caERGV.js +0 -1
- package/dist/client/assets/collection-detail-I5bQPS94.js +0 -1
- package/dist/client/assets/collection-display-button-D58wr6x3.js +0 -1
- package/dist/client/assets/collection-table-wrapper-DoehWRok.js +0 -1
- package/dist/client/assets/command-BDTuhAyF.js +0 -1
- package/dist/client/assets/connection-detail-CpUnSGYQ.js +0 -1
- package/dist/client/assets/connections-COVM3fme.js +0 -1
- package/dist/client/assets/dropdown-menu-DwLxT3z1.js +0 -1
- package/dist/client/assets/general-gsvbF_Za.js +0 -1
- package/dist/client/assets/index-DeSgX7LP.css +0 -1
- package/dist/client/assets/members-COWr_hPe.js +0 -3
- package/dist/client/assets/project-app-view-CjbRHagh.js +0 -1
- package/dist/client/assets/registry-iJ2QFmg-.js +0 -2
- package/dist/client/assets/settings-layout-D70kmFKJ.js +0 -1
- package/dist/client/assets/store-registry-BdrjcFsM.js +0 -2
- package/dist/client/assets/tools-list-BbeD_D_r.js +0 -1
- package/dist/client/assets/useInfiniteQuery-m9L0mxCO.js +0 -1
- package/dist/client/assets/workflow-Z523A-0v.js +0 -1
- package/dist/client/assets/workflow-detail-CLjOJ-4m.js +0 -1
- package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
- package/dist/server/node_modules/mimic-fn/index.js +0 -13
- package/dist/server/node_modules/mimic-fn/license +0 -9
- package/dist/server/node_modules/mimic-fn/package.json +0 -42
- package/dist/server/node_modules/mimic-fn/readme.md +0 -69
- package/dist/server/node_modules/pg-int8/LICENSE +0 -13
- package/dist/server/node_modules/pg-int8/README.md +0 -16
- package/dist/server/node_modules/pg-int8/index.js +0 -100
- package/dist/server/node_modules/pg-int8/package.json +0 -24
- package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
- package/dist/server/node_modules/postgres-array/index.js +0 -97
- package/dist/server/node_modules/postgres-array/license +0 -21
- package/dist/server/node_modules/postgres-array/package.json +0 -35
- package/dist/server/node_modules/postgres-array/readme.md +0 -43
- package/dist/server/node_modules/postgres-bytea/index.js +0 -33
- package/dist/server/node_modules/postgres-bytea/package.json +0 -34
- package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
- package/dist/server/node_modules/postgres-date/index.js +0 -116
- package/dist/server/node_modules/postgres-date/license +0 -21
- package/dist/server/node_modules/postgres-date/package.json +0 -33
- package/dist/server/node_modules/postgres-date/readme.md +0 -49
- package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
- package/dist/server/node_modules/postgres-interval/index.js +0 -125
- package/dist/server/node_modules/postgres-interval/license +0 -21
- package/dist/server/node_modules/postgres-interval/package.json +0 -36
- package/dist/server/node_modules/postgres-interval/readme.md +0 -48
- package/dist/server/node_modules/split2/LICENSE +0 -13
- package/dist/server/node_modules/split2/README.md +0 -85
- package/dist/server/node_modules/split2/bench.js +0 -27
- package/dist/server/node_modules/split2/index.js +0 -141
- package/dist/server/node_modules/split2/package.json +0 -39
- package/dist/server/node_modules/split2/test.js +0 -409
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as v,c as N,j as t}from"./index-
|
|
1
|
+
import{e as v,c as N,j as t}from"./index-D34n6J5J.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as b,c as h,j as t,B as g}from"./index-
|
|
1
|
+
import{e as b,c as h,j as t,B as g}from"./index-D34n6J5J.js";function y(N){const e=b.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(g,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{y as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as O}from"./constants-
|
|
1
|
+
import{g as O}from"./constants-v4RUVkEN.js";import"./index-D34n6J5J.js";import{d as T,c as x}from"./constants-DDHDU3PV.js";function U(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function F(e,t){return U(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function q(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const H={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function L(e){return e?H[e]??e.toUpperCase():null}function B(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function J(e,t,n,a){const r=await x({connectionId:e,orgId:t});try{const o=await r.callTool({name:n,arguments:a});return o.structuredContent??o}finally{await r.close().catch(console.error)}}const Y="mcp.mesh";function D(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function G(e){const t=D(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function j(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function K(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function $(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Q(e,t,n,a){const r=e.server,o=e._meta?.[Y],m=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",k=r?.description||null,C=r?.icons?.[0]?.src||G(r?.repository)||null,i=o?.oauth_config,R=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,P=o?.configuration_state,v=o?.configuration_scopes,w=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,f=r?.packages??[],d=r?.remotes??[],A=a?.packageIndex??0,S=a?.remoteIndex??0,y=f.length>0&&a?.packageIndex!==void 0,c=y?f[A]:null,s=y?null:d[S];let l,u,h=null;if(c){const _=c.identifier||c.name;l="STDIO",u="";const g={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(g[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(l=L(s.type)||"HTTP",u=s.url||""):(l="HTTP",u="");const N=d.length>1,M=f.length>1;let p="";c&&M?p=` (${$(c)})`:s&&N&&(p=` (${K(s)})`);const E=I+p;return{id:O("conn"),title:E,description:k,icon:C,app_name:j(e),app_id:o?.id||e.id||null,connection_type:l,connection_url:u,connection_token:null,connection_headers:h,oauth_config:R,configuration_state:P??null,configuration_scopes:v??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:w},created_at:m,updated_at:m,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{G as a,B as b,J as c,Q as e,q as f,j as g,F as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as S,s as w,o as E,bL as N,j as i,a6 as _,aG as K,K as C,z as R}from"./index-
|
|
1
|
+
import{e as S,s as w,o as E,bL as N,j as i,a6 as _,aG as K,K as C,z as R}from"./index-D34n6J5J.js";import{P as y}from"./index-zDq2Zqio.js";import{d as T}from"./use-organization-settings-BD9CIHH5.js";import{S as q}from"./switch-VBeL01bM.js";import{n as z}from"./Container-B1nHZdmn.js";import"./use-mobile-CxvYCzu9.js";import"./X-i9zBn6Hn.js";import"./constants-DDHDU3PV.js";function Q(t){const e=S.c(33),{plugin:n,isEnabled:l,isSaving:c,description:d,label:f,icon:p,onToggle:g}=t;let u;e[0]!==l||e[1]!==c||e[2]!==g||e[3]!==n.id?(u=()=>!c&&g(n.id,!l),e[0]=l,e[1]=c,e[2]=g,e[3]=n.id,e[4]=u):u=e[4];const h=c?void 0:"pointer";let x;e[5]!==h?(x={cursor:h},e[5]=h,e[6]=x):x=e[6];let j;e[7]!==p?(j=p&&i.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0 [&>svg]:size-4",children:p}),e[7]=p,e[8]=j):j=e[8];let o;e[9]!==f?(o=i.jsx("p",{className:"text-sm font-medium text-foreground",children:f}),e[9]=f,e[10]=o):o=e[10];let m;e[11]!==d?(m=d&&i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:d}),e[11]=d,e[12]=m):m=e[12];let s;e[13]!==o||e[14]!==m?(s=i.jsxs("div",{className:"min-w-0",children:[o,m]}),e[13]=o,e[14]=m,e[15]=s):s=e[15];let r;e[16]!==j||e[17]!==s?(r=i.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[j,s]}),e[16]=j,e[17]=s,e[18]=r):r=e[18];let a;e[19]!==g||e[20]!==n.id?(a=k=>g(n.id,k),e[19]=g,e[20]=n.id,e[21]=a):a=e[21];let b;e[22]!==l||e[23]!==c||e[24]!==a?(b=i.jsx("div",{onClick:$,className:"shrink-0",children:i.jsx(q,{checked:l,onCheckedChange:a,disabled:c})}),e[22]=l,e[23]=c,e[24]=a,e[25]=b):b=e[25];let P;e[26]!==b||e[27]!==r?(P=i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[r,b]}),e[26]=b,e[27]=r,e[28]=P):P=e[28];let v;return e[29]!==u||e[30]!==P||e[31]!==x?(v=i.jsx("div",{className:"flex flex-col border-b border-border last:border-0",onClick:u,style:x,children:P}),e[29]=u,e[30]=P,e[31]=x,e[32]=v):v=e[32],v}function $(t){return t.stopPropagation()}function F(){const t=S.c(17),{org:e,project:n}=w(),l=E();let c;t[0]!==n.enabledPlugins?(c=n.enabledPlugins??[],t[0]=n.enabledPlugins,t[1]=c):c=t[1];const d=c,f=T();let p;t[2]!==e||t[3]!==n.slug||t[4]!==l?(p=()=>{l.invalidateQueries({queryKey:C.project(e.id,n.slug)}),l.invalidateQueries({queryKey:C.projects(e.id)}),l.invalidateQueries({predicate:s=>{const r=s.queryKey;return r[1]===e.id&&r[3]==="collection"&&r[4]==="VIRTUAL_MCP"}})},t[2]=e,t[3]=n.slug,t[4]=l,t[5]=p):p=t[5];const g=p;let u;t[6]!==g||t[7]!==f||t[8]!==d?(u=(s,r)=>{const a=new Set(d);r?a.add(s):a.delete(s),f.mutate({enabled_plugins:Array.from(a)},{onSuccess:g,onError:A})},t[6]=g,t[7]=f,t[8]=d,t[9]=u):u=t[9];const h=u,x=U,j=I;if(N.length===0){let s;return t[10]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),t[10]=s):s=t[10],s}let o;t[11]!==h||t[12]!==f||t[13]!==d?(o=N.map(s=>{const r=x(s.id),a=j(s.id),b=d.includes(s.id);return i.jsx(Q,{plugin:s,isEnabled:b,isSaving:f.isPending,description:a,label:r?.label??s.id,icon:r?.icon??i.jsx(z,{size:14}),onToggle:h},s.id)}),t[11]=h,t[12]=f,t[13]=d,t[14]=o):o=t[14];let m;return t[15]!==o?(m=i.jsx("div",{className:"flex flex-col",children:o}),t[15]=o,t[16]=m):m=t[16],m}function I(t){return N.find(n=>n.id===t)?.description??null}function U(t){const e=_.find(l=>l.pluginId===t);if(e)return{label:e.label,icon:e.items[0]?.icon};const n=K.find(l=>l.pluginId===t);return n?{label:n.label,icon:n.icon}:null}function A(t){R.error("Failed to update plugin: "+(t instanceof Error?t.message:"Unknown error"))}function D(){const t=S.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(y,{children:i.jsx(y.Content,{children:i.jsx(y.Body,{children:i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsx(y.Title,{children:"Plugins"}),i.jsx(F,{})]})})})}),t[0]=e):e=t[0],e}function J(){const t=S.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(D,{}),t[0]=e):e=t[0],e}export{J as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bV as b,e as f,j as c,aB as C,r as d,c as p,aY as j,bW as v,bX as h}from"./index-
|
|
1
|
+
import{bV as b,e as f,j as c,aB as C,r as d,c as p,aY as j,bW as v,bX as h}from"./index-D34n6J5J.js";import{L as N}from"./label-Bt4h_QUk.js";const E=b,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(C,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(j,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{E as F,M as a,w as b,L as c,P as d,R as e,y as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as G,r as Q,z as T,j as s,B as M,f as pe,s as ce,o as de,x as je,w as be,a as W,t as q,K as Z,b as me,v as ve,y as se,n as Ne,c as ye,aD as Se}from"./index-D34n6J5J.js";import{P as J}from"./index-zDq2Zqio.js";import{C as Y,b as X,c as ee,a as te,d as ue,e as _e}from"./card-CaekC2K0.js";import{I as oe}from"./input-urtyHxks.js";import{L as B}from"./label-Bt4h_QUk.js";import{c as Ce}from"./XCircle-C1sJYG9R.js";import{i as fe}from"./X-i9zBn6Hn.js";import{u as V}from"./unwrap-tool-result-BYXdCQMg.js";import{S as we,u as ze,W as ae,i as De}from"./constants-DDHDU3PV.js";import{S as Ae}from"./switch-VBeL01bM.js";import{u as Ee,a as le,D as Ie,c as Pe,S as ke,v as Oe,K as Te,P as Fe,d as Re,C as Le,s as Me,b as $e,e as qe}from"./collection-search-DMqppne6.js";import{u as ge}from"./use-virtual-mcp-0vHwLInn.js";import{b as Ge,P as Ke,a as Ue}from"./popover-j_PzMtdY.js";import{S as He}from"./skeleton-C9NsUzIb.js";import{Q as Be}from"./agent-icon-CyE6nkC1.js";import{s as Qe}from"./Plus-oXFwCrYz.js";import{a as xe}from"./Users03-DqYvPeZM.js";import{I as ie}from"./integration-icon-Cdkk9YPE.js";import{u as Je,c as Ve}from"./use-organization-settings-BD9CIHH5.js";import"./use-mobile-CxvYCzu9.js";import"./SearchMd-BRJBvWf4.js";import"./use-collections-DRlHpXQL.js";import"./AlertCircle-DTmaHldD.js";import"./Tool01-CKowkGsd.js";import"./XClose-BbIo6xHe.js";import"./RefreshCcw01-B10mKiE2.js";import"./ArrowNarrowLeft-DlPeFc4v.js";import"./ZapSquare-DT93lGV4.js";import"./CheckCircle-DJ3lme5R.js";import"./ChevronDown-DGnjAtqs.js";import"./ChevronRight-DV9No7GF.js";import"./ChevronUp-BkSgkwhO.js";import"./DotsVertical-Bp2tW8JI.js";import"./Container-B1nHZdmn.js";import"./Star01-_IJK5Yjt.js";import"./Palette-CI8n49a8.js";import"./LinkExternal01-BBbCPDtX.js";import"./Lock01-DpPIS3K7.js";import"./Sun-QqE1VnS_.js";import"./Play-DKFUTU3G.js";import"./Settings02-Dm9dFDqk.js";import"./Shield01-BZJVBd5S.js";import"./Trash01-C6bAXG6g.js";import"./User01-C2-anwoO.js";import"./Zap-KmbRMccM.js";function We(t){const e=G.c(28),{value:a,onChange:o,name:p,disabled:i}=t,n=Q.useRef(null);let C;e[0]!==o?(C=b=>{const w=b.target.files?.[0];if(w){if(w.size>2097152){T.error("Image must be smaller than 2MB");return}const m=new FileReader;m.onerror=()=>{const S=m.error;console.error("FileReader error:",S),T.error(S?.message||"Failed to read image file. Please try again."),n.current&&(n.current.value="")},m.onloadend=()=>{m.readyState===FileReader.DONE&&m.result&&o(m.result),n.current&&(n.current.value="")},m.readAsDataURL(w)}},e[0]=o,e[1]=C):C=e[1];const E=C;let N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{n.current?.click()},e[2]=N):N=e[2];const r=N;let f;e[3]!==o?(f=b=>{b.stopPropagation(),o("")},e[3]=o,e[4]=f):f=e[4];const g=f;let d;e[5]!==i||e[6]!==E?(d=s.jsx("input",{type:"file",ref:n,className:"hidden",accept:"image/*",onChange:E,disabled:i}),e[5]=i,e[6]=E,e[7]=d):d=e[7];let c;e[8]!==i||e[9]!==g||e[10]!==p||e[11]!==a?(c=a?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:a,alt:p||"Logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:g,disabled:i,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(fe,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:r,disabled:i,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground disabled:opacity-50 disabled:pointer-events-none",children:[s.jsx(Ce,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[8]=i,e[9]=g,e[10]=p,e[11]=a,e[12]=c):c=e[12];const z=a?"Change Logo":"Upload Logo";let D;e[13]!==i||e[14]!==z?(D=s.jsx(M,{type:"button",variant:"outline",size:"sm",onClick:r,disabled:i,className:"mb-2",children:z}),e[13]=i,e[14]=z,e[15]=D):D=e[15];let x;e[16]!==i||e[17]!==g||e[18]!==a?(x=a&&s.jsx(M,{type:"button",variant:"ghost",size:"sm",onClick:g,disabled:i,className:"ml-2",children:"Remove"}),e[16]=i,e[17]=g,e[18]=a,e[19]=x):x=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[20]=j):j=e[20];let h;e[21]!==D||e[22]!==x?(h=s.jsxs("div",{className:"flex-1",children:[D,x,j]}),e[21]=D,e[22]=x,e[23]=h):h=e[23];let y;return e[24]!==h||e[25]!==d||e[26]!==c?(y=s.jsxs("div",{className:"flex items-start gap-4",children:[d,c,h]}),e[24]=h,e[25]=d,e[26]=c,e[27]=y):y=e[27],y}const Ze=ve({name:se().min(1,"Name is required").max(255,"Name is too long"),slug:se().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:se().optional()});function Ye(){const t=pe(),{org:e}=ce(),a=de(),[o,p]=Q.useState(!1),i=je({resolver:be(Ze),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),n=W({mutationFn:async r=>{const f={name:r.name,slug:r.slug};r.logo&&(f.logo=r.logo);const g=await me.organization.update({organizationId:e.id,data:f});if(g?.error)throw new Error(g.error.message||"Failed to update organization");return g},onSuccess:r=>{q("organization_settings_updated",{organization_id:e.id,fields:Object.keys(i.formState.dirtyFields)}),a.invalidateQueries({queryKey:Z.organizations()}),a.invalidateQueries({queryKey:Z.activeOrganization(e.slug)}),T.success("Organization settings updated successfully"),r?.data?.slug&&r.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:r.data.slug}})},onError:r=>{q("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(i.formState.dirtyFields),error:r instanceof Error?r.message:String(r)}),T.error(r instanceof Error?r.message:"Failed to update organization")},onSettled:()=>{p(!1)}}),C=r=>{p(!0),n.mutate(r)},E=i.formState.isDirty,N=i.formState.errors;return s.jsx("form",{onSubmit:i.handleSubmit(C),className:"flex flex-col gap-6",children:s.jsxs(Y,{className:"p-6",children:[s.jsx(X,{className:"p-0",children:s.jsx(ee,{className:"text-sm",children:"Overview"})}),s.jsxs(te,{className:"flex flex-col gap-6 p-0",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Logo"}),s.jsx(We,{value:i.watch("logo"),onChange:r=>i.setValue("logo",r??"",{shouldDirty:!0}),name:i.watch("name"),disabled:o}),N.logo&&s.jsx("p",{className:"text-xs text-destructive",children:N.logo.message})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-5",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{htmlFor:"org-name",className:"text-xs text-muted-foreground",children:"Organization name"}),s.jsx(oe,{id:"org-name",...i.register("name"),placeholder:"Organization name",disabled:o}),N.name&&s.jsx("p",{className:"text-xs text-destructive",children:N.name.message})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{htmlFor:"org-slug",className:"text-xs text-muted-foreground",children:"Slug"}),s.jsx(oe,{id:"org-slug",...i.register("slug"),placeholder:"my-organization",disabled:o,onChange:r=>{const f=r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");i.setValue("slug",f,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Only lowercase letters, numbers, and hyphens."}),N.slug&&s.jsx("p",{className:"text-xs text-destructive",children:N.slug.message})]})]})]}),E&&s.jsxs(ue,{className:"p-0 pt-2 gap-2",children:[s.jsx(M,{type:"submit",disabled:o,children:o?"Saving…":"Save"}),s.jsx(M,{type:"button",variant:"outline",onClick:()=>i.reset(),disabled:o,children:"Cancel"})]})]})})}function Xe(){const t=G.c(62),{org:e}=ce(),{data:a}=me.useSession(),o=de();let p;t[0]!==e.id?(p={connectionId:we,orgId:e.id},t[0]=e.id,t[1]=p):p=t[1];const i=ze(p);let n;t[2]!==e.id?(n=Z.organizationDomain(e.id),t[2]=e.id,t[3]=n):n=t[3];let C;t[4]!==i?(C=async()=>{const l=await i.callTool({name:"ORGANIZATION_DOMAIN_GET",arguments:{}});return V(l)},t[4]=i,t[5]=C):C=t[5];let E;t[6]!==n||t[7]!==C?(E={queryKey:n,queryFn:C},t[6]=n,t[7]=C,t[8]=E):E=t[8];const{data:N,isPending:r}=Ne(E),f=a?.user?.email??"";let g;t[9]!==f?(g=f.split("@")[1]?.toLowerCase()??"",t[9]=f,t[10]=g):g=t[10];const d=g,c=N?.domain??null,z=N?.autoJoinEnabled??!1,D=d&&d!==c;let x;t[11]!==e.id||t[12]!==o?(x=()=>o.invalidateQueries({queryKey:Z.organizationDomain(e.id)}),t[11]=e.id,t[12]=o,t[13]=x):x=t[13];const j=x;let h;t[14]!==i||t[15]!==d?(h=async()=>{const l=await i.callTool({name:"ORGANIZATION_DOMAIN_SET",arguments:{domain:d,autoJoinEnabled:!1}});return V(l)},t[14]=i,t[15]=d,t[16]=h):h=t[16];let y;t[17]!==j||t[18]!==e.id||t[19]!==d?(y=()=>{q("organization_domain_claimed",{organization_id:e.id,email_domain:d}),j(),T.success("Domain claimed")},t[17]=j,t[18]=e.id,t[19]=d,t[20]=y):y=t[20];let b;t[21]!==e.id||t[22]!==d?(b=l=>{q("organization_domain_claim_failed",{organization_id:e.id,email_domain:d,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to claim domain")},t[21]=e.id,t[22]=d,t[23]=b):b=t[23];let w;t[24]!==h||t[25]!==y||t[26]!==b?(w={mutationFn:h,onSuccess:y,onError:b},t[24]=h,t[25]=y,t[26]=b,t[27]=w):w=t[27];const m=W(w);let S;t[28]!==i?(S=async()=>{const l=await i.callTool({name:"ORGANIZATION_DOMAIN_CLEAR",arguments:{}});return V(l)},t[28]=i,t[29]=S):S=t[29];let v;t[30]!==c||t[31]!==j||t[32]!==e.id?(v=()=>{q("organization_domain_cleared",{organization_id:e.id,email_domain:c}),j(),T.success("Domain removed")},t[30]=c,t[31]=j,t[32]=e.id,t[33]=v):v=t[33];let _;t[34]!==c||t[35]!==e.id?(_=l=>{q("organization_domain_clear_failed",{organization_id:e.id,email_domain:c,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to remove domain")},t[34]=c,t[35]=e.id,t[36]=_):_=t[36];let k;t[37]!==S||t[38]!==v||t[39]!==_?(k={mutationFn:S,onSuccess:v,onError:_},t[37]=S,t[38]=v,t[39]=_,t[40]=k):k=t[40];const P=W(k);let A;t[41]!==i||t[42]!==c||t[43]!==e.id?(A=async l=>{if(!c)return;q("organization_auto_join_toggled",{organization_id:e.id,enabled:l});const L=await i.callTool({name:"ORGANIZATION_DOMAIN_UPDATE",arguments:{autoJoinEnabled:l}});return V(L)},t[41]=i,t[42]=c,t[43]=e.id,t[44]=A):A=t[44];let I;t[45]!==j?(I=()=>{j(),T.success("Auto-join setting updated")},t[45]=j,t[46]=I):I=t[46];let O;t[47]!==e.id?(O=l=>{q("organization_auto_join_toggle_failed",{organization_id:e.id,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to update auto-join")},t[47]=e.id,t[48]=O):O=t[48];let u;t[49]!==A||t[50]!==I||t[51]!==O?(u={mutationFn:A,onSuccess:I,onError:O},t[49]=A,t[50]=I,t[51]=O,t[52]=u):u=t[52];const F=W(u);if(r)return null;let R;t[53]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsxs(X,{className:"p-0",children:[s.jsx(ee,{className:"text-sm",children:"Email Domain"}),s.jsx(_e,{className:"text-xs",children:"Claim your company's email domain so new users with matching emails can automatically join this organization."})]}),t[53]=R):R=t[53];let $;return t[54]!==z||t[55]!==D||t[56]!==P||t[57]!==c||t[58]!==m||t[59]!==F||t[60]!==d?($=s.jsxs(Y,{className:"p-6",children:[R,s.jsx(te,{className:"flex flex-col gap-4 p-0 pt-4",children:c?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Claimed domain"}),s.jsx("p",{className:"text-sm font-medium",children:c})]}),s.jsx(M,{variant:"outline",size:"sm",onClick:()=>P.mutate(),disabled:P.isPending,children:"Remove"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(B,{className:"text-xs",children:"Auto-join"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Users with @",c," emails will automatically join this organization on signup."]})]}),s.jsx(Ae,{checked:z,onCheckedChange:l=>F.mutate(l),disabled:F.isPending})]})]}):D?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Your domain"}),s.jsx("p",{className:"text-sm font-medium",children:d})]}),s.jsx(M,{size:"sm",onClick:()=>m.mutate(),disabled:m.isPending,children:m.isPending?"Claiming...":"Claim Domain"})]}):s.jsx("p",{className:"text-xs text-muted-foreground",children:"No corporate email domain detected."})})]}),t[54]=z,t[55]=D,t[56]=P,t[57]=c,t[58]=m,t[59]=F,t[60]=d,t[61]=$):$=t[61],$}const re=["site-editor","site-diagnostics","ai-image","ai-research"],ne=8;function et(t,e,a){const o=e.find(i=>i.id===t);if(o)return{id:o.id,title:o.title,icon:o.icon,kind:"template"};const p=a.find(i=>i.id===t);return p?{id:t,title:p.title,icon:p.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function tt(t){const e=G.c(39),{agent:a,onRemove:o}=t;let p;e[0]!==a.id?(p={id:a.id},e[0]=a.id,e[1]=p):p=e[1];const{attributes:i,listeners:n,setNodeRef:C,transform:E,transition:N,isDragging:r}=Re(p);let f;e[2]!==E?(f=Le.Transform.toString(E),e[2]=E,e[3]=f):f=e[3];const g=r?.5:void 0,d=r?100:void 0;let c;e[4]!==f||e[5]!==g||e[6]!==d||e[7]!==N?(c={transform:f,transition:N,opacity:g,zIndex:d},e[4]=f,e[5]=g,e[6]=d,e[7]=N,e[8]=c):c=e[8];const z=c,D=r&&"shadow-lg";let x;e[9]!==D?(x=ye("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",D),e[9]=D,e[10]=x):x=e[10];const j=`Drag to reorder ${a.title}`;let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Be,{size:14}),e[11]=h):h=e[11];let y;e[12]!==i||e[13]!==n||e[14]!==j?(y=s.jsx("button",{type:"button",...i,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":j,children:h}),e[12]=i,e[13]=n,e[14]=j,e[15]=y):y=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(xe,{size:14}),e[16]=b):b=e[16];let w;e[17]!==a.icon||e[18]!==a.title?(w=s.jsx(ie,{icon:a.icon,name:a.title,size:"xs",fallbackIcon:b}),e[17]=a.icon,e[18]=a.title,e[19]=w):w=e[19];let m;e[20]!==a.title?(m=s.jsx("span",{className:"text-sm text-foreground truncate",children:a.title}),e[20]=a.title,e[21]=m):m=e[21];const S=a.kind==="template"?"Template":a.kind==="custom"?"Custom agent":"Unavailable";let v;e[22]!==S?(v=s.jsx("span",{className:"text-xs text-muted-foreground",children:S}),e[22]=S,e[23]=v):v=e[23];let _;e[24]!==m||e[25]!==v?(_=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[m,v]}),e[24]=m,e[25]=v,e[26]=_):_=e[26];const k=`Remove ${a.title}`;let P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(fe,{size:14}),e[27]=P):P=e[27];let A;e[28]!==o||e[29]!==k?(A=s.jsx("button",{type:"button",onClick:o,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":k,children:P}),e[28]=o,e[29]=k,e[30]=A):A=e[30];let I;return e[31]!==C||e[32]!==z||e[33]!==y||e[34]!==w||e[35]!==_||e[36]!==A||e[37]!==x?(I=s.jsxs("div",{ref:C,style:z,className:x,children:[y,w,_,A]}),e[31]=C,e[32]=z,e[33]=y,e[34]=w,e[35]=_,e[36]=A,e[37]=x,e[38]=I):I=e[38],I}function st(t){const e=G.c(48),{selectedIds:a,onAdd:o}=t,[p,i]=Q.useState(!1),[n,C]=Q.useState(""),E=ge();let N;e[0]!==a?(N=new Set(a),e[0]=a,e[1]=N):N=e[1];const r=N;let f,g,d,c,z,D,x,j,h,y,b,w,m;if(e[2]!==E||e[3]!==o||e[4]!==p||e[5]!==n||e[6]!==r){const P=n.toLowerCase();c=ae.filter(u=>!r.has(u.id)&&(!n||u.title.toLowerCase().includes(P)));let A;e[20]!==r?(A=u=>u.id!==null&&!De(u.id)&&!r.has(u.id),e[20]=r,e[21]=A):A=e[21],d=E.filter(A).filter(u=>!n||u.title.toLowerCase().includes(P));let I;e[22]!==o?(I=u=>{o(u),i(!1),C("")},e[22]=o,e[23]=I):I=e[23];const O=I;g=Ge,w=p,m=i,e[24]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ke,{asChild:!0,children:s.jsxs(M,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Qe,{size:14}),"Add agent"]})}),e[24]=z):z=e[24],f=Ue,h="w-[320px] p-0 overflow-hidden",y="start",e[25]!==n?(b=s.jsx(qe,{value:n,onChange:C,placeholder:"Search agents..."}),e[25]=n,e[26]=b):b=e[26],D="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",x=c.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Templates"}),c.map(u=>s.jsxs("button",{type:"button",onClick:()=>O(u.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ie,{icon:u.icon,name:u.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:u.title})]},u.id))]}),j=d.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Custom agents"}),d.map(u=>s.jsxs("button",{type:"button",onClick:()=>O(u.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ie,{icon:u.icon,name:u.title,size:"xs",fallbackIcon:s.jsx(xe,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:u.title})]},u.id))]}),e[2]=E,e[3]=o,e[4]=p,e[5]=n,e[6]=r,e[7]=f,e[8]=g,e[9]=d,e[10]=c,e[11]=z,e[12]=D,e[13]=x,e[14]=j,e[15]=h,e[16]=y,e[17]=b,e[18]=w,e[19]=m}else f=e[7],g=e[8],d=e[9],c=e[10],z=e[11],D=e[12],x=e[13],j=e[14],h=e[15],y=e[16],b=e[17],w=e[18],m=e[19];let S;e[27]!==d||e[28]!==c.length||e[29]!==n?(S=c.length===0&&d.length===0&&s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),e[27]=d,e[28]=c.length,e[29]=n,e[30]=S):S=e[30];let v;e[31]!==S||e[32]!==D||e[33]!==x||e[34]!==j?(v=s.jsxs("div",{className:D,children:[x,j,S]}),e[31]=S,e[32]=D,e[33]=x,e[34]=j,e[35]=v):v=e[35];let _;e[36]!==f||e[37]!==v||e[38]!==h||e[39]!==y||e[40]!==b?(_=s.jsxs(f,{className:h,align:y,children:[b,v]}),e[36]=f,e[37]=v,e[38]=h,e[39]=y,e[40]=b,e[41]=_):_=e[41];let k;return e[42]!==g||e[43]!==z||e[44]!==_||e[45]!==w||e[46]!==m?(k=s.jsxs(g,{open:w,onOpenChange:m,children:[z,_]}),e[42]=g,e[43]=z,e[44]=_,e[45]=w,e[46]=m,e[47]=k):k=e[47],k}function nt(){const t=G.c(60),e=Je(),a=ge(),o=Ve();let p;t[0]!==e?.ids?(p=e?.ids??[...re],t[0]=e?.ids,t[1]=p):p=t[1];const i=p,[n,C]=Q.useState(i);let E;t[2]!==n||t[3]!==i?(E=n.length!==i.length||n.some((l,L)=>l!==i[L]),t[2]=n,t[3]=i,t[4]=E):E=t[4];const N=E;let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r={activationConstraint:{distance:5}},t[5]=r):r=t[5];let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f={coordinateGetter:Me},t[6]=f):f=t[6];const g=Ee(le(Fe,r),le(Te,f));let d;t[7]!==n?(d=l=>{const{active:L,over:K}=l;if(!K||L.id===K.id)return;const H=n.indexOf(L.id),U=n.indexOf(K.id);H===-1||U===-1||C($e([...n],H,U))},t[7]=n,t[8]=d):d=t[8];const c=d;let z;t[9]!==n?(z=l=>{n.includes(l)||C([...n,l])},t[9]=n,t[10]=z):z=t[10];const D=z;let x;t[11]!==n?(x=l=>{C(n.filter(L=>L!==l))},t[11]=n,t[12]=x):x=t[12];const j=x;let h;t[13]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{C([...re])},t[13]=h):h=t[13];const y=h;let b;t[14]!==n||t[15]!==o?(b=()=>{o.mutate({ids:n},{onSuccess:()=>{q("default_home_agents_updated",{count:n.length,template_count:n.filter(at).length}),T.success("Default home agents updated")},onError:it})},t[14]=n,t[15]=o,t[16]=b):b=t[16];const w=b;let m,S,v,_,k,P,A;if(t[17]!==a||t[18]!==n||t[19]!==c||t[20]!==j||t[21]!==g||t[22]!==o.isPending){let l;t[30]!==a?(l=U=>et(U,ae,a),t[30]=a,t[31]=l):l=t[31];const L=n.map(l);v=Math.max(0,n.length-ne),S=Y,k="p-6";let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(ee,{className:"text-sm",children:"Default home agents"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Choose which agents appear on the home view for everyone in this organization. Drag to reorder. Up to ",ne," tiles render on the home view."]})]}),t[32]=K):K=t[32];let H;t[33]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Se,{size:14}),t[33]=H):H=t[33],t[34]!==o.isPending?(P=s.jsxs(X,{className:"p-0 flex flex-row items-start justify-between gap-3",children:[K,s.jsxs(M,{type:"button",variant:"ghost",size:"sm",onClick:y,disabled:o.isPending,children:[H,"Reset defaults"]})]}),t[34]=o.isPending,t[35]=P):P=t[35],m=te,A="p-0 flex flex-col gap-3",_=L.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(Ie,{sensors:g,collisionDetection:Pe,onDragEnd:c,children:s.jsx(ke,{items:n,strategy:Oe,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:L.map((U,he)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[he===ne&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(tt,{agent:U,onRemove:()=>j(U.id)})]},U.id))})})}),t[17]=a,t[18]=n,t[19]=c,t[20]=j,t[21]=g,t[22]=o.isPending,t[23]=m,t[24]=S,t[25]=v,t[26]=_,t[27]=k,t[28]=P,t[29]=A}else m=t[23],S=t[24],v=t[25],_=t[26],k=t[27],P=t[28],A=t[29];let I;t[36]!==n||t[37]!==D?(I=s.jsx(st,{selectedIds:n,onAdd:D}),t[36]=n,t[37]=D,t[38]=I):I=t[38];let O;t[39]!==v?(O=v>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[v," agent",v===1?"":"s"," won't fit on the home view"]}),t[39]=v,t[40]=O):O=t[40];let u;t[41]!==I||t[42]!==O?(u=s.jsxs("div",{className:"flex items-center justify-between",children:[I,O]}),t[41]=I,t[42]=O,t[43]=u):u=t[43];let F;t[44]!==m||t[45]!==_||t[46]!==u||t[47]!==A?(F=s.jsxs(m,{className:A,children:[_,u]}),t[44]=m,t[45]=_,t[46]=u,t[47]=A,t[48]=F):F=t[48];let R;t[49]!==w||t[50]!==i||t[51]!==N||t[52]!==o.isPending?(R=N&&s.jsxs(ue,{className:"p-0 pt-2 gap-2",children:[s.jsx(M,{type:"button",onClick:w,disabled:o.isPending,children:o.isPending?"Saving…":"Save"}),s.jsx(M,{type:"button",variant:"outline",onClick:()=>C(i),disabled:o.isPending,children:"Cancel"})]}),t[49]=w,t[50]=i,t[51]=N,t[52]=o.isPending,t[53]=R):R=t[53];let $;return t[54]!==S||t[55]!==k||t[56]!==P||t[57]!==F||t[58]!==R?($=s.jsxs(S,{className:k,children:[P,F,R]}),t[54]=S,t[55]=k,t[56]=P,t[57]=F,t[58]=R,t[59]=$):$=t[59],$}function it(t){T.error(t instanceof Error?t.message:"Failed to update default home agents")}function at(t){return ae.some(e=>e.id===t)}function ot(){const t=G.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X,{className:"p-0",children:s.jsx(ee,{className:"text-sm",children:"Default home agents"})}),t[0]=e):e=t[0];let a;return t[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs(Y,{className:"p-6",children:[e,s.jsx(te,{className:"p-0 flex flex-col gap-2",children:Array.from({length:4}).map(lt)})]}),t[1]=a):a=t[1],a}function lt(t,e){return s.jsx(He,{className:"h-12 w-full rounded-lg"},e)}function rt(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Q.Suspense,{fallback:s.jsx(ot,{}),children:s.jsx(nt,{})}),t[0]=e):e=t[0],e}function ct(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(J,{children:s.jsx(J.Content,{children:s.jsx(J.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(J.Title,{children:"Organization"}),s.jsx(Ye,{}),s.jsx(Xe,{}),s.jsx(rt,{})]})})})}),t[0]=e):e=t[0],e}function ts(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ct,{}),t[0]=e):e=t[0],e}export{ts as default};
|
package/dist/client/assets/{github-repo-picker-DnkATBdp.js → github-repo-picker-DZqLC6FL.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as M,s as z,o as ve,b as ze,r as O,K as ne,n as He,a as Fe,j as t,c as he,B as oe,t as V,z as ie,f as We,a0 as Je,a1 as Xe,az as je,C as Ze,l as xe,V as et}from"./index-DHvfV22T.js";import{S as re,u as $,d as we,W as Be,j as ye}from"./constants-BgpFj97_.js";import{u as Ne}from"./use-navigate-to-agent-CVVCVmb_.js";import{c as ce,d as le,a as de,D as ue,b as tt}from"./dialog-BlDJEasr.js";import{i as Ae}from"./SearchMd-DmmmzJIi.js";import{C as qe}from"./collection-search-BSwS6tWM.js";import{c as Ee,b as Se,D as Oe,a as Le}from"./drawer-n2769KGk.js";import{u as Re}from"./use-mobile-DHF6z3l-.js";import{I as Me}from"./integration-icon-CI13mmaS.js";import{a as ke,u as nt}from"./use-connection-B4n7P5ZX.js";import{u as st,d as Qe}from"./use-mcp-tools-BGEi8TMH.js";import{b as Ue,u as it}from"./use-virtual-mcp-ByUoWLLO.js";import{C as ot}from"./checkbox-BafUZKEr.js";import{i as at}from"./Lock01-D0hjzmk2.js";import{I as rt}from"./agent-icon-B4FOoeEp.js";import{e as ct}from"./extract-connection-data-BkZ-2zmr.js";function lt(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function dt(){const i=await fetch("/api/deco-sites");if(!i.ok){const e=await i.json().catch(()=>({}));throw new Error(e.error??`Failed to load sites (${i.status})`)}return i.json()}function Kt(i){const e=M.c(65),{open:n,onOpenChange:a,onBack:c}=i,{org:s}=z(),l=Ne(),m=ve(),{data:f}=ze.useSession(),[x,h]=O.useState(null),[T,d]=O.useState("");let u;e[0]!==s.id?(u={connectionId:re,orgId:s.id},e[0]=s.id,e[1]=u):u=e[1];const p=$(u);let r;e[2]!==f?.user?.email?(r=ne.decoSites(f?.user?.email),e[2]=f?.user?.email,e[3]=r):r=e[3];const g=n&&!!f?.user?.email;let C;e[4]!==r||e[5]!==g?(C={queryKey:r,queryFn:dt,enabled:g,staleTime:6e4,retry:!1},e[4]=r,e[5]=g,e[6]=C):C=e[6];const{data:_,isLoading:N,error:b}=He(C),I=_?.sites??[];let o;e[7]!==a?(o=w=>{w||(h(null),d("")),a(w)},e[7]=a,e[8]=o):o=e[8];const y=o;let A;e[9]!==T?(A=w=>w.name.toLowerCase().includes(T.toLowerCase())||w.domains?.[0]?.domain.toLowerCase().includes(T.toLowerCase()),e[9]=T,e[10]=A):A=e[10];const v=I.filter(A),E=!x||v.some(w=>w.name===x);let j;e[11]!==p||e[12]!==s.id?(j=async w=>{V("deco_site_import_started",{site_name:w});const G=await fetch("/api/deco-sites/connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:w,orgId:s.id})}),D=await G.json().catch(ft);if(!G.ok)throw new Error(D.error??`Failed to create connection (${G.status})`);const L=D.connId;if(!L)throw new Error("Server did not return a connection ID");const ge=D.icon??null,te=lt(w),Pe=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:w,description:"Imported from deco.cx",pinned:!0,icon:ge??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],ui:{banner:null,bannerColor:"#22C55E",icon:ge,themeColor:"#22C55E",slug:te,pinnedViews:[{connectionId:L,toolName:"file_explorer",label:"Preview",icon:null},{connectionId:L,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:L,toolName:"get_monitor_data",label:"Monitor",icon:null},{connectionId:L,toolName:"list_pull_requests",label:"Pull Requests",icon:null},{connectionId:L,toolName:"list_releases",label:"Releases",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:L,toolName:"file_explorer"}}}},connections:[{connection_id:L}]}}}),Ge=Pe.structuredContent??Pe;return{slug:te,virtualMcpId:Ge.item.id,connId:L,item:Ge.item}},e[11]=p,e[12]=s.id,e[13]=j):j=e[13];let S;e[14]!==p||e[15]!==y||e[16]!==l||e[17]!==s.id||e[18]!==m?(S=w=>{const{slug:G,virtualMcpId:D,item:L}=w;V("deco_site_import_succeeded",{site_name:L.title,virtual_mcp_id:D,slug:G}),m.setQueryData(ne.collectionItem(p,s.id,"","VIRTUAL_MCP",D),{item:L}),m.invalidateQueries({predicate:ge=>{const te=ge.queryKey;return te[1]===s.id&&te[3]==="collection"&&te[4]==="VIRTUAL_MCP"}}),m.invalidateQueries({queryKey:ne.projects(s.id)}),ie.success(`Imported ${G} from deco.cx`),y(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(D)},e[14]=p,e[15]=y,e[16]=l,e[17]=s.id,e[18]=m,e[19]=S):S=e[19];let k;e[20]!==j||e[21]!==S?(k={mutationFn:j,onSuccess:S,onError:mt},e[20]=j,e[21]=S,e[22]=k):k=e[22];const U=Fe(k),H=le,se=ce,R="sm:max-w-[900px] p-0 gap-0 overflow-hidden";let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(de,{className:"sr-only",children:t.jsx(ue,{children:"Import from deco.cx"})}),e[23]=P):P=e[23];let F;e[24]!==c?(F=c&&t.jsx("button",{type:"button",onClick:c,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:t.jsx(Ae,{size:18})}),e[24]=c,e[25]=F):F=e[25];let me;e[26]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"}),e[26]=me):me=e[26];let B;e[27]!==F?(B=t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[F,me]}),e[27]=F,e[28]=B):B=e[28];let fe;e[29]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w.key==="Escape"&&d("")},e[29]=fe):fe=e[29];let q;e[30]!==T?(q=t.jsx("div",{children:t.jsx(qe,{value:T,onChange:d,placeholder:"Search sites...",onKeyDown:fe})}),e[30]=T,e[31]=q):q=e[31];const Ke="pb-0 min-h-[300px]";let Q;e[32]!==N?(Q=N&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),e[32]=N,e[33]=Q):Q=e[33];const _e=!N&&!b&&I.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),Ce=!N&&I.length>0&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[v.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",T,"”"]}),v.map(w=>{const G=w.domains?.find(ut)?.domain??w.domains?.[0]?.domain,D=x===w.name;return t.jsxs("button",{type:"button",onClick:()=>h(w.name),className:he("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",D?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[t.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:w.thumb_url?t.jsx("img",{src:w.thumb_url,alt:w.name,className:"w-full h-full object-cover",loading:"lazy"}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsxs("div",{className:"px-4 py-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:w.name}),G&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:G})]})]},w.name)})]});let Y;e[34]!==Q||e[35]!==_e||e[36]!==Ce?(Y=t.jsxs("div",{className:Ke,children:[Q,_e,Ce]}),e[34]=Q,e[35]=_e,e[36]=Ce,e[37]=Y):Y=e[37];let K;e[38]!==y?(K=()=>y(!1),e[38]=y,e[39]=K):K=e[39];let W;e[40]!==U.isPending||e[41]!==K?(W=t.jsx(oe,{variant:"outline",onClick:K,disabled:U.isPending,children:"Cancel"}),e[40]=U.isPending,e[41]=K,e[42]=W):W=e[42];const Ie=!x||!E||U.isPending||N;let J;e[43]!==U||e[44]!==x?(J=()=>x&&U.mutate(x),e[43]=U,e[44]=x,e[45]=J):J=e[45];const Te=U.isPending?"Importing...":"Import";let X;e[46]!==Ie||e[47]!==J||e[48]!==Te?(X=t.jsx(oe,{disabled:Ie,onClick:J,children:Te}),e[46]=Ie,e[47]=J,e[48]=Te,e[49]=X):X=e[49];let Z;e[50]!==W||e[51]!==X?(Z=t.jsxs(tt,{className:"px-8 py-5 border-t border-border",children:[W,X]}),e[50]=W,e[51]=X,e[52]=Z):Z=e[52];let ee;e[53]!==se||e[54]!==P||e[55]!==B||e[56]!==q||e[57]!==Y||e[58]!==Z?(ee=t.jsxs(se,{className:R,children:[P,B,q,Y,Z]}),e[53]=se,e[54]=P,e[55]=B,e[56]=q,e[57]=Y,e[58]=Z,e[59]=ee):ee=e[59];let pe;return e[60]!==H||e[61]!==y||e[62]!==n||e[63]!==ee?(pe=t.jsx(H,{open:n,onOpenChange:y,children:ee}),e[60]=H,e[61]=y,e[62]=n,e[63]=ee,e[64]=pe):pe=e[64],pe}function ut(i){return i.production}function mt(i){V("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),ie.error("Import failed: "+(i instanceof Error?i.message:"Unknown error"))}function ft(){return{}}function Ye(i,e){const n=M.c(11),{org:a}=z();let c;n[0]!==a.id?(c=we.REGISTRY(a.id),n[0]=a.id,n[1]=c):c=n[1];const s=c;let l;n[2]!==a.id||n[3]!==s?(l={connectionId:s,orgId:a.id},n[2]=a.id,n[3]=s,n[4]=l):l=n[4];const m=$(l);let f;n[5]!==i?(f={name:i},n[5]=i,n[6]=f):f=n[6];const x=e?.enabled??!0;let h;return n[7]!==m||n[8]!==f||n[9]!==x?(h={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:f,enabled:x,staleTime:3e5,select:pt},n[7]=m,n[8]=f,n[9]=x,n[10]=h):h=n[10],st(h)}function pt(i){return i.structuredContent?.item??null}const gt=["Full HAR capture with cache, TTFB, and request analysis","Screenshot capture for visual inspection","Page discovery via sitemap, navigation, and link crawling","SEO audit — meta tags, structured data, robots.txt","Third-party script inventory and size analysis","Dead link detection across the entire site","Deco-specific diagnostics (?__d debug mode)"];function De(i){const e=M.c(7),{onRecruit:n,isRecruiting:a,isLoading:c}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a blackbox diagnostics agent that tests your storefront from the outside — no internal access needed. Give it a URL and it produces a detailed performance and health report."}),e[0]=s):s=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=l):l=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx("ul",{className:"space-y-1.5",children:gt.map(ht)})]}),e[2]=m):m=e[2];const f=a||c,x=a?"Setting up...":"Add Site Diagnostics";let h;return e[3]!==n||e[4]!==f||e[5]!==x?(h=t.jsxs("div",{className:"flex flex-col gap-6",children:[s,m,t.jsx(oe,{onClick:n,disabled:f,className:"w-full cursor-pointer",children:x})]}),e[3]=n,e[4]=f,e[5]=x,e[6]=h):h=e[6],h}function ht(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),i]},i)}function Wt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(I=>I.id==="site-diagnostics"),{data:u,isLoading:p}=Ye(d.appId,{enabled:i}),r=u?.title||u?.server?.title||u?.server?.name||d.title,g=u?.server?.icons?.[0]?.src??d.icon,C=u?.server?.description??null,_=t.jsx(Me,{icon:g,name:r,size:"sm"}),N=async()=>{if(u){if(n){e(!1),s(n.id);return}T(!0);try{const I=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:d.appId},limit:1,offset:0}});let o;const A=I?.structuredContent?.items?.find(E=>E.app_id===d.appId);if(A)o=A.id;else{const E=u.server?.remotes?.[0]?.url;if(!E)throw new Error("Registry item is missing a remote URL for site-diagnostics");o=(await l.create.mutateAsync({title:r,description:C,icon:u.server?.icons?.[0]?.src??d.icon,connection_type:"HTTP",connection_url:E,app_name:u.server?.name??"site-diagnostics",app_id:d.appId,metadata:{type:"site-diagnostics",source:"store",registry_item_id:d.appId,verified:!0}})).id}const v=await m.create.mutateAsync({title:r,description:C,icon:g,status:"active",connections:[{connection_id:o,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"site-diagnostics",instructions:null,ui:{pinnedViews:[{connectionId:o,toolName:"diagnose",label:"diagnose",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:o,toolName:"diagnose"}}}}});V("agent_recruit_confirmed",{template_id:"site-diagnostics",agent_id:v.id}),e(!1),s(v.id)}catch(I){V("agent_recruit_failed",{template_id:"site-diagnostics",error:I instanceof Error?I.message:String(I)}),console.error("Failed to create Site Diagnostics agent:",I)}finally{T(!1)}}},b=`Add ${r}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(Le,{className:"text-xl font-semibold",children:b})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(ue,{className:"text-xl font-semibold",children:b})]})}),t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})]})})}const xt="https://sites-lean-canva.decocache.com/api/mcp",Nt=["Build and update Lean Canvas business models visually","Interactive grid UI with all 9 canvas sections","Iterative updates — add information as you discover it","Covers: Problem, Solution, Key Metrics, Unique Value Proposition","Covers: Channels, Customer Segments, Cost Structure, Revenue Streams","Unfair Advantage analysis"];function Ve(i){const e=M.c(7),{onRecruit:n,isRecruiting:a}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a Lean Canvas agent that helps you build and iterate on your business model. Describe your idea and it produces a visual, structured canvas."}),e[0]=c):c=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"space-y-2",children:[s,t.jsx("ul",{className:"space-y-1.5",children:Nt.map(_t)})]}),e[2]=l):l=e[2];const m=a?"Setting up...":"Add Lean Canvas";let f;return e[3]!==a||e[4]!==n||e[5]!==m?(f=t.jsxs("div",{className:"flex flex-col gap-6",children:[c,l,t.jsx(oe,{onClick:n,disabled:a,className:"w-full cursor-pointer",children:m})]}),e[3]=a,e[4]=n,e[5]=m,e[6]=f):f=e[6],f}function _t(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),i]},i)}function Jt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(g=>g.id==="lean-canvas"),u=t.jsx(Me,{icon:d.icon,name:d.title,size:"sm"}),p=async()=>{if(n){e(!1),s(n.id);return}T(!0);try{const g=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:"lean-canvas"},limit:1,offset:0}});let C;const N=g?.structuredContent?.items?.find(o=>o.app_id==="lean-canvas"),b=we.SELF(c.id);N?C=N.id:C=(await l.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,connection_type:"HTTP",connection_url:xt,app_name:"lean-canvas",app_id:"lean-canvas",configuration_state:{OBJECT_STORAGE:{__type:"@deco/object-storage",value:b}},metadata:{type:"lean-canvas",source:"store",verified:!0}})).id;const I=await m.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,status:"active",connections:[{connection_id:C,selected_tools:null,selected_resources:null,selected_prompts:null},{connection_id:b,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"lean-canvas",instructions:null,ui:{pinnedViews:[{connectionId:C,toolName:"lean_canvas",label:"lean_canvas",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:C,toolName:"lean_canvas"}}}}});V("agent_recruit_confirmed",{template_id:"lean-canvas",agent_id:I.id}),e(!1),s(I.id)}catch(g){V("agent_recruit_failed",{template_id:"lean-canvas",error:g instanceof Error?g.message:String(g)}),console.error("Failed to create Lean Canvas agent:",g)}finally{T(!1)}},r=`Add ${d.title}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(Le,{className:"text-xl font-semibold",children:r})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(Ve,{onRecruit:p,isRecruiting:h})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(ue,{className:"text-xl font-semibold",children:r})]})}),t.jsx(Ve,{onRecruit:p,isRecruiting:h})]})})}const Ct=`<role>
|
|
1
|
+
import{e as M,s as z,o as ve,b as ze,r as O,K as ne,n as Fe,a as He,j as t,c as he,B as oe,t as V,z as ie,f as We,a0 as Je,a1 as Xe,az as je,C as Ze,l as xe,V as et}from"./index-D34n6J5J.js";import{S as re,u as $,d as we,W as Be,j as ye}from"./constants-DDHDU3PV.js";import{u as Ne}from"./use-navigate-to-agent-CFIKBq0L.js";import{c as ce,d as le,a as de,D as ue,b as tt}from"./dialog-C4lREl-t.js";import{i as Ae}from"./RefreshCcw01-B10mKiE2.js";import{C as qe}from"./collection-search-Bo2bOvRn.js";import{c as Ee,b as Se,D as Oe,a as Le}from"./drawer-BTCEaGGQ.js";import{u as Re}from"./use-mobile-CxvYCzu9.js";import{I as Me}from"./integration-icon-Cdkk9YPE.js";import{a as ke,u as nt}from"./use-connection-Cif-LY0f.js";import{u as st,d as Qe}from"./use-mcp-tools-BYVtg7WH.js";import{b as Ue,u as it}from"./use-virtual-mcp-0vHwLInn.js";import{C as ot}from"./checkbox-DznLgPgR.js";import{i as at}from"./Lock01-DpPIS3K7.js";import{F as rt}from"./agent-icon-CyE6nkC1.js";import{e as ct}from"./extract-connection-data-CfXvFcGA.js";function lt(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function dt(){const i=await fetch("/api/deco-sites");if(!i.ok){const e=await i.json().catch(()=>({}));throw new Error(e.error??`Failed to load sites (${i.status})`)}return i.json()}function Kt(i){const e=M.c(65),{open:n,onOpenChange:a,onBack:c}=i,{org:s}=z(),l=Ne(),m=ve(),{data:f}=ze.useSession(),[x,h]=O.useState(null),[T,d]=O.useState("");let u;e[0]!==s.id?(u={connectionId:re,orgId:s.id},e[0]=s.id,e[1]=u):u=e[1];const p=$(u);let r;e[2]!==f?.user?.email?(r=ne.decoSites(f?.user?.email),e[2]=f?.user?.email,e[3]=r):r=e[3];const g=n&&!!f?.user?.email;let C;e[4]!==r||e[5]!==g?(C={queryKey:r,queryFn:dt,enabled:g,staleTime:6e4,retry:!1},e[4]=r,e[5]=g,e[6]=C):C=e[6];const{data:_,isLoading:N,error:b}=Fe(C),I=_?.sites??[];let o;e[7]!==a?(o=w=>{w||(h(null),d("")),a(w)},e[7]=a,e[8]=o):o=e[8];const y=o;let A;e[9]!==T?(A=w=>w.name.toLowerCase().includes(T.toLowerCase())||w.domains?.[0]?.domain.toLowerCase().includes(T.toLowerCase()),e[9]=T,e[10]=A):A=e[10];const v=I.filter(A),E=!x||v.some(w=>w.name===x);let j;e[11]!==p||e[12]!==s.id?(j=async w=>{V("deco_site_import_started",{site_name:w});const G=await fetch("/api/deco-sites/connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:w,orgId:s.id})}),D=await G.json().catch(ft);if(!G.ok)throw new Error(D.error??`Failed to create connection (${G.status})`);const L=D.connId;if(!L)throw new Error("Server did not return a connection ID");const ge=D.icon??null,te=lt(w),Pe=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:w,description:"Imported from deco.cx",pinned:!0,icon:ge??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],ui:{banner:null,bannerColor:"#22C55E",icon:ge,themeColor:"#22C55E",slug:te,pinnedViews:[{connectionId:L,toolName:"file_explorer",label:"Preview",icon:null},{connectionId:L,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:L,toolName:"get_monitor_data",label:"Monitor",icon:null},{connectionId:L,toolName:"list_pull_requests",label:"Pull Requests",icon:null},{connectionId:L,toolName:"list_releases",label:"Releases",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:L,toolName:"file_explorer"}}}},connections:[{connection_id:L}]}}}),Ge=Pe.structuredContent??Pe;return{slug:te,virtualMcpId:Ge.item.id,connId:L,item:Ge.item}},e[11]=p,e[12]=s.id,e[13]=j):j=e[13];let S;e[14]!==p||e[15]!==y||e[16]!==l||e[17]!==s.id||e[18]!==m?(S=w=>{const{slug:G,virtualMcpId:D,item:L}=w;V("deco_site_import_succeeded",{site_name:L.title,virtual_mcp_id:D,slug:G}),m.setQueryData(ne.collectionItem(p,s.id,"","VIRTUAL_MCP",D),{item:L}),m.invalidateQueries({predicate:ge=>{const te=ge.queryKey;return te[1]===s.id&&te[3]==="collection"&&te[4]==="VIRTUAL_MCP"}}),m.invalidateQueries({queryKey:ne.projects(s.id)}),ie.success(`Imported ${G} from deco.cx`),y(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(D)},e[14]=p,e[15]=y,e[16]=l,e[17]=s.id,e[18]=m,e[19]=S):S=e[19];let k;e[20]!==j||e[21]!==S?(k={mutationFn:j,onSuccess:S,onError:mt},e[20]=j,e[21]=S,e[22]=k):k=e[22];const U=He(k),F=le,se=ce,R="sm:max-w-[900px] p-0 gap-0 overflow-hidden";let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(de,{className:"sr-only",children:t.jsx(ue,{children:"Import from deco.cx"})}),e[23]=P):P=e[23];let H;e[24]!==c?(H=c&&t.jsx("button",{type:"button",onClick:c,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:t.jsx(Ae,{size:18})}),e[24]=c,e[25]=H):H=e[25];let me;e[26]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"}),e[26]=me):me=e[26];let B;e[27]!==H?(B=t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[H,me]}),e[27]=H,e[28]=B):B=e[28];let fe;e[29]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w.key==="Escape"&&d("")},e[29]=fe):fe=e[29];let q;e[30]!==T?(q=t.jsx("div",{children:t.jsx(qe,{value:T,onChange:d,placeholder:"Search sites...",onKeyDown:fe})}),e[30]=T,e[31]=q):q=e[31];const Ke="pb-0 min-h-[300px]";let Q;e[32]!==N?(Q=N&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),e[32]=N,e[33]=Q):Q=e[33];const _e=!N&&!b&&I.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),Ce=!N&&I.length>0&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[v.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",T,"”"]}),v.map(w=>{const G=w.domains?.find(ut)?.domain??w.domains?.[0]?.domain,D=x===w.name;return t.jsxs("button",{type:"button",onClick:()=>h(w.name),className:he("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",D?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[t.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:w.thumb_url?t.jsx("img",{src:w.thumb_url,alt:w.name,className:"w-full h-full object-cover",loading:"lazy"}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsxs("div",{className:"px-4 py-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:w.name}),G&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:G})]})]},w.name)})]});let Y;e[34]!==Q||e[35]!==_e||e[36]!==Ce?(Y=t.jsxs("div",{className:Ke,children:[Q,_e,Ce]}),e[34]=Q,e[35]=_e,e[36]=Ce,e[37]=Y):Y=e[37];let K;e[38]!==y?(K=()=>y(!1),e[38]=y,e[39]=K):K=e[39];let W;e[40]!==U.isPending||e[41]!==K?(W=t.jsx(oe,{variant:"outline",onClick:K,disabled:U.isPending,children:"Cancel"}),e[40]=U.isPending,e[41]=K,e[42]=W):W=e[42];const Ie=!x||!E||U.isPending||N;let J;e[43]!==U||e[44]!==x?(J=()=>x&&U.mutate(x),e[43]=U,e[44]=x,e[45]=J):J=e[45];const Te=U.isPending?"Importing...":"Import";let X;e[46]!==Ie||e[47]!==J||e[48]!==Te?(X=t.jsx(oe,{disabled:Ie,onClick:J,children:Te}),e[46]=Ie,e[47]=J,e[48]=Te,e[49]=X):X=e[49];let Z;e[50]!==W||e[51]!==X?(Z=t.jsxs(tt,{className:"px-8 py-5 border-t border-border",children:[W,X]}),e[50]=W,e[51]=X,e[52]=Z):Z=e[52];let ee;e[53]!==se||e[54]!==P||e[55]!==B||e[56]!==q||e[57]!==Y||e[58]!==Z?(ee=t.jsxs(se,{className:R,children:[P,B,q,Y,Z]}),e[53]=se,e[54]=P,e[55]=B,e[56]=q,e[57]=Y,e[58]=Z,e[59]=ee):ee=e[59];let pe;return e[60]!==F||e[61]!==y||e[62]!==n||e[63]!==ee?(pe=t.jsx(F,{open:n,onOpenChange:y,children:ee}),e[60]=F,e[61]=y,e[62]=n,e[63]=ee,e[64]=pe):pe=e[64],pe}function ut(i){return i.production}function mt(i){V("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),ie.error("Import failed: "+(i instanceof Error?i.message:"Unknown error"))}function ft(){return{}}function Ye(i,e){const n=M.c(11),{org:a}=z();let c;n[0]!==a.id?(c=we.REGISTRY(a.id),n[0]=a.id,n[1]=c):c=n[1];const s=c;let l;n[2]!==a.id||n[3]!==s?(l={connectionId:s,orgId:a.id},n[2]=a.id,n[3]=s,n[4]=l):l=n[4];const m=$(l);let f;n[5]!==i?(f={name:i},n[5]=i,n[6]=f):f=n[6];const x=e?.enabled??!0;let h;return n[7]!==m||n[8]!==f||n[9]!==x?(h={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:f,enabled:x,staleTime:3e5,select:pt},n[7]=m,n[8]=f,n[9]=x,n[10]=h):h=n[10],st(h)}function pt(i){return i.structuredContent?.item??null}const gt=["Full HAR capture with cache, TTFB, and request analysis","Screenshot capture for visual inspection","Page discovery via sitemap, navigation, and link crawling","SEO audit — meta tags, structured data, robots.txt","Third-party script inventory and size analysis","Dead link detection across the entire site","Deco-specific diagnostics (?__d debug mode)"];function De(i){const e=M.c(7),{onRecruit:n,isRecruiting:a,isLoading:c}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a blackbox diagnostics agent that tests your storefront from the outside — no internal access needed. Give it a URL and it produces a detailed performance and health report."}),e[0]=s):s=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=l):l=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx("ul",{className:"space-y-1.5",children:gt.map(ht)})]}),e[2]=m):m=e[2];const f=a||c,x=a?"Setting up...":"Add Site Diagnostics";let h;return e[3]!==n||e[4]!==f||e[5]!==x?(h=t.jsxs("div",{className:"flex flex-col gap-6",children:[s,m,t.jsx(oe,{onClick:n,disabled:f,className:"w-full cursor-pointer",children:x})]}),e[3]=n,e[4]=f,e[5]=x,e[6]=h):h=e[6],h}function ht(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),i]},i)}function Wt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(I=>I.id==="site-diagnostics"),{data:u,isLoading:p}=Ye(d.appId,{enabled:i}),r=u?.title||u?.server?.title||u?.server?.name||d.title,g=u?.server?.icons?.[0]?.src??d.icon,C=u?.server?.description??null,_=t.jsx(Me,{icon:g,name:r,size:"sm"}),N=async()=>{if(u){if(n){e(!1),s(n.id);return}T(!0);try{const I=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:d.appId},limit:1,offset:0}});let o;const A=I?.structuredContent?.items?.find(E=>E.app_id===d.appId);if(A)o=A.id;else{const E=u.server?.remotes?.[0]?.url;if(!E)throw new Error("Registry item is missing a remote URL for site-diagnostics");o=(await l.create.mutateAsync({title:r,description:C,icon:u.server?.icons?.[0]?.src??d.icon,connection_type:"HTTP",connection_url:E,app_name:u.server?.name??"site-diagnostics",app_id:d.appId,metadata:{type:"site-diagnostics",source:"store",registry_item_id:d.appId,verified:!0}})).id}const v=await m.create.mutateAsync({title:r,description:C,icon:g,status:"active",connections:[{connection_id:o,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"site-diagnostics",instructions:null,ui:{pinnedViews:[{connectionId:o,toolName:"diagnose",label:"diagnose",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:o,toolName:"diagnose"}}}}});V("agent_recruit_confirmed",{template_id:"site-diagnostics",agent_id:v.id}),e(!1),s(v.id)}catch(I){V("agent_recruit_failed",{template_id:"site-diagnostics",error:I instanceof Error?I.message:String(I)}),console.error("Failed to create Site Diagnostics agent:",I)}finally{T(!1)}}},b=`Add ${r}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(Le,{className:"text-xl font-semibold",children:b})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(ue,{className:"text-xl font-semibold",children:b})]})}),t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})]})})}const xt="https://sites-lean-canva.decocache.com/api/mcp",Nt=["Build and update Lean Canvas business models visually","Interactive grid UI with all 9 canvas sections","Iterative updates — add information as you discover it","Covers: Problem, Solution, Key Metrics, Unique Value Proposition","Covers: Channels, Customer Segments, Cost Structure, Revenue Streams","Unfair Advantage analysis"];function Ve(i){const e=M.c(7),{onRecruit:n,isRecruiting:a}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a Lean Canvas agent that helps you build and iterate on your business model. Describe your idea and it produces a visual, structured canvas."}),e[0]=c):c=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"space-y-2",children:[s,t.jsx("ul",{className:"space-y-1.5",children:Nt.map(_t)})]}),e[2]=l):l=e[2];const m=a?"Setting up...":"Add Lean Canvas";let f;return e[3]!==a||e[4]!==n||e[5]!==m?(f=t.jsxs("div",{className:"flex flex-col gap-6",children:[c,l,t.jsx(oe,{onClick:n,disabled:a,className:"w-full cursor-pointer",children:m})]}),e[3]=a,e[4]=n,e[5]=m,e[6]=f):f=e[6],f}function _t(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),i]},i)}function Jt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(g=>g.id==="lean-canvas"),u=t.jsx(Me,{icon:d.icon,name:d.title,size:"sm"}),p=async()=>{if(n){e(!1),s(n.id);return}T(!0);try{const g=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:"lean-canvas"},limit:1,offset:0}});let C;const N=g?.structuredContent?.items?.find(o=>o.app_id==="lean-canvas"),b=we.SELF(c.id);N?C=N.id:C=(await l.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,connection_type:"HTTP",connection_url:xt,app_name:"lean-canvas",app_id:"lean-canvas",configuration_state:{OBJECT_STORAGE:{__type:"@deco/object-storage",value:b}},metadata:{type:"lean-canvas",source:"store",verified:!0}})).id;const I=await m.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,status:"active",connections:[{connection_id:C,selected_tools:null,selected_resources:null,selected_prompts:null},{connection_id:b,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"lean-canvas",instructions:null,ui:{pinnedViews:[{connectionId:C,toolName:"lean_canvas",label:"lean_canvas",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:C,toolName:"lean_canvas"}}}}});V("agent_recruit_confirmed",{template_id:"lean-canvas",agent_id:I.id}),e(!1),s(I.id)}catch(g){V("agent_recruit_failed",{template_id:"lean-canvas",error:g instanceof Error?g.message:String(g)}),console.error("Failed to create Lean Canvas agent:",g)}finally{T(!1)}},r=`Add ${d.title}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(Le,{className:"text-xl font-semibold",children:r})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(Ve,{onRecruit:p,isRecruiting:h})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(ue,{className:"text-xl font-semibold",children:r})]})}),t.jsx(Ve,{onRecruit:p,isRecruiting:h})]})})}const Ct=`<role>
|
|
2
2
|
You are the Agent Manager. You create, configure, and maintain agents (Virtual MCPs) in this workspace.
|
|
3
3
|
</role>
|
|
4
4
|
|
|
@@ -113,4 +113,4 @@ You are the Connection Manager. You create, configure, test, and manage MCP conn
|
|
|
113
113
|
a. List all connections with COLLECTION_CONNECTIONS_LIST.
|
|
114
114
|
b. Test each connection's health with CONNECTION_TEST.
|
|
115
115
|
c. Report which connections are healthy, erroring, or inactive.
|
|
116
|
-
</workflows>`,yt=[{id:"studio-agent-manager",title:"Agent Manager",icon:"icon://Bot?color=violet",description:"Create, configure, and manage agents",selectedTools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE","COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET"],instructions:Ct,getId:ye.AGENT_MANAGER},{id:"studio-automation-manager",title:"Automation Manager",icon:"icon://Zap?color=amber",description:"Create, configure, and run automations with triggers",selectedTools:["AUTOMATION_CREATE","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_RUN","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET"],instructions:It,getId:ye.AUTOMATION_MANAGER},{id:"studio-connection-manager",title:"Connection Manager",icon:"icon://Link01?color=cyan",description:"Create, configure, test, and manage connections",selectedTools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","CONNECTION_TEST"],instructions:Tt,getId:ye.CONNECTION_MANAGER}],bt=[{title:"Agent Manager",description:"Create, configure, and manage agents"},{title:"Automation Manager",description:"Create, configure, and run automations with triggers"},{title:"Connection Manager",description:"Create, configure, test, and manage connections"}];function $e(i){const e=M.c(7),{onInstall:n,isInstalling:a}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Install a suite of pre-configured agents for managing your studio. Each agent is scoped to a specific domain with focused instructions."}),e[0]=c):c=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Included agents"}),e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"space-y-2",children:[s,t.jsx("ul",{className:"space-y-1.5",children:bt.map(jt)})]}),e[2]=l):l=e[2];const m=a?"Installing...":"Install Studio Pack";let f;return e[3]!==a||e[4]!==n||e[5]!==m?(f=t.jsxs("div",{className:"flex flex-col gap-6",children:[c,l,t.jsx(oe,{onClick:n,disabled:a,className:"w-full cursor-pointer",children:m})]}),e[3]=a,e[4]=n,e[5]=m,e[6]=f):f=e[6],f}function jt(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),t.jsxs("span",{children:[t.jsx("span",{className:"text-foreground font-medium",children:i.title})," ","— ",i.description]})]},i.title)}function Xt({open:i,onOpenChange:e}){const n=Re(),{org:a}=z(),c=Ue(),s=it(),l=We(),[m,f]=O.useState(!1),x=t.jsx(Me,{icon:"icon://Package?color=blue",name:"Studio Pack",size:"sm"}),h=async()=>{f(!0);try{const d=we.SELF(a.id),u=new Set(s.map(r=>r.title));let p=0;for(const r of yt)u.has(r.title)||(await c.create.mutateAsync({title:r.title,description:r.description,icon:r.icon,status:"active",metadata:{instructions:r.instructions},connections:[{connection_id:d,selected_tools:[...r.selectedTools],selected_resources:null,selected_prompts:null}]}),p++);V("agent_recruit_confirmed",{template_id:"studio-pack",installed_count:p}),e(!1),l({to:"/$org",params:{org:a.slug}})}catch(d){V("agent_recruit_failed",{template_id:"studio-pack",error:d instanceof Error?d.message:String(d)}),console.error("Failed to install Studio Pack:",d)}finally{f(!1)}},T="Install Studio Pack";return n?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[x,t.jsx(Le,{className:"text-xl font-semibold",children:T})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx($e,{onInstall:h,isInstalling:m})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[x,t.jsx(ue,{className:"text-xl font-semibold",children:T})]})}),t.jsx($e,{onInstall:h,isInstalling:m})]})})}const vt="deco/mcp-github";function wt(i){const{org:e}=z(),{data:n}=ze.useSession(),a=ke(),c=ve(),[s,l]=O.useState("idle"),[m,f]=O.useState(null),[x,h]=O.useState(null),{data:T,isLoading:d}=Ye(vt,{enabled:i.enabled}),u=O.useRef(!1);i.enabled&&T&&!d&&!u.current&&n?.user?.id&&s==="idle"&&(u.current=!0,p());async function p(){if(!(!T||!n?.user?.id||!e))try{l("installing"),f(null);const g=ct(T,e.id,n.user.id,{remoteIndex:0});if(!g.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:_}=await a.create.mutateAsync(g);l("authenticating");const N=new URL(`/mcp/${_}`,window.location.origin),b=await Je({url:N.href,token:null});if(b.supportsOAuth&&!b.isAuthenticated){const{token:I,tokenInfo:o,error:y}=await Xe({connectionId:_,scope:"offline_access"});if(y||!I){try{await a.delete.mutateAsync(_)}catch{}throw new Error(y??"No token received from GitHub")}if(o)try{(await fetch(`/api/connections/${_}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:o.accessToken,refreshToken:o.refreshToken,expiresIn:o.expiresIn,scope:o.scope,clientId:o.clientId,clientSecret:o.clientSecret,tokenEndpoint:o.tokenEndpoint})})).ok||await a.update.mutateAsync({id:_,data:{connection_token:I}})}catch{await a.update.mutateAsync({id:_,data:{connection_token:I}})}}je(c,e.id),h(g),l("ready")}catch(g){f(g instanceof Error?g.message:String(g)),l("error")}}function r(){l("idle"),f(null),h(null),u.current=!1}return i.enabled&&d&&s==="idle"?{status:"installing",error:null,connection:null,retry:r}:{status:s,error:m,connection:x,retry:r}}function ae(i){const e=M.c(4),{size:n,className:a}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=c):c=e[0];let s;return e[1]!==a||e[2]!==n?(s=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:a,children:c}),e[1]=a,e[2]=n,e[3]=s):s=e[3],s}function Zt(i){const e=M.c(21),{open:n,onOpenChange:a,title:c,hideAutoRespondCheckbox:s,onImportComplete:l}=i,m=c===void 0?"Import from GitHub":c,f=s===void 0?!1:s,[x]=Ze(),[h,T]=O.useState(null);if(!x.experimental_vibecode)return null;let d;e[0]!==m?(d=t.jsx(de,{className:"sr-only",children:t.jsx(ue,{children:m})}),e[0]=m,e[1]=d):d=e[1];let u;e[2]!==h||e[3]!==m?(u=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:h?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>T(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(Ae,{size:16})}),t.jsx("img",{src:h.avatarUrl,alt:h.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:h.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(ae,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:m})]})}),e[2]=h,e[3]=m,e[4]=u):u=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(xe,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=p):p=e[5];let r;e[6]!==a?(r=()=>a(!1),e[6]=a,e[7]=r):r=e[7];let g;e[8]!==f||e[9]!==l||e[10]!==h||e[11]!==r?(g=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(O.Suspense,{fallback:p,children:t.jsx(At,{onComplete:r,selectedInstallation:h,onSelectInstallation:T,hideAutoRespondCheckbox:f,onImportComplete:l})})}),e[8]=f,e[9]=l,e[10]=h,e[11]=r,e[12]=g):g=e[12];let C;e[13]!==d||e[14]!==u||e[15]!==g?(C=t.jsxs(ce,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[d,u,g]}),e[13]=d,e[14]=u,e[15]=g,e[16]=C):C=e[16];let _;return e[17]!==a||e[18]!==n||e[19]!==C?(_=t.jsx(le,{open:n,onOpenChange:a,children:C}),e[17]=a,e[18]=n,e[19]=C,e[20]=_):_=e[20],_}function At({onComplete:i,selectedInstallation:e,onSelectInstallation:n,hideAutoRespondCheckbox:a,onImportComplete:c}){const{org:s}=z(),l=ve(),m=Ne(),[f,x]=O.useState(null),[h,T]=O.useState(!0),d=a?!0:h,u=nt({slug:"mcp-github"}),p=wt({enabled:u.length===0}),r=u.length===1?u[0]??null:f,g=$({connectionId:r?.id??"",orgId:s.id}),C=$({connectionId:re,orgId:s.id}),_=async(o,y)=>{try{const v=await g.callTool({name:"get_file_contents",arguments:{owner:o.owner,repo:o.name,path:y}});if(v.isError)return null;const j=v.content?.find(S=>S.type==="resource")?.resource?.text;if(!j)return null;try{const S=JSON.parse(j);return typeof S=="string"?S:JSON.stringify(S)}catch{return j}}catch{return null}},N=(o,y)=>{Promise.all([_(y,"AGENTS.md"),_(y,"CLAUDE.md")]).then(async([A,v])=>{const E=A??v??null;E&&(await C.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:o,data:{metadata:{instructions:E}}}}),je(l,s.id))}).catch(A=>{console.error("GitHub instructions fetch failed:",A)})},b=async({virtualMcpId:o,repo:y,connectionId:A})=>{const v=await g.callTool({name:"TRIGGER_LIST",arguments:{}}),E=v.structuredContent??v,j=E.triggers?.find(R=>R.type==="github.issues.opened")??E.triggers?.find(R=>{const P=R.type.toLowerCase();return/\bissues?\./.test(P)&&(P.endsWith(".opened")||P.endsWith(".created"))});if(!j)throw new Error("No issue-created trigger exposed by GitHub connection");const S=new Set;if(Array.isArray(j.params))for(const R of j.params)S.add(R.name);else if(j.params&&typeof j.params=="object")for(const R of Object.keys(j.params))S.add(R);if(j.paramsSchema)for(const R of Object.keys(j.paramsSchema))S.add(R);const k={};S.has("repo")?k.repo=`${y.owner}/${y.name}`:(S.has("owner")&&(k.owner=y.owner),S.has("name")&&(k.name=y.name),S.has("repository")&&(k.repository=`${y.owner}/${y.name}`));const U=`A new GitHub issue has been opened in ${y.owner}/${y.name}. Read the issue details, explore the relevant code in the repository, create a new branch, implement the fix or feature requested, and open a pull request that resolves the issue. Reference the issue number in the PR description.`,H=await C.callTool({name:"AUTOMATION_CREATE",arguments:{name:`${y.name}: auto-respond to issues`,virtual_mcp_id:o,agent:{id:o},messages:U,active:!0}}),se=H.structuredContent??H;await C.callTool({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:se.id,type:"event",connection_id:A,event_type:j.type,params:k}})},I=Fe({mutationFn:async o=>{if(!r||!e)throw new Error("No GitHub connection or installation");const y=r.id,A=await C.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:o.name,description:o.description||"Imported from GitHub",pinned:!0,icon:null,metadata:{githubRepo:{owner:o.owner,name:o.name,url:o.url,installationId:e.installationId,connectionId:y},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"}}}},connections:[{connection_id:y}]}}}),v=A.structuredContent??A,E=v.item.id;return d&&await b({virtualMcpId:E,repo:o,connectionId:y}).catch(j=>{console.error("Failed to set up issue automation:",j),ie.warning("Imported repo, but failed to set up issue auto-response. You can add the trigger manually from the automations view.")}),{virtualMcpId:E,repo:o,connectionId:y,item:v.item}},onSuccess:({virtualMcpId:o,repo:y,connectionId:A,item:v})=>{if(l.setQueryData(ne.collectionItem(C,s.id,"","VIRTUAL_MCP",o),{item:v}),je(l,s.id),N(o,y),c){c({virtualMcpId:o,repo:y,connectionId:A});return}ie.success(`Imported ${y.name} from GitHub`),i(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),m(o)},onError:o=>{ie.error("Failed to import repo: "+(o instanceof Error?o.message:"Unknown error"))}});return p.status==="installing"||p.status==="authenticating"?t.jsx(be,{status:p.status,error:null,retry:p.retry}):p.status==="error"?t.jsx(be,{status:"error",error:p.error,retry:p.retry}):u.length===0&&p.status==="idle"?t.jsx(be,{status:"installing",error:null,retry:p.retry}):u.length>1&&!r?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),u.map(o=>t.jsxs("button",{type:"button",onClick:()=>x(o),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[o.icon?t.jsx("img",{src:o.icon,alt:o.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(ae,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:o.title})]},o.id))]}):r?e?t.jsx(St,{connectionId:r.id,orgId:s.id,installation:e,onSelectRepo:o=>I.mutate(o),isSaving:I.isPending,autoRespondToIssues:h,onAutoRespondChange:T,hideAutoRespondCheckbox:a}):t.jsx(Et,{connectionId:r.id,orgId:s.id,onSelect:n,showBackButton:u.length>1,onBack:()=>x(null)}):null}function Et(i){const e=M.c(30),{connectionId:n,orgId:a,onSelect:c,showBackButton:s,onBack:l}=i;let m;e[0]!==a?(m={connectionId:re,orgId:a},e[0]=a,e[1]=m):m=e[1];const f=$(m);let x;e[2]!==n||e[3]!==a?(x=ne.githubUserOrgs(a,n),e[2]=n,e[3]=a,e[4]=x):x=e[4];let h;e[5]!==n||e[6]!==f?(h=async()=>{const o=(await f.callTool({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:n}})).content?.[0]?.text;if(!o)throw new Error("No response from GITHUB_LIST_USER_ORGS");return JSON.parse(o)},e[5]=n,e[6]=f,e[7]=h):h=e[7];let T;e[8]!==x||e[9]!==h?(T={queryKey:x,queryFn:h},e[8]=x,e[9]=h,e[10]=T):T=e[10];const d=He(T);if(d.isLoading){let I;return e[11]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(xe,{size:18,className:"animate-spin text-muted-foreground"})}),e[11]=I):I=e[11],I}if(d.isError){let I;return e[12]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"})}),e[12]=I):I=e[12],I}const u=d.data;if(!u)return null;let p;e[13]!==l||e[14]!==s?(p=s&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:l,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Ae,{size:12}),"Change connection"]})}),e[13]=l,e[14]=s,e[15]=p):p=e[15];let r;if(e[16]!==u.installations||e[17]!==c){let I;e[19]!==c?(I=o=>t.jsxs("button",{type:"button",onClick:()=>c(o),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:o.avatarUrl,alt:o.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:o.login}),o.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},o.installationId),e[19]=c,e[20]=I):I=e[20],r=u.installations.map(I),e[16]=u.installations,e[17]=c,e[18]=r}else r=e[18];let g;e[21]!==r?(g=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:r}),e[21]=r,e[22]=g):g=e[22];const C=u.appSlug?`https://github.com/apps/${u.appSlug}/installations/new`:"https://github.com/settings/installations";let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[23]=_):_=e[23];let N;e[24]!==C?(N=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:C,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",_]})}),e[24]=C,e[25]=N):N=e[25];let b;return e[26]!==N||e[27]!==p||e[28]!==g?(b=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,g,N]}),e[26]=N,e[27]=p,e[28]=g,e[29]=b):b=e[29],b}function St(i){const e=M.c(24),{connectionId:n,orgId:a,installation:c,onSelectRepo:s,isSaving:l,autoRespondToIssues:m,onAutoRespondChange:f,hideAutoRespondCheckbox:x}=i,[h,T]=O.useState(""),d=O.useDeferredValue(h),u=h!==d;let p;e[0]!==u||e[1]!==h?(p=t.jsx(qe,{placeholder:"Search repositories...",value:h,onChange:T,isSearching:u}),e[0]=u,e[1]=h,e[2]=p):p=e[2];const r=u?"opacity-40":"opacity-100";let g;e[3]!==r?(g=he("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",r),e[3]=r,e[4]=g):g=e[4];let C;e[5]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(xe,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=C):C=e[5];let _;e[6]!==n||e[7]!==d||e[8]!==c||e[9]!==l||e[10]!==s||e[11]!==a?(_=t.jsx(O.Suspense,{fallback:C,children:t.jsx(Ot,{connectionId:n,orgId:a,installation:c,query:d,onSelectRepo:s,isSaving:l})}),e[6]=n,e[7]=d,e[8]=c,e[9]=l,e[10]=s,e[11]=a,e[12]=_):_=e[12];let N;e[13]!==g||e[14]!==_?(N=t.jsx("div",{className:g,children:_}),e[13]=g,e[14]=_,e[15]=N):N=e[15];let b;e[16]!==m||e[17]!==x||e[18]!==f?(b=!x&&t.jsxs("label",{className:"flex items-center gap-2 px-4 py-3 border-t border-border shrink-0 cursor-pointer select-none",children:[t.jsx(ot,{checked:m,onCheckedChange:o=>f(o===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Auto-respond to new issues with a PR"})]}),e[16]=m,e[17]=x,e[18]=f,e[19]=b):b=e[19];let I;return e[20]!==p||e[21]!==N||e[22]!==b?(I=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,N,b]}),e[20]=p,e[21]=N,e[22]=b,e[23]=I):I=e[23],I}function Ot(i){const e=M.c(28),{connectionId:n,orgId:a,installation:c,query:s,onSelectRepo:l,isSaving:m}=i;let f;e[0]!==n||e[1]!==a?(f={connectionId:n,orgId:a},e[0]=n,e[1]=a,e[2]=f):f=e[2];const x=$(f),h=c.type==="User"?"user":"org",T=s?`${h}:${c.login} ${s} in:name`:`${h}:${c.login}`;let d;e[3]!==n||e[4]!==c.login||e[5]!==a||e[6]!==s?(d=ne.githubOrgRepos(a,n,c.login,s),e[3]=n,e[4]=c.login,e[5]=a,e[6]=s,e[7]=d):d=e[7];let u;e[8]!==x||e[9]!==T?(u=async()=>{const N=(await x.callTool({name:"search_repositories",arguments:{query:T,page:1,perPage:30}})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(Lt)},e[8]=x,e[9]=T,e[10]=u):u=e[10];let p;e[11]!==d||e[12]!==u?(p={queryKey:d,queryFn:u},e[11]=d,e[12]=u,e[13]=p):p=e[13];const{data:r}=et(p);if(r.length===0){let _;e[14]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[14]=_):_=e[14];let N;e[15]!==s?(N=s&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[15]=s,e[16]=N):N=e[16];let b;return e[17]!==N?(b=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[_,N]}),e[17]=N,e[18]=b):b=e[18],b}let g;if(e[19]!==m||e[20]!==l||e[21]!==r){let _;e[23]!==m||e[24]!==l?(_=N=>t.jsxs("button",{type:"button",onClick:()=>l(N),disabled:m,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(ae,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:N.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[N.private?t.jsx(at,{size:10}):t.jsx(rt,{size:10}),N.private?"Private":"Public"]})]},N.fullName),e[23]=m,e[24]=l,e[25]=_):_=e[25],g=r.map(_),e[19]=m,e[20]=l,e[21]=r,e[22]=g}else g=e[22];let C;return e[26]!==g?(C=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:g}),e[26]=g,e[27]=C):C=e[27],C}function Lt(i){return{name:i.name,fullName:i.full_name,owner:i.full_name.split("/")[0]??"",url:i.html_url,private:i.private,description:i.description,updatedAt:i.updated_at}}function be(i){const e=M.c(33),{status:n,error:a,retry:c}=i;if(n==="error"){let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(ae,{className:"size-5 text-destructive"})}),e[0]=o):o=e[0];let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=y):y=e[1];const A=a??"Something went wrong while connecting to GitHub.";let v;e[2]!==A?(v=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[y,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:A})]}),e[2]=A,e[3]=v):v=e[3];let E;e[4]!==c?(E=t.jsx("button",{type:"button",onClick:c,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=c,e[5]=E):E=e[5];let j;return e[6]!==v||e[7]!==E?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[o,v,E]}),e[6]=v,e[7]=E,e[8]=j):j=e[8],j}const s=n==="authenticating";let l;e[9]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(ae,{className:"size-5 text-foreground"})}),e[9]=l):l=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"relative size-10",children:[l,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(xe,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=m):m=e[10];const f=s?"Authenticating with GitHub":"Setting up GitHub";let x;e[11]!==f?(x=t.jsx("p",{className:"text-sm font-medium",children:f}),e[11]=f,e[12]=x):x=e[12];const h=s?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let T;e[13]!==h?(T=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[13]=h,e[14]=T):T=e[14];let d;e[15]!==x||e[16]!==T?(d=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[x,T]}),e[15]=x,e[16]=T,e[17]=d):d=e[17];const u=s?"bg-muted-foreground/30":"bg-foreground animate-pulse";let p;e[18]!==u?(p=he("size-1.5 rounded-full",u),e[18]=u,e[19]=p):p=e[19];let r;e[20]!==p?(r=t.jsx("span",{className:p}),e[20]=p,e[21]=r):r=e[21];const g=s?"bg-foreground animate-pulse":"bg-muted-foreground/30";let C;e[22]!==g?(C=he("size-1.5 rounded-full",g),e[22]=g,e[23]=C):C=e[23];let _;e[24]!==C?(_=t.jsx("span",{className:C}),e[24]=C,e[25]=_):_=e[25];let N;e[26]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=N):N=e[26];let b;e[27]!==r||e[28]!==_?(b=t.jsxs("div",{className:"flex items-center gap-1.5",children:[r,_,N]}),e[27]=r,e[28]=_,e[29]=b):b=e[29];let I;return e[30]!==b||e[31]!==d?(I=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[m,d,b]}),e[30]=b,e[31]=d,e[32]=I):I=e[32],I}export{Zt as G,Kt as I,Jt as L,Wt as S,Xt as a,ae as b,Ye as u};
|
|
116
|
+
</workflows>`,yt=[{id:"studio-agent-manager",title:"Agent Manager",icon:"icon://Bot?color=violet",description:"Create, configure, and manage agents",selectedTools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE","COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET"],instructions:Ct,getId:ye.AGENT_MANAGER},{id:"studio-automation-manager",title:"Automation Manager",icon:"icon://Zap?color=amber",description:"Create, configure, and run automations with triggers",selectedTools:["AUTOMATION_CREATE","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_RUN","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET"],instructions:It,getId:ye.AUTOMATION_MANAGER},{id:"studio-connection-manager",title:"Connection Manager",icon:"icon://Link01?color=cyan",description:"Create, configure, test, and manage connections",selectedTools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","CONNECTION_TEST"],instructions:Tt,getId:ye.CONNECTION_MANAGER}],bt=[{title:"Agent Manager",description:"Create, configure, and manage agents"},{title:"Automation Manager",description:"Create, configure, and run automations with triggers"},{title:"Connection Manager",description:"Create, configure, test, and manage connections"}];function $e(i){const e=M.c(7),{onInstall:n,isInstalling:a}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Install a suite of pre-configured agents for managing your studio. Each agent is scoped to a specific domain with focused instructions."}),e[0]=c):c=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Included agents"}),e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"space-y-2",children:[s,t.jsx("ul",{className:"space-y-1.5",children:bt.map(jt)})]}),e[2]=l):l=e[2];const m=a?"Installing...":"Install Studio Pack";let f;return e[3]!==a||e[4]!==n||e[5]!==m?(f=t.jsxs("div",{className:"flex flex-col gap-6",children:[c,l,t.jsx(oe,{onClick:n,disabled:a,className:"w-full cursor-pointer",children:m})]}),e[3]=a,e[4]=n,e[5]=m,e[6]=f):f=e[6],f}function jt(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),t.jsxs("span",{children:[t.jsx("span",{className:"text-foreground font-medium",children:i.title})," ","— ",i.description]})]},i.title)}function Xt({open:i,onOpenChange:e}){const n=Re(),{org:a}=z(),c=Ue(),s=it(),l=We(),[m,f]=O.useState(!1),x=t.jsx(Me,{icon:"icon://Package?color=blue",name:"Studio Pack",size:"sm"}),h=async()=>{f(!0);try{const d=we.SELF(a.id),u=new Set(s.map(r=>r.title));let p=0;for(const r of yt)u.has(r.title)||(await c.create.mutateAsync({title:r.title,description:r.description,icon:r.icon,status:"active",metadata:{instructions:r.instructions},connections:[{connection_id:d,selected_tools:[...r.selectedTools],selected_resources:null,selected_prompts:null}]}),p++);V("agent_recruit_confirmed",{template_id:"studio-pack",installed_count:p}),e(!1),l({to:"/$org",params:{org:a.slug}})}catch(d){V("agent_recruit_failed",{template_id:"studio-pack",error:d instanceof Error?d.message:String(d)}),console.error("Failed to install Studio Pack:",d)}finally{f(!1)}},T="Install Studio Pack";return n?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[x,t.jsx(Le,{className:"text-xl font-semibold",children:T})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx($e,{onInstall:h,isInstalling:m})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[x,t.jsx(ue,{className:"text-xl font-semibold",children:T})]})}),t.jsx($e,{onInstall:h,isInstalling:m})]})})}const vt="deco/mcp-github";function wt(i){const{org:e}=z(),{data:n}=ze.useSession(),a=ke(),c=ve(),[s,l]=O.useState("idle"),[m,f]=O.useState(null),[x,h]=O.useState(null),{data:T,isLoading:d}=Ye(vt,{enabled:i.enabled}),u=O.useRef(!1);i.enabled&&T&&!d&&!u.current&&n?.user?.id&&s==="idle"&&(u.current=!0,p());async function p(){if(!(!T||!n?.user?.id||!e))try{l("installing"),f(null);const g=ct(T,e.id,n.user.id,{remoteIndex:0});if(!g.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:_}=await a.create.mutateAsync(g);l("authenticating");const N=new URL(`/mcp/${_}`,window.location.origin),b=await Je({url:N.href,token:null});if(b.supportsOAuth&&!b.isAuthenticated){const{token:I,tokenInfo:o,error:y}=await Xe({connectionId:_,scope:"offline_access"});if(y||!I){try{await a.delete.mutateAsync(_)}catch{}throw new Error(y??"No token received from GitHub")}if(o)try{(await fetch(`/api/connections/${_}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:o.accessToken,refreshToken:o.refreshToken,expiresIn:o.expiresIn,scope:o.scope,clientId:o.clientId,clientSecret:o.clientSecret,tokenEndpoint:o.tokenEndpoint})})).ok||await a.update.mutateAsync({id:_,data:{connection_token:I}})}catch{await a.update.mutateAsync({id:_,data:{connection_token:I}})}}je(c,e.id),h(g),l("ready")}catch(g){f(g instanceof Error?g.message:String(g)),l("error")}}function r(){l("idle"),f(null),h(null),u.current=!1}return i.enabled&&d&&s==="idle"?{status:"installing",error:null,connection:null,retry:r}:{status:s,error:m,connection:x,retry:r}}function ae(i){const e=M.c(4),{size:n,className:a}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=c):c=e[0];let s;return e[1]!==a||e[2]!==n?(s=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:a,children:c}),e[1]=a,e[2]=n,e[3]=s):s=e[3],s}function Zt(i){const e=M.c(21),{open:n,onOpenChange:a,title:c,hideAutoRespondCheckbox:s,onImportComplete:l}=i,m=c===void 0?"Import from GitHub":c,f=s===void 0?!1:s,[x]=Ze(),[h,T]=O.useState(null);if(!x.experimental_vibecode)return null;let d;e[0]!==m?(d=t.jsx(de,{className:"sr-only",children:t.jsx(ue,{children:m})}),e[0]=m,e[1]=d):d=e[1];let u;e[2]!==h||e[3]!==m?(u=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:h?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>T(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(Ae,{size:16})}),t.jsx("img",{src:h.avatarUrl,alt:h.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:h.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(ae,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:m})]})}),e[2]=h,e[3]=m,e[4]=u):u=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(xe,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=p):p=e[5];let r;e[6]!==a?(r=()=>a(!1),e[6]=a,e[7]=r):r=e[7];let g;e[8]!==f||e[9]!==l||e[10]!==h||e[11]!==r?(g=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(O.Suspense,{fallback:p,children:t.jsx(At,{onComplete:r,selectedInstallation:h,onSelectInstallation:T,hideAutoRespondCheckbox:f,onImportComplete:l})})}),e[8]=f,e[9]=l,e[10]=h,e[11]=r,e[12]=g):g=e[12];let C;e[13]!==d||e[14]!==u||e[15]!==g?(C=t.jsxs(ce,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[d,u,g]}),e[13]=d,e[14]=u,e[15]=g,e[16]=C):C=e[16];let _;return e[17]!==a||e[18]!==n||e[19]!==C?(_=t.jsx(le,{open:n,onOpenChange:a,children:C}),e[17]=a,e[18]=n,e[19]=C,e[20]=_):_=e[20],_}function At({onComplete:i,selectedInstallation:e,onSelectInstallation:n,hideAutoRespondCheckbox:a,onImportComplete:c}){const{org:s}=z(),l=ve(),m=Ne(),[f,x]=O.useState(null),[h,T]=O.useState(!0),d=a?!0:h,u=nt({slug:"mcp-github"}),p=wt({enabled:u.length===0}),r=u.length===1?u[0]??null:f,g=$({connectionId:r?.id??"",orgId:s.id}),C=$({connectionId:re,orgId:s.id}),_=async(o,y)=>{try{const v=await g.callTool({name:"get_file_contents",arguments:{owner:o.owner,repo:o.name,path:y}});if(v.isError)return null;const j=v.content?.find(S=>S.type==="resource")?.resource?.text;if(!j)return null;try{const S=JSON.parse(j);return typeof S=="string"?S:JSON.stringify(S)}catch{return j}}catch{return null}},N=(o,y)=>{Promise.all([_(y,"AGENTS.md"),_(y,"CLAUDE.md")]).then(async([A,v])=>{const E=A??v??null;E&&(await C.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:o,data:{metadata:{instructions:E}}}}),je(l,s.id))}).catch(A=>{console.error("GitHub instructions fetch failed:",A)})},b=async({virtualMcpId:o,repo:y,connectionId:A})=>{const v=await g.callTool({name:"TRIGGER_LIST",arguments:{}}),E=v.structuredContent??v,j=E.triggers?.find(R=>R.type==="github.issues.opened")??E.triggers?.find(R=>{const P=R.type.toLowerCase();return/\bissues?\./.test(P)&&(P.endsWith(".opened")||P.endsWith(".created"))});if(!j)throw new Error("No issue-created trigger exposed by GitHub connection");const S=new Set;if(Array.isArray(j.params))for(const R of j.params)S.add(R.name);else if(j.params&&typeof j.params=="object")for(const R of Object.keys(j.params))S.add(R);if(j.paramsSchema)for(const R of Object.keys(j.paramsSchema))S.add(R);const k={};S.has("repo")?k.repo=`${y.owner}/${y.name}`:(S.has("owner")&&(k.owner=y.owner),S.has("name")&&(k.name=y.name),S.has("repository")&&(k.repository=`${y.owner}/${y.name}`));const U=`A new GitHub issue has been opened in ${y.owner}/${y.name}. Read the issue details, explore the relevant code in the repository, create a new branch, implement the fix or feature requested, and open a pull request that resolves the issue. Reference the issue number in the PR description.`,F=await C.callTool({name:"AUTOMATION_CREATE",arguments:{name:`${y.name}: auto-respond to issues`,virtual_mcp_id:o,agent:{id:o},messages:U,active:!0}}),se=F.structuredContent??F;await C.callTool({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:se.id,type:"event",connection_id:A,event_type:j.type,params:k}})},I=He({mutationFn:async o=>{if(!r||!e)throw new Error("No GitHub connection or installation");const y=r.id,A=await C.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:o.name,description:o.description||"Imported from GitHub",pinned:!0,icon:null,metadata:{githubRepo:{owner:o.owner,name:o.name,url:o.url,installationId:e.installationId,connectionId:y},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"}}}},connections:[{connection_id:y}]}}}),v=A.structuredContent??A,E=v.item.id;return d&&await b({virtualMcpId:E,repo:o,connectionId:y}).catch(j=>{console.error("Failed to set up issue automation:",j),ie.warning("Imported repo, but failed to set up issue auto-response. You can add the trigger manually from the automations view.")}),{virtualMcpId:E,repo:o,connectionId:y,item:v.item}},onSuccess:({virtualMcpId:o,repo:y,connectionId:A,item:v})=>{if(l.setQueryData(ne.collectionItem(C,s.id,"","VIRTUAL_MCP",o),{item:v}),je(l,s.id),N(o,y),c){c({virtualMcpId:o,repo:y,connectionId:A});return}ie.success(`Imported ${y.name} from GitHub`),i(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),m(o)},onError:o=>{ie.error("Failed to import repo: "+(o instanceof Error?o.message:"Unknown error"))}});return p.status==="installing"||p.status==="authenticating"?t.jsx(be,{status:p.status,error:null,retry:p.retry}):p.status==="error"?t.jsx(be,{status:"error",error:p.error,retry:p.retry}):u.length===0&&p.status==="idle"?t.jsx(be,{status:"installing",error:null,retry:p.retry}):u.length>1&&!r?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),u.map(o=>t.jsxs("button",{type:"button",onClick:()=>x(o),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[o.icon?t.jsx("img",{src:o.icon,alt:o.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(ae,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:o.title})]},o.id))]}):r?e?t.jsx(St,{connectionId:r.id,orgId:s.id,installation:e,onSelectRepo:o=>I.mutate(o),isSaving:I.isPending,autoRespondToIssues:h,onAutoRespondChange:T,hideAutoRespondCheckbox:a}):t.jsx(Et,{connectionId:r.id,orgId:s.id,onSelect:n,showBackButton:u.length>1,onBack:()=>x(null)}):null}function Et(i){const e=M.c(30),{connectionId:n,orgId:a,onSelect:c,showBackButton:s,onBack:l}=i;let m;e[0]!==a?(m={connectionId:re,orgId:a},e[0]=a,e[1]=m):m=e[1];const f=$(m);let x;e[2]!==n||e[3]!==a?(x=ne.githubUserOrgs(a,n),e[2]=n,e[3]=a,e[4]=x):x=e[4];let h;e[5]!==n||e[6]!==f?(h=async()=>{const o=(await f.callTool({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:n}})).content?.[0]?.text;if(!o)throw new Error("No response from GITHUB_LIST_USER_ORGS");return JSON.parse(o)},e[5]=n,e[6]=f,e[7]=h):h=e[7];let T;e[8]!==x||e[9]!==h?(T={queryKey:x,queryFn:h},e[8]=x,e[9]=h,e[10]=T):T=e[10];const d=Fe(T);if(d.isLoading){let I;return e[11]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(xe,{size:18,className:"animate-spin text-muted-foreground"})}),e[11]=I):I=e[11],I}if(d.isError){let I;return e[12]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"})}),e[12]=I):I=e[12],I}const u=d.data;if(!u)return null;let p;e[13]!==l||e[14]!==s?(p=s&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:l,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Ae,{size:12}),"Change connection"]})}),e[13]=l,e[14]=s,e[15]=p):p=e[15];let r;if(e[16]!==u.installations||e[17]!==c){let I;e[19]!==c?(I=o=>t.jsxs("button",{type:"button",onClick:()=>c(o),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:o.avatarUrl,alt:o.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:o.login}),o.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},o.installationId),e[19]=c,e[20]=I):I=e[20],r=u.installations.map(I),e[16]=u.installations,e[17]=c,e[18]=r}else r=e[18];let g;e[21]!==r?(g=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:r}),e[21]=r,e[22]=g):g=e[22];const C=u.appSlug?`https://github.com/apps/${u.appSlug}/installations/new`:"https://github.com/settings/installations";let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[23]=_):_=e[23];let N;e[24]!==C?(N=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:C,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",_]})}),e[24]=C,e[25]=N):N=e[25];let b;return e[26]!==N||e[27]!==p||e[28]!==g?(b=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,g,N]}),e[26]=N,e[27]=p,e[28]=g,e[29]=b):b=e[29],b}function St(i){const e=M.c(24),{connectionId:n,orgId:a,installation:c,onSelectRepo:s,isSaving:l,autoRespondToIssues:m,onAutoRespondChange:f,hideAutoRespondCheckbox:x}=i,[h,T]=O.useState(""),d=O.useDeferredValue(h),u=h!==d;let p;e[0]!==u||e[1]!==h?(p=t.jsx(qe,{placeholder:"Search repositories...",value:h,onChange:T,isSearching:u}),e[0]=u,e[1]=h,e[2]=p):p=e[2];const r=u?"opacity-40":"opacity-100";let g;e[3]!==r?(g=he("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",r),e[3]=r,e[4]=g):g=e[4];let C;e[5]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(xe,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=C):C=e[5];let _;e[6]!==n||e[7]!==d||e[8]!==c||e[9]!==l||e[10]!==s||e[11]!==a?(_=t.jsx(O.Suspense,{fallback:C,children:t.jsx(Ot,{connectionId:n,orgId:a,installation:c,query:d,onSelectRepo:s,isSaving:l})}),e[6]=n,e[7]=d,e[8]=c,e[9]=l,e[10]=s,e[11]=a,e[12]=_):_=e[12];let N;e[13]!==g||e[14]!==_?(N=t.jsx("div",{className:g,children:_}),e[13]=g,e[14]=_,e[15]=N):N=e[15];let b;e[16]!==m||e[17]!==x||e[18]!==f?(b=!x&&t.jsxs("label",{className:"flex items-center gap-2 px-4 py-3 border-t border-border shrink-0 cursor-pointer select-none",children:[t.jsx(ot,{checked:m,onCheckedChange:o=>f(o===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Auto-respond to new issues with a PR"})]}),e[16]=m,e[17]=x,e[18]=f,e[19]=b):b=e[19];let I;return e[20]!==p||e[21]!==N||e[22]!==b?(I=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,N,b]}),e[20]=p,e[21]=N,e[22]=b,e[23]=I):I=e[23],I}function Ot(i){const e=M.c(28),{connectionId:n,orgId:a,installation:c,query:s,onSelectRepo:l,isSaving:m}=i;let f;e[0]!==n||e[1]!==a?(f={connectionId:n,orgId:a},e[0]=n,e[1]=a,e[2]=f):f=e[2];const x=$(f),h=c.type==="User"?"user":"org",T=s?`${h}:${c.login} ${s} in:name`:`${h}:${c.login}`;let d;e[3]!==n||e[4]!==c.login||e[5]!==a||e[6]!==s?(d=ne.githubOrgRepos(a,n,c.login,s),e[3]=n,e[4]=c.login,e[5]=a,e[6]=s,e[7]=d):d=e[7];let u;e[8]!==x||e[9]!==T?(u=async()=>{const N=(await x.callTool({name:"search_repositories",arguments:{query:T,page:1,perPage:30}})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(Lt)},e[8]=x,e[9]=T,e[10]=u):u=e[10];let p;e[11]!==d||e[12]!==u?(p={queryKey:d,queryFn:u},e[11]=d,e[12]=u,e[13]=p):p=e[13];const{data:r}=et(p);if(r.length===0){let _;e[14]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[14]=_):_=e[14];let N;e[15]!==s?(N=s&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[15]=s,e[16]=N):N=e[16];let b;return e[17]!==N?(b=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[_,N]}),e[17]=N,e[18]=b):b=e[18],b}let g;if(e[19]!==m||e[20]!==l||e[21]!==r){let _;e[23]!==m||e[24]!==l?(_=N=>t.jsxs("button",{type:"button",onClick:()=>l(N),disabled:m,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(ae,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:N.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[N.private?t.jsx(at,{size:10}):t.jsx(rt,{size:10}),N.private?"Private":"Public"]})]},N.fullName),e[23]=m,e[24]=l,e[25]=_):_=e[25],g=r.map(_),e[19]=m,e[20]=l,e[21]=r,e[22]=g}else g=e[22];let C;return e[26]!==g?(C=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:g}),e[26]=g,e[27]=C):C=e[27],C}function Lt(i){return{name:i.name,fullName:i.full_name,owner:i.full_name.split("/")[0]??"",url:i.html_url,private:i.private,description:i.description,updatedAt:i.updated_at}}function be(i){const e=M.c(33),{status:n,error:a,retry:c}=i;if(n==="error"){let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(ae,{className:"size-5 text-destructive"})}),e[0]=o):o=e[0];let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=y):y=e[1];const A=a??"Something went wrong while connecting to GitHub.";let v;e[2]!==A?(v=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[y,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:A})]}),e[2]=A,e[3]=v):v=e[3];let E;e[4]!==c?(E=t.jsx("button",{type:"button",onClick:c,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=c,e[5]=E):E=e[5];let j;return e[6]!==v||e[7]!==E?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[o,v,E]}),e[6]=v,e[7]=E,e[8]=j):j=e[8],j}const s=n==="authenticating";let l;e[9]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(ae,{className:"size-5 text-foreground"})}),e[9]=l):l=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"relative size-10",children:[l,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(xe,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=m):m=e[10];const f=s?"Authenticating with GitHub":"Setting up GitHub";let x;e[11]!==f?(x=t.jsx("p",{className:"text-sm font-medium",children:f}),e[11]=f,e[12]=x):x=e[12];const h=s?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let T;e[13]!==h?(T=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[13]=h,e[14]=T):T=e[14];let d;e[15]!==x||e[16]!==T?(d=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[x,T]}),e[15]=x,e[16]=T,e[17]=d):d=e[17];const u=s?"bg-muted-foreground/30":"bg-foreground animate-pulse";let p;e[18]!==u?(p=he("size-1.5 rounded-full",u),e[18]=u,e[19]=p):p=e[19];let r;e[20]!==p?(r=t.jsx("span",{className:p}),e[20]=p,e[21]=r):r=e[21];const g=s?"bg-foreground animate-pulse":"bg-muted-foreground/30";let C;e[22]!==g?(C=he("size-1.5 rounded-full",g),e[22]=g,e[23]=C):C=e[23];let _;e[24]!==C?(_=t.jsx("span",{className:C}),e[24]=C,e[25]=_):_=e[25];let N;e[26]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=N):N=e[26];let b;e[27]!==r||e[28]!==_?(b=t.jsxs("div",{className:"flex items-center gap-1.5",children:[r,_,N]}),e[27]=r,e[28]=_,e[29]=b):b=e[29];let I;return e[30]!==b||e[31]!==d?(I=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[m,d,b]}),e[30]=b,e[31]=d,e[32]=I):I=e[32],I}export{Zt as G,Kt as I,Jt as L,Wt as S,Xt as a,ae as b,Ye as u};
|