@decocms/mesh 2.38.6 → 2.39.1

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.
Files changed (165) hide show
  1. package/dist/client/assets/{AlertCircle-B4xqDHbG.js → AlertCircle-BGhlDWk2.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-BlDPaWrc.js → ArrowLeft-DiPZV3an.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-CLiwYXs0.js → ArrowUp-CxSqAFHI.js} +1 -1
  4. package/dist/client/assets/{Check-CCn5GCwg.js → Check-fIeUq0Tl.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-YbVVQVLg.js → ChevronDown-aJJ6RgWv.js} +1 -1
  6. package/dist/client/assets/{Code01-Dir622wi.js → Code01-Ckl-ddC5.js} +1 -1
  7. package/dist/client/assets/{Copy01-CjY-NlSc.js → Copy01-CdhhOoSD.js} +1 -1
  8. package/dist/client/assets/{CpuChip02-yUWdNp1P.js → CpuChip02-B5a9K48n.js} +1 -1
  9. package/dist/client/assets/{DotsHorizontal-Do1LS6Wx.js → DotsHorizontal-gjRK9bmC.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-Dp-gx6mF.js → DotsVertical-1JZvMgtG.js} +1 -1
  11. package/dist/client/assets/{Download01-DAAiXVpc.js → Download01-3VU6vngg.js} +1 -1
  12. package/dist/client/assets/{Edit01-B_nUJxlr.js → Edit01-F53eAMKI.js} +1 -1
  13. package/dist/client/assets/{File06-CB-q8MUQ.js → File06-BpUf605-.js} +1 -1
  14. package/dist/client/assets/{FilterLines-Br-acHX0.js → FilterLines-BM5N4VAM.js} +1 -1
  15. package/dist/client/assets/{FlipBackward-Cj4V50Wu.js → FlipBackward-__aw6tTy.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-zw_VkZBZ.js → GitBranch01-CphPKbYc.js} +1 -1
  17. package/dist/client/assets/{Grid01-CPA-Um40.js → Grid01-D89OcY09.js} +1 -1
  18. package/dist/client/assets/{Home02-DoAoQwmo.js → Home02-CvY65VhH.js} +1 -1
  19. package/dist/client/assets/{Image01-CNk-r4qX.js → Image01-DlxjetON.js} +1 -1
  20. package/dist/client/assets/{Inbox01-By8bLcOc.js → Inbox01-CxsccOrS.js} +1 -1
  21. package/dist/client/assets/{InfoCircle-B0FNzXlM.js → InfoCircle-Bcvi8VQY.js} +1 -1
  22. package/dist/client/assets/{Key01-B_LfAqq6.js → Key01-BMhwGxr8.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-s2DQaDMZ.js → LinkExternal01-BF9uACMs.js} +1 -1
  24. package/dist/client/assets/{List-d67v1RYc.js → List-G-H7B3e1.js} +1 -1
  25. package/dist/client/assets/{Loading01-Da3G3uHv.js → Loading01-BOeR2B8B.js} +1 -1
  26. package/dist/client/assets/{Lock01-mht9NTxx.js → Lock01-Bxcblt1i.js} +1 -1
  27. package/dist/client/assets/{Play-LyI9ODLq.js → Play-BmnNjAyT.js} +1 -1
  28. package/dist/client/assets/{Plus-C8Yk0Byt.js → Plus-CROcV2-u.js} +1 -1
  29. package/dist/client/assets/{SearchMd-DFqFsfr3.js → SearchMd-D74Sf-27.js} +1 -1
  30. package/dist/client/assets/{Terminal-sjkm0kJR.js → Terminal-DGXkCDiq.js} +1 -1
  31. package/dist/client/assets/{Trash01-DsqSsyPF.js → Trash01-DHhhoDHD.js} +1 -1
  32. package/dist/client/assets/{Upload01-D0gUGV2F.js → Upload01-C2CuGT1-.js} +1 -1
  33. package/dist/client/assets/{X-8Mftq7jS.js → X-BAy7Mfyd.js} +1 -1
  34. package/dist/client/assets/{XClose-CM1uqjVP.js → XClose-CE5BsdL1.js} +1 -1
  35. package/dist/client/assets/agent-detail-D2jPAyzE.js +1 -0
  36. package/dist/client/assets/agents-BnJBjaH8.js +1 -0
  37. package/dist/client/assets/{alert-dialog-CP6Si-sS.js → alert-dialog-DCgyNkDL.js} +2 -2
  38. package/dist/client/assets/{auth-catchall-iqpKi7T9.js → auth-catchall-CFWeOKHi.js} +1 -1
  39. package/dist/client/assets/{avatar-qY1FecOi.js → avatar-DyhTRBi5.js} +1 -1
  40. package/dist/client/assets/{badge-DfcjklCU.js → badge-BfOFucuW.js} +1 -1
  41. package/dist/client/assets/{binder-oimq46F2.js → binder-D14T3-AY.js} +1 -1
  42. package/dist/client/assets/{button-CEYz4vVv.js → button-DMKajqX_.js} +1 -1
  43. package/dist/client/assets/card-Cx64whKR.js +1 -0
  44. package/dist/client/assets/checkbox-BCZJI_DJ.js +1 -0
  45. package/dist/client/assets/circle-alert-CMl9VinB.js +1 -0
  46. package/dist/client/assets/{collection-detail-CCz5bSND.js → collection-detail-p9qkl9qa.js} +4 -4
  47. package/dist/client/assets/{collection-display-button-DnLs8bVk.js → collection-display-button-BVh1TgBj.js} +1 -1
  48. package/dist/client/assets/{collection-header-BKBivTdh.js → collection-header-Dc5LPFVH.js} +1 -1
  49. package/dist/client/assets/{collection-page-BQnr3vxz.js → collection-page-DGyQ3ZNG.js} +1 -1
  50. package/dist/client/assets/{collection-search-BtYrCrPa.js → collection-search-Di76L1bf.js} +1 -1
  51. package/dist/client/assets/collection-tab--167XVPq.js +1 -0
  52. package/dist/client/assets/{collection-table-wrapper-qsmwllrX.js → collection-table-wrapper-DHB_EgNT.js} +1 -1
  53. package/dist/client/assets/connect-CXcmZCG1.js +1 -0
  54. package/dist/client/assets/{connection-card-BmrG8yB6.js → connection-card-DQrk1HXS.js} +1 -1
  55. package/dist/client/assets/connection-detail-nzhWhLWV.js +1 -0
  56. package/dist/client/assets/connections-ByUZtUgd.js +1 -0
  57. package/dist/client/assets/constants-BxAQzeE8.js +1 -0
  58. package/dist/client/assets/{constants-C56YODyA.js → constants-fPyH6C9l.js} +1 -1
  59. package/dist/client/assets/{create-organization-dialog-BP-zgBpE.js → create-organization-dialog-D77RxEh5.js} +1 -1
  60. package/dist/client/assets/{dialog-Cur3bgyn.js → dialog-ztR7gCh9.js} +1 -1
  61. package/dist/client/assets/{dropdown-menu-DRvXtcX1.js → dropdown-menu-ClnDILPk.js} +1 -1
  62. package/dist/client/assets/dynamic-plugin-layout-A1dILRX9.js +1 -0
  63. package/dist/client/assets/{empty-state-D96Y5HBy.js → empty-state-BnO7A9lc.js} +1 -1
  64. package/dist/client/assets/{empty-state-B52GWMyA.js → empty-state-bLy612i3.js} +1 -1
  65. package/dist/client/assets/env-vars-editor-BcnJ-LB5.js +1 -0
  66. package/dist/client/assets/{error-boundary-B-AbkEzN.js → error-boundary-BmoPYDr9.js} +1 -1
  67. package/dist/client/assets/{extract-connection-data-xYQXXnta.js → extract-connection-data-BmKY6Xwr.js} +1 -1
  68. package/dist/client/assets/{file-browser-BM3fdjJP.js → file-browser-qwFJR9E8.js} +2 -2
  69. package/dist/client/assets/{form-BuxG1-zn.js → form-ndfdAtTI.js} +1 -1
  70. package/dist/client/assets/{grid-view-x-p3DL4O.js → grid-view-BvcNXtON.js} +1 -1
  71. package/dist/client/assets/{home-C9y8ew9m.js → home-BuQVPeAU.js} +1 -1
  72. package/dist/client/assets/index-B_JsA4Kj.js +25 -0
  73. package/dist/client/assets/{index-B7TTLamD.js → index-C2RcJiSR.js} +1 -1
  74. package/dist/client/assets/index-CsefZjgp.js +1 -0
  75. package/dist/client/assets/{index-BqaxN2xC.js → index-DZ0WP9Uu.js} +34 -34
  76. package/dist/client/assets/{index-B1uX_6ZJ.js → index-Dtt3Ixsj.js} +3 -3
  77. package/dist/client/assets/index-DuakjG98.js +1 -0
  78. package/dist/client/assets/{infiniteQueryObserver-93EeshRP.js → infiniteQueryObserver-BbTATuuq.js} +1 -1
  79. package/dist/client/assets/{input-lyCEJ-v7.js → input-B0NJeiuT.js} +1 -1
  80. package/dist/client/assets/{layout-D-OU3f8P.js → layout-DfJ4yUAY.js} +1 -1
  81. package/dist/client/assets/{localstorage-keys-ONdhlVrj.js → localstorage-keys-peJWGFoJ.js} +1 -1
  82. package/dist/client/assets/login-aZLO4ovp.js +1 -0
  83. package/dist/client/assets/mcp-oauth-pM6hRYfR.js +1 -0
  84. package/dist/client/assets/{mcp-server-card-DHP36XTl.js → mcp-server-card-DHzfT3Ej.js} +1 -1
  85. package/dist/client/assets/mcp-server-detail-Bw5soC6_.js +2 -0
  86. package/dist/client/assets/members-7Q8DX6Lb.js +3 -0
  87. package/dist/client/assets/{monaco-editor-DGUxTU96.js → monaco-editor-Dv9cb_Fm.js} +4 -4
  88. package/dist/client/assets/{monitoring-XFLd7M9_.js → monitoring-BC6v2u5z.js} +6 -6
  89. package/dist/client/assets/{oauth-callback-C6TgACkm.js → oauth-callback-Cadz6rw5.js} +1 -1
  90. package/dist/client/assets/page-BNxkmB8w.js +1 -0
  91. package/dist/client/assets/page-tk64pthv.js +21 -0
  92. package/dist/client/assets/pin-to-sidebar-button-Cgw1E6xL.js +1 -0
  93. package/dist/client/assets/{plugin-empty-state-DRyAVBqZ.js → plugin-empty-state-BS367vfH.js} +1 -1
  94. package/dist/client/assets/{plugin-header-Or8ouB6a.js → plugin-header-CUs1tx4q.js} +1 -1
  95. package/dist/client/assets/plugins-bBiQTZ8C.js +1 -0
  96. package/dist/client/assets/{popover-DJUBm9Y-.js → popover-Bz6616No.js} +1 -1
  97. package/dist/client/assets/registry-utils-CpCQJuef.js +1 -0
  98. package/dist/client/assets/{resizable-R_MVWpDo.js → resizable-DIm_hRMc.js} +1 -1
  99. package/dist/client/assets/{resource-tabs-CXTSNkut.js → resource-tabs-cEMTKUzi.js} +1 -1
  100. package/dist/client/assets/{select-DGKcOybq.js → select-2zWNvmE1.js} +1 -1
  101. package/dist/client/assets/settings-BfF0KNyp.js +1 -0
  102. package/dist/client/assets/shell-layout-hoToOJQP.js +3 -0
  103. package/dist/client/assets/spinner-YcNewNcW.js +1 -0
  104. package/dist/client/assets/{switch-LeZRc51C.js → switch-C6NVbbW1.js} +1 -1
  105. package/dist/client/assets/{textarea-CphdD9q0.js → textarea-BE-RZN1V.js} +1 -1
  106. package/dist/client/assets/tool-set-selector-CoFCawdz.js +1 -0
  107. package/dist/client/assets/{tools-list-BeRMZtG9.js → tools-list-DMgjdEKU.js} +1 -1
  108. package/dist/client/assets/{tooltip-DzrZ9wCu.js → tooltip-CzB50oKO.js} +1 -1
  109. package/dist/client/assets/{typewriter-title-yCfBZocB.js → typewriter-title-BGVtH7qI.js} +1 -1
  110. package/dist/client/assets/{use-binding-B4CdGd_R.js → use-binding-BhZjQhNo.js} +1 -1
  111. package/dist/client/assets/{use-collections-oaTV6V1V.js → use-collections-Drr6_6fb.js} +1 -1
  112. package/dist/client/assets/use-connection-Bp7t1xn3.js +1 -0
  113. package/dist/client/assets/use-create-virtual-mcp-OU_v2YUB.js +1 -0
  114. package/dist/client/assets/{use-list-state-CUj2Pms0.js → use-list-state-Zs89S-QA.js} +1 -1
  115. package/dist/client/assets/use-mcp-prompts-CSWg69Uu.js +1 -0
  116. package/dist/client/assets/use-members-CjhBeBkC.js +1 -0
  117. package/dist/client/assets/{use-mobile-BYgIoeGI.js → use-mobile-BrgiFD7w.js} +1 -1
  118. package/dist/client/assets/use-organization-settings-BCjNGEBN.js +1 -0
  119. package/dist/client/assets/use-virtual-mcp-DQzFD2uZ.js +1 -0
  120. package/dist/client/assets/useInfiniteQuery-CZQ71w-T.js +1 -0
  121. package/dist/client/assets/{useMutation-Cwf-gT4m.js → useMutation-BSgCoYc_.js} +1 -1
  122. package/dist/client/assets/useQuery-CpAu1eM3.js +1 -0
  123. package/dist/client/assets/{value-BcjHEbtF.js → value-Cq0O3NJH.js} +1 -1
  124. package/dist/client/assets/{view-mode-toggle-Ba3TLRo6.js → view-mode-toggle-BrT5iiCv.js} +1 -1
  125. package/dist/client/assets/workflow-DiPsBlj7.js +1 -0
  126. package/dist/client/index.html +1 -1
  127. package/dist/server/cli.js +201 -201
  128. package/dist/server/migrate.js +196 -196
  129. package/dist/server/server.js +152 -152
  130. package/package.json +2 -1
  131. package/dist/client/assets/agent-detail-BbRahLm7.js +0 -1
  132. package/dist/client/assets/agents-CO51KXQ7.js +0 -1
  133. package/dist/client/assets/card-Czj8cnsu.js +0 -1
  134. package/dist/client/assets/checkbox-YBwSx7EQ.js +0 -1
  135. package/dist/client/assets/collection-tab-B7nFFfRR.js +0 -1
  136. package/dist/client/assets/connection-detail-DrwBqwII.js +0 -1
  137. package/dist/client/assets/connections-EyHBeVDZ.js +0 -1
  138. package/dist/client/assets/constants-DFc-Xc3W.js +0 -1
  139. package/dist/client/assets/dynamic-plugin-layout-Cd-NaU-8.js +0 -1
  140. package/dist/client/assets/env-vars-editor-BvlIX34u.js +0 -1
  141. package/dist/client/assets/index-BaKebp2o.js +0 -1
  142. package/dist/client/assets/index-DNsNPBek.js +0 -1
  143. package/dist/client/assets/index-DZba6oBj.js +0 -25
  144. package/dist/client/assets/login-uVCvvt_Q.js +0 -1
  145. package/dist/client/assets/mcp-oauth-Cf6g90Vj.js +0 -1
  146. package/dist/client/assets/mcp-server-detail-C0U713uq.js +0 -2
  147. package/dist/client/assets/members-DyA8e--q.js +0 -3
  148. package/dist/client/assets/page-B_m9E6ic.js +0 -1
  149. package/dist/client/assets/page-D2nSeVmo.js +0 -21
  150. package/dist/client/assets/pin-to-sidebar-button-S58VyRdL.js +0 -1
  151. package/dist/client/assets/plugins-BfxCF9MV.js +0 -1
  152. package/dist/client/assets/registry-utils-Byyd88f7.js +0 -1
  153. package/dist/client/assets/settings-Co5ybzun.js +0 -1
  154. package/dist/client/assets/shell-layout-C3pBvx_P.js +0 -3
  155. package/dist/client/assets/spinner-CwB0mUYA.js +0 -1
  156. package/dist/client/assets/tool-set-selector-CRLNbs4C.js +0 -1
  157. package/dist/client/assets/use-connection-BC3zltzG.js +0 -1
  158. package/dist/client/assets/use-create-virtual-mcp-Cj9oL1-p.js +0 -1
  159. package/dist/client/assets/use-members-BxzdumcN.js +0 -1
  160. package/dist/client/assets/use-organization-settings-DYLZDPKB.js +0 -1
  161. package/dist/client/assets/use-virtual-mcp-DsllWo9H.js +0 -1
  162. package/dist/client/assets/useInfiniteQuery-fnNpWW1Y.js +0 -1
  163. package/dist/client/assets/useQuery-Czw6cUjK.js +0 -1
  164. package/dist/client/assets/virtual-mcp-CoYEAnoS.js +0 -1
  165. package/dist/client/assets/workflow-7kcB8-gn.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "2.38.6",
