decocms 2.186.6 → 2.186.7

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 (234) hide show
  1. package/dist/client/assets/{AlertCircle-CMykqSBg.js → AlertCircle-CE4aMC_6.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-uGR-9mNu.js → ArrowLeft-VzQjF5nf.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-nzMjud7y.js → ArrowUp-DVMY0e13.js} +1 -1
  4. package/dist/client/assets/{Check-xiDQ8BtU.js → Check-BgcEZAFd.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-Br-9w7at.js → ChevronDown-Ca93y5Zg.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-9oNUepCi.js → ChevronRight-iThFOnTS.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-Cn8mueH6.js → ChevronUp-Dfrjh0kb.js} +1 -1
  8. package/dist/client/assets/{Container-2jV0v6El.js → Container-BQWbDEy6.js} +1 -1
  9. package/dist/client/assets/{Dataflow03-DxoSS6Mb.js → Dataflow03-DdTzEDv9.js} +1 -1
  10. package/dist/client/assets/{FolderClosed-rSkxBpcc.js → FolderClosed-jb7WzUeW.js} +1 -1
  11. package/dist/client/assets/{Loading01-BcvCGReP.js → Loading01-CrI0NwPE.js} +1 -1
  12. package/dist/client/assets/{Play-CfPk1Jil.js → Play-DSddPPya.js} +1 -1
  13. package/dist/client/assets/{Plus-_0WPT4fC.js → Plus-ltkKoqJz.js} +1 -1
  14. package/dist/client/assets/{RefreshCcw01-7vLfxx-h.js → RefreshCcw01-DN-y3At7.js} +1 -1
  15. package/dist/client/assets/{SearchMd-Drvt0RJI.js → SearchMd-CS43V34Y.js} +1 -1
  16. package/dist/client/assets/{Settings01-BWfYiv65.js → Settings01-ClJz1ULQ.js} +1 -1
  17. package/dist/client/assets/{Trash01-1xYo27RH.js → Trash01-fCw8HP0s.js} +1 -1
  18. package/dist/client/assets/{Type01-BYtXAD5n.js → Type01-Dp2k0by5.js} +1 -1
  19. package/dist/client/assets/{Upload01-B0BJCQ_e.js → Upload01-3AVPYkeL.js} +1 -1
  20. package/dist/client/assets/{User01-BeQd85RG.js → User01-CKoZ8ZDH.js} +1 -1
  21. package/dist/client/assets/{X-COxH8ezg.js → X-BNpME-HX.js} +1 -1
  22. package/dist/client/assets/{XCircle-DF_H_9sl.js → XCircle-MpsZU5qt.js} +1 -1
  23. package/dist/client/assets/{XClose-DN7ytwf7.js → XClose-DKDxXEaA.js} +1 -1
  24. package/dist/client/assets/{Zap-EKbyzC1z.js → Zap-kD49gPEF.js} +1 -1
  25. package/dist/client/assets/{agent-connections-preview-BJR4An4x.js → agent-connections-preview-DusvXNLB.js} +1 -1
  26. package/dist/client/assets/{agent-detail-S7Xnyf74.js → agent-detail-B-PecVBx.js} +1 -1
  27. package/dist/client/assets/{agents-DGMB2xM-.js → agents-DTWgODy0.js} +1 -1
  28. package/dist/client/assets/{ai-providers-logos-AsQMrQkI.js → ai-providers-logos-Bp_JBc4Z.js} +1 -1
  29. package/dist/client/assets/{alert-dialog-CahR3t2-.js → alert-dialog-DPu-w5FH.js} +1 -1
  30. package/dist/client/assets/{auth-catchall-CuUUPNMf.js → auth-catchall-CVoq5acq.js} +1 -1
  31. package/dist/client/assets/{automation-detail-D21R_NZo.js → automation-detail-BtlNzqYH.js} +1 -1
  32. package/dist/client/assets/{automations-BDE5mXwW.js → automations-B9MMi9MY.js} +1 -1
  33. package/dist/client/assets/{avatar-CUJtyPo2.js → avatar-DJ_eE6FL.js} +1 -1
  34. package/dist/client/assets/{badge-CED9DV1z.js → badge-Dg_rRuRo.js} +1 -1
  35. package/dist/client/assets/{breadcrumb-CCQEGtsd.js → breadcrumb-B3Pzyfpg.js} +1 -1
  36. package/dist/client/assets/{card-CPxXaS9B.js → card-CQTuw0Xi.js} +1 -1
  37. package/dist/client/assets/{checkbox-BkHtMStR.js → checkbox-pwwqVDt-.js} +1 -1
  38. package/dist/client/assets/{collapsible-B030Rvpo.js → collapsible-BpfdSPbv.js} +1 -1
  39. package/dist/client/assets/{collection-detail-6j0HNb-_.js → collection-detail-7hb0Mplz.js} +1 -1
  40. package/dist/client/assets/{collection-display-button--wDfVH13.js → collection-display-button-DgaN6ief.js} +1 -1
  41. package/dist/client/assets/{collection-search-DpxIEj2Y.js → collection-search-BxbLLE-D.js} +1 -1
  42. package/dist/client/assets/{collection-table-wrapper-fDncVs5S.js → collection-table-wrapper-DhM52ivn.js} +1 -1
  43. package/dist/client/assets/{collection-tabs-CqPectm8.js → collection-tabs-B87Atjwc.js} +1 -1
  44. package/dist/client/assets/{collections-D4sy0Xs0.js → collections-pcWRi6G6.js} +1 -1
  45. package/dist/client/assets/{command-BeBA7wJA.js → command-CIWQeRGP.js} +1 -1
  46. package/dist/client/assets/{connection-card-Bji8m80q.js → connection-card-CM5AlZwH.js} +1 -1
  47. package/dist/client/assets/{connection-detail-CGya4X8s.js → connection-detail-O3fmkpqe.js} +1 -1
  48. package/dist/client/assets/{connections-CzVW7p9D.js → connections-BCkT2NPr.js} +1 -1
  49. package/dist/client/assets/{constants-C2mKle9u.js → constants-B7D0VCWO.js} +1 -1
  50. package/dist/client/assets/constants-B_S2_Dfe.js +1 -0
  51. package/dist/client/assets/{context-BiAMhAiB.js → context-IJmL4QO_.js} +1 -1
  52. package/dist/client/assets/{create-organization-dialog-MUEiKqL8.js → create-organization-dialog-ixA2WoW7.js} +1 -1
  53. package/dist/client/assets/{create-project-dialog-B8VM2kbV.js → create-project-dialog-B6n_03Ug.js} +1 -1
  54. package/dist/client/assets/{danger-CCuvZ302.js → danger-CYvp_RGb.js} +1 -1
  55. package/dist/client/assets/{danger-zone-R1YnFMha.js → danger-zone-xpmW0-9o.js} +1 -1
  56. package/dist/client/assets/{dependencies-usSRHhHV.js → dependencies-C9e_dQDy.js} +1 -1
  57. package/dist/client/assets/{dialog-DkflQEEK.js → dialog-Ce95gXqs.js} +1 -1
  58. package/dist/client/assets/{drawer-CWTdsYcu.js → drawer-ByM8CEL_.js} +1 -1
  59. package/dist/client/assets/{dropdown-menu-CPUZgeQt.js → dropdown-menu-BT7g2ayh.js} +1 -1
  60. package/dist/client/assets/{dynamic-plugin-layout-COn0BiTQ.js → dynamic-plugin-layout-exCUjntN.js} +1 -1
  61. package/dist/client/assets/{editable-task-title-CXF21pnu.js → editable-task-title-wQy-5KA-.js} +1 -1
  62. package/dist/client/assets/{empty-state-mZytJ7Og.js → empty-state-8546_PpL.js} +1 -1
  63. package/dist/client/assets/{empty-state-DLNIkqnc.js → empty-state-CjwgvmoI.js} +1 -1
  64. package/dist/client/assets/{env-vars-editor-74-7rifU.js → env-vars-editor-Cn7u3DNm.js} +1 -1
  65. package/dist/client/assets/{extract-connection-data-0iT2_wST.js → extract-connection-data-OUAaU9Od.js} +1 -1
  66. package/dist/client/assets/{form-DTthvfe9.js → form-BxnLhCD_.js} +1 -1
  67. package/dist/client/assets/{general-g1xkIict.js → general-CnJT7yxb.js} +1 -1
  68. package/dist/client/assets/{home-29e6ki_m.js → home-CVvG2Fqq.js} +1 -1
  69. package/dist/client/assets/{import-from-deco-dialog-1gjK7_AP.js → import-from-deco-dialog-Chrnp3Cw.js} +1 -1
  70. package/dist/client/assets/{index-ZixwJ1Pk.js → index-3yf2NnlI.js} +1 -1
  71. package/dist/client/assets/{index-DIir8pgm.js → index-B62MiQAu.js} +2 -2
  72. package/dist/client/assets/{index-DTnP3oIT.js → index-BcOdsrKl.js} +1 -1
  73. package/dist/client/assets/{index-CuI-2Tt-.js → index-C-wrel8E.js} +1 -1
  74. package/dist/client/assets/{index--5l6Kd5l.js → index-CMA-66KF.js} +1 -1
  75. package/dist/client/assets/{index-Cb6NnGWb.js → index-CsLoKsqY.js} +1 -1
  76. package/dist/client/assets/{index-DIiriVeM.js → index-DAKvcNkQ.js} +1 -1
  77. package/dist/client/assets/{index-B_aEJlRD.js → index-DNarCA5m.js} +1 -1
  78. package/dist/client/assets/{index-DcP_WR0J.js → index-DXw26Swq.js} +1 -1
  79. package/dist/client/assets/{index-Dz9R7lP6.js → index-DehDS4SM.js} +1 -1
  80. package/dist/client/assets/{index-DoQQIBf1.js → index-DrtlaMfG.js} +1 -1
  81. package/dist/client/assets/{infiniteQueryObserver-D_1D5AYq.js → infiniteQueryObserver-C4rkYsAc.js} +1 -1
  82. package/dist/client/assets/{input-BVAvDQ_C.js → input-BNSWRvAr.js} +1 -1
  83. package/dist/client/assets/{integration-icon-B_0G_X87.js → integration-icon-BByVvYW2.js} +1 -1
  84. package/dist/client/assets/{label-C6omQTs_.js → label-C-5U7XF4.js} +1 -1
  85. package/dist/client/assets/{layout-D4tWA0bw.js → layout-CxMMzlDg.js} +1 -1
  86. package/dist/client/assets/{layout-AYXb28rc.js → layout-DuIBVgOo.js} +1 -1
  87. package/dist/client/assets/{login-Cx7hoJoT.js → login-ayW5J8kp.js} +1 -1
  88. package/dist/client/assets/{logo-upload-FTAEWKjw.js → logo-upload-Cnlppzw5.js} +1 -1
  89. package/dist/client/assets/{mcp-app-renderer-DDZtzzcL.js → mcp-app-renderer-C5hh7NUh.js} +1 -1
  90. package/dist/client/assets/{mcp-server-card-C8wXu9yO.js → mcp-server-card-3TrMzryK.js} +1 -1
  91. package/dist/client/assets/{mcp-server-detail-BVknczom.js → mcp-server-detail-BHg2jU2j.js} +2 -2
  92. package/dist/client/assets/{members-CczX95O-.js → members-DR64AFBa.js} +1 -1
  93. package/dist/client/assets/{monaco-editor-BF2WLfQD.js → monaco-editor-0MGgMe6Z.js} +1 -1
  94. package/dist/client/assets/{monitoring-dashboard-edit-6dYajQ_1.js → monitoring-dashboard-edit-D0wDbirt.js} +1 -1
  95. package/dist/client/assets/{monitoring-dashboard-view-C154UPGx.js → monitoring-dashboard-view-Cye--xow.js} +1 -1
  96. package/dist/client/assets/{monitoring-stats-row-C6qBbHow.js → monitoring-stats-row-Br-gOcw_.js} +1 -1
  97. package/dist/client/assets/{monitoring-9XsThidn.js → monitoring-zjAHbr2Y.js} +1 -1
  98. package/dist/client/assets/{oauth-callback-3Syoq1nk.js → oauth-callback-C5qRKz1E.js} +1 -1
  99. package/dist/client/assets/{oauth-callback-ai-provider-udnTMnIE.js → oauth-callback-ai-provider-Belxh9YS.js} +1 -1
  100. package/dist/client/assets/{org-ai-providers-BZX8CBbC.js → org-ai-providers-vLOcM2IN.js} +1 -1
  101. package/dist/client/assets/{page-B8I6CLK9.js → page-Bk-6gYjF.js} +1 -1
  102. package/dist/client/assets/{page-DG6axqmW.js → page-D9taTz3x.js} +1 -1
  103. package/dist/client/assets/{plugin-empty-state-Bt8UXvj0.js → plugin-empty-state-DwTx3Irb.js} +1 -1
  104. package/dist/client/assets/{plugin-header-DT9lR12I.js → plugin-header-_SJ-AMks.js} +1 -1
  105. package/dist/client/assets/plugins-_-cF0kV-.js +1 -0
  106. package/dist/client/assets/{popover-BMBGvHQ_.js → popover-CW4G5neq.js} +1 -1
  107. package/dist/client/assets/{project-app-view-fuhRg8H7.js → project-app-view-Cxge46GP.js} +1 -1
  108. package/dist/client/assets/{project-layout-DWnRAr4s.js → project-layout-CszLr05H.js} +1 -1
  109. package/dist/client/assets/{project-plugins-CRqpdPvu.js → project-plugins-CB_lBTqe.js} +1 -1
  110. package/dist/client/assets/{projects-list-Dl8bD1xL.js → projects-list-BAFLJ8Ur.js} +1 -1
  111. package/dist/client/assets/{registry-layout-CdBoBkB6.js → registry-layout-BFPpF2ab.js} +1 -1
  112. package/dist/client/assets/{registry-utils-pfpET92F.js → registry-utils-DWGplsmC.js} +1 -1
  113. package/dist/client/assets/{reset-password-BL4AtRcT.js → reset-password-D2kT9zWB.js} +1 -1
  114. package/dist/client/assets/{resizable-CcW4J8VD.js → resizable-DFwU4W6w.js} +1 -1
  115. package/dist/client/assets/{save-actions-3dOJ5Mjm.js → save-actions-CmbT6lbz.js} +1 -1
  116. package/dist/client/assets/{scroll-area-Bqfa6wPc.js → scroll-area-DEb4D9kS.js} +1 -1
  117. package/dist/client/assets/{select-CBE7xbF4.js → select-BY6esNmT.js} +1 -1
  118. package/dist/client/assets/{select-virtual-mcp-Bco91LS8.js → select-virtual-mcp-C6Eik732.js} +1 -1
  119. package/dist/client/assets/{shell-layout-BVpZ2wZ-.js → shell-layout-BPQbdNig.js} +2 -2
  120. package/dist/client/assets/{sidebar-settings-BpXHJmnQ.js → sidebar-settings-LoxM-jfH.js} +1 -1
  121. package/dist/client/assets/{skeleton-CQd2QEI9.js → skeleton-H6tvOoEj.js} +1 -1
  122. package/dist/client/assets/{spinner-DCPsu4ZG.js → spinner-X15c9Qjw.js} +1 -1
  123. package/dist/client/assets/{store-invite-D4qgWC83.js → store-invite-CbJMqLqm.js} +1 -1
  124. package/dist/client/assets/{switch-CDhXZx5x.js → switch-1W8o5vam.js} +1 -1
  125. package/dist/client/assets/{table-CGhKFeKb.js → table-oKRuJlES.js} +1 -1
  126. package/dist/client/assets/{tabs-BMh4okm_.js → tabs-wloAa-G_.js} +1 -1
  127. package/dist/client/assets/{task-status-2ts0kYwT.js → task-status-DtA3vCfp.js} +1 -1
  128. package/dist/client/assets/tasks-DYQdfmG5.js +1 -0
  129. package/dist/client/assets/{tasks-panel-0RmxrVW1.js → tasks-panel-CfTCpIaN.js} +1 -1
  130. package/dist/client/assets/{textarea-CdQzy4Ij.js → textarea-Db5eGrte.js} +1 -1
  131. package/dist/client/assets/{time-range-picker-obtb96_y.js → time-range-picker-kvCom5E0.js} +1 -1
  132. package/dist/client/assets/{toggle-group-BvQ8i1-N.js → toggle-group-nuX--X8U.js} +1 -1
  133. package/dist/client/assets/{tools-list-SV45eRcg.js → tools-list-CzNHOfxQ.js} +1 -1
  134. package/dist/client/assets/{tooltip-iG9fvlrZ.js → tooltip-Cz2tQy7f.js} +1 -1
  135. package/dist/client/assets/{types-BJ15oicG.js → types-B85FeN8J.js} +1 -1
  136. package/dist/client/assets/{use-automations-DDYigIn8.js → use-automations-Bmzs_h6Z.js} +1 -1
  137. package/dist/client/assets/{use-collections-CeVeE6L5.js → use-collections-Cw-CkhM5.js} +1 -1
  138. package/dist/client/assets/{use-connection-B3ekSVUc.js → use-connection-u5F7YTDM.js} +1 -1
  139. package/dist/client/assets/{use-copy-DFqHt08d.js → use-copy-DXoYLkGY.js} +1 -1
  140. package/dist/client/assets/{use-create-virtual-mcp-J-6A5Uhg.js → use-create-virtual-mcp-B6BY4hNy.js} +1 -1
  141. package/dist/client/assets/{use-infinite-scroll-DbO9lGzn.js → use-infinite-scroll-BCAoqpbu.js} +1 -1
  142. package/dist/client/assets/{use-install-from-registry-BKwLRanW.js → use-install-from-registry-Bh4CcElp.js} +1 -1
  143. package/dist/client/assets/{use-list-state-BSx7RPGJ.js → use-list-state-J17yqbOy.js} +1 -1
  144. package/dist/client/assets/{use-mcp-prompts-ClavsAnj.js → use-mcp-prompts-C4rv2YNo.js} +1 -1
  145. package/dist/client/assets/{use-mcp-resources-BuE1rP0c.js → use-mcp-resources-C2RRZo8d.js} +1 -1
  146. package/dist/client/assets/{use-mcp-tools-JDKA9UZ8.js → use-mcp-tools-CS9dH9Hk.js} +1 -1
  147. package/dist/client/assets/{use-members-DNGgajFa.js → use-members-L6twvwj_.js} +1 -1
  148. package/dist/client/assets/{use-project-DvVOFuu-.js → use-project-DmzlV8IR.js} +1 -1
  149. package/dist/client/assets/{use-store-discovery-dPavPbA-.js → use-store-discovery-B_zVCnQi.js} +1 -1
  150. package/dist/client/assets/{use-view-mode-BijqAGDe.js → use-view-mode-DDZQlalb.js} +1 -1
  151. package/dist/client/assets/{use-virtual-mcp-DXFVfjMZ.js → use-virtual-mcp-BQ1ML2v_.js} +1 -1
  152. package/dist/client/assets/useInfiniteQuery-D_7z7Ekt.js +1 -0
  153. package/dist/client/assets/{useMutation-DPjXSTSD.js → useMutation-5tF0rOhi.js} +1 -1
  154. package/dist/client/assets/useQuery-Cr3Ibn6v.js +1 -0
  155. package/dist/client/assets/useSuspenseInfiniteQuery-UikfpG9C.js +1 -0
  156. package/dist/client/assets/{user-BAgoGcDp.js → user-Wn7CHNY8.js} +1 -1
  157. package/dist/client/assets/{workflow-CrjjFLE3.js → workflow-CehUk0kO.js} +1 -1
  158. package/dist/client/assets/{workflow-DCKJ21al.js → workflow-DGOWYrJv.js} +1 -1
  159. package/dist/client/index.html +1 -1
  160. package/dist/server/cli.js +338 -337
  161. package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
  162. package/dist/server/node_modules/ansi-styles/index.js +223 -0
  163. package/dist/server/node_modules/ansi-styles/license +9 -0
  164. package/dist/server/node_modules/ansi-styles/package.json +54 -0
  165. package/dist/server/node_modules/ansi-styles/readme.md +173 -0
  166. package/dist/server/node_modules/mimic-fn/index.d.ts +54 -0
  167. package/dist/server/node_modules/mimic-fn/index.js +13 -0
  168. package/dist/server/node_modules/mimic-fn/license +9 -0
  169. package/dist/server/node_modules/mimic-fn/package.json +42 -0
  170. package/dist/server/node_modules/mimic-fn/readme.md +69 -0
  171. package/dist/server/node_modules/pg-int8/LICENSE +13 -0
  172. package/dist/server/node_modules/pg-int8/README.md +16 -0
  173. package/dist/server/node_modules/pg-int8/index.js +100 -0
  174. package/dist/server/node_modules/pg-int8/package.json +24 -0
  175. package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
  176. package/dist/server/node_modules/postgres-array/index.js +97 -0
  177. package/dist/server/node_modules/postgres-array/license +21 -0
  178. package/dist/server/node_modules/postgres-array/package.json +35 -0
  179. package/dist/server/node_modules/postgres-array/readme.md +43 -0
  180. package/dist/server/node_modules/postgres-bytea/index.js +33 -0
  181. package/dist/server/node_modules/postgres-bytea/license +21 -0
  182. package/dist/server/node_modules/postgres-bytea/package.json +34 -0
  183. package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
  184. package/dist/server/node_modules/postgres-date/index.js +116 -0
  185. package/dist/server/node_modules/postgres-date/license +21 -0
  186. package/dist/server/node_modules/postgres-date/package.json +33 -0
  187. package/dist/server/node_modules/postgres-date/readme.md +49 -0
  188. package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
  189. package/dist/server/node_modules/postgres-interval/index.js +125 -0
  190. package/dist/server/node_modules/postgres-interval/license +21 -0
  191. package/dist/server/node_modules/postgres-interval/package.json +36 -0
  192. package/dist/server/node_modules/postgres-interval/readme.md +48 -0
  193. package/dist/server/node_modules/split2/LICENSE +13 -0
  194. package/dist/server/node_modules/split2/README.md +85 -0
  195. package/dist/server/node_modules/split2/bench.js +27 -0
  196. package/dist/server/node_modules/split2/index.js +141 -0
  197. package/dist/server/node_modules/split2/package.json +39 -0
  198. package/dist/server/node_modules/split2/test.js +409 -0
  199. package/dist/server/node_modules/xtend/.jshintrc +30 -0
  200. package/dist/server/node_modules/{pg → xtend}/LICENSE +6 -7
  201. package/dist/server/node_modules/xtend/README.md +32 -0
  202. package/dist/server/node_modules/xtend/immutable.js +19 -0
  203. package/dist/server/node_modules/xtend/mutable.js +17 -0
  204. package/dist/server/node_modules/xtend/package.json +55 -0
  205. package/dist/server/node_modules/xtend/test.js +103 -0
  206. package/dist/server/server.js +269 -269
  207. package/package.json +1 -1
  208. package/dist/client/assets/constants-CUwoz2Qc.js +0 -1
  209. package/dist/client/assets/plugins-S0nxg7Xk.js +0 -1
  210. package/dist/client/assets/tasks-DR3nWr8j.js +0 -1
  211. package/dist/client/assets/useInfiniteQuery-DfmHdhse.js +0 -1
  212. package/dist/client/assets/useQuery-BJg_09kQ.js +0 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-xbYvMmn4.js +0 -1
  214. package/dist/server/node_modules/pg/README.md +0 -95
  215. package/dist/server/node_modules/pg/esm/index.mjs +0 -20
  216. package/dist/server/node_modules/pg/lib/client.js +0 -743
  217. package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
  218. package/dist/server/node_modules/pg/lib/connection.js +0 -221
  219. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
  220. package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
  221. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
  222. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
  223. package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
  224. package/dist/server/node_modules/pg/lib/defaults.js +0 -91
  225. package/dist/server/node_modules/pg/lib/index.js +0 -73
  226. package/dist/server/node_modules/pg/lib/native/client.js +0 -323
  227. package/dist/server/node_modules/pg/lib/native/index.js +0 -2
  228. package/dist/server/node_modules/pg/lib/native/query.js +0 -165
  229. package/dist/server/node_modules/pg/lib/query.js +0 -252
  230. package/dist/server/node_modules/pg/lib/result.js +0 -109
  231. package/dist/server/node_modules/pg/lib/stream.js +0 -83
  232. package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
  233. package/dist/server/node_modules/pg/lib/utils.js +0 -217
  234. package/dist/server/node_modules/pg/package.json +0 -76
