decocms 2.292.2 → 2.293.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/dist/client/assets/{AlertCircle-De2C9wZC.js → AlertCircle-DnJbX_0w.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-bSu4Kz2F.js → ArrowNarrowLeft-M9-X6Sxy.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-DT3QLsvt.js → ArrowUpRight-BQK-oA7E.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-BIi7toDZ.js → CheckCircle-BTDGGZJo.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-DmIUGcFl.js → ChevronDown-D098IDk9.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-CIh2nJ4L.js → ChevronRight-DIr3-XeU.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-BYOoc7wr.js → ChevronUp-qt4sL4uC.js} +1 -1
  8. package/dist/client/assets/{Container-BerLGLgK.js → Container-BvdKvtbe.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-CDho1dav.js → DotsVertical-DGFUAKYN.js} +1 -1
  10. package/dist/client/assets/{LinkExternal01-CcTNZj2P.js → LinkExternal01-CS_vTEL0.js} +1 -1
  11. package/dist/client/assets/{Lock01-B-vCOiSg.js → Lock01-DepQhBci.js} +1 -1
  12. package/dist/client/assets/{Palette-CqW3vcqn.js → Palette-SeD4BOqL.js} +1 -1
  13. package/dist/client/assets/{Play-CrdOw1Iv.js → Play-B2WhNMxb.js} +1 -1
  14. package/dist/client/assets/{Plus-Zv0hv0Vg.js → Plus-6a_0gFD5.js} +1 -1
  15. package/dist/client/assets/{RefreshCcw01-COL3SGLi.js → RefreshCcw01-CmGHOB_j.js} +1 -1
  16. package/dist/client/assets/{SearchMd-BjteSZXQ.js → SearchMd-B4RJoOIR.js} +1 -1
  17. package/dist/client/assets/{Settings02-w5kxVqcK.js → Settings02-86F4b3dQ.js} +1 -1
  18. package/dist/client/assets/{Shield01-DodcxEya.js → Shield01-CzaXyqoU.js} +1 -1
  19. package/dist/client/assets/{Star01-BhFELsp4.js → Star01-BsL_E8DX.js} +1 -1
  20. package/dist/client/assets/{Sun-DY_ADcda.js → Sun-CoYtwe4c.js} +1 -1
  21. package/dist/client/assets/{Tool01-B5mm7tYF.js → Tool01-Cxeqfwwz.js} +1 -1
  22. package/dist/client/assets/{Trash01-DuRnWn1E.js → Trash01-Crqeojj8.js} +1 -1
  23. package/dist/client/assets/{User01-CQoJwY3u.js → User01-lfQ-qZIG.js} +1 -1
  24. package/dist/client/assets/{Users03-DfcHW1oz.js → Users03-BEcIfaLP.js} +1 -1
  25. package/dist/client/assets/{X-Bgfd1eh0.js → X-DSm8Y-S-.js} +1 -1
  26. package/dist/client/assets/{XCircle-DUufUsoh.js → XCircle-D0NNu2cU.js} +1 -1
  27. package/dist/client/assets/{XClose-BQJEwJET.js → XClose-8tp9nQPE.js} +1 -1
  28. package/dist/client/assets/{Zap-CDLB-lxK.js → Zap-GnwBp_Qp.js} +1 -1
  29. package/dist/client/assets/{ZapSquare-BFGlmWLE.js → ZapSquare-DgxRVJjy.js} +1 -1
  30. package/dist/client/assets/accordion-CJq3HBrS.js +1 -0
  31. package/dist/client/assets/agent-icon-DxobcFDr.js +1 -0
  32. package/dist/client/assets/agents-list-eEeKypKu.js +1 -0
  33. package/dist/client/assets/ai-providers-D_bgIPsh.js +1 -0
  34. package/dist/client/assets/{alert-dialog-rItivTOb.js → alert-dialog-CscciHzk.js} +2 -2
  35. package/dist/client/assets/{auth-catchall-BGNYNNAk.js → auth-catchall-DZZidYw0.js} +1 -1
  36. package/dist/client/assets/{automation-list-row-lCQuQb2Q.js → automation-list-row-Br_pkbGs.js} +1 -1
  37. package/dist/client/assets/automations-Ch3eQvio.js +1 -0
  38. package/dist/client/assets/{avatar-UVBUP_wG.js → avatar-BQ09Qk0Z.js} +1 -1
  39. package/dist/client/assets/{badge-nX1O9Qf1.js → badge-Clg4Tzdw.js} +1 -1
  40. package/dist/client/assets/brand-context-DZl3n4iE.js +1 -0
  41. package/dist/client/assets/{card-B6kxnNb0.js → card-DUOq7Rl6.js} +1 -1
  42. package/dist/client/assets/chat-context-CfrtTY3a.js +31 -0
  43. package/dist/client/assets/{checkbox-CTi7T5x-.js → checkbox-D2GZcsVt.js} +1 -1
  44. package/dist/client/assets/collection-detail-ChjtG6Ga.js +1 -0
  45. package/dist/client/assets/collection-display-button-BZwsY1Wv.js +1 -0
  46. package/dist/client/assets/{collection-search-BVB_BOr-.js → collection-search-CzSQR8Hb.js} +1 -1
  47. package/dist/client/assets/{collection-search-DHiaU-oT.js → collection-search-DW3g3zGc.js} +1 -1
  48. package/dist/client/assets/{collection-table-wrapper-Cqd6KCzo.js → collection-table-wrapper-B84Op-Zk.js} +1 -1
  49. package/dist/client/assets/{collection-tabs-CczYJtOJ.js → collection-tabs-DVyOXsXh.js} +1 -1
  50. package/dist/client/assets/{collections-Czgjy6V_.js → collections-CzE8C7FB.js} +1 -1
  51. package/dist/client/assets/{command-C1riJax0.js → command-ChcvD0z3.js} +1 -1
  52. package/dist/client/assets/{connection-card-MQF8JSkw.js → connection-card-C2vEoZIt.js} +1 -1
  53. package/dist/client/assets/connection-detail-BGY9VwYa.js +1 -0
  54. package/dist/client/assets/connection-form-helpers-CgA-QNzF.js +1 -0
  55. package/dist/client/assets/connections-DRgi7C4U.js +1 -0
  56. package/dist/client/assets/{constants-CMKJaZow.js → constants-CrD_AMxD.js} +1 -1
  57. package/dist/client/assets/{constants-puxzW8Tt.js → constants-nJzh8CYx.js} +2 -2
  58. package/dist/client/assets/{dialog-CAwNCLeY.js → dialog-CVDAkUpR.js} +1 -1
  59. package/dist/client/assets/domain-settings-ClmaftJG.js +1 -0
  60. package/dist/client/assets/{drawer-Co7qhpAL.js → drawer-CFg3CiQr.js} +1 -1
  61. package/dist/client/assets/dropdown-menu-gP2-wJTw.js +1 -0
  62. package/dist/client/assets/dynamic-plugin-layout-DZA29J1C.js +1 -0
  63. package/dist/client/assets/{empty-state-DIogXxVN.js → empty-state-C2PUUqhT.js} +1 -1
  64. package/dist/client/assets/{empty-state-Bio4MAFs.js → empty-state-CPpC79-7.js} +1 -1
  65. package/dist/client/assets/{extract-connection-data-BFIbyEiI.js → extract-connection-data-5g73Imwy.js} +1 -1
  66. package/dist/client/assets/features-CeA9UMCz.js +1 -0
  67. package/dist/client/assets/form-yPmbpUVF.js +1 -0
  68. package/dist/client/assets/general-CX6-dTKZ.js +1 -0
  69. package/dist/client/assets/index-B3vDeqTk.js +1 -0
  70. package/dist/client/assets/{index-DFoLVe7P.js → index-BYM0cbyk.js} +3 -3
  71. package/dist/client/assets/{index-BiFex3ig.js → index-BdUJIICa.js} +1 -1
  72. package/dist/client/assets/index-BzSFWy5-.js +189 -0
  73. package/dist/client/assets/index-C3hSkh4S.js +1 -0
  74. package/dist/client/assets/index-CXbGCxBV.js +547 -0
  75. package/dist/client/assets/{index-mWgQ602E.js → index-CfanpUI7.js} +3 -3
  76. package/dist/client/assets/{index-BhZeUpb1.js → index-CqrrK0SQ.js} +1 -1
  77. package/dist/client/assets/{index-DcnXzgrr.js → index-CsTWePfc.js} +1 -1
  78. package/dist/client/assets/index-DImBkhtD.js +1 -0
  79. package/dist/client/assets/index-Dbs2wH7N.js +1 -0
  80. package/dist/client/assets/index-DkZMRzTR.js +1 -0
  81. package/dist/client/assets/index-Dkaetwrr.js +142 -0
  82. package/dist/client/assets/{index-DdEYcoGw.js → index-Dlk19fTc.js} +1 -1
  83. package/dist/client/assets/index-b9vWbQjO.js +1 -0
  84. package/dist/client/assets/{index-C4KOdiuW.js → index-gKZjkMnf.js} +26 -26
  85. package/dist/client/assets/{infiniteQueryObserver-DS8PEXT3.js → infiniteQueryObserver-B9PWohpE.js} +1 -1
  86. package/dist/client/assets/{input-DrxCctpM.js → input-Cet4kRAV.js} +1 -1
  87. package/dist/client/assets/{integration-icon-B-ypwxt-.js → integration-icon-BYjt2zM8.js} +1 -1
  88. package/dist/client/assets/{label-qumw5kFa.js → label-CaWfIbuT.js} +1 -1
  89. package/dist/client/assets/layout-BgwHTi9m.js +1 -0
  90. package/dist/client/assets/lean-canvas-recruit-modal-CNtMOKiS.js +116 -0
  91. package/dist/client/assets/{login-zoPe2LeA.js → login-DDBhfkxa.js} +1 -1
  92. package/dist/client/assets/{members-BrCn_crL.js → members-CpZry3vM.js} +1 -1
  93. package/dist/client/assets/{monaco-editor-C80vYwBa.js → monaco-editor-D2GSkzL1.js} +1 -1
  94. package/dist/client/assets/{monitoring-stats-row-DoiRCC4f.js → monitoring-stats-row-B9-AgFrN.js} +1 -1
  95. package/dist/client/assets/{oauth-callback-CNmuoGWl.js → oauth-callback-ZTQDmTMI.js} +1 -1
  96. package/dist/client/assets/{oauth-callback-ai-provider-CsQrJZmR.js → oauth-callback-ai-provider-Gd1uARX2.js} +1 -1
  97. package/dist/client/assets/{onboarding-C7clLSW8.js → onboarding-8fDDt_RN.js} +1 -1
  98. package/dist/client/assets/{org-layout-BmM2YD3_.js → org-layout-Bw77z4Sw.js} +1 -1
  99. package/dist/client/assets/org-plugin-layout-BIXLREf_.js +1 -0
  100. package/dist/client/assets/{task-status-DhB__zcV.js → pair-CSF6pLZy.js} +40 -40
  101. package/dist/client/assets/plugin-empty-state-D452cObw.js +1 -0
  102. package/dist/client/assets/plugin-header-DesRdhcy.js +1 -0
  103. package/dist/client/assets/{plugin-layout-BZBMQxU7.js → plugin-layout-cW34W41Y.js} +1 -1
  104. package/dist/client/assets/{popover-BdnMz9At.js → popover-dpRZqzOJ.js} +1 -1
  105. package/dist/client/assets/profile-AXVJhA8D.js +1 -0
  106. package/dist/client/assets/project-app-view-C0WWCGe_.js +1 -0
  107. package/dist/client/assets/registry-91e7KTfr.js +2 -0
  108. package/dist/client/assets/{registry-layout-DF08kMn2.js → registry-layout-DWruz43b.js} +1 -1
  109. package/dist/client/assets/required-auth-layout-DVgyyuV-.js +1 -0
  110. package/dist/client/assets/{reset-password-KFV68Ks-.js → reset-password-jjqpZRxZ.js} +1 -1
  111. package/dist/client/assets/roles-Bf8vBKyU.js +1 -0
  112. package/dist/client/assets/scroll-area-CH9Vosbx.js +1 -0
  113. package/dist/client/assets/{search-input-CbSuDoZL.js → search-input-BTdLweUR.js} +1 -1
  114. package/dist/client/assets/select-B6R2tTSM.js +1 -0
  115. package/dist/client/assets/{select-model-BLp2y3cG.js → select-model-BMdrDFa3.js} +1 -1
  116. package/dist/client/assets/settings-layout-CnrVmFqe.js +1 -0
  117. package/dist/client/assets/{settings-section-CKsKmGWh.js → settings-section-Z9FmAPIg.js} +1 -1
  118. package/dist/client/assets/shell-layout-DaB5J-du.js +1 -0
  119. package/dist/client/assets/{skeleton-BKGbLlxs.js → skeleton-BhVqr-eG.js} +1 -1
  120. package/dist/client/assets/sso-DZJw-CAn.js +1 -0
  121. package/dist/client/assets/store-D-L6Gt6i.js +1 -0
  122. package/dist/client/assets/store-registry-DdZCk03l.js +2 -0
  123. package/dist/client/assets/{switch-DNv5M4ZB.js → switch-D_DqyrYW.js} +1 -1
  124. package/dist/client/assets/{table-CaLu-Lo8.js → table-D1_6e_tY.js} +1 -1
  125. package/dist/client/assets/{tabs-Ds3m3VsK.js → tabs-Bu_QsdLq.js} +1 -1
  126. package/dist/client/assets/task-status-DKnoaN0K.js +1 -0
  127. package/dist/client/assets/{textarea-D8dnqUDV.js → textarea-BPX5qWaA.js} +1 -1
  128. package/dist/client/assets/{toggle-group-DiaVR0jE.js → toggle-group-BJxlfhsN.js} +1 -1
  129. package/dist/client/assets/tools-list-CjPOU8GA.js +1 -0
  130. package/dist/client/assets/tooltip-DlUl6zVU.js +1 -0
  131. package/dist/client/assets/{types-Cj_XQKsH.js → types-CUVoLk-m.js} +6 -6
  132. package/dist/client/assets/{use-ai-providers-CiKg1J6I.js → use-ai-providers-CKSasQTP.js} +1 -1
  133. package/dist/client/assets/{use-collections-BgcKlAB6.js → use-collections-DKaygmj-.js} +1 -1
  134. package/dist/client/assets/{use-connection-D0OofLda.js → use-connection-DLwIHVYP.js} +1 -1
  135. package/dist/client/assets/{use-copy-DU9Tefqq.js → use-copy-CLL1wnsg.js} +1 -1
  136. package/dist/client/assets/use-create-virtual-mcp-B693GvUD.js +1 -0
  137. package/dist/client/assets/{use-decopilot-events-ClmBUkq4.js → use-decopilot-events-NXGOEGvZ.js} +1 -1
  138. package/dist/client/assets/{use-delete-connection-D8siAEqJ.js → use-delete-connection-DN8HxHVx.js} +1 -1
  139. package/dist/client/assets/{use-infinite-scroll-8BgvLQv0.js → use-infinite-scroll-B32XN73V.js} +1 -1
  140. package/dist/client/assets/{use-list-state-BEoAeszV.js → use-list-state-Cwr5OloB.js} +1 -1
  141. package/dist/client/assets/{use-mcp-tools-D1ScXFUK.js → use-mcp-tools-CyPVbfii.js} +1 -1
  142. package/dist/client/assets/{use-members-BzwLO50s.js → use-members-C8bjIWu8.js} +1 -1
  143. package/dist/client/assets/use-navigate-to-agent-DuF5pNCT.js +1 -0
  144. package/dist/client/assets/{use-org-sso-D0nq7yh3.js → use-org-sso-pbiXxD33.js} +1 -1
  145. package/dist/client/assets/{use-organization-roles-Dl9VoSUw.js → use-organization-roles-7NVaQG9M.js} +1 -1
  146. package/dist/client/assets/{use-organization-settings-C1HGFbFZ.js → use-organization-settings-DpXizr85.js} +1 -1
  147. package/dist/client/assets/{use-registry-connections-DzXuLNdG.js → use-registry-connections-BFqaVIUz.js} +1 -1
  148. package/dist/client/assets/{use-status-sounds-BC_OJyRi.js → use-status-sounds-DVyydX5_.js} +1 -1
  149. package/dist/client/assets/{use-tasks-BtGSWUvO.js → use-tasks-tzb1zUeQ.js} +1 -1
  150. package/dist/client/assets/use-view-mode-D9sT86SW.js +1 -0
  151. package/dist/client/assets/{use-virtual-mcp-D1fXVRo5.js → use-virtual-mcp-SIWEo5E_.js} +1 -1
  152. package/dist/client/assets/useInfiniteQuery-B3rxurAJ.js +1 -0
  153. package/dist/client/assets/useSuspenseInfiniteQuery-KPnhOQU0.js +1 -0
  154. package/dist/client/assets/{user-DAufXs4h.js → user-DxM-AJLw.js} +1 -1
  155. package/dist/client/assets/view-mode-toggle-CussfoqD.js +1 -0
  156. package/dist/client/assets/workflow-a5DJAs_-.js +1 -0
  157. package/dist/client/assets/workflow-detail-DqMXf6Es.js +1 -0
  158. package/dist/client/index.html +1 -1
  159. package/dist/server/cli.js +1 -1
  160. package/package.json +1 -1
  161. package/dist/client/assets/accordion-zVtel299.js +0 -1
  162. package/dist/client/assets/agent-icon-DSfidSus.js +0 -1
  163. package/dist/client/assets/agents-list-vffTTABq.js +0 -1
  164. package/dist/client/assets/ai-providers-t0YXr9kj.js +0 -1
  165. package/dist/client/assets/automations-C7xJbJSO.js +0 -1
  166. package/dist/client/assets/brand-context-7PuYXROc.js +0 -1
  167. package/dist/client/assets/chat-context-KGI8H-cg.js +0 -30
  168. package/dist/client/assets/collection-detail-D_GfRl2U.js +0 -1
  169. package/dist/client/assets/collection-display-button-DtLA-_Qf.js +0 -1
  170. package/dist/client/assets/connection-detail-Kmft9f88.js +0 -1
  171. package/dist/client/assets/connection-form-helpers-DMZ5iUjm.js +0 -1
  172. package/dist/client/assets/connections-Qfmncrnr.js +0 -1
  173. package/dist/client/assets/domain-settings-ZwlKCgS9.js +0 -1
  174. package/dist/client/assets/dropdown-menu-CiJ99ly5.js +0 -1
  175. package/dist/client/assets/dynamic-plugin-layout-SGNBzqAT.js +0 -1
  176. package/dist/client/assets/features-QRbg1n3B.js +0 -1
  177. package/dist/client/assets/form-FdRX5pG1.js +0 -1
  178. package/dist/client/assets/general-Cc1ql58y.js +0 -1
  179. package/dist/client/assets/github-repo-picker-QAmOQiwy.js +0 -116
  180. package/dist/client/assets/index-L8A_STvx.js +0 -1
  181. package/dist/client/assets/index-SoZ9vkB3.js +0 -735
  182. package/dist/client/assets/index-mcaIOSGF.js +0 -1
  183. package/dist/client/assets/layout-BHQW603q.js +0 -1
  184. package/dist/client/assets/org-plugin-layout-Csh0KNUp.js +0 -1
  185. package/dist/client/assets/plugin-empty-state-DxSYI7WM.js +0 -1
  186. package/dist/client/assets/plugin-header-D0WCyAas.js +0 -1
  187. package/dist/client/assets/profile-BZlcE9Y0.js +0 -1
  188. package/dist/client/assets/project-app-view-B8g2l52t.js +0 -1
  189. package/dist/client/assets/registry-oDwGjrMT.js +0 -2
  190. package/dist/client/assets/required-auth-layout-DAzAQKek.js +0 -1
  191. package/dist/client/assets/roles-CMvkTrhY.js +0 -1
  192. package/dist/client/assets/scroll-area-BlUv7zcB.js +0 -142
  193. package/dist/client/assets/select-W23RccQR.js +0 -1
  194. package/dist/client/assets/settings-layout-b1Br3189.js +0 -1
  195. package/dist/client/assets/shell-layout-BUuy9S_L.js +0 -1
  196. package/dist/client/assets/sso-aoLg93_m.js +0 -1
  197. package/dist/client/assets/store-DGgyYg8C.js +0 -1
  198. package/dist/client/assets/store-registry-Dbm0_etm.js +0 -2
  199. package/dist/client/assets/tools-list-CVgYt-8F.js +0 -1
  200. package/dist/client/assets/use-create-virtual-mcp-DAB2T3vN.js +0 -1
  201. package/dist/client/assets/use-mobile-DvmdhkH5.js +0 -1
  202. package/dist/client/assets/use-navigate-to-agent-Dg24R1Fh.js +0 -1
  203. package/dist/client/assets/use-view-mode-BnyE0_EO.js +0 -1
  204. package/dist/client/assets/useInfiniteQuery-H3t_tPfZ.js +0 -1
  205. package/dist/client/assets/useSuspenseInfiniteQuery-BAnABuH7.js +0 -1
  206. package/dist/client/assets/view-mode-toggle-LshbVzEB.js +0 -1
  207. package/dist/client/assets/workflow-Dt2CIq6i.js +0 -1
  208. package/dist/client/assets/workflow-detail-BZ0JnpLY.js +0 -1
  209. package/dist/server/node_modules/pg-int8/LICENSE +0 -13
  210. package/dist/server/node_modules/pg-int8/README.md +0 -16
  211. package/dist/server/node_modules/pg-int8/index.js +0 -100
  212. package/dist/server/node_modules/pg-int8/package.json +0 -24
  213. package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
  214. package/dist/server/node_modules/postgres-array/index.js +0 -97
  215. package/dist/server/node_modules/postgres-array/license +0 -21
  216. package/dist/server/node_modules/postgres-array/package.json +0 -35
  217. package/dist/server/node_modules/postgres-array/readme.md +0 -43
  218. package/dist/server/node_modules/postgres-bytea/index.js +0 -33
  219. package/dist/server/node_modules/postgres-bytea/license +0 -21
  220. package/dist/server/node_modules/postgres-bytea/package.json +0 -34
  221. package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
  222. package/dist/server/node_modules/postgres-date/index.js +0 -116
  223. package/dist/server/node_modules/postgres-date/license +0 -21
  224. package/dist/server/node_modules/postgres-date/package.json +0 -33
  225. package/dist/server/node_modules/postgres-date/readme.md +0 -49
  226. package/dist/server/node_modules/split2/LICENSE +0 -13
  227. package/dist/server/node_modules/split2/README.md +0 -85
  228. package/dist/server/node_modules/split2/bench.js +0 -27
  229. package/dist/server/node_modules/split2/index.js +0 -141
  230. package/dist/server/node_modules/split2/package.json +0 -39
  231. package/dist/server/node_modules/split2/test.js +0 -409
  232. package/dist/server/node_modules/xtend/.jshintrc +0 -30
  233. package/dist/server/node_modules/xtend/LICENSE +0 -20
  234. package/dist/server/node_modules/xtend/README.md +0 -32
  235. package/dist/server/node_modules/xtend/immutable.js +0 -19
  236. package/dist/server/node_modules/xtend/mutable.js +0 -17
  237. package/dist/server/node_modules/xtend/package.json +0 -55
  238. package/dist/server/node_modules/xtend/test.js +0 -103