3
+ "version": "2.39.1",
4
4
  "description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "license": "MIT",
@@ -105,6 +105,7 @@
105
105
  "jose": "^6.0.11",
106
106
  "lucide-react": "^0.468.0",
107
107
  "marked": "^15.0.6",
108
+ "mesh-plugin-user-sandbox": "workspace:*",
108
109
  "mesh-plugin-object-storage": "workspace:*",
109
110
  "nanoid": "^5.1.6",
110
111
  "pg": "^8.16.3",
@@ -1 +0,0 @@
1
- import{r as y,c as M,j as t,e as We,u as rt,f as it,s as at,b8 as ct,bi as dt,a as mt,b as ut,a0 as Re}from"./index-BqaxN2xC.js";import{I as Ae,E as ft}from"./empty-state-D96Y5HBy.js";import{E as Ye}from"./error-boundary-B-AbkEzN.js";import{C as Ge}from"./checkbox-YBwSx7EQ.js";import{c as G,B as q}from"./button-CEYz4vVv.js";import{i as ht}from"./ArrowLeft-BlDPaWrc.js";import{p as xt,V as pt,u as gt}from"./virtual-mcp-CoYEAnoS.js";import{a as He}from"./use-connection-BC3zltzG.js";import{C as jt}from"./collection-search-BtYrCrPa.js";import{I as Ee}from"./input-lyCEJ-v7.js";import{s as bt}from"./Plus-C8Yk0Byt.js";import{i as vt}from"./X-8Mftq7jS.js";import{P as yt}from"./pin-to-sidebar-button-S58VyRdL.js";import{T as Nt}from"./tool-set-selector-CRLNbs4C.js";import{I as St,R as Ct,a as _t,u as De}from"./index-BaKebp2o.js";import{c as Le,K as Fe}from"./constants-C56YODyA.js";import{listPrompts as wt,listResources as kt}from"./index-DNsNPBek.js";import{b as It,a as Tt}from"./use-virtual-mcp-DsllWo9H.js";import{s as Ke}from"./slugify-CEUa2lfQ.js";import{B as Qe}from"./badge-DfcjklCU.js";import{b as Mt,c as $t,a as Pt,D as zt}from"./dialog-Cur3bgyn.js";import{F as de,a as Rt,b as me,d as ue,f as fe,c as Ze}from"./form-BuxG1-zn.js";import{R as At}from"./resource-tabs-CXTSNkut.js";import{S as Et,a as Vt,b as Dt,c as Lt,d as Be}from"./select-DGKcOybq.js";import{S as Ft}from"./switch-LeZRc51C.js";import{T as Bt}from"./textarea-CphdD9q0.js";import{b as Q,c as Z,T as J,a as X}from"./tooltip-DzrZ9wCu.js";import{i as Je}from"./Check-CCn5GCwg.js";import{i as Ot}from"./Code01-Dir622wi.js";import{a as qt}from"./Copy01-CjY-NlSc.js";import{i as Ut}from"./CpuChip02-yUWdNp1P.js";import{i as Wt}from"./FlipBackward-Cj4V50Wu.js";import{i as Ce}from"./InfoCircle-B0FNzXlM.js";import{i as ze}from"./Loading01-Da3G3uHv.js";import{a as Yt,V as Gt,b as Ht}from"./layout-D-OU3f8P.js";import"./use-collections-oaTV6V1V.js";import"./useMutation-Cwf-gT4m.js";import"./useQuery-Czw6cUjK.js";import"./SearchMd-DFqFsfr3.js";import"./use-organization-settings-DYLZDPKB.js";import"./ChevronDown-YbVVQVLg.js";const Xe=({size:o=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"M4 7h11m0 0-4 4m4-4-4-4M4 17h16m0 0-4 4m4-4-4-4"}));Xe.displayName="ArrowsRight";const et=({size:o=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));et.displayName="Circle";const tt=({size:o=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"M10 17.659V20a2 2 0 1 0 4 0v-2.341M12 2v1m-9 9H2m3.5-6.5-.6-.6m13.6.6.6-.6M22 12h-1m-3 0a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z"}));tt.displayName="Lightbulb02";const st=({size:o=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));st.displayName="Save01";const ot=({size:o=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));ot.displayName="Share07";const Kt=y.memo(function(e){const s=M.c(20),{connection:l,isSelected:n,hasItemsEnabled:r,activeItemsCount:i,totalItemsCount:a,onSelect:m,onToggle:c}=e,d=n?"bg-accent/50":"hover:bg-muted/50";let u;s[0]!==d?(u=G("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),s[0]=d,s[1]=u):u=s[1];let f;s[2]!==l.icon||s[3]!==l.title?(f=t.jsx(Ae,{icon:l.icon,name:l.title,size:"xs"}),s[2]=l.icon,s[3]=l.title,s[4]=f):f=s[4];let x;s[5]!==l.title?(x=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),s[5]=l.title,s[6]=x):x=s[6];let p;s[7]!==m||s[8]!==f||s[9]!==x?(p=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:m,children:[f,x]}),s[7]=m,s[8]=f,s[9]=x,s[10]=p):p=s[10];let g;s[11]!==i||s[12]!==r||s[13]!==c||s[14]!==a?(g=a>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[i,"/",a]}),t.jsx(Ge,{checked:r,onCheckedChange:c,onClick:Zt})]}),s[11]=i,s[12]=r,s[13]=c,s[14]=a,s[15]=g):g=s[15];let S;return s[16]!==u||s[17]!==p||s[18]!==g?(S=t.jsxs("div",{className:u,children:[p,g]}),s[16]=u,s[17]=p,s[18]=g,s[19]=S):S=s[19],S}),Qt=y.memo(function(e){const s=M.c(18),{connectionId:l,item:n,isSelected:r,onToggle:i}=e,a=`item-${l}-${n.id}`,m=r?"text-foreground":"text-muted-foreground";let c;s[0]!==m?(c=G("text-sm font-medium",m),s[0]=m,s[1]=c):c=s[1];let d;s[2]!==n.name||s[3]!==c?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:c,children:n.name})}),s[2]=n.name,s[3]=c,s[4]=d):d=s[4];let u;s[5]!==n.description?(u=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),s[5]=n.description,s[6]=u):u=s[6];let f;s[7]!==d||s[8]!==u?(f=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),s[7]=d,s[8]=u,s[9]=f):f=s[9];const x=`item-${l}-${n.id}`;let p;s[10]!==r||s[11]!==i||s[12]!==x?(p=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Ge,{id:x,checked:r,onCheckedChange:i,onClick:Jt})}),s[10]=r,s[11]=i,s[12]=x,s[13]=p):p=s[13];let g;return s[14]!==a||s[15]!==f||s[16]!==p?(g=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:a,children:[f,p]}),s[14]=a,s[15]=f,s[16]=p,s[17]=g):g=s[17],g});function lt({itemSet:o,onItemSetChange:e,getItems:s,itemLabel:l,emptyItemsMessage:n,extraContent:r,excludeVirtualMcpId:i}){const[a,m]=y.useState(""),c=y.useDeferredValue(a),[d,u]=y.useState("all"),[f,x]=y.useState(!1),p=y.useRef(new Set(Object.keys(o))),g=He({searchTerm:c.trim()||void 0}),S=i?g.filter(h=>h.connection_type!=="VIRTUAL"?!0:xt(h.connection_url)!==i):g,C=p.current,I=[...C.values()].map(h=>S.find(N=>N.id===h)).filter(h=>h!==void 0),k=S.filter(h=>!C.has(h.id)),j=[...I,...k],v=h=>{const N=o[h];return N!==void 0&&N.length>0},_=j.filter(h=>{if(d==="all")return!0;const N=v(h.id);return d==="selected"?N:d==="unselected"?!N:!0}),[T,$]=y.useState(j[0]?.id??null),w=T?j.find(h=>h.id===T)??null:null,P=w?s(w):[],E=(h,N)=>o[h]?.includes(N)??!1,z=(h,N)=>{const D=o[h]??[],L=D.includes(N),U={...o};if(L){const W=D.filter(H=>H!==N);W.length===0?delete U[h]:U[h]=W}else U[h]=[...D,N];e(U)},R=h=>{const N=j.find(B=>B.id===h);if(!N)return;const D=s(N);if(D.length===0)return;const L=o[h]??[],U=D.map(B=>B.id),W=L.length>0&&U.every(B=>L.includes(B)),H={...o};W?delete H[h]:(H[h]=U,$(h)),e(H)},V=h=>{$(h),x(!0)},F=()=>{x(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:G("w-full md:w-80 border-r border-border flex flex-col",f&&"hidden md:flex"),children:[t.jsx(jt,{value:a,onChange:m,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>u("all"),className:G("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>u("selected"),className:G("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>u("unselected"),className:G("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:_.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:a?"No connections found":d==="selected"?"No servers selected":d==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:_.map(h=>{const D=s(h).length,L=o[h.id]?.length??0;return t.jsx(Kt,{connection:h,isSelected:T===h.id,hasItemsEnabled:v(h.id),activeItemsCount:L,totalItemsCount:D,onSelect:()=>V(h.id),onToggle:()=>R(h.id)},h.id)})})})]}),t.jsx("div",{className:G("flex-1 flex-col",f?"flex":"hidden md:flex"),children:w?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(q,{variant:"ghost",size:"sm",onClick:F,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(ht,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Ae,{icon:w.icon,name:w.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:w.title}),w.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:w.description})]})]})]}),r,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:P.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n||`This connection has no ${l} available`}):t.jsx("div",{className:"space-y-2",children:P.map(h=>t.jsx(Qt,{connectionId:w.id,item:h,isSelected:E(w.id,h.id),onToggle:()=>z(w.id,h.id)},h.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",l]})})})]})}function Zt(o){return o.stopPropagation()}function Jt(o){return o.stopPropagation()}function Xt(o){const e=M.c(7),{promptSet:s,onPromptSetChange:l,connectionPrompts:n,excludeVirtualMcpId:r}=o;let i;e[0]!==n?(i=c=>(n.get(c.id)??[]).map(es),e[0]=n,e[1]=i):i=e[1];const a=i;let m;return e[2]!==r||e[3]!==a||e[4]!==l||e[5]!==s?(m=t.jsx(lt,{itemSet:s,onItemSetChange:l,getItems:a,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available",excludeVirtualMcpId:r}),e[2]=r,e[3]=a,e[4]=l,e[5]=s,e[6]=m):m=e[6],m}function es(o){return{id:o.name,name:o.name,description:o.description}}function ts(o){return o.includes("*")}function ss(o){const e=M.c(27),{patterns:s,onAddPattern:l,onRemovePattern:n}=o,[r,i]=y.useState("");let a;e[0]!==r||e[1]!==l||e[2]!==s?(a=()=>{const f=r.trim();f&&!s.includes(f)&&(l(f),i(""))},e[0]=r,e[1]=l,e[2]=s,e[3]=a):a=e[3];const m=a;let c;e[4]!==m?(c=f=>{f.key==="Enter"&&(f.preventDefault(),m())},e[4]=m,e[5]=c):c=e[5];const d=c;let u;if(e[6]!==m||e[7]!==d||e[8]!==r||e[9]!==n||e[10]!==s){const f=s.filter(ts);let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("code",{children:"*"}),e[12]=x):x=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",x," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=p):p=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=_=>i(_.target.value),e[14]=g):g=e[14];let S;e[15]!==d||e[16]!==r?(S=t.jsx(Ee,{value:r,onChange:g,onKeyDown:d,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=d,e[16]=r,e[17]=S):S=e[17];let C;e[18]!==r?(C=r.trim(),e[18]=r,e[19]=C):C=e[19];const I=!C;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(bt,{size:16}),e[20]=k):k=e[20];let j;e[21]!==m||e[22]!==I?(j=t.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:I,children:k}),e[21]=m,e[22]=I,e[23]=j):j=e[23];let v;e[24]!==j||e[25]!==S?(v=t.jsxs("div",{className:"flex gap-2",children:[S,j]}),e[24]=j,e[25]=S,e[26]=v):v=e[26],u=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[p,v,f.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(_=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:_}),t.jsx("button",{type:"button",onClick:()=>n(_),className:"text-muted-foreground hover:text-foreground",children:t.jsx(vt,{size:12})})]},_))})]}),e[6]=m,e[7]=d,e[8]=r,e[9]=n,e[10]=s,e[11]=u}else u=e[11];return u}function os(o){const e=M.c(24),{resourceSet:s,onResourceSetChange:l,connectionResources:n,excludeVirtualMcpId:r}=o,[i]=y.useState(null);let a;e[0]!==n?(a=j=>(n.get(j.id)??[]).map(ls),e[0]=n,e[1]=a):a=e[1];const m=a;let c;e[2]!==l||e[3]!==s?(c=(j,v)=>{const _=s[j]??[];_.includes(v)||l({...s,[j]:[..._,v]})},e[2]=l,e[3]=s,e[4]=c):c=e[4];const d=c;let u;e[5]!==l||e[6]!==s?(u=(j,v)=>{const T=(s[j]??[]).filter($=>$!==v);if(T.length===0){const $={...s};delete $[j],l($)}else l({...s,[j]:T})},e[5]=l,e[6]=s,e[7]=u):u=e[7];const f=u;let x;e[8]!==l?(x=j=>{l(j)},e[8]=l,e[9]=x):x=e[9];const p=x;let g;e[10]!==s||e[11]!==i?(g=i?s[i]??[]:[],e[10]=s,e[11]=i,e[12]=g):g=e[12];const S=g;let C;e[13]!==d||e[14]!==f||e[15]!==i||e[16]!==S?(C=i?t.jsx(ss,{patterns:S,onAddPattern:j=>d(i,j),onRemovePattern:j=>f(i,j)}):null,e[13]=d,e[14]=f,e[15]=i,e[16]=S,e[17]=C):C=e[17];const I=C;let k;return e[18]!==r||e[19]!==I||e[20]!==m||e[21]!==p||e[22]!==s?(k=t.jsx("div",{className:"h-full",children:t.jsx(lt,{itemSet:s,onItemSetChange:p,getItems:m,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:I,excludeVirtualMcpId:r})}),e[18]=r,e[19]=I,e[20]=m,e[21]=p,e[22]=s,e[23]=k):k=e[23],k}function ls(o){return{id:o.uri,name:o.name||o.uri,description:o.description||o.uri}}function ns(o){const e=M.c(8);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=G("grid gap-3",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==l||e[6]!==n?(r=t.jsx(Ct,{"data-slot":"radio-group",className:n,...l}),e[5]=l,e[6]=n,e[7]=r):r=e[7],r}function Pe(o){const e=M.c(9);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=G("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=n):n=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(_t,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(et,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=r):r=e[5];let i;return e[6]!==l||e[7]!==n?(i=t.jsx(St,{"data-slot":"radio-group-item",className:n,...l,children:r}),e[6]=l,e[7]=n,e[8]=i):i=e[8],i}function rs(o){const s=new TextEncoder().encode(o),l=Array.from(s,n=>String.fromCharCode(n)).join("");return btoa(l)}const is=pt.pick({title:!0,description:!0,status:!0,tool_selection_mode:!0,metadata:!0}).extend({title:at().min(1,"Name is required").max(255)});function Oe(o,e){const s={};for(const l of o.connections)if(l.selected_tools===null){const n=e.get(l.connection_id)??[];n.length>0&&(s[l.connection_id]=n)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function qe(o){const e={};for(const s of o.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function Ue(o){const e={};for(const s of o.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function as(o,e,s,l){const n=new Set([...Object.keys(o),...Object.keys(e),...Object.keys(s)]);return Array.from(n).map(r=>{const i=o[r]??[],a=l.get(r)??[],m=a.length>0&&a.every(c=>i.includes(c));return{connection_id:r,selected_tools:i.length===0||m?null:i,selected_resources:e[r]??null,selected_prompts:s[r]??null}})}function cs(o){const e=M.c(10),{url:s}=o,[l,n]=y.useState(!1);let r;e[0]!==s?(r=async()=>{await navigator.clipboard.writeText(s),n(!0),Re.success("Agent URL copied to clipboard"),setTimeout(()=>n(!1),2e3)},e[0]=s,e[1]=r):r=e[1];const i=r;let a;e[2]!==l?(a=l?t.jsx(Je,{size:20,className:"text-green-600"}):t.jsx(qt,{size:20}),e[2]=l,e[3]=a):a=e[3];const m=l?"Copied!":"Copy URL";let c;e[4]!==m?(c=t.jsx("span",{className:"text-xs font-medium",children:m}),e[4]=m,e[5]=c):c=e[5];let d;return e[6]!==i||e[7]!==a||e[8]!==c?(d=t.jsxs(q,{type:"button",variant:"outline",onClick:i,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,c]}),e[6]=i,e[7]=a,e[8]=c,e[9]=d):d=e[9],d}function ds(o){const e=M.c(7),{url:s,serverName:l}=o;let n;e[0]!==l||e[1]!==s?(n=()=>{const c=Ke(l),u=rs(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),f=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(u)}`;window.open(f,"_blank"),Re.success("Opening Cursor...")},e[0]=l,e[1]=s,e[2]=n):n=e[2];const r=n;let i,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),a=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=i,e[4]=a):(i=e[3],a=e[4]);let m;return e[5]!==r?(m=t.jsxs(q,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[i,a]}),e[5]=r,e[6]=m):m=e[6],m}function ms(o){const e=M.c(11),{url:s,serverName:l}=o,[n,r]=y.useState(!1);let i;e[0]!==l||e[1]!==s?(i=async()=>{const f=Ke(l),p=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),g=`claude mcp add "${f}" --config '${p.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(g),r(!0),Re.success("Claude Code command copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[0]=l,e[1]=s,e[2]=i):i=e[2];const a=i;let m;e[3]!==n?(m=n?t.jsx(Je,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=n,e[4]=m):m=e[4];const c=n?"Copied!":"Install on Claude";let d;e[5]!==c?(d=t.jsx("span",{className:"text-xs font-medium",children:c}),e[5]=c,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==m||e[9]!==d?(u=t.jsxs(q,{type:"button",variant:"outline",onClick:a,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,d]}),e[7]=a,e[8]=m,e[9]=d,e[10]=u):u=e[10],u}function us(o){const e=M.c(40),{open:s,onOpenChange:l,virtualMcp:n}=o,[r,i]=y.useState("code_execution");let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=N=>{(N==="passthrough"||N==="smart_tool_selection"||N==="code_execution")&&i(N)},e[0]=a):a=e[0];const m=a;let c;e[1]!==r||e[2]!==n.id?(c=new URL(`/mcp/virtual-mcp/${n.id}`,window.location.origin),c.searchParams.set("mode",r),e[1]=r,e[2]=n.id,e[3]=c):c=e[3];let d;e[4]!==n.id||e[5]!==n.title?(d=n.title||`agent-${n.id.slice(0,8)}`,e[4]=n.id,e[5]=n.title,e[6]=d):d=e[6];const u=d;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Mt,{children:t.jsx($t,{children:"Share Agent"})}),e[7]=f):f=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=x):x=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Xe,{className:"size-5 text-muted-foreground"})}),e[9]=p):p=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=g):g=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(J,{asChild:!0,children:t.jsx(Ce,{className:"size-3.5 text-muted-foreground"})}),e[11]=S):S=e[11];let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[p,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[g,t.jsx(Q,{children:t.jsxs(Z,{children:[S,t.jsx(X,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(Pe,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=C):C=e[12];let I;e[13]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(tt,{className:"size-5 text-muted-foreground"})}),e[13]=I):I=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=k):k=e[14];let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(J,{asChild:!0,children:t.jsx(Ce,{className:"size-3.5 text-muted-foreground"})}),e[15]=j):j=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[I,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[k,t.jsx(Q,{children:t.jsxs(Z,{children:[j,t.jsx(X,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(Pe,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=v):v=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Ot,{className:"size-5 text-muted-foreground"})}),e[17]=_):_=e[17];let T;e[18]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=T):T=e[18];let $;e[19]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(J,{asChild:!0,children:t.jsx(Ce,{className:"size-3.5 text-muted-foreground"})}),e[19]=$):$=e[19];let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[_,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[T,t.jsx(Q,{children:t.jsxs(Z,{children:[$,t.jsx(X,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(Pe,{id:"mode-code",value:"code_execution"}),t.jsx(Qe,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=w):w=e[20];let P;e[21]!==r?(P=t.jsxs("div",{className:"flex flex-col gap-3",children:[x,t.jsxs(ns,{value:r,onValueChange:m,className:"flex flex-col gap-4.5",children:[C,v,w]})]}),e[21]=r,e[22]=P):P=e[22];let E;e[23]!==c.href?(E=t.jsx(cs,{url:c.href}),e[23]=c.href,e[24]=E):E=e[24];let z,R;e[25]!==u||e[26]!==c.href?(z=t.jsx(ds,{url:c.href,serverName:u}),R=t.jsx(ms,{url:c.href,serverName:u}),e[25]=u,e[26]=c.href,e[27]=z,e[28]=R):(z=e[27],R=e[28]);let V;e[29]!==E||e[30]!==z||e[31]!==R?(V=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[E,z,R]})}),e[29]=E,e[30]=z,e[31]=R,e[32]=V):V=e[32];let F;e[33]!==P||e[34]!==V?(F=t.jsxs(Pt,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[f,t.jsxs("div",{className:"flex flex-col gap-6",children:[P,V]})]}),e[33]=P,e[34]=V,e[35]=F):F=e[35];let h;return e[36]!==l||e[37]!==s||e[38]!==F?(h=t.jsx(zt,{open:s,onOpenChange:l,children:F}),e[36]=l,e[37]=s,e[38]=F,e[39]=h):h=e[39],h}function fs(o){const e=M.c(27),{form:s,icon:l}=o;let n;e[0]!==s?(n=s.watch("title")||"Agent",e[0]=s,e[1]=n):n=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ut,{}),e[2]=r):r=e[2];let i;e[3]!==l||e[4]!==n?(i=t.jsx(Ae,{icon:l,name:n,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:r}),e[3]=l,e[4]=n,e[5]=i):i=e[5];let a;e[6]!==s.control?(a=t.jsx(de,{control:s.control,name:"status",render:js}),e[6]=s.control,e[7]=a):a=e[7];let m;e[8]!==i||e[9]!==a?(m=t.jsxs("div",{className:"flex items-start justify-between",children:[i,a]}),e[8]=i,e[9]=a,e[10]=m):m=e[10];let c;e[11]!==s.control?(c=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(de,{control:s.control,name:"title",render:gs}),t.jsx(de,{control:s.control,name:"description",render:ps})]}),e[11]=s.control,e[12]=c):c=e[12];let d;e[13]!==m||e[14]!==c?(d=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,c]}),e[13]=m,e[14]=c,e[15]=d):d=e[15];let u;e[16]!==s.control?(u=t.jsx("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:t.jsx(de,{control:s.control,name:"tool_selection_mode",render:xs})}),e[16]=s.control,e[17]=u):u=e[17];let f;e[18]!==s.control?(f=t.jsx("div",{className:"flex flex-col gap-3 p-5",children:t.jsx(de,{control:s.control,name:"metadata",render:hs})}),e[18]=s.control,e[19]=f):f=e[19];let x;e[20]!==d||e[21]!==u||e[22]!==f?(x=t.jsxs("div",{className:"flex flex-col",children:[d,u,f]}),e[20]=d,e[21]=u,e[22]=f,e[23]=x):x=e[23];let p;return e[24]!==s||e[25]!==x?(p=t.jsx("div",{className:"flex flex-col h-full overflow-auto",children:t.jsx(Rt,{...s,children:x})}),e[24]=s,e[25]=x,e[26]=p):p=e[26],p}function hs(o){const{field:e}=o;return t.jsxs(me,{children:[t.jsxs("div",{children:[t.jsx(Ze,{className:"text-sm font-medium text-foreground mb-1",children:"Instructions"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Define the agent's role, capabilities, and behavior to guide how it interprets requests, uses available tools, and responds to users."})]}),t.jsx(ue,{children:t.jsx(Bt,{value:e.value?.instructions??"",onChange:s=>e.onChange({...e.value??{},instructions:s.target.value||void 0}),placeholder:"You are a helpful assistant that specializes in customer support. Your role is to help users resolve issues and answer questions...",className:"min-h-[240px] resize-none text-sm leading-relaxed"})}),t.jsx(fe,{})]})}function xs(o){const{field:e}=o;return t.jsxs(me,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Ze,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Q,{children:t.jsxs(Z,{children:[t.jsx(J,{asChild:!0,children:t.jsx(q,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(Ce,{size:14,className:"text-muted-foreground"})})}),t.jsx(X,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs(Et,{value:e.value,onValueChange:e.onChange,children:[t.jsx(ue,{children:t.jsx(Vt,{className:"w-[180px]",children:t.jsx(Dt,{})})}),t.jsxs(Lt,{children:[t.jsx(Be,{value:"inclusion",children:"Include Selected"}),t.jsx(Be,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(fe,{})]})}function ps(o){const{field:e}=o;return t.jsxs(me,{className:"w-full space-y-0",children:[t.jsx(ue,{children:t.jsx(Ee,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(fe,{})]})}function gs(o){const{field:e}=o;return t.jsxs(me,{className:"w-full space-y-0",children:[t.jsx(ue,{children:t.jsx(Ee,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Agent Name"})}),t.jsx(fe,{})]})}function js(o){const{field:e}=o;return t.jsxs(me,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Qe,{variant:e.value==="active"?"success":"outline",children:e.value==="active"?"Active":"Inactive"}),t.jsx(ue,{children:t.jsx(Ft,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(fe,{})]})}function bs(o){const e=M.c(76),{virtualMcp:s,virtualMcpId:l,requestedTabId:n}=o,i=ct().location.href,a=dt();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/$org/agents/$agentId"},e[0]=m):m=e[0];const c=We(m),d=Tt(),{org:u}=gt();let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f={},e[1]=f):f=e[1];const x=He(f),p=x.map(Ss);let g;e[2]!==u?(g=b=>({queryKey:Fe.connectionPrompts(b),queryFn:async()=>{try{const A=await Le({connectionId:b,orgId:u.id});return await wt(A)}catch{return{prompts:[]}}},staleTime:6e4,retry:!1}),e[2]=u,e[3]=g):g=e[3];const S=De({queries:p.map(g)});let C;e[4]!==u?(C=b=>({queryKey:Fe.connectionResources(b),queryFn:async()=>{try{const A=await Le({connectionId:b,orgId:u.id});return await kt(A)}catch{return{resources:[]}}},staleTime:6e4,retry:!1}),e[4]=u,e[5]=C):C=e[5];const I=De({queries:p.map(C)}),k=new Map;p.forEach((b,A)=>{const K=S[A];K?.data?k.set(b,K.data.prompts.map(Ns)):k.set(b,[])});const j=new Map;p.forEach((b,A)=>{const K=I[A];K?.data?j.set(b,K.data.resources.map(ys)):j.set(b,[])});let v;if(e[6]!==x){v=new Map;for(const b of x)b.tools&&b.tools.length>0&&v.set(b.id,b.tools.map(vs));e[6]=x,e[7]=v}else v=e[7];let _;e[8]!==v||e[9]!==s?(_=()=>Oe(s,v),e[8]=v,e[9]=s,e[10]=_):_=e[10];const[T,$]=y.useState(_);let w;e[11]!==s?(w=()=>qe(s),e[11]=s,e[12]=w):w=e[12];const[P,E]=y.useState(w);let z;e[13]!==s?(z=()=>Ue(s),e[13]=s,e[14]=z):z=e[14];const[R,V]=y.useState(z),[F,h]=y.useState(!1),[N,D]=y.useState(!1);let L;e[15]===Symbol.for("react.memo_cache_sentinel")?(L=b=>{$(b),h(!0)},e[15]=L):L=e[15];const U=L;let W;e[16]===Symbol.for("react.memo_cache_sentinel")?(W=b=>{E(b),h(!0)},e[16]=W):W=e[16];const H=W;let B;e[17]===Symbol.for("react.memo_cache_sentinel")?(B=b=>{V(b),h(!0)},e[17]=B):B=e[17];const nt=B;let he;e[18]===Symbol.for("react.memo_cache_sentinel")?(he=mt(is),e[18]=he):he=e[18];const _e=s.tool_selection_mode??"inclusion";let ee;e[19]!==s.metadata?(ee=s.metadata??{instructions:""},e[19]=s.metadata,e[20]=ee):ee=e[20];let xe;e[21]!==_e||e[22]!==ee||e[23]!==s.description||e[24]!==s.status||e[25]!==s.title?(xe={resolver:he,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:_e,metadata:ee}},e[21]=_e,e[22]=ee,e[23]=s.description,e[24]=s.status,e[25]=s.title,e[26]=xe):xe=e[26];const Y=ut(xe),we=Y.formState.isDirty||F;let pe;e[27]!==d.update||e[28]!==v||e[29]!==Y||e[30]!==R||e[31]!==P||e[32]!==T||e[33]!==l?(pe=async()=>{try{const b=Y.getValues(),A=as(T,P,R,v),K={title:b.title,description:b.description,status:b.status,tool_selection_mode:b.tool_selection_mode,metadata:b.metadata,connections:A};await d.update.mutateAsync({id:l,data:K}),Y.reset(b),h(!1)}catch(b){console.error("Failed to save virtual MCP:",b)}},e[27]=d.update,e[28]=v,e[29]=Y,e[30]=R,e[31]=P,e[32]=T,e[33]=l,e[34]=pe):pe=e[34];const ke=pe;let ge;e[35]!==v||e[36]!==Y||e[37]!==s?(ge=()=>{Y.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion",metadata:s.metadata??{instructions:""}}),$(Oe(s,v)),E(qe(s)),V(Ue(s)),h(!1)},e[35]=v,e[36]=Y,e[37]=s,e[38]=ge):ge=e[38];const Ie=ge;let je;e[39]===Symbol.for("react.memo_cache_sentinel")?(je=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[39]=je):je=e[39];const Ve=je,O=Ve.some(b=>b.id===n)?n:"settings";let be;e[40]!==c?(be=b=>{c({search:A=>({...A,tab:b}),replace:!0})},e[40]=c,e[41]=be):be=e[41];const Te=be,ce=d.update.isPending;let te;e[42]!==a.history?(te=()=>a.history.back(),e[42]=a.history,e[43]=te):te=e[43];let se;e[44]!==O||e[45]!==Te?(se=t.jsx(Yt,{children:t.jsx(At,{tabs:Ve,activeTab:O,onTabChange:Te})}),e[44]=O,e[45]=Te,e[46]=se):se=e[46];let oe;e[47]!==Ie||e[48]!==ke||e[49]!==we||e[50]!==ce?(oe=we&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{children:t.jsxs(Z,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(q,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ce,onClick:Ie,"aria-label":"Cancel",children:t.jsx(Wt,{size:14})})})}),t.jsx(X,{side:"bottom",children:"Cancel"})]})}),t.jsx(Q,{children:t.jsxs(Z,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(q,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ce,onClick:ke,"aria-label":"Save",children:ce?t.jsx(ze,{size:14,className:"animate-spin"}):t.jsx(st,{size:14})})})}),t.jsx(X,{side:"bottom",children:"Save"})]})})]}),e[47]=Ie,e[48]=ke,e[49]=we,e[50]=ce,e[51]=oe):oe=e[51];let ve;e[52]===Symbol.for("react.memo_cache_sentinel")?(ve=()=>D(!0),e[52]=ve):ve=e[52];let ye;e[53]===Symbol.for("react.memo_cache_sentinel")?(ye=t.jsx(Q,{children:t.jsxs(Z,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(q,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:ve,"aria-label":"Share",children:t.jsx(ot,{size:14})})})}),t.jsx(X,{side:"bottom",children:"Share"})]})}),e[53]=ye):ye=e[53];const Me=s.icon??"cpu_chip";let le;e[54]!==Me||e[55]!==i||e[56]!==s.title?(le=t.jsx(yt,{title:s.title,url:i,icon:Me}),e[54]=Me,e[55]=i,e[56]=s.title,e[57]=le):le=e[57];let ne;e[58]!==oe||e[59]!==le?(ne=t.jsxs(Gt,{children:[oe,ye,le]}),e[58]=oe,e[59]=le,e[60]=ne):ne=e[60];let Ne;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ne=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),e[61]=Ne):Ne=e[61];const $e=O==="settings"?t.jsx(fs,{form:Y,icon:s.icon}):O==="tools"?t.jsx(Nt,{toolSet:T,onToolSetChange:U,excludeVirtualMcpId:l}):O==="resources"?t.jsx(os,{resourceSet:P,onResourceSetChange:H,connectionResources:j,excludeVirtualMcpId:l}):O==="prompts"?t.jsx(Xt,{promptSet:R,onPromptSetChange:nt,connectionPrompts:k,excludeVirtualMcpId:l}):null;let re;e[62]!==$e?(re=t.jsx(y.Suspense,{fallback:Ne,children:$e}),e[62]=$e,e[63]=re):re=e[63];let ie;e[64]!==O||e[65]!==re?(ie=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(Ye,{children:re},O)})})}),e[64]=O,e[65]=re,e[66]=ie):ie=e[66];let ae;e[67]!==N||e[68]!==s?(ae=t.jsx(us,{open:N,onOpenChange:D,virtualMcp:s}),e[67]=N,e[68]=s,e[69]=ae):ae=e[69];let Se;return e[70]!==te||e[71]!==se||e[72]!==ne||e[73]!==ie||e[74]!==ae?(Se=t.jsxs(Ht,{onBack:te,children:[se,ne,ie,ae]}),e[70]=te,e[71]=se,e[72]=ne,e[73]=ie,e[74]=ae,e[75]=Se):Se=e[75],Se}function vs(o){return o.name}function ys(o){return{uri:o.uri,name:o.name,description:o.description}}function Ns(o){return{name:o.name,description:o.description}}function Ss(o){return o.id}function Cs(){const o=M.c(10);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/agents/$agentId"},o[0]=e):e=o[0];const s=We(e);let l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},o[1]=l):l=o[1];const n=rt(l),{org:r}=n,i=n.agentId??n.virtualMcpId??"";let a;o[2]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},o[2]=a):a=o[2];const c=it(a).tab||"settings",d=It(i);if(!d){let f;return o[3]!==s||o[4]!==r?(f=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ft,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(q,{variant:"outline",onClick:()=>s({to:"/$org/agents",params:{org:r}}),children:"Back to agents"})})}),o[3]=s,o[4]=r,o[5]=f):f=o[5],f}let u;return o[6]!==c||o[7]!==d||o[8]!==i?(u=t.jsx(bs,{virtualMcp:d,virtualMcpId:i,requestedTabId:c}),o[6]=c,o[7]=d,o[8]=i,o[9]=u):u=o[9],u}function _s(){const o=M.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Cs,{})})}),o[0]=e):e=o[0],e}function xo(){const o=M.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_s,{}),o[0]=e):e=o[0],e}export{xo as default};
@@ -1 +0,0 @@
1
- import{c as ee,j as t,r as te,e as oe}from"./index-BqaxN2xC.js";import{C as re}from"./collection-header-BKBivTdh.js";import{C as ne}from"./collection-page-BQnr3vxz.js";import{C as ie}from"./collection-search-BtYrCrPa.js";import{C as ae}from"./collection-table-wrapper-qsmwllrX.js";import{C as le}from"./connection-card-BmrG8yB6.js";import{E as q,I as ce}from"./empty-state-D96Y5HBy.js";import{E as de}from"./error-boundary-B-AbkEzN.js";import{u as me,s as J}from"./use-list-state-CUj2Pms0.js";import{u as ue}from"./use-create-virtual-mcp-Cj9oL1-p.js";import{u as ge}from"./virtual-mcp-CoYEAnoS.js";import{u as pe,a as he}from"./use-virtual-mcp-DsllWo9H.js";import{c as fe,b as xe,d as je,A as Ce,e as we,g as Ne,a as ye,f as De}from"./alert-dialog-CP6Si-sS.js";import{B as se}from"./badge-DfcjklCU.js";import{B as G}from"./button-CEYz4vVv.js";import{D as Q,a as U,b as X,c as V}from"./dropdown-menu-DRvXtcX1.js";import{i as x}from"./CpuChip02-yUWdNp1P.js";import{i as Y}from"./DotsVertical-Dp-gx6mF.js";import{i as Se}from"./Loading01-Da3G3uHv.js";import{s as Z}from"./Trash01-DsqSsyPF.js";import"./collection-display-button-DnLs8bVk.js";import"./ArrowUp-CLiwYXs0.js";import"./Check-CCn5GCwg.js";import"./Grid01-CPA-Um40.js";import"./List-d67v1RYc.js";import"./tooltip-DzrZ9wCu.js";import"./view-mode-toggle-Ba3TLRo6.js";import"./SearchMd-DFqFsfr3.js";import"./input-lyCEJ-v7.js";import"./card-Czj8cnsu.js";import"./use-mobile-BYgIoeGI.js";import"./use-collections-oaTV6V1V.js";import"./useMutation-Cwf-gT4m.js";import"./useQuery-Czw6cUjK.js";import"./constants-C56YODyA.js";function be(e,r){switch(r.type){case"delete":return{mode:"deleting",virtualMcp:r.virtualMcp};case"close":return{mode:"idle"}}}function ve(){const e=ee.c(63),{org:r}=ge(),i=oe();let j;e[0]!==r.slug?(j={namespace:r.slug,resource:"agents"},e[0]=r.slug,e[1]=j):j=e[1];const s=me(j),f=pe(s);let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},e[2]=C):C=e[2];const{createVirtualMCP:O,isCreating:w}=ue(C),B=he();let N;e[3]===Symbol.for("react.memo_cache_sentinel")?(N={mode:"idle"},e[3]=N):N=e[3];const[n,y]=te.useReducer(be,N);let D;e[4]!==B||e[5]!==n.mode||e[6]!==n.virtualMcp?(D=async()=>{if(n.mode!=="deleting")return;const o=n.virtualMcp.id;y({type:"close"});try{await B.delete.mutateAsync(o)}catch{}},e[4]=B,e[5]=n.mode,e[6]=n.virtualMcp,e[7]=D):D=e[7];const R=D;let S,b,v,k,A,_;e[8]===Symbol.for("react.memo_cache_sentinel")?(S={id:"icon",header:"",render:Ke,cellClassName:"w-16 shrink-0",wrap:!0},b={id:"title",header:"Name",render:Ee,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},v={id:"description",header:"Description",render:Pe,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},k={id:"mode",header:"Mode",accessor:$e,cellClassName:"w-[100px]"},A={id:"connections",header:"Connections",render:Me,cellClassName:"w-24 shrink-0"},_={id:"status",header:"Status",render:ze,cellClassName:"w-24 shrink-0",sortable:!0},e[8]=S,e[9]=b,e[10]=v,e[11]=k,e[12]=A,e[13]=_):(S=e[8],b=e[9],v=e[10],k=e[11],A=e[12],_=e[13]);let I;e[14]!==i||e[15]!==r.slug?(I=[S,b,v,k,A,_,{id:"actions",header:"",render:o=>t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ie,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:_e,children:[t.jsxs(V,{onClick:a=>{a.stopPropagation(),i({to:"/$org/agents/$agentId",params:{org:r.slug,agentId:o.id}})},children:[t.jsx(J,{size:16}),"Open"]}),t.jsxs(V,{variant:"destructive",onClick:a=>{a.stopPropagation(),y({type:"delete",virtualMcp:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[14]=i,e[15]=r.slug,e[16]=I):I=e[16];const T=I,H=w?"Creating...":"Create Agent";let z;e[17]!==O||e[18]!==w||e[19]!==H?(z=t.jsx(G,{onClick:O,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:w,children:H}),e[17]=O,e[18]=w,e[19]=H,e[20]=z):z=e[20];const L=z,F=n.mode==="deleting";let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=o=>!o&&y({type:"close"}),e[21]=M):M=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(fe,{children:"Delete Agent?"}),e[22]=$):$=e[22];const W=n.mode==="deleting"&&n.virtualMcp.title;let l;e[23]!==W?(l=t.jsxs(xe,{children:[$,t.jsxs(je,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[23]=W,e[24]=l):l=e[24];let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Ce,{children:"Cancel"}),e[25]=P):P=e[25];let c;e[26]!==R?(c=t.jsxs(we,{children:[P,t.jsx(Ne,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[26]=R,e[27]=c):c=e[27];let d;e[28]!==l||e[29]!==c?(d=t.jsxs(ye,{children:[l,c]}),e[28]=l,e[29]=c,e[30]=d):d=e[30];let m;e[31]!==F||e[32]!==d?(m=t.jsx(De,{open:F,onOpenChange:M,children:d}),e[31]=F,e[32]=d,e[33]=m):m=e[33];let E;e[34]===Symbol.for("react.memo_cache_sentinel")?(E=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[34]=E):E=e[34];let u;e[35]!==L||e[36]!==s.handleSort||e[37]!==s.setViewMode||e[38]!==s.sortDirection||e[39]!==s.sortKey||e[40]!==s.viewMode?(u=t.jsx(re,{title:"Agents",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:E,ctaButton:L}),e[35]=L,e[36]=s.handleSort,e[37]=s.setViewMode,e[38]=s.sortDirection,e[39]=s.sortKey,e[40]=s.viewMode,e[41]=u):u=e[41];let g;e[42]!==s?(g=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[42]=s,e[43]=g):g=e[43];let p;e[44]!==s.search||e[45]!==s.setSearch||e[46]!==g?(p=t.jsx(ie,{value:s.search,onChange:s.setSearch,placeholder:"Search for an agent...",onKeyDown:g}),e[44]=s.search,e[45]=s.setSearch,e[46]=g,e[47]=p):p=e[47];let h;e[48]!==T||e[49]!==s.handleSort||e[50]!==s.search||e[51]!==s.sortDirection||e[52]!==s.sortKey||e[53]!==s.viewMode||e[54]!==i||e[55]!==r.slug||e[56]!==f?(h=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:f.length===0?t.jsx(q,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:s.search?"No agents found":"No agents yet",description:s.search?`No agents match "${s.search}"`:"Create an agent to aggregate tools from multiple Connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:f.map(o=>t.jsx(le,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(x,{}),onClick:()=>i({to:"/$org/agents/$agentId",params:{org:r.slug,agentId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ae,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:ke,children:[t.jsxs(V,{onClick:a=>{a.stopPropagation(),i({to:"/$org/agents/$agentId",params:{org:r.slug,agentId:o.id}})},children:[t.jsx(J,{size:16}),"Open"]}),t.jsxs(V,{variant:"destructive",onClick:a=>{a.stopPropagation(),y({type:"delete",virtualMcp:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ae,{columns:T,data:f,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>i({to:"/$org/agents/$agentId",params:{org:r.slug,agentId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(q,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})}),e[48]=T,e[49]=s.handleSort,e[50]=s.search,e[51]=s.sortDirection,e[52]=s.sortKey,e[53]=s.viewMode,e[54]=i,e[55]=r.slug,e[56]=f,e[57]=h):h=e[57];let K;return e[58]!==m||e[59]!==u||e[60]!==p||e[61]!==h?(K=t.jsxs(ne,{children:[m,u,p,h]}),e[58]=m,e[59]=u,e[60]=p,e[61]=h,e[62]=K):K=e[62],K}function ke(e){return e.stopPropagation()}function Ae(e){return e.stopPropagation()}function _e(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function ze(e){return t.jsx(se,{variant:e.status==="active"?"default":"outline",children:e.status})}function Me(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function $e(e){return t.jsx(se,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Pe(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Ee(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Ke(e){return t.jsx(ce,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(x,{size:16})})}function jt(){const e=ee.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(de,{children:t.jsx(te.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Se,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ve,{})})}),e[0]=r):r=e[0],r}export{jt as default};
@@ -1 +0,0 @@
1
- import{c,j as l}from"./index-BqaxN2xC.js";import{c as d}from"./button-CEYz4vVv.js";function f(a){const e=c.c(8);let r,o;e[0]!==a?({className:r,...o}=a,e[0]=a,e[1]=r,e[2]=o):(r=e[1],o=e[2]);let t;e[3]!==r?(t=d("bg-card text-card-foreground hover:bg-accent/50 flex flex-col gap-6 rounded-xl border border-border/75",r),e[3]=r,e[4]=t):t=e[4];let s;return e[5]!==o||e[6]!==t?(s=l.jsx("div",{"data-slot":"card",className:t,...o}),e[5]=o,e[6]=t,e[7]=s):s=e[7],s}export{f as C};
@@ -1 +0,0 @@
1
- import{c as d,j as c,X as n,Y as l}from"./index-BqaxN2xC.js";import{i as m}from"./Check-CCn5GCwg.js";import{c as b}from"./button-CEYz4vVv.js";function f(o){const e=d.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=b("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(l,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(n,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{f as C};
@@ -1 +0,0 @@
1
- import{c as ne,j as t,K as rt,e as at,b8 as ct,d as dt,r as mt,a0 as ft}from"./index-BqaxN2xC.js";import{g as Ue}from"./generate-id-Dyweu44Y.js";import{C as Ve}from"./collection-display-button-DnLs8bVk.js";import{C as ut}from"./collection-search-BtYrCrPa.js";import{C as pt}from"./card-Czj8cnsu.js";import{I as qe,E as ht}from"./empty-state-D96Y5HBy.js";import{D as Ge,a as We,b as He,c as F}from"./dropdown-menu-DRvXtcX1.js";import{B as ke,c as Oe}from"./button-CEYz4vVv.js";import{a as Je}from"./Copy01-CjY-NlSc.js";import{i as Qe}from"./DotsVertical-Dp-gx6mF.js";import{i as Ye}from"./Edit01-B_nUJxlr.js";import{s as Xe,u as xt}from"./use-list-state-CUj2Pms0.js";import{s as Ze}from"./Trash01-DsqSsyPF.js";import{C as gt}from"./collection-table-wrapper-qsmwllrX.js";import{E as Le}from"./empty-state-B52GWMyA.js";import{n as Be}from"./Inbox01-By8bLcOc.js";import{A as Me}from"./avatar-qY1FecOi.js";import{u as jt}from"./useQuery-Czw6cUjK.js";import{u as et}from"./virtual-mcp-CoYEAnoS.js";import{S as Ct,u as tt}from"./constants-C56YODyA.js";import{P as vt}from"./pin-to-sidebar-button-S58VyRdL.js";import{b as bt,a as yt}from"./use-collections-oaTV6V1V.js";import{b as Nt}from"./use-connection-BC3zltzG.js";import{B as wt}from"./constants-DFc-Xc3W.js";import{A as St,g as _t,c as Dt,b as At,d as It,e as Pt,a as Tt,f as $t}from"./alert-dialog-CP6Si-sS.js";import{s as Et}from"./Plus-C8Yk0Byt.js";import{V as zt}from"./layout-D-OU3f8P.js";function Ot(n,e){const s=n.properties||{};for(const o in s){const l=s[o];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&o in e&&e[o])return e[o]}const c=["image","img","avatar","icon","logo","thumbnail","cover"];for(const o of c)if(e&&typeof e=="object"&&o in e&&typeof e[o]=="string")return e[o]}function Mt(n){const e=ne.c(25),{item:s,schema:c,actions:o}=n;let l;e[0]!==s||e[1]!==c?(l=Ot(c,s),e[0]=s,e[1]=c,e[2]=l):l=e[2];const r=l,d=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==o?(f=o&&Object.keys(o).length>0,e[3]=o,e[4]=f):f=e[4];const i=f;let u;e[5]!==r||e[6]!==s.title?(u=t.jsx(qe,{icon:r,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=s.title,e[7]=u):u=e[7];let g;e[8]!==s.title?(g=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=g):g=e[9];const h=d||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==g||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[g,m]}),e[12]=g,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let v;e[18]!==o||e[19]!==i||e[20]!==s?(v=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ut,onMouseDown:Kt,children:t.jsxs(Ge,{children:[t.jsx(We,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ft,children:t.jsx(Qe,{size:20})})}),t.jsxs(He,{align:"end",onClick:kt,children:[o.open&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.open?.(s)},children:[t.jsx(Xe,{size:16}),"Open"]}),o.edit&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.edit?.(s)},children:[t.jsx(Ye,{size:16}),"Edit"]}),o.duplicate&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.duplicate?.(s)},children:[t.jsx(Je,{size:16}),"Duplicate"]}),o.delete&&t.jsxs(F,{variant:"destructive",onClick:p=>{p.stopPropagation(),o.delete?.(s)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})}),e[18]=o,e[19]=i,e[20]=s,e[21]=v):v=e[21];let N;return e[22]!==y||e[23]!==v?(N=t.jsxs(pt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,v]}),e[22]=y,e[23]=v,e[24]=N):N=e[24],N}function kt(n){return n.stopPropagation()}function Ft(n){return n.stopPropagation()}function Kt(n){return n.stopPropagation()}function Ut(n){return n.stopPropagation()}function Lt(n){const e=ne.c(11),{org:s}=et();let c;e[0]!==s.id?(c={connectionId:Ct,orgId:s.id},e[0]=s.id,e[1]=c):c=e[1];const o=tt(c);let l;e[2]!==n?(l=rt.user(n),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==o||e[5]!==n?(r=async()=>{const i=await o.callTool({name:"USER_GET",arguments:{id:n}});return(i.structuredContent??i).user},e[4]=o,e[5]=n,e[6]=r):r=e[6];const d=!!n;let f;return e[7]!==l||e[8]!==r||e[9]!==d?(f={queryKey:l,queryFn:r,staleTime:3e5,retry:1,enabled:d},e[7]=l,e[8]=r,e[9]=d,e[10]=f):f=e[10],jt(f)}function Bt(n){const e=ne.c(39),{id:s,size:c,showEmail:o,className:l}=n,r=c===void 0?"xs":c,d=o===void 0?!1:o,{data:f,isLoading:i,isError:u}=Lt(s);if(i){let p;e[0]!==l?(p=Oe("flex items-center gap-2",l),e[0]=l,e[1]=p):p=e[1];let a;e[2]!==r?(a=t.jsx(Me.Skeleton,{shape:"circle",size:r}),e[2]=r,e[3]=a):a=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=b):b=e[4];let j;e[5]!==d?(j=d&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=d,e[6]=j):j=e[6];let C;e[7]!==j?(C=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,j]}),e[7]=j,e[8]=C):C=e[8];let _;return e[9]!==p||e[10]!==a||e[11]!==C?(_=t.jsxs("div",{className:p,children:[a,C]}),e[9]=p,e[10]=a,e[11]=C,e[12]=_):_=e[12],_}if(u||!f){let p;e[13]!==l?(p=Oe("flex items-center gap-2",l),e[13]=l,e[14]=p):p=e[14];let a;e[15]!==r?(a=t.jsx(Me,{shape:"circle",size:r,fallback:"?",muted:!0}),e[15]=r,e[16]=a):a=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=b):b=e[17];let j;return e[18]!==p||e[19]!==a?(j=t.jsxs("div",{className:p,children:[a,b]}),e[18]=p,e[19]=a,e[20]=j):j=e[20],j}let g;e[21]!==l?(g=Oe("flex items-center gap-2",l),e[21]=l,e[22]=g):g=e[22];const h=f.image??void 0;let m;e[23]!==r||e[24]!==h||e[25]!==f.name?(m=t.jsx(Me,{shape:"circle",size:r,url:h,fallback:f.name}),e[23]=r,e[24]=h,e[25]=f.name,e[26]=m):m=e[26];let x;e[27]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[27]=f.name,e[28]=x):x=e[28];let y;e[29]!==d||e[30]!==f.email?(y=d&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[29]=d,e[30]=f.email,e[31]=y):y=e[31];let v;e[32]!==x||e[33]!==y?(v=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[32]=x,e[33]=y,e[34]=v):v=e[34];let N;return e[35]!==g||e[36]!==m||e[37]!==v?(N=t.jsxs("div",{className:g,children:[m,v]}),e[35]=g,e[36]=m,e[37]=v,e[38]=N):N=e[38],N}const Rt=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Vt(n){return Object.keys(n).find(e=>Rt.includes(e.toLowerCase()))}function st(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function qt(n){const e=ne.c(32),{data:s,schema:c,viewMode:o,onViewModeChange:l,search:r,sortKey:d,sortDirection:f,onSort:i,actions:u,onItemClick:g,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:v,sortableFields:N}=n,p=l===void 0?Qt:l,a=f===void 0?"asc":f,b=i===void 0?Jt:i;let j;e[0]!==u?(j=u===void 0?{}:u,e[0]=u,e[1]=j):j=e[1];const C=j,_=g===void 0?Ht:g,D=h===void 0?null:h,P=m===void 0?null:m,E=x===void 0?!1:x,A=y===void 0?void 0:y,I=v===void 0?!1:v,S=N===void 0?void 0:N;let M;e[2]!==A||e[3]!==c||e[4]!==S?(M=A?A.filter(Wt).filter(O=>!S||S.includes(O.id)).map(Gt):st(c,S),e[2]=A,e[3]=c,e[4]=S,e[5]=M):M=e[5];const k=M;let z;e[6]!==D||e[7]!==I||e[8]!==b||e[9]!==p||e[10]!==a||e[11]!==d||e[12]!==k||e[13]!==o?(z=!I&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:D}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Ve,{viewMode:o,onViewModeChange:p,sortKey:d,sortDirection:a,onSort:b,sortOptions:k})})]})}),e[6]=D,e[7]=I,e[8]=b,e[9]=p,e[10]=a,e[11]=d,e[12]=k,e[13]=o,e[14]=z):z=e[14];let T;e[15]!==C||e[16]!==A||e[17]!==s||e[18]!==P||e[19]!==_||e[20]!==b||e[21]!==E||e[22]!==c||e[23]!==r||e[24]!==a||e[25]!==d||e[26]!==S||e[27]!==o?(T=o==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(O=>t.jsx("div",{onClick:()=>_?.(O),className:"cursor-pointer h-full",children:t.jsx(Mt,{item:O,schema:c,readOnly:E,actions:C})},O.id))})}):t.jsx(gt,{columns:Zt(A,c,S,C),data:s,sortKey:d,sortDirection:a,onSort:b,onRowClick:_,emptyState:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}),e[15]=C,e[16]=A,e[17]=s,e[18]=P,e[19]=_,e[20]=b,e[21]=E,e[22]=c,e[23]=r,e[24]=a,e[25]=d,e[26]=S,e[27]=o,e[28]=T):T=e[28];let $;return e[29]!==z||e[30]!==T?($=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[z,T]}),e[29]=z,e[30]=T,e[31]=$):$=e[31],$}function Gt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Wt(n){return n.sortable!==!1}function Ht(){}function Jt(){}function Qt(){}function Yt(n){return{id:"actions",header:"",render:e=>t.jsxs(Ge,{children:[t.jsx(We,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(He,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Xe,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ye,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Je,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function it(n){const e=n.type;return Array.isArray(e)?e.every(s=>it({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Xt(n,e){const s=n.properties||{},c=Object.keys(s).filter(i=>{const u=s[i];return u&&it(u)}),o=Vt(s),l=[],r=new Set;o&&c.includes(o)&&(l.push(o),r.add(o));const d=["title","description","updated_at","updated_by"];for(const i of d)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));const f=c.filter(i=>!r.has(i)&&!Re.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of f)l.push(i),r.add(i);for(const i of Re)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));return l.map(i=>{const u=s[i],g=e?e.includes(i):!["id"].includes(i);return i===o?{id:i,header:"",render:h=>{const m=h[i];return t.jsx(qe,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:g,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx(Bt,{id:String(m),size:"xs"}):"—"},sortable:g,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:g,cellClassName:"max-w-[200px]"}})}function Zt(n,e,s,c){const o=n||Xt(e,s);return o.some(d=>d.id==="actions")?o:Object.keys(c).length>0?[...o,Yt(c)]:o}function As(n){const e=ne.c(118),{connectionId:s,org:c,activeCollection:o}=n,l=o.name,r=o.schema??wt,d=o.hasCreateTool,f=o.hasUpdateTool,i=o.hasDeleteTool,u=at(),h=ct().location.href,{data:m}=dt.useSession(),x=m?.user?.id||"unknown",y=Nt(s),{org:v}=et();let N;e[0]!==s||e[1]!==v.id?(N={connectionId:s,orgId:v.id},e[0]=s,e[1]=v.id,e[2]=N):N=e[2];const p=tt(N),a=bt(s,l,p),b=`${s}-${l}`;let j;e[3]!==c||e[4]!==b?(j={namespace:c,resource:b,defaultSortKey:"updated_at"},e[3]=c,e[4]=b,e[5]=j):j=e[5];const{search:C,searchTerm:_,setSearch:D,viewMode:P,setViewMode:E,sortKey:A,sortDirection:I,handleSort:S}=xt(j);let M;e[6]!==_||e[7]!==I||e[8]!==A?(M={searchTerm:_,sortKey:A,sortDirection:I},e[6]=_,e[7]=I,e[8]=A,e[9]=M):M=e[9];const k=yt(s,l,p,M),z=!d&&!f&&!i;let T;e[10]!==l||e[11]!==s||e[12]!==u||e[13]!==c?(T=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:w.id}})},e[10]=l,e[11]=s,e[12]=u,e[13]=c,e[14]=T):T=e[14];const $=T;let O;e[15]!==a.create||e[16]!==x?(O=async w=>{const he=new Date().toISOString();await a.create.mutateAsync({...w,id:Ue("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[15]=a.create,e[16]=x,e[17]=O):O=e[17];const xe=O,[K,ge]=mt.useState(null);let le;e[18]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{ge(w)},e[18]=le):le=e[18];const ot=le;let U;e[19]!==$||e[20]!==f?(U=f&&{edit:$},e[19]=$,e[20]=f,e[21]=U):U=e[21];let L;e[22]!==xe||e[23]!==d?(L=d&&{duplicate:xe},e[22]=xe,e[23]=d,e[24]=L):L=e[24];let B;e[25]!==i?(B=i&&{delete:ot},e[25]=i,e[26]=B):B=e[26];let re;e[27]!==B||e[28]!==U||e[29]!==L?(re={...U,...L,...B},e[27]=B,e[28]=U,e[29]=L,e[30]=re):re=e[30];const je=re;let ae;e[31]!==a.delete||e[32]!==K?(ae=async()=>{K&&(await a.delete.mutateAsync(K.id),ge(null))},e[31]=a.delete,e[32]=K,e[33]=ae):ae=e[33];const Ce=ae;let ce;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==d||e[38]!==u||e[39]!==c||e[40]!==x?(ce=async()=>{if(!d){ft.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ue("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const ze=await a.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:ze.id}})}catch(ze){console.error("Failed to create item:",ze)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=d,e[38]=u,e[39]=c,e[40]=x,e[41]=ce):ce=e[41];const ve=ce;let de;e[42]!==r?(de=st(r),e[42]=r,e[43]=de):de=e[43];const be=de,Fe=(k?.length??0)>0,nt=d&&Fe,lt=d&&!Fe&&!C;let me;e[44]!==a.create||e[45]!==ve||e[46]!==d?(me=d?t.jsxs(ke,{onClick:ve,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=ve,e[46]=d,e[47]=me):me=e[47];const Ke=me,ye=A;let R;e[48]!==S||e[49]!==E||e[50]!==I||e[51]!==be||e[52]!==ye||e[53]!==P?(R=t.jsx(Ve,{viewMode:P,onViewModeChange:E,sortKey:ye,sortDirection:I,onSort:S,sortOptions:be}),e[48]=S,e[49]=E,e[50]=I,e[51]=be,e[52]=ye,e[53]=P,e[54]=R):R=e[54];const Ne=`${l}s`,we=y?.icon??"grid_view";let V;e[55]!==Ne||e[56]!==we||e[57]!==h?(V=t.jsx(vt,{title:Ne,url:h,icon:we}),e[55]=Ne,e[56]=we,e[57]=h,e[58]=V):V=e[58];const Se=nt&&Ke;let q;e[59]!==R||e[60]!==V||e[61]!==Se?(q=t.jsxs(zt,{children:[R,V,Se]}),e[59]=R,e[60]=V,e[61]=Se,e[62]=q):q=e[62];const _e=`Search ${l}...`;let G;e[63]!==D?(G=w=>{w.key==="Escape"&&(D(""),w.target.blur())},e[63]=D,e[64]=G):G=e[64];let W;e[65]!==C||e[66]!==D||e[67]!==_e||e[68]!==G?(W=t.jsx(ut,{value:C,onChange:D,placeholder:_e,onKeyDown:G}),e[65]=C,e[66]=D,e[67]=_e,e[68]=G,e[69]=W):W=e[69];let H;e[70]!==k?(H=k??[],e[70]=k,e[71]=H):H=e[71];const De=A;let J;e[72]!==$?(J=w=>$(w),e[72]=$,e[73]=J):J=e[73];const Ae="No items found",Ie=C?"Try adjusting your search terms":"This collection doesn't have any items yet.",Pe=lt?Ke:void 0;let Q;e[74]!==Ae||e[75]!==Ie||e[76]!==Pe?(Q=t.jsx(ht,{image:null,title:Ae,description:Ie,actions:Pe}),e[74]=Ae,e[75]=Ie,e[76]=Pe,e[77]=Q):Q=e[77];let Y;e[78]!==S||e[79]!==z||e[80]!==je||e[81]!==r||e[82]!==C||e[83]!==D||e[84]!==E||e[85]!==I||e[86]!==H||e[87]!==De||e[88]!==J||e[89]!==Q||e[90]!==P?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(qt,{hideToolbar:!0,data:H,schema:r,viewMode:P,onViewModeChange:E,search:C,onSearchChange:D,sortKey:De,sortDirection:I,onSort:S,actions:je,onItemClick:J,readOnly:z,emptyState:Q})}),e[78]=S,e[79]=z,e[80]=je,e[81]=r,e[82]=C,e[83]=D,e[84]=E,e[85]=I,e[86]=H,e[87]=De,e[88]=J,e[89]=Q,e[90]=P,e[91]=Y):Y=e[91];let X;e[92]!==W||e[93]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[92]=W,e[93]=Y,e[94]=X):X=e[94];const Te=!!K;let fe;e[95]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||ge(null)},e[95]=fe):fe=e[95];let ue;e[96]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Dt,{children:"Delete item?"}),e[96]=ue):ue=e[96];const $e=K?.title;let Z;e[97]!==$e?(Z=t.jsxs(At,{children:[ue,t.jsxs(It,{children:['Are you sure you want to delete "',$e,'"? This action cannot be undone.']})]}),e[97]=$e,e[98]=Z):Z=e[98];let ee;e[99]!==a.delete.isPending?(ee=t.jsx(St,{disabled:a.delete.isPending,children:"Cancel"}),e[99]=a.delete.isPending,e[100]=ee):ee=e[100];const Ee=a.delete.isPending?"Deleting...":"Delete";let te;e[101]!==a.delete.isPending||e[102]!==Ce||e[103]!==Ee?(te=t.jsx(_t,{onClick:Ce,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[101]=a.delete.isPending,e[102]=Ce,e[103]=Ee,e[104]=te):te=e[104];let se;e[105]!==ee||e[106]!==te?(se=t.jsxs(Pt,{children:[ee,te]}),e[105]=ee,e[106]=te,e[107]=se):se=e[107];let ie;e[108]!==Z||e[109]!==se?(ie=t.jsxs(Tt,{children:[Z,se]}),e[108]=Z,e[109]=se,e[110]=ie):ie=e[110];let oe;e[111]!==Te||e[112]!==ie?(oe=t.jsx($t,{open:Te,onOpenChange:fe,children:ie}),e[111]=Te,e[112]=ie,e[113]=oe):oe=e[113];let pe;return e[114]!==q||e[115]!==X||e[116]!==oe?(pe=t.jsxs(t.Fragment,{children:[q,X,oe]}),e[114]=q,e[115]=X,e[116]=oe,e[117]=pe):pe=e[117],pe}export{As as C};
@@ -1 +0,0 @@
1
- import{c as q,j as o,e as H,b8 as X,r as Q,u as ce,f as ae,bi as le}from"./index-BqaxN2xC.js";import{E as G,I as Y}from"./empty-state-D96Y5HBy.js";import{E as Z}from"./error-boundary-B-AbkEzN.js";import{b as me}from"./use-binding-B4CdGd_R.js";import{u as de,S as ue}from"./index-DZba6oBj.js";import{u as pe}from"./virtual-mcp-CoYEAnoS.js";import{d as fe}from"./use-collections-oaTV6V1V.js";import{b as J,u as he}from"./use-connection-BC3zltzG.js";import{u as xe}from"./constants-C56YODyA.js";import{useMCPPromptsListQuery as ge,useMCPResourcesListQuery as be}from"./index-DNsNPBek.js";import{B as je}from"./button-CEYz4vVv.js";import{R as ye}from"./resource-tabs-CXTSNkut.js";import{i as ee}from"./Loading01-Da3G3uHv.js";import{V as te,a as Se,b as Ce}from"./layout-D-OU3f8P.js";import{C as ve}from"./collection-tab-B7nFFfRR.js";import{C as oe}from"./collection-display-button-DnLs8bVk.js";import{C as se}from"./collection-search-BtYrCrPa.js";import{C as ne}from"./collection-table-wrapper-qsmwllrX.js";import{P as re}from"./pin-to-sidebar-button-S58VyRdL.js";import{C as ie}from"./card-Czj8cnsu.js";import{R as Ne,T as Te}from"./tools-list-BeRMZtG9.js";import"./binder-oimq46F2.js";import"./mcp-oauth-Cf6g90Vj.js";import"./env-vars-editor-BvlIX34u.js";import"./input-lyCEJ-v7.js";import"./Plus-C8Yk0Byt.js";import"./Trash01-DsqSsyPF.js";import"./File06-CB-q8MUQ.js";import"./Key01-B_LfAqq6.js";import"./badge-DfcjklCU.js";import"./form-BuxG1-zn.js";import"./select-DGKcOybq.js";import"./tooltip-DzrZ9wCu.js";import"./Check-CCn5GCwg.js";import"./ChevronDown-YbVVQVLg.js";import"./extract-connection-data-xYQXXnta.js";import"./constants-DFc-Xc3W.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-Byyd88f7.js";import"./generate-id-Dyweu44Y.js";import"./CpuChip02-yUWdNp1P.js";import"./Terminal-sjkm0kJR.js";import"./use-virtual-mcp-DsllWo9H.js";import"./Grid01-CPA-Um40.js";import"./index-BaKebp2o.js";import"./index-B7TTLamD.js";import"./index-B1uX_6ZJ.js";import"./X-8Mftq7jS.js";import"./monaco-editor-DGUxTU96.js";import"./infiniteQueryObserver-93EeshRP.js";import"./spinner-CwB0mUYA.js";import"./localstorage-keys-ONdhlVrj.js";import"./useQuery-Czw6cUjK.js";import"./useMutation-Cwf-gT4m.js";import"./popover-DJUBm9Y-.js";import"./Image01-CNk-r4qX.js";import"./SearchMd-DFqFsfr3.js";import"./dialog-Cur3bgyn.js";import"./AlertCircle-B4xqDHbG.js";import"./ArrowUp-CLiwYXs0.js";import"./Edit01-B_nUJxlr.js";import"./Copy01-CjY-NlSc.js";import"./use-create-virtual-mcp-Cj9oL1-p.js";import"./ArrowLeft-BlDPaWrc.js";import"./dropdown-menu-DRvXtcX1.js";import"./DotsVertical-Dp-gx6mF.js";import"./use-list-state-CUj2Pms0.js";import"./use-mobile-BYgIoeGI.js";import"./empty-state-B52GWMyA.js";import"./Inbox01-By8bLcOc.js";import"./avatar-qY1FecOi.js";import"./alert-dialog-CP6Si-sS.js";import"./List-d67v1RYc.js";import"./view-mode-toggle-Ba3TLRo6.js";import"./use-organization-settings-DYLZDPKB.js";function we(t){const e=q.c(42),{prompts:n,connectionId:s,org:r,connectionTitle:d,connectionIcon:l,onPromptClick:b,showToolbar:T,emptyMessage:E}=t,I=T===void 0?!0:T,R=E===void 0?"This connection doesn't have any prompts yet.":E,u=H(),x=X().location.href,[j,f]=Q.useState(""),[g,i]=Q.useState("table"),[p,w]=Q.useState("name"),[m,D]=Q.useState("asc");let V;e[0]!==m||e[1]!==p?(V=h=>{p===h?(D(_e),m==="desc"&&w(void 0)):(w(h),D("asc"))},e[0]=m,e[1]=p,e[2]=V):V=e[2];const v=V;let k;e[3]!==s||e[4]!==u||e[5]!==b||e[6]!==r?(k=h=>{b?b(h):s&&r&&u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:r,connectionId:s,collectionName:"prompts",itemId:encodeURIComponent(h.name)}})},e[3]=s,e[4]=u,e[5]=b,e[6]=r,e[7]=k):k=e[7];const _=k;let $;if(e[8]!==n||e[9]!==j||e[10]!==m||e[11]!==p){const h=!n||n.length===0?[]:j.trim()?(()=>{const K=j.toLowerCase();return n.filter(B=>B.name.toLowerCase().includes(K)||B.description&&B.description.toLowerCase().includes(K))})():n;$=!p||!m?h:[...h].sort((K,B)=>{const F=K[p]||"",U=B[p]||"",W=String(F).localeCompare(String(U));return m==="asc"?W:-W}),e[8]=n,e[9]=j,e[10]=m,e[11]=p,e[12]=$}else $=e[12];const N=$;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=[{id:"name",header:"Name",render:ke,sortable:!0},{id:"description",header:"Description",render:Re,cellClassName:"flex-1",sortable:!0}],e[13]=O):O=e[13];const L=O;let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=L.filter(Ie).map($e),e[14]=a):a=e[14];const A=a;let y;e[15]!==l||e[16]!==d||e[17]!==v||e[18]!==I||e[19]!==m||e[20]!==p||e[21]!==x||e[22]!==g?(y=I&&o.jsxs(te,{children:[o.jsx(oe,{viewMode:g,onViewModeChange:i,sortKey:p,sortDirection:m,onSort:v,sortOptions:A}),o.jsx(re,{title:d?`${d}: Prompts`:"Prompts",url:x,icon:l??"description"})]}),e[15]=l,e[16]=d,e[17]=v,e[18]=I,e[19]=m,e[20]=p,e[21]=x,e[22]=g,e[23]=y):y=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[24]=S):S=e[24];let C;e[25]!==j?(C=o.jsx(se,{value:j,onChange:f,placeholder:"Search prompts...",onKeyDown:S}),e[25]=j,e[26]=C):C=e[26];let c;e[27]!==R||e[28]!==_||e[29]!==v||e[30]!==j||e[31]!==m||e[32]!==p||e[33]!==N||e[34]!==g?(c=g==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?o.jsx(G,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":R}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(h=>o.jsx(ie,{className:"cursor-pointer transition-colors",onClick:()=>_(h),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Y,{icon:null,name:h.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h.description||"No description"})]})]})},h.name))})}):o.jsx(ne,{columns:L,data:N,isLoading:!1,sortKey:p,sortDirection:m,onSort:v,onRowClick:h=>_(h),emptyState:o.jsx(G,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":R})}),e[27]=R,e[28]=_,e[29]=v,e[30]=j,e[31]=m,e[32]=p,e[33]=N,e[34]=g,e[35]=c):c=e[35];let P;e[36]!==C||e[37]!==c?(P=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[C,c]}),e[36]=C,e[37]=c,e[38]=P):P=e[38];let M;return e[39]!==P||e[40]!==y?(M=o.jsxs(o.Fragment,{children:[y,P]}),e[39]=P,e[40]=y,e[41]=M):M=e[41],M}function $e(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ie(t){return t.sortable}function Re(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function ke(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function _e(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Le(t){const e=q.c(6),{prompts:n,connectionId:s,org:r}=t,d=J(s),l=d?.title,b=d?.icon;let T;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==b?(T=o.jsx(we,{prompts:n,connectionId:s,org:r,connectionTitle:l,connectionIcon:b}),e[0]=s,e[1]=r,e[2]=n,e[3]=l,e[4]=b,e[5]=T):T=e[5],T}function Pe(t){const e=q.c(2),{repository:n}=t;let s;return e[0]!==n?(s=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Ne,{repository:n})}),e[0]=n,e[1]=s):s=e[1],s}function Me(t){const e=q.c(39),{resources:n,connectionTitle:s,connectionIcon:r,onResourceClick:d,showToolbar:l,emptyMessage:b}=t,T=l===void 0?!0:l,E=b===void 0?"This connection doesn't have any resources yet.":b,R=X().location.href,[u,z]=Q.useState(""),[x,j]=Q.useState("table"),[f,g]=Q.useState("name"),[i,p]=Q.useState("asc");let w;e[0]!==i||e[1]!==f?(w=c=>{f===c?(p(Ue),i==="desc"&&g(void 0)):(g(c),p("asc"))},e[0]=i,e[1]=f,e[2]=w):w=e[2];const m=w;let D;e[3]!==d?(D=c=>{d&&d(c)},e[3]=d,e[4]=D):D=e[4];const V=D;let v;if(e[5]!==n||e[6]!==u||e[7]!==i||e[8]!==f){const c=!n||n.length===0?[]:u.trim()?(()=>{const P=u.toLowerCase();return n.filter(M=>M.uri.toLowerCase().includes(P)||M.name&&M.name.toLowerCase().includes(P)||M.description&&M.description.toLowerCase().includes(P))})():n;v=!f||!i?c:[...c].sort((P,M)=>{const h=P[f]||"",K=M[f]||"",B=String(h).localeCompare(String(K));return i==="asc"?B:-B}),e[5]=n,e[6]=u,e[7]=i,e[8]=f,e[9]=v}else v=e[9];const k=v;let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=[{id:"name",header:"Name",render:Be,sortable:!0},{id:"uri",header:"URI",render:Oe,sortable:!0},{id:"description",header:"Description",render:De,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ee,sortable:!0}],e[10]=_):_=e[10];const $=_;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=$.filter(Ae).map(Ve),e[11]=N):N=e[11];const O=N;let L;e[12]!==r||e[13]!==s||e[14]!==m||e[15]!==T||e[16]!==i||e[17]!==f||e[18]!==R||e[19]!==x?(L=T&&o.jsxs(te,{children:[o.jsx(oe,{viewMode:x,onViewModeChange:j,sortKey:f,sortDirection:i,onSort:m,sortOptions:O}),o.jsx(re,{title:s?`${s}: Resources`:"Resources",url:R,icon:r??"folder"})]}),e[12]=r,e[13]=s,e[14]=m,e[15]=T,e[16]=i,e[17]=f,e[18]=R,e[19]=x,e[20]=L):L=e[20];let a;e[21]===Symbol.for("react.memo_cache_sentinel")?(a=c=>{c.key==="Escape"&&(z(""),c.target.blur())},e[21]=a):a=e[21];let A;e[22]!==u?(A=o.jsx(se,{value:u,onChange:z,placeholder:"Search resources...",onKeyDown:a}),e[22]=u,e[23]=A):A=e[23];let y;e[24]!==E||e[25]!==V||e[26]!==m||e[27]!==u||e[28]!==i||e[29]!==f||e[30]!==k||e[31]!==x?(y=x==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?o.jsx(G,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":E}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:k.map(c=>o.jsx(ie,{className:"cursor-pointer transition-colors",onClick:()=>V(c),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Y,{icon:null,name:c.name||c.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:c.name||c.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:c.uri}),c.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:c.description})]})]})},c.uri))})}):o.jsx(ne,{columns:$,data:k,isLoading:!1,sortKey:f,sortDirection:i,onSort:m,onRowClick:c=>V(c),emptyState:o.jsx(G,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":E})}),e[24]=E,e[25]=V,e[26]=m,e[27]=u,e[28]=i,e[29]=f,e[30]=k,e[31]=x,e[32]=y):y=e[32];let S;e[33]!==A||e[34]!==y?(S=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[A,y]}),e[33]=A,e[34]=y,e[35]=S):S=e[35];let C;return e[36]!==S||e[37]!==L?(C=o.jsxs(o.Fragment,{children:[L,S]}),e[36]=S,e[37]=L,e[38]=C):C=e[38],C}function Ve(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ae(t){return t.sortable}function Ee(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function De(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Oe(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function Be(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Ue(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Ke(t){const e=q.c(6),{resources:n,connectionId:s,org:r}=t,d=J(s),l=d?.title,b=d?.icon;let T;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==b?(T=o.jsx(Me,{resources:n,connectionId:s,org:r,connectionTitle:l,connectionIcon:b}),e[0]=s,e[1]=r,e[2]=n,e[3]=l,e[4]=b,e[5]=T):T=e[5],T}function ze(t){const e=q.c(5),{tools:n,connectionId:s,org:r,isLoading:d}=t;let l;return e[0]!==s||e[1]!==d||e[2]!==r||e[3]!==n?(l=o.jsx(Te,{tools:n,connectionId:s,org:r,isLoading:d}),e[0]=s,e[1]=d,e[2]=r,e[3]=n,e[4]=l):l=e[4],l}function Qe(t){const e=q.c(66),{connection:n,connectionId:s,org:r,requestedTabId:d,collections:l,onUpdate:b,isUpdating:T,prompts:E,resources:I,tools:R,isLoadingTools:u}=t,z=le();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={from:"/$org/mcps/$connectionId"},e[0]=x):x=e[0];const j=H(x);let f;e[1]!==s?(f={connectionId:s},e[1]=s,e[2]=f):f=e[2];const g=de(f),i=g.isAuthenticated,p=n?.metadata?.repository,w=!!p?.url,m=R.length,D=E.length,V=I.length,v=m>0||u;let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k={id:"settings",label:"Settings"},e[3]=k):k=e[3];let _;e[4]!==u||e[5]!==i||e[6]!==v||e[7]!==m?(_=i&&v?[{id:"tools",label:"Tools",count:u?void 0:m}]:[],e[4]=u,e[5]=i,e[6]=v,e[7]=m,e[8]=_):_=e[8];let $;e[9]!==i||e[10]!==D?($=i&&D>0?[{id:"prompts",label:"Prompts",count:D}]:[],e[9]=i,e[10]=D,e[11]=$):$=e[11];let N;e[12]!==i||e[13]!==V?(N=i&&V>0?[{id:"resources",label:"Resources",count:V}]:[],e[12]=i,e[13]=V,e[14]=N):N=e[14];let O;if(e[15]!==l||e[16]!==w||e[17]!==i||e[18]!==_||e[19]!==$||e[20]!==N){let U;e[22]!==w?(U=w?[{id:"readme",label:"README"}]:[],e[22]=w,e[23]=U):U=e[23],O=[k,..._,...$,...N,...i?(l||[]).map(qe):[],...U],e[15]=l,e[16]=w,e[17]=i,e[18]=_,e[19]=$,e[20]=N,e[21]=O}else O=e[21];const L=O,a=L.some(U=>U.id===d)?d:"settings";let A;e[24]!==j?(A=U=>{j({search:W=>({...W,tab:U}),replace:!0})},e[24]=j,e[25]=A):A=e[25];const y=A;let S;e[26]!==l?(S=l||[],e[26]=l,e[27]=S):S=e[27];let C;if(e[28]!==a||e[29]!==S){let U;e[31]!==a?(U=W=>W.name===a,e[31]=a,e[32]=U):U=e[32],C=S.find(U),e[28]=a,e[29]=S,e[30]=C}else C=e[30];const c=C;let P;e[33]!==z.history?(P=()=>z.history.back(),e[33]=z.history,e[34]=P):P=e[34];let M;e[35]!==a||e[36]!==y||e[37]!==L?(M=o.jsx(Se,{children:o.jsx(ye,{tabs:L,activeTab:a,onTabChange:y})}),e[35]=a,e[36]=y,e[37]=L,e[38]=M):M=e[38];let h;e[39]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ee,{size:32,className:"animate-spin text-muted-foreground"})}),e[39]=h):h=e[39];let K;e[40]!==c||e[41]!==a||e[42]!==g.hasOAuthToken||e[43]!==g.isServerError||e[44]!==g.supportsOAuth||e[45]!==n||e[46]!==s||e[47]!==y||e[48]!==w||e[49]!==u||e[50]!==i||e[51]!==T||e[52]!==b||e[53]!==r||e[54]!==E||e[55]!==p||e[56]!==I||e[57]!==R?(K=o.jsx(Q.Suspense,{fallback:h,children:a==="tools"?o.jsx(ze,{tools:R,connectionId:s,org:r,isLoading:u}):a==="prompts"?o.jsx(Le,{prompts:E,connectionId:s,org:r}):a==="resources"?o.jsx(Ke,{resources:I,connectionId:s,org:r}):a==="settings"?o.jsx(ue,{connection:n,onUpdate:b,isUpdating:T,isMCPAuthenticated:i,supportsOAuth:g.supportsOAuth,hasOAuthToken:g.hasOAuthToken,isServerError:g.isServerError,onViewReadme:w?()=>y("readme"):void 0}):a==="readme"&&w?o.jsx(Pe,{repository:p}):c&&i?o.jsx(ve,{connectionId:s,org:r,activeCollection:c},a):o.jsx(G,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[40]=c,e[41]=a,e[42]=g.hasOAuthToken,e[43]=g.isServerError,e[44]=g.supportsOAuth,e[45]=n,e[46]=s,e[47]=y,e[48]=w,e[49]=u,e[50]=i,e[51]=T,e[52]=b,e[53]=r,e[54]=E,e[55]=p,e[56]=I,e[57]=R,e[58]=K):K=e[58];let B;e[59]!==a||e[60]!==K?(B=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(Z,{children:K},a)})}),e[59]=a,e[60]=K,e[61]=B):B=e[61];let F;return e[62]!==P||e[63]!==M||e[64]!==B?(F=o.jsxs(Ce,{onBack:P,children:[M,B]}),e[62]=P,e[63]=M,e[64]=B,e[65]=F):F=e[65],F}function qe(t){return{id:t.name,label:t.displayName}}function Fe(){const t=q.c(43);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const n=H(e);let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId"},t[1]=s):s=t[1];const{connectionId:r,org:d}=ce(s),{org:l}=pe();let b;t[2]===Symbol.for("react.memo_cache_sentinel")?(b={from:"/shell/$org/mcps/$connectionId"},t[2]=b):b=t[2];const E=ae(b).tab||"settings",I=J(r),R=he(),u=me(I??void 0);let z;t[3]!==r||t[4]!==l.id?(z={connectionId:r,orgId:l.id},t[3]=r,t[4]=l.id,t[5]=z):z=t[5];const x=xe(z);let j;t[6]!==x?(j={client:x},t[6]=x,t[7]=j):j=t[7];const{data:f}=ge(j);let g;t[8]!==x?(g={client:x},t[8]=x,t[9]=g):g=t[9];const{data:i}=be(g),p=I?.tools&&I.tools.length>0,w=!p;let m;t[10]!==x||t[11]!==w?(m={client:x,enabled:w},t[10]=x,t[11]=w,t[12]=m):m=t[12];const{data:D,isLoading:V}=fe(m);let v;t[13]!==f?.prompts?(v=f?.prompts??[],t[13]=f?.prompts,t[14]=v):v=t[14];let k;t[15]!==v?(k=v.map(He),t[15]=v,t[16]=k):k=t[16];const _=k;let $;t[17]!==i?.resources?($=i?.resources??[],t[17]=i?.resources,t[18]=$):$=t[18];let N;t[19]!==$?(N=$.map(Ge),t[19]=$,t[20]=N):N=t[20];const O=N;let L;t[21]!==I||t[22]!==p||t[23]!==D?.tools?(L=p?I.tools??[]:(D?.tools??[]).map(We),t[21]=I,t[22]=p,t[23]=D?.tools,t[24]=L):L=t[24];const a=L;let A;t[25]!==R.update||t[26]!==r?(A=async C=>{await R.update.mutateAsync({id:r,data:C})},t[25]=R.update,t[26]=r,t[27]=A):A=t[27];const y=A;if(!I){let C;return t[28]!==n||t[29]!==d?(C=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(G,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(je,{variant:"outline",onClick:()=>n({to:"/$org/mcps",params:{org:d}}),children:"Back to connections"})})}),t[28]=n,t[29]=d,t[30]=C):C=t[30],C}let S;return t[31]!==R.update.isPending||t[32]!==u||t[33]!==I||t[34]!==r||t[35]!==y||t[36]!==V||t[37]!==d||t[38]!==_||t[39]!==E||t[40]!==O||t[41]!==a?(S=o.jsx(Qe,{org:d,connection:I,connectionId:r,requestedTabId:E,collections:u,onUpdate:y,isUpdating:R.update.isPending,prompts:_,resources:O,tools:a,isLoadingTools:V}),t[31]=R.update.isPending,t[32]=u,t[33]=I,t[34]=r,t[35]=y,t[36]=V,t[37]=d,t[38]=_,t[39]=E,t[40]=O,t[41]=a,t[42]=S):S=t[42],S}function We(t){return{name:t.name,description:t.description,inputSchema:t.inputSchema}}function Ge(t){return{uri:t.uri,name:t.name,description:t.description}}function He(t){return{name:t.name,description:t.description}}function Je(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Z,{children:o.jsx(Q.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(ee,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(Fe,{})})}),t[0]=e):e=t[0],e}function jo(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Je,{}),t[0]=e):e=t[0],e}export{jo as default};
@@ -1 +0,0 @@
1
- import{c as ge,j as e,r as B,e as xe,f as je,d as fe,g as ye,b as ve,a as _e,o as se,h as Ce,s as y,_ as ke}from"./index-BqaxN2xC.js";import{C as Ne}from"./collection-header-BKBivTdh.js";import{C as Se}from"./collection-page-BQnr3vxz.js";import{C as we}from"./collection-search-BtYrCrPa.js";import{C as De}from"./collection-table-wrapper-qsmwllrX.js";import{C as be}from"./connection-card-BmrG8yB6.js";import{n as O,E as H,I as Te}from"./empty-state-D96Y5HBy.js";import{E as Pe}from"./error-boundary-B-AbkEzN.js";import{u as Ie}from"./use-binding-B4CdGd_R.js";import{u as Ve,s as Q}from"./use-list-state-CUj2Pms0.js";import{u as $e}from"./virtual-mcp-CoYEAnoS.js";import{u as Ae}from"./use-collections-oaTV6V1V.js";import{u as Ee,a as Fe}from"./use-connection-BC3zltzG.js";import{u as Oe}from"./constants-C56YODyA.js";import{f as He,a as Me,b as Be,c as ze,d as Re,e as Ue,A as Xe,g as Le}from"./alert-dialog-CP6Si-sS.js";import{B as We}from"./badge-DfcjklCU.js";import{B as _}from"./button-CEYz4vVv.js";import{D as Ke,a as Ge,b as qe,c as Ye,d as Qe,e as Je}from"./dialog-Cur3bgyn.js";import{D as J,a as Z,b as ee,c as $}from"./dropdown-menu-DRvXtcX1.js";import{a as Ze,F as h,b as g,c as x,d as j,f}from"./form-BuxG1-zn.js";import{i as te}from"./DotsVertical-Dp-gx6mF.js";import{f as et,e as tt,s as M}from"./registry-utils-Byyd88f7.js";import{i as nt}from"./Loading01-Da3G3uHv.js";import{i as ot}from"./Terminal-sjkm0kJR.js";import{s as ne}from"./Trash01-DsqSsyPF.js";import{I as k}from"./input-lyCEJ-v7.js";import{S as st,a as rt,b as it,c as at,d as P}from"./select-DGKcOybq.js";import{T as ct}from"./textarea-CphdD9q0.js";import{g as lt}from"./generate-id-Dyweu44Y.js";import{i as dt,r as ut,E as mt,e as re}from"./env-vars-editor-BvlIX34u.js";import"./collection-display-button-DnLs8bVk.js";import"./ArrowUp-CLiwYXs0.js";import"./Check-CCn5GCwg.js";import"./Grid01-CPA-Um40.js";import"./List-d67v1RYc.js";import"./tooltip-DzrZ9wCu.js";import"./view-mode-toggle-Ba3TLRo6.js";import"./SearchMd-DFqFsfr3.js";import"./card-Czj8cnsu.js";import"./binder-oimq46F2.js";import"./use-mobile-BYgIoeGI.js";import"./useMutation-Cwf-gT4m.js";import"./useQuery-Czw6cUjK.js";import"./X-8Mftq7jS.js";import"./ChevronDown-YbVVQVLg.js";import"./Plus-C8Yk0Byt.js";const pt=se({key:y(),value:y()}),ht=se({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:ke(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:Ce(pt).optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function E(n){const s=n.trim();if(!s)return"";try{const i=new URL(s),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return s.replace(/\/+$/,"")}}function gt(n){const s=n.trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;const i=s[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const m=s.slice(1).find(a=>!a.startsWith("-"));return m?{packageName:m}:null}function A(n){const{uiType:s}=n,i=E(n.connectionUrl??"");if((s==="HTTP"||s==="SSE"||s==="Websocket")&&i===E("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(n.npxPackage??"").trim();return s==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function oe(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const s=E(n.connectionUrl??"");if(!s)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>E(N.url??"")===s));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",m=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:m}:null}function xt(n,s){const i={command:"npx",args:["-y",n]},d=re(s);return Object.keys(d).length>0&&(i.envVars=d),i}function jt(n,s,i,d){const m={command:n};s.trim()&&(m.args=s.trim().split(/\s+/)),i?.trim()&&(m.cwd=i.trim());const a=re(d);return Object.keys(a).length>0&&(m.envVars=a),m}function ft(n){return n.command==="npx"}function yt(n){return n.args?.find(s=>!s.startsWith("-"))??""}function vt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function _t(n,s){switch(s.type){case"edit":return{mode:"editing",connection:s.connection};case"delete":return{mode:"deleting",connection:s.connection};case"close":return{mode:"idle"}}}function Ct(){const{org:n}=$e(),s=xe(),i=je({strict:!1}),{data:d}=fe.useSession(),{stdioEnabled:m}=ye(),a=Ve({namespace:n.slug,resource:"connections"}),I=Ee(),N=Fe(a),[v,S]=B.useReducer(_t,{mode:"idle"}),z=Ie(N)[0],R=z?.id??"",U=et(z?.tools),ie=Oe({connectionId:R||null,orgId:n.id}),{data:ae}=Ae({client:ie,toolName:U,toolArguments:{limit:200},enabled:!!(R&&U),staleTime:3600*1e3,select:t=>t.structuredContent??t}),X=tt(ae??[]),L=i.action==="create",ce=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},W=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{}})},r=ve({resolver:_e(ht),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),K=r.watch("connection_url"),le=r.watch("npx_package"),b=A({uiType:u,connectionUrl:K??"",npxPackage:le??""})??oe({uiType:u,connectionUrl:K??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;B.useEffect(()=>{if(l){const t=dt(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const o=ut(t.envVars);if(ft(t)){const c=yt(t);r.reset({title:l.title,description:l.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const c=vt(t);r.reset({title:l.title,description:l.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:o})}}else r.reset({title:l.title,description:l.description,ui_type:l.connection_type,connection_url:l.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[l,r]);const de=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;S({type:"close"});try{await I.delete.mutateAsync(t)}catch{}},ue=async t=>{let o,c=null,w=null,C=null;if(t.ui_type==="NPX"?(o="STDIO",c="",C=xt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",c="",C=jt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,c=t.connection_url||"",w=t.connection_token||null),l){await I.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:c,...w&&{connection_token:w},...C&&{connection_headers:C}}}),S({type:"close"}),r.reset();return}const D=lt("conn");await I.create.mutateAsync({id:D,title:t.title,description:t.description||null,connection_type:o,connection_url:c,connection_token:w,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),W(),r.reset(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:D}})},G=t=>{t||(L?W():S({type:"close"}),r.reset())},V=t=>{const o=t.trim();if(!o)return;const c=!!r.formState.dirtyFields.title,w=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,D=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!w&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const q=r.getValues("env_vars")??[],he=new Set(q.map(T=>T.key)),Y=p.envVarKeys.filter(T=>!he.has(T));Y.length>0&&r.setValue("env_vars",[...q,...Y.map(T=>({key:T,value:""}))],{shouldDirty:!0})}},F=gt(o);if(F&&m){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",F.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),D(A({uiType:"NPX",npxPackage:F.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),D(A({uiType:p,connectionUrl:o})??oe({uiType:p,connectionUrl:o,registryItems:X}));return}u==="NPX"&&D(A({uiType:"NPX",npxPackage:o}))},me=[{id:"icon",header:"",render:t=>e.jsx(Te,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(O,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:t=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-sm font-medium",children:t.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:t=>{const o=t.connection_url??"",c=o.length>40?`${o.slice(0,40)}...`:o;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:t=>e.jsx(We,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs($,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Open"]}),e.jsxs($,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],pe=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:ce,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(Se,{children:[e.jsx(Ke,{open:L||v.mode==="editing",onOpenChange:G,children:e.jsxs(Ge,{className:"sm:max-w-[525px]",children:[e.jsxs(qe,{children:[e.jsx(Ye,{children:l?"Edit Connection":"Create Connection"}),e.jsx(Qe,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Ze,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(ue),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Type *"}),e.jsxs(st,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(rt,{children:e.jsx(it,{})})}),e.jsxs(at,{children:[e.jsx(P,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(P,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(P,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"Websocket"]})}),m&&e.jsxs(e.Fragment,{children:[e.jsx(P,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(P,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ot,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),u==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Working Directory"}),e.jsx(j,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(f,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(mt,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:b?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:b?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),b?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[b.token.helperText,b.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Description"}),e.jsx(j,{children:e.jsx(ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(Je,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(He,{open:v.mode==="deleting",onOpenChange:t=>!t&&S({type:"close"}),children:e.jsxs(Me,{children:[e.jsxs(Be,{children:[e.jsx(ze,{children:"Delete Connection?"}),e.jsxs(Re,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(Ue,{children:[e.jsx(Xe,{children:"Cancel"}),e.jsx(Le,{onClick:de,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(Ne,{title:"Connections",viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:pe}),e.jsx(we,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(be,{connection:t,fallbackIcon:e.jsx(O,{}),onClick:()=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs($,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Open"]}),e.jsxs($,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx(De,{columns:me,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})]})}function xn(){const n=ge.c(1);let s;return n[0]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(Pe,{children:e.jsx(B.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(nt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ct,{})})}),n[0]=s):s=n[0],s}export{xn as default};
@@ -1 +0,0 @@
1
- import{t,B as a}from"./index-BqaxN2xC.js";const e=t(a,{target:"draft-7"});export{e as B};
@@ -1 +0,0 @@
1
- import{u as S,d as _,j as t,aC as j,r as f,aD as b,c as N,aE as L}from"./index-BqaxN2xC.js";import{i as p}from"./Loading01-Da3G3uHv.js";import{c as P}from"./binder-oimq46F2.js";import{u as I,L as H}from"./localstorage-keys-ONdhlVrj.js";import{u as w}from"./virtual-mcp-CoYEAnoS.js";import{a as k}from"./use-connection-BC3zltzG.js";import{u as z}from"./constants-C56YODyA.js";import"./useQuery-Czw6cUjK.js";import"./useMutation-Cwf-gT4m.js";import"./use-collections-oaTV6V1V.js";function B(e,r){return e?e.filter(a=>P(a,r)):[]}function y(e){return{id:e.id,title:e.title,icon:e.icon,description:e.description,app_name:e.app_name,app_id:e.app_id,tools:e.tools,metadata:e.metadata}}function O({binding:e,renderHeader:r,renderEmptyState:a}){const{org:s}=w(),{pluginId:n}=S({strict:!1}),d=k(),{data:o}=_.useSession(),l=B(d,e),[i,m]=I(H.pluginConnection(s.slug,n),c=>c??""),u=l.find(c=>c.id===i)??l[0]??null,x=o?.user?{user:{id:o.user.id,name:o.user.name,email:o.user.email,image:o.user.image}}:null,g={id:s.id,slug:s.slug,name:s.name};if(l.length===0||!u){const c={connectionId:null,connection:null,toolCaller:null,org:g,session:x};return t.jsx(j,{value:c,children:t.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:a()})})}const h=z({connectionId:u.id,orgId:s.id}),v={connectionId:u.id,connection:y(u),toolCaller:((c,E)=>h?h.callTool({name:c,arguments:E}).then(C=>C.structuredContent??C):Promise.reject(new Error("MCP client is not available"))),org:g,session:x};return t.jsx(j,{value:v,children:t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[r({connections:l.map(y),selectedConnectionId:u.id,onConnectionChange:m}),t.jsx("div",{className:"flex-1 overflow-hidden",children:t.jsx(f.Suspense,{fallback:t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(p,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:t.jsx(b,{})})})]})})}function J(){const e=N.c(12);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const{pluginId:a}=S(r);let s;e[1]!==a?(s=L.find(i=>i.id===a),e[1]=a,e[2]=s):s=e[2];const n=s;if(n?.renderHeader&&n?.renderEmptyState){let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(p,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=i):i=e[3];let m;return e[4]!==n.binding||e[5]!==n.renderEmptyState||e[6]!==n.renderHeader?(m=t.jsx(f.Suspense,{fallback:i,children:t.jsx(O,{binding:n.binding,renderHeader:n.renderHeader,renderEmptyState:n.renderEmptyState})}),e[4]=n.binding,e[5]=n.renderEmptyState,e[6]=n.renderHeader,e[7]=m):m=e[7],m}const d=n?.LayoutComponent;if(!d){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(b,{}),e[8]=i):i=e[8],i}let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(p,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[9]=o):o=e[9];let l;return e[10]!==d?(l=t.jsx(f.Suspense,{fallback:o,children:t.jsx(d,{})}),e[10]=d,e[11]=l):l=e[11],l}export{J as default};
@@ -1 +0,0 @@
1
- import{o as f,_ as V,h as k,s as t,a2 as j,a3 as d,a4 as x,a5 as R,c as W,j as c}from"./index-BqaxN2xC.js";import{B as H}from"./button-CEYz4vVv.js";import{I as N}from"./input-lyCEJ-v7.js";import{s as O}from"./Plus-C8Yk0Byt.js";import{s as U}from"./Trash01-DsqSsyPF.js";const L=f({authorizationEndpoint:t().url(),tokenEndpoint:t().url(),introspectionEndpoint:t().url().optional(),clientId:t(),clientSecret:t().optional(),scopes:k(t()),grantType:V(["authorization_code","client_credentials"])}),B=f({title:t().optional(),readOnlyHint:j().optional(),destructiveHint:j().optional(),idempotentHint:j().optional(),openWorldHint:j().optional()}),K=f({name:t(),description:t().optional(),inputSchema:d(t(),x()),outputSchema:d(t(),x()).optional(),annotations:B.optional(),_meta:d(t(),x()).optional()}),$=f({headers:d(t(),t()).optional()}),q=f({command:t().describe("Command to run (e.g., 'npx', 'node')"),args:k(t()).optional().describe("Command arguments"),cwd:t().optional().describe("Working directory"),envVars:d(t(),t()).optional().describe("Environment variables (encrypted in storage)")}),z=f({id:t().describe("Unique identifier for the connection"),title:t().describe("Human-readable name for the connection"),created_at:t().describe("When the connection was created"),updated_at:t().describe("When the connection was last updated"),created_by:t().describe("User ID who created the connection"),updated_by:t().optional().describe("User ID who last updated the connection"),organization_id:t().describe("Organization ID this connection belongs to"),description:t().nullable().describe("Description of the connection"),icon:t().nullable().describe("Icon URL for the connection"),app_name:t().nullable().describe("Associated app name"),app_id:t().nullable().describe("Associated app ID"),connection_type:V(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:t().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:t().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:R([q,$]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:L.nullable().describe("OAuth configuration"),configuration_state:d(t(),x()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:k(t()).nullable().optional().describe("Configuration scopes"),metadata:d(t(),x()).nullable().describe("Additional metadata (includes repository info)"),tools:k(K).nullable().describe("Discovered tools from MCP"),bindings:k(t()).nullable().describe("Detected bindings"),status:V(["active","inactive","error"]).describe("Current status")});z.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});z.partial();function Y(o){return o!=null&&"command"in o}function Z(o){return!o||!o.startsWith("virtual://")?null:o.replace("virtual://","")}function M(o){const e=o.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function ee(o){const e=W.c(34),{value:n,onChange:i,keyPlaceholder:A,valuePlaceholder:l,className:I}=o,_=A===void 0?"VARIABLE_NAME":A,b=l===void 0?"value...":l;let w;e[0]!==i||e[1]!==n?(w=()=>{i([...n,{key:"",value:""}])},e[0]=i,e[1]=n,e[2]=w):w=e[2];const D=w;let S;e[3]!==i||e[4]!==n?(S=r=>{i(n.filter((u,a)=>a!==r))},e[3]=i,e[4]=n,e[5]=S):S=e[5];const g=S;let C;e[6]!==i||e[7]!==n?(C=(r,u)=>{const a=[...n],s=a[r];s&&(a[r]={key:u,value:s.value},i(a))},e[6]=i,e[7]=n,e[8]=C):C=e[8];const v=C;let T;e[9]!==i||e[10]!==n?(T=(r,u)=>{const a=[...n],s=a[r];s&&(a[r]={key:s.key,value:u},i(a))},e[9]=i,e[10]=n,e[11]=T):T=e[11];const y=T;let p;if(e[12]!==v||e[13]!==g||e[14]!==y||e[15]!==_||e[16]!==n||e[17]!==b){let r;e[19]!==v||e[20]!==g||e[21]!==y||e[22]!==_||e[23]!==b?(r=(u,a)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(N,{placeholder:_,value:u.key,onChange:s=>v(a,s.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(N,{type:M(u.key)?"password":"text",placeholder:b,value:u.value,onChange:s=>y(a,s.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(a),children:c.jsx(U,{size:16})})]},a),e[19]=v,e[20]=g,e[21]=y,e[22]=_,e[23]=b,e[24]=r):r=e[24],p=n.map(r),e[12]=v,e[13]=g,e[14]=y,e[15]=_,e[16]=n,e[17]=b,e[18]=p}else p=e[18];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(O,{size:16,className:"mr-1"}),e[25]=E):E=e[25];let h;e[26]!==D?(h=c.jsxs(H,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:D,children:[E,"Add Environment Variable"]}),e[26]=D,e[27]=h):h=e[27];let m;e[28]!==p||e[29]!==h?(m=c.jsxs("div",{className:"flex flex-col gap-2",children:[p,h]}),e[28]=p,e[29]=h,e[30]=m):m=e[30];let P;return e[31]!==I||e[32]!==m?(P=c.jsx("div",{className:I,children:m}),e[31]=I,e[32]=m,e[33]=P):P=e[33],P}function te(o){const e={};for(const{key:n,value:i}of o)n.trim()&&(e[n.trim()]=i);return e}function ne(o){return o?Object.entries(o).map(([e,n])=>({key:e,value:n})):[]}export{ee as E,te as e,Y as i,Z as p,ne as r};
@@ -1 +0,0 @@
1
- import{aH as V,aL as C,aI as K,aQ as z,Q as _,E as W,aR as X,aS as Y,r as p,aT as Z,aU as $,aV as J,aM as ee,aW as k,aX as I,aY as se,aZ as te,a_ as re,a6 as oe,j as m,a$ as ae,aa as g,a9 as O,b0 as ne,ab as w,b1 as Q,ad as ie,ai as A,ap as ue,aq as ce}from"./index-BqaxN2xC.js";function P(r,s){const t=new Set(s);return r.filter(o=>!t.has(o))}function de(r,s,t){const o=r.slice(0);return o[s]=t,o}var le=class extends V{#r;#e;#o;#a;#s;#t;#n;#i;#u=[];constructor(r,s,t){super(),this.#r=r,this.#a=t,this.#o=[],this.#s=[],this.#e=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(s=>{this.#p(r,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,s){this.#o=r,this.#a=s,C.batch(()=>{const t=this.#s,o=this.#l(this.#o);this.#u=o,o.forEach(i=>i.observer.setOptions(i.defaultedQueryOptions));const e=o.map(i=>i.observer),a=e.map(i=>i.getCurrentResult()),n=t.length!==e.length,c=e.some((i,d)=>i!==t[d]),l=n||c,v=l?!0:a.some((i,d)=>{const b=this.#e[d];return!b||!K(i,b)});!l&&!v||(l&&(this.#s=e),this.#e=a,this.hasListeners()&&(l&&(P(t,e).forEach(i=>{i.destroy()}),P(e,t).forEach(i=>{i.subscribe(d=>{this.#p(i,d)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,s){const t=this.#l(r),o=t.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[o,e=>this.#d(e??o,s),()=>this.#c(o,t)]}#c(r,s){return s.map((t,o)=>{const e=r[o];return t.defaultedQueryOptions.notifyOnChangeProps?e:t.observer.trackResult(e,a=>{s.forEach(n=>{n.observer.trackProp(a)})})})}#d(r,s){return s?((!this.#t||this.#e!==this.#i||s!==this.#n)&&(this.#n=s,this.#i=this.#e,this.#t=z(this.#t,s(r))),this.#t):r}#l(r){const s=new Map;this.#s.forEach(o=>{const e=o.options.queryHash;if(!e)return;const a=s.get(e);a?a.push(o):s.set(e,[o])});const t=[];return r.forEach(o=>{const e=this.#r.defaultQueryOptions(o),n=s.get(e.queryHash)?.shift()??new _(this.#r,e);t.push({defaultedQueryOptions:e,observer:n})}),t}#p(r,s){const t=this.#s.indexOf(r);t!==-1&&(this.#e=de(this.#e,t,s),this.#h())}#h(){if(this.hasListeners()){const r=this.#t,s=this.#c(this.#e,this.#u),t=this.#d(s,this.#a?.combine);r!==t&&C.batch(()=>{this.listeners.forEach(o=>{o(this.#e)})})}}};function Ce({queries:r,...s},t){const o=W(t),e=X(),a=Y(),n=p.useMemo(()=>r.map(u=>{const f=o.defaultQueryOptions(u);return f._optimisticResults=e?"isRestoring":"optimistic",f}),[r,o,e]);n.forEach(u=>{Z(u),$(u,a)}),J(a);const[c]=p.useState(()=>new le(o,n,s)),[l,v,i]=c.getOptimisticResult(n,s.combine),d=!e&&s.subscribed!==!1;p.useSyncExternalStore(p.useCallback(u=>d?c.subscribe(C.batchCalls(u)):ee,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setQueries(n,s)},[n,s,c]);const h=l.some((u,f)=>k(n[f],u))?l.flatMap((u,f)=>{const y=n[f];if(y){const x=new _(o,y);if(k(y,u))return I(y,x,a);se(u,e)&&I(y,x,a)}return[]}):[];if(h.length>0)throw Promise.all(h);const R=l.find((u,f)=>{const y=n[f];return y&&te({result:u,errorResetBoundary:a,throwOnError:y.throwOnError,query:o.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(R?.error)throw R.error;return v(i())}var S="Radio",[pe,M]=A(S),[he,fe]=pe(S),G=p.forwardRef((r,s)=>{const{__scopeRadio:t,name:o,checked:e=!1,required:a,disabled:n,value:c="on",onCheck:l,form:v,...i}=r,[d,b]=p.useState(null),h=O(s,f=>b(f)),R=p.useRef(!1),u=d?v||!!d.closest("form"):!0;return m.jsxs(he,{scope:t,checked:e,disabled:n,children:[m.jsx(g.button,{type:"button",role:"radio","aria-checked":e,"data-state":L(e),"data-disabled":n?"":void 0,disabled:n,value:c,...i,ref:h,onClick:w(r.onClick,f=>{e||l?.(),u&&(R.current=f.isPropagationStopped(),R.current||f.stopPropagation())})}),u&&m.jsx(q,{control:d,bubbles:!R.current,name:o,value:c,checked:e,required:a,disabled:n,form:v,style:{transform:"translateX(-100%)"}})]})});G.displayName=S;var j="RadioIndicator",N=p.forwardRef((r,s)=>{const{__scopeRadio:t,forceMount:o,...e}=r,a=fe(j,t);return m.jsx(ie,{present:o||a.checked,children:m.jsx(g.span,{"data-state":L(a.checked),"data-disabled":a.disabled?"":void 0,...e,ref:s})})});N.displayName=j;var Re="RadioBubbleInput",q=p.forwardRef(({__scopeRadio:r,control:s,checked:t,bubbles:o=!0,...e},a)=>{const n=p.useRef(null),c=O(n,a),l=ue(t),v=ce(s);return p.useEffect(()=>{const i=n.current;if(!i)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==t&&h){const R=new Event("click",{bubbles:o});h.call(i,t),i.dispatchEvent(R)}},[l,t,o]),m.jsx(g.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...e,tabIndex:-1,ref:c,style:{...e.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});q.displayName=Re;function L(r){return r?"checked":"unchecked"}var ve=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],E="RadioGroup",[be]=A(E,[Q,M]),D=Q(),B=M(),[me,ye]=be(E),T=p.forwardRef((r,s)=>{const{__scopeRadioGroup:t,name:o,defaultValue:e,value:a,required:n=!1,disabled:c=!1,orientation:l,dir:v,loop:i=!0,onValueChange:d,...b}=r,h=D(t),R=re(v),[u,f]=oe({prop:a,defaultProp:e??null,onChange:d,caller:E});return m.jsx(me,{scope:t,name:o,required:n,disabled:c,value:u,onValueChange:f,children:m.jsx(ae,{asChild:!0,...h,orientation:l,dir:R,loop:i,children:m.jsx(g.div,{role:"radiogroup","aria-required":n,"aria-orientation":l,"data-disabled":c?"":void 0,dir:R,...b,ref:s})})})});T.displayName=E;var F="RadioGroupItem",U=p.forwardRef((r,s)=>{const{__scopeRadioGroup:t,disabled:o,...e}=r,a=ye(F,t),n=a.disabled||o,c=D(t),l=B(t),v=p.useRef(null),i=O(s,v),d=a.value===e.value,b=p.useRef(!1);return p.useEffect(()=>{const h=u=>{ve.includes(u.key)&&(b.current=!0)},R=()=>b.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",R),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",R)}},[]),m.jsx(ne,{asChild:!0,...c,focusable:!n,active:d,children:m.jsx(G,{disabled:n,required:a.required,checked:d,...l,...e,name:a.name,ref:i,onCheck:()=>a.onValueChange(e.value),onKeyDown:w(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:w(e.onFocus,()=>{b.current&&v.current?.click()})})})});U.displayName=F;var ge="RadioGroupIndicator",H=p.forwardRef((r,s)=>{const{__scopeRadioGroup:t,...o}=r,e=B(t);return m.jsx(N,{...e,...o,ref:s})});H.displayName=ge;var we=T,Oe=U,Se=H;export{Oe as I,we as R,Se as a,Ce as u};
@@ -1 +0,0 @@
1
- import{C as d,L as q,O as x,P as O,V as E,i as A,p as Q,u as V}from"./virtual-mcp-CoYEAnoS.js";import{b as _,c as I,a as v,e as F,f as h,u as $,d as j}from"./use-collections-oaTV6V1V.js";import{b as G,u as U,a as H}from"./use-connection-BC3zltzG.js";import{K as l,e as y}from"./constants-C56YODyA.js";import{S as N,W as Y,c as k,b as z,g as B,d as X,a as Z,u as ee}from"./constants-C56YODyA.js";import{c as u,i as m}from"./index-BqaxN2xC.js";import{u as c}from"./useQuery-Czw6cUjK.js";import{b as se,a as re,u as ie}from"./use-virtual-mcp-DsllWo9H.js";import"./useMutation-Cwf-gT4m.js";async function C(r){return r.getServerCapabilities()?.resources?await r.listResources():{resources:[]}}async function g(r,e){return await r.readResource({uri:e})}function S(r){const e=u.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=l.mcpResourcesList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>C(t),e[5]=t,e[6]=o):o=e[6];const n=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==n?(a={...s,queryKey:i,queryFn:o,staleTime:n,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=n,e[11]=a):a=e[11],c(a)}async function p(r){return r.getServerCapabilities()?.prompts?await r.listPrompts():{prompts:[]}}async function T(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function L(r){const e=u.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=l.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>p(t),e[5]=t,e[6]=o):o=e[6];const n=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==n?(a={...s,queryKey:i,queryFn:o,staleTime:n,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=n,e[11]=a):a=e[11],m(a)}function R(r){const e=u.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=l.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>p(t),e[5]=t,e[6]=o):o=e[6];const n=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==n?(a={...s,queryKey:i,queryFn:o,staleTime:n,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=n,e[11]=a):a=e[11],c(a)}export{d as ConnectionEntitySchema,l as KEYS,q as Locator,x as ORG_ADMIN_PROJECT_SLUG,O as ProjectContextProvider,N as SELF_MCP_ALIAS_ID,y as StreamableHTTPClientTransport,E as VirtualMCPEntitySchema,Y as WellKnownOrgMCPId,k as createMCPClient,T as getPrompt,z as getWellKnownCommunityRegistryConnection,B as getWellKnownMcpStudioConnection,X as getWellKnownOpenRouterConnection,Z as getWellKnownRegistryConnection,A as isStdioParameters,p as listPrompts,C as listResources,Q as parseVirtualUrl,g as readResource,_ as useCollectionActions,I as useCollectionItem,v as useCollectionList,G as useConnection,U as useConnectionActions,H as useConnections,ee as useMCPClient,L as useMCPPromptsList,R as useMCPPromptsListQuery,S as useMCPResourcesListQuery,F as useMCPToolCall,h as useMCPToolCallMutation,$ as useMCPToolCallQuery,j as useMCPToolsListQuery,V as useProjectContext,se as useVirtualMCP,re as useVirtualMCPActions,ie as useVirtualMCPs};