@@ -1 +1 @@
1
- import{d as w,c as C,K as S,y as N,j as t}from"./index-DIir8pgm.js";import{A as E}from"./avatar-CUJtyPo2.js";import{u as k}from"./useQuery-BJg_09kQ.js";import{a as A,u as _}from"./constants-C2mKle9u.js";function K(m){const e=w.c(11),{org:h}=C();let x;e[0]!==h.id?(x={connectionId:A,orgId:h.id},e[0]=h.id,e[1]=x):x=e[1];const u=_(x);let d;e[2]!==m?(d=S.user(m),e[2]=m,e[3]=d):d=e[3];let s;e[4]!==u||e[5]!==m?(s=async()=>{const r=await u.callTool({name:"USER_GET",arguments:{id:m}});return(r.structuredContent??r).user},e[4]=u,e[5]=m,e[6]=s):s=e[6];const l=!!m;let o;return e[7]!==d||e[8]!==s||e[9]!==l?(o={queryKey:d,queryFn:s,staleTime:3e5,retry:1,enabled:l},e[7]=d,e[8]=s,e[9]=l,e[10]=o):o=e[10],k(o)}function q(m){const e=w.c(36),{id:h,size:x,showEmail:u,avatarOnly:d,className:s}=m,l=x===void 0?"xs":x,o=u===void 0?!1:u,r=d===void 0?!1:d,{data:c,isLoading:U,isError:b}=K(h);if(U){let a;e[0]!==s?(a=N("flex items-center gap-2",s),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==l?(i=t.jsx(E.Skeleton,{shape:"circle",size:l}),e[2]=l,e[3]=i):i=e[3];let n;e[4]!==r||e[5]!==o?(n=!r&&t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),o&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"})]}),e[4]=r,e[5]=o,e[6]=n):n=e[6];let f;return e[7]!==a||e[8]!==i||e[9]!==n?(f=t.jsxs("div",{className:a,children:[i,n]}),e[7]=a,e[8]=i,e[9]=n,e[10]=f):f=e[10],f}if(b||!c){let a;e[11]!==s?(a=N("flex items-center gap-2",s),e[11]=s,e[12]=a):a=e[12];let i;e[13]!==l?(i=t.jsx(E,{shape:"circle",size:l,fallback:"?",muted:!0}),e[13]=l,e[14]=i):i=e[14];let n;e[15]!==r?(n=!r&&t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[15]=r,e[16]=n):n=e[16];let f;return e[17]!==a||e[18]!==i||e[19]!==n?(f=t.jsxs("div",{className:a,children:[i,n]}),e[17]=a,e[18]=i,e[19]=n,e[20]=f):f=e[20],f}let p;e[21]!==s?(p=N("flex items-center gap-2",s),e[21]=s,e[22]=p):p=e[22];const y=c.image??void 0;let v;e[23]!==l||e[24]!==y||e[25]!==c.name?(v=t.jsx(E,{shape:"circle",size:l,url:y,fallback:c.name}),e[23]=l,e[24]=y,e[25]=c.name,e[26]=v):v=e[26];let j;e[27]!==r||e[28]!==o||e[29]!==c.email||e[30]!==c.name?(j=!r&&t.jsxs("div",{className:"flex flex-col",children:[t.jsx("div",{className:"text-sm font-medium",children:c.name}),o&&t.jsx("div",{className:"text-xs text-muted-foreground",children:c.email})]}),e[27]=r,e[28]=o,e[29]=c.email,e[30]=c.name,e[31]=j):j=e[31];let g;return e[32]!==p||e[33]!==v||e[34]!==j?(g=t.jsxs("div",{className:p,children:[v,j]}),e[32]=p,e[33]=v,e[34]=j,e[35]=g):g=e[35],g}export{q as U};
1
+ import{d as w,c as C,K as S,y as N,j as t}from"./index-B62MiQAu.js";import{A as E}from"./avatar-DJ_eE6FL.js";import{u as k}from"./useQuery-Cr3Ibn6v.js";import{a as A,u as _}from"./constants-B7D0VCWO.js";function K(m){const e=w.c(11),{org:h}=C();let x;e[0]!==h.id?(x={connectionId:A,orgId:h.id},e[0]=h.id,e[1]=x):x=e[1];const u=_(x);let d;e[2]!==m?(d=S.user(m),e[2]=m,e[3]=d):d=e[3];let s;e[4]!==u||e[5]!==m?(s=async()=>{const r=await u.callTool({name:"USER_GET",arguments:{id:m}});return(r.structuredContent??r).user},e[4]=u,e[5]=m,e[6]=s):s=e[6];const l=!!m;let o;return e[7]!==d||e[8]!==s||e[9]!==l?(o={queryKey:d,queryFn:s,staleTime:3e5,retry:1,enabled:l},e[7]=d,e[8]=s,e[9]=l,e[10]=o):o=e[10],k(o)}function q(m){const e=w.c(36),{id:h,size:x,showEmail:u,avatarOnly:d,className:s}=m,l=x===void 0?"xs":x,o=u===void 0?!1:u,r=d===void 0?!1:d,{data:c,isLoading:U,isError:b}=K(h);if(U){let a;e[0]!==s?(a=N("flex items-center gap-2",s),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==l?(i=t.jsx(E.Skeleton,{shape:"circle",size:l}),e[2]=l,e[3]=i):i=e[3];let n;e[4]!==r||e[5]!==o?(n=!r&&t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),o&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"})]}),e[4]=r,e[5]=o,e[6]=n):n=e[6];let f;return e[7]!==a||e[8]!==i||e[9]!==n?(f=t.jsxs("div",{className:a,children:[i,n]}),e[7]=a,e[8]=i,e[9]=n,e[10]=f):f=e[10],f}if(b||!c){let a;e[11]!==s?(a=N("flex items-center gap-2",s),e[11]=s,e[12]=a):a=e[12];let i;e[13]!==l?(i=t.jsx(E,{shape:"circle",size:l,fallback:"?",muted:!0}),e[13]=l,e[14]=i):i=e[14];let n;e[15]!==r?(n=!r&&t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[15]=r,e[16]=n):n=e[16];let f;return e[17]!==a||e[18]!==i||e[19]!==n?(f=t.jsxs("div",{className:a,children:[i,n]}),e[17]=a,e[18]=i,e[19]=n,e[20]=f):f=e[20],f}let p;e[21]!==s?(p=N("flex items-center gap-2",s),e[21]=s,e[22]=p):p=e[22];const y=c.image??void 0;let v;e[23]!==l||e[24]!==y||e[25]!==c.name?(v=t.jsx(E,{shape:"circle",size:l,url:y,fallback:c.name}),e[23]=l,e[24]=y,e[25]=c.name,e[26]=v):v=e[26];let j;e[27]!==r||e[28]!==o||e[29]!==c.email||e[30]!==c.name?(j=!r&&t.jsxs("div",{className:"flex flex-col",children:[t.jsx("div",{className:"text-sm font-medium",children:c.name}),o&&t.jsx("div",{className:"text-xs text-muted-foreground",children:c.email})]}),e[27]=r,e[28]=o,e[29]=c.email,e[30]=c.name,e[31]=j):j=e[31];let g;return e[32]!==p||e[33]!==v||e[34]!==j?(g=t.jsxs("div",{className:p,children:[v,j]}),e[32]=p,e[33]=v,e[34]=j,e[35]=g):g=e[35],g}export{q as U};
@@ -1 +1 @@
1
- import{d as ie,j as t,B as ge,f as pt,g as ft,c as $e,r as ht,O as Fe,w as ke,x as gt,K as Ke}from"./index-DIir8pgm.js";import{u as Qe,a as Ve}from"./constants-C2mKle9u.js";import{g as Me}from"./generate-id-Dyweu44Y.js";import{C as Ye}from"./collection-display-button--wDfVH13.js";import{C as xt}from"./collection-search-DpxIEj2Y.js";import{C as jt}from"./card-CPxXaS9B.js";import{I as Xe,e as Ze,r as We}from"./integration-icon-B_0G_X87.js";import{D as et,a as tt,b as st,c as L}from"./dropdown-menu-CPUZgeQt.js";import{c as ot}from"./Play-CfPk1Jil.js";import{i as it,s as nt}from"./RefreshCcw01-7vLfxx-h.js";import{s as rt}from"./Trash01-1xYo27RH.js";import{C as Ct}from"./collection-table-wrapper-fDncVs5S.js";import{E as Ue}from"./empty-state-DLNIkqnc.js";import{U as bt}from"./user-BAgoGcDp.js";import{E as lt}from"./empty-state-mZytJ7Og.js";import{u as yt}from"./use-list-state-BSx7RPGJ.js";import{B as vt}from"./constants-CUwoz2Qc.js";import{g as Nt}from"./connection-slug-Bw8dtz1U.js";import{A as wt,h as St,c as _t,b as Pt,d as Dt,e as It,a as At,f as Tt}from"./alert-dialog-CahR3t2-.js";import{u as Et,e as Ot}from"./use-collections-CeVeE6L5.js";import{u as $t}from"./use-connection-B3ekSVUc.js";import{s as kt}from"./Plus-_0WPT4fC.js";import{a as Lt}from"./layout-D4tWA0bw.js";import{u as zt}from"./useMutation-DPjXSTSD.js";import{P as k}from"./index-B_aEJlRD.js";import{B as Be,a as Re,b as He,c as Ge}from"./breadcrumb-CCQEGtsd.js";import{e as Ft}from"./Dataflow03-DxoSS6Mb.js";import"./ArrowUp-nzMjud7y.js";import"./Check-xiDQ8BtU.js";import"./Type01-BYtXAD5n.js";import"./tooltip-iG9fvlrZ.js";import"./index-DTnP3oIT.js";import"./badge-CED9DV1z.js";import"./Loading01-BcvCGReP.js";import"./SearchMd-Drvt0RJI.js";import"./input-BVAvDQ_C.js";import"./Container-2jV0v6El.js";import"./AlertCircle-CMykqSBg.js";import"./ArrowLeft-uGR-9mNu.js";import"./XCircle-DF_H_9sl.js";import"./ChevronDown-Br-9w7at.js";import"./ChevronRight-9oNUepCi.js";import"./ChevronUp-Cn8mueH6.js";import"./FolderClosed-rSkxBpcc.js";import"./Settings01-BWfYiv65.js";import"./Upload01-B0BJCQ_e.js";import"./User01-BeQd85RG.js";import"./XClose-DN7ytwf7.js";import"./X-COxH8ezg.js";import"./Zap-EKbyzC1z.js";import"./table-CGhKFeKb.js";import"./avatar-CUJtyPo2.js";import"./useQuery-BJg_09kQ.js";import"./use-view-mode-BijqAGDe.js";import"./collections-D4sy0Xs0.js";import"./slugify-CEUa2lfQ.js";function Kt(s,e){const o=s.properties||{};for(const n in o){const l=o[n];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const a=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of a)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function Mt(s){const e=ie.c(25),{item:o,schema:a,actions:n}=s;let l;e[0]!==o||e[1]!==a?(l=Kt(a,o),e[0]=o,e[1]=a,e[2]=l):l=e[2];const r=l,c=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let p;e[3]!==n?(p=n&&Object.keys(n).length>0,e[3]=n,e[4]=p):p=e[4];const i=p;let u;e[5]!==r||e[6]!==o.title?(u=t.jsx(Xe,{icon:r,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=o.title,e[7]=u):u=e[7];let f;e[8]!==o.title?(f=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=f):f=e[9];const d=c||"No description";let m;e[10]!==d?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:d}),e[10]=d,e[11]=m):m=e[11];let b;e[12]!==f||e[13]!==m?(b=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[f,m]}),e[12]=f,e[13]=m,e[14]=b):b=e[14];let x;e[15]!==u||e[16]!==b?(x=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,b]}),e[15]=u,e[16]=b,e[17]=x):x=e[17];let N;e[18]!==n||e[19]!==i||e[20]!==o?(N=i&&t.jsx("div",{className:"absolute top-6 right-6 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",onClick:Rt,onMouseDown:Bt,children:t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ut,children:t.jsx(it,{size:20})})}),t.jsxs(st,{align:"end",onClick:Wt,children:[n.open&&t.jsxs(L,{onClick:g=>{g.stopPropagation(),n.open?.(o)},children:[t.jsx(nt,{size:16}),"Open"]}),n.edit&&t.jsxs(L,{onClick:g=>{g.stopPropagation(),n.edit?.(o)},children:[t.jsx(Ze,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(L,{onClick:g=>{g.stopPropagation(),n.duplicate?.(o)},children:[t.jsx(ot,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(L,{variant:"destructive",onClick:g=>{g.stopPropagation(),n.delete?.(o)},children:[t.jsx(rt,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=i,e[20]=o,e[21]=N):N=e[21];let j;return e[22]!==x||e[23]!==N?(j=t.jsxs(jt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[x,N]}),e[22]=x,e[23]=N,e[24]=j):j=e[24],j}function Wt(s){return s.stopPropagation()}function Ut(s){return s.stopPropagation()}function Bt(s){return s.stopPropagation()}function Rt(s){return s.stopPropagation()}const Ht=["icon","avatar","logo"],qe=["created_at","created_by","id"];function Gt(s){return Object.keys(s).find(e=>Ht.includes(e.toLowerCase()))}function at(s,e){return Object.keys(s.properties||{}).filter(o=>["id","created_at","updated_at","created_by","updated_by"].includes(o)?!1:e?e.includes(o):!0).map(o=>({id:o,label:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," ")}))}function qt(s){const e=ie.c(30),{data:o,schema:a,viewMode:n,search:l,sortKey:r,sortDirection:c,onSort:p,actions:i,onItemClick:u,headerActions:f,emptyState:d,readOnly:m,columns:b,hideToolbar:x,sortableFields:N}=s,j=c===void 0?"asc":c,g=p===void 0?Yt:p;let h;e[0]!==i?(h=i===void 0?{}:i,e[0]=i,e[1]=h):h=e[1];const E=h,T=u===void 0?Vt:u,w=f===void 0?null:f,O=d===void 0?null:d,S=m===void 0?!1:m,_=b===void 0?void 0:b,z=x===void 0?!1:x,y=N===void 0?void 0:N;let v;e[2]!==_||e[3]!==a||e[4]!==y?(v=_?_.filter(Qt).filter(A=>!y||y.includes(A.id)).map(Jt):at(a,y),e[2]=_,e[3]=a,e[4]=y,e[5]=v):v=e[5];const I=v;let P;e[6]!==w||e[7]!==z||e[8]!==g||e[9]!==j||e[10]!==r||e[11]!==I?(P=!z&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:w}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Ye,{sortKey:r,sortDirection:j,onSort:g,sortOptions:I})})]})}),e[6]=w,e[7]=z,e[8]=g,e[9]=j,e[10]=r,e[11]=I,e[12]=P):P=e[12];let D;e[13]!==E||e[14]!==_||e[15]!==o||e[16]!==O||e[17]!==T||e[18]!==g||e[19]!==S||e[20]!==a||e[21]!==l||e[22]!==j||e[23]!==r||e[24]!==y||e[25]!==n?(D=n==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:O||t.jsx(Ue,{icon:t.jsx(We,{size:36,className:"text-muted-foreground"}),title:"No items found",description:l?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:o.map(A=>t.jsx("div",{onClick:()=>T?.(A),className:"cursor-pointer h-full",children:t.jsx(Mt,{item:A,schema:a,readOnly:S,actions:E})},A.id))})}):t.jsx(Ct,{columns:es(_,a,y,E),data:o,sortKey:r,sortDirection:j,onSort:g,onRowClick:T,emptyState:O||t.jsx(Ue,{icon:t.jsx(We,{size:36,className:"text-muted-foreground"}),title:"No items found",description:l?"Try adjusting your search":"No items to display"})}),e[13]=E,e[14]=_,e[15]=o,e[16]=O,e[17]=T,e[18]=g,e[19]=S,e[20]=a,e[21]=l,e[22]=j,e[23]=r,e[24]=y,e[25]=n,e[26]=D):D=e[26];let $;return e[27]!==P||e[28]!==D?($=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[P,D]}),e[27]=P,e[28]=D,e[29]=$):$=e[29],$}function Jt(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Qt(s){return s.sortable!==!1}function Vt(){}function Yt(){}function Xt(s){return{id:"actions",header:"",render:e=>t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(ge,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:t.jsx(it,{size:20})})}),t.jsxs(st,{align:"end",onClick:o=>o.stopPropagation(),children:[s.open&&t.jsxs(L,{onClick:o=>{o.stopPropagation(),s.open?.(e)},children:[t.jsx(nt,{size:16}),"Open"]}),s.edit&&t.jsxs(L,{onClick:o=>{o.stopPropagation(),s.edit?.(e)},children:[t.jsx(Ze,{size:16}),"Edit"]}),s.duplicate&&t.jsxs(L,{onClick:o=>{o.stopPropagation(),s.duplicate?.(e)},children:[t.jsx(ot,{size:16}),"Duplicate"]}),s.delete&&t.jsxs(L,{variant:"destructive",onClick:o=>{o.stopPropagation(),s.delete?.(e)},children:[t.jsx(rt,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function ct(s){const e=s.type;return Array.isArray(e)?e.every(o=>ct({type:o})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Zt(s,e){const o=s.properties||{},a=Object.keys(o).filter(i=>{const u=o[i];return u&&ct(u)}),n=Gt(o),l=[],r=new Set;n&&a.includes(n)&&(l.push(n),r.add(n));const c=["title","description","updated_at","updated_by"];for(const i of c)a.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));const p=a.filter(i=>!r.has(i)&&!qe.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of p)l.push(i),r.add(i);for(const i of qe)a.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));return l.map(i=>{const u=o[i],f=e?e.includes(i):!["id"].includes(i);return i===n?{id:i,header:"",render:d=>{const m=d[i];return t.jsx(Xe,{icon:m,name:d.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:d=>{const m=d[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:f,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:d=>{const m=d[i];return m?t.jsx(bt,{id:String(m),size:"xs"}):"—"},sortable:f,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:d=>{const m=d[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:f,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:d=>{const m=d[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:f,cellClassName:"max-w-[200px]"}})}function es(s,e,o,a){const n=s||Zt(e,o);return n.some(c=>c.id==="actions")?n:Object.keys(a).length>0?[...n,Xt(a)]:n}function ts(s){const e=ie.c(114),{connectionId:o,org:a,activeCollection:n}=s,l=n.name,r=n.schema??vt,c=n.hasCreateTool,p=n.hasUpdateTool,i=n.hasDeleteTool,u=pt(),{data:f}=ft.useSession(),d=f?.user?.id||"unknown",m=$t(o);let b;e[0]!==m||e[1]!==o?(b=m?Nt(m):o,e[0]=m,e[1]=o,e[2]=b):b=e[2];const x=b,{org:N}=$e();let j;e[3]!==o||e[4]!==N.id?(j={connectionId:o,orgId:N.id},e[3]=o,e[4]=N.id,e[5]=j):j=e[5];const g=Qe(j),h=Et(o,l,g),E=`${o}-${l}`;let T;e[6]!==a||e[7]!==E?(T={namespace:a,resource:E,defaultSortKey:"updated_at"},e[6]=a,e[7]=E,e[8]=T):T=e[8];const{search:w,searchTerm:O,setSearch:S,viewMode:_,setViewMode:z,sortKey:y,sortDirection:v,handleSort:I}=yt(T);let P;e[9]!==O||e[10]!==v||e[11]!==y?(P={searchTerm:O,sortKey:y,sortDirection:v},e[9]=O,e[10]=v,e[11]=y,e[12]=P):P=e[12];const D=Ot(o,l,g,P),$=!c&&!p&&!i;let A;e[13]!==x||e[14]!==l||e[15]!==u||e[16]!==a?(A=C=>{u({to:"/$org/$project/mcps/$appSlug/$collectionName/$itemId",params:{org:a,project:Fe,appSlug:x,collectionName:l,itemId:C.id}})},e[13]=x,e[14]=l,e[15]=u,e[16]=a,e[17]=A):A=e[17];const F=A;let ne;e[18]!==h.create||e[19]!==d?(ne=async C=>{const he=new Date().toISOString();await h.create.mutateAsync({...C,id:Me("conn"),title:`${C.title} (Copy)`,created_at:he,updated_at:he,created_by:d,updated_by:d})},e[18]=h.create,e[19]=d,e[20]=ne):ne=e[20];const xe=ne,[K,je]=ht.useState(null);let re;e[21]===Symbol.for("react.memo_cache_sentinel")?(re=C=>{je(C)},e[21]=re):re=e[21];const dt=re;let M;e[22]!==F||e[23]!==p?(M=p&&{edit:F},e[22]=F,e[23]=p,e[24]=M):M=e[24];let W;e[25]!==xe||e[26]!==c?(W=c&&{duplicate:xe},e[25]=xe,e[26]=c,e[27]=W):W=e[27];let U;e[28]!==i?(U=i&&{delete:dt},e[28]=i,e[29]=U):U=e[29];let le;e[30]!==W||e[31]!==U||e[32]!==M?(le={...M,...W,...U},e[30]=W,e[31]=U,e[32]=M,e[33]=le):le=e[33];const Ce=le;let ae;e[34]!==h.delete||e[35]!==K?(ae=async()=>{K&&(await h.delete.mutateAsync(K.id),je(null))},e[34]=h.delete,e[35]=K,e[36]=ae):ae=e[36];const be=ae;let ce;e[37]!==h.create||e[38]!==x||e[39]!==l||e[40]!==c||e[41]!==u||e[42]!==a||e[43]!==d?(ce=async()=>{if(!c){ke.error("Create operation is not available for this collection");return}const C=new Date().toISOString(),he={id:Me("conn"),title:"New Item",description:"A brief description of the item",created_at:C,updated_at:C,created_by:d,updated_by:d};try{const Oe=await h.create.mutateAsync(he);u({to:"/$org/$project/mcps/$appSlug/$collectionName/$itemId",params:{org:a,project:Fe,appSlug:x,collectionName:l,itemId:Oe.id}})}catch(Oe){console.error("Failed to create item:",Oe)}},e[37]=h.create,e[38]=x,e[39]=l,e[40]=c,e[41]=u,e[42]=a,e[43]=d,e[44]=ce):ce=e[44];const ye=ce;let de;e[45]!==r?(de=at(r),e[45]=r,e[46]=de):de=e[46];const ve=de,Le=(D?.length??0)>0,mt=c&&Le,ut=c&&!Le&&!w;let me;e[47]!==h.create||e[48]!==ye||e[49]!==c?(me=c?t.jsxs(ge,{onClick:ye,size:"sm",disabled:h.create.isPending,className:"h-7",children:[t.jsx(kt,{className:"mr-2 h-4 w-4"}),h.create.isPending?"Creating...":"Create"]}):null,e[47]=h.create,e[48]=ye,e[49]=c,e[50]=me):me=e[50];const ze=me,Ne=y;let B;e[51]!==I||e[52]!==v||e[53]!==ve||e[54]!==Ne?(B=t.jsx(Ye,{sortKey:Ne,sortDirection:v,onSort:I,sortOptions:ve}),e[51]=I,e[52]=v,e[53]=ve,e[54]=Ne,e[55]=B):B=e[55];const we=mt&&ze;let R;e[56]!==B||e[57]!==we?(R=t.jsxs(Lt,{children:[B,we]}),e[56]=B,e[57]=we,e[58]=R):R=e[58];const Se=`Search ${l}...`;let H;e[59]!==S?(H=C=>{C.key==="Escape"&&(S(""),C.target.blur())},e[59]=S,e[60]=H):H=e[60];let G;e[61]!==w||e[62]!==S||e[63]!==Se||e[64]!==H?(G=t.jsx(xt,{value:w,onChange:S,placeholder:Se,onKeyDown:H}),e[61]=w,e[62]=S,e[63]=Se,e[64]=H,e[65]=G):G=e[65];let q;e[66]!==D?(q=D??[],e[66]=D,e[67]=q):q=e[67];const _e=y;let J;e[68]!==F?(J=C=>F(C),e[68]=F,e[69]=J):J=e[69];const Pe="No items found",De=w?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ie=ut?ze:void 0;let Q;e[70]!==Pe||e[71]!==De||e[72]!==Ie?(Q=t.jsx(lt,{image:null,title:Pe,description:De,actions:Ie}),e[70]=Pe,e[71]=De,e[72]=Ie,e[73]=Q):Q=e[73];let V;e[74]!==I||e[75]!==$||e[76]!==Ce||e[77]!==r||e[78]!==w||e[79]!==S||e[80]!==z||e[81]!==v||e[82]!==q||e[83]!==_e||e[84]!==J||e[85]!==Q||e[86]!==_?(V=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(qt,{hideToolbar:!0,data:q,schema:r,viewMode:_,onViewModeChange:z,search:w,onSearchChange:S,sortKey:_e,sortDirection:v,onSort:I,actions:Ce,onItemClick:J,readOnly:$,emptyState:Q})}),e[74]=I,e[75]=$,e[76]=Ce,e[77]=r,e[78]=w,e[79]=S,e[80]=z,e[81]=v,e[82]=q,e[83]=_e,e[84]=J,e[85]=Q,e[86]=_,e[87]=V):V=e[87];let Y;e[88]!==G||e[89]!==V?(Y=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,V]}),e[88]=G,e[89]=V,e[90]=Y):Y=e[90];const Ae=!!K;let ue;e[91]===Symbol.for("react.memo_cache_sentinel")?(ue=C=>{C||je(null)},e[91]=ue):ue=e[91];let pe;e[92]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx(_t,{children:"Delete item?"}),e[92]=pe):pe=e[92];const Te=K?.title;let X;e[93]!==Te?(X=t.jsxs(Pt,{children:[pe,t.jsxs(Dt,{children:['Are you sure you want to delete "',Te,'"? This action cannot be undone.']})]}),e[93]=Te,e[94]=X):X=e[94];let Z;e[95]!==h.delete.isPending?(Z=t.jsx(wt,{disabled:h.delete.isPending,children:"Cancel"}),e[95]=h.delete.isPending,e[96]=Z):Z=e[96];const Ee=h.delete.isPending?"Deleting...":"Delete";let ee;e[97]!==h.delete.isPending||e[98]!==be||e[99]!==Ee?(ee=t.jsx(St,{onClick:be,disabled:h.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[97]=h.delete.isPending,e[98]=be,e[99]=Ee,e[100]=ee):ee=e[100];let te;e[101]!==Z||e[102]!==ee?(te=t.jsxs(It,{children:[Z,ee]}),e[101]=Z,e[102]=ee,e[103]=te):te=e[103];let se;e[104]!==X||e[105]!==te?(se=t.jsxs(At,{children:[X,te]}),e[104]=X,e[105]=te,e[106]=se):se=e[106];let oe;e[107]!==Ae||e[108]!==se?(oe=t.jsx(Tt,{open:Ae,onOpenChange:ue,children:se}),e[107]=Ae,e[108]=se,e[109]=oe):oe=e[109];let fe;return e[110]!==R||e[111]!==Y||e[112]!==oe?(fe=t.jsxs(t.Fragment,{children:[R,Y,oe]}),e[110]=R,e[111]=Y,e[112]=oe,e[113]=fe):fe=e[113],fe}function ss(){const s=ie.c(12),{org:e,project:o}=$e(),a=gt();let n;s[0]!==e.id?(n={connectionId:Ve,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const l=Qe(n);let r;s[2]!==l||s[3]!==o?(r=async u=>{const f=o.enabledPlugins??[];if(f.includes(u))return;const d=[...f,u],m=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:o.id,enabledPlugins:d}});return m.structuredContent??m},s[2]=l,s[3]=o,s[4]=r):r=s[4];let c;s[5]!==e.id||s[6]!==o||s[7]!==a?(c=()=>{a.invalidateQueries({queryKey:Ke.project(e.id,o.slug)}),a.invalidateQueries({queryKey:Ke.projects(e.id)})},s[5]=e.id,s[6]=o,s[7]=a,s[8]=c):c=s[8];let p;return s[9]!==r||s[10]!==c?(p={mutationFn:r,onSuccess:c,onError:os},s[9]=r,s[10]=c,s[11]=p):p=s[11],zt(p)}function os(s){ke.error("Failed to enable plugin: "+(s instanceof Error?s.message:"Unknown error"))}function is(s){const e=ie.c(12),{pluginId:o,title:a,description:n,icon:l}=s,r=ss();let c;e[0]!==r||e[1]!==o?(c=async()=>{try{await r.mutateAsync(o),ke.success("Plugin enabled!")}catch{}},e[0]=r,e[1]=o,e[2]=c):c=e[2];const p=c,i=l??null,u=r.isPending?"Enabling…":"Enable plugin";let f;e[3]!==r.isPending||e[4]!==p||e[5]!==u?(f=t.jsx(ge,{onClick:p,disabled:r.isPending,children:u}),e[3]=r.isPending,e[4]=p,e[5]=u,e[6]=f):f=e[6];let d;return e[7]!==n||e[8]!==i||e[9]!==f||e[10]!==a?(d=t.jsx(lt,{image:i,title:a,description:n,actions:f}),e[7]=n,e[8]=i,e[9]=f,e[10]=a,e[11]=d):d=e[11],d}const Je="MCP Workflows",ns={name:"WORKFLOW",displayName:"Workflow",hasCreateTool:!0,hasUpdateTool:!0,hasDeleteTool:!0};function co(){const s=ie.c(5),{project:e,org:o}=$e();if(!(e.enabledPlugins??[]).includes(Je)){let c;s[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k.Header,{children:t.jsx(k.Header.Left,{children:t.jsx(Be,{children:t.jsx(Re,{children:t.jsx(He,{children:t.jsx(Ge,{children:"Workflows"})})})})})}),s[0]=c):c=s[0];let p;return s[1]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs(k,{children:[c,t.jsx(k.Content,{children:t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(is,{pluginId:Je,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:t.jsx("div",{className:"bg-muted p-4 rounded-full",children:t.jsx(Ft,{className:"size-8 text-muted-foreground"})})})})})]}),s[1]=p):p=s[1],p}let l;s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(k.Header,{children:t.jsx(k.Header.Left,{children:t.jsx(Be,{children:t.jsx(Re,{children:t.jsx(He,{children:t.jsx(Ge,{children:"Workflows"})})})})})}),s[2]=l):l=s[2];let r;return s[3]!==o.slug?(r=t.jsxs(k,{children:[l,t.jsx(k.Content,{children:t.jsx(ts,{connectionId:Ve,org:o.slug,activeCollection:ns})})]}),s[3]=o.slug,s[4]=r):r=s[4],r}export{co as default};
1
+ import{d as ie,j as t,B as ge,f as pt,g as ft,c as $e,r as ht,O as Fe,w as ke,x as gt,K as Ke}from"./index-B62MiQAu.js";import{u as Qe,a as Ve}from"./constants-B7D0VCWO.js";import{g as Me}from"./generate-id-Dyweu44Y.js";import{C as Ye}from"./collection-display-button-DgaN6ief.js";import{C as xt}from"./collection-search-BxbLLE-D.js";import{C as jt}from"./card-CQTuw0Xi.js";import{I as Xe,e as Ze,r as We}from"./integration-icon-BByVvYW2.js";import{D as et,a as tt,b as st,c as L}from"./dropdown-menu-BT7g2ayh.js";import{c as ot}from"./Play-DSddPPya.js";import{i as it,s as nt}from"./RefreshCcw01-DN-y3At7.js";import{s as rt}from"./Trash01-fCw8HP0s.js";import{C as Ct}from"./collection-table-wrapper-DhM52ivn.js";import{E as Ue}from"./empty-state-CjwgvmoI.js";import{U as bt}from"./user-Wn7CHNY8.js";import{E as lt}from"./empty-state-8546_PpL.js";import{u as yt}from"./use-list-state-J17yqbOy.js";import{B as vt}from"./constants-B_S2_Dfe.js";import{g as Nt}from"./connection-slug-Bw8dtz1U.js";import{A as wt,h as St,c as _t,b as Pt,d as Dt,e as It,a as At,f as Tt}from"./alert-dialog-DPu-w5FH.js";import{u as Et,e as Ot}from"./use-collections-Cw-CkhM5.js";import{u as $t}from"./use-connection-u5F7YTDM.js";import{s as kt}from"./Plus-ltkKoqJz.js";import{a as Lt}from"./layout-CxMMzlDg.js";import{u as zt}from"./useMutation-5tF0rOhi.js";import{P as k}from"./index-DNarCA5m.js";import{B as Be,a as Re,b as He,c as Ge}from"./breadcrumb-B3Pzyfpg.js";import{e as Ft}from"./Dataflow03-DdTzEDv9.js";import"./ArrowUp-DVMY0e13.js";import"./Check-BgcEZAFd.js";import"./Type01-Dp2k0by5.js";import"./tooltip-Cz2tQy7f.js";import"./index-BcOdsrKl.js";import"./badge-Dg_rRuRo.js";import"./Loading01-CrI0NwPE.js";import"./SearchMd-CS43V34Y.js";import"./input-BNSWRvAr.js";import"./Container-BQWbDEy6.js";import"./AlertCircle-CE4aMC_6.js";import"./ArrowLeft-VzQjF5nf.js";import"./XCircle-MpsZU5qt.js";import"./ChevronDown-Ca93y5Zg.js";import"./ChevronRight-iThFOnTS.js";import"./ChevronUp-Dfrjh0kb.js";import"./FolderClosed-jb7WzUeW.js";import"./Settings01-ClJz1ULQ.js";import"./Upload01-3AVPYkeL.js";import"./User01-CKoZ8ZDH.js";import"./XClose-DKDxXEaA.js";import"./X-BNpME-HX.js";import"./Zap-kD49gPEF.js";import"./table-oKRuJlES.js";import"./avatar-DJ_eE6FL.js";import"./useQuery-Cr3Ibn6v.js";import"./use-view-mode-DDZQlalb.js";import"./collections-pcWRi6G6.js";import"./slugify-CEUa2lfQ.js";function Kt(s,e){const o=s.properties||{};for(const n in o){const l=o[n];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const a=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of a)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function Mt(s){const e=ie.c(25),{item:o,schema:a,actions:n}=s;let l;e[0]!==o||e[1]!==a?(l=Kt(a,o),e[0]=o,e[1]=a,e[2]=l):l=e[2];const r=l,c=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let p;e[3]!==n?(p=n&&Object.keys(n).length>0,e[3]=n,e[4]=p):p=e[4];const i=p;let u;e[5]!==r||e[6]!==o.title?(u=t.jsx(Xe,{icon:r,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=o.title,e[7]=u):u=e[7];let f;e[8]!==o.title?(f=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=f):f=e[9];const d=c||"No description";let m;e[10]!==d?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:d}),e[10]=d,e[11]=m):m=e[11];let b;e[12]!==f||e[13]!==m?(b=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[f,m]}),e[12]=f,e[13]=m,e[14]=b):b=e[14];let x;e[15]!==u||e[16]!==b?(x=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,b]}),e[15]=u,e[16]=b,e[17]=x):x=e[17];let N;e[18]!==n||e[19]!==i||e[20]!==o?(N=i&&t.jsx("div",{className:"absolute top-6 right-6 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",onClick:Rt,onMouseDown:Bt,children:t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ut,children:t.jsx(it,{size:20})})}),t.jsxs(st,{align:"end",onClick:Wt,children:[n.open&&t.jsxs(L,{onClick:g=>{g.stopPropagation(),n.open?.(o)},children:[t.jsx(nt,{size:16}),"Open"]}),n.edit&&t.jsxs(L,{onClick:g=>{g.stopPropagation(),n.edit?.(o)},children:[t.jsx(Ze,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(L,{onClick:g=>{g.stopPropagation(),n.duplicate?.(o)},children:[t.jsx(ot,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(L,{variant:"destructive",onClick:g=>{g.stopPropagation(),n.delete?.(o)},children:[t.jsx(rt,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=i,e[20]=o,e[21]=N):N=e[21];let j;return e[22]!==x||e[23]!==N?(j=t.jsxs(jt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[x,N]}),e[22]=x,e[23]=N,e[24]=j):j=e[24],j}function Wt(s){return s.stopPropagation()}function Ut(s){return s.stopPropagation()}function Bt(s){return s.stopPropagation()}function Rt(s){return s.stopPropagation()}const Ht=["icon","avatar","logo"],qe=["created_at","created_by","id"];function Gt(s){return Object.keys(s).find(e=>Ht.includes(e.toLowerCase()))}function at(s,e){return Object.keys(s.properties||{}).filter(o=>["id","created_at","updated_at","created_by","updated_by"].includes(o)?!1:e?e.includes(o):!0).map(o=>({id:o,label:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," ")}))}function qt(s){const e=ie.c(30),{data:o,schema:a,viewMode:n,search:l,sortKey:r,sortDirection:c,onSort:p,actions:i,onItemClick:u,headerActions:f,emptyState:d,readOnly:m,columns:b,hideToolbar:x,sortableFields:N}=s,j=c===void 0?"asc":c,g=p===void 0?Yt:p;let h;e[0]!==i?(h=i===void 0?{}:i,e[0]=i,e[1]=h):h=e[1];const E=h,T=u===void 0?Vt:u,w=f===void 0?null:f,O=d===void 0?null:d,S=m===void 0?!1:m,_=b===void 0?void 0:b,z=x===void 0?!1:x,y=N===void 0?void 0:N;let v;e[2]!==_||e[3]!==a||e[4]!==y?(v=_?_.filter(Qt).filter(A=>!y||y.includes(A.id)).map(Jt):at(a,y),e[2]=_,e[3]=a,e[4]=y,e[5]=v):v=e[5];const I=v;let P;e[6]!==w||e[7]!==z||e[8]!==g||e[9]!==j||e[10]!==r||e[11]!==I?(P=!z&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:w}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Ye,{sortKey:r,sortDirection:j,onSort:g,sortOptions:I})})]})}),e[6]=w,e[7]=z,e[8]=g,e[9]=j,e[10]=r,e[11]=I,e[12]=P):P=e[12];let D;e[13]!==E||e[14]!==_||e[15]!==o||e[16]!==O||e[17]!==T||e[18]!==g||e[19]!==S||e[20]!==a||e[21]!==l||e[22]!==j||e[23]!==r||e[24]!==y||e[25]!==n?(D=n==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:O||t.jsx(Ue,{icon:t.jsx(We,{size:36,className:"text-muted-foreground"}),title:"No items found",description:l?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:o.map(A=>t.jsx("div",{onClick:()=>T?.(A),className:"cursor-pointer h-full",children:t.jsx(Mt,{item:A,schema:a,readOnly:S,actions:E})},A.id))})}):t.jsx(Ct,{columns:es(_,a,y,E),data:o,sortKey:r,sortDirection:j,onSort:g,onRowClick:T,emptyState:O||t.jsx(Ue,{icon:t.jsx(We,{size:36,className:"text-muted-foreground"}),title:"No items found",description:l?"Try adjusting your search":"No items to display"})}),e[13]=E,e[14]=_,e[15]=o,e[16]=O,e[17]=T,e[18]=g,e[19]=S,e[20]=a,e[21]=l,e[22]=j,e[23]=r,e[24]=y,e[25]=n,e[26]=D):D=e[26];let $;return e[27]!==P||e[28]!==D?($=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[P,D]}),e[27]=P,e[28]=D,e[29]=$):$=e[29],$}function Jt(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Qt(s){return s.sortable!==!1}function Vt(){}function Yt(){}function Xt(s){return{id:"actions",header:"",render:e=>t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(ge,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:t.jsx(it,{size:20})})}),t.jsxs(st,{align:"end",onClick:o=>o.stopPropagation(),children:[s.open&&t.jsxs(L,{onClick:o=>{o.stopPropagation(),s.open?.(e)},children:[t.jsx(nt,{size:16}),"Open"]}),s.edit&&t.jsxs(L,{onClick:o=>{o.stopPropagation(),s.edit?.(e)},children:[t.jsx(Ze,{size:16}),"Edit"]}),s.duplicate&&t.jsxs(L,{onClick:o=>{o.stopPropagation(),s.duplicate?.(e)},children:[t.jsx(ot,{size:16}),"Duplicate"]}),s.delete&&t.jsxs(L,{variant:"destructive",onClick:o=>{o.stopPropagation(),s.delete?.(e)},children:[t.jsx(rt,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function ct(s){const e=s.type;return Array.isArray(e)?e.every(o=>ct({type:o})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Zt(s,e){const o=s.properties||{},a=Object.keys(o).filter(i=>{const u=o[i];return u&&ct(u)}),n=Gt(o),l=[],r=new Set;n&&a.includes(n)&&(l.push(n),r.add(n));const c=["title","description","updated_at","updated_by"];for(const i of c)a.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));const p=a.filter(i=>!r.has(i)&&!qe.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of p)l.push(i),r.add(i);for(const i of qe)a.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));return l.map(i=>{const u=o[i],f=e?e.includes(i):!["id"].includes(i);return i===n?{id:i,header:"",render:d=>{const m=d[i];return t.jsx(Xe,{icon:m,name:d.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:d=>{const m=d[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:f,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:d=>{const m=d[i];return m?t.jsx(bt,{id:String(m),size:"xs"}):"—"},sortable:f,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:d=>{const m=d[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:f,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:d=>{const m=d[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:f,cellClassName:"max-w-[200px]"}})}function es(s,e,o,a){const n=s||Zt(e,o);return n.some(c=>c.id==="actions")?n:Object.keys(a).length>0?[...n,Xt(a)]:n}function ts(s){const e=ie.c(114),{connectionId:o,org:a,activeCollection:n}=s,l=n.name,r=n.schema??vt,c=n.hasCreateTool,p=n.hasUpdateTool,i=n.hasDeleteTool,u=pt(),{data:f}=ft.useSession(),d=f?.user?.id||"unknown",m=$t(o);let b;e[0]!==m||e[1]!==o?(b=m?Nt(m):o,e[0]=m,e[1]=o,e[2]=b):b=e[2];const x=b,{org:N}=$e();let j;e[3]!==o||e[4]!==N.id?(j={connectionId:o,orgId:N.id},e[3]=o,e[4]=N.id,e[5]=j):j=e[5];const g=Qe(j),h=Et(o,l,g),E=`${o}-${l}`;let T;e[6]!==a||e[7]!==E?(T={namespace:a,resource:E,defaultSortKey:"updated_at"},e[6]=a,e[7]=E,e[8]=T):T=e[8];const{search:w,searchTerm:O,setSearch:S,viewMode:_,setViewMode:z,sortKey:y,sortDirection:v,handleSort:I}=yt(T);let P;e[9]!==O||e[10]!==v||e[11]!==y?(P={searchTerm:O,sortKey:y,sortDirection:v},e[9]=O,e[10]=v,e[11]=y,e[12]=P):P=e[12];const D=Ot(o,l,g,P),$=!c&&!p&&!i;let A;e[13]!==x||e[14]!==l||e[15]!==u||e[16]!==a?(A=C=>{u({to:"/$org/$project/mcps/$appSlug/$collectionName/$itemId",params:{org:a,project:Fe,appSlug:x,collectionName:l,itemId:C.id}})},e[13]=x,e[14]=l,e[15]=u,e[16]=a,e[17]=A):A=e[17];const F=A;let ne;e[18]!==h.create||e[19]!==d?(ne=async C=>{const he=new Date().toISOString();await h.create.mutateAsync({...C,id:Me("conn"),title:`${C.title} (Copy)`,created_at:he,updated_at:he,created_by:d,updated_by:d})},e[18]=h.create,e[19]=d,e[20]=ne):ne=e[20];const xe=ne,[K,je]=ht.useState(null);let re;e[21]===Symbol.for("react.memo_cache_sentinel")?(re=C=>{je(C)},e[21]=re):re=e[21];const dt=re;let M;e[22]!==F||e[23]!==p?(M=p&&{edit:F},e[22]=F,e[23]=p,e[24]=M):M=e[24];let W;e[25]!==xe||e[26]!==c?(W=c&&{duplicate:xe},e[25]=xe,e[26]=c,e[27]=W):W=e[27];let U;e[28]!==i?(U=i&&{delete:dt},e[28]=i,e[29]=U):U=e[29];let le;e[30]!==W||e[31]!==U||e[32]!==M?(le={...M,...W,...U},e[30]=W,e[31]=U,e[32]=M,e[33]=le):le=e[33];const Ce=le;let ae;e[34]!==h.delete||e[35]!==K?(ae=async()=>{K&&(await h.delete.mutateAsync(K.id),je(null))},e[34]=h.delete,e[35]=K,e[36]=ae):ae=e[36];const be=ae;let ce;e[37]!==h.create||e[38]!==x||e[39]!==l||e[40]!==c||e[41]!==u||e[42]!==a||e[43]!==d?(ce=async()=>{if(!c){ke.error("Create operation is not available for this collection");return}const C=new Date().toISOString(),he={id:Me("conn"),title:"New Item",description:"A brief description of the item",created_at:C,updated_at:C,created_by:d,updated_by:d};try{const Oe=await h.create.mutateAsync(he);u({to:"/$org/$project/mcps/$appSlug/$collectionName/$itemId",params:{org:a,project:Fe,appSlug:x,collectionName:l,itemId:Oe.id}})}catch(Oe){console.error("Failed to create item:",Oe)}},e[37]=h.create,e[38]=x,e[39]=l,e[40]=c,e[41]=u,e[42]=a,e[43]=d,e[44]=ce):ce=e[44];const ye=ce;let de;e[45]!==r?(de=at(r),e[45]=r,e[46]=de):de=e[46];const ve=de,Le=(D?.length??0)>0,mt=c&&Le,ut=c&&!Le&&!w;let me;e[47]!==h.create||e[48]!==ye||e[49]!==c?(me=c?t.jsxs(ge,{onClick:ye,size:"sm",disabled:h.create.isPending,className:"h-7",children:[t.jsx(kt,{className:"mr-2 h-4 w-4"}),h.create.isPending?"Creating...":"Create"]}):null,e[47]=h.create,e[48]=ye,e[49]=c,e[50]=me):me=e[50];const ze=me,Ne=y;let B;e[51]!==I||e[52]!==v||e[53]!==ve||e[54]!==Ne?(B=t.jsx(Ye,{sortKey:Ne,sortDirection:v,onSort:I,sortOptions:ve}),e[51]=I,e[52]=v,e[53]=ve,e[54]=Ne,e[55]=B):B=e[55];const we=mt&&ze;let R;e[56]!==B||e[57]!==we?(R=t.jsxs(Lt,{children:[B,we]}),e[56]=B,e[57]=we,e[58]=R):R=e[58];const Se=`Search ${l}...`;let H;e[59]!==S?(H=C=>{C.key==="Escape"&&(S(""),C.target.blur())},e[59]=S,e[60]=H):H=e[60];let G;e[61]!==w||e[62]!==S||e[63]!==Se||e[64]!==H?(G=t.jsx(xt,{value:w,onChange:S,placeholder:Se,onKeyDown:H}),e[61]=w,e[62]=S,e[63]=Se,e[64]=H,e[65]=G):G=e[65];let q;e[66]!==D?(q=D??[],e[66]=D,e[67]=q):q=e[67];const _e=y;let J;e[68]!==F?(J=C=>F(C),e[68]=F,e[69]=J):J=e[69];const Pe="No items found",De=w?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ie=ut?ze:void 0;let Q;e[70]!==Pe||e[71]!==De||e[72]!==Ie?(Q=t.jsx(lt,{image:null,title:Pe,description:De,actions:Ie}),e[70]=Pe,e[71]=De,e[72]=Ie,e[73]=Q):Q=e[73];let V;e[74]!==I||e[75]!==$||e[76]!==Ce||e[77]!==r||e[78]!==w||e[79]!==S||e[80]!==z||e[81]!==v||e[82]!==q||e[83]!==_e||e[84]!==J||e[85]!==Q||e[86]!==_?(V=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(qt,{hideToolbar:!0,data:q,schema:r,viewMode:_,onViewModeChange:z,search:w,onSearchChange:S,sortKey:_e,sortDirection:v,onSort:I,actions:Ce,onItemClick:J,readOnly:$,emptyState:Q})}),e[74]=I,e[75]=$,e[76]=Ce,e[77]=r,e[78]=w,e[79]=S,e[80]=z,e[81]=v,e[82]=q,e[83]=_e,e[84]=J,e[85]=Q,e[86]=_,e[87]=V):V=e[87];let Y;e[88]!==G||e[89]!==V?(Y=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,V]}),e[88]=G,e[89]=V,e[90]=Y):Y=e[90];const Ae=!!K;let ue;e[91]===Symbol.for("react.memo_cache_sentinel")?(ue=C=>{C||je(null)},e[91]=ue):ue=e[91];let pe;e[92]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx(_t,{children:"Delete item?"}),e[92]=pe):pe=e[92];const Te=K?.title;let X;e[93]!==Te?(X=t.jsxs(Pt,{children:[pe,t.jsxs(Dt,{children:['Are you sure you want to delete "',Te,'"? This action cannot be undone.']})]}),e[93]=Te,e[94]=X):X=e[94];let Z;e[95]!==h.delete.isPending?(Z=t.jsx(wt,{disabled:h.delete.isPending,children:"Cancel"}),e[95]=h.delete.isPending,e[96]=Z):Z=e[96];const Ee=h.delete.isPending?"Deleting...":"Delete";let ee;e[97]!==h.delete.isPending||e[98]!==be||e[99]!==Ee?(ee=t.jsx(St,{onClick:be,disabled:h.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[97]=h.delete.isPending,e[98]=be,e[99]=Ee,e[100]=ee):ee=e[100];let te;e[101]!==Z||e[102]!==ee?(te=t.jsxs(It,{children:[Z,ee]}),e[101]=Z,e[102]=ee,e[103]=te):te=e[103];let se;e[104]!==X||e[105]!==te?(se=t.jsxs(At,{children:[X,te]}),e[104]=X,e[105]=te,e[106]=se):se=e[106];let oe;e[107]!==Ae||e[108]!==se?(oe=t.jsx(Tt,{open:Ae,onOpenChange:ue,children:se}),e[107]=Ae,e[108]=se,e[109]=oe):oe=e[109];let fe;return e[110]!==R||e[111]!==Y||e[112]!==oe?(fe=t.jsxs(t.Fragment,{children:[R,Y,oe]}),e[110]=R,e[111]=Y,e[112]=oe,e[113]=fe):fe=e[113],fe}function ss(){const s=ie.c(12),{org:e,project:o}=$e(),a=gt();let n;s[0]!==e.id?(n={connectionId:Ve,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const l=Qe(n);let r;s[2]!==l||s[3]!==o?(r=async u=>{const f=o.enabledPlugins??[];if(f.includes(u))return;const d=[...f,u],m=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:o.id,enabledPlugins:d}});return m.structuredContent??m},s[2]=l,s[3]=o,s[4]=r):r=s[4];let c;s[5]!==e.id||s[6]!==o||s[7]!==a?(c=()=>{a.invalidateQueries({queryKey:Ke.project(e.id,o.slug)}),a.invalidateQueries({queryKey:Ke.projects(e.id)})},s[5]=e.id,s[6]=o,s[7]=a,s[8]=c):c=s[8];let p;return s[9]!==r||s[10]!==c?(p={mutationFn:r,onSuccess:c,onError:os},s[9]=r,s[10]=c,s[11]=p):p=s[11],zt(p)}function os(s){ke.error("Failed to enable plugin: "+(s instanceof Error?s.message:"Unknown error"))}function is(s){const e=ie.c(12),{pluginId:o,title:a,description:n,icon:l}=s,r=ss();let c;e[0]!==r||e[1]!==o?(c=async()=>{try{await r.mutateAsync(o),ke.success("Plugin enabled!")}catch{}},e[0]=r,e[1]=o,e[2]=c):c=e[2];const p=c,i=l??null,u=r.isPending?"Enabling…":"Enable plugin";let f;e[3]!==r.isPending||e[4]!==p||e[5]!==u?(f=t.jsx(ge,{onClick:p,disabled:r.isPending,children:u}),e[3]=r.isPending,e[4]=p,e[5]=u,e[6]=f):f=e[6];let d;return e[7]!==n||e[8]!==i||e[9]!==f||e[10]!==a?(d=t.jsx(lt,{image:i,title:a,description:n,actions:f}),e[7]=n,e[8]=i,e[9]=f,e[10]=a,e[11]=d):d=e[11],d}const Je="MCP Workflows",ns={name:"WORKFLOW",displayName:"Workflow",hasCreateTool:!0,hasUpdateTool:!0,hasDeleteTool:!0};function co(){const s=ie.c(5),{project:e,org:o}=$e();if(!(e.enabledPlugins??[]).includes(Je)){let c;s[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k.Header,{children:t.jsx(k.Header.Left,{children:t.jsx(Be,{children:t.jsx(Re,{children:t.jsx(He,{children:t.jsx(Ge,{children:"Workflows"})})})})})}),s[0]=c):c=s[0];let p;return s[1]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs(k,{children:[c,t.jsx(k.Content,{children:t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(is,{pluginId:Je,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:t.jsx("div",{className:"bg-muted p-4 rounded-full",children:t.jsx(Ft,{className:"size-8 text-muted-foreground"})})})})})]}),s[1]=p):p=s[1],p}let l;s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(k.Header,{children:t.jsx(k.Header.Left,{children:t.jsx(Be,{children:t.jsx(Re,{children:t.jsx(He,{children:t.jsx(Ge,{children:"Workflows"})})})})})}),s[2]=l):l=s[2];let r;return s[3]!==o.slug?(r=t.jsxs(k,{children:[l,t.jsx(k.Content,{children:t.jsx(ts,{connectionId:Ve,org:o.slug,activeCollection:ns})})]}),s[3]=o.slug,s[4]=r):r=s[4],r}export{co as default};
@@ -1,4 +1,4 @@
1
- import{B as te,c as re}from"./collections-D4sy0Xs0.js";import{bR as _,c2 as ge,q as s,aK as p,aM as v,bU as pe,aL as h,aP as k,bp as x,aN as W,c3 as H,o as a,c4 as he,c5 as ve,c6 as Ae,b$ as Me,c7 as Te,c8 as je,c9 as Le,ca as Ue,cb as q,cc as ne,cd as we,bM as Ce,ce as Re,aV as S,aQ as y,aO as We}from"./index-DIir8pgm.js";import{h as He,j as De,n as qe,k as $e,C as Be}from"./constants-C2mKle9u.js";var Fe=class{apply(e,r){if(!r.type)return;const t=Array.isArray(r.type)?r.type:[r.type],n=new Set(t);if(n.has("string")||(e.string=!1),!n.has("number")&&!n.has("integer")&&(e.number=!1),n.has("boolean")||(e.boolean=!1),n.has("null")||(e.null=!1),n.has("array")||(e.array=!1),n.has("object")||(e.object=!1),n.has("integer")&&e.number!==!1){const i=e.number||p();i instanceof H&&(e.number=i.int())}}},Ve=class{apply(e,r){if(r.const===void 0)return;const t=r.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof t=="string"?e.string=x(t):typeof t=="number"?e.number=x(t):typeof t=="boolean"?e.boolean=x(t):t===null?e.null=pe():Array.isArray(t)?e.array=void 0:typeof t=="object"&&(e.object=void 0)}},Ge=class{apply(e,r){if(!r.enum)return;if(r.enum.length===0){r.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const t={string:r.enum.filter(n=>typeof n=="string"),number:r.enum.filter(n=>typeof n=="number"),boolean:r.enum.filter(n=>typeof n=="boolean"),null:r.enum.filter(n=>n===null),array:r.enum.filter(n=>Array.isArray(n)),object:r.enum.filter(n=>typeof n=="object"&&n!==null&&!Array.isArray(n))};e.string=this.createTypeSchema(t.string,"string"),e.number=this.createTypeSchema(t.number,"number"),e.boolean=this.createTypeSchema(t.boolean,"boolean"),e.null=t.null.length>0?pe():!1,e.array=t.array.length>0?void 0:!1,e.object=t.object.length>0?void 0:!1}createTypeSchema(e,r){if(e.length===0)return!1;if(e.length===1)return x(e[0]);if(r==="string")return W(e);if(r==="number"){const[t,n,...i]=e;return k([x(t),x(n),...i.map(o=>x(o))])}return r==="boolean"?k([x(!0),x(!1)]):!1}},Je=class{apply(e,r){const t=r;if(t.type==="string"&&t.format==="binary"&&t.contentEncoding==="binary"){let n=Ue();t.minLength!==void 0&&(n=n.min(t.minLength)),t.maxLength!==void 0&&(n=n.max(t.maxLength)),t.contentMediaType!==void 0&&(n=n.mime(t.contentMediaType)),e.file=n,e.string=!1}}},Ke=class{apply(e,r){const t=r;r.type===void 0&&(t.minLength!==void 0||t.maxLength!==void 0||t.pattern!==void 0)&&e.string===void 0&&(e.string=s())}},Ze=class{apply(e,r){const t=r;if(t.minLength!==void 0&&e.string!==!1){const n=e.string||s();n instanceof he&&(e.string=n.refine(i=>Array.from(i).length>=t.minLength,{message:`String must be at least ${t.minLength} characters long`}))}}},Xe=class{apply(e,r){const t=r;if(t.maxLength!==void 0&&e.string!==!1){const n=e.string||s();n instanceof he&&(e.string=n.refine(i=>Array.from(i).length<=t.maxLength,{message:`String must be at most ${t.maxLength} characters long`}))}}},ze=class{apply(e,r){const t=r;if(t.pattern&&e.string!==!1){const n=e.string||s();if(n instanceof he){const i=new RegExp(t.pattern);e.string=n.regex(i)}}}},Qe=class{apply(e,r){const t=r;if(t.minimum!==void 0&&e.number!==!1){const n=e.number||p();n instanceof H&&(e.number=n.min(t.minimum))}}},Ye=class{apply(e,r){const t=r;if(t.maximum!==void 0&&e.number!==!1){const n=e.number||p();n instanceof H&&(e.number=n.max(t.maximum))}}},et=class{apply(e,r){const t=r;if(t.exclusiveMinimum!==void 0&&e.number!==!1){const n=e.number||p();n instanceof H&&(typeof t.exclusiveMinimum=="number"?e.number=n.gt(t.exclusiveMinimum):e.number=!1)}}},tt=class{apply(e,r){const t=r;if(t.exclusiveMaximum!==void 0&&e.number!==!1){const n=e.number||p();n instanceof H&&(typeof t.exclusiveMaximum=="number"?e.number=n.lt(t.exclusiveMaximum):e.number=!1)}}},rt=class{apply(e,r){const t=r;if(t.multipleOf!==void 0&&e.number!==!1){const n=e.number||p();n instanceof H&&(e.number=n.refine(i=>{if(t.multipleOf===0)return!1;const o=i/t.multipleOf,c=Math.round(o),u=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(t.multipleOf)*Number.EPSILON*10);return Math.abs(o-c)<=u/Math.abs(t.multipleOf)},{message:`Must be a multiple of ${t.multipleOf}`}))}}},nt=class{apply(e,r){const t=r;r.type===void 0&&(t.minItems!==void 0||t.maxItems!==void 0||t.items!==void 0||t.prefixItems!==void 0)&&e.array===void 0&&(e.array=h(_()))}},st=class{apply(e,r){const t=r;t.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||h(_())).min(t.minItems))}},it=class{apply(e,r){const t=r;t.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||h(_())).max(t.maxItems))}},ot=class{apply(e,r){const t=r;if(e.array!==!1)if(Array.isArray(t.items))e.array=e.array||h(_());else if(t.items&&typeof t.items!="boolean"&&!t.prefixItems){const n=g(t.items);let i=h(n);if(e.array&&e.array instanceof Ae){const o=e.array._def;o.checks&&o.checks.forEach(c=>{if(c._zod&&c._zod.def){const u=c._zod.def;u.check==="min_length"&&u.minimum!==void 0?i=i.min(u.minimum):u.check==="max_length"&&u.maximum!==void 0&&(i=i.max(u.maximum))}})}e.array=i}else typeof t.items=="boolean"&&t.items===!1?t.prefixItems?e.array=e.array||h(_()):e.array=h(_()).max(0):typeof t.items=="boolean"&&t.items===!0?e.array=e.array||h(_()):t.prefixItems&&(e.array=e.array||h(_()))}},at=class{apply(e,r){if(r.type!=="array")return;const t=r;if(!Array.isArray(t.items)||e.array===!1)return;const n=t.items.map(o=>g(o));let i;n.length===0?i=ve([]):i=ve(n),t.minItems!==void 0&&t.minItems>n.length&&(i=!1),t.maxItems!==void 0&&t.maxItems<n.length&&(i=!1),e.tuple=i,e.array=!1}},ct=class{apply(e,r){const t=r;e.object!==!1&&(t.properties||t.required||t.additionalProperties!==void 0)&&(e.object=e.object||a({}).passthrough())}},lt=class{apply(e,r){const t=r;r.type===void 0&&(t.maxProperties!==void 0||t.minProperties!==void 0)&&e.object===void 0&&(e.object=a({}).passthrough())}},ut=class{apply(e,r){const t=r;if(t.maxProperties!==void 0&&e.object!==!1){const n=e.object||a({}).passthrough();e.object=n.refine(i=>Object.keys(i).length<=t.maxProperties,{message:`Object must have at most ${t.maxProperties} properties`})}}},dt=class{apply(e,r){const t=r;if(t.minProperties!==void 0&&e.object!==!1){const n=e.object||a({}).passthrough();e.object=n.refine(i=>Object.keys(i).length>=t.minProperties,{message:`Object must have at least ${t.minProperties} properties`})}}};function G(e,r){if(e===r)return!0;if(e==null||r==null)return e===r;if(typeof e!=typeof r)return!1;if(Array.isArray(e)&&Array.isArray(r))return e.length!==r.length?!1:e.every((t,n)=>G(t,r[n]));if(typeof e=="object"&&typeof r=="object"){const t=Object.keys(e),n=Object.keys(r);return t.length!==n.length?!1:t.every(i=>n.includes(i)&&G(e[i],r[i]))}return!1}function pt(){return e=>{if(!Array.isArray(e))return!0;const r=[];return e.every(t=>r.some(i=>G(t,i))?!1:(r.push(t),!0))}}function Y(e,r){return e.safeParse(r).success}var ht=class{apply(e,r){if(!r.not)return e;const t=g(r.not);return e.refine(n=>!Y(t,n),{message:"Value must not match the 'not' schema"})}},ft=class{apply(e,r){return r.uniqueItems!==!0?e:e.refine(pt(),{message:"Array items must be unique"})}},mt=class{apply(e,r){return!r.allOf||r.allOf.length===0?e:r.allOf.map(n=>g(n)).reduce((n,i)=>Te(n,i),e)}},bt=class{apply(e,r){if(!r.anyOf||r.anyOf.length===0)return e;const t=r.anyOf.length===1?g(r.anyOf[0]):k([g(r.anyOf[0]),g(r.anyOf[1]),...r.anyOf.slice(2).map(n=>g(n))]);return Te(e,t)}},yt=class{apply(e,r){if(!r.oneOf||r.oneOf.length===0)return e;const t=r.oneOf.map(n=>g(n));return e.refine(n=>{let i=0;for(const o of t)if(o.safeParse(n).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},gt=class{apply(e,r){const t=r;if(t.prefixItems&&Array.isArray(t.prefixItems)){const i=t.prefixItems.map(o=>g(o));return e.refine(o=>{if(!Array.isArray(o))return!0;for(let c=0;c<Math.min(o.length,i.length);c++)if(!Y(i[c],o[c]))return!1;if(o.length>i.length){if(typeof t.items=="boolean"&&t.items===!1)return!1;if(t.items&&typeof t.items=="object"&&!Array.isArray(t.items)){const c=g(t.items);for(let u=i.length;u<o.length;u++)if(!Y(c,o[u]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},vt=class{apply(e,r){const t=r;if(!t.properties&&!t.required&&t.additionalProperties!==!1)return e;if(e instanceof je||e instanceof Le){const n={};if(t.properties)for(const[i,o]of Object.entries(t.properties))o!==void 0&&(n[i]=g(o));if(t.required&&Array.isArray(t.required)){const i=new Set(t.required);for(const o of Object.keys(n))i.has(o)||(n[o]=n[o].optional())}else for(const i of Object.keys(n))n[i]=n[i].optional();return t.additionalProperties===!1?a(n):a(n).passthrough()}return e.refine(n=>{if(typeof n!="object"||n===null||Array.isArray(n))return!0;if(t.properties){for(const[i,o]of Object.entries(t.properties))if(o!==void 0&&Object.getOwnPropertyDescriptor(n,i)!==void 0&&!g(o).safeParse(n[i]).success)return!1}if(t.required&&Array.isArray(t.required)){for(const i of t.required)if(!(Object.getOwnPropertyDescriptor(n,i)!==void 0))return!1}if(t.additionalProperties===!1&&t.properties){const i=new Set(Object.keys(t.properties));for(const o in n)if(!i.has(o))return!1}return!0},{message:"Object constraints validation failed"})}},wt=class{apply(e,r){if(!r.enum||r.enum.length===0)return e;const t=r.enum.filter(n=>Array.isArray(n)||typeof n=="object"&&n!==null);return t.length===0?e:e.refine(n=>typeof n!="object"||n===null?!0:t.some(i=>G(n,i)),{message:"Value must match one of the enum values"})}},St=class{apply(e,r){if(r.const===void 0)return e;const t=r.const;return typeof t!="object"||t===null?e:e.refine(n=>G(n,t),{message:"Value must equal the const value"})}},_t=class{apply(e,r){return r.description&&(e=e.describe(r.description)),e}},Et=class{apply(e,r){var t;const n=r;return!((t=n.required)!=null&&t.includes("__proto__"))||r.type!==void 0?e:_().refine(i=>this.validateRequired(i,n.required),{message:"Missing required properties"})}validateRequired(e,r){return typeof e!="object"||e===null||Array.isArray(e)?!0:r.every(t=>Object.prototype.hasOwnProperty.call(e,t))}},xt=class{apply(e,r){var t;const n=r;if(n.contains===void 0)return e;const i=g(n.contains),o=(t=n.minContains)!=null?t:1,c=n.maxContains;return e.refine(u=>{if(!Array.isArray(u))return!0;let m=0;for(const d of u)Y(i,d)&&m++;return!(m<o||c!==void 0&&m>c)},{message:"Array must contain required items matching the schema"})}},Ot=class{apply(e,r){const{default:t}=r;return t===void 0||!e.safeParse(t).success?e:e.default(t)}},It=[new Ve,new Ge,new Fe,new Je,new Ke,new nt,new lt,new Ze,new Xe,new ze,new Qe,new Ye,new et,new tt,new rt,new at,new st,new it,new ot,new ut,new dt,new ct],Tt=[new Et,new wt,new St,new mt,new bt,new yt,new gt,new vt,new xt,new ht,new ft,new Ot,new _t];function g(e){if(typeof e=="boolean")return e?_():ge();const r={};for(const i of It)i.apply(r,e);const t=[];if(r.string!==!1&&t.push(r.string||s()),r.number!==!1&&t.push(r.number||p()),r.boolean!==!1&&t.push(r.boolean||v()),r.null!==!1&&t.push(r.null||pe()),r.array!==!1&&t.push(r.array||h(_())),r.tuple!==!1&&r.tuple!==void 0&&t.push(r.tuple),r.object!==!1)if(r.object)t.push(r.object);else{const i=Me(o=>typeof o=="object"&&o!==null&&!Array.isArray(o),"Must be an object, not an array");t.push(i)}r.file!==!1&&r.file!==void 0&&t.push(r.file);let n;t.length===0?n=ge():t.length===1?n=t[0]:Object.keys(e).some(o=>o!=="$schema"&&o!=="title"&&o!=="description")?n=k(t):n=_();for(const i of Tt)n=i.apply(n,e);return n}class Se extends Event{constructor(r,t){var n,i;super(r),this.code=(n=t?.code)!=null?n:void 0,this.message=(i=t?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](r,t,n){return n(_e(this),t)}[Symbol.for("Deno.customInspect")](r,t){return r(_e(this),t)}}function Ct(e){const r=globalThis.DOMException;return typeof r=="function"?new r(e,"SyntaxError"):new SyntaxError(e)}function se(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(se).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${se(e.cause)}`:e.message:`${e}`}function _e(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var ke=e=>{throw TypeError(e)},fe=(e,r,t)=>r.has(e)||ke("Cannot "+t),l=(e,r,t)=>(fe(e,r,"read from private field"),t?t.call(e):r.get(e)),b=(e,r,t)=>r.has(e)?ke("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,t),f=(e,r,t,n)=>(fe(e,r,"write to private field"),r.set(e,t),t),I=(e,r,t)=>(fe(e,r,"access private method"),t),w,C,M,z,ee,F,U,V,T,j,R,L,$,E,ie,oe,ae,Ee,ce,le,B,ue,de;class Q extends EventTarget{constructor(r,t){var n,i;super(),b(this,E),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,b(this,w),b(this,C),b(this,M),b(this,z),b(this,ee),b(this,F),b(this,U),b(this,V,null),b(this,T),b(this,j),b(this,R,null),b(this,L,null),b(this,$,null),b(this,oe,async o=>{var c;l(this,j).reset();const{body:u,redirected:m,status:d,headers:O}=o;if(d===204){I(this,E,B).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(m?f(this,M,new URL(o.url)):f(this,M,void 0),d!==200){I(this,E,B).call(this,`Non-200 status code (${d})`,d);return}if(!(O.get("content-type")||"").startsWith("text/event-stream")){I(this,E,B).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(l(this,w)===this.CLOSED)return;f(this,w,this.OPEN);const N=new Event("open");if((c=l(this,$))==null||c.call(this,N),this.dispatchEvent(N),typeof u!="object"||!u||!("getReader"in u)){I(this,E,B).call(this,"Invalid response body, expected a web ReadableStream",d),this.close();return}const D=new TextDecoder,J=u.getReader();let P=!0;do{const{done:K,value:A}=await J.read();A&&l(this,j).feed(D.decode(A,{stream:!K})),K&&(P=!1,l(this,j).reset(),I(this,E,ue).call(this))}while(P)}),b(this,ae,o=>{f(this,T,void 0),!(o.name==="AbortError"||o.type==="aborted")&&I(this,E,ue).call(this,se(o))}),b(this,ce,o=>{typeof o.id=="string"&&f(this,V,o.id);const c=new MessageEvent(o.event||"message",{data:o.data,origin:l(this,M)?l(this,M).origin:l(this,C).origin,lastEventId:o.id||""});l(this,L)&&(!o.event||o.event==="message")&&l(this,L).call(this,c),this.dispatchEvent(c)}),b(this,le,o=>{f(this,F,o)}),b(this,de,()=>{f(this,U,void 0),l(this,w)===this.CONNECTING&&I(this,E,ie).call(this)});try{if(r instanceof URL)f(this,C,r);else if(typeof r=="string")f(this,C,new URL(r,kt()));else throw new Error("Invalid URL")}catch{throw Ct("An invalid or illegal string was specified")}f(this,j,He({onEvent:l(this,ce),onRetry:l(this,le)})),f(this,w,this.CONNECTING),f(this,F,3e3),f(this,ee,(n=t?.fetch)!=null?n:globalThis.fetch),f(this,z,(i=t?.withCredentials)!=null?i:!1),I(this,E,ie).call(this)}get readyState(){return l(this,w)}get url(){return l(this,C).href}get withCredentials(){return l(this,z)}get onerror(){return l(this,R)}set onerror(r){f(this,R,r)}get onmessage(){return l(this,L)}set onmessage(r){f(this,L,r)}get onopen(){return l(this,$)}set onopen(r){f(this,$,r)}addEventListener(r,t,n){const i=t;super.addEventListener(r,i,n)}removeEventListener(r,t,n){const i=t;super.removeEventListener(r,i,n)}close(){l(this,U)&&clearTimeout(l(this,U)),l(this,w)!==this.CLOSED&&(l(this,T)&&l(this,T).abort(),f(this,w,this.CLOSED),f(this,T,void 0))}}w=new WeakMap,C=new WeakMap,M=new WeakMap,z=new WeakMap,ee=new WeakMap,F=new WeakMap,U=new WeakMap,V=new WeakMap,T=new WeakMap,j=new WeakMap,R=new WeakMap,L=new WeakMap,$=new WeakMap,E=new WeakSet,ie=function(){f(this,w,this.CONNECTING),f(this,T,new AbortController),l(this,ee)(l(this,C),I(this,E,Ee).call(this)).then(l(this,oe)).catch(l(this,ae))},oe=new WeakMap,ae=new WeakMap,Ee=function(){var e;const r={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...l(this,V)?{"Last-Event-ID":l(this,V)}:void 0},cache:"no-store",signal:(e=l(this,T))==null?void 0:e.signal};return"window"in globalThis&&(r.credentials=this.withCredentials?"include":"same-origin"),r},ce=new WeakMap,le=new WeakMap,B=function(e,r){var t;l(this,w)!==this.CLOSED&&f(this,w,this.CLOSED);const n=new Se("error",{code:r,message:e});(t=l(this,R))==null||t.call(this,n),this.dispatchEvent(n)},ue=function(e,r){var t;if(l(this,w)===this.CLOSED)return;f(this,w,this.CONNECTING);const n=new Se("error",{code:r,message:e});(t=l(this,R))==null||t.call(this,n),this.dispatchEvent(n),f(this,U,setTimeout(l(this,de),l(this,F)))},de=new WeakMap,Q.CONNECTING=0,Q.OPEN=1,Q.CLOSED=2;function kt(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class Nt extends Error{constructor(r,t,n){super(`SSE error: ${t}`),this.code=r,this.event=n}}class Pt{constructor(r,t){this._url=r,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=t?.eventSourceInit,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=De(t?.fetch,t?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new q("No auth provider");let r;try{r=await ne(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(t){throw this.onerror?.(t),t}if(r!=="AUTHORIZED")throw new q;return await this._startOrAuth()}async _commonHeaders(){const r={};if(this._authProvider){const n=await this._authProvider.tokens();n&&(r.Authorization=`Bearer ${n.access_token}`)}this._protocolVersion&&(r["mcp-protocol-version"]=this._protocolVersion);const t=qe(this._requestInit?.headers);return new Headers({...r,...t})}_startOrAuth(){const r=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((t,n)=>{this._eventSource=new Q(this._url.href,{...this._eventSourceInit,fetch:async(i,o)=>{const c=await this._commonHeaders();c.set("Accept","text/event-stream");const u=await r(i,{...o,headers:c});if(u.status===401&&u.headers.has("www-authenticate")){const{resourceMetadataUrl:m,scope:d}=we(u);this._resourceMetadataUrl=m,this._scope=d}return u}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(t,n);return}const o=new Nt(i.code,i.message,i);n(o),this.onerror?.(o)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const o=i;try{if(this._endpoint=new URL(o.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(c){n(c),this.onerror?.(c),this.close();return}t()}),this._eventSource.onmessage=i=>{const o=i;let c;try{c=Ce.parse(JSON.parse(o.data))}catch(u){this.onerror?.(u);return}this.onmessage?.(c)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(r){if(!this._authProvider)throw new q("No auth provider");if(await ne(this._authProvider,{serverUrl:this._url,authorizationCode:r,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new q("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(r){if(!this._endpoint)throw new Error("Not connected");try{const t=await this._commonHeaders();t.set("content-type","application/json");const n={...this._requestInit,method:"POST",headers:t,body:JSON.stringify(r),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,n);if(!i.ok){const o=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:c,scope:u}=we(i);if(this._resourceMetadataUrl=c,this._scope=u,await ne(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new q;return this.send(r)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${o}`)}await i.body?.cancel()}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(r){this._protocolVersion=r}}const At="mcp";class Mt{constructor(r){this._url=r}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((r,t)=>{this._socket=new WebSocket(this._url,At),this._socket.onerror=n=>{const i="error"in n?n.error:new Error(`WebSocket error: ${JSON.stringify(n)}`);t(i),this.onerror?.(i)},this._socket.onopen=()=>{r()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=n=>{let i;try{i=Ce.parse(JSON.parse(n.data))}catch(o){this.onerror?.(o);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(r){return new Promise((t,n)=>{if(!this._socket){n(new Error("Not connected"));return}this._socket?.send(JSON.stringify(r)),t()})}}class jt extends $e{constructor(r,t){super(r,t)}send(r,t){const n=Lt(r);return n?.type==="emit"?(this.onmessage?.(n.message),Promise.resolve()):n?.type==="suppress"?Promise.resolve():super.send(r,t)}}function Lt(e){const r=e;if(!r||typeof r!="object"||!("method"in r))return null;switch(r.method){case"initialize":{const t=r?.params?.protocolVersion;return t?{type:"emit",message:{result:{protocolVersion:t,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:r.jsonrpc??"2.0",id:r.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class Ut extends Be{constructor(r,t){super(r,t)}async listTools(r,t){return await this.request({method:"tools/list",params:r},Re,t)}}const Rt=async(e,r,t)=>{const n=Wt(e.connection,r,t);if(!n)throw new Error("Unknown MCP connection type");const i=new Ut({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(n),{client:i,callStreamableTool:(o,c,u)=>{if(e.connection.type!=="HTTP")throw new Error("HTTP connection required");const m=new Headers(t);m.has("Authorization")||m.set("Authorization",`Bearer ${e.connection.token}`);for(const[N,D]of Object.entries(e.connection.headers??{}))m.set(N,D);const d=new URL(e.connection.url),O=d.pathname.replace(/\/+$/,"")||"/";return d.pathname=`${O}/call-tool/${encodeURIComponent(o)}`,fetch(d.href,{method:"POST",redirect:"manual",body:JSON.stringify(c),headers:m,signal:u})}}},Wt=(e,r,t)=>{if(e.type==="Websocket")return new Mt(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...t??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const o={requestInit:{headers:i,signal:r}};return e.token&&(o.eventSourceInit={fetch:(c,u)=>fetch(c,{...u,headers:{...i,Accept:"text/event-stream"},signal:r})}),new Pt(new URL(e.url),o)}return new jt(new URL(e.url),{requestInit:{headers:i,signal:r,credentials:"include"}})},xe=e=>{try{return JSON.parse(e)}catch{return e}},X=new Map,Oe=(e,r)=>({...e,id:e.name,inputSchema:e.inputSchema?g(e.inputSchema):void 0,outputSchema:e.outputSchema?g(e.outputSchema):void 0,execute:t=>r(t.context,e.name)});function Ht(e){const r=t=>"connection"in e?Rt({connection:e.connection},void 0,t):e.client;return new Proxy({},{get(t,n){if(n==="toJSON")return null;if(typeof n!="string")throw new Error("Name must be a string");if(n==="listTools")return u;async function i(m,d=n){const O=e?.debugId?.(),N=O?{"x-trace-debug-id":O}:void 0,{client:D,callStreamableTool:J}=await r(N);if(e?.streamable?.[String(d)]){if(!J)throw new Error(`Tool ${String(d)} requires streaming support but client doesn't provide callStreamableTool`);return await J(String(d),m)}const{structuredContent:P,isError:K,content:A}=await D.callTool({name:String(d),arguments:m});if(K){const be=A?.[0]?.text,Z=typeof be=="string"?xe(be):null,ye=Z?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(Z.code,Z.message,Z.traceId):null;throw ye||new Error(`Tool ${String(d)} returned an error: ${JSON.stringify(P??A)}`)}if(P!==void 0)return P;const me=A?.[0]?.text;return typeof me=="string"?xe(me):void 0}async function o(){const{client:m}=await r(),{tools:d}=await m.listTools();return d}async function c(){if(!("connection"in e))return o();const m=e.connection,d=JSON.stringify(m);try{return X.has(d)||X.set(d,o()),await X.get(d)}catch(O){console.error("Failed to list tools",O),X.delete(d);return}}async function u(){return(await c()??[]).map(d=>Oe(d,i))}return i.asTool=async()=>{const d=(await c()??[]).find(O=>O.name===n);if(!d)throw new Error(`Tool ${n} not found`);return Oe(d,i)},i}})}new Proxy({},{get(e,r){return r==="toJSON"?null:r==="forConnection"?t=>Dt({connection:t}):global[r]}});function Dt(e){return Ht(e)}function qt(e){return{isImplementedBy:r=>{for(const t of e){const n=typeof t.name=="string"?new RegExp(`^${t.name}$`):t.name,i=r.find(o=>n.test(o.name));if(!(!i&&t.opt)&&!i)return!1}return!0}}}function Tr(e,r){const t=e.tools;if(!t||t.length===0)return!1;const n=t.map(c=>({name:c.name,inputSchema:c.inputSchema})),i=r.map(c=>({name:c.name,inputSchema:c.inputSchema,opt:c.opt}));return qt(i).isImplementedBy(n)}const $t=a({id:s(),name:s(),description:s().optional(),inputSchema:S(s(),y()),outputSchema:S(s(),y()).optional()}),Bt=te.extend({_meta:a({"io.decocms":a({id:s(),verified:v(),scopeName:s(),appName:s(),friendlyName:s().nullable().optional(),metadata:S(s(),y()).nullable().optional(),publishedAt:s().datetime().optional(),updatedAt:s().datetime().optional(),tools:h($t).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:a({$schema:s().optional(),_meta:S(s(),y()).optional(),name:s().describe("The server name (scope/app)"),title:s().optional().describe("User-friendly title"),description:s().optional().describe("Server description"),icons:h(a({src:s(),mimeType:s().optional(),sizes:h(s()).optional(),theme:W(["light","dark"]).optional()})).optional(),remotes:h(a({type:W(["http","stdio","sse"]),url:s().optional(),headers:h(y()).optional()})).optional(),packages:h(y()).optional(),repository:a({url:s(),source:s().optional(),subfolder:s().optional()}).optional(),version:s().optional(),websiteUrl:s().optional()})});re("registry_app",Bt,{readOnly:!0});const Ft=a({specversion:x("1.0").describe("CloudEvents specification version"),id:s().describe("Unique identifier for this event (UUID recommended)"),source:s().describe("Connection ID of the event publisher"),type:s().describe("Event type (e.g., 'order.created', 'user.signup')"),time:s().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:s().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:s().optional().default("application/json").describe("Content type of the data attribute"),dataschema:s().url().optional().describe("URI to the schema for the data attribute"),data:y().optional().describe("Event payload (any JSON value)")});a({events:h(Ft).min(1).describe("Batch of CloudEvents to process")});const Vt=a({success:v().optional().describe("Whether this event was processed successfully"),error:s().optional().describe("Error message for this event"),retryAfter:p().int().positive().optional().describe("Re-deliver this event after this many ms")});a({success:v().optional().describe("Batch success - applies to events not in results"),error:s().optional().describe("Batch error message - applies to events not in results"),processedCount:p().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:p().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:S(s(),Vt).optional().describe("Per-event results keyed by event ID")});const Gt=a({type:s().min(1).max(255).describe("Event type identifier"),subject:s().max(255).optional().describe("Subject/resource identifier (e.g., order ID)"),data:y().optional().describe("Event payload"),deliverAt:s().datetime().optional().describe("Scheduled delivery time (ISO 8601). Omit for immediate delivery."),cron:s().max(100).optional().describe("Cron expression for recurring delivery. Use EVENT_CANCEL to stop.")}),Jt=a({id:s().describe("Unique event ID"),type:s().describe("Event type"),source:s().describe("Source connection ID"),time:s().describe("Event timestamp")}),Kt=a({eventType:s().min(1).max(255).describe("Event type to subscribe to"),publisher:s().optional().describe("Filter events by publisher connection ID"),filter:s().max(1e3).optional().describe("JSONPath filter expression on event data")}),Zt=a({subscription:a({id:s().describe("Subscription ID"),connectionId:s().describe("Subscriber connection ID"),eventType:s().describe("Event type pattern"),publisher:s().nullable().describe("Publisher connection filter"),filter:s().nullable().describe("JSONPath filter expression"),enabled:v().describe("Whether subscription is enabled"),createdAt:s().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:s().datetime().describe("Updated timestamp (ISO 8601)")})}),Xt=a({eventType:s().min(1).max(255).describe("Event type to subscribe to"),publisher:s().optional().describe("Filter events by publisher connection ID"),filter:s().max(1e3).optional().describe("JSONPath filter expression on event data")}),zt=a({id:s().describe("Subscription ID"),connectionId:s().describe("Subscriber connection ID"),eventType:s().describe("Event type pattern"),publisher:s().nullable().describe("Publisher connection filter"),filter:s().nullable().describe("JSONPath filter expression"),enabled:v().describe("Whether subscription is enabled"),createdAt:s().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:s().datetime().describe("Updated timestamp (ISO 8601)")}),Qt=a({subscriptions:h(Xt).describe("Desired subscriptions - system will create/update/delete to match")}),Yt=a({created:p().int().min(0).describe("Number of subscriptions created"),updated:p().int().min(0).describe("Number of subscriptions with filter updated"),deleted:p().int().min(0).describe("Number of subscriptions removed"),unchanged:p().int().min(0).describe("Number of subscriptions unchanged"),subscriptions:h(zt).describe("Current subscriptions after sync")}),er=a({subscriptionId:s().describe("Subscription ID to remove")}),tr=a({success:v().describe("Whether unsubscribe was successful"),subscriptionId:s().describe("Subscription ID that was removed")}),rr=a({eventId:s().describe("Event ID to cancel")}),nr=a({success:v().describe("Whether cancellation was successful"),eventId:s().describe("Event ID that was cancelled")}),sr=a({eventId:s().describe("Event ID to acknowledge")}),ir=a({success:v().describe("Whether ACK was successful"),eventId:s().describe("Event ID that was acknowledged")}),Cr=[{name:"EVENT_PUBLISH",inputSchema:Gt,outputSchema:Jt},{name:"EVENT_SUBSCRIBE",inputSchema:Kt,outputSchema:Zt},{name:"EVENT_UNSUBSCRIBE",inputSchema:er,outputSchema:tr},{name:"EVENT_CANCEL",inputSchema:rr,outputSchema:nr},{name:"EVENT_ACK",inputSchema:sr,outputSchema:ir},{name:"EVENT_SYNC_SUBSCRIPTIONS",inputSchema:Qt,outputSchema:Yt}],or=a({type:x("string"),enum:h(s()).optional(),description:s().optional()}),ar=a({type:s(),description:s(),paramsSchema:S(s(),or)}),cr=a({}),lr=a({triggers:h(ar)}),ur=a({type:s(),params:S(s(),s()),enabled:v()}),dr=a({success:v()}),kr=[{name:"TRIGGER_LIST",inputSchema:cr,outputSchema:lr},{name:"TRIGGER_CONFIGURE",inputSchema:ur,outputSchema:dr}];a({prefix:s().optional().describe("Filter objects by prefix (e.g., 'folder/' for folder contents)"),maxKeys:p().optional().default(1e3).describe("Maximum number of keys to return (default: 1000)"),continuationToken:s().optional().describe("Token for pagination from previous response"),delimiter:s().optional().describe("Delimiter for grouping keys (typically '/'). When set, commonPrefixes returns folder paths.")});a({objects:h(a({key:s().describe("Object key/path"),size:p().describe("Object size in bytes"),lastModified:s().describe("Last modified timestamp"),etag:s().describe("Entity tag for the object")})),nextContinuationToken:s().optional().describe("Token for fetching next page of results"),isTruncated:v().describe("Whether there are more results available"),commonPrefixes:h(s()).optional().describe("Folder paths when delimiter is used (e.g., ['photos/2024/', 'photos/2025/'])")});a({key:s().describe("Object key/path to get metadata for")});a({contentType:s().optional().describe("MIME type of the object"),contentLength:p().describe("Size of the object in bytes"),lastModified:s().describe("Last modified timestamp"),etag:s().describe("Entity tag for the object"),metadata:S(s(),s()).optional().describe("Custom metadata key-value pairs")});a({key:s().describe("Object key/path to generate URL for"),expiresIn:p().optional().describe("URL expiration time in seconds (default: from state config or 3600)")});a({url:s().describe("Presigned URL for downloading the object"),expiresIn:p().describe("Expiration time in seconds that was used")});a({key:s().describe("Object key/path for the upload"),expiresIn:p().optional().describe("URL expiration time in seconds (default: from state config or 3600)"),contentType:s().optional().describe("MIME type for the object being uploaded")});a({url:s().describe("Presigned URL for uploading the object"),expiresIn:p().describe("Expiration time in seconds that was used")});a({key:s().describe("Object key/path to delete")});a({success:v().describe("Whether the deletion was successful"),key:s().describe("The key that was deleted")});a({keys:h(s()).max(1e3).describe("Array of object keys/paths to delete (max 1000)")});a({deleted:h(s()).describe("Array of successfully deleted keys"),errors:h(a({key:s(),message:s()})).describe("Array of errors for failed deletions")});const pr=a({toolName:s().describe("Name of the tool to invoke on that connection"),transformCode:s().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(input): Output { ... }`\n The input will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output. \n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),hr=a({code:s().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(input): Output { ... }\`
1
+ import{B as te,c as re}from"./collections-pcWRi6G6.js";import{bR as _,c2 as ge,q as s,aK as p,aM as v,bU as pe,aL as h,aP as k,bp as x,aN as W,c3 as H,o as a,c4 as he,c5 as ve,c6 as Ae,b$ as Me,c7 as Te,c8 as je,c9 as Le,ca as Ue,cb as q,cc as ne,cd as we,bM as Ce,ce as Re,aV as S,aQ as y,aO as We}from"./index-B62MiQAu.js";import{h as He,j as De,n as qe,k as $e,C as Be}from"./constants-B7D0VCWO.js";var Fe=class{apply(e,r){if(!r.type)return;const t=Array.isArray(r.type)?r.type:[r.type],n=new Set(t);if(n.has("string")||(e.string=!1),!n.has("number")&&!n.has("integer")&&(e.number=!1),n.has("boolean")||(e.boolean=!1),n.has("null")||(e.null=!1),n.has("array")||(e.array=!1),n.has("object")||(e.object=!1),n.has("integer")&&e.number!==!1){const i=e.number||p();i instanceof H&&(e.number=i.int())}}},Ve=class{apply(e,r){if(r.const===void 0)return;const t=r.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof t=="string"?e.string=x(t):typeof t=="number"?e.number=x(t):typeof t=="boolean"?e.boolean=x(t):t===null?e.null=pe():Array.isArray(t)?e.array=void 0:typeof t=="object"&&(e.object=void 0)}},Ge=class{apply(e,r){if(!r.enum)return;if(r.enum.length===0){r.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const t={string:r.enum.filter(n=>typeof n=="string"),number:r.enum.filter(n=>typeof n=="number"),boolean:r.enum.filter(n=>typeof n=="boolean"),null:r.enum.filter(n=>n===null),array:r.enum.filter(n=>Array.isArray(n)),object:r.enum.filter(n=>typeof n=="object"&&n!==null&&!Array.isArray(n))};e.string=this.createTypeSchema(t.string,"string"),e.number=this.createTypeSchema(t.number,"number"),e.boolean=this.createTypeSchema(t.boolean,"boolean"),e.null=t.null.length>0?pe():!1,e.array=t.array.length>0?void 0:!1,e.object=t.object.length>0?void 0:!1}createTypeSchema(e,r){if(e.length===0)return!1;if(e.length===1)return x(e[0]);if(r==="string")return W(e);if(r==="number"){const[t,n,...i]=e;return k([x(t),x(n),...i.map(o=>x(o))])}return r==="boolean"?k([x(!0),x(!1)]):!1}},Je=class{apply(e,r){const t=r;if(t.type==="string"&&t.format==="binary"&&t.contentEncoding==="binary"){let n=Ue();t.minLength!==void 0&&(n=n.min(t.minLength)),t.maxLength!==void 0&&(n=n.max(t.maxLength)),t.contentMediaType!==void 0&&(n=n.mime(t.contentMediaType)),e.file=n,e.string=!1}}},Ke=class{apply(e,r){const t=r;r.type===void 0&&(t.minLength!==void 0||t.maxLength!==void 0||t.pattern!==void 0)&&e.string===void 0&&(e.string=s())}},Ze=class{apply(e,r){const t=r;if(t.minLength!==void 0&&e.string!==!1){const n=e.string||s();n instanceof he&&(e.string=n.refine(i=>Array.from(i).length>=t.minLength,{message:`String must be at least ${t.minLength} characters long`}))}}},Xe=class{apply(e,r){const t=r;if(t.maxLength!==void 0&&e.string!==!1){const n=e.string||s();n instanceof he&&(e.string=n.refine(i=>Array.from(i).length<=t.maxLength,{message:`String must be at most ${t.maxLength} characters long`}))}}},ze=class{apply(e,r){const t=r;if(t.pattern&&e.string!==!1){const n=e.string||s();if(n instanceof he){const i=new RegExp(t.pattern);e.string=n.regex(i)}}}},Qe=class{apply(e,r){const t=r;if(t.minimum!==void 0&&e.number!==!1){const n=e.number||p();n instanceof H&&(e.number=n.min(t.minimum))}}},Ye=class{apply(e,r){const t=r;if(t.maximum!==void 0&&e.number!==!1){const n=e.number||p();n instanceof H&&(e.number=n.max(t.maximum))}}},et=class{apply(e,r){const t=r;if(t.exclusiveMinimum!==void 0&&e.number!==!1){const n=e.number||p();n instanceof H&&(typeof t.exclusiveMinimum=="number"?e.number=n.gt(t.exclusiveMinimum):e.number=!1)}}},tt=class{apply(e,r){const t=r;if(t.exclusiveMaximum!==void 0&&e.number!==!1){const n=e.number||p();n instanceof H&&(typeof t.exclusiveMaximum=="number"?e.number=n.lt(t.exclusiveMaximum):e.number=!1)}}},rt=class{apply(e,r){const t=r;if(t.multipleOf!==void 0&&e.number!==!1){const n=e.number||p();n instanceof H&&(e.number=n.refine(i=>{if(t.multipleOf===0)return!1;const o=i/t.multipleOf,c=Math.round(o),u=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(t.multipleOf)*Number.EPSILON*10);return Math.abs(o-c)<=u/Math.abs(t.multipleOf)},{message:`Must be a multiple of ${t.multipleOf}`}))}}},nt=class{apply(e,r){const t=r;r.type===void 0&&(t.minItems!==void 0||t.maxItems!==void 0||t.items!==void 0||t.prefixItems!==void 0)&&e.array===void 0&&(e.array=h(_()))}},st=class{apply(e,r){const t=r;t.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||h(_())).min(t.minItems))}},it=class{apply(e,r){const t=r;t.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||h(_())).max(t.maxItems))}},ot=class{apply(e,r){const t=r;if(e.array!==!1)if(Array.isArray(t.items))e.array=e.array||h(_());else if(t.items&&typeof t.items!="boolean"&&!t.prefixItems){const n=g(t.items);let i=h(n);if(e.array&&e.array instanceof Ae){const o=e.array._def;o.checks&&o.checks.forEach(c=>{if(c._zod&&c._zod.def){const u=c._zod.def;u.check==="min_length"&&u.minimum!==void 0?i=i.min(u.minimum):u.check==="max_length"&&u.maximum!==void 0&&(i=i.max(u.maximum))}})}e.array=i}else typeof t.items=="boolean"&&t.items===!1?t.prefixItems?e.array=e.array||h(_()):e.array=h(_()).max(0):typeof t.items=="boolean"&&t.items===!0?e.array=e.array||h(_()):t.prefixItems&&(e.array=e.array||h(_()))}},at=class{apply(e,r){if(r.type!=="array")return;const t=r;if(!Array.isArray(t.items)||e.array===!1)return;const n=t.items.map(o=>g(o));let i;n.length===0?i=ve([]):i=ve(n),t.minItems!==void 0&&t.minItems>n.length&&(i=!1),t.maxItems!==void 0&&t.maxItems<n.length&&(i=!1),e.tuple=i,e.array=!1}},ct=class{apply(e,r){const t=r;e.object!==!1&&(t.properties||t.required||t.additionalProperties!==void 0)&&(e.object=e.object||a({}).passthrough())}},lt=class{apply(e,r){const t=r;r.type===void 0&&(t.maxProperties!==void 0||t.minProperties!==void 0)&&e.object===void 0&&(e.object=a({}).passthrough())}},ut=class{apply(e,r){const t=r;if(t.maxProperties!==void 0&&e.object!==!1){const n=e.object||a({}).passthrough();e.object=n.refine(i=>Object.keys(i).length<=t.maxProperties,{message:`Object must have at most ${t.maxProperties} properties`})}}},dt=class{apply(e,r){const t=r;if(t.minProperties!==void 0&&e.object!==!1){const n=e.object||a({}).passthrough();e.object=n.refine(i=>Object.keys(i).length>=t.minProperties,{message:`Object must have at least ${t.minProperties} properties`})}}};function G(e,r){if(e===r)return!0;if(e==null||r==null)return e===r;if(typeof e!=typeof r)return!1;if(Array.isArray(e)&&Array.isArray(r))return e.length!==r.length?!1:e.every((t,n)=>G(t,r[n]));if(typeof e=="object"&&typeof r=="object"){const t=Object.keys(e),n=Object.keys(r);return t.length!==n.length?!1:t.every(i=>n.includes(i)&&G(e[i],r[i]))}return!1}function pt(){return e=>{if(!Array.isArray(e))return!0;const r=[];return e.every(t=>r.some(i=>G(t,i))?!1:(r.push(t),!0))}}function Y(e,r){return e.safeParse(r).success}var ht=class{apply(e,r){if(!r.not)return e;const t=g(r.not);return e.refine(n=>!Y(t,n),{message:"Value must not match the 'not' schema"})}},ft=class{apply(e,r){return r.uniqueItems!==!0?e:e.refine(pt(),{message:"Array items must be unique"})}},mt=class{apply(e,r){return!r.allOf||r.allOf.length===0?e:r.allOf.map(n=>g(n)).reduce((n,i)=>Te(n,i),e)}},bt=class{apply(e,r){if(!r.anyOf||r.anyOf.length===0)return e;const t=r.anyOf.length===1?g(r.anyOf[0]):k([g(r.anyOf[0]),g(r.anyOf[1]),...r.anyOf.slice(2).map(n=>g(n))]);return Te(e,t)}},yt=class{apply(e,r){if(!r.oneOf||r.oneOf.length===0)return e;const t=r.oneOf.map(n=>g(n));return e.refine(n=>{let i=0;for(const o of t)if(o.safeParse(n).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},gt=class{apply(e,r){const t=r;if(t.prefixItems&&Array.isArray(t.prefixItems)){const i=t.prefixItems.map(o=>g(o));return e.refine(o=>{if(!Array.isArray(o))return!0;for(let c=0;c<Math.min(o.length,i.length);c++)if(!Y(i[c],o[c]))return!1;if(o.length>i.length){if(typeof t.items=="boolean"&&t.items===!1)return!1;if(t.items&&typeof t.items=="object"&&!Array.isArray(t.items)){const c=g(t.items);for(let u=i.length;u<o.length;u++)if(!Y(c,o[u]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},vt=class{apply(e,r){const t=r;if(!t.properties&&!t.required&&t.additionalProperties!==!1)return e;if(e instanceof je||e instanceof Le){const n={};if(t.properties)for(const[i,o]of Object.entries(t.properties))o!==void 0&&(n[i]=g(o));if(t.required&&Array.isArray(t.required)){const i=new Set(t.required);for(const o of Object.keys(n))i.has(o)||(n[o]=n[o].optional())}else for(const i of Object.keys(n))n[i]=n[i].optional();return t.additionalProperties===!1?a(n):a(n).passthrough()}return e.refine(n=>{if(typeof n!="object"||n===null||Array.isArray(n))return!0;if(t.properties){for(const[i,o]of Object.entries(t.properties))if(o!==void 0&&Object.getOwnPropertyDescriptor(n,i)!==void 0&&!g(o).safeParse(n[i]).success)return!1}if(t.required&&Array.isArray(t.required)){for(const i of t.required)if(!(Object.getOwnPropertyDescriptor(n,i)!==void 0))return!1}if(t.additionalProperties===!1&&t.properties){const i=new Set(Object.keys(t.properties));for(const o in n)if(!i.has(o))return!1}return!0},{message:"Object constraints validation failed"})}},wt=class{apply(e,r){if(!r.enum||r.enum.length===0)return e;const t=r.enum.filter(n=>Array.isArray(n)||typeof n=="object"&&n!==null);return t.length===0?e:e.refine(n=>typeof n!="object"||n===null?!0:t.some(i=>G(n,i)),{message:"Value must match one of the enum values"})}},St=class{apply(e,r){if(r.const===void 0)return e;const t=r.const;return typeof t!="object"||t===null?e:e.refine(n=>G(n,t),{message:"Value must equal the const value"})}},_t=class{apply(e,r){return r.description&&(e=e.describe(r.description)),e}},Et=class{apply(e,r){var t;const n=r;return!((t=n.required)!=null&&t.includes("__proto__"))||r.type!==void 0?e:_().refine(i=>this.validateRequired(i,n.required),{message:"Missing required properties"})}validateRequired(e,r){return typeof e!="object"||e===null||Array.isArray(e)?!0:r.every(t=>Object.prototype.hasOwnProperty.call(e,t))}},xt=class{apply(e,r){var t;const n=r;if(n.contains===void 0)return e;const i=g(n.contains),o=(t=n.minContains)!=null?t:1,c=n.maxContains;return e.refine(u=>{if(!Array.isArray(u))return!0;let m=0;for(const d of u)Y(i,d)&&m++;return!(m<o||c!==void 0&&m>c)},{message:"Array must contain required items matching the schema"})}},Ot=class{apply(e,r){const{default:t}=r;return t===void 0||!e.safeParse(t).success?e:e.default(t)}},It=[new Ve,new Ge,new Fe,new Je,new Ke,new nt,new lt,new Ze,new Xe,new ze,new Qe,new Ye,new et,new tt,new rt,new at,new st,new it,new ot,new ut,new dt,new ct],Tt=[new Et,new wt,new St,new mt,new bt,new yt,new gt,new vt,new xt,new ht,new ft,new Ot,new _t];function g(e){if(typeof e=="boolean")return e?_():ge();const r={};for(const i of It)i.apply(r,e);const t=[];if(r.string!==!1&&t.push(r.string||s()),r.number!==!1&&t.push(r.number||p()),r.boolean!==!1&&t.push(r.boolean||v()),r.null!==!1&&t.push(r.null||pe()),r.array!==!1&&t.push(r.array||h(_())),r.tuple!==!1&&r.tuple!==void 0&&t.push(r.tuple),r.object!==!1)if(r.object)t.push(r.object);else{const i=Me(o=>typeof o=="object"&&o!==null&&!Array.isArray(o),"Must be an object, not an array");t.push(i)}r.file!==!1&&r.file!==void 0&&t.push(r.file);let n;t.length===0?n=ge():t.length===1?n=t[0]:Object.keys(e).some(o=>o!=="$schema"&&o!=="title"&&o!=="description")?n=k(t):n=_();for(const i of Tt)n=i.apply(n,e);return n}class Se extends Event{constructor(r,t){var n,i;super(r),this.code=(n=t?.code)!=null?n:void 0,this.message=(i=t?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](r,t,n){return n(_e(this),t)}[Symbol.for("Deno.customInspect")](r,t){return r(_e(this),t)}}function Ct(e){const r=globalThis.DOMException;return typeof r=="function"?new r(e,"SyntaxError"):new SyntaxError(e)}function se(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(se).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${se(e.cause)}`:e.message:`${e}`}function _e(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var ke=e=>{throw TypeError(e)},fe=(e,r,t)=>r.has(e)||ke("Cannot "+t),l=(e,r,t)=>(fe(e,r,"read from private field"),t?t.call(e):r.get(e)),b=(e,r,t)=>r.has(e)?ke("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,t),f=(e,r,t,n)=>(fe(e,r,"write to private field"),r.set(e,t),t),I=(e,r,t)=>(fe(e,r,"access private method"),t),w,C,M,z,ee,F,U,V,T,j,R,L,$,E,ie,oe,ae,Ee,ce,le,B,ue,de;class Q extends EventTarget{constructor(r,t){var n,i;super(),b(this,E),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,b(this,w),b(this,C),b(this,M),b(this,z),b(this,ee),b(this,F),b(this,U),b(this,V,null),b(this,T),b(this,j),b(this,R,null),b(this,L,null),b(this,$,null),b(this,oe,async o=>{var c;l(this,j).reset();const{body:u,redirected:m,status:d,headers:O}=o;if(d===204){I(this,E,B).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(m?f(this,M,new URL(o.url)):f(this,M,void 0),d!==200){I(this,E,B).call(this,`Non-200 status code (${d})`,d);return}if(!(O.get("content-type")||"").startsWith("text/event-stream")){I(this,E,B).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(l(this,w)===this.CLOSED)return;f(this,w,this.OPEN);const N=new Event("open");if((c=l(this,$))==null||c.call(this,N),this.dispatchEvent(N),typeof u!="object"||!u||!("getReader"in u)){I(this,E,B).call(this,"Invalid response body, expected a web ReadableStream",d),this.close();return}const D=new TextDecoder,J=u.getReader();let P=!0;do{const{done:K,value:A}=await J.read();A&&l(this,j).feed(D.decode(A,{stream:!K})),K&&(P=!1,l(this,j).reset(),I(this,E,ue).call(this))}while(P)}),b(this,ae,o=>{f(this,T,void 0),!(o.name==="AbortError"||o.type==="aborted")&&I(this,E,ue).call(this,se(o))}),b(this,ce,o=>{typeof o.id=="string"&&f(this,V,o.id);const c=new MessageEvent(o.event||"message",{data:o.data,origin:l(this,M)?l(this,M).origin:l(this,C).origin,lastEventId:o.id||""});l(this,L)&&(!o.event||o.event==="message")&&l(this,L).call(this,c),this.dispatchEvent(c)}),b(this,le,o=>{f(this,F,o)}),b(this,de,()=>{f(this,U,void 0),l(this,w)===this.CONNECTING&&I(this,E,ie).call(this)});try{if(r instanceof URL)f(this,C,r);else if(typeof r=="string")f(this,C,new URL(r,kt()));else throw new Error("Invalid URL")}catch{throw Ct("An invalid or illegal string was specified")}f(this,j,He({onEvent:l(this,ce),onRetry:l(this,le)})),f(this,w,this.CONNECTING),f(this,F,3e3),f(this,ee,(n=t?.fetch)!=null?n:globalThis.fetch),f(this,z,(i=t?.withCredentials)!=null?i:!1),I(this,E,ie).call(this)}get readyState(){return l(this,w)}get url(){return l(this,C).href}get withCredentials(){return l(this,z)}get onerror(){return l(this,R)}set onerror(r){f(this,R,r)}get onmessage(){return l(this,L)}set onmessage(r){f(this,L,r)}get onopen(){return l(this,$)}set onopen(r){f(this,$,r)}addEventListener(r,t,n){const i=t;super.addEventListener(r,i,n)}removeEventListener(r,t,n){const i=t;super.removeEventListener(r,i,n)}close(){l(this,U)&&clearTimeout(l(this,U)),l(this,w)!==this.CLOSED&&(l(this,T)&&l(this,T).abort(),f(this,w,this.CLOSED),f(this,T,void 0))}}w=new WeakMap,C=new WeakMap,M=new WeakMap,z=new WeakMap,ee=new WeakMap,F=new WeakMap,U=new WeakMap,V=new WeakMap,T=new WeakMap,j=new WeakMap,R=new WeakMap,L=new WeakMap,$=new WeakMap,E=new WeakSet,ie=function(){f(this,w,this.CONNECTING),f(this,T,new AbortController),l(this,ee)(l(this,C),I(this,E,Ee).call(this)).then(l(this,oe)).catch(l(this,ae))},oe=new WeakMap,ae=new WeakMap,Ee=function(){var e;const r={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...l(this,V)?{"Last-Event-ID":l(this,V)}:void 0},cache:"no-store",signal:(e=l(this,T))==null?void 0:e.signal};return"window"in globalThis&&(r.credentials=this.withCredentials?"include":"same-origin"),r},ce=new WeakMap,le=new WeakMap,B=function(e,r){var t;l(this,w)!==this.CLOSED&&f(this,w,this.CLOSED);const n=new Se("error",{code:r,message:e});(t=l(this,R))==null||t.call(this,n),this.dispatchEvent(n)},ue=function(e,r){var t;if(l(this,w)===this.CLOSED)return;f(this,w,this.CONNECTING);const n=new Se("error",{code:r,message:e});(t=l(this,R))==null||t.call(this,n),this.dispatchEvent(n),f(this,U,setTimeout(l(this,de),l(this,F)))},de=new WeakMap,Q.CONNECTING=0,Q.OPEN=1,Q.CLOSED=2;function kt(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class Nt extends Error{constructor(r,t,n){super(`SSE error: ${t}`),this.code=r,this.event=n}}class Pt{constructor(r,t){this._url=r,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=t?.eventSourceInit,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=De(t?.fetch,t?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new q("No auth provider");let r;try{r=await ne(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(t){throw this.onerror?.(t),t}if(r!=="AUTHORIZED")throw new q;return await this._startOrAuth()}async _commonHeaders(){const r={};if(this._authProvider){const n=await this._authProvider.tokens();n&&(r.Authorization=`Bearer ${n.access_token}`)}this._protocolVersion&&(r["mcp-protocol-version"]=this._protocolVersion);const t=qe(this._requestInit?.headers);return new Headers({...r,...t})}_startOrAuth(){const r=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((t,n)=>{this._eventSource=new Q(this._url.href,{...this._eventSourceInit,fetch:async(i,o)=>{const c=await this._commonHeaders();c.set("Accept","text/event-stream");const u=await r(i,{...o,headers:c});if(u.status===401&&u.headers.has("www-authenticate")){const{resourceMetadataUrl:m,scope:d}=we(u);this._resourceMetadataUrl=m,this._scope=d}return u}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(t,n);return}const o=new Nt(i.code,i.message,i);n(o),this.onerror?.(o)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const o=i;try{if(this._endpoint=new URL(o.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(c){n(c),this.onerror?.(c),this.close();return}t()}),this._eventSource.onmessage=i=>{const o=i;let c;try{c=Ce.parse(JSON.parse(o.data))}catch(u){this.onerror?.(u);return}this.onmessage?.(c)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(r){if(!this._authProvider)throw new q("No auth provider");if(await ne(this._authProvider,{serverUrl:this._url,authorizationCode:r,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new q("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(r){if(!this._endpoint)throw new Error("Not connected");try{const t=await this._commonHeaders();t.set("content-type","application/json");const n={...this._requestInit,method:"POST",headers:t,body:JSON.stringify(r),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,n);if(!i.ok){const o=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:c,scope:u}=we(i);if(this._resourceMetadataUrl=c,this._scope=u,await ne(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new q;return this.send(r)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${o}`)}await i.body?.cancel()}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(r){this._protocolVersion=r}}const At="mcp";class Mt{constructor(r){this._url=r}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((r,t)=>{this._socket=new WebSocket(this._url,At),this._socket.onerror=n=>{const i="error"in n?n.error:new Error(`WebSocket error: ${JSON.stringify(n)}`);t(i),this.onerror?.(i)},this._socket.onopen=()=>{r()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=n=>{let i;try{i=Ce.parse(JSON.parse(n.data))}catch(o){this.onerror?.(o);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(r){return new Promise((t,n)=>{if(!this._socket){n(new Error("Not connected"));return}this._socket?.send(JSON.stringify(r)),t()})}}class jt extends $e{constructor(r,t){super(r,t)}send(r,t){const n=Lt(r);return n?.type==="emit"?(this.onmessage?.(n.message),Promise.resolve()):n?.type==="suppress"?Promise.resolve():super.send(r,t)}}function Lt(e){const r=e;if(!r||typeof r!="object"||!("method"in r))return null;switch(r.method){case"initialize":{const t=r?.params?.protocolVersion;return t?{type:"emit",message:{result:{protocolVersion:t,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:r.jsonrpc??"2.0",id:r.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class Ut extends Be{constructor(r,t){super(r,t)}async listTools(r,t){return await this.request({method:"tools/list",params:r},Re,t)}}const Rt=async(e,r,t)=>{const n=Wt(e.connection,r,t);if(!n)throw new Error("Unknown MCP connection type");const i=new Ut({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(n),{client:i,callStreamableTool:(o,c,u)=>{if(e.connection.type!=="HTTP")throw new Error("HTTP connection required");const m=new Headers(t);m.has("Authorization")||m.set("Authorization",`Bearer ${e.connection.token}`);for(const[N,D]of Object.entries(e.connection.headers??{}))m.set(N,D);const d=new URL(e.connection.url),O=d.pathname.replace(/\/+$/,"")||"/";return d.pathname=`${O}/call-tool/${encodeURIComponent(o)}`,fetch(d.href,{method:"POST",redirect:"manual",body:JSON.stringify(c),headers:m,signal:u})}}},Wt=(e,r,t)=>{if(e.type==="Websocket")return new Mt(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...t??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const o={requestInit:{headers:i,signal:r}};return e.token&&(o.eventSourceInit={fetch:(c,u)=>fetch(c,{...u,headers:{...i,Accept:"text/event-stream"},signal:r})}),new Pt(new URL(e.url),o)}return new jt(new URL(e.url),{requestInit:{headers:i,signal:r,credentials:"include"}})},xe=e=>{try{return JSON.parse(e)}catch{return e}},X=new Map,Oe=(e,r)=>({...e,id:e.name,inputSchema:e.inputSchema?g(e.inputSchema):void 0,outputSchema:e.outputSchema?g(e.outputSchema):void 0,execute:t=>r(t.context,e.name)});function Ht(e){const r=t=>"connection"in e?Rt({connection:e.connection},void 0,t):e.client;return new Proxy({},{get(t,n){if(n==="toJSON")return null;if(typeof n!="string")throw new Error("Name must be a string");if(n==="listTools")return u;async function i(m,d=n){const O=e?.debugId?.(),N=O?{"x-trace-debug-id":O}:void 0,{client:D,callStreamableTool:J}=await r(N);if(e?.streamable?.[String(d)]){if(!J)throw new Error(`Tool ${String(d)} requires streaming support but client doesn't provide callStreamableTool`);return await J(String(d),m)}const{structuredContent:P,isError:K,content:A}=await D.callTool({name:String(d),arguments:m});if(K){const be=A?.[0]?.text,Z=typeof be=="string"?xe(be):null,ye=Z?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(Z.code,Z.message,Z.traceId):null;throw ye||new Error(`Tool ${String(d)} returned an error: ${JSON.stringify(P??A)}`)}if(P!==void 0)return P;const me=A?.[0]?.text;return typeof me=="string"?xe(me):void 0}async function o(){const{client:m}=await r(),{tools:d}=await m.listTools();return d}async function c(){if(!("connection"in e))return o();const m=e.connection,d=JSON.stringify(m);try{return X.has(d)||X.set(d,o()),await X.get(d)}catch(O){console.error("Failed to list tools",O),X.delete(d);return}}async function u(){return(await c()??[]).map(d=>Oe(d,i))}return i.asTool=async()=>{const d=(await c()??[]).find(O=>O.name===n);if(!d)throw new Error(`Tool ${n} not found`);return Oe(d,i)},i}})}new Proxy({},{get(e,r){return r==="toJSON"?null:r==="forConnection"?t=>Dt({connection:t}):global[r]}});function Dt(e){return Ht(e)}function qt(e){return{isImplementedBy:r=>{for(const t of e){const n=typeof t.name=="string"?new RegExp(`^${t.name}$`):t.name,i=r.find(o=>n.test(o.name));if(!(!i&&t.opt)&&!i)return!1}return!0}}}function Tr(e,r){const t=e.tools;if(!t||t.length===0)return!1;const n=t.map(c=>({name:c.name,inputSchema:c.inputSchema})),i=r.map(c=>({name:c.name,inputSchema:c.inputSchema,opt:c.opt}));return qt(i).isImplementedBy(n)}const $t=a({id:s(),name:s(),description:s().optional(),inputSchema:S(s(),y()),outputSchema:S(s(),y()).optional()}),Bt=te.extend({_meta:a({"io.decocms":a({id:s(),verified:v(),scopeName:s(),appName:s(),friendlyName:s().nullable().optional(),metadata:S(s(),y()).nullable().optional(),publishedAt:s().datetime().optional(),updatedAt:s().datetime().optional(),tools:h($t).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:a({$schema:s().optional(),_meta:S(s(),y()).optional(),name:s().describe("The server name (scope/app)"),title:s().optional().describe("User-friendly title"),description:s().optional().describe("Server description"),icons:h(a({src:s(),mimeType:s().optional(),sizes:h(s()).optional(),theme:W(["light","dark"]).optional()})).optional(),remotes:h(a({type:W(["http","stdio","sse"]),url:s().optional(),headers:h(y()).optional()})).optional(),packages:h(y()).optional(),repository:a({url:s(),source:s().optional(),subfolder:s().optional()}).optional(),version:s().optional(),websiteUrl:s().optional()})});re("registry_app",Bt,{readOnly:!0});const Ft=a({specversion:x("1.0").describe("CloudEvents specification version"),id:s().describe("Unique identifier for this event (UUID recommended)"),source:s().describe("Connection ID of the event publisher"),type:s().describe("Event type (e.g., 'order.created', 'user.signup')"),time:s().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:s().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:s().optional().default("application/json").describe("Content type of the data attribute"),dataschema:s().url().optional().describe("URI to the schema for the data attribute"),data:y().optional().describe("Event payload (any JSON value)")});a({events:h(Ft).min(1).describe("Batch of CloudEvents to process")});const Vt=a({success:v().optional().describe("Whether this event was processed successfully"),error:s().optional().describe("Error message for this event"),retryAfter:p().int().positive().optional().describe("Re-deliver this event after this many ms")});a({success:v().optional().describe("Batch success - applies to events not in results"),error:s().optional().describe("Batch error message - applies to events not in results"),processedCount:p().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:p().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:S(s(),Vt).optional().describe("Per-event results keyed by event ID")});const Gt=a({type:s().min(1).max(255).describe("Event type identifier"),subject:s().max(255).optional().describe("Subject/resource identifier (e.g., order ID)"),data:y().optional().describe("Event payload"),deliverAt:s().datetime().optional().describe("Scheduled delivery time (ISO 8601). Omit for immediate delivery."),cron:s().max(100).optional().describe("Cron expression for recurring delivery. Use EVENT_CANCEL to stop.")}),Jt=a({id:s().describe("Unique event ID"),type:s().describe("Event type"),source:s().describe("Source connection ID"),time:s().describe("Event timestamp")}),Kt=a({eventType:s().min(1).max(255).describe("Event type to subscribe to"),publisher:s().optional().describe("Filter events by publisher connection ID"),filter:s().max(1e3).optional().describe("JSONPath filter expression on event data")}),Zt=a({subscription:a({id:s().describe("Subscription ID"),connectionId:s().describe("Subscriber connection ID"),eventType:s().describe("Event type pattern"),publisher:s().nullable().describe("Publisher connection filter"),filter:s().nullable().describe("JSONPath filter expression"),enabled:v().describe("Whether subscription is enabled"),createdAt:s().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:s().datetime().describe("Updated timestamp (ISO 8601)")})}),Xt=a({eventType:s().min(1).max(255).describe("Event type to subscribe to"),publisher:s().optional().describe("Filter events by publisher connection ID"),filter:s().max(1e3).optional().describe("JSONPath filter expression on event data")}),zt=a({id:s().describe("Subscription ID"),connectionId:s().describe("Subscriber connection ID"),eventType:s().describe("Event type pattern"),publisher:s().nullable().describe("Publisher connection filter"),filter:s().nullable().describe("JSONPath filter expression"),enabled:v().describe("Whether subscription is enabled"),createdAt:s().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:s().datetime().describe("Updated timestamp (ISO 8601)")}),Qt=a({subscriptions:h(Xt).describe("Desired subscriptions - system will create/update/delete to match")}),Yt=a({created:p().int().min(0).describe("Number of subscriptions created"),updated:p().int().min(0).describe("Number of subscriptions with filter updated"),deleted:p().int().min(0).describe("Number of subscriptions removed"),unchanged:p().int().min(0).describe("Number of subscriptions unchanged"),subscriptions:h(zt).describe("Current subscriptions after sync")}),er=a({subscriptionId:s().describe("Subscription ID to remove")}),tr=a({success:v().describe("Whether unsubscribe was successful"),subscriptionId:s().describe("Subscription ID that was removed")}),rr=a({eventId:s().describe("Event ID to cancel")}),nr=a({success:v().describe("Whether cancellation was successful"),eventId:s().describe("Event ID that was cancelled")}),sr=a({eventId:s().describe("Event ID to acknowledge")}),ir=a({success:v().describe("Whether ACK was successful"),eventId:s().describe("Event ID that was acknowledged")}),Cr=[{name:"EVENT_PUBLISH",inputSchema:Gt,outputSchema:Jt},{name:"EVENT_SUBSCRIBE",inputSchema:Kt,outputSchema:Zt},{name:"EVENT_UNSUBSCRIBE",inputSchema:er,outputSchema:tr},{name:"EVENT_CANCEL",inputSchema:rr,outputSchema:nr},{name:"EVENT_ACK",inputSchema:sr,outputSchema:ir},{name:"EVENT_SYNC_SUBSCRIPTIONS",inputSchema:Qt,outputSchema:Yt}],or=a({type:x("string"),enum:h(s()).optional(),description:s().optional()}),ar=a({type:s(),description:s(),paramsSchema:S(s(),or)}),cr=a({}),lr=a({triggers:h(ar)}),ur=a({type:s(),params:S(s(),s()),enabled:v()}),dr=a({success:v()}),kr=[{name:"TRIGGER_LIST",inputSchema:cr,outputSchema:lr},{name:"TRIGGER_CONFIGURE",inputSchema:ur,outputSchema:dr}];a({prefix:s().optional().describe("Filter objects by prefix (e.g., 'folder/' for folder contents)"),maxKeys:p().optional().default(1e3).describe("Maximum number of keys to return (default: 1000)"),continuationToken:s().optional().describe("Token for pagination from previous response"),delimiter:s().optional().describe("Delimiter for grouping keys (typically '/'). When set, commonPrefixes returns folder paths.")});a({objects:h(a({key:s().describe("Object key/path"),size:p().describe("Object size in bytes"),lastModified:s().describe("Last modified timestamp"),etag:s().describe("Entity tag for the object")})),nextContinuationToken:s().optional().describe("Token for fetching next page of results"),isTruncated:v().describe("Whether there are more results available"),commonPrefixes:h(s()).optional().describe("Folder paths when delimiter is used (e.g., ['photos/2024/', 'photos/2025/'])")});a({key:s().describe("Object key/path to get metadata for")});a({contentType:s().optional().describe("MIME type of the object"),contentLength:p().describe("Size of the object in bytes"),lastModified:s().describe("Last modified timestamp"),etag:s().describe("Entity tag for the object"),metadata:S(s(),s()).optional().describe("Custom metadata key-value pairs")});a({key:s().describe("Object key/path to generate URL for"),expiresIn:p().optional().describe("URL expiration time in seconds (default: from state config or 3600)")});a({url:s().describe("Presigned URL for downloading the object"),expiresIn:p().describe("Expiration time in seconds that was used")});a({key:s().describe("Object key/path for the upload"),expiresIn:p().optional().describe("URL expiration time in seconds (default: from state config or 3600)"),contentType:s().optional().describe("MIME type for the object being uploaded")});a({url:s().describe("Presigned URL for uploading the object"),expiresIn:p().describe("Expiration time in seconds that was used")});a({key:s().describe("Object key/path to delete")});a({success:v().describe("Whether the deletion was successful"),key:s().describe("The key that was deleted")});a({keys:h(s()).max(1e3).describe("Array of object keys/paths to delete (max 1000)")});a({deleted:h(s()).describe("Array of successfully deleted keys"),errors:h(a({key:s(),message:s()})).describe("Array of errors for failed deletions")});const pr=a({toolName:s().describe("Name of the tool to invoke on that connection"),transformCode:s().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(input): Output { ... }`\n The input will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output. \n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),hr=a({code:s().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(input): Output { ... }\`
2
2
  The input is the resolved value of the references in the input field. Example:
3
3
  {
4
4
  "input": {
@@ -13,7 +13,7 @@
13
13
  <meta name="twitter:description" content="Hire specialized agents, give them access to your tools, and let them deliver real projects — with planning, verification, and observability built in." />
14
14
  <meta name="twitter:image" content="/og-image.png" />
15
15
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
16
- <script type="module" crossorigin src="/assets/index-DIir8pgm.js"></script>
16
+ <script type="module" crossorigin src="/assets/index-B62MiQAu.js"></script>
17
17
  <link rel="stylesheet" crossorigin href="/assets/index-DXoW3R1_.css">
18
18
  </head>
19
19
  <body>