@@ -0,0 +1 @@
1
+ import{H as Ke,J as te,e as N,j as t,E as Te,r as C,s as le,z as Ge,c as U,aX as Qe,aY as Xe,l as ie,d as Ye,L as G,B as q,x as Ze,g as ae,aZ as ke}from"./index-gKZjkMnf.js";import{E as Pe}from"./empty-state-CPpC79-7.js";import{u as et,a as Ee}from"./use-collections-DKaygmj-.js";import{u as ce}from"./constants-nJzh8CYx.js";import{F as se,a as tt,b as de,d as me}from"./form-yPmbpUVF.js";import{I as ue}from"./input-Cet4kRAV.js";import{T as re}from"./textarea-BPX5qWaA.js";import{a as st,b as nt,V as xe}from"./layout-BgwHTi9m.js";import{S as ot,W as rt,a as lt}from"./index-BYM0cbyk.js";import{g as it,M as at,b as je}from"./types-CUVoLk-m.js";import{S as be,a as Ne,b as ve,c as Se,d as ne}from"./select-B6R2tTSM.js";import{c as ct,T as ye,a as we,b as Ce}from"./tooltip-DlUl6zVU.js";import{i as dt}from"./AlertCircle-DnJbX_0w.js";import{v as mt,x as ut,U as xt,V as pt,W as ft,X as Ie}from"./agent-icon-DxobcFDr.js";import{c as ht}from"./XCircle-D0NNu2cU.js";import{i as gt}from"./Play-B2WhNMxb.js";import{i as jt}from"./ChevronRight-DIr3-XeU.js";import{O as bt,M as Nt}from"./index-DImBkhtD.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-CjPOU8GA.js";import{a as _e,u as Oe}from"./use-connection-DLwIHVYP.js";import{b as wt}from"./use-mcp-tools-CyPVbfii.js";import{c as Ct}from"./content-blocks-o63cs2vh.js";import{I as $e}from"./integration-icon-BYjt2zM8.js";import{g as It,k as $t}from"./chat-context-CfrtTY3a.js";import{u as Tt}from"./shell-layout-DaB5J-du.js";import{M as kt}from"./monaco-editor-D2GSkzL1.js";import{E as Pt}from"./empty-state-C2PUUqhT.js";import{n as Et}from"./Container-BvdKvtbe.js";import"./label-CaWfIbuT.js";import"./index-C3hSkh4S.js";import"./X-DSm8Y-S-.js";import"./index-Dlk19fTc.js";import"./collections-CzE8C7FB.js";import"./index-BdUJIICa.js";import"./use-virtual-mcp-SIWEo5E_.js";import"./accordion-CJq3HBrS.js";import"./index-Dkaetwrr.js";import"./badge-Clg4Tzdw.js";import"./view-mode-toggle-CussfoqD.js";import"./dialog-CVDAkUpR.js";import"./index-B3vDeqTk.js";import"./dropdown-menu-gP2-wJTw.js";import"./ChevronDown-D098IDk9.js";import"./DotsVertical-DGFUAKYN.js";import"./Plus-6a_0gFD5.js";import"./Tool01-Cxeqfwwz.js";import"./XClose-8tp9nQPE.js";import"./scroll-area-CH9Vosbx.js";import"./index-CqrrK0SQ.js";import"./create-sse-subscription-CxkOgzKf.js";import"./ChevronUp-qt4sL4uC.js";import"./RefreshCcw01-CmGHOB_j.js";import"./ArrowNarrowLeft-M9-X6Sxy.js";import"./ArrowUpRight-BQK-oA7E.js";import"./ZapSquare-DgxRVJjy.js";import"./Users03-BEcIfaLP.js";import"./CheckCircle-BTDGGZJo.js";import"./Star01-BsL_E8DX.js";import"./Palette-SeD4BOqL.js";import"./SearchMd-B4RJoOIR.js";import"./LinkExternal01-CS_vTEL0.js";import"./Lock01-DepQhBci.js";import"./Sun-CoYtwe4c.js";import"./Settings02-86F4b3dQ.js";import"./Shield01-CzaXyqoU.js";import"./Trash01-Crqeojj8.js";import"./User01-lfQ-qZIG.js";import"./Zap-GnwBp_Qp.js";import"./extract-connection-data-5g73Imwy.js";import"./constants-CrD_AMxD.js";import"./use-registry-connections-BFqaVIUz.js";import"./use-organization-settings-DpXizr85.js";import"./index-CsTWePfc.js";import"./popover-dpRZqzOJ.js";import"./use-create-virtual-mcp-B693GvUD.js";import"./use-navigate-to-agent-DuF5pNCT.js";import"./use-ai-providers-CKSasQTP.js";import"./use-decopilot-events-NXGOEGvZ.js";import"./use-tasks-tzb1zUeQ.js";import"./required-auth-layout-DVgyyuV-.js";import"./use-org-sso-pbiXxD33.js";Ke({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function _t(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function Ot(s){const e=N.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let r;e[1]!==o.control?(r=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:o.control,name:"title",render:Dt}),t.jsx(se,{control:o.control,name:"description",render:Rt})]})]}),e[1]=o.control,e[2]=r):r=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),i=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[l,i,t.jsx(se,{control:o.control,name:"body",render:At})]}),e[5]=o.control,e[6]=c):c=e[6];let a;e[7]!==r||e[8]!==c?(a=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[r,c]}),e[7]=r,e[8]=c,e[9]=a):a=e[9];let x;return e[10]!==o||e[11]!==a?(x=t.jsx(tt,{...o,children:a}),e[10]=o,e[11]=a,e[12]=x):x=e[12],x}function At(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Rt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const e=N.c(35),{providerId:o,promptId:n}=s,{org:r}=le(),l=o||null;let i;e[0]!==r.id||e[1]!==l?(i={connectionId:l,orgId:r.id},e[0]=r.id,e[1]=l,e[2]=i):i=e[2];const c=ce(i),a=et(o,"PROMPT",n,c),x=Ee(o,"PROMPT",c),f=x.update.isPending;let u;e[3]!==a?(u=a?{title:a.title,description:a.description??null,body:oe(a)}:void 0,e[3]=a,e[4]=u):u=e[4];let h;e[5]!==u?(h={values:u},e[5]=u,e[6]=h):h=e[6];const v=Ge(h);let T;e[7]!==v||e[8]!==a?(T=()=>{a&&v.reset({title:a.title,description:a.description??null,body:oe(a)})},e[7]=v,e[8]=a,e[9]=T):T=e[9];const _=T;let O;e[10]!==x.update||e[11]!==v||e[12]!==n?(O=v.handleSubmit(async j=>{const P=await x.update.mutateAsync({id:n,data:{title:j.title,description:j.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:j.body}}]}});v.reset({title:P.title,description:P.description??null,body:oe(P)})}),e[10]=x.update,e[11]=v,e[12]=n,e[13]=O):O=e[13];const A=O;if(!a){let j;return e[14]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Pe,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=j):j=e[14],j}let y;e[15]!==a.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[15]=a.title,e[16]=y):y=e[16];let k;e[17]!==a.description?(k=a.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[17]=a.description,e[18]=k):k=e[18];let I;e[19]!==y||e[20]!==k?(I=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,k]})}),e[19]=y,e[20]=k,e[21]=I):I=e[21];let g;e[22]!==A?(g=()=>{A()},e[22]=A,e[23]=g):g=e[23];let S;e[24]!==v.formState.isDirty||e[25]!==f||e[26]!==_||e[27]!==g?(S=t.jsx(st,{children:t.jsx(ot,{onSave:g,onUndo:_,isDirty:v.formState.isDirty,isSaving:f})}),e[24]=v.formState.isDirty,e[25]=f,e[26]=_,e[27]=g,e[28]=S):S=e[28];let w;e[29]!==v?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:v})}),e[29]=v,e[30]=w):w=e[30];let $;return e[31]!==S||e[32]!==w||e[33]!==I?($=t.jsxs(xe,{children:[I,S,w]}),e[31]=S,e[32]=w,e[33]=I,e[34]=$):$=e[34],$}function zt(s){const e=N.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=_t(),e[0]=n):n=e[0];const r=n;if(!r){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Pe,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=i):i=e[1],i}let l;return e[2]!==o?(l=t.jsx(Te,{children:t.jsx(C.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:r,promptId:o})})}),e[2]=o,e[3]=l):l=e[3],l}const Ut=Qe("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Lt(s){const e=N.c(10);let o,n,r;e[0]!==s?({className:o,variant:r,...n}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=r):(o=e[1],n=e[2],r=e[3]);let l;e[4]!==o||e[5]!==r?(l=U(Ut({variant:r}),o),e[4]=o,e[5]=r,e[6]=l):l=e[6];let i;return e[7]!==n||e[8]!==l?(i=t.jsx("div",{"data-slot":"alert",role:"alert",className:l,...n}),e[7]=n,e[8]=l,e[9]=i):i=e[9],i}function Vt(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("line-clamp-1 min-h-4 font-medium tracking-tight",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("div",{"data-slot":"alert-title",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Bt(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("text-muted-foreground leading-relaxed",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("div",{"data-slot":"alert-description",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Ae(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("min-w-0 overflow-hidden",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Re(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("ol",{"data-slot":"breadcrumb-list",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function J(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("li",{"data-slot":"breadcrumb-item",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Q(s){const e=N.c(10);let o,n,r;e[0]!==s?({asChild:o,className:n,...r}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=r):(o=e[1],n=e[2],r=e[3]);const l=o?Xe:"a";let i;e[4]!==n?(i=U("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=i):i=e[5];let c;return e[6]!==l||e[7]!==r||e[8]!==i?(c=t.jsx(l,{"data-slot":"breadcrumb-link",className:i,...r}),e[6]=l,e[7]=r,e[8]=i,e[9]=c):c=e[9],c}function De(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("text-foreground font-medium truncate",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function X(s){const e=N.c(12);let o,n,r;e[0]!==s?({children:o,className:n,...r}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=r):(o=e[1],n=e[2],r=e[3]);let l;e[4]!==n?(l=U("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=l):l=e[5];let i;e[6]!==o?(i=o??t.jsx(jt,{}),e[6]=o,e[7]=i):i=e[7];let c;return e[8]!==r||e[9]!==l||e[10]!==i?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...r,children:i}),e[8]=r,e[9]=l,e[10]=i,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Jt(s){const e=N.c(11),{toolName:o,connectionId:n,siblings:r,onSelectInstance:l,onBack:i}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const a=St(c);if(!a.isAuthenticated){let u;return e[2]!==a.supportsOAuth||e[3]!==i?(u=t.jsx("div",{className:"flex h-full items-center justify-center",children:a.supportsOAuth?t.jsx(bt,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):t.jsx(Nt,{hasReadme:!1})}),e[2]=a.supportsOAuth,e[3]=i,e[4]=u):u=e[4],u}const x=`${n}:${o}`;let f;return e[5]!==n||e[6]!==l||e[7]!==r||e[8]!==x||e[9]!==o?(f=t.jsx(Wt,{toolName:o,connectionId:n,siblings:r,onSelectInstance:l},x),e[5]=n,e[6]=l,e[7]=r,e[8]=x,e[9]=o,e[10]=f):f=e[10],f}function Wt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:r}=Ye({strict:!1}),l=(()=>{if(!r)return null;const d=`replay-${r}`,m=sessionStorage.getItem(d);if(!m)return null;sessionStorage.removeItem(d);try{return JSON.parse(m)}catch{return null}})(),i=(()=>{if(!l)return null;const d={};for(const[m,b]of Object.entries(l))b!==null&&typeof b=="object"?d[m]=JSON.stringify(b,null,2):d[m]=b;return d})(),[c,a]=C.useState(i??{}),[x,f]=C.useState(l?JSON.stringify(l,null,2):"{}"),[u,h]=C.useState(null),[v,T]=C.useState(null),[_,O]=C.useState(null),[A,y]=C.useState(null),[k,I]=C.useState(!1),[g,S]=C.useState(null),{org:w}=le(),$=_e(e),j=It(),P=$t(),{setChatOpen:L}=Tt(),M=`${e}:${s}`,R=ce({connectionId:e,orgId:w.id}),z=wt({client:R}),p=z.data?.tools?.find(d=>d.name===s),E=it(p?._meta),V=d=>{if(!j)return;const m=Ct(d.content);m.content.length>0&&(L(!0),j.sendMessage({tiptapDoc:m}))},[D,Y]=C.useState("json"),[Me,ze]=C.useState(!1);E&&!Me&&(Y("ui"),ze(!0));const pe=p?.inputSchema?.properties,fe=pe?Object.keys(pe):[],W=fe.length>0,H={};if(W&&p?.inputSchema?.properties)for(const d of fe)H[d]=p.inputSchema.required?.includes(d)?"":void 0;const Z=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{I(!0),y(null),h(null),T(null),O(null),S(null);const d=performance.now();try{if(!R)throw new Error("MCP client is not available");const m=W?{...H,...c}:(()=>{const B=x.trim();if(!B)return{};const F=JSON.parse(B);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();W&&p?.inputSchema?.properties&&Object.entries(p.inputSchema.properties).forEach(([B,F])=>{if((F.type==="object"||F.type==="array")&&typeof m[B]=="string")try{m[B]=JSON.parse(m[B])}catch{}});const b=await R.callTool({name:s,arguments:m}),K=b.structuredContent??b,We=performance.now(),qe=Math.round(We-d);h(K),T(b),O(m);const He=JSON.stringify(K),ge=new TextEncoder().encode(He).length;S({duration:`${qe}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(m){const b=m instanceof Error?m.message:String(m);y(b||"Unknown error occurred");const K=performance.now();S({duration:`${Math.round(K-d)}ms`})}finally{I(!1)}},ee=(d,m)=>{a(b=>({...b,[d]:m}))},Le=()=>{h(null),T(null),O(null),y(null),S(null)},Ve=p?.name??Ft(s),Be=t.jsx(Ae,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(X,{}),$&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt($)},search:{tab:"tools"},children:$.title})})}),t.jsx(X,{})]}),t.jsx(J,{children:t.jsx(De,{children:Ve})})]})}),he=o.length>1&&t.jsxs(be,{value:e,onValueChange:n,children:[t.jsx(Ne,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ve,{})}),t.jsx(Se,{children:o.map(d=>t.jsx(ne,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx($e,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Fe=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),p?.inputSchema?.required&&p.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:W&&p?.inputSchema?.properties?Object.entries(p.inputSchema.properties).map(([d,m])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,p.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:m.type})]}),m.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:m.description}),m.type==="object"||m.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:Z(d)?c[d]??"":H[d]??"",onChange:b=>ee(d,b.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):m.type==="boolean"?t.jsxs(be,{value:Z(d)?String(c[d]??""):"",onValueChange:b=>ee(d,b==="true"),children:[t.jsx(Ne,{children:t.jsx(ve,{placeholder:"Select true or false..."})}),t.jsxs(Se,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:Z(d)?c[d]??"":H[d]??"",onChange:b=>ee(d,b.target.value),placeholder:`Enter ${d}...`})]},d)):p?.inputSchema&&!W?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:x,onChange:d=>f(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(q,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Le,children:[t.jsx(mt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(q,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(gt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),Je=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[g&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ut,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.duration})]}),g.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(xt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.tokens})]}),g.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(pt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.bytes})]}),g.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:g.cost})})]}),E&&t.jsx(ct,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(q,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Y("ui"),children:t.jsx(ft,{size:14})})}),t.jsx(Ce,{children:"Interactive view"})]}),t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(q,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Y("json"),children:t.jsx(Ie,{size:14})})}),t.jsx(Ce,{children:"JSON view"})]})]})})]})]}),A&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(Lt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(dt,{className:"h-4 w-4"}),t.jsx(Vt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(Bt,{className:"text-xs text-destructive",children:A})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:E&&D==="ui"&&R?t.jsx(C.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(at,{resourceURI:E,toolInfo:p?{tool:p}:void 0,toolInput:_??void 0,toolResult:v??void 0,displayMode:"fullscreen",minHeight:je.view.minHeight,maxHeight:je.view.maxHeight,client:R,onMessage:V,onUpdateModelContext:d=>P?.setAppContext(M,d),onTeardown:()=>P?.clearAppContext(M),className:"h-full"})}):u?t.jsxs(t.Fragment,{children:[t.jsx(kt,{code:JSON.stringify(u,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(q,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(u,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(ht,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(Ie,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Be,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx($e,{icon:$?.icon||null,name:$?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[z.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):z.isLoading?t.jsx(ie,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:z.isSuccess?"ready":z.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:p?.annotations,_meta:p?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:p?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Fe}),Je]})})]})})}function qt(s){const e=N.c(10),{itemId:o,siblings:n,onBack:r}=s,[l,i]=C.useState(n[0]?.id??"");let c;e[0]!==l||e[1]!==n?(c=n.find(h=>h.id===l)?.id??n[0]?.id??"",e[0]=l,e[1]=n,e[2]=c):c=e[2];const a=c;if(!_e(a||void 0)||!a){let h;return e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=h):h=e[3],h}let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ie,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=f):f=e[4];let u;return e[5]!==a||e[6]!==r||e[7]!==n||e[8]!==o?(u=t.jsx(C.Suspense,{fallback:f,children:t.jsx(Jt,{toolName:o,connectionId:a,siblings:n,onSelectInstance:i,onBack:r})}),e[5]=a,e[6]=r,e[7]=n,e[8]=o,e[9]=u):u=e[9],u}const Ht={workflow:lt,workflow_execution:rt,prompt:zt};function Kt(){const s=N.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),r=decodeURIComponent(n.itemId);let l;s[1]!==n.appSlug?(l={slug:n.appSlug},s[1]=n.appSlug,s[2]=l):l=s[2];const i=Oe(l);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const a=c,x=Gt;let f;return s[5]!==a||s[6]!==r||s[7]!==i?(f=t.jsx(qt,{itemId:r,siblings:i,onBack:a,onUpdate:x}),s[5]=a,s[6]=r,s[7]=i,s[8]=f):f=s[8],f}async function Gt(s){return Promise.resolve()}function Qt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Xt(){const s=N.c(40),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),r=decodeURIComponent(n.collectionName),l=decodeURIComponent(n.itemId);let i;s[1]!==e.history?(i=()=>{e.history.back()},s[1]=e.history,s[2]=i):i=s[2];const c=i,{org:a}=le();let x;s[3]!==n.appSlug?(x={slug:n.appSlug},s[3]=n.appSlug,s[4]=x):x=s[4];const u=Oe(x)[0]??null,h=u?.id??"",v=h||"no-connection",T=h??null;let _;s[5]!==a.id||s[6]!==T?(_={connectionId:T,orgId:a.id},s[5]=a.id,s[6]=T,s[7]=_):_=s[7];const O=ce(_),A=Ee(v,r,O);let y;s[8]!==A||s[9]!==l?(y=async D=>{l&&await A.update.mutateAsync({id:l,data:D})},s[8]=A,s[9]=l,s[10]=y):y=s[10];const k=y;let I;s[11]!==r?(I=r?.toLowerCase(),s[11]=r,s[12]=I):I=s[12];const g=I,S=g&&Ht[g];let w;s[13]!==r?(w=Qt(r),s[13]=r,s[14]=w):w=s[14];const $=w;let j;s[15]!==a.slug?(j=t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:a.slug},children:"Connections"})})}),s[15]=a.slug,s[16]=j):j=s[16];let P;s[17]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(X,{}),s[17]=P):P=s[17];let L;s[18]!==r||s[19]!==u||s[20]!==a.slug||s[21]!==n.appSlug?(L=u&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:n.appSlug},search:{tab:r},children:u.title})})}),t.jsx(X,{})]}),s[18]=r,s[19]=u,s[20]=a.slug,s[21]=n.appSlug,s[22]=L):L=s[22];let M;s[23]!==$?(M=t.jsx(J,{children:t.jsx(De,{children:$})}),s[23]=$,s[24]=M):M=s[24];let R;s[25]!==L||s[26]!==M||s[27]!==j?(R=t.jsx(Ae,{children:t.jsxs(Re,{children:[j,P,L,M]})}),s[25]=L,s[26]=M,s[27]=j,s[28]=R):R=s[28];const z=R;if(S){let D;return s[29]!==S||s[30]!==c||s[31]!==k||s[32]!==l?(D=t.jsx(S,{itemId:l,onBack:c,onUpdate:k}),s[29]=S,s[30]=c,s[31]=k,s[32]=l,s[33]=D):D=s[33],D}let p;s[34]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Et,{size:36,className:"text-muted-foreground"}),s[34]=p):p=s[34];let E;s[35]!==c?(E=t.jsx(Pt,{icon:p,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[35]=c,s[36]=E):E=s[36];let V;return s[37]!==z||s[38]!==E?(V=t.jsx(xe,{breadcrumb:z,children:E}),s[37]=z,s[38]=E,s[39]=V):V=s[39],V}function Yt(){const s=N.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Kt,{}),s[1]=i):i=s[1],i}let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Xt,{}),s[2]=l):l=s[2],l}function Tn(){const s=N.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Te,{children:t.jsx(C.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ie,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Tn as default};
@@ -0,0 +1 @@
1
+ import{e as B,j as s,c as M,B as V}from"./index-gKZjkMnf.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-gP2-wJTw.js";import{i as L,n as O,b as R,d as A,c as F}from"./XClose-8tp9nQPE.js";import{i as S}from"./ChevronDown-D098IDk9.js";import{a as I,b as K,c as P,T as W}from"./tooltip-DlUl6zVU.js";import{V as q}from"./view-mode-toggle-CussfoqD.js";import{B as G}from"./badge-Clg4Tzdw.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
@@ -1 +1 @@
1
- import{e as v,c as b,j as n,l as w}from"./index-C4KOdiuW.js";import{i as C}from"./SearchMd-BjteSZXQ.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?n.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):n.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=n.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let a;e[14]!==s||e[15]!==l||e[16]!==o?(a=n.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=n.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{S as C};
1
+ import{e as v,c as b,j as n,l as w}from"./index-gKZjkMnf.js";import{i as C}from"./SearchMd-B4RJoOIR.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?n.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):n.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=n.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let a;e[14]!==s||e[15]!==l||e[16]!==o?(a=n.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=n.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{S as C};
@@ -1,4 +1,4 @@
1
- import{r as c,bc as P,J as Oe,e as En,c as Ot,j as Ne,l as Mn}from"./index-C4KOdiuW.js";import{i as In}from"./SearchMd-BjteSZXQ.js";function An(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const tt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function we(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function bt(e){return"nodeType"in e}function B(e){var t,n;return e?we(e)?e:bt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function mt(e){const{Document:t}=B(e);return e instanceof t}function Fe(e){return we(e)?!1:e instanceof B(e).HTMLElement}function Kt(e){return e instanceof B(e).SVGElement}function ye(e){return e?we(e)?e.document:bt(e)?mt(e)?e:Fe(e)||Kt(e)?e.ownerDocument:document:document:document}const Q=tt?c.useLayoutEffect:c.useEffect;function wt(e){const t=c.useRef(e);return Q(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Nn(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ze(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Q(()=>{n.current!==e&&(n.current=e)},t),n}function $e(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Je(e){const t=wt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function ft(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let ct={};function je(e,t){return c.useMemo(()=>{if(t)return t;const n=ct[e]==null?0:ct[e]+1;return ct[e]=n,e+"-"+n},[e,t])}function Ht(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const me=Ht(1),Pe=Ht(-1);function On(e){return"clientX"in e&&"clientY"in e}function yt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function Tn(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function ht(e){if(Tn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return On(e)?{x:e.clientX,y:e.clientY}:null}const _e=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[_e.Translate.toString(e),_e.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Tt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ln(e){return e.matches(Tt)?e:e.querySelector(Tt)}const kn={display:"none"};function zn(e){let{id:t,value:n}=e;return P.createElement("div",{id:t,style:kn},n)}function Pn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return P.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Bn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Vt=c.createContext(null);function Fn(e){const t=c.useContext(Vt);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function $n(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const jn={draggable:`
1
+ import{r as c,bc as P,ao as Oe,e as En,c as Ot,j as Ne,l as Mn}from"./index-gKZjkMnf.js";import{i as In}from"./SearchMd-B4RJoOIR.js";function An(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const tt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function we(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function bt(e){return"nodeType"in e}function B(e){var t,n;return e?we(e)?e:bt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function mt(e){const{Document:t}=B(e);return e instanceof t}function Fe(e){return we(e)?!1:e instanceof B(e).HTMLElement}function Kt(e){return e instanceof B(e).SVGElement}function ye(e){return e?we(e)?e.document:bt(e)?mt(e)?e:Fe(e)||Kt(e)?e.ownerDocument:document:document:document}const Q=tt?c.useLayoutEffect:c.useEffect;function wt(e){const t=c.useRef(e);return Q(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Nn(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ze(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Q(()=>{n.current!==e&&(n.current=e)},t),n}function $e(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Je(e){const t=wt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function ft(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let ct={};function je(e,t){return c.useMemo(()=>{if(t)return t;const n=ct[e]==null?0:ct[e]+1;return ct[e]=n,e+"-"+n},[e,t])}function Ht(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const me=Ht(1),Pe=Ht(-1);function On(e){return"clientX"in e&&"clientY"in e}function yt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function Tn(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function ht(e){if(Tn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return On(e)?{x:e.clientX,y:e.clientY}:null}const _e=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[_e.Translate.toString(e),_e.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Tt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ln(e){return e.matches(Tt)?e:e.querySelector(Tt)}const kn={display:"none"};function zn(e){let{id:t,value:n}=e;return P.createElement("div",{id:t,style:kn},n)}function Pn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return P.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Bn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Vt=c.createContext(null);function Fn(e){const t=c.useContext(Vt);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function $n(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const jn={draggable:`
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.
@@ -1 +1 @@
1
- import{e as k,j as s,c as C}from"./index-C4KOdiuW.js";import{e as S,d as R,a as T,T as H,b as L,c as z}from"./table-CaLu-Lo8.js";import{i as D,n as E}from"./XClose-BQJEwJET.js";function I(y){const e=k.c(29),{columns:r,data:f,sortKey:x,sortDirection:u,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==u?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&u&&(u==="asc"?s.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=u,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==x){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==x?(o=(t,h)=>{const N=x===t.id;return s.jsx(S,{className:C(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=x,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=x,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(12),{columns:r,data:f,isLoading:x,sortKey:u,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(x===void 0?!1:x){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==u?(d=s.jsx("div",{className:"flex-1",children:s.jsx(I,{columns:r,data:f,sortKey:u,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}export{B as C};
1
+ import{e as k,j as s,c as C}from"./index-gKZjkMnf.js";import{e as S,d as R,a as T,T as H,b as L,c as z}from"./table-D1_6e_tY.js";import{i as D,n as E}from"./XClose-8tp9nQPE.js";function I(y){const e=k.c(29),{columns:r,data:f,sortKey:x,sortDirection:u,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==u?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&u&&(u==="asc"?s.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=u,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==x){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==x?(o=(t,h)=>{const N=x===t.id;return s.jsx(S,{className:C(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=x,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=x,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(12),{columns:r,data:f,isLoading:x,sortKey:u,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(x===void 0?!1:x){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==u?(d=s.jsx("div",{className:"flex-1",children:s.jsx(I,{columns:r,data:f,sortKey:u,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}export{B as C};
@@ -1 +1 @@
1
- import{e as f,c as u,j as m}from"./index-C4KOdiuW.js";import{B as g}from"./badge-nX1O9Qf1.js";function h(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
1
+ import{e as f,c as u,j as m}from"./index-gKZjkMnf.js";import{B as g}from"./badge-Clg4Tzdw.js";function h(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
@@ -1 +1 @@
1
- import{v as t,y as i,aJ as p,_ as r,aK as a,bR as m,bl as h,aC as c,a_ as b}from"./index-C4KOdiuW.js";const N=t({id:i().describe("Unique identifier for the entity"),title:i().describe("Human-readable title for the entity"),description:i().nullish().describe("Description of the entity"),created_at:i().datetime(),updated_at:i().datetime(),created_by:i().optional(),updated_by:i().optional()}),f=t({field:a(i()),operator:r(["eq","gt","gte","lt","lte","in","like","contains"]),value:p()}),l=m(()=>h([f,t({operator:r(["and","or","not"]),conditions:a(l)})])),C=t({field:a(i()),direction:r(["asc","desc"]),nulls:r(["first","last"]).optional()}),S=t({where:l.optional().describe("Filter expression"),orderBy:a(C).optional().describe("Sort expressions"),limit:c().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:c().int().min(0).optional().describe("Number of items to skip")});function O(e){return t({items:a(e).describe("Array of collection items"),totalCount:c().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:b().optional().describe("Whether there are more items available")})}const y=t({id:i().describe("ID of the entity to retrieve")});function _(e){return t({item:e.nullable().describe("The retrieved item, or null if not found")})}function E(e){return t({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function I(e){return t({item:e.describe("The created entity with generated id")})}function T(e){return t({id:i().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function L(e){return t({item:e.describe("The updated entity")})}const D=t({id:i().describe("ID of the entity to delete")});function g(e){return t({item:e.describe("The deleted entity")})}function v(e,n,u){const o=e.toUpperCase(),d=u?.readOnly??!1,s=[{name:`COLLECTION_${o}_LIST`,inputSchema:S,outputSchema:O(n)},{name:`COLLECTION_${o}_GET`,inputSchema:y,outputSchema:_(n)}];return d||s.push({name:`COLLECTION_${o}_CREATE`,inputSchema:E(n),outputSchema:I(n),opt:!0},{name:`COLLECTION_${o}_UPDATE`,inputSchema:T(n),outputSchema:L(n),opt:!0},{name:`COLLECTION_${o}_DELETE`,inputSchema:D,outputSchema:g(n),opt:!0}),s}export{N as B,v as c};
1
+ import{H as t,J as i,aJ as p,ap as r,aK as a,bR as m,bl as h,I as c,a_ as b}from"./index-gKZjkMnf.js";const N=t({id:i().describe("Unique identifier for the entity"),title:i().describe("Human-readable title for the entity"),description:i().nullish().describe("Description of the entity"),created_at:i().datetime(),updated_at:i().datetime(),created_by:i().optional(),updated_by:i().optional()}),f=t({field:a(i()),operator:r(["eq","gt","gte","lt","lte","in","like","contains"]),value:p()}),l=m(()=>h([f,t({operator:r(["and","or","not"]),conditions:a(l)})])),C=t({field:a(i()),direction:r(["asc","desc"]),nulls:r(["first","last"]).optional()}),S=t({where:l.optional().describe("Filter expression"),orderBy:a(C).optional().describe("Sort expressions"),limit:c().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:c().int().min(0).optional().describe("Number of items to skip")});function O(e){return t({items:a(e).describe("Array of collection items"),totalCount:c().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:b().optional().describe("Whether there are more items available")})}const I=t({id:i().describe("ID of the entity to retrieve")});function y(e){return t({item:e.nullable().describe("The retrieved item, or null if not found")})}function E(e){return t({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function _(e){return t({item:e.describe("The created entity with generated id")})}function T(e){return t({id:i().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function L(e){return t({item:e.describe("The updated entity")})}const D=t({id:i().describe("ID of the entity to delete")});function g(e){return t({item:e.describe("The deleted entity")})}function v(e,n,u){const o=e.toUpperCase(),d=u?.readOnly??!1,s=[{name:`COLLECTION_${o}_LIST`,inputSchema:S,outputSchema:O(n)},{name:`COLLECTION_${o}_GET`,inputSchema:I,outputSchema:y(n)}];return d||s.push({name:`COLLECTION_${o}_CREATE`,inputSchema:E(n),outputSchema:_(n),opt:!0},{name:`COLLECTION_${o}_UPDATE`,inputSchema:T(n),outputSchema:L(n),opt:!0},{name:`COLLECTION_${o}_DELETE`,inputSchema:D,outputSchema:g(n),opt:!0}),s}export{N as B,v as c};
@@ -1 +1 @@
1
- import{e as r,c as m,j as n}from"./index-C4KOdiuW.js";import{_ as d}from"./index-DcnXzgrr.js";import{i}from"./SearchMd-BjteSZXQ.js";function x(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function g(l){const e=r.c(9);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(i,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let a;e[4]!==t?(a=m("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=a):a=e[5];let c;return e[6]!==s||e[7]!==a?(c=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(d.Input,{"data-slot":"command-input",className:a,...s})]}),e[6]=s,e[7]=a,e[8]=c):c=e[8],c}function h(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function N(l){const e=r.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(d.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function b(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function _(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}export{N as C,v as a,_ as b,b as c,g as d,h as e,x as f};
1
+ import{e as r,c as m,j as n}from"./index-gKZjkMnf.js";import{_ as d}from"./index-CsTWePfc.js";import{i}from"./SearchMd-B4RJoOIR.js";function x(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function g(l){const e=r.c(9);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(i,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let a;e[4]!==t?(a=m("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=a):a=e[5];let c;return e[6]!==s||e[7]!==a?(c=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(d.Input,{"data-slot":"command-input",className:a,...s})]}),e[6]=s,e[7]=a,e[8]=c):c=e[8],c}function h(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function N(l){const e=r.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(d.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function b(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function _(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}export{N as C,v as a,_ as b,b as c,g as d,h as e,x as f};
@@ -1 +1 @@
1
- import{g as _}from"./connection-slug-eyAPH6o3.js";import{e as R,s as $,aH as A,K as L,c as E,j as x}from"./index-C4KOdiuW.js";import{u as D}from"./use-registry-connections-DzXuLNdG.js";import{a as K}from"./use-organization-settings-C1HGFbFZ.js";import{S as w,c as H}from"./constants-puxzW8Tt.js";import{u as Q}from"./useInfiniteQuery-H3t_tPfZ.js";import{i as F,f as q}from"./extract-connection-data-BFIbyEiI.js";import{C as G}from"./card-B6kxnNb0.js";import{I as U}from"./integration-icon-B-ypwxt-.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),n=e.get(l);n?n.push(o):e.set(l,[o])}const t=[],f=new Set;for(const o of s){const l=_(o);if(f.has(l))continue;f.add(l);const n=e.get(l),m=n[0];n.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:n})}return t}function le(){const s=R.c(6),e=D(),t=K(),f=$().project.enabledPlugins??[];let o;if(s[0]!==f||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=n=>t(n.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(V),f.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=f,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function V(s){return{id:s.id,title:s.title,icon:s.icon}}const X=24,S=3;function k(s){return s.id.includes("community-registry")}function Y(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,f){const o=s.map(u=>u.id).sort().join(","),l=Y(f),{data:n,fetchNextPage:m,hasNextPage:c,isFetchingNextPage:v,isLoading:p}=Q({queryKey:L.storeDiscovery(e,`${o}:${f??""}`),queryFn:async({pageParam:u})=>{const r=u??{};return await Promise.all(s.map(async i=>{const g=r[i.id];if(g==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const I=F(i.id,e);let b;for(let N=0;N<S;N++){let y=null;try{y=await H({connectionId:i.id,orgId:e});const d={limit:X};g&&(d.cursor=g),l&&(d.where=l);const C=await y.callTool({name:I,arguments:d}),P=C.structuredContent??C,j=P.nextCursor||P.cursor||void 0,M=q(P?[P]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:M,nextCursor:j}}catch(d){b=d}finally{await y?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,b),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:u=>{const r={};let a=!1;for(const i of u)i.registryId&&(i.nextCursor?(r[i.registryId]=i.nextCursor,a=!0):r[i.registryId]="EXHAUSTED");return a?r:void 0},staleTime:3600*1e3,placeholderData:A,retry:!1,enabled:t&&s.length>0}),h=[];if(n?.pages)for(const u of n.pages)for(const r of u)for(const a of r.items)h.push({...a,_sourceName:a._sourceName??r.registryTitle,_sourceIcon:a._sourceIcon??r.registryIcon,_registryId:a._registryId??r.registryId});return{items:h,hasMore:c??!1,isLoadingMore:v,isInitialLoading:p,fetchNextPage:()=>{c&&!v&&m()}}}function ce(s,e){const t=R.c(17),{org:f}=$();let o;t[0]!==s?(o=s.filter(W),t[0]=s,t[1]=o):o=t[1];const l=o;let n;t[2]!==s?(n=s.filter(z),t[2]=s,t[3]=n):n=t[3];const m=n,c=T(l,f.id,!0,e),v=!c.hasMore&&!c.isInitialLoading,p=T(m,f.id,v,e);let h;if(t[4]!==v||t[5]!==p||t[6]!==c.items){const N=new Set;h=[];const y=[...c.items];v&&y.push(...p.items);for(const d of y){const C=`${d._registryId}:${d.id}`;N.has(C)||(N.add(C),h.push(d))}t[4]=v,t[5]=p,t[6]=c.items,t[7]=h}else h=t[7];const u=c.isInitialLoading,r=c.isLoadingMore||p.isLoadingMore;let a;e:{if(c.hasMore){a=!0;break e}if(m.length>0){if(!v){a=!0;break e}a=p.hasMore;break e}a=!1}const i=a;let g;t[8]!==p||t[9]!==c?(g=()=>{if(c.hasMore){c.fetchNextPage();return}p.hasMore&&p.fetchNextPage()},t[8]=p,t[9]=c,t[10]=g):g=t[10];const I=g;let b;return t[11]!==i||t[12]!==u||t[13]!==r||t[14]!==h||t[15]!==I?(b={items:h,hasMore:i,isLoadingMore:r,isInitialLoading:u,loadMore:I},t[11]=i,t[12]=u,t[13]=r,t[14]=h,t[15]=I,t[16]=b):b=t[16],b}function z(s){return k(s)}function W(s){return!k(s)}function ue(s){const e=R.c(37),{connection:t,onClick:f,headerActions:o,headerActionsAlwaysVisible:l,body:n,footer:m,className:c,fallbackIcon:v}=s,p=l===void 0?!1:l,h=f&&"hover:bg-muted/50";let u;e[0]!==c||e[1]!==h?(u=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",h,c),e[0]=c,e[1]=h,e[2]=u):u=e[2];let r;e[3]!==t.icon||e[4]!==t.title||e[5]!==v?(r=x.jsx(U,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:v}),e[3]=t.icon,e[4]=t.title,e[5]=v,e[6]=r):r=e[6];let a;e[7]!==o||e[8]!==p?(a=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:B,children:o}),e[7]=o,e[8]=p,e[9]=a):a=e[9];let i;e[10]!==a?(i=x.jsx("div",{className:"relative",children:a}),e[10]=a,e[11]=i):i=e[11];let g;e[12]!==r||e[13]!==i?(g=x.jsxs("div",{className:"flex items-start justify-between",children:[r,i]}),e[12]=r,e[13]=i,e[14]=g):g=e[14];let I;e[15]!==t.title?(I=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=I):I=e[16];const b=t.description||"No description";let N;e[17]!==b?(N=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b}),e[17]=b,e[18]=N):N=e[18];let y;e[19]!==N||e[20]!==I?(y=x.jsxs("div",{className:"flex flex-col gap-1",children:[I,N]}),e[19]=N,e[20]=I,e[21]=y):y=e[21];let d;e[22]!==n?(d=n&&x.jsx("div",{children:n}),e[22]=n,e[23]=d):d=e[23];let C;e[24]!==y||e[25]!==d||e[26]!==g?(C=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[g,y,d]}),e[24]=y,e[25]=d,e[26]=g,e[27]=C):C=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:Z,children:m})}),e[28]=m,e[29]=P):P=e[29];let j;e[30]!==C||e[31]!==P?(j=x.jsxs("div",{className:"flex flex-col flex-1",children:[C,P]}),e[30]=C,e[31]=P,e[32]=j):j=e[32];let M;return e[33]!==f||e[34]!==j||e[35]!==u?(M=x.jsx(G,{className:u,onClick:f,children:j}),e[33]=f,e[34]=j,e[35]=u,e[36]=M):M=e[36],M}function Z(s){return s.stopPropagation()}function B(s){return s.stopPropagation()}export{ue as C,ce as a,ae as g,le as u};
1
+ import{g as _}from"./connection-slug-eyAPH6o3.js";import{e as R,s as $,aH as A,K as L,c as E,j as x}from"./index-gKZjkMnf.js";import{u as D}from"./use-registry-connections-BFqaVIUz.js";import{a as K}from"./use-organization-settings-DpXizr85.js";import{S as w,c as H}from"./constants-nJzh8CYx.js";import{u as Q}from"./useInfiniteQuery-B3rxurAJ.js";import{i as F,f as q}from"./extract-connection-data-5g73Imwy.js";import{C as G}from"./card-DUOq7Rl6.js";import{I as U}from"./integration-icon-BYjt2zM8.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),n=e.get(l);n?n.push(o):e.set(l,[o])}const t=[],f=new Set;for(const o of s){const l=_(o);if(f.has(l))continue;f.add(l);const n=e.get(l),m=n[0];n.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:n})}return t}function le(){const s=R.c(6),e=D(),t=K(),f=$().project.enabledPlugins??[];let o;if(s[0]!==f||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=n=>t(n.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(V),f.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=f,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function V(s){return{id:s.id,title:s.title,icon:s.icon}}const X=24,S=3;function k(s){return s.id.includes("community-registry")}function Y(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,f){const o=s.map(u=>u.id).sort().join(","),l=Y(f),{data:n,fetchNextPage:m,hasNextPage:c,isFetchingNextPage:v,isLoading:p}=Q({queryKey:L.storeDiscovery(e,`${o}:${f??""}`),queryFn:async({pageParam:u})=>{const r=u??{};return await Promise.all(s.map(async i=>{const g=r[i.id];if(g==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const I=F(i.id,e);let b;for(let N=0;N<S;N++){let y=null;try{y=await H({connectionId:i.id,orgId:e});const d={limit:X};g&&(d.cursor=g),l&&(d.where=l);const C=await y.callTool({name:I,arguments:d}),P=C.structuredContent??C,j=P.nextCursor||P.cursor||void 0,M=q(P?[P]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:M,nextCursor:j}}catch(d){b=d}finally{await y?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,b),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:u=>{const r={};let a=!1;for(const i of u)i.registryId&&(i.nextCursor?(r[i.registryId]=i.nextCursor,a=!0):r[i.registryId]="EXHAUSTED");return a?r:void 0},staleTime:3600*1e3,placeholderData:A,retry:!1,enabled:t&&s.length>0}),h=[];if(n?.pages)for(const u of n.pages)for(const r of u)for(const a of r.items)h.push({...a,_sourceName:a._sourceName??r.registryTitle,_sourceIcon:a._sourceIcon??r.registryIcon,_registryId:a._registryId??r.registryId});return{items:h,hasMore:c??!1,isLoadingMore:v,isInitialLoading:p,fetchNextPage:()=>{c&&!v&&m()}}}function ce(s,e){const t=R.c(17),{org:f}=$();let o;t[0]!==s?(o=s.filter(W),t[0]=s,t[1]=o):o=t[1];const l=o;let n;t[2]!==s?(n=s.filter(z),t[2]=s,t[3]=n):n=t[3];const m=n,c=T(l,f.id,!0,e),v=!c.hasMore&&!c.isInitialLoading,p=T(m,f.id,v,e);let h;if(t[4]!==v||t[5]!==p||t[6]!==c.items){const N=new Set;h=[];const y=[...c.items];v&&y.push(...p.items);for(const d of y){const C=`${d._registryId}:${d.id}`;N.has(C)||(N.add(C),h.push(d))}t[4]=v,t[5]=p,t[6]=c.items,t[7]=h}else h=t[7];const u=c.isInitialLoading,r=c.isLoadingMore||p.isLoadingMore;let a;e:{if(c.hasMore){a=!0;break e}if(m.length>0){if(!v){a=!0;break e}a=p.hasMore;break e}a=!1}const i=a;let g;t[8]!==p||t[9]!==c?(g=()=>{if(c.hasMore){c.fetchNextPage();return}p.hasMore&&p.fetchNextPage()},t[8]=p,t[9]=c,t[10]=g):g=t[10];const I=g;let b;return t[11]!==i||t[12]!==u||t[13]!==r||t[14]!==h||t[15]!==I?(b={items:h,hasMore:i,isLoadingMore:r,isInitialLoading:u,loadMore:I},t[11]=i,t[12]=u,t[13]=r,t[14]=h,t[15]=I,t[16]=b):b=t[16],b}function z(s){return k(s)}function W(s){return!k(s)}function ue(s){const e=R.c(37),{connection:t,onClick:f,headerActions:o,headerActionsAlwaysVisible:l,body:n,footer:m,className:c,fallbackIcon:v}=s,p=l===void 0?!1:l,h=f&&"hover:bg-muted/50";let u;e[0]!==c||e[1]!==h?(u=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",h,c),e[0]=c,e[1]=h,e[2]=u):u=e[2];let r;e[3]!==t.icon||e[4]!==t.title||e[5]!==v?(r=x.jsx(U,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:v}),e[3]=t.icon,e[4]=t.title,e[5]=v,e[6]=r):r=e[6];let a;e[7]!==o||e[8]!==p?(a=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:B,children:o}),e[7]=o,e[8]=p,e[9]=a):a=e[9];let i;e[10]!==a?(i=x.jsx("div",{className:"relative",children:a}),e[10]=a,e[11]=i):i=e[11];let g;e[12]!==r||e[13]!==i?(g=x.jsxs("div",{className:"flex items-start justify-between",children:[r,i]}),e[12]=r,e[13]=i,e[14]=g):g=e[14];let I;e[15]!==t.title?(I=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=I):I=e[16];const b=t.description||"No description";let N;e[17]!==b?(N=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b}),e[17]=b,e[18]=N):N=e[18];let y;e[19]!==N||e[20]!==I?(y=x.jsxs("div",{className:"flex flex-col gap-1",children:[I,N]}),e[19]=N,e[20]=I,e[21]=y):y=e[21];let d;e[22]!==n?(d=n&&x.jsx("div",{children:n}),e[22]=n,e[23]=d):d=e[23];let C;e[24]!==y||e[25]!==d||e[26]!==g?(C=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[g,y,d]}),e[24]=y,e[25]=d,e[26]=g,e[27]=C):C=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:Z,children:m})}),e[28]=m,e[29]=P):P=e[29];let j;e[30]!==C||e[31]!==P?(j=x.jsxs("div",{className:"flex flex-col flex-1",children:[C,P]}),e[30]=C,e[31]=P,e[32]=j):j=e[32];let M;return e[33]!==f||e[34]!==j||e[35]!==u?(M=x.jsx(G,{className:u,onClick:f,children:j}),e[33]=f,e[34]=j,e[35]=u,e[36]=M):M=e[36],M}function Z(s){return s.stopPropagation()}function B(s){return s.stopPropagation()}export{ue as C,ce as a,ae as g,le as u};
@@ -0,0 +1 @@
1
+ import{H as he,aI as Te,aJ as Ie,J as le,aK as Ae,e as $,j as t,l as ge,B,r as X,c as je,s as te,w as De,K as oe,f as Q,aL as ce,u as $e,aM as Pe,E as Oe,g as Me,o as ze,z as Ve,C as Ee,G as Ue,aN as Fe,x as q,F as Le}from"./index-gKZjkMnf.js";import{g as Re}from"./constants-CrD_AMxD.js";import{E as ve}from"./empty-state-CPpC79-7.js";import{E as He,c as Be,r as Ge,b as We,d as Xe}from"./connection-form-helpers-CgA-QNzF.js";import{c as Ke,S as qe}from"./index-DImBkhtD.js";import{u as be,T as Qe}from"./tools-list-CjPOU8GA.js";import{u as Je}from"./use-members-C8bjIWu8.js";import{A as Ye}from"./avatar-BQ09Qk0Z.js";import{a as Ne,b as ye,u as Ze}from"./use-connection-DLwIHVYP.js";import{u as ie,S as et}from"./constants-nJzh8CYx.js";import{b as tt}from"./use-mcp-tools-CyPVbfii.js";import{g as ae,M as st,a as nt}from"./types-CUVoLk-m.js";import{T as Y,b as ot,c as Z,a as it,d as at}from"./tabs-Bu_QsdLq.js";import{I as se}from"./integration-icon-BYjt2zM8.js";import{s as rt}from"./Plus-6a_0gFD5.js";import{a as _e}from"./Settings02-86F4b3dQ.js";import{s as re}from"./Trash01-Crqeojj8.js";import{e as lt,d as ct,r as dt,c as mt,s as ut}from"./index-C3hSkh4S.js";import{F as U,b as F,c as R,d as V,f as H,e as xt,a as pt}from"./form-yPmbpUVF.js";import{I as W}from"./input-Cet4kRAV.js";import{u as ft,D as ht}from"./use-delete-connection-DN8HxHVx.js";import{V as gt}from"./layout-BgwHTi9m.js";import{c as jt,C as vt,B as bt,a as Nt,b as yt,d as _t,e as Ct}from"./monitoring-stats-row-B9-AgFrN.js";import{b as St}from"./use-virtual-mcp-SIWEo5E_.js";import{i as Ce}from"./ChevronRight-DIr3-XeU.js";import{a as Se}from"./Users03-BEcIfaLP.js";import{g as we}from"./connection-slug-eyAPH6o3.js";import{c as wt}from"./ZapSquare-DgxRVJjy.js";import{T as kt,a as Tt}from"./agent-icon-DxobcFDr.js";import{b as It}from"./Tool01-Cxeqfwwz.js";import{C as At}from"./collection-search-CzSQR8Hb.js";import{C as Dt}from"./card-DUOq7Rl6.js";import{B as $t}from"./badge-Clg4Tzdw.js";import{D as Pt,a as Ot,b as Mt,c as de}from"./dropdown-menu-gP2-wJTw.js";import{S as me,a as ue,b as xe,c as pe,d as E}from"./select-B6R2tTSM.js";import{i as zt}from"./CheckCircle-BTDGGZJo.js";import{t as Vt}from"./ChevronDown-D098IDk9.js";import{n as Et}from"./Container-BvdKvtbe.js";import{s as ee}from"./Star01-BsL_E8DX.js";import{a as Ut}from"./RefreshCcw01-CmGHOB_j.js";import{s as Ft}from"./XClose-8tp9nQPE.js";import"./collections-CzE8C7FB.js";import"./SearchMd-B4RJoOIR.js";import"./index-Dlk19fTc.js";import"./index-BdUJIICa.js";import"./extract-connection-data-5g73Imwy.js";import"./use-registry-connections-BFqaVIUz.js";import"./use-organization-settings-DpXizr85.js";import"./index-CsTWePfc.js";import"./popover-dpRZqzOJ.js";import"./tooltip-DlUl6zVU.js";import"./use-create-virtual-mcp-B693GvUD.js";import"./use-navigate-to-agent-DuF5pNCT.js";import"./User01-lfQ-qZIG.js";import"./use-collections-DKaygmj-.js";import"./X-DSm8Y-S-.js";import"./label-CaWfIbuT.js";import"./alert-dialog-CscciHzk.js";import"./AlertCircle-DnJbX_0w.js";import"./ArrowNarrowLeft-M9-X6Sxy.js";import"./XCircle-D0NNu2cU.js";import"./ArrowUpRight-BQK-oA7E.js";import"./ChevronUp-qt4sL4uC.js";import"./DotsVertical-DGFUAKYN.js";import"./Palette-SeD4BOqL.js";import"./LinkExternal01-CS_vTEL0.js";import"./Lock01-DepQhBci.js";import"./Sun-CoYtwe4c.js";import"./Play-B2WhNMxb.js";import"./Shield01-CzaXyqoU.js";import"./Zap-GnwBp_Qp.js";const Lt=he({scopes:Ae(le()).describe("List of scopes available"),stateSchema:Te(le(),Ie()).describe("JSON Schema (draft-07) defining the state structure")}),Rt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Lt}];function Ht(s){const e=$.c(39),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o}=s;let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const d=be(c),l=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,u=l?"border-destructive/50 bg-destructive/5":"border-transparent";let p;e[2]!==u?(p=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=p):p=e[3];let a;e[4]!==n.icon||e[5]!==n.title?(a=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a):a=e[6];let f;e[7]!==n.title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=f):f=e[8];let h;e[9]!==l?(h=l&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=l,e[10]=h):h=e[10];let b;e[11]!==f||e[12]!==h?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,h]}),e[11]=f,e[12]=h,e[13]=b):b=e[13];let j;e[14]!==n||e[15]!==l||e[16]!==r?(j=l&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[14]=n,e[15]=l,e[16]=r,e[17]=j):j=e[17];let v;e[18]!==n||e[19]!==i?(v=()=>i(n),e[18]=n,e[19]=i,e[20]=v):v=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(_e,{size:13}),e[21]=S):S=e[21];let I;e[22]!==v?(I=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:v,title:"Configure",children:S}),e[22]=v,e[23]=I):I=e[23];let N;e[24]!==n||e[25]!==o?(N=()=>o(n),e[24]=n,e[25]=o,e[26]=N):N=e[26];let w;e[27]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(re,{size:13}),e[27]=w):w=e[27];let k;e[28]!==N?(k=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:N,title:"Delete",children:w}),e[28]=N,e[29]=k):k=e[29];let _;e[30]!==I||e[31]!==k||e[32]!==j?(_=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,I,k]}),e[30]=I,e[31]=k,e[32]=j,e[33]=_):_=e[33];let T;return e[34]!==_||e[35]!==p||e[36]!==a||e[37]!==b?(T=t.jsxs("div",{className:p,children:[a,b,_]}),e[34]=_,e[35]=p,e[36]=a,e[37]=b,e[38]=T):T=e[38],T}function Bt(s){const e=$.c(15),{instance:n,onConfigure:i}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let c;e[5]!==n||e[6]!==i?(c=()=>i(n),e[5]=n,e[6]=i,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_e,{size:13}),e[8]=d):d=e[8];let m;e[9]!==c?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:c,title:"Configure",children:d})}),e[9]=c,e[10]=m):m=e[10];let l;return e[11]!==r||e[12]!==o||e[13]!==m?(l=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,m]}),e[11]=r,e[12]=o,e[13]=m,e[14]=l):l=e[14],l}function Gt(s){const e=$.c(25),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onAdd:c,isAdding:d}=s;if(n.length===0)return null;const m=n.length===1?"Instance":"Instances";let l;e[0]!==m?(l=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[0]=m,e[1]=l):l=e[1];let u;e[2]!==d?(u=d?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(rt,{size:13}),e[2]=d,e[3]=u):u=e[3];let p;e[4]!==d||e[5]!==c||e[6]!==u?(p=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:c,disabled:d,children:[u,"Add instance"]}),e[4]=d,e[5]=c,e[6]=u,e[7]=p):p=e[7];let a;e[8]!==l||e[9]!==p?(a=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[l,p]}),e[8]=l,e[9]=p,e[10]=a):a=e[10];let f;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o){let j;e[16]!==r||e[17]!==i||e[18]!==o?(j=v=>t.jsx(X.Suspense,{fallback:t.jsx(Bt,{instance:v,onConfigure:i}),children:t.jsx(Ht,{instance:v,onConfigure:i,onAuthenticate:r,onDelete:o})},v.id),e[16]=r,e[17]=i,e[18]=o,e[19]=j):j=e[19],f=n.map(j),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=f}else f=e[15];let h;e[20]!==f?(h=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=h):h=e[21];let b;return e[22]!==a||e[23]!==h?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[a,h]}),e[22]=a,e[23]=h,e[24]=b):b=e[24],b}const Wt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Xt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Kt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function qt(s){const e=$.c(3),{connectionId:n,orgId:i,timeframe:r}=s;let o;e[0]!==i?(o={connectionId:et,orgId:i},e[0]=i,e[1]=o):o=e[1];const c=ie(o),d=Xt(r),{data:m}=De({queryKey:oe.connectionActivity(n,r,i),queryFn:async()=>{const f=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:d.startDate.toISOString(),endDate:d.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return f.structuredContent??f},staleTime:3e5}),l=jt(m?.logs??[],d),u=l.data,p=l.totalCalls>0;let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[2]=a):a=e[2],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),a]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),p?t.jsxs("div",{children:[t.jsx(vt,{config:Kt,className:"h-16 w-full",children:t.jsxs(bt,{data:u,barCategoryGap:"4%",children:[t.jsx(Nt,{content:t.jsx(yt,{labelFormatter:Jt}),cursor:{fill:"var(--muted)"}}),t.jsx(_t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Qt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Qt(s,e){return t.jsx(Ct,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function Jt(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Yt(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function Zt(s){const e=$.c(13),{connectionId:n}=s,[i,r]=X.useState("14d"),{org:o}=te();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=c):c=e[0];let d;e[1]!==i?(d=Wt.map(a=>t.jsx("button",{type:"button",onClick:()=>r(a.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value)),e[1]=i,e[2]=d):d=e[2];let m;e[3]!==d?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[c,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=m):m=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Yt,{}),e[5]=l):l=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==i?(u=t.jsx(X.Suspense,{fallback:l,children:t.jsx(qt,{connectionId:n,orgId:o.id,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=i,e[9]=u):u=e[9];let p;return e[10]!==m||e[11]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[10]=m,e[11]=u,e[12]=p):p=e[12],p}function es(s){const e=$.c(15),{virtualMcp:n,org:i}=s,r=Q();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:16}),e[4]=c):c=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:c}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let m;e[8]!==n.title?(m=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=m):m=e[9];let l;e[10]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=l):l=e[10];let u;return e[11]!==o||e[12]!==d||e[13]!==m?(u=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,m,l]}),e[11]=o,e[12]=d,e[13]=m,e[14]=u):u=e[14],u}function ts(s){const e=$.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let c;e[3]!==i?(c=d=>t.jsx(es,{virtualMcp:d,org:i},d.id),e[3]=i,e[4]=c):c=e[4],r=n.map(c),e[0]=i,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function ss(s){const e=$.c(7),{connection:n}=s,{org:i}=te();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=St(r);if(!(o.length>0)){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(t.Fragment,{}),e[2]=l):l=e[2],l}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=d):d=e[3];let m;return e[4]!==i.slug||e[5]!==o?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ts,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=m):m=e[6],m}function ns(s){const e=$.c(30),{tools:n,connectionId:i,org:r}=s,o=Q(),{org:c}=te();let d;e[0]!==i||e[1]!==c.id?(d={connectionId:i,orgId:c.id},e[0]=i,e[1]=c.id,e[2]=d):d=e[2];const m=ie(d),l=Ne(i);let u;e[3]!==l||e[4]!==i?(u=l?we(l):i,e[3]=l,e[4]=i,e[5]=u):u=e[5];const p=u,[a,f]=X.useState("");let h,b,j,v;if(e[6]!==p||e[7]!==m||e[8]!==o||e[9]!==r||e[10]!==a||e[11]!==n){const N=(n??[]).filter(os),w=a.toLowerCase().trim(),k=w?N.filter(g=>g.name.toLowerCase().includes(w)||g.description&&g.description.toLowerCase().includes(w)):N;let _;e[16]!==p||e[17]!==o||e[18]!==r?(_=g=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(g.name)}})},e[16]=p,e[17]=o,e[18]=r,e[19]=_):_=e[19];const T=_;j="flex flex-col h-full overflow-hidden";let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=g=>{g.key==="Escape"&&(f(""),g.target.blur())},e[20]=y):y=e[20],e[21]!==a?(v=t.jsx(At,{value:a,onChange:f,placeholder:"Search apps...",onKeyDown:y}),e[21]=a,e[22]=v):v=e[22],h="flex-1 overflow-auto p-5",b=k.length===0?t.jsx(ve,{image:null,title:a?"No apps found":"No apps available",description:a?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:k.map(g=>{const P=ae(g._meta);return t.jsxs(Dt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>T(g),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(st,{resourceURI:P,toolInfo:{tool:g},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:g.name}),t.jsx(Qe,{annotations:g.annotations,_meta:g._meta})]}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description})]})]},g.name)})}),e[6]=p,e[7]=m,e[8]=o,e[9]=r,e[10]=a,e[11]=n,e[12]=h,e[13]=b,e[14]=j,e[15]=v}else h=e[12],b=e[13],j=e[14],v=e[15];let S;e[23]!==h||e[24]!==b?(S=t.jsx("div",{className:h,children:b}),e[23]=h,e[24]=b,e[25]=S):S=e[25];let I;return e[26]!==j||e[27]!==v||e[28]!==S?(I=t.jsxs("div",{className:j,children:[v,S]}),e[26]=j,e[27]=v,e[28]=S,e[29]=I):I=e[29],I}function os(s){return!!ae(s._meta)}function ke(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=c=>c.charAt(0).toUpperCase()+c.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ne(s){const e=$.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function is(s){const e=$.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:c}=s;let d;e[0]!==i?(d=i===void 0?[]:i,e[0]=i,e[1]=d):d=e[1];const m=d;let l;e[2]!==r?(l=r===void 0?[]:r,e[2]=r,e[3]=l):l=e[3];const u=l,p=Q(),a=Ne(o??"");let f;e[4]!==a||e[5]!==o?(f=a?we(a):o,e[4]=a,e[5]=o,e[6]=f):f=e[6];const h=f;let b;e[7]!==h||e[8]!==o||e[9]!==p||e[10]!==c?(b=function(A){!o||!c||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:c,appSlug:h,collectionName:"tools",itemId:encodeURIComponent(A)}})},e[7]=h,e[8]=o,e[9]=p,e[10]=c,e[11]=b):b=e[11];const j=b;let v;e[12]!==o||e[13]!==c||e[14]!==n?(v=o&&c&&n.some(ls),e[12]=o,e[13]=c,e[14]=n,e[15]=v):v=e[15];const S=v;if(n.length+m.length+u.length===0){let C;return e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=C):C=e[16],C}let N;e[17]!==n.length?(N=t.jsxs(Y,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=N):N=e[18];let w;e[19]!==S?(w=S&&t.jsx(Y,{value:"apps",variant:"underline",children:"UI"}),e[19]=S,e[20]=w):w=e[20];let k,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Y,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(Y,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=_):(k=e[21],_=e[22]);let T;e[23]!==N||e[24]!==w?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(ot,{variant:"underline",className:"gap-1",children:[N,w,k,_]})}),e[23]=N,e[24]=w,e[25]=T):T=e[25];let y;e[26]!==j||e[27]!==n?(y=n.length>0?n.map(C=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>j(C.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(It,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:ke(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(ne,{label:"tools"}),e[26]=j,e[27]=n,e[28]=y):y=e[28];let g;e[29]!==y?(g=t.jsx(Z,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:y})}),e[29]=y,e[30]=g):g=e[30];let P;e[31]!==o||e[32]!==S||e[33]!==c||e[34]!==n?(P=S&&t.jsx(Z,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ns,{tools:n,connectionId:o,org:c})}),e[31]=o,e[32]=S,e[33]=c,e[34]=n,e[35]=P):P=e[35];let M;e[36]!==m?(M=m.length>0?m.map(rs):t.jsx(ne,{label:"prompts"}),e[36]=m,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(Z,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let D;e[40]!==u?(D=u.length>0?u.map(as):t.jsx(ne,{label:"resources"}),e[40]=u,e[41]=D):D=e[41];let z;e[42]!==D?(z=t.jsx(Z,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:D})}),e[42]=D,e[43]=z):z=e[43];let x;return e[44]!==T||e[45]!==g||e[46]!==P||e[47]!==O||e[48]!==z?(x=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(it,{defaultValue:"tools",variant:"underline",children:[T,g,P,O,z]})}),e[44]=T,e[45]=g,e[46]=P,e[47]=O,e[48]=z,e[49]=x):x=e[49],x}function as(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(kt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function rs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(wt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:ke(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function ls(s){return ae(s._meta)}function cs(s){const e=$.c(13),{connection:n,displayTitle:i}=s,r=i??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(se,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let c;e[3]!==r?(c=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=c):c=e[4];let d;e[5]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=d):d=e[6];let m;e[7]!==c||e[8]!==d?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,d]}),e[7]=c,e[8]=d,e[9]=m):m=e[9];let l;return e[10]!==o||e[11]!==m?(l=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,m]}),e[10]=o,e[11]=m,e[12]=l):l=e[12],l}function ds({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),c=ce({control:s.control,name:"connection_url"}),{stdioEnabled:d}=$e(),m=(()=>{if(typeof c!="string"||!c)return!1;try{const a=new URL(c);return a.hostname==="api.githubcopilot.com"&&a.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),l=d||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?Pe(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Se,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(U,{control:s.control,name:"ui_type",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:a.value,onValueChange:a.onChange,children:[t.jsx(V,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ee,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(E,{value:"HTTP",children:"HTTP"}),t.jsx(E,{value:"SSE",children:"SSE"}),t.jsx(E,{value:"Websocket",children:"Websocket"}),l&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:"NPX Package"}),t.jsx(E,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(U,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(F,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(W,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:a.value,onValueChange:a.onChange,children:[t.jsx(V,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(E,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(E,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(E,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Et,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(E,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(H,{})]})}),o==="NPX"&&t.jsx(U,{control:s.control,name:"npx_package",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(H,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(U,{control:s.control,name:"stdio_command",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(W,{placeholder:"node, bun, python...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(H,{})]})}),t.jsx(U,{control:s.control,name:"stdio_args",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(W,{placeholder:"arg1 arg2 --flag value",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(H,{})]})})]}),t.jsx(U,{control:s.control,name:"stdio_cwd",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(W,{placeholder:"/path/to/project (optional)",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(H,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(U,{control:s.control,name:"env_vars",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(He,{value:a.value??[],onChange:a.onChange})}),t.jsx(H,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(U,{control:s.control,name:"connection_token",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Pt,{children:[t.jsx(Ot,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs($t,{variant:"success",className:"gap-1.5",children:[t.jsx(zt,{size:12}),"Authenticated via OAuth",t.jsx(Vt,{size:12})]})})}),t.jsxs(Mt,{align:"start",children:[t.jsxs(de,{onClick:i,children:[t.jsx(Ut,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&a.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>a.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Ft,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(xt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(H,{})]})})]})}function ms(s){return s.command==="npx"}function us(s){return s.args?.find(e=>!e.startsWith("-"))??""}function xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Fe(s.connection_headers)){const i=s.connection_headers,r=Ge(i.envVars);if(ms(i)){const c=us(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=xs(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function ps(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=We(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Xe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function fs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:c,siblings:d}){const m=Q({from:"/$org/settings/connections/$appSlug"}),l=ze(),u=ye(),p=ft({onSuccess:()=>{d.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[a,f]=X.useState(null),[h,b]=X.useState(!1),j=be({connectionId:e}),{data:v}=Je(),S=v?.data?.members??[],I=a??s,N=S.find(x=>x.userId===I.created_by),k=s?.connection_type==="VIRTUAL"||j.isAuthenticated,_={...s,tools:r},T=Ke(_,Rt),y=Ve({resolver:Ee(Be),values:fe(a??s)}),g=y.formState.isDirty,P=async()=>{if(!await y.trigger())return;const C=y.getValues(),A=ps(C),G=a?.id??e;await u.update.mutateAsync({id:G,data:A}),y.reset(C)},M=()=>{y.reset(fe(a??s))},O=async x=>{const{token:C,tokenInfo:A,error:G}=await Le({connectionId:x,scope:"offline_access"});if(G||!C){q.error(`Authentication failed: ${G}`);return}if(A)try{const K=await fetch(`/api/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:A.accessToken,refreshToken:A.refreshToken,expiresIn:A.expiresIn,scope:A.scope,clientId:A.clientId,clientSecret:A.clientSecret,tokenEndpoint:A.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await u.update.mutateAsync({id:x,data:{connection_token:C}});else try{await u.update.mutateAsync({id:x,data:{}})}catch(J){console.warn("Failed to refresh connection tools after OAuth:",J)}}catch(K){console.error("Error saving OAuth token:",K),await u.update.mutateAsync({id:x,data:{connection_token:C}})}else await u.update.mutateAsync({id:x,data:{connection_token:C}});const L=new URL(`/mcp/${x}`,window.location.origin);await l.invalidateQueries({queryKey:oe.isMCPAuthenticated(L.href,null)}),q.success("Authentication successful")},D=()=>O(s.id),z=async()=>{try{const x=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const A=await x.text();q.error(`Failed to remove OAuth: ${A}`);return}const C=new URL(`/mcp/${s.id}`,window.location.origin);await l.invalidateQueries({queryKey:oe.isMCPAuthenticated(C.href,null)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(x){console.error("Error removing OAuth token:",x),q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(ht,{...p}),t.jsx(lt,{open:a!==null,onOpenChange:x=>{x||f(null)},children:t.jsxs(ct,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(dt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(mt,{className:"text-base",children:a?.title??s.title}),t.jsx(ut,{className:"text-xs",children:"Update URL, authentication, and other settings"}),N&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ye,{url:N.user?.image??void 0,fallback:N.user?.name??N.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:N.user?.name||N.user?.email})]})]}),t.jsxs(pt,{...y,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(U,{control:y.control,name:"title",render:({field:x})=>t.jsxs(F,{children:[t.jsx(R,{children:"Name"}),t.jsx(V,{children:t.jsx(W,{...x})}),t.jsx(H,{})]})}),t.jsx(U,{control:y.control,name:"description",render:({field:x})=>t.jsxs(F,{children:[t.jsx(R,{children:"Description"}),t.jsx(V,{children:t.jsx(W,{...x,value:x.value||""})}),t.jsx(H,{})]})})]}),t.jsx(ds,{form:y,connection:a??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:D,onRemoveOAuth:z}),t.jsx(qe,{connection:a??s,form:y,hasMcpBinding:T,isMCPAuthenticated:k,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:D,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:P,disabled:!g||i,className:"flex-1",children:i?"Saving…":"Save changes"}),g&&t.jsx(B,{variant:"outline",onClick:M,children:"Undo"}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=a??s;f(null),p.requestDelete(x)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},a?.id??s.id)]})}),t.jsx(gt,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(cs,{connection:s,displayTitle:(()=>{const x=d[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(Zt,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Gt,{instances:d,onConfigure:x=>f(x),onAuthenticate:x=>O(x.id),onDelete:x=>p.requestDelete(x),isAdding:h,onAdd:async()=>{b(!0);try{const x=d[0]??s,C=x.title.replace(/\s*\(\d+\)\s*$/,""),A=d.length+1,G=`${C} (${A})`,L=Re("conn");await u.create.mutateAsync({id:L,title:G,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/mcp/${L}`,window.location.origin),J=await Ue({url:K.href,token:null});J.supportsOAuth&&!J.isAuthenticated&&await O(L)}finally{b(!1)}}}),t.jsx(ss,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(is,{tools:r,prompts:o,resources:c,connectionId:e,org:n})})]})})]})})]})}function hs(){const s=$.c(38);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Q(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=Me(i),{org:c}=te(),d=ye();let m;s[2]!==r?(m={slug:r},s[2]=r,s[3]=m):m=s[3];const l=Ze(m),u=l[0]??null,p=u?.id??"",a=p||null;let f;s[4]!==c.id||s[5]!==a?(f={connectionId:a,orgId:c.id},s[4]=c.id,s[5]=a,s[6]=f):f=s[6];const h=ie(f);let b;s[7]!==h?(b={client:h},s[7]=h,s[8]=b):b=s[8];const{data:j}=tt(b);let v;if(s[9]!==u?.tools||s[10]!==p||s[11]!==l||s[12]!==j){const D=j?j.tools.map(ys):(u?.tools??[]).map(Ns);e:{if(l.length<=1){v=D;break e}const z=new Set,x=[],C=vs;for(const A of l){const G=A.id===p?D:C(A.tools);for(const L of G)z.has(L.name)||(z.add(L.name),x.push(L))}v=x.length>0?x:D}s[9]=u?.tools,s[10]=p,s[11]=l,s[12]=j,s[13]=v}else v=s[13];const S=v;let I;s[14]!==h?(I={client:h},s[14]=h,s[15]=I):I=s[15];const{data:N}=at(I);let w;s[16]!==h?(w={client:h},s[16]=h,s[17]=w):w=s[17];const{data:k}=nt(w);let _;s[18]!==N?.prompts?(_=N?.prompts??[],s[18]=N?.prompts,s[19]=_):_=s[19];let T;s[20]!==_?(T=_.map(js),s[20]=_,s[21]=T):T=s[21];const y=T;let g;s[22]!==k?.resources?(g=k?.resources??[],s[22]=k?.resources,s[23]=g):g=s[23];let P;s[24]!==g?(P=g.map(gs),s[24]=g,s[25]=P):P=s[25];const M=P;if(!u){let D;return s[26]!==n||s[27]!==o?(D=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(B,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[26]=n,s[27]=o,s[28]=D):D=s[28],D}let O;return s[29]!==d.update.isPending||s[30]!==S||s[31]!==u||s[32]!==p||s[33]!==o||s[34]!==y||s[35]!==M||s[36]!==l?(O=t.jsx(fs,{org:o,connection:u,connectionId:p,isUpdating:d.update.isPending,tools:S,prompts:y,resources:M,siblings:l}),s[29]=d.update.isPending,s[30]=S,s[31]=u,s[32]=p,s[33]=o,s[34]=y,s[35]=M,s[36]=l,s[37]=O):O=s[37],O}function gs(s){return{name:s.name,description:s.description,uri:s.uri}}function js(s){return{name:s.name,description:s.description}}function vs(s){return(s??[]).map(bs)}function bs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ns(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function _s(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Oe,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(hs,{})})}),s[0]=e):e=s[0],e}function Rn(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_s,{}),s[0]=e):e=s[0],e}export{Rn as default};
@@ -0,0 +1 @@
1
+ import{H as R,aI as V,aJ as A,J as a,aK as j,ap as z,e as K,j as u,B as C}from"./index-gKZjkMnf.js";import{I as H}from"./input-Cet4kRAV.js";import{s as L}from"./Plus-6a_0gFD5.js";import{s as W}from"./Trash01-Crqeojj8.js";const q=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(q).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:V(a(),A()).nullable().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 $(n){const e=n.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(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=K.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(W,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(L,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function I(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function J(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("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 r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Y(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=I(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=I(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,Y as a,Q as b,M as c,Z as d,J as i,F as p,D as r};
@@ -0,0 +1 @@
1
+ import{e as ie,j as t,E as Ye,r as W,l as ce,s as _e,f as Se,d as Je,b as be,u as Ze,Q as et,R as tt,z as nt,C as st,B,t as te,o as ot,c as re,x as G,G as it,F as lt,K as ct}from"./index-gKZjkMnf.js";import{g as rt}from"./constants-CrD_AMxD.js";import{C as at}from"./collection-display-button-BZwsY1Wv.js";import{S as dt}from"./search-input-BTdLweUR.js";import{C as mt}from"./collection-tabs-DVyOXsXh.js";import{u as ut,a as Ne,g as pt,C as ge}from"./connection-card-C2vEoZIt.js";import{E as ht}from"./empty-state-CPpC79-7.js";import{I as xt}from"./integration-icon-BYjt2zM8.js";import{P as de}from"./index-C3hSkh4S.js";import{u as ft,D as gt}from"./use-delete-connection-DN8HxHVx.js";import{u as jt}from"./use-infinite-scroll-B32XN73V.js";import{u as yt}from"./use-list-state-Cwr5OloB.js";import{g as ke,a as Ct,e as vt}from"./extract-connection-data-5g73Imwy.js";import{g as ue}from"./connection-slug-eyAPH6o3.js";import{c as De,d as Ae,b as we,f as Te,e as Ie,g as Pe,a as Le,A as Oe}from"./alert-dialog-CscciHzk.js";import{C as $e}from"./checkbox-D2GZcsVt.js";import{b as Ee,a as ze,c as Fe,d as Me,e as Ve,D as Be}from"./dialog-CVDAkUpR.js";import{b as _t,a as St,c as bt,D as Nt,d as kt,e as Dt,f as At}from"./drawer-CFg3CiQr.js";import{u as wt}from"./tooltip-DlUl6zVU.js";import{D as Re,a as Ue,b as He,c as pe}from"./dropdown-menu-gP2-wJTw.js";import{F as Q,b as Y,c as J,d as Z,f as ee,a as Ce}from"./form-yPmbpUVF.js";import{I as oe}from"./input-Cet4kRAV.js";import{S as Tt,a as It,b as Pt,c as Lt,d as le}from"./select-B6R2tTSM.js";import{T as Ot}from"./textarea-BPX5qWaA.js";import{b as Ke,u as $t}from"./use-connection-DLwIHVYP.js";import{u as Et,S as zt}from"./constants-nJzh8CYx.js";import{b as Ft}from"./use-virtual-mcp-SIWEo5E_.js";import{a as Mt,S as Vt}from"./agent-icon-DxobcFDr.js";import{n as he}from"./Container-BvdKvtbe.js";import{i as We}from"./DotsVertical-DGFUAKYN.js";import{s as Xe}from"./RefreshCcw01-CmGHOB_j.js";import{s as fe}from"./Star01-BsL_E8DX.js";import{s as qe}from"./Plus-6a_0gFD5.js";import{s as Ge}from"./Trash01-Crqeojj8.js";import{s as Qe}from"./XClose-8tp9nQPE.js";import{i as me,a as ve,E as Bt,c as Rt,p as Ut,b as Ht,d as Kt}from"./connection-form-helpers-CgA-QNzF.js";import"./collections-CzE8C7FB.js";import"./ChevronDown-D098IDk9.js";import"./view-mode-toggle-CussfoqD.js";import"./badge-Clg4Tzdw.js";import"./SearchMd-B4RJoOIR.js";import"./use-registry-connections-BFqaVIUz.js";import"./use-organization-settings-DpXizr85.js";import"./useInfiniteQuery-B3rxurAJ.js";import"./infiniteQueryObserver-B9PWohpE.js";import"./card-DUOq7Rl6.js";import"./X-DSm8Y-S-.js";import"./use-view-mode-D9sT86SW.js";import"./ChevronRight-DIr3-XeU.js";import"./label-CaWfIbuT.js";import"./ChevronUp-qt4sL4uC.js";import"./use-collections-DKaygmj-.js";import"./AlertCircle-DnJbX_0w.js";import"./Tool01-Cxeqfwwz.js";import"./ArrowNarrowLeft-M9-X6Sxy.js";import"./XCircle-D0NNu2cU.js";import"./ArrowUpRight-BQK-oA7E.js";import"./ZapSquare-DgxRVJjy.js";import"./Users03-BEcIfaLP.js";import"./CheckCircle-BTDGGZJo.js";import"./Palette-SeD4BOqL.js";import"./LinkExternal01-CS_vTEL0.js";import"./Lock01-DepQhBci.js";import"./Sun-CoYtwe4c.js";import"./Play-B2WhNMxb.js";import"./Settings02-86F4b3dQ.js";import"./Shield01-CzaXyqoU.js";import"./User01-lfQ-qZIG.js";import"./Zap-GnwBp_Qp.js";function Wt(y){const e=ie.c(51),{group:n,onOpen:f,selectionMode:m,selectedIds:d,onToggleSelect:i}=y;let v;if(e[0]!==n.connections||e[1]!==d){let j;e[3]!==d?(j=R=>d.has(R.id),e[3]=d,e[4]=j):j=e[4],v=n.connections.every(j),e[0]=n.connections,e[1]=d,e[2]=v}else v=e[2];const h=v;let _;if(e[5]!==n.connections||e[6]!==d){let j;e[8]!==d?(j=R=>d.has(R.id),e[8]=d,e[9]=j):j=e[9],_=n.connections.some(j),e[5]=n.connections,e[6]=d,e[7]=_}else _=e[7];const u=_,S=`${n.connections.length} instances`;let x;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(x={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=x):x=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==f||e[17]!==i||e[18]!==d||e[19]!==m?(a=()=>m?(()=>{for(const j of n.connections)h?d.has(j.id)&&i(j.id):d.has(j.id)||i(j.id)})():f(),e[14]=h,e[15]=n.connections,e[16]=f,e[17]=i,e[18]=d,e[19]=m,e[20]=a):a=e[20];const p=m&&h&&"ring-2 ring-primary",g=m&&u&&!h&&"ring-1 ring-primary/50";let k;e[21]!==p||e[22]!==g?(k=re(p,g),e[21]=p,e[22]=g,e[23]=k):k=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(he,{}),e[24]=A):A=e[24];let N;e[25]!==h||e[26]!==n.connections||e[27]!==i||e[28]!==d||e[29]!==m||e[30]!==u?(N=m?t.jsx($e,{checked:h?!0:u?"indeterminate":!1,onCheckedChange:()=>{for(const j of n.connections)h?d.has(j.id)&&i(j.id):d.has(j.id)||i(j.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=i,e[28]=d,e[29]=m,e[30]=u,e[31]=N):N=e[31];const I=m?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let s;e[32]!==I?(s=re("overflow-hidden transition-all duration-150 ease-out",I),e[32]=I,e[33]=s):s=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(Ue,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qt,children:t.jsx(We,{size:20})})}),e[34]=D):D=e[34];let M;e[35]!==f?(M=j=>{j.stopPropagation(),f()},e[35]=f,e[36]=M):M=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Xe,{size:16}),e[37]=$):$=e[37];let P;e[38]!==M?(P=t.jsxs(Re,{children:[D,t.jsx(He,{align:"end",onClick:Xt,children:t.jsxs(pe,{onClick:M,children:[$,"Open"]})})]}),e[38]=M,e[39]=P):P=e[39];let T;e[40]!==s||e[41]!==P?(T=t.jsx("div",{className:s,children:P}),e[40]=s,e[41]=P,e[42]=T):T=e[42];let z;e[43]!==N||e[44]!==T?(z=t.jsxs("div",{className:"flex items-center gap-1",children:[N,T]}),e[43]=N,e[44]=T,e[45]=z):z=e[45];let F;return e[46]!==z||e[47]!==x||e[48]!==a||e[49]!==k?(F=t.jsx(t.Fragment,{children:t.jsx(ge,{connection:x,onClick:a,className:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:z})}),e[46]=z,e[47]=x,e[48]=a,e[49]=k,e[50]=F):F=e[50],F}function Xt(y){return y.stopPropagation()}function qt(y){return y.stopPropagation()}function Gt(y){const e=ie.c(28),{count:n,total:f,onSelectAll:m,onDeselectAll:d,onDelete:i,onAddToAgent:v,onToggleStatus:h,onCancel:_}=y;if(n===0)return null;let u;e[0]!==n?(u=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=u):u=e[1];let S;e[2]!==n||e[3]!==d||e[4]!==m||e[5]!==f?(S=n<f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:["Select all (",f,")"]}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:"Clear selection"}),e[2]=n,e[3]=d,e[4]=m,e[5]=f,e[6]=S):S=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:13}),e[7]=x):x=e[7];let a;e[8]!==v?(a=t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:v,children:[x,"Add to Agent"]}),e[8]=v,e[9]=a):a=e[9];let p;e[10]!==h?(p=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("active"),children:"Enable"}),e[10]=h,e[11]=p):p=e[11];let g;e[12]!==h?(g=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("inactive"),children:"Disable"}),e[12]=h,e[13]=g):g=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ge,{size:13}),e[14]=k):k=e[14];let A;e[15]!==i?(A=t.jsxs(B,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:[k,"Delete"]}),e[15]=i,e[16]=A):A=e[16];let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Qe,{size:13}),e[17]=N):N=e[17];let I;e[18]!==_?(I=t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:_,children:N}),e[18]=_,e[19]=I):I=e[19];let s;return e[20]!==u||e[21]!==I||e[22]!==S||e[23]!==a||e[24]!==p||e[25]!==g||e[26]!==A?(s=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[u,S,a,p,g,A,I]})}),e[20]=u,e[21]=I,e[22]=S,e[23]=a,e[24]=p,e[25]=g,e[26]=A,e[27]=s):s=e[27],s}function Qt(y){const e=ie.c(25),{open:n,onOpenChange:f,agents:m,onConfirm:d}=y,[i,v]=W.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Fe,{children:[t.jsx(Me,{children:"Add to Agent"}),t.jsx(Ve,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let _;e[1]!==m||e[2]!==i?(_=m.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):m.map(N=>t.jsxs("button",{type:"button",onClick:()=>v(N.id),className:re("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===N.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{icon:N.icon,name:N.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:N.title}),N.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.description})]})]},N.id)),e[1]=m,e[2]=i,e[3]=_):_=e[3];let u;e[4]!==_?(u=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:_}),e[4]=_,e[5]=u):u=e[5];let S;e[6]!==f?(S=t.jsx(B,{variant:"outline",onClick:()=>f(!1),children:"Cancel"}),e[6]=f,e[7]=S):S=e[7];const x=!i;let a;e[8]!==d||e[9]!==f||e[10]!==i?(a=()=>{i&&(d(i),f(!1),v(null))},e[8]=d,e[9]=f,e[10]=i,e[11]=a):a=e[11];let p;e[12]!==x||e[13]!==a?(p=t.jsx(B,{disabled:x,onClick:a,children:"Add"}),e[12]=x,e[13]=a,e[14]=p):p=e[14];let g;e[15]!==S||e[16]!==p?(g=t.jsxs(Be,{children:[S,p]}),e[15]=S,e[16]=p,e[17]=g):g=e[17];let k;e[18]!==u||e[19]!==g?(k=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,u,g]}),e[18]=u,e[19]=g,e[20]=k):k=e[20];let A;return e[21]!==f||e[22]!==n||e[23]!==k?(A=t.jsx(Ee,{open:n,onOpenChange:f,children:k}),e[21]=f,e[22]=n,e[23]=k,e[24]=A):A=e[24],A}function Yt(y){const e=ie.c(20),{open:n,onOpenChange:f,count:m,onConfirm:d}=y,i=m!==1?"s":"";let v;e[0]!==m||e[1]!==i?(v=t.jsxs(De,{children:["Delete ",m," connection",i,"?"]}),e[0]=m,e[1]=i,e[2]=v):v=e[2];const h=m!==1?"s":"";let _;e[3]!==h?(_=t.jsxs(Ae,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=_):_=e[4];let u;e[5]!==v||e[6]!==_?(u=t.jsxs(we,{children:[v,_]}),e[5]=v,e[6]=_,e[7]=u):u=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Te,{children:"Cancel"}),e[8]=S):S=e[8];const x=m!==1?"s":"";let a;e[9]!==m||e[10]!==d||e[11]!==x?(a=t.jsxs(Ie,{children:[S,t.jsxs(Pe,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",m," connection",x]})]}),e[9]=m,e[10]=d,e[11]=x,e[12]=a):a=e[12];let p;e[13]!==u||e[14]!==a?(p=t.jsxs(Le,{children:[u,a]}),e[13]=u,e[14]=a,e[15]=p):p=e[15];let g;return e[16]!==f||e[17]!==n||e[18]!==p?(g=t.jsx(Oe,{open:n,onOpenChange:f,children:p}),e[16]=f,e[17]=n,e[18]=p,e[19]=g):g=e[19],g}function Jt(y){return y._registryId?.includes("community-registry")===!0}function Zt(y){const e=ie.c(56),{item:n,allConnections:f,connectedAppNames:m,connectingItemId:d,onNavigateConnected:i,onConnect:v}=y,[h,_]=W.useState(!1),[u,S]=W.useState(null);let x,a;e[0]!==m||e[1]!==n?(x=ke(n)??"",a=m.has(x),e[0]=m,e[1]=n,e[2]=x,e[3]=a):(x=e[2],a=e[3]);const p=a,g=n._meta?.["mcp.mesh"],k=g?.friendlyName||g?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",A=n.server?.description||n.description||null;let N;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(N=n.server?.icons?.[0]?.src||Ct(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=N):N=e[6];const I=N;let s;if(e[7]!==f||e[8]!==x){let b;e[10]!==x?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===x,e[10]=x,e[11]=b):b=e[11],s=f.filter(b),e[7]=f,e[8]=x,e[9]=s}else s=e[9];const D=s;let M;e[12]!==n?(M=Jt(n),e[12]=n,e[13]=M):M=e[13];const $=M;let P,T;e[14]!==D||e[15]!==$||e[16]!==p||e[17]!==n||e[18]!==v||e[19]!==i?(P=()=>{if(p){const b=D[0];b&&i(b);return}T()},T=()=>{$?(S("connect"),_(!0)):v(n)},e[14]=D,e[15]=$,e[16]=p,e[17]=n,e[18]=v,e[19]=i,e[20]=P,e[21]=T):(P=e[20],T=e[21]);let z;e[22]!==n||e[23]!==v||e[24]!==u?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),_(!1),u==="connect"&&v(n),S(null)},e[22]=n,e[23]=v,e[24]=u,e[25]=z):z=e[25];const F=z;let j;e[26]!==A||e[27]!==I||e[28]!==k?(j={title:k,description:A,icon:I},e[26]=A,e[27]=I,e[28]=k,e[29]=j):j=e[29];let R;e[30]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(he,{}),e[30]=R):R=e[30];let U;e[31]!==$||e[32]!==n._sourceIcon?(U=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[31]=$,e[32]=n._sourceIcon,e[33]=U):U=e[33];let X;e[34]!==d||e[35]!==T||e[36]!==p||e[37]!==n.id?(X=p?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:d!==null,onClick:b=>{b.stopPropagation(),T()},children:d===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[34]=d,e[35]=T,e[36]=p,e[37]=n.id,e[38]=X):X=e[38];let o;e[39]!==U||e[40]!==X?(o=t.jsxs("div",{className:"flex items-center gap-2",children:[U,X]}),e[39]=U,e[40]=X,e[41]=o):o=e[41];let C;e[42]!==P||e[43]!==o||e[44]!==j?(C=t.jsx(ge,{connection:j,fallbackIcon:R,onClick:P,headerActionsAlwaysVisible:!0,headerActions:o}),e[42]=P,e[43]=o,e[44]=j,e[45]=C):C=e[45];let V;e[46]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(we,{children:[t.jsx(De,{children:"Community MCP Server"}),t.jsx(Ae,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[46]=V):V=e[46];let H;e[47]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Te,{children:"Cancel"}),e[47]=H):H=e[47];let E;e[48]!==F?(E=t.jsxs(Le,{children:[V,t.jsxs(Ie,{children:[H,t.jsx(Pe,{onClick:F,children:"Continue"})]})]}),e[48]=F,e[49]=E):E=e[49];let l;e[50]!==h||e[51]!==E?(l=t.jsx(Oe,{open:h,onOpenChange:_,children:E}),e[50]=h,e[51]=E,e[52]=l):l=e[52];let O;return e[53]!==C||e[54]!==l?(O=t.jsxs(t.Fragment,{children:[C,l]}),e[53]=C,e[54]=l,e[55]=O):O=e[55],O}function en({listState:y,activeTab:e,typeFilter:n,statusFilter:f,registryFilter:m,enabledRegistries:d}){const{org:i}=_e(),v=ot(),h=Se(),{data:_}=be.useSession(),u=Ke(),S=$t(y),x=ft(),[a,p]=W.useState(new Set),g=a.size>0,[k,A]=W.useState(!1),[N,I]=W.useState(!1),[s,D]=W.useState(null),M=Ft(),$=S.filter(c=>!(n!=="ALL"&&c.connection_type!==n||f!=="ALL"&&c.status!==f)),P=pt($),T=c=>{p(r=>{const w=new Set(r);return w.has(c)?w.delete(c):w.add(c),w})},z=()=>{p(new Set)},F=Ne(d,y.searchTerm),j=F.items,R=jt(F.loadMore,F.hasMore,F.isLoadingMore),U=new Set(S.filter(c=>c.app_name).map(c=>c.app_name)),X=m==="ALL"||d.some(c=>c.id===m)?m:"ALL",o=y.search.length>0,C=e==="all"||o?j.filter(c=>{if(X!=="ALL"&&c._registryId!==X)return!1;if(o){const r=ke(c);if(r&&U.has(r))return!1}return!0}):[],V=e==="connected"||o?P:[],H=async c=>{if(!(!i||!_?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:c.id,source:"connections_page"}),D(c.id);try{const r=vt(c,i.id,_.user.id,{remoteIndex:0}),w=r.connection_type==="STDIO",L=!!r.connection_url,q=w&&r.connection_headers&&typeof r.connection_headers=="object"&&"command"in r.connection_headers;if(!L&&!q){G.error("This MCP Server cannot be connected: no connection method available"),D(null);return}const{id:K}=await u.create.mutateAsync(r),je=new URL(`/mcp/${K}`,window.location.origin),ye=await it({url:je.href,token:null});if(ye.supportsOAuth&&!ye.isAuthenticated){const{token:ae,tokenInfo:ne,error:xe}=await lt({connectionId:K,scope:"offline_access"});if(xe||!ae){te("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:xe??"no_token"}),G.error(`Authentication failed: ${xe??"no token received"}`);return}else{if(te("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),ne)try{(await fetch(`/api/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ne.accessToken,refreshToken:ne.refreshToken,expiresIn:ne.expiresIn,scope:ne.scope,clientId:ne.clientId,clientSecret:ne.clientSecret,tokenEndpoint:ne.tokenEndpoint})})).ok?await u.update.mutateAsync({id:K,data:{}}):await u.update.mutateAsync({id:K,data:{connection_token:ae}})}catch{await u.update.mutateAsync({id:K,data:{connection_token:ae}})}else await u.update.mutateAsync({id:K,data:{connection_token:ae}});await v.invalidateQueries({queryKey:ct.isMCPAuthenticated(je.href,null)}),G.success("Authentication successful")}}G.success("Connected successfully")}catch(r){G.error(`Failed to connect: ${r instanceof Error?r.message:String(r)}`)}finally{D(null)}}},E=Et({connectionId:zt,orgId:i.id}),l=()=>{v.invalidateQueries({predicate:c=>{const r=c.queryKey;return r[1]===i.id&&r[3]==="collection"&&r[4]==="CONNECTIONS"}})},O=async()=>{A(!1);const c=[...a];te("connections_bulk_delete",{count:c.length});let r=0;for(const w of c)try{(await E.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:w,force:!0}})).isError||r++}catch{}l(),G.success(`Deleted ${r} connection${r!==1?"s":""}`),z()},b=async c=>{const r=[...a];te("connections_bulk_status_toggled",{count:r.length,to_status:c});let w=0;for(const L of r)try{await u.update.mutateAsync({id:L,data:{status:c}}),w++}catch{}l(),G.success(`${c==="active"?"Enabled":"Disabled"} ${w} connection${w!==1?"s":""}`),z()},se=async c=>{const r=M.find(q=>q.id===c);if(!r||!E)return;te("connections_bulk_add_to_agent",{agent_id:c,count:a.size});const w=new Set(r.connections.map(q=>q.connection_id)),L=[...a].filter(q=>!w.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(L.length===0){G.info("All selected connections are already in that agent");return}try{await E.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{connections:[...r.connections,...L]}}}),v.invalidateQueries({predicate:q=>{const K=q.queryKey;return K[1]===i.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),G.success(`Added ${L.length} connection${L.length!==1?"s":""} to "${r.title}"`),z()}catch{G.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(gt,{...x}),t.jsx(Yt,{open:k,onOpenChange:A,count:a.size,onConfirm:O}),t.jsx(Qt,{open:N,onOpenChange:I,agents:M,onConfirm:se}),F.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(o?C.length===0&&$.length===0:e==="all"?C.length===0:$.length===0)?t.jsx(ht,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:y.search?`No Connections match "${y.search}"`:"Create a connection to get started."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[V.map(c=>{if(c.type==="group")return t.jsx(Wt,{group:c,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:c.key}})},selectionMode:g,selectedIds:a,onToggleSelect:T},c.key);const r=c.connection,w=a.has(r.id);return t.jsx(ge,{connection:r,fallbackIcon:t.jsx(he,{}),onClick:()=>g?T(r.id):h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(r)}}),className:re(w&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[g?t.jsx($e,{checked:w,onCheckedChange:()=>T(r.id),onClick:L=>L.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:re("overflow-hidden transition-all duration-150 ease-out",g?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Re,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:L=>L.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(He,{align:"end",onClick:L=>L.stopPropagation(),children:[t.jsxs(pe,{onClick:L=>{L.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(r)}})},children:[t.jsx(Xe,{size:16}),"Open"]}),t.jsxs(pe,{onClick:L=>{L.stopPropagation(),T(r.id)},children:[t.jsx(Vt,{size:16}),"Select"]}),t.jsxs(pe,{variant:"destructive",onClick:L=>{L.stopPropagation(),x.requestDelete(r)},children:[t.jsx(Ge,{size:16}),"Delete"]})]})]})})]})},r.id)}),C.map(c=>t.jsx(Zt,{item:c,allConnections:S,connectedAppNames:U,connectingItemId:s,onNavigateConnected:r=>h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(r)}}),onConnect:H},`catalog-${c._registryId}:${c.id}`)),(e==="all"||o)&&d.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||o)&&F.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),g&&t.jsx(Gt,{count:a.size,total:$.length,onSelectAll:()=>{p(new Set($.map(c=>c.id)))},onDeselectAll:()=>p(new Set),onDelete:()=>A(!0),onAddToAgent:()=>I(!0),onToggleStatus:b,onCancel:z})]})}function tn(){const{org:y}=_e(),e=Se(),n=Je({strict:!1}),{data:f}=be.useSession(),{stdioEnabled:m}=Ze(),d=wt(),i=yt({namespace:y.slug,resource:"connections"}),v=Ke(),[h,_]=et(tt.connectionsTab(y.slug),o=>n.tab==="all"||n.tab==="connected"?n.tab:o??"all"),[u,S]=W.useState("ALL"),[x,a]=W.useState("ALL"),[p,g]=W.useState("ALL"),k=ut(),N=Ne(k,i.searchTerm).items,I=i.search!==i.searchTerm,s=nt({resolver:st(Rt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),D=s.watch("ui_type"),M=s.watch("connection_url"),$=s.watch("npx_package"),P=me({uiType:D,connectionUrl:M??"",npxPackage:$??""})??ve({uiType:D,connectionUrl:M??"",registryItems:N}),T=n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:y.slug},search:{action:"create"}})},F=()=>{e({to:"/$org/settings/connections",params:{org:y.slug},search:{}})},j=async o=>{let C,V=null,H=null,E=null;o.ui_type==="NPX"?(C="STDIO",V="",E=Ht(o.npx_package||"",o.env_vars||[])):o.ui_type==="STDIO"?(C="STDIO",V="",E=Kt(o.stdio_command||"",o.stdio_args||"",o.stdio_cwd,o.env_vars||[])):(C=o.ui_type,V=o.connection_url||"",H=o.connection_token||null);const l=rt("conn");te("connection_custom_created",{connection_type:C,ui_type:o.ui_type}),await v.create.mutateAsync({id:l,title:o.title,description:o.description||null,connection_type:C,connection_url:V,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f?.user?.id||"system",organization_id:y.id,icon:o.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),F(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:ue({app_name:null,connection_url:V,title:o.title,id:l})}})},R=o=>{o||(T&&F(),s.reset())},U=o=>{const C=o.trim();if(!C)return;const V=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,l=b=>{if(b&&(!V&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!E&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],c=new Set(se.map(w=>w.key)),r=b.envVarKeys.filter(w=>!c.has(w));r.length>0&&s.setValue("env_vars",[...se,...r.map(w=>({key:w,value:""}))],{shouldDirty:!0})}},O=Ut(C);if(O&&m){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",O.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),l(me({uiType:"NPX",npxPackage:O.packageName}));return}if(C.startsWith("http://")||C.startsWith("https://")){const b=D==="HTTP"||D==="SSE"||D==="Websocket"?D:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",C,{shouldDirty:!0}),l(me({uiType:b,connectionUrl:C})??ve({uiType:b,connectionUrl:C,registryItems:N}));return}D==="NPX"&&l(me({uiType:"NPX",npxPackage:C}))},X=t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(B,{variant:"outline",onClick:z,children:[t.jsx(qe,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})});return t.jsx(t.Fragment,{children:t.jsxs(de,{children:[(()=>{const o="Create Connection",C="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Type *"}),t.jsxs(Tt,{value:l.value,onValueChange:l.onChange,children:[t.jsx(Z,{children:t.jsx(It,{children:t.jsx(Pt,{})})}),t.jsxs(Lt,{children:[t.jsx(le,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(fe,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(le,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(fe,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(le,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(fe,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(le,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(he,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(le,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),D==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),U(b))},onBlur:O=>{U(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),D==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Command *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"node, bun, python...",...l,value:l.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"arg1 arg2 --flag value",...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"/path/to/project (optional)",...l,value:l.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(D==="NPX"||D==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:l.value??[],onChange:l.onChange})}),t.jsx(ee,{})]})}),D!=="NPX"&&D!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"URL *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"https://example.com/mcp",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),U(b))},onBlur:O=>{U(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:P?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...l,value:l.value??""})}),P?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.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"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Name *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"My Connection",...l})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Description"}),t.jsx(Z,{children:t.jsx(Ot,{placeholder:"A brief description of this connection",rows:3,...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),E=T;return d?t.jsx(_t,{open:E,onOpenChange:R,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Nt,{children:o}),t.jsx(kt,{className:"mt-1",children:C})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Qe,{size:16})})})]})}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(At,{children:t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Ee,{open:E,onOpenChange:R,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Fe,{children:[t.jsx(Me,{children:o}),t.jsx(Ve,{children:C})]}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Be,{children:[t.jsx(B,{type:"button",variant:"outline",onClick:()=>R(!1),children:"Cancel"}),t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(de.Content,{children:t.jsx(de.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(de.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(dt,{value:i.search,onChange:i.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:o=>{o.key==="Escape"&&(i.setSearch(""),o.target.blur())}}),t.jsx(at,{sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:u,onChange:o=>S(o||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:x,onChange:o=>a(o||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},...k.length>1?[{label:"Registry",value:p,onChange:o=>g(o||"ALL"),options:[{id:"ALL",label:"All registries"},...k.map(o=>({id:o.id,label:o.id.includes("community-registry")?"Community MCP Registry":o.title}))]}]:[]]})]}),X]}),t.jsx(mt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:h,onTabChange:o=>{const C=o;C!==h&&te("connections_page_tab_changed",{to_tab:C}),_(C)}}),t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:I?.5:1,transition:I?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:I?"none":"auto"},children:t.jsx(en,{listState:i,activeTab:h,typeFilter:u,statusFilter:x,registryFilter:p,enabledRegistries:k})})})]})})})]})})}function ys(){const y=ie.c(1);let e;return y[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tn,{})})}),y[0]=e):e=y[0],e}export{ys as default};
@@ -1 +1 @@
1
- import{B as r}from"./collections-Czgjy6V_.js";import{bO as o}from"./index-C4KOdiuW.js";let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",l=(t=21)=>{let e="",a=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=n[a[t]&63];return e};function m(t){return`${t}_${l()}`}const s=o(r,{target:"draft-7"});export{s as B,m as g};
1
+ import{B as r}from"./collections-CzE8C7FB.js";import{bO as o}from"./index-gKZjkMnf.js";let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",l=(t=21)=>{let e="",a=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=n[a[t]&63];return e};function m(t){return`${t}_${l()}`}const s=o(r,{target:"draft-7"});export{s as B,m as g};