decocms 3.11.0 → 3.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/dist/client/assets/{AlertCircle-Ctbek2zl.js → AlertCircle-Ct5JClmX.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-CGlPrRsR.js → ArrowUpRight-DFys0RTG.js} +1 -1
  3. package/dist/client/assets/{Check-D-2DMeXR.js → Check-CX_4ezXT.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-CPLY3iX-.js → CheckCircle-F3yb9n72.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-DUb-OAcF.js → ChevronDown-DLHvMc9a.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-IUSMXc7n.js → ChevronLeft-Bu7-Ah4d.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-C6_Bb1P7.js → ChevronRight-DvTu3N_v.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-mT0kmu5O.js → ChevronUp-BkOw3Oht.js} +1 -1
  9. package/dist/client/assets/{Container-V3OuMECL.js → Container-kpsLNlK5.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CYMPhMIv.js → DotsVertical-Brl_zZG8.js} +1 -1
  11. package/dist/client/assets/{Eye-DLKlw-42.js → Eye-C2kOuaUL.js} +1 -1
  12. package/dist/client/assets/{FilterLines-B2lLGnWS.js → FilterLines-DJxFTY4_.js} +1 -1
  13. package/dist/client/assets/{Globe01-BSqLqa8H.js → Globe01-CHJlbTRh.js} +1 -1
  14. package/dist/client/assets/{HardDrive-BFG0b6vP.js → HardDrive-MqOe6DAm.js} +1 -1
  15. package/dist/client/assets/{Key01-DeIJhm73.js → Key01-9GKtDEns.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-CAachN7j.js → LayoutLeft-B-iDHOLW.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-C7Ulot5I.js → LinkExternal01-DJ-jwwAo.js} +1 -1
  18. package/dist/client/assets/{Monitor01-RdLthi4L.js → Monitor01-y_N4ZVFQ.js} +1 -1
  19. package/dist/client/assets/{Palette-D1rjO3C7.js → Palette-CFuStOcC.js} +1 -1
  20. package/dist/client/assets/{Play-CL1Mgiwf.js → Play-CJxIvoNh.js} +1 -1
  21. package/dist/client/assets/{Plus-DINfOuqC.js → Plus-8PM23xDH.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-DSZXx3HQ.js → RefreshCcw01-D_JjhMUH.js} +1 -1
  23. package/dist/client/assets/{SearchMd-Dt4Aj6N4.js → SearchMd-BWGEjDry.js} +1 -1
  24. package/dist/client/assets/{Settings02-COHAF-aj.js → Settings02-CiHXAKFw.js} +1 -1
  25. package/dist/client/assets/{Shield01-Ef5O0H91.js → Shield01-C8cVelqS.js} +1 -1
  26. package/dist/client/assets/{Star01-DWr_psxV.js → Star01-CWWxG_KI.js} +1 -1
  27. package/dist/client/assets/{Stars01-CTAt_kJn.js → Stars01-BbOwGDTo.js} +1 -1
  28. package/dist/client/assets/{Stars02-7S-x4jsE.js → Stars02-Cg0towie.js} +1 -1
  29. package/dist/client/assets/{Sun-C0yimusT.js → Sun-B0pEiEJI.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-CdSYnpvh.js → SwitchHorizontal01-CZV_CCfT.js} +1 -1
  31. package/dist/client/assets/{Tool01-Co9IzxOX.js → Tool01-CMWiPEy3.js} +1 -1
  32. package/dist/client/assets/{Trash01-m4F91Gbm.js → Trash01-6BHtEMEK.js} +1 -1
  33. package/dist/client/assets/{Upload01-BWuva6Fs.js → Upload01-BBS5mQ3f.js} +1 -1
  34. package/dist/client/assets/{User01-BQ6QP8OL.js → User01-ctLudJHz.js} +1 -1
  35. package/dist/client/assets/{Users01-ByzlIQ3F.js → Users01-DmtEzcDe.js} +1 -1
  36. package/dist/client/assets/{Users03-mgRYViRT.js → Users03-Cw29gL8E.js} +1 -1
  37. package/dist/client/assets/{X-D5DAti-0.js → X-n4wQsP8C.js} +1 -1
  38. package/dist/client/assets/{XCircle-BjeFLJxj.js → XCircle-RlZKBdWu.js} +1 -1
  39. package/dist/client/assets/{XClose-s3WJPw3-.js → XClose-CCdbSCI0.js} +1 -1
  40. package/dist/client/assets/{Zap-Z3n8EP6c.js → Zap-CNZdOKXJ.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-By7Cv3Wp.js → ZapSquare-D7H0u5d_.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-CIHaUyEl.js → ZoomOut-BQsNolCw.js} +1 -1
  43. package/dist/client/assets/{access-gate-Duof6cnb.js → access-gate-CQBCWOww.js} +1 -1
  44. package/dist/client/assets/accordion-B2UZL_6g.js +1 -0
  45. package/dist/client/assets/{add-section-modal-DkoTaNoJ.js → add-section-modal-MhdiYYco.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-Ckkw1MUq.js → agent-capabilities-x_XqSHVA.js} +2 -2
  47. package/dist/client/assets/{agent-icon-VIqap9Jf.js → agent-icon-j_3BzIcD.js} +1 -1
  48. package/dist/client/assets/{agent-icons-D05ipmZ4.js → agent-icons-CtmJd8pv.js} +1 -1
  49. package/dist/client/assets/{agents-list-CVx5qLnY.js → agents-list-DuG_JWSA.js} +1 -1
  50. package/dist/client/assets/{ai-providers-BuKKX642.js → ai-providers-CvcJHwWP.js} +1 -1
  51. package/dist/client/assets/{alert-DlT05Ylq.js → alert-CaGtoRvE.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-Ci1rMRpl.js → alert-dialog-B5GON_rn.js} +1 -1
  53. package/dist/client/assets/app-editor-BW8g00Bn.js +1 -0
  54. package/dist/client/assets/{auth-catchall-BUCBz8XY.js → auth-catchall-E_5n_j5N.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-CY6KnHSz.js → auth-split-layout-DNbg1SkA.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-Dg6SIiTL.js → automation-list-row-DMVyFU5x.js} +1 -1
  57. package/dist/client/assets/{automation-runs-BmKdgkka.js → automation-runs-C8HJhqMh.js} +1 -1
  58. package/dist/client/assets/{automations-BcxEWxp4.js → automations-DkWkQPjn.js} +1 -1
  59. package/dist/client/assets/{avatar-B5XGLu28.js → avatar-B2pgX4O-.js} +1 -1
  60. package/dist/client/assets/{badge-BiVWMQaC.js → badge-CuZ-TwnI.js} +1 -1
  61. package/dist/client/assets/{brand-context-DSuk-fkh.js → brand-context-j5XEN4rS.js} +1 -1
  62. package/dist/client/assets/{buckets-DNim0Oxi.js → buckets-VBpQxTsO.js} +1 -1
  63. package/dist/client/assets/{calendar-D3ybWgKx.js → calendar-DWtgCgYZ.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-BoG7ZxlR.js → capability-load-error-X-oFLl6b.js} +1 -1
  65. package/dist/client/assets/{card-Bs_ZETWd.js → card-C6GST7pX.js} +1 -1
  66. package/dist/client/assets/{chat-context-DXMK9LpM.js → chat-context-IL49-Qii.js} +7 -7
  67. package/dist/client/assets/{checkbox-CDeLVmoz.js → checkbox-iQvmtiOf.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-DUzSXn1x.js → cli-auth-success-DZWOU6WH.js} +1 -1
  69. package/dist/client/assets/{collection-detail-B39xBZcf.js → collection-detail-DjOaNOeb.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-LYjUKJyD.js → collection-display-button-Cuh6mlSK.js} +1 -1
  71. package/dist/client/assets/{collection-search-CIGzMvXg.js → collection-search-CjajZIce.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-CRZ7umIR.js → collection-table-wrapper-eBoRds6R.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-Cl0Sce7d.js → collection-tabs-CP0Z4RDy.js} +1 -1
  74. package/dist/client/assets/{collections-DsvWgjkq.js → collections-UhkoFujd.js} +1 -1
  75. package/dist/client/assets/{command-nIpjgY_C.js → command-CrwWdffP.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-D0cwbi62.js → connect-desktop-dialog-cYID8Fwh.js} +1 -1
  77. package/dist/client/assets/{connection-card-Js2GKnMD.js → connection-card-BMUq3Pqp.js} +1 -1
  78. package/dist/client/assets/connection-detail-DXmnPxmn.js +1 -0
  79. package/dist/client/assets/connection-form-helpers-D0ciET8p.js +1 -0
  80. package/dist/client/assets/{connections-BM65SkyA.js → connections-BohYSkTk.js} +1 -1
  81. package/dist/client/assets/constants-Oa_3OHe_.js +10 -0
  82. package/dist/client/assets/{decopilot-sse-pool-xYuzxJCG.js → decopilot-sse-pool-BM6ilk8E.js} +1 -1
  83. package/dist/client/assets/{dialog-BDoa-Aig.js → dialog-DdLbZ_WU.js} +1 -1
  84. package/dist/client/assets/{domain-settings-BHKhY4wr.js → domain-settings-C3uvi2cc.js} +1 -1
  85. package/dist/client/assets/{drawer-DBoqm7Ga.js → drawer-Di65R9Lp.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-BuEg85yr.js → dropdown-menu-KTv5Rg2q.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-DROpH4YR.js → dynamic-plugin-layout-BMU6Jrbq.js} +1 -1
  88. package/dist/client/assets/{empty-state-BzUpYoP8.js → empty-state-B5p5bk6Z.js} +1 -1
  89. package/dist/client/assets/{empty-state-Ct_D2Lzo.js → empty-state-CHF-OJzf.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-C73XSXJg.js → extract-connection-data-C8n8zRZ1.js} +1 -1
  91. package/dist/client/assets/features-CLXTlINo.js +1 -0
  92. package/dist/client/assets/{file-explorer-DIE7TBnv.js → file-explorer-9WWuVsQv.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-CXEAWEt3.js → file-type-icon-CPHxcxKH.js} +1 -1
  94. package/dist/client/assets/{files-Dk2BQIKH.js → files-DkKLVBZC.js} +1 -1
  95. package/dist/client/assets/{form-CEHwzUIx.js → form-Dz5uedkA.js} +1 -1
  96. package/dist/client/assets/{general-D0Ux1V9u.js → general-C5vTPmS0.js} +1 -1
  97. package/dist/client/assets/{generate-id-DwXNdT-H.js → generate-id-mQX7A9NG.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-CFHmzbdo.js → github-repo-picker-Cc4-p1Vw.js} +2 -2
  99. package/dist/client/assets/{header-tab-button-Be5qNrZz.js → header-tab-button-BS4KWscL.js} +3 -3
  100. package/dist/client/assets/{hover-card-CZKyvEKV.js → hover-card-DYtXMFUa.js} +1 -1
  101. package/dist/client/assets/{image-field-dhimK8za.js → image-field-BfJrQGY-.js} +1 -1
  102. package/dist/client/assets/{index-CX7SvFBB.js → index-BC_JflmM.js} +1 -1
  103. package/dist/client/assets/{index-5FdhmN0u.js → index-C_IR8gxp.js} +1 -1
  104. package/dist/client/assets/{index-8Av7_XG5.js → index-Cpkh2ZIG.js} +30 -30
  105. package/dist/client/assets/{index-fhh9LjnW.js → index-CtKZvwsL.js} +1 -1
  106. package/dist/client/assets/{index-3RJ1532Y.js → index-Cw1b7_IC.js} +1 -1
  107. package/dist/client/assets/{index-C1oz8tZO.js → index-D2vCCd_J.js} +1 -1
  108. package/dist/client/assets/{index-BTP7FdvD.js → index-D6Z5qT0j.js} +1 -1
  109. package/dist/client/assets/{index-OL8Ldzfm.js → index-DHvl6UTr.js} +12 -12
  110. package/dist/client/assets/{index-CnvExC11.js → index-DMO9m3rs.js} +12 -12
  111. package/dist/client/assets/{index-DJjaDA78.js → index-DOtgrMac.js} +1 -1
  112. package/dist/client/assets/{index-B3HtVn_3.js → index-DQcXUr0x.js} +1 -1
  113. package/dist/client/assets/{index-D2E_r2Ga.js → index-DXZuqE0E.js} +1 -1
  114. package/dist/client/assets/{index-DhlM3QdF.js → index-DbF-n4-L.js} +1 -1
  115. package/dist/client/assets/{index-qEEk-G84.js → index-MbPJV6rG.js} +1 -1
  116. package/dist/client/assets/{index-4cje1k2I.js → index-N7c6GjPf.js} +4 -4
  117. package/dist/client/assets/{index-redirect-Cw9_x250.js → index-redirect-H-A-1e_u.js} +1 -1
  118. package/dist/client/assets/{infiniteQueryObserver-BPAoXqhZ.js → infiniteQueryObserver-zekhS5wb.js} +1 -1
  119. package/dist/client/assets/{input-CFgdCIf-.js → input-DEyRCUKF.js} +1 -1
  120. package/dist/client/assets/{integration-icon-ByZrCdpe.js → integration-icon-bH4ORjC1.js} +1 -1
  121. package/dist/client/assets/{label-D5ze4fbW.js → label-CXjSsOVd.js} +1 -1
  122. package/dist/client/assets/{layout-BuMBlDfo.js → layout-DR2BXWUz.js} +1 -1
  123. package/dist/client/assets/{login-RbDPhsFB.js → login-D-75DUI6.js} +1 -1
  124. package/dist/client/assets/{members-k2G4ARa8.js → members-C5Z2CQl6.js} +2 -2
  125. package/dist/client/assets/{monaco-editor-BAqhsJzm.js → monaco-editor-BaZ5Dhu_.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-DSa7vGTC.js → monitoring-stats-row-VskxRAxf.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-CbbBKuCW.js → oauth-callback-MuK3qiPW.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-BRZTOWnt.js → oauth-callback-ai-provider-o68OT3gt.js} +1 -1
  129. package/dist/client/assets/{onboarding-C6E_j9z8.js → onboarding-7h0TMHtu.js} +1 -1
  130. package/dist/client/assets/org-install-CIf67b31.js +1 -0
  131. package/dist/client/assets/{org-layout-UJeeaSgp.js → org-layout-lEA7IQLq.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-BKs5_fCy.js → org-plugin-layout-OlMHMxYT.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-nusKb5Sb.js → page-seo-form-CgJjTSWF.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-k1GRACQ1.js +1 -0
  135. package/dist/client/assets/{pair-B10kI-gZ.js → pair-BVzu7sAB.js} +5 -5
  136. package/dist/client/assets/{plugin-empty-state-j4CULS57.js → plugin-empty-state-C9uXRG5n.js} +1 -1
  137. package/dist/client/assets/{plugin-header-DULj-Y49.js → plugin-header-COqHcrfF.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-BKWVYVIi.js → plugin-layout-CcJ44FQz.js} +1 -1
  139. package/dist/client/assets/{popover-CusBDsw3.js → popover-uEdNUAGC.js} +1 -1
  140. package/dist/client/assets/{post-editor-DEyWVqiE.js → post-editor-dIV5W22o.js} +1 -1
  141. package/dist/client/assets/{primitives-K-Cou-34.js → primitives-CX6AfsVx.js} +1 -1
  142. package/dist/client/assets/{profile-Cbty-wCE.js → profile-uzt4qynv.js} +1 -1
  143. package/dist/client/assets/project-app-view-C_BRD5rR.js +1 -0
  144. package/dist/client/assets/record-editor-BGQc7oGD.js +1 -0
  145. package/dist/client/assets/registry-CERn-13P.js +2 -0
  146. package/dist/client/assets/registry-layout-D37zehmA.js +27 -0
  147. package/dist/client/assets/{require-capability-B58b3LsO.js → require-capability-B3lwAyWg.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-CLPqu2hV.js → required-auth-layout-Wnvh0U4T.js} +1 -1
  149. package/dist/client/assets/{reset-password-QvfJzQLt.js → reset-password-DmsfHgmJ.js} +1 -1
  150. package/dist/client/assets/{resizable-DtVYiBv-.js → resizable-D7ieBArZ.js} +1 -1
  151. package/dist/client/assets/{roles-BJzMRSbv.js → roles-Dd2ckVHk.js} +1 -1
  152. package/dist/client/assets/{save-status-CcrdCZvz.js → save-status-COEL3tyo.js} +1 -1
  153. package/dist/client/assets/{schema-form-CLs9R9OM.js → schema-form-BJ10scGm.js} +1 -1
  154. package/dist/client/assets/{scroll-area-GY_MqX9m.js → scroll-area-CROxBGDJ.js} +1 -1
  155. package/dist/client/assets/{search-input-CaIL3--R.js → search-input-CEos2vuK.js} +1 -1
  156. package/dist/client/assets/{secrets-CEQKXAz2.js → secrets-uX8-r_iL.js} +1 -1
  157. package/dist/client/assets/{sections-editor-3wx6-GfE.js → sections-editor-DscL7vhI.js} +1 -1
  158. package/dist/client/assets/select-CdQXqmNU.js +1 -0
  159. package/dist/client/assets/{select-model-DV1-Oh57.js → select-model-CGmj9qQR.js} +1 -1
  160. package/dist/client/assets/{seo-editor-CwuvVAjS.js → seo-editor-lsINyDxy.js} +1 -1
  161. package/dist/client/assets/{settings-layout-lPzeLZ6G.js → settings-layout-VmkPRLeq.js} +1 -1
  162. package/dist/client/assets/{settings-section-rywQD1H8.js → settings-section-DfXgkKe4.js} +1 -1
  163. package/dist/client/assets/{sheet-HD1tdtUP.js → sheet-DaGOcg1E.js} +1 -1
  164. package/dist/client/assets/{shell-controls-CiR1mOgQ.js → shell-controls-CaJkCNp9.js} +1 -1
  165. package/dist/client/assets/shell-layout-sZixPx3p.js +1 -0
  166. package/dist/client/assets/shell-route-loading-kPm1pbpp.js +1 -0
  167. package/dist/client/assets/{sidebar-BTAYcbpn.js → sidebar-Laoughup.js} +1 -1
  168. package/dist/client/assets/{skeleton-KPs8aExG.js → skeleton-D7QGBIf9.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-k9dnaUc0.js → sortable.esm-BXQkfVLn.js} +1 -1
  170. package/dist/client/assets/{spinner-CWHpDgnL.js → spinner-Can-xf73.js} +1 -1
  171. package/dist/client/assets/{sso-DCJOVjP-.js → sso-DmpdlPS9.js} +1 -1
  172. package/dist/client/assets/{store-QHf4NvZa.js → store-DdJ8D_i5.js} +1 -1
  173. package/dist/client/assets/store-registry-CHbu7dYT.js +2 -0
  174. package/dist/client/assets/{switch-CCjru8jV.js → switch-r0YT0Lap.js} +1 -1
  175. package/dist/client/assets/{tab-id-Cj2zAp8p.js → tab-id-CX7N91lc.js} +1 -1
  176. package/dist/client/assets/{table-Dpu-CGxg.js → table-CAdDo5TO.js} +1 -1
  177. package/dist/client/assets/{tabs-Bsb3WneA.js → tabs-Dpo84qqe.js} +1 -1
  178. package/dist/client/assets/{task-status-Bq8PHYFh.js → task-status-BwdOy1Jy.js} +1 -1
  179. package/dist/client/assets/{textarea-Bw4v_xfm.js → textarea-CUD0RgwO.js} +1 -1
  180. package/dist/client/assets/{toggle-group-a9DpUbSj.js → toggle-group-CZpeIyjE.js} +1 -1
  181. package/dist/client/assets/{toolbar-BkMHRO8B.js → toolbar-CEHDA2-o.js} +1 -1
  182. package/dist/client/assets/{tools-list-CmaWZYdl.js → tools-list-CDyehiZe.js} +1 -1
  183. package/dist/client/assets/{tooltip-B9p8ywB_.js → tooltip-Bjr-42Bl.js} +1 -1
  184. package/dist/client/assets/{types-5S14a687.js → types-D9_SUZkD.js} +19 -19
  185. package/dist/client/assets/{use-ai-providers-iJF3uFpo.js → use-ai-providers-UMKPQnZG.js} +1 -1
  186. package/dist/client/assets/{use-automations-BTipFIOi.js → use-automations-BDH3-J4x.js} +1 -1
  187. package/dist/client/assets/{use-capability-CeWdChcL.js → use-capability-C2Tu19nf.js} +1 -1
  188. package/dist/client/assets/use-collections-D85cxoLq.js +1 -0
  189. package/dist/client/assets/{use-connection-C2Ef-EqP.js → use-connection-CXzR06Gi.js} +1 -1
  190. package/dist/client/assets/{use-copy-DPF-R5Zs.js → use-copy-CF7xkH7Y.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-7QQxHiI4.js → use-create-virtual-mcp-DA_6aHJV.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-Da4caii8.js → use-debounced-autosave-kCYkqmyz.js} +1 -1
  193. package/dist/client/assets/use-delete-connection-CdKASaY5.js +1 -0
  194. package/dist/client/assets/{use-file-configs-DWgNRokn.js → use-file-configs-DiKn7NQz.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-BaBllFvG.js → use-infinite-scroll-7ieugFXP.js} +1 -1
  196. package/dist/client/assets/{use-list-state-d80zzrG8.js → use-list-state-B-_Y_GrK.js} +1 -1
  197. package/dist/client/assets/use-mcp-prompts-B6gU18rG.js +1 -0
  198. package/dist/client/assets/use-mcp-tools-dz6nCDMf.js +1 -0
  199. package/dist/client/assets/{use-members-D2U599cF.js → use-members-CDIouu8q.js} +1 -1
  200. package/dist/client/assets/{use-navigate-to-agent-C3AzTy7G.js → use-navigate-to-agent-jijw9Ij-.js} +1 -1
  201. package/dist/client/assets/{use-org-auth-client-BQe59WMu.js → use-org-auth-client-BTgQkcc5.js} +1 -1
  202. package/dist/client/assets/{use-org-sso-BB-vyF4c.js → use-org-sso-Bj8ldpdb.js} +1 -1
  203. package/dist/client/assets/{use-organization-roles-DItwUayG.js → use-organization-roles-CAd0PQL1.js} +1 -1
  204. package/dist/client/assets/{use-organization-settings-B6tWOwuA.js → use-organization-settings-UL_V1zDB.js} +1 -1
  205. package/dist/client/assets/{use-registry-connections-DIBKm4oO.js → use-registry-connections-7sfZluS3.js} +1 -1
  206. package/dist/client/assets/{use-secrets-BhZyR2Dx.js → use-secrets-DJsGqvsL.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-Wb6qMNbl.js → use-status-sounds-tZ40uoUX.js} +1 -1
  208. package/dist/client/assets/{use-view-mode-BwvjqQMY.js → use-view-mode-Ce2twUKM.js} +1 -1
  209. package/dist/client/assets/use-virtual-mcp-Ce0GfiFh.js +1 -0
  210. package/dist/client/assets/useInfiniteQuery-B20VvZoE.js +1 -0
  211. package/dist/client/assets/{useRouterState-BLC1S9ll.js → useRouterState-td5u2-aW.js} +1 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-edWZifJ8.js +1 -0
  213. package/dist/client/assets/{user-BHKPSALf.js → user-CHD7rK-Q.js} +1 -1
  214. package/dist/client/assets/{view-mode-toggle-BabF7Sx4.js → view-mode-toggle-BRfGML_p.js} +1 -1
  215. package/dist/client/assets/{workflow-BQFoQKwV.js → workflow-C1oFX2-w.js} +1 -1
  216. package/dist/client/assets/workflow-detail-C8PdDdMR.js +1 -0
  217. package/dist/client/index.html +1 -1
  218. package/dist/server/cli.js +432 -422
  219. package/dist/server/migrate.js +57 -57
  220. package/dist/server/server.js +288 -278
  221. package/package.json +1 -1
  222. package/dist/client/assets/accordion-B1qqQUiM.js +0 -1
  223. package/dist/client/assets/app-editor-DNNG7_rJ.js +0 -1
  224. package/dist/client/assets/connection-detail-Db8Rqnlx.js +0 -1
  225. package/dist/client/assets/connection-form-helpers-Dkeln3L-.js +0 -1
  226. package/dist/client/assets/constants-DeFtLUND.js +0 -10
  227. package/dist/client/assets/features-CG5whIKN.js +0 -1
  228. package/dist/client/assets/org-install-Dj9o_O_M.js +0 -1
  229. package/dist/client/assets/page-seo-sheet-BpOn67AY.js +0 -1
  230. package/dist/client/assets/project-app-view-gakpd8ie.js +0 -1
  231. package/dist/client/assets/record-editor-BJCIZK6H.js +0 -1
  232. package/dist/client/assets/registry-IJiacnxJ.js +0 -2
  233. package/dist/client/assets/registry-layout-1N9kmpom.js +0 -27
  234. package/dist/client/assets/select-Y4AHPww8.js +0 -1
  235. package/dist/client/assets/shell-layout-D1gXYOI4.js +0 -1
  236. package/dist/client/assets/shell-route-loading-BMvdQN97.js +0 -1
  237. package/dist/client/assets/store-registry-O5u8x-zS.js +0 -2
  238. package/dist/client/assets/use-collections-CMMaRmVG.js +0 -1
  239. package/dist/client/assets/use-delete-connection-DaFBaRNm.js +0 -1
  240. package/dist/client/assets/use-mcp-prompts-1dd1yGOH.js +0 -1
  241. package/dist/client/assets/use-mcp-tools-C8LW1vg1.js +0 -1
  242. package/dist/client/assets/use-virtual-mcp-C_vD2kKw.js +0 -1
  243. package/dist/client/assets/useInfiniteQuery-CQ_UxVw9.js +0 -1
  244. package/dist/client/assets/useSuspenseInfiniteQuery-XoWOrVYw.js +0 -1
  245. package/dist/client/assets/workflow-detail-CUEl0-_h.js +0 -1
@@ -1,20 +1,20 @@
1
- import{e as F,n as ke,bA as qe,bB as Pe,s as be,bM as p,bi as t,aI as b,U as l,bN as P,R as s,aJ as g,aG as u,T as f,b6 as x,bO as B,bP as ye,bQ as ve,bR as V,bS as j,bT as xe,bU as we,bV as W,bW as Te,bX as Ie,bY as Ee,bZ as Le,b_ as ze,b$ as De,c0 as Ne,c1 as Ue,c2 as Ae,c3 as Oe,c4 as $e,c5 as Be,c6 as je,c7 as Fe,c8 as Ve,c9 as We,ca as Ke,r as oe,t as Ze,c as se,j as v}from"./index-8Av7_XG5.js";import{K as re,P as Je}from"./constants-DeFtLUND.js";async function Re(n){if(!n.getServerCapabilities()?.resources)return{resources:[]};try{return await n.listResources()}catch(o){if(o instanceof qe&&o.code===Pe.MethodNotFound)return{resources:[]};throw o}}async function Qe(n,e){return await n.readResource({uri:e})}function Yt(n){const e=F.c(12);let o,i;e[0]!==n?({client:o,...i}=n,e[0]=n,e[1]=o,e[2]=i):(o=e[1],i=e[2]);let r;e[3]!==o?(r=re.mcpResourcesList(o),e[3]=o,e[4]=r):r=e[4];let a;e[5]!==o?(a=()=>Re(o),e[5]=o,e[6]=a):a=e[6];const c=i.staleTime??3e4;let d;return e[7]!==i||e[8]!==r||e[9]!==a||e[10]!==c?(d={...i,queryKey:r,queryFn:a,staleTime:c,retry:!1},e[7]=i,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],be(d)}function Gt(n){const e=F.c(12);let o,i;e[0]!==n?({client:o,...i}=n,e[0]=n,e[1]=o,e[2]=i):(o=e[1],i=e[2]);let r;e[3]!==o?(r=re.mcpResourcesList(o),e[3]=o,e[4]=r):r=e[4];let a;e[5]!==o?(a=()=>Re(o),e[5]=o,e[6]=a):a=e[6];const c=i.staleTime??3e4;let d;return e[7]!==i||e[8]!==r||e[9]!==a||e[10]!==c?(d={...i,queryKey:r,queryFn:a,staleTime:c,retry:!1},e[7]=i,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],ke(d)}function Ye(n){const e=F.c(15);let o,i,r;e[0]!==n?({client:o,uri:r,...i}=n,e[0]=n,e[1]=o,e[2]=i,e[3]=r):(o=e[1],i=e[2],r=e[3]);let a;e[4]!==o||e[5]!==r?(a=re.mcpReadResource(o,r),e[4]=o,e[5]=r,e[6]=a):a=e[6];let c;e[7]!==o||e[8]!==r?(c=()=>Qe(o,r),e[7]=o,e[8]=r,e[9]=c):c=e[9];const d=i.staleTime??3e4;let h;return e[10]!==i||e[11]!==a||e[12]!==c||e[13]!==d?(h={...i,queryKey:a,queryFn:c,staleTime:d,retry:!1},e[10]=i,e[11]=a,e[12]=c,e[13]=d,e[14]=h):h=e[14],be(h)}const de=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function Ge(n,e={}){const i=`<meta http-equiv="Content-Security-Policy" content="${et(e)}">`,r=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,a=n.match(r);if(a){const m=(a.index??0)+a[0].length;return n.slice(0,m)+`
2
- `+i+n.slice(m)}const c=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,d=n.match(c);if(d){const m=(d.index??0)+d[0].length;return n.slice(0,m)+`
1
+ import{bT as p,bp as t,aJ as y,W as a,bU as q,T as s,aK as f,aH as u,U as m,ba as x,bV as O,bW as fe,bX as ge,bY as $,bZ as j,b_ as be,b$ as ye,c0 as B,c1 as Se,c2 as _e,c3 as He,c4 as Me,c5 as ke,c6 as Pe,c7 as qe,c8 as Te,c9 as Ie,ca as Ee,cb as Le,cc as ze,cd as Ue,ce as Ae,cf as De,cg as Ne,ch as Oe,r as te,e as V,j as b,ci as je,cj as $e,t as Be,c as oe}from"./index-Cpkh2ZIG.js";import{P as Ve}from"./constants-Oa_3OHe_.js";const le=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function We(r,e={}){const i=`<meta http-equiv="Content-Security-Policy" content="${Ke(e)}">`,n=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,l=r.match(n);if(l){const g=(l.index??0)+l[0].length;return r.slice(0,g)+`
2
+ `+i+r.slice(g)}const c=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,d=r.match(c);if(d){const g=(d.index??0)+d[0].length;return r.slice(0,g)+`
3
3
  <head>
4
4
  `+i+`
5
- </head>`+n.slice(m)}const h=/<!DOCTYPE[^>]*>/i,y=n.match(h);if(y){const m=(y.index??0)+y[0].length;return n.slice(0,m)+`
5
+ </head>`+r.slice(g)}const h=/<!DOCTYPE[^>]*>/i,v=r.match(h);if(v){const g=(v.index??0)+v[0].length;return r.slice(0,g)+`
6
6
  <head>
7
7
  `+i+`
8
- </head>`+n.slice(m)}return`<head>
8
+ </head>`+r.slice(g)}return`<head>
9
9
  `+i+`
10
10
  </head>
11
- `+n}const Xe=/^https?:\/\/(\*\.)?[a-zA-Z0-9._-]+(:\d+)?\/?$/;function $(n){return!n||n.length===0?[]:n.filter(e=>Xe.test(e))}function et(n){if(n.csp)return n.csp;const e=n.resourceCsp;if(!e)return de;const o=$(e.resourceDomains),i=$(e.connectDomains),r=$(e.frameDomains),a=$(e.baseUriDomains),c=o.length>0,d=i.length>0,h=r.length>0,y=a.length>0;if(!c&&!d&&!h&&!y)return de;const m=o.join(" ");return["default-src 'none'",c?`script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval' ${m}`:"script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'",c?`style-src 'unsafe-inline' ${m}`:"style-src 'unsafe-inline'",c?`img-src * data: blob: ${m}`:"img-src * data: blob:",c?`media-src * data: blob: ${m}`:"media-src * data: blob:",c?`font-src data: ${m}`:"font-src data:",d?`connect-src ${i.join(" ")}`:"connect-src 'none'",h?`frame-src ${r.join(" ")}`:"frame-src 'none'","worker-src blob:","form-action 'none'",y?`base-uri ${a.join(" ")}`:"base-uri 'none'"].join("; ")}(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});class tt extends Je{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,o){}_ensureEventSlot(e){let o=this._eventSlots.get(e);if(!o){let i=this.eventSchemas[e];if(!i)throw Error(`Unknown event: ${String(e)}`);o={listeners:[]},this._eventSlots.set(e,o);let r=i.shape.method.value;this._registeredMethods.add(r);let a=o;super.setNotificationHandler(i,c=>{let d=c.params;this.onEventDispatch(e,d),a.onHandler?.(d);for(let h of[...a.listeners])h(d)})}return o}setEventHandler(e,o){let i=this._ensureEventSlot(e);i.onHandler&&o&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),i.onHandler=o}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,o){this._ensureEventSlot(e).listeners.push(o)}removeEventListener(e,o){let i=this._eventSlots.get(e);if(!i)return;let r=i.listeners.indexOf(o);r!==-1&&i.listeners.splice(r,1)}setRequestHandler=(e,o)=>{this._assertMethodNotRegistered(e,"setRequestHandler"),super.setRequestHandler(e,o)};setNotificationHandler=(e,o)=>{this._assertMethodNotRegistered(e,"setNotificationHandler"),super.setNotificationHandler(e,o)};warnIfRequestHandlerReplaced(e,o,i){o&&i&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,o)=>{let i=e.shape.method.value;this._registeredMethods.add(i),super.setRequestHandler(e,o)};_assertMethodNotRegistered(e,o){let i=e.shape.method.value;if(this._registeredMethods.has(i))throw Error(`Handler for "${i}" already registered (via ${o}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(i)}}var Ce="2026-01-26",ot="ui/notifications/tool-input-partial",st=p([t("light"),t("dark")]).describe("Color theme preference for the host environment."),T=p([t("inline"),t("fullscreen"),t("pip")]).describe("Display mode for UI presentation."),it=p([t("--color-background-primary"),t("--color-background-secondary"),t("--color-background-tertiary"),t("--color-background-inverse"),t("--color-background-ghost"),t("--color-background-info"),t("--color-background-danger"),t("--color-background-success"),t("--color-background-warning"),t("--color-background-disabled"),t("--color-text-primary"),t("--color-text-secondary"),t("--color-text-tertiary"),t("--color-text-inverse"),t("--color-text-ghost"),t("--color-text-info"),t("--color-text-danger"),t("--color-text-success"),t("--color-text-warning"),t("--color-text-disabled"),t("--color-border-primary"),t("--color-border-secondary"),t("--color-border-tertiary"),t("--color-border-inverse"),t("--color-border-ghost"),t("--color-border-info"),t("--color-border-danger"),t("--color-border-success"),t("--color-border-warning"),t("--color-border-disabled"),t("--color-ring-primary"),t("--color-ring-secondary"),t("--color-ring-inverse"),t("--color-ring-info"),t("--color-ring-danger"),t("--color-ring-success"),t("--color-ring-warning"),t("--font-sans"),t("--font-mono"),t("--font-weight-normal"),t("--font-weight-medium"),t("--font-weight-semibold"),t("--font-weight-bold"),t("--font-text-xs-size"),t("--font-text-sm-size"),t("--font-text-md-size"),t("--font-text-lg-size"),t("--font-heading-xs-size"),t("--font-heading-sm-size"),t("--font-heading-md-size"),t("--font-heading-lg-size"),t("--font-heading-xl-size"),t("--font-heading-2xl-size"),t("--font-heading-3xl-size"),t("--font-text-xs-line-height"),t("--font-text-sm-line-height"),t("--font-text-md-line-height"),t("--font-text-lg-line-height"),t("--font-heading-xs-line-height"),t("--font-heading-sm-line-height"),t("--font-heading-md-line-height"),t("--font-heading-lg-line-height"),t("--font-heading-xl-line-height"),t("--font-heading-2xl-line-height"),t("--font-heading-3xl-line-height"),t("--border-radius-xs"),t("--border-radius-sm"),t("--border-radius-md"),t("--border-radius-lg"),t("--border-radius-xl"),t("--border-radius-full"),t("--border-width-regular"),t("--shadow-hairline"),t("--shadow-sm"),t("--shadow-md"),t("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),rt=b(it.describe(`Style variables for theming MCP apps.
11
+ `+r}const Fe=/^https?:\/\/(\*\.)?[a-zA-Z0-9._-]+(:\d+)?\/?$/;function N(r){return!r||r.length===0?[]:r.filter(e=>Fe.test(e))}function Ke(r){if(r.csp)return r.csp;const e=r.resourceCsp;if(!e)return le;const o=N(e.resourceDomains),i=N(e.connectDomains),n=N(e.frameDomains),l=N(e.baseUriDomains),c=o.length>0,d=i.length>0,h=n.length>0,v=l.length>0;if(!c&&!d&&!h&&!v)return le;const g=o.join(" ");return["default-src 'none'",c?`script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval' ${g}`:"script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'",c?`style-src 'unsafe-inline' ${g}`:"style-src 'unsafe-inline'",c?`img-src * data: blob: ${g}`:"img-src * data: blob:",c?`media-src * data: blob: ${g}`:"media-src * data: blob:",c?`font-src data: ${g}`:"font-src data:",d?`connect-src ${i.join(" ")}`:"connect-src 'none'",h?`frame-src ${n.join(" ")}`:"frame-src 'none'","worker-src blob:","form-action 'none'",v?`base-uri ${l.join(" ")}`:"base-uri 'none'"].join("; ")}(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});class Ze extends Ve{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,o){}_ensureEventSlot(e){let o=this._eventSlots.get(e);if(!o){let i=this.eventSchemas[e];if(!i)throw Error(`Unknown event: ${String(e)}`);o={listeners:[]},this._eventSlots.set(e,o);let n=i.shape.method.value;this._registeredMethods.add(n);let l=o;super.setNotificationHandler(i,c=>{let d=c.params;this.onEventDispatch(e,d),l.onHandler?.(d);for(let h of[...l.listeners])h(d)})}return o}setEventHandler(e,o){let i=this._ensureEventSlot(e);i.onHandler&&o&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),i.onHandler=o}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,o){this._ensureEventSlot(e).listeners.push(o)}removeEventListener(e,o){let i=this._eventSlots.get(e);if(!i)return;let n=i.listeners.indexOf(o);n!==-1&&i.listeners.splice(n,1)}setRequestHandler=(e,o)=>{this._assertMethodNotRegistered(e,"setRequestHandler"),super.setRequestHandler(e,o)};setNotificationHandler=(e,o)=>{this._assertMethodNotRegistered(e,"setNotificationHandler"),super.setNotificationHandler(e,o)};warnIfRequestHandlerReplaced(e,o,i){o&&i&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,o)=>{let i=e.shape.method.value;this._registeredMethods.add(i),super.setRequestHandler(e,o)};_assertMethodNotRegistered(e,o){let i=e.shape.method.value;if(this._registeredMethods.has(i))throw Error(`Handler for "${i}" already registered (via ${o}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(i)}}var ve="2026-01-26",Je="ui/notifications/tool-input-partial",Ye=p([t("light"),t("dark")]).describe("Color theme preference for the host environment."),T=p([t("inline"),t("fullscreen"),t("pip")]).describe("Display mode for UI presentation."),Qe=p([t("--color-background-primary"),t("--color-background-secondary"),t("--color-background-tertiary"),t("--color-background-inverse"),t("--color-background-ghost"),t("--color-background-info"),t("--color-background-danger"),t("--color-background-success"),t("--color-background-warning"),t("--color-background-disabled"),t("--color-text-primary"),t("--color-text-secondary"),t("--color-text-tertiary"),t("--color-text-inverse"),t("--color-text-ghost"),t("--color-text-info"),t("--color-text-danger"),t("--color-text-success"),t("--color-text-warning"),t("--color-text-disabled"),t("--color-border-primary"),t("--color-border-secondary"),t("--color-border-tertiary"),t("--color-border-inverse"),t("--color-border-ghost"),t("--color-border-info"),t("--color-border-danger"),t("--color-border-success"),t("--color-border-warning"),t("--color-border-disabled"),t("--color-ring-primary"),t("--color-ring-secondary"),t("--color-ring-inverse"),t("--color-ring-info"),t("--color-ring-danger"),t("--color-ring-success"),t("--color-ring-warning"),t("--font-sans"),t("--font-mono"),t("--font-weight-normal"),t("--font-weight-medium"),t("--font-weight-semibold"),t("--font-weight-bold"),t("--font-text-xs-size"),t("--font-text-sm-size"),t("--font-text-md-size"),t("--font-text-lg-size"),t("--font-heading-xs-size"),t("--font-heading-sm-size"),t("--font-heading-md-size"),t("--font-heading-lg-size"),t("--font-heading-xl-size"),t("--font-heading-2xl-size"),t("--font-heading-3xl-size"),t("--font-text-xs-line-height"),t("--font-text-sm-line-height"),t("--font-text-md-line-height"),t("--font-text-lg-line-height"),t("--font-heading-xs-line-height"),t("--font-heading-sm-line-height"),t("--font-heading-md-line-height"),t("--font-heading-lg-line-height"),t("--font-heading-xl-line-height"),t("--font-heading-2xl-line-height"),t("--font-heading-3xl-line-height"),t("--border-radius-xs"),t("--border-radius-sm"),t("--border-radius-md"),t("--border-radius-lg"),t("--border-radius-xl"),t("--border-radius-full"),t("--border-width-regular"),t("--shadow-hairline"),t("--shadow-sm"),t("--shadow-md"),t("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),Ge=y(Qe.describe(`Style variables for theming MCP apps.
12
12
 
13
13
  Individual style keys are optional - hosts may provide any subset of these values.
14
14
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
15
15
 
16
16
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
17
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),p([l(),P()]).describe(`Style variables for theming MCP apps.
17
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),p([a(),q()]).describe(`Style variables for theming MCP apps.
18
18
 
19
19
  Individual style keys are optional - hosts may provide any subset of these values.
20
20
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
@@ -26,10 +26,10 @@ Individual style keys are optional - hosts may provide any subset of these value
26
26
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
27
27
 
28
28
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
29
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),nt=s({method:t("ui/open-link"),params:s({url:l().describe("URL to open in the host's browser")})});s({isError:g().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough();s({isError:g().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough();s({isError:g().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();var at=s({method:t("ui/notifications/sandbox-proxy-ready"),params:s({})}),ne=s({connectDomains:u(l()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
29
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Xe=s({method:t("ui/open-link"),params:s({url:a().describe("URL to open in the host's browser")})});s({isError:f().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough();s({isError:f().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough();s({isError:f().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();var et=s({method:t("ui/notifications/sandbox-proxy-ready"),params:s({})}),ie=s({connectDomains:u(a()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
30
30
 
31
31
  - Maps to CSP \`connect-src\` directive
32
- - Empty or omitted → no network connections (secure default)`),resourceDomains:u(l()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:u(l()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:u(l()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),ae=s({camera:s({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:s({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:s({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:s({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),lt=s({method:t("ui/notifications/size-changed"),params:s({width:f().optional().describe("New width in pixels."),height:f().optional().describe("New height in pixels.")})});s({method:t("ui/notifications/tool-input"),params:s({arguments:b(l(),x().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})});s({method:t("ui/notifications/tool-input-partial"),params:s({arguments:b(l(),x().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})});s({method:t("ui/notifications/tool-cancelled"),params:s({reason:l().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})});var ct=s({fonts:l().optional()}),dt=s({variables:rt.optional().describe("CSS variables for theming the app."),css:ct.optional().describe("CSS blocks that apps can inject.")});s({method:t("ui/resource-teardown"),params:s({})});var pt=b(l(),x()),pe=s({text:s({}).optional().describe("Host supports text content blocks."),image:s({}).optional().describe("Host supports image content blocks."),audio:s({}).optional().describe("Host supports audio content blocks."),resource:s({}).optional().describe("Host supports resource content blocks."),resourceLink:s({}).optional().describe("Host supports resource link content blocks."),structuredContent:s({}).optional().describe("Host supports structured content.")}),ut=s({method:t("ui/notifications/request-teardown"),params:s({}).optional()}),ht=s({experimental:s({}).optional().describe("Experimental features (structure TBD)."),openLinks:s({}).optional().describe("Host supports opening external URLs."),downloadFile:s({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:s({listChanged:g().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:s({listChanged:g().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:s({}).optional().describe("Host accepts log messages."),sandbox:s({permissions:ae.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:ne.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:pe.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:pe.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:s({tools:s({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),mt=s({experimental:s({}).optional().describe("Experimental features (structure TBD)."),tools:s({listChanged:g().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:u(T).optional().describe("Display modes the app supports.")}),ft=s({method:t("ui/notifications/initialized"),params:s({}).optional()});s({csp:ne.optional().describe("Content Security Policy configuration for UI resources."),permissions:ae.optional().describe("Sandbox permissions requested by the UI resource."),domain:l().optional().describe(`Dedicated origin for view sandbox.
32
+ - Empty or omitted → no network connections (secure default)`),resourceDomains:u(a()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:u(a()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:u(a()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),re=s({camera:s({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:s({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:s({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:s({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),tt=s({method:t("ui/notifications/size-changed"),params:s({width:m().optional().describe("New width in pixels."),height:m().optional().describe("New height in pixels.")})});s({method:t("ui/notifications/tool-input"),params:s({arguments:y(a(),x().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})});s({method:t("ui/notifications/tool-input-partial"),params:s({arguments:y(a(),x().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})});s({method:t("ui/notifications/tool-cancelled"),params:s({reason:a().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})});var ot=s({fonts:a().optional()}),st=s({variables:Ge.optional().describe("CSS variables for theming the app."),css:ot.optional().describe("CSS blocks that apps can inject.")});s({method:t("ui/resource-teardown"),params:s({})});var it=y(a(),x()),ce=s({text:s({}).optional().describe("Host supports text content blocks."),image:s({}).optional().describe("Host supports image content blocks."),audio:s({}).optional().describe("Host supports audio content blocks."),resource:s({}).optional().describe("Host supports resource content blocks."),resourceLink:s({}).optional().describe("Host supports resource link content blocks."),structuredContent:s({}).optional().describe("Host supports structured content.")}),rt=s({method:t("ui/notifications/request-teardown"),params:s({}).optional()}),nt=s({experimental:s({}).optional().describe("Experimental features (structure TBD)."),openLinks:s({}).optional().describe("Host supports opening external URLs."),downloadFile:s({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:s({listChanged:f().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:s({listChanged:f().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:s({}).optional().describe("Host accepts log messages."),sandbox:s({permissions:re.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:ie.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:ce.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:ce.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:s({tools:s({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),at=s({experimental:s({}).optional().describe("Experimental features (structure TBD)."),tools:s({listChanged:f().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:u(T).optional().describe("Display modes the app supports.")}),lt=s({method:t("ui/notifications/initialized"),params:s({}).optional()});s({csp:ie.optional().describe("Content Security Policy configuration for UI resources."),permissions:re.optional().describe("Sandbox permissions requested by the UI resource."),domain:a().optional().describe(`Dedicated origin for view sandbox.
33
33
 
34
34
  Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
35
35
 
@@ -37,22 +37,22 @@ Useful when views need stable, dedicated origins for OAuth callbacks, CORS polic
37
37
  - Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
38
38
  - URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
39
39
 
40
- If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:g().optional().describe(`Visual boundary preference - true if view prefers a visible border.
40
+ If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:f().optional().describe(`Visual boundary preference - true if view prefers a visible border.
41
41
 
42
42
  Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
43
43
 
44
44
  - \`true\`: request visible border + background
45
45
  - \`false\`: request no visible border + background
46
- - omitted: host decides border`)});var ue=s({method:t("ui/request-display-mode"),params:s({mode:T.describe("The display mode being requested.")})});s({mode:T.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough();var gt=p([t("model"),t("app")]).describe("Tool visibility scope - who can access the tool.");s({resourceUri:l().optional(),visibility:u(gt).optional().describe(`Who can access this tool. Default: ["model", "app"]
46
+ - omitted: host decides border`)});var de=s({method:t("ui/request-display-mode"),params:s({mode:T.describe("The display mode being requested.")})});s({mode:T.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough();var ct=p([t("model"),t("app")]).describe("Tool visibility scope - who can access the tool.");s({resourceUri:a().optional(),visibility:u(ct).optional().describe(`Who can access this tool. Default: ["model", "app"]
47
47
  - "model": Tool visible to and callable by the agent
48
- - "app": Tool callable by the app from this server only`),csp:B().optional(),permissions:B().optional()});s({mimeTypes:u(l()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});var bt=s({method:t("ui/download-file"),params:s({contents:u(p([ye,ve])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),yt=s({method:t("ui/message"),params:s({role:t("user").describe('Message role, currently only "user" is supported.'),content:u(V).describe("Message content blocks (text, image, etc.).")})});s({method:t("ui/notifications/sandbox-resource-ready"),params:s({html:l().describe("HTML content to load into the inner iframe."),sandbox:l().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:ne.optional().describe("CSP configuration from resource metadata."),permissions:ae.optional().describe("Sandbox permissions from resource metadata.")})});s({method:t("ui/notifications/tool-result"),params:j.describe("Standard MCP tool execution result.")});var Se=s({toolInfo:s({id:we.optional().describe("JSON-RPC id of the tools/call request."),tool:xe.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:st.optional().describe("Current color theme preference."),styles:dt.optional().describe("Style configuration for theming the app."),displayMode:T.optional().describe("How the UI is currently displayed."),availableDisplayModes:u(T).optional().describe("Display modes the host supports."),containerDimensions:p([s({height:f().describe("Fixed container height in pixels.")}),s({maxHeight:p([f(),P()]).optional().describe("Maximum container height in pixels.")})]).and(p([s({width:f().describe("Fixed container width in pixels.")}),s({maxWidth:p([f(),P()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
49
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:l().optional().describe("User's language and region preference in BCP 47 format."),timeZone:l().optional().describe("User's timezone in IANA format."),userAgent:l().optional().describe("Host application identifier."),platform:p([t("web"),t("desktop"),t("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:s({touch:g().optional().describe("Whether the device supports touch input."),hover:g().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:s({top:f().describe("Top safe area inset in pixels."),right:f().describe("Right safe area inset in pixels."),bottom:f().describe("Bottom safe area inset in pixels."),left:f().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough();s({method:t("ui/notifications/host-context-changed"),params:Se.describe("Partial context update containing only changed fields.")});var vt=s({method:t("ui/update-model-context"),params:s({content:u(V).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:b(l(),x().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),xt=s({method:t("ui/initialize"),params:s({appInfo:W.describe("App identification (name and version)."),appCapabilities:mt.describe("Features and capabilities this app provides."),protocolVersion:l().describe("Protocol version this app supports.")})});s({protocolVersion:l().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:W.describe("Host application identification and version."),hostCapabilities:ht.describe("Features and capabilities provided by the host."),hostContext:Se.describe("Rich context about the host environment.")}).passthrough();class wt{eventTarget;eventSource;messageListener;constructor(e=window.parent,o){this.eventTarget=e,this.eventSource=o,this.messageListener=i=>{if(o&&i.source!==this.eventSource){console.debug("Ignoring message from unknown source",i);return}let r=Ke.safeParse(i.data);r.success?(console.debug("Parsed message",r.data),this.onmessage?.(r.data)):i.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",r.error.message,i):(console.error("Failed to parse message",r.error.message,i),this.onerror?.(Error("Invalid JSON-RPC message received: "+r.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(e,o){e.method!==ot&&console.debug("Sending message",e),this.eventTarget.postMessage(e,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var Rt="ui/resourceUri";function Ct(n){let e=n._meta?.ui?.resourceUri;if(e===void 0&&(e=n._meta?.[Rt]),typeof e=="string"&&e.startsWith("ui://"))return e;if(e!==void 0)throw Error(`Invalid UI resource URI: ${JSON.stringify(e)}`)}var St=[Ce];class _t extends tt{_client;_hostInfo;_capabilities;_appCapabilities;_hostContext={};_appInfo;_initializedReceived=!1;_baseReplaceRequestHandler=this.replaceRequestHandler;replaceRequestHandler=(e,o)=>{this._baseReplaceRequestHandler(e,(i,r)=>(this._initializedReceived||console.warn(`[ext-apps] AppBridge received '${i.method}' before ui/notifications/initialized. The View is calling host methods before completing the handshake; it should await app.connect() first.`),o(i,r)))};eventSchemas={sizechange:lt,sandboxready:at,initialized:ft,requestteardown:ut,loggingmessage:Te};constructor(e,o,i,r){super(r),this._client=e,this._hostInfo=o,this._capabilities=i,this.addEventListener("initialized",()=>{this._initializedReceived=!0}),this._hostContext=r?.hostContext||{},this.setRequestHandler(xt,a=>this._oninitialize(a)),this.setRequestHandler(Ie,(a,c)=>(this.onping?.(a.params,c),{})),this.replaceRequestHandler(ue,a=>({mode:this._hostContext.displayMode??"inline"}))}getAppCapabilities(){return this._appCapabilities}getAppVersion(){return this._appInfo}onping;get onsizechange(){return this.getEventHandler("sizechange")}set onsizechange(e){this.setEventHandler("sizechange",e)}get onsandboxready(){return this.getEventHandler("sandboxready")}set onsandboxready(e){this.setEventHandler("sandboxready",e)}get oninitialized(){return this.getEventHandler("initialized")}set oninitialized(e){this.setEventHandler("initialized",e)}_onmessage;get onmessage(){return this._onmessage}set onmessage(e){this.warnIfRequestHandlerReplaced("onmessage",this._onmessage,e),this._onmessage=e,this.replaceRequestHandler(yt,async(o,i)=>{if(!this._onmessage)throw Error("No onmessage handler set");return this._onmessage(o.params,i)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(e){this.warnIfRequestHandlerReplaced("onopenlink",this._onopenlink,e),this._onopenlink=e,this.replaceRequestHandler(nt,async(o,i)=>{if(!this._onopenlink)throw Error("No onopenlink handler set");return this._onopenlink(o.params,i)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(e){this.warnIfRequestHandlerReplaced("ondownloadfile",this._ondownloadfile,e),this._ondownloadfile=e,this.replaceRequestHandler(bt,async(o,i)=>{if(!this._ondownloadfile)throw Error("No ondownloadfile handler set");return this._ondownloadfile(o.params,i)})}get onrequestteardown(){return this.getEventHandler("requestteardown")}set onrequestteardown(e){this.setEventHandler("requestteardown",e)}_onrequestdisplaymode;get onrequestdisplaymode(){return this._onrequestdisplaymode}set onrequestdisplaymode(e){this.warnIfRequestHandlerReplaced("onrequestdisplaymode",this._onrequestdisplaymode,e),this._onrequestdisplaymode=e,this.replaceRequestHandler(ue,async(o,i)=>{if(!this._onrequestdisplaymode)throw Error("No onrequestdisplaymode handler set");return this._onrequestdisplaymode(o.params,i)})}get onloggingmessage(){return this.getEventHandler("loggingmessage")}set onloggingmessage(e){this.setEventHandler("loggingmessage",e)}_onupdatemodelcontext;get onupdatemodelcontext(){return this._onupdatemodelcontext}set onupdatemodelcontext(e){this.warnIfRequestHandlerReplaced("onupdatemodelcontext",this._onupdatemodelcontext,e),this._onupdatemodelcontext=e,this.replaceRequestHandler(vt,async(o,i)=>{if(!this._onupdatemodelcontext)throw Error("No onupdatemodelcontext handler set");return this._onupdatemodelcontext(o.params,i)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(Ee,async(o,i)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(o.params,i)})}set oncreatesamplingmessage(e){this.setRequestHandler(Le,async(o,i)=>e(o.params,i))}sendToolListChanged(e={}){return this.notification({method:"notifications/tools/list_changed",params:e})}_onlistresources;get onlistresources(){return this._onlistresources}set onlistresources(e){this.warnIfRequestHandlerReplaced("onlistresources",this._onlistresources,e),this._onlistresources=e,this.replaceRequestHandler(ze,async(o,i)=>{if(!this._onlistresources)throw Error("No onlistresources handler set");return this._onlistresources(o.params,i)})}_onlistresourcetemplates;get onlistresourcetemplates(){return this._onlistresourcetemplates}set onlistresourcetemplates(e){this.warnIfRequestHandlerReplaced("onlistresourcetemplates",this._onlistresourcetemplates,e),this._onlistresourcetemplates=e,this.replaceRequestHandler(De,async(o,i)=>{if(!this._onlistresourcetemplates)throw Error("No onlistresourcetemplates handler set");return this._onlistresourcetemplates(o.params,i)})}_onreadresource;get onreadresource(){return this._onreadresource}set onreadresource(e){this.warnIfRequestHandlerReplaced("onreadresource",this._onreadresource,e),this._onreadresource=e,this.replaceRequestHandler(Ne,async(o,i)=>{if(!this._onreadresource)throw Error("No onreadresource handler set");return this._onreadresource(o.params,i)})}sendResourceListChanged(e={}){return this.notification({method:"notifications/resources/list_changed",params:e})}_onlistprompts;get onlistprompts(){return this._onlistprompts}set onlistprompts(e){this.warnIfRequestHandlerReplaced("onlistprompts",this._onlistprompts,e),this._onlistprompts=e,this.replaceRequestHandler(Ue,async(o,i)=>{if(!this._onlistprompts)throw Error("No onlistprompts handler set");return this._onlistprompts(o.params,i)})}sendPromptListChanged(e={}){return this.notification({method:"notifications/prompts/list_changed",params:e})}assertCapabilityForMethod(e){}assertRequestHandlerCapability(e){}assertNotificationCapability(e){}assertTaskCapability(e){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(e){throw Error("Task handlers are not supported in MCP Apps")}getCapabilities(){return this._capabilities}async _oninitialize(e){let o=e.params.protocolVersion;return this._appInfo!==void 0&&console.warn("[ext-apps] AppBridge received a second ui/initialize. The View may be double-mounting (e.g. React StrictMode in dev) without closing the previous App instance. Responding normally; the latest appInfo/appCapabilities replace the previous values."),this._appCapabilities=e.params.appCapabilities,this._appInfo=e.params.appInfo,{protocolVersion:St.includes(o)?o:Ce,hostCapabilities:this.getCapabilities(),hostInfo:this._hostInfo,hostContext:this._hostContext}}setHostContext(e){let o={},i=!1;for(let r of Object.keys(e)){let a=this._hostContext[r],c=e[r];Ht(a,c)||(o[r]=c,i=!0)}i&&(this._hostContext=e,this.sendHostContextChange(o))}sendHostContextChange(e){return this.notification({method:"ui/notifications/host-context-changed",params:e})}sendToolInput(e){return this.notification({method:"ui/notifications/tool-input",params:e})}sendToolInputPartial(e){return this.notification({method:"ui/notifications/tool-input-partial",params:e})}sendToolResult(e){return this.notification({method:"ui/notifications/tool-result",params:e})}sendToolCancelled(e){return this.notification({method:"ui/notifications/tool-cancelled",params:e})}sendSandboxResourceReady(e){return this.notification({method:"ui/notifications/sandbox-resource-ready",params:e})}teardownResource(e,o){return this.request({method:"ui/resource-teardown",params:e},pt,o)}sendResourceTeardown=this.teardownResource;callTool(e,o){return this.request({method:"tools/call",params:e},j,o)}listTools(e,o){return this.request({method:"tools/list",params:e},Ae,o)}async connect(e){if(this.transport)throw Error("AppBridge is already connected. Call close() before connecting again.");if(this._initializedReceived=!1,this._client){let o=this._client.getServerCapabilities();if(!o)throw Error("Client server capabilities not available");o.tools&&(this.oncalltool=async(i,r)=>this._client.request({method:"tools/call",params:i},j,{signal:r.signal}),o.tools.listChanged&&this._client.setNotificationHandler(Oe,i=>this.sendToolListChanged(i.params))),o.resources&&(this.onlistresources=async(i,r)=>this._client.request({method:"resources/list",params:i},$e,{signal:r.signal}),this.onlistresourcetemplates=async(i,r)=>this._client.request({method:"resources/templates/list",params:i},Be,{signal:r.signal}),this.onreadresource=async(i,r)=>this._client.request({method:"resources/read",params:i},je,{signal:r.signal}),o.resources.listChanged&&this._client.setNotificationHandler(Fe,i=>this.sendResourceListChanged(i.params))),o.prompts&&(this.onlistprompts=async(i,r)=>this._client.request({method:"prompts/list",params:i},Ve,{signal:r.signal}),o.prompts.listChanged&&this._client.setNotificationHandler(We,i=>this.sendPromptListChanged(i.params)))}return super.connect(e)}}function Ht(n,e){return JSON.stringify(n)===JSON.stringify(e)}(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var Mt=p([t("light"),t("dark")]).describe("Color theme preference for the host environment."),I=p([t("inline"),t("fullscreen"),t("pip")]).describe("Display mode for UI presentation."),kt=p([t("--color-background-primary"),t("--color-background-secondary"),t("--color-background-tertiary"),t("--color-background-inverse"),t("--color-background-ghost"),t("--color-background-info"),t("--color-background-danger"),t("--color-background-success"),t("--color-background-warning"),t("--color-background-disabled"),t("--color-text-primary"),t("--color-text-secondary"),t("--color-text-tertiary"),t("--color-text-inverse"),t("--color-text-ghost"),t("--color-text-info"),t("--color-text-danger"),t("--color-text-success"),t("--color-text-warning"),t("--color-text-disabled"),t("--color-border-primary"),t("--color-border-secondary"),t("--color-border-tertiary"),t("--color-border-inverse"),t("--color-border-ghost"),t("--color-border-info"),t("--color-border-danger"),t("--color-border-success"),t("--color-border-warning"),t("--color-border-disabled"),t("--color-ring-primary"),t("--color-ring-secondary"),t("--color-ring-inverse"),t("--color-ring-info"),t("--color-ring-danger"),t("--color-ring-success"),t("--color-ring-warning"),t("--font-sans"),t("--font-mono"),t("--font-weight-normal"),t("--font-weight-medium"),t("--font-weight-semibold"),t("--font-weight-bold"),t("--font-text-xs-size"),t("--font-text-sm-size"),t("--font-text-md-size"),t("--font-text-lg-size"),t("--font-heading-xs-size"),t("--font-heading-sm-size"),t("--font-heading-md-size"),t("--font-heading-lg-size"),t("--font-heading-xl-size"),t("--font-heading-2xl-size"),t("--font-heading-3xl-size"),t("--font-text-xs-line-height"),t("--font-text-sm-line-height"),t("--font-text-md-line-height"),t("--font-text-lg-line-height"),t("--font-heading-xs-line-height"),t("--font-heading-sm-line-height"),t("--font-heading-md-line-height"),t("--font-heading-lg-line-height"),t("--font-heading-xl-line-height"),t("--font-heading-2xl-line-height"),t("--font-heading-3xl-line-height"),t("--border-radius-xs"),t("--border-radius-sm"),t("--border-radius-md"),t("--border-radius-lg"),t("--border-radius-xl"),t("--border-radius-full"),t("--border-width-regular"),t("--shadow-hairline"),t("--shadow-sm"),t("--shadow-md"),t("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),qt=b(kt.describe(`Style variables for theming MCP apps.
48
+ - "app": Tool callable by the app from this server only`),csp:O().optional(),permissions:O().optional()});s({mimeTypes:u(a()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});var dt=s({method:t("ui/download-file"),params:s({contents:u(p([fe,ge])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),pt=s({method:t("ui/message"),params:s({role:t("user").describe('Message role, currently only "user" is supported.'),content:u($).describe("Message content blocks (text, image, etc.).")})});s({method:t("ui/notifications/sandbox-resource-ready"),params:s({html:a().describe("HTML content to load into the inner iframe."),sandbox:a().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:ie.optional().describe("CSP configuration from resource metadata."),permissions:re.optional().describe("Sandbox permissions from resource metadata.")})});s({method:t("ui/notifications/tool-result"),params:j.describe("Standard MCP tool execution result.")});var xe=s({toolInfo:s({id:ye.optional().describe("JSON-RPC id of the tools/call request."),tool:be.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:Ye.optional().describe("Current color theme preference."),styles:st.optional().describe("Style configuration for theming the app."),displayMode:T.optional().describe("How the UI is currently displayed."),availableDisplayModes:u(T).optional().describe("Display modes the host supports."),containerDimensions:p([s({height:m().describe("Fixed container height in pixels.")}),s({maxHeight:p([m(),q()]).optional().describe("Maximum container height in pixels.")})]).and(p([s({width:m().describe("Fixed container width in pixels.")}),s({maxWidth:p([m(),q()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
49
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:a().optional().describe("User's language and region preference in BCP 47 format."),timeZone:a().optional().describe("User's timezone in IANA format."),userAgent:a().optional().describe("Host application identifier."),platform:p([t("web"),t("desktop"),t("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:s({touch:f().optional().describe("Whether the device supports touch input."),hover:f().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:s({top:m().describe("Top safe area inset in pixels."),right:m().describe("Right safe area inset in pixels."),bottom:m().describe("Bottom safe area inset in pixels."),left:m().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough();s({method:t("ui/notifications/host-context-changed"),params:xe.describe("Partial context update containing only changed fields.")});var ut=s({method:t("ui/update-model-context"),params:s({content:u($).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:y(a(),x().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),ht=s({method:t("ui/initialize"),params:s({appInfo:B.describe("App identification (name and version)."),appCapabilities:at.describe("Features and capabilities this app provides."),protocolVersion:a().describe("Protocol version this app supports.")})});s({protocolVersion:a().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:B.describe("Host application identification and version."),hostCapabilities:nt.describe("Features and capabilities provided by the host."),hostContext:xe.describe("Rich context about the host environment.")}).passthrough();class mt{eventTarget;eventSource;messageListener;constructor(e=window.parent,o){this.eventTarget=e,this.eventSource=o,this.messageListener=i=>{if(o&&i.source!==this.eventSource){console.debug("Ignoring message from unknown source",i);return}let n=Oe.safeParse(i.data);n.success?(console.debug("Parsed message",n.data),this.onmessage?.(n.data)):i.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",n.error.message,i):(console.error("Failed to parse message",n.error.message,i),this.onerror?.(Error("Invalid JSON-RPC message received: "+n.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(e,o){e.method!==Je&&console.debug("Sending message",e),this.eventTarget.postMessage(e,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var ft="ui/resourceUri";function gt(r){let e=r._meta?.ui?.resourceUri;if(e===void 0&&(e=r._meta?.[ft]),typeof e=="string"&&e.startsWith("ui://"))return e;if(e!==void 0)throw Error(`Invalid UI resource URI: ${JSON.stringify(e)}`)}var bt=[ve];class yt extends Ze{_client;_hostInfo;_capabilities;_appCapabilities;_hostContext={};_appInfo;_initializedReceived=!1;_baseReplaceRequestHandler=this.replaceRequestHandler;replaceRequestHandler=(e,o)=>{this._baseReplaceRequestHandler(e,(i,n)=>(this._initializedReceived||console.warn(`[ext-apps] AppBridge received '${i.method}' before ui/notifications/initialized. The View is calling host methods before completing the handshake; it should await app.connect() first.`),o(i,n)))};eventSchemas={sizechange:tt,sandboxready:et,initialized:lt,requestteardown:rt,loggingmessage:Se};constructor(e,o,i,n){super(n),this._client=e,this._hostInfo=o,this._capabilities=i,this.addEventListener("initialized",()=>{this._initializedReceived=!0}),this._hostContext=n?.hostContext||{},this.setRequestHandler(ht,l=>this._oninitialize(l)),this.setRequestHandler(_e,(l,c)=>(this.onping?.(l.params,c),{})),this.replaceRequestHandler(de,l=>({mode:this._hostContext.displayMode??"inline"}))}getAppCapabilities(){return this._appCapabilities}getAppVersion(){return this._appInfo}onping;get onsizechange(){return this.getEventHandler("sizechange")}set onsizechange(e){this.setEventHandler("sizechange",e)}get onsandboxready(){return this.getEventHandler("sandboxready")}set onsandboxready(e){this.setEventHandler("sandboxready",e)}get oninitialized(){return this.getEventHandler("initialized")}set oninitialized(e){this.setEventHandler("initialized",e)}_onmessage;get onmessage(){return this._onmessage}set onmessage(e){this.warnIfRequestHandlerReplaced("onmessage",this._onmessage,e),this._onmessage=e,this.replaceRequestHandler(pt,async(o,i)=>{if(!this._onmessage)throw Error("No onmessage handler set");return this._onmessage(o.params,i)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(e){this.warnIfRequestHandlerReplaced("onopenlink",this._onopenlink,e),this._onopenlink=e,this.replaceRequestHandler(Xe,async(o,i)=>{if(!this._onopenlink)throw Error("No onopenlink handler set");return this._onopenlink(o.params,i)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(e){this.warnIfRequestHandlerReplaced("ondownloadfile",this._ondownloadfile,e),this._ondownloadfile=e,this.replaceRequestHandler(dt,async(o,i)=>{if(!this._ondownloadfile)throw Error("No ondownloadfile handler set");return this._ondownloadfile(o.params,i)})}get onrequestteardown(){return this.getEventHandler("requestteardown")}set onrequestteardown(e){this.setEventHandler("requestteardown",e)}_onrequestdisplaymode;get onrequestdisplaymode(){return this._onrequestdisplaymode}set onrequestdisplaymode(e){this.warnIfRequestHandlerReplaced("onrequestdisplaymode",this._onrequestdisplaymode,e),this._onrequestdisplaymode=e,this.replaceRequestHandler(de,async(o,i)=>{if(!this._onrequestdisplaymode)throw Error("No onrequestdisplaymode handler set");return this._onrequestdisplaymode(o.params,i)})}get onloggingmessage(){return this.getEventHandler("loggingmessage")}set onloggingmessage(e){this.setEventHandler("loggingmessage",e)}_onupdatemodelcontext;get onupdatemodelcontext(){return this._onupdatemodelcontext}set onupdatemodelcontext(e){this.warnIfRequestHandlerReplaced("onupdatemodelcontext",this._onupdatemodelcontext,e),this._onupdatemodelcontext=e,this.replaceRequestHandler(ut,async(o,i)=>{if(!this._onupdatemodelcontext)throw Error("No onupdatemodelcontext handler set");return this._onupdatemodelcontext(o.params,i)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(He,async(o,i)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(o.params,i)})}set oncreatesamplingmessage(e){this.setRequestHandler(Me,async(o,i)=>e(o.params,i))}sendToolListChanged(e={}){return this.notification({method:"notifications/tools/list_changed",params:e})}_onlistresources;get onlistresources(){return this._onlistresources}set onlistresources(e){this.warnIfRequestHandlerReplaced("onlistresources",this._onlistresources,e),this._onlistresources=e,this.replaceRequestHandler(ke,async(o,i)=>{if(!this._onlistresources)throw Error("No onlistresources handler set");return this._onlistresources(o.params,i)})}_onlistresourcetemplates;get onlistresourcetemplates(){return this._onlistresourcetemplates}set onlistresourcetemplates(e){this.warnIfRequestHandlerReplaced("onlistresourcetemplates",this._onlistresourcetemplates,e),this._onlistresourcetemplates=e,this.replaceRequestHandler(Pe,async(o,i)=>{if(!this._onlistresourcetemplates)throw Error("No onlistresourcetemplates handler set");return this._onlistresourcetemplates(o.params,i)})}_onreadresource;get onreadresource(){return this._onreadresource}set onreadresource(e){this.warnIfRequestHandlerReplaced("onreadresource",this._onreadresource,e),this._onreadresource=e,this.replaceRequestHandler(qe,async(o,i)=>{if(!this._onreadresource)throw Error("No onreadresource handler set");return this._onreadresource(o.params,i)})}sendResourceListChanged(e={}){return this.notification({method:"notifications/resources/list_changed",params:e})}_onlistprompts;get onlistprompts(){return this._onlistprompts}set onlistprompts(e){this.warnIfRequestHandlerReplaced("onlistprompts",this._onlistprompts,e),this._onlistprompts=e,this.replaceRequestHandler(Te,async(o,i)=>{if(!this._onlistprompts)throw Error("No onlistprompts handler set");return this._onlistprompts(o.params,i)})}sendPromptListChanged(e={}){return this.notification({method:"notifications/prompts/list_changed",params:e})}assertCapabilityForMethod(e){}assertRequestHandlerCapability(e){}assertNotificationCapability(e){}assertTaskCapability(e){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(e){throw Error("Task handlers are not supported in MCP Apps")}getCapabilities(){return this._capabilities}async _oninitialize(e){let o=e.params.protocolVersion;return this._appInfo!==void 0&&console.warn("[ext-apps] AppBridge received a second ui/initialize. The View may be double-mounting (e.g. React StrictMode in dev) without closing the previous App instance. Responding normally; the latest appInfo/appCapabilities replace the previous values."),this._appCapabilities=e.params.appCapabilities,this._appInfo=e.params.appInfo,{protocolVersion:bt.includes(o)?o:ve,hostCapabilities:this.getCapabilities(),hostInfo:this._hostInfo,hostContext:this._hostContext}}setHostContext(e){let o={},i=!1;for(let n of Object.keys(e)){let l=this._hostContext[n],c=e[n];vt(l,c)||(o[n]=c,i=!0)}i&&(this._hostContext=e,this.sendHostContextChange(o))}sendHostContextChange(e){return this.notification({method:"ui/notifications/host-context-changed",params:e})}sendToolInput(e){return this.notification({method:"ui/notifications/tool-input",params:e})}sendToolInputPartial(e){return this.notification({method:"ui/notifications/tool-input-partial",params:e})}sendToolResult(e){return this.notification({method:"ui/notifications/tool-result",params:e})}sendToolCancelled(e){return this.notification({method:"ui/notifications/tool-cancelled",params:e})}sendSandboxResourceReady(e){return this.notification({method:"ui/notifications/sandbox-resource-ready",params:e})}teardownResource(e,o){return this.request({method:"ui/resource-teardown",params:e},it,o)}sendResourceTeardown=this.teardownResource;callTool(e,o){return this.request({method:"tools/call",params:e},j,o)}listTools(e,o){return this.request({method:"tools/list",params:e},Ie,o)}async connect(e){if(this.transport)throw Error("AppBridge is already connected. Call close() before connecting again.");if(this._initializedReceived=!1,this._client){let o=this._client.getServerCapabilities();if(!o)throw Error("Client server capabilities not available");o.tools&&(this.oncalltool=async(i,n)=>this._client.request({method:"tools/call",params:i},j,{signal:n.signal}),o.tools.listChanged&&this._client.setNotificationHandler(Ee,i=>this.sendToolListChanged(i.params))),o.resources&&(this.onlistresources=async(i,n)=>this._client.request({method:"resources/list",params:i},Le,{signal:n.signal}),this.onlistresourcetemplates=async(i,n)=>this._client.request({method:"resources/templates/list",params:i},ze,{signal:n.signal}),this.onreadresource=async(i,n)=>this._client.request({method:"resources/read",params:i},Ue,{signal:n.signal}),o.resources.listChanged&&this._client.setNotificationHandler(Ae,i=>this.sendResourceListChanged(i.params))),o.prompts&&(this.onlistprompts=async(i,n)=>this._client.request({method:"prompts/list",params:i},De,{signal:n.signal}),o.prompts.listChanged&&this._client.setNotificationHandler(Ne,i=>this.sendPromptListChanged(i.params)))}return super.connect(e)}}function vt(r,e){return JSON.stringify(r)===JSON.stringify(e)}(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var xt=p([t("light"),t("dark")]).describe("Color theme preference for the host environment."),I=p([t("inline"),t("fullscreen"),t("pip")]).describe("Display mode for UI presentation."),wt=p([t("--color-background-primary"),t("--color-background-secondary"),t("--color-background-tertiary"),t("--color-background-inverse"),t("--color-background-ghost"),t("--color-background-info"),t("--color-background-danger"),t("--color-background-success"),t("--color-background-warning"),t("--color-background-disabled"),t("--color-text-primary"),t("--color-text-secondary"),t("--color-text-tertiary"),t("--color-text-inverse"),t("--color-text-ghost"),t("--color-text-info"),t("--color-text-danger"),t("--color-text-success"),t("--color-text-warning"),t("--color-text-disabled"),t("--color-border-primary"),t("--color-border-secondary"),t("--color-border-tertiary"),t("--color-border-inverse"),t("--color-border-ghost"),t("--color-border-info"),t("--color-border-danger"),t("--color-border-success"),t("--color-border-warning"),t("--color-border-disabled"),t("--color-ring-primary"),t("--color-ring-secondary"),t("--color-ring-inverse"),t("--color-ring-info"),t("--color-ring-danger"),t("--color-ring-success"),t("--color-ring-warning"),t("--font-sans"),t("--font-mono"),t("--font-weight-normal"),t("--font-weight-medium"),t("--font-weight-semibold"),t("--font-weight-bold"),t("--font-text-xs-size"),t("--font-text-sm-size"),t("--font-text-md-size"),t("--font-text-lg-size"),t("--font-heading-xs-size"),t("--font-heading-sm-size"),t("--font-heading-md-size"),t("--font-heading-lg-size"),t("--font-heading-xl-size"),t("--font-heading-2xl-size"),t("--font-heading-3xl-size"),t("--font-text-xs-line-height"),t("--font-text-sm-line-height"),t("--font-text-md-line-height"),t("--font-text-lg-line-height"),t("--font-heading-xs-line-height"),t("--font-heading-sm-line-height"),t("--font-heading-md-line-height"),t("--font-heading-lg-line-height"),t("--font-heading-xl-line-height"),t("--font-heading-2xl-line-height"),t("--font-heading-3xl-line-height"),t("--border-radius-xs"),t("--border-radius-sm"),t("--border-radius-md"),t("--border-radius-lg"),t("--border-radius-xl"),t("--border-radius-full"),t("--border-width-regular"),t("--shadow-hairline"),t("--shadow-sm"),t("--shadow-md"),t("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),Ct=y(wt.describe(`Style variables for theming MCP apps.
50
50
 
51
51
  Individual style keys are optional - hosts may provide any subset of these values.
52
52
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
53
53
 
54
54
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
55
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),p([l(),P()]).describe(`Style variables for theming MCP apps.
55
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),p([a(),q()]).describe(`Style variables for theming MCP apps.
56
56
 
57
57
  Individual style keys are optional - hosts may provide any subset of these values.
58
58
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
@@ -64,10 +64,10 @@ Individual style keys are optional - hosts may provide any subset of these value
64
64
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
65
65
 
66
66
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
67
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);s({method:t("ui/open-link"),params:s({url:l().describe("URL to open in the host's browser")})});s({isError:g().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough();s({isError:g().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough();s({isError:g().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();s({method:t("ui/notifications/sandbox-proxy-ready"),params:s({})});var le=s({connectDomains:u(l()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
67
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);s({method:t("ui/open-link"),params:s({url:a().describe("URL to open in the host's browser")})});s({isError:f().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough();s({isError:f().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough();s({isError:f().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();s({method:t("ui/notifications/sandbox-proxy-ready"),params:s({})});var ne=s({connectDomains:u(a()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
68
68
 
69
69
  - Maps to CSP \`connect-src\` directive
70
- - Empty or omitted → no network connections (secure default)`),resourceDomains:u(l()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:u(l()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:u(l()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),ce=s({camera:s({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:s({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:s({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:s({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")});s({method:t("ui/notifications/size-changed"),params:s({width:f().optional().describe("New width in pixels."),height:f().optional().describe("New height in pixels.")})});s({method:t("ui/notifications/tool-input"),params:s({arguments:b(l(),x().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})});s({method:t("ui/notifications/tool-input-partial"),params:s({arguments:b(l(),x().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})});s({method:t("ui/notifications/tool-cancelled"),params:s({reason:l().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})});var Pt=s({fonts:l().optional()}),Tt=s({variables:qt.optional().describe("CSS variables for theming the app."),css:Pt.optional().describe("CSS blocks that apps can inject.")});s({method:t("ui/resource-teardown"),params:s({})});b(l(),x());var he=s({text:s({}).optional().describe("Host supports text content blocks."),image:s({}).optional().describe("Host supports image content blocks."),audio:s({}).optional().describe("Host supports audio content blocks."),resource:s({}).optional().describe("Host supports resource content blocks."),resourceLink:s({}).optional().describe("Host supports resource link content blocks."),structuredContent:s({}).optional().describe("Host supports structured content.")});s({method:t("ui/notifications/request-teardown"),params:s({}).optional()});var It=s({experimental:s({}).optional().describe("Experimental features (structure TBD)."),openLinks:s({}).optional().describe("Host supports opening external URLs."),downloadFile:s({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:s({listChanged:g().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:s({listChanged:g().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:s({}).optional().describe("Host accepts log messages."),sandbox:s({permissions:ce.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:le.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:he.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:he.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:s({tools:s({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),Et=s({experimental:s({}).optional().describe("Experimental features (structure TBD)."),tools:s({listChanged:g().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:u(I).optional().describe("Display modes the app supports.")});s({method:t("ui/notifications/initialized"),params:s({}).optional()});s({csp:le.optional().describe("Content Security Policy configuration for UI resources."),permissions:ce.optional().describe("Sandbox permissions requested by the UI resource."),domain:l().optional().describe(`Dedicated origin for view sandbox.
70
+ - Empty or omitted → no network connections (secure default)`),resourceDomains:u(a()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:u(a()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:u(a()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),ae=s({camera:s({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:s({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:s({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:s({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")});s({method:t("ui/notifications/size-changed"),params:s({width:m().optional().describe("New width in pixels."),height:m().optional().describe("New height in pixels.")})});s({method:t("ui/notifications/tool-input"),params:s({arguments:y(a(),x().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})});s({method:t("ui/notifications/tool-input-partial"),params:s({arguments:y(a(),x().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})});s({method:t("ui/notifications/tool-cancelled"),params:s({reason:a().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})});var Rt=s({fonts:a().optional()}),St=s({variables:Ct.optional().describe("CSS variables for theming the app."),css:Rt.optional().describe("CSS blocks that apps can inject.")});s({method:t("ui/resource-teardown"),params:s({})});y(a(),x());var pe=s({text:s({}).optional().describe("Host supports text content blocks."),image:s({}).optional().describe("Host supports image content blocks."),audio:s({}).optional().describe("Host supports audio content blocks."),resource:s({}).optional().describe("Host supports resource content blocks."),resourceLink:s({}).optional().describe("Host supports resource link content blocks."),structuredContent:s({}).optional().describe("Host supports structured content.")});s({method:t("ui/notifications/request-teardown"),params:s({}).optional()});var _t=s({experimental:s({}).optional().describe("Experimental features (structure TBD)."),openLinks:s({}).optional().describe("Host supports opening external URLs."),downloadFile:s({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:s({listChanged:f().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:s({listChanged:f().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:s({}).optional().describe("Host accepts log messages."),sandbox:s({permissions:ae.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:ne.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:pe.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:pe.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:s({tools:s({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),Ht=s({experimental:s({}).optional().describe("Experimental features (structure TBD)."),tools:s({listChanged:f().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:u(I).optional().describe("Display modes the app supports.")});s({method:t("ui/notifications/initialized"),params:s({}).optional()});s({csp:ne.optional().describe("Content Security Policy configuration for UI resources."),permissions:ae.optional().describe("Sandbox permissions requested by the UI resource."),domain:a().optional().describe(`Dedicated origin for view sandbox.
71
71
 
72
72
  Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
73
73
 
@@ -75,13 +75,13 @@ Useful when views need stable, dedicated origins for OAuth callbacks, CORS polic
75
75
  - Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
76
76
  - URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
77
77
 
78
- If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:g().optional().describe(`Visual boundary preference - true if view prefers a visible border.
78
+ If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:f().optional().describe(`Visual boundary preference - true if view prefers a visible border.
79
79
 
80
80
  Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
81
81
 
82
82
  - \`true\`: request visible border + background
83
83
  - \`false\`: request no visible border + background
84
- - omitted: host decides border`)});s({method:t("ui/request-display-mode"),params:s({mode:I.describe("The display mode being requested.")})});s({mode:I.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough();var Lt=p([t("model"),t("app")]).describe("Tool visibility scope - who can access the tool.");s({resourceUri:l().optional(),visibility:u(Lt).optional().describe(`Who can access this tool. Default: ["model", "app"]
84
+ - omitted: host decides border`)});s({method:t("ui/request-display-mode"),params:s({mode:I.describe("The display mode being requested.")})});s({mode:I.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough();var Mt=p([t("model"),t("app")]).describe("Tool visibility scope - who can access the tool.");s({resourceUri:a().optional(),visibility:u(Mt).optional().describe(`Who can access this tool. Default: ["model", "app"]
85
85
  - "model": Tool visible to and callable by the agent
86
- - "app": Tool callable by the app from this server only`),csp:B().optional(),permissions:B().optional()});s({mimeTypes:u(l()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});s({method:t("ui/download-file"),params:s({contents:u(p([ye,ve])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});s({method:t("ui/message"),params:s({role:t("user").describe('Message role, currently only "user" is supported.'),content:u(V).describe("Message content blocks (text, image, etc.).")})});s({method:t("ui/notifications/sandbox-resource-ready"),params:s({html:l().describe("HTML content to load into the inner iframe."),sandbox:l().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:le.optional().describe("CSP configuration from resource metadata."),permissions:ce.optional().describe("Sandbox permissions from resource metadata.")})});s({method:t("ui/notifications/tool-result"),params:j.describe("Standard MCP tool execution result.")});var _e=s({toolInfo:s({id:we.optional().describe("JSON-RPC id of the tools/call request."),tool:xe.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:Mt.optional().describe("Current color theme preference."),styles:Tt.optional().describe("Style configuration for theming the app."),displayMode:I.optional().describe("How the UI is currently displayed."),availableDisplayModes:u(I).optional().describe("Display modes the host supports."),containerDimensions:p([s({height:f().describe("Fixed container height in pixels.")}),s({maxHeight:p([f(),P()]).optional().describe("Maximum container height in pixels.")})]).and(p([s({width:f().describe("Fixed container width in pixels.")}),s({maxWidth:p([f(),P()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
87
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:l().optional().describe("User's language and region preference in BCP 47 format."),timeZone:l().optional().describe("User's timezone in IANA format."),userAgent:l().optional().describe("Host application identifier."),platform:p([t("web"),t("desktop"),t("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:s({touch:g().optional().describe("Whether the device supports touch input."),hover:g().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:s({top:f().describe("Top safe area inset in pixels."),right:f().describe("Right safe area inset in pixels."),bottom:f().describe("Bottom safe area inset in pixels."),left:f().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough();s({method:t("ui/notifications/host-context-changed"),params:_e.describe("Partial context update containing only changed fields.")});s({method:t("ui/update-model-context"),params:s({content:u(V).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:b(l(),x().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});s({method:t("ui/initialize"),params:s({appInfo:W.describe("App identification (name and version)."),appCapabilities:Et.describe("Features and capabilities this app provides."),protocolVersion:l().describe("Protocol version this app supports.")})});s({protocolVersion:l().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:W.describe("Host application identification and version."),hostCapabilities:It.describe("Features and capabilities provided by the host."),hostContext:_e.describe("Rich context about the host environment.")}).passthrough();function zt(){let n=document.documentElement.getAttribute("data-theme");return n==="dark"||n==="light"?n:document.documentElement.classList.contains("dark")?"dark":"light"}const Dt=[["--background","--color-background-primary"],["--muted","--color-background-secondary"],["--accent","--color-background-tertiary"],["--destructive","--color-background-danger"],["--success","--color-background-success"],["--warning","--color-background-warning"],["--foreground","--color-text-primary"],["--muted-foreground","--color-text-secondary"],["--accent-foreground","--color-text-tertiary"],["--destructive-foreground","--color-text-danger"],["--success-foreground","--color-text-success"],["--warning-foreground","--color-text-warning"],["--border","--color-border-primary"],["--input","--color-border-secondary"],["--ring","--color-ring-primary"],["--font-sans","--font-sans"],["--font-mono","--font-mono"],["--font-weight-normal","--font-weight-normal"],["--font-weight-medium","--font-weight-medium"],["--font-weight-semibold","--font-weight-semibold"],["--font-weight-bold","--font-weight-bold"],["--radius","--border-radius-md"],["--default-border-width","--border-width-regular"],["--shadow-sm","--shadow-sm"],["--shadow-md","--shadow-md"],["--shadow-lg","--shadow-lg"]];function Nt(){if(typeof document>"u")return{};const n=getComputedStyle(document.documentElement),e={};for(const[o,i]of Dt){const r=n.getPropertyValue(o).trim();r&&(e[i]=r)}return{variables:e}}const Ut={name:"MCP Mesh",version:"1.0.0"},At={openLinks:{},serverTools:{},serverResources:{},logging:{},message:{},downloadFile:{},updateModelContext:{text:{}}},Ot=15e3;function $t(){return typeof navigator>"u"?"en":navigator.language??"en"}function Bt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}function jt(){return typeof navigator>"u"?"web":/Mobi|Android/i.test(navigator.userAgent)?"mobile":"web"}function me(n,e,o,i){return{theme:zt(),styles:Nt(),displayMode:n,availableDisplayModes:["inline","fullscreen"],locale:$t(),timeZone:Bt(),platform:jt(),...e!=null&&{toolInfo:e},...o!=null&&{containerDimensions:{maxHeight:o}},...i!=null&&{orgId:i}}}const ie=new Set;let fe=!1;function Ft(){if(fe||typeof document>"u")return;fe=!0;const n=()=>ie.forEach(e=>e());new MutationObserver(n).observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",n)}function Vt(n){return ie.add(n),Ft(),()=>ie.delete(n)}class Wt{bridge=null;timeout=null;disposed=!1;unsubTheme=null;snapshot;listeners=new Set;config;constructor(e){this.config=e,this.snapshot=Object.freeze({height:e.minHeight,isLoading:!0,error:null})}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snapshot;updateConfig(e){const o=this.config;this.config=e,!(!this.bridge||this.disposed)&&(e.displayMode!==o.displayMode&&this.pushHostContext(),e.toolInput!==o.toolInput&&e.toolInput!=null&&this.bridge.sendToolInput({arguments:e.toolInput}),e.toolResult!==o.toolResult&&e.toolResult!=null&&this.bridge.sendToolResult(e.toolResult))}pushHostContext(){if(!this.bridge||this.disposed)return;const{displayMode:e,maxHeight:o,toolInfo:i,orgId:r}=this.config;this.bridge.setHostContext(me(e,i,o,r))}set(e){const o=this.snapshot,i={...o,...e};if(!(i.height===o.height&&i.isLoading===o.isLoading&&i.error===o.error)){this.snapshot=Object.freeze(i);for(const r of this.listeners)r()}}teardown(){(this.bridge||this.timeout||this.unsubTheme)&&this.config.onTeardown?.(),this.disposed=!0,this.unsubTheme?.(),this.unsubTheme=null,this.bridge&&(this.bridge.teardownResource({}).catch(()=>{}),this.bridge.close(),this.bridge=null),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}attach=e=>{if(this.teardown(),this.disposed=!1,this.set({height:this.config.minHeight,isLoading:!0,error:null}),!!e){e.onerror=()=>{this.disposed||this.set({error:"Failed to load app",isLoading:!1})};try{const{client:o,displayMode:i,maxHeight:r,toolInfo:a,orgId:c}=this.config,d=me(i,a,r,c),h=new _t(o,Ut,At,{hostContext:d});this.bridge=h,this.registerHandlers(h),this.startInitTimeout(),this.registerInitHandler(h),this.connectTransport(h,e),this.unsubTheme=Vt(()=>this.pushHostContext())}catch(o){this.clearTimeout(),console.error("Failed to create AppBridge:",o),this.set({error:o instanceof Error?o.message:"Unknown error",isLoading:!1})}}};registerHandlers(e){e.onopenlink=async({url:o})=>{let i=null;try{i=new URL(o)}catch{}if(!i||!["http:","https:"].includes(i.protocol))throw new Error("Only http and https URLs are allowed");return window.open(o,"_blank","noopener,noreferrer"),{}},e.onmessage=async o=>(this.config.onMessage?.(o),{}),e.onupdatemodelcontext=async o=>(this.config.onUpdateModelContext?.(o),{}),e.onsizechange=({height:o})=>{if(!this.disposed&&o!=null){const{minHeight:i,maxHeight:r}=this.config;this.set({height:Math.max(i,Math.min(r,o))})}},e.onloggingmessage=({level:o,data:i})=>{console[o==="error"?"error":"debug"](`[MCP App ${this.config.toolInfo?.tool.name??"unknown"}]`,i)},e.onrequestdisplaymode=async({mode:o})=>({mode:this.config.onRequestDisplayMode?await this.config.onRequestDisplayMode(o):this.config.displayMode}),e.ondownloadfile=async({contents:o})=>{for(const i of o)if(i.type==="resource"){const r=i.resource,a="blob"in r?new Blob([Uint8Array.from(atob(r.blob),h=>h.charCodeAt(0))],{type:r.mimeType}):new Blob([r.text??""],{type:r.mimeType}),c=URL.createObjectURL(a),d=document.createElement("a");d.href=c,d.download=r.uri.split("/").pop()??"download",d.click(),URL.revokeObjectURL(c)}else i.type==="resource_link"&&window.open(i.uri,"_blank");return{}}}registerInitHandler(e){e.oninitialized=()=>{if(this.disposed)return;this.clearTimeout(),this.set({isLoading:!1});const{toolInput:o,toolResult:i}=this.config;o!=null&&e.sendToolInput({arguments:o}),i!=null&&e.sendToolResult(i)}}startInitTimeout(){this.timeout=setTimeout(()=>{this.disposed||this.set({error:"App took too long to load",isLoading:!1})},Ot)}clearTimeout(){this.timeout&&(globalThis.clearTimeout(this.timeout),this.timeout=null)}connectTransport(e,o){if(!o.contentWindow){console.warn("iframe contentWindow not yet available");return}const i=new wt(o.contentWindow,o.contentWindow);e.connect(i).catch(r=>{this.disposed||(this.clearTimeout(),console.error("AppBridge connect failed:",r),this.set({error:r instanceof Error?r.message:"Connection failed",isLoading:!1}))})}}function Kt(n){const e=oe.useRef(new Wt(n));oe.useEffect(()=>{e.current.updateConfig(n)},[n]);const{height:o,isLoading:i,error:r}=oe.useSyncExternalStore(e.current.subscribe,e.current.getSnapshot);return{height:o,isLoading:i,error:r,iframeRef:e.current.attach}}const ge=new Set;function Zt(n){const e=n?.contents?.[0];return!e||!("text"in e)||!e.text?null:Ge(e.text,{resourceCsp:e._meta?.ui?.csp})}function Xt(n){const e=F.c(42),{resourceURI:o,orgId:i,toolInfo:r,toolInput:a,toolResult:c,displayMode:d,minHeight:h,maxHeight:y,client:m,onMessage:E,onUpdateModelContext:K,onTeardown:Z,onRequestDisplayMode:J,className:R}=n,w=d===void 0?"inline":d,Q=h===void 0?150:h,Y=y===void 0?600:y;let L;e[0]!==m||e[1]!==o?(L={client:m,uri:o,staleTime:3e4},e[0]=m,e[1]=o,e[2]=L):L=e[2];const{data:He}=Ye(L),z=Zt(He);o&&!ge.has(o)&&(ge.add(o),Ze("mcp_app_opened",{resource_uri:o,display_mode:w,tool_name:r?.tool?.name??null}));let D;e[3]!==m||e[4]!==w||e[5]!==Y||e[6]!==Q||e[7]!==E||e[8]!==J||e[9]!==Z||e[10]!==K||e[11]!==i||e[12]!==r||e[13]!==a||e[14]!==c?(D={client:m,displayMode:w,minHeight:Q,maxHeight:Y,orgId:i,toolInfo:r,toolInput:a,toolResult:c,onMessage:E,onUpdateModelContext:K,onTeardown:Z,onRequestDisplayMode:J},e[3]=m,e[4]=w,e[5]=Y,e[6]=Q,e[7]=E,e[8]=J,e[9]=Z,e[10]=K,e[11]=i,e[12]=r,e[13]=a,e[14]=c,e[15]=D):D=e[15];const{height:G,isLoading:N,error:U,iframeRef:X}=Kt(D);if(!z)return null;if(U){let k;e[16]!==R?(k=se("flex items-center justify-center p-4 text-destructive bg-destructive/10 rounded-lg",R),e[16]=R,e[17]=k):k=e[17];let q;e[18]!==U?(q=v.jsx("span",{className:"text-sm",children:U}),e[18]=U,e[19]=q):q=e[19];let O;return e[20]!==k||e[21]!==q?(O=v.jsx("div",{className:k,children:q}),e[20]=k,e[21]=q,e[22]=O):O=e[22],O}const Me=r?.tool.name;let C;e[23]!==R?(C=se("relative w-full overflow-hidden rounded-lg",R),e[23]=R,e[24]=C):C=e[24];let S;e[25]!==w||e[26]!==G?(S=w!=="fullscreen"?{height:`${G}px`}:void 0,e[25]=w,e[26]=G,e[27]=S):S=e[27];let _;e[28]!==N?(_=N&&v.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background z-10",children:v.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[v.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),v.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),e[28]=N,e[29]=_):_=e[29];const ee=N&&"invisible";let H;e[30]!==ee?(H=se("w-full h-full border-0",ee),e[30]=ee,e[31]=H):H=e[31];const te=`MCP App: ${Me??o}`;let M;e[32]!==z||e[33]!==X||e[34]!==H||e[35]!==te?(M=v.jsx("iframe",{ref:X,srcDoc:z,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups",className:H,title:te}),e[32]=z,e[33]=X,e[34]=H,e[35]=te,e[36]=M):M=e[36];let A;return e[37]!==M||e[38]!==C||e[39]!==S||e[40]!==_?(A=v.jsxs("div",{className:C,style:S,children:[_,M]}),e[37]=M,e[38]=C,e[39]=S,e[40]=_,e[41]=A):A=e[41],A}const eo={view:{minHeight:400,maxHeight:800},fullscreen:{minHeight:600,maxHeight:1200}};function to(n){if(!(n==null||typeof n!="object"))try{return Ct({_meta:n})}catch{return}}export{Xt as M,Gt as a,eo as b,to as g,Re as l,Qe as r,Yt as u};
86
+ - "app": Tool callable by the app from this server only`),csp:O().optional(),permissions:O().optional()});s({mimeTypes:u(a()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});s({method:t("ui/download-file"),params:s({contents:u(p([fe,ge])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});s({method:t("ui/message"),params:s({role:t("user").describe('Message role, currently only "user" is supported.'),content:u($).describe("Message content blocks (text, image, etc.).")})});s({method:t("ui/notifications/sandbox-resource-ready"),params:s({html:a().describe("HTML content to load into the inner iframe."),sandbox:a().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:ne.optional().describe("CSP configuration from resource metadata."),permissions:ae.optional().describe("Sandbox permissions from resource metadata.")})});s({method:t("ui/notifications/tool-result"),params:j.describe("Standard MCP tool execution result.")});var we=s({toolInfo:s({id:ye.optional().describe("JSON-RPC id of the tools/call request."),tool:be.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:xt.optional().describe("Current color theme preference."),styles:St.optional().describe("Style configuration for theming the app."),displayMode:I.optional().describe("How the UI is currently displayed."),availableDisplayModes:u(I).optional().describe("Display modes the host supports."),containerDimensions:p([s({height:m().describe("Fixed container height in pixels.")}),s({maxHeight:p([m(),q()]).optional().describe("Maximum container height in pixels.")})]).and(p([s({width:m().describe("Fixed container width in pixels.")}),s({maxWidth:p([m(),q()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
87
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:a().optional().describe("User's language and region preference in BCP 47 format."),timeZone:a().optional().describe("User's timezone in IANA format."),userAgent:a().optional().describe("Host application identifier."),platform:p([t("web"),t("desktop"),t("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:s({touch:f().optional().describe("Whether the device supports touch input."),hover:f().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:s({top:m().describe("Top safe area inset in pixels."),right:m().describe("Right safe area inset in pixels."),bottom:m().describe("Bottom safe area inset in pixels."),left:m().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough();s({method:t("ui/notifications/host-context-changed"),params:we.describe("Partial context update containing only changed fields.")});s({method:t("ui/update-model-context"),params:s({content:u($).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:y(a(),x().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});s({method:t("ui/initialize"),params:s({appInfo:B.describe("App identification (name and version)."),appCapabilities:Ht.describe("Features and capabilities this app provides."),protocolVersion:a().describe("Protocol version this app supports.")})});s({protocolVersion:a().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:B.describe("Host application identification and version."),hostCapabilities:_t.describe("Features and capabilities provided by the host."),hostContext:we.describe("Rich context about the host environment.")}).passthrough();function kt(){let r=document.documentElement.getAttribute("data-theme");return r==="dark"||r==="light"?r:document.documentElement.classList.contains("dark")?"dark":"light"}const Pt=[["--background","--color-background-primary"],["--muted","--color-background-secondary"],["--accent","--color-background-tertiary"],["--destructive","--color-background-danger"],["--success","--color-background-success"],["--warning","--color-background-warning"],["--foreground","--color-text-primary"],["--muted-foreground","--color-text-secondary"],["--accent-foreground","--color-text-tertiary"],["--destructive-foreground","--color-text-danger"],["--success-foreground","--color-text-success"],["--warning-foreground","--color-text-warning"],["--border","--color-border-primary"],["--input","--color-border-secondary"],["--ring","--color-ring-primary"],["--font-sans","--font-sans"],["--font-mono","--font-mono"],["--font-weight-normal","--font-weight-normal"],["--font-weight-medium","--font-weight-medium"],["--font-weight-semibold","--font-weight-semibold"],["--font-weight-bold","--font-weight-bold"],["--radius","--border-radius-md"],["--default-border-width","--border-width-regular"],["--shadow-sm","--shadow-sm"],["--shadow-md","--shadow-md"],["--shadow-lg","--shadow-lg"]];function qt(){if(typeof document>"u")return{};const r=getComputedStyle(document.documentElement),e={};for(const[o,i]of Pt){const n=r.getPropertyValue(o).trim();n&&(e[i]=n)}return{variables:e}}const Tt={name:"MCP Mesh",version:"1.0.0"},It={openLinks:{},serverTools:{},serverResources:{},logging:{},message:{},downloadFile:{},updateModelContext:{text:{}}},Et=15e3;function Lt(){return typeof navigator>"u"?"en":navigator.language??"en"}function zt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}function Ut(){return typeof navigator>"u"?"web":/Mobi|Android/i.test(navigator.userAgent)?"mobile":"web"}function ue(r,e,o,i){return{theme:kt(),styles:qt(),displayMode:r,availableDisplayModes:["inline","fullscreen"],locale:Lt(),timeZone:zt(),platform:Ut(),...e!=null&&{toolInfo:e},...o!=null&&{containerDimensions:{maxHeight:o}},...i!=null&&{orgId:i}}}const se=new Set;let he=!1;function At(){if(he||typeof document>"u")return;he=!0;const r=()=>se.forEach(e=>e());new MutationObserver(r).observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r)}function Dt(r){return se.add(r),At(),()=>se.delete(r)}class Nt{bridge=null;timeout=null;disposed=!1;unsubTheme=null;snapshot;listeners=new Set;config;constructor(e){this.config=e,this.snapshot=Object.freeze({height:e.minHeight,isLoading:!0,error:null})}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snapshot;updateConfig(e){const o=this.config;this.config=e,!(!this.bridge||this.disposed)&&(e.displayMode!==o.displayMode&&this.pushHostContext(),e.toolInput!==o.toolInput&&e.toolInput!=null&&this.bridge.sendToolInput({arguments:e.toolInput}),e.toolResult!==o.toolResult&&e.toolResult!=null&&this.bridge.sendToolResult(e.toolResult))}pushHostContext(){if(!this.bridge||this.disposed)return;const{displayMode:e,maxHeight:o,toolInfo:i,orgId:n}=this.config;this.bridge.setHostContext(ue(e,i,o,n))}set(e){const o=this.snapshot,i={...o,...e};if(!(i.height===o.height&&i.isLoading===o.isLoading&&i.error===o.error)){this.snapshot=Object.freeze(i);for(const n of this.listeners)n()}}teardown(){(this.bridge||this.timeout||this.unsubTheme)&&this.config.onTeardown?.(),this.disposed=!0,this.unsubTheme?.(),this.unsubTheme=null,this.bridge&&(this.bridge.teardownResource({}).catch(()=>{}),this.bridge.close(),this.bridge=null),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}attach=e=>{if(this.teardown(),this.disposed=!1,this.set({height:this.config.minHeight,isLoading:!0,error:null}),!!e){e.onerror=()=>{this.disposed||this.set({error:"Failed to load app",isLoading:!1})};try{const{client:o,displayMode:i,maxHeight:n,toolInfo:l,orgId:c}=this.config,d=ue(i,l,n,c),h=new yt(o,Tt,It,{hostContext:d});this.bridge=h,this.registerHandlers(h),this.startInitTimeout(),this.registerInitHandler(h),this.connectTransport(h,e),this.unsubTheme=Dt(()=>this.pushHostContext())}catch(o){this.clearTimeout(),console.error("Failed to create AppBridge:",o),this.set({error:o instanceof Error?o.message:"Unknown error",isLoading:!1})}}};registerHandlers(e){e.onopenlink=async({url:o})=>{let i=null;try{i=new URL(o)}catch{}if(!i||!["http:","https:"].includes(i.protocol))throw new Error("Only http and https URLs are allowed");return window.open(o,"_blank","noopener,noreferrer"),{}},e.onmessage=async o=>(this.config.onMessage?.(o),{}),e.onupdatemodelcontext=async o=>(this.config.onUpdateModelContext?.(o),{}),e.onsizechange=({height:o})=>{if(!this.disposed&&o!=null){const{minHeight:i,maxHeight:n}=this.config;this.set({height:Math.max(i,Math.min(n,o))})}},e.onloggingmessage=({level:o,data:i})=>{console[o==="error"?"error":"debug"](`[MCP App ${this.config.toolInfo?.tool.name??"unknown"}]`,i)},e.onrequestdisplaymode=async({mode:o})=>({mode:this.config.onRequestDisplayMode?await this.config.onRequestDisplayMode(o):this.config.displayMode}),e.ondownloadfile=async({contents:o})=>{for(const i of o)if(i.type==="resource"){const n=i.resource,l="blob"in n?new Blob([Uint8Array.from(atob(n.blob),h=>h.charCodeAt(0))],{type:n.mimeType}):new Blob([n.text??""],{type:n.mimeType}),c=URL.createObjectURL(l),d=document.createElement("a");d.href=c,d.download=n.uri.split("/").pop()??"download",d.click(),URL.revokeObjectURL(c)}else i.type==="resource_link"&&window.open(i.uri,"_blank");return{}}}registerInitHandler(e){e.oninitialized=()=>{if(this.disposed)return;this.clearTimeout(),this.set({isLoading:!1});const{toolInput:o,toolResult:i}=this.config;o!=null&&e.sendToolInput({arguments:o}),i!=null&&e.sendToolResult(i)}}startInitTimeout(){this.timeout=setTimeout(()=>{this.disposed||this.set({error:"App took too long to load",isLoading:!1})},Et)}clearTimeout(){this.timeout&&(globalThis.clearTimeout(this.timeout),this.timeout=null)}connectTransport(e,o){if(!o.contentWindow){console.warn("iframe contentWindow not yet available");return}const i=new mt(o.contentWindow,o.contentWindow);e.connect(i).catch(n=>{this.disposed||(this.clearTimeout(),console.error("AppBridge connect failed:",n),this.set({error:n instanceof Error?n.message:"Connection failed",isLoading:!1}))})}}function Ot(r){const e=te.useRef(new Nt(r));te.useEffect(()=>{e.current.updateConfig(r)},[r]);const{height:o,isLoading:i,error:n}=te.useSyncExternalStore(e.current.subscribe,e.current.getSnapshot);return{height:o,isLoading:i,error:n,iframeRef:e.current.attach}}const me=new Set;function jt(r){const e=r?.contents?.[0];return!e||!("text"in e)||!e.text?null:We(e.text,{resourceCsp:e._meta?.ui?.csp})}function Ce(r){const e=V.c(39),{html:o,uri:i,orgId:n,toolInfo:l,toolInput:c,toolResult:d,displayMode:h,minHeight:v,maxHeight:g,client:E,onMessage:W,onUpdateModelContext:F,onTeardown:K,onRequestDisplayMode:Z,className:C}=r,w=h===void 0?"inline":h,J=v===void 0?150:v,Y=g===void 0?600:g;i&&!me.has(i)&&(me.add(i),Be("mcp_app_opened",{resource_uri:i,display_mode:w,tool_name:l?.tool?.name??null}));let L;e[0]!==E||e[1]!==w||e[2]!==Y||e[3]!==J||e[4]!==W||e[5]!==Z||e[6]!==K||e[7]!==F||e[8]!==n||e[9]!==l||e[10]!==c||e[11]!==d?(L={client:E,displayMode:w,minHeight:J,maxHeight:Y,orgId:n,toolInfo:l,toolInput:c,toolResult:d,onMessage:W,onUpdateModelContext:F,onTeardown:K,onRequestDisplayMode:Z},e[0]=E,e[1]=w,e[2]=Y,e[3]=J,e[4]=W,e[5]=Z,e[6]=K,e[7]=F,e[8]=n,e[9]=l,e[10]=c,e[11]=d,e[12]=L):L=e[12];const{height:Q,isLoading:z,error:U,iframeRef:G}=Ot(L);if(!o)return null;if(U){let k;e[13]!==C?(k=oe("flex items-center justify-center p-4 text-destructive bg-destructive/10 rounded-lg",C),e[13]=C,e[14]=k):k=e[14];let P;e[15]!==U?(P=b.jsx("span",{className:"text-sm",children:U}),e[15]=U,e[16]=P):P=e[16];let D;return e[17]!==k||e[18]!==P?(D=b.jsx("div",{className:k,children:P}),e[17]=k,e[18]=P,e[19]=D):D=e[19],D}const Re=l?.tool.name;let R;e[20]!==C?(R=oe("relative w-full overflow-hidden rounded-lg",C),e[20]=C,e[21]=R):R=e[21];let S;e[22]!==w||e[23]!==Q?(S=w!=="fullscreen"?{height:`${Q}px`}:void 0,e[22]=w,e[23]=Q,e[24]=S):S=e[24];let _;e[25]!==z?(_=z&&b.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background z-10",children:b.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[b.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),b.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),e[25]=z,e[26]=_):_=e[26];const X=z&&"invisible";let H;e[27]!==X?(H=oe("w-full h-full border-0",X),e[27]=X,e[28]=H):H=e[28];const ee=`MCP App: ${Re??i}`;let M;e[29]!==o||e[30]!==G||e[31]!==ee||e[32]!==H?(M=b.jsx("iframe",{ref:G,srcDoc:o,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups",className:H,title:ee}),e[29]=o,e[30]=G,e[31]=ee,e[32]=H,e[33]=M):M=e[33];let A;return e[34]!==M||e[35]!==R||e[36]!==S||e[37]!==_?(A=b.jsxs("div",{className:R,style:S,children:[_,M]}),e[34]=M,e[35]=R,e[36]=S,e[37]=_,e[38]=A):A=e[38],A}function $t(r){const e=V.c(13);let o,i,n,l;e[0]!==r?({resourceURI:l,orgSlug:n,connectionId:o,...i}=r,e[0]=r,e[1]=o,e[2]=i,e[3]=n,e[4]=l):(o=e[1],i=e[2],n=e[3],l=e[4]);let c;e[5]!==o||e[6]!==n||e[7]!==l?(c={orgSlug:n,connectionId:o,uri:l,staleTime:3e4},e[5]=o,e[6]=n,e[7]=l,e[8]=c):c=e[8];const d=je(c);let h;return e[9]!==i||e[10]!==d.data||e[11]!==l?(h=b.jsx(Ce,{html:d.data,uri:l,...i}),e[9]=i,e[10]=d.data,e[11]=l,e[12]=h):h=e[12],h}function Bt(r){const e=V.c(10);let o,i;e[0]!==r?({resourceURI:i,...o}=r,e[0]=r,e[1]=o,e[2]=i):(o=e[1],i=e[2]);let n;e[3]!==o.client||e[4]!==i?(n={client:o.client,uri:i,staleTime:3e4},e[3]=o.client,e[4]=i,e[5]=n):n=e[5];const{data:l}=$e(n),c=jt(l);let d;return e[6]!==o||e[7]!==c||e[8]!==i?(d=b.jsx(Ce,{html:c,uri:i,...o}),e[6]=o,e[7]=c,e[8]=i,e[9]=d):d=e[9],d}function Ft(r){const e=V.c(4);if(r.orgSlug&&r.connectionId){let i;return e[0]!==r?(i=b.jsx($t,{...r,orgSlug:r.orgSlug,connectionId:r.connectionId}),e[0]=r,e[1]=i):i=e[1],i}let o;return e[2]!==r?(o=b.jsx(Bt,{...r}),e[2]=r,e[3]=o):o=e[3],o}const Kt={view:{minHeight:400,maxHeight:800},fullscreen:{minHeight:600,maxHeight:1200}};function Zt(r){if(!(r==null||typeof r!="object"))try{return gt({_meta:r})}catch{return}}export{Ft as M,Kt as a,Zt as g};
@@ -1 +1 @@
1
- import{e as g,q as f,s as _,K as m,n as I}from"./index-8Av7_XG5.js";import{S,u as P}from"./constants-DeFtLUND.js";function A(t,e){return{queryKey:m.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>(await t.callTool({name:"AI_PROVIDER_KEY_LIST",arguments:{}})).structuredContent??null}}function q(){const t=g.c(10),{org:e}=f();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:S,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const o=P(s);let i;t[3]!==e.id?(i=m.aiProviders(e.id),t[3]=e.id,t[4]=i):i=t[4];let l;t[5]!==o?(l=async()=>(await o.callTool({name:"AI_PROVIDERS_LIST",arguments:{}})).structuredContent,t[5]=o,t[6]=l):l=t[6];let n;t[7]!==i||t[8]!==l?(n={queryKey:i,staleTime:1/0,queryFn:l},t[7]=i,t[8]=l,t[9]=n):n=t[9];const{data:r}=_(n);return r}function v(){const t=g.c(8),{org:e}=f();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:S,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const o=P(s);let i;t[3]!==o||t[4]!==e.id?(i=A(o,e.id),t[3]=o,t[4]=e.id,t[5]=i):i=t[5];const{data:l}=_(i);let n;return t[6]!==l?.keys?(n=l?.keys??[],t[6]=l?.keys,t[7]=n):n=t[7],n}function R(t){const e=g.c(18),{org:s}=f();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:S,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const i=P(o);let l;e[3]!==t||e[4]!==s.id?(l=m.aiProviderModels(s.id,t??""),e[3]=t,e[4]=s.id,e[5]=l):l=e[5];const n=!!t;let r;e[6]!==i||e[7]!==t?(r=async()=>(await i.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:t}})).structuredContent??null,e[6]=i,e[7]=t,e[8]=r):r=e[8];let u;e[9]!==l||e[10]!==n||e[11]!==r?(u={queryKey:l,enabled:n,staleTime:6e4,queryFn:r},e[9]=l,e[10]=n,e[11]=r,e[12]=u):u=e[12];const{data:c,isLoading:T}=I(u);let a;e[13]!==c?.models?(a=c?.models??[],e[13]=c?.models,e[14]=a):a=e[14];const y=!!t&&T;let d;return e[15]!==a||e[16]!==y?(d={models:a,isLoading:y},e[15]=a,e[16]=y,e[17]=d):d=e[17],d}function p(t){const e=g.c(14),{org:s}=f();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:S,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const i=P(o);let l;e[3]!==t||e[4]!==s.id?(l=m.aiProviderModels(s.id,t),e[3]=t,e[4]=s.id,e[5]=l):l=e[5];let n;e[6]!==i||e[7]!==t?(n=async()=>(await i.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:t}})).structuredContent??null,e[6]=i,e[7]=t,e[8]=n):n=e[8];let r;e[9]!==l||e[10]!==n?(r={queryKey:l,staleTime:6e4,queryFn:n},e[9]=l,e[10]=n,e[11]=r):r=e[11];const{data:u}=_(r);let c;return e[12]!==u?.models?(c=u?.models??[],e[12]=u?.models,e[13]=c):c=e[13],c}export{A as a,R as b,q as c,p as d,v as u};
1
+ import{e as g,q as f,s as _,K as m,n as I}from"./index-Cpkh2ZIG.js";import{S,u as P}from"./constants-Oa_3OHe_.js";function A(t,e){return{queryKey:m.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>(await t.callTool({name:"AI_PROVIDER_KEY_LIST",arguments:{}})).structuredContent??null}}function q(){const t=g.c(10),{org:e}=f();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:S,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const o=P(s);let i;t[3]!==e.id?(i=m.aiProviders(e.id),t[3]=e.id,t[4]=i):i=t[4];let l;t[5]!==o?(l=async()=>(await o.callTool({name:"AI_PROVIDERS_LIST",arguments:{}})).structuredContent,t[5]=o,t[6]=l):l=t[6];let n;t[7]!==i||t[8]!==l?(n={queryKey:i,staleTime:1/0,queryFn:l},t[7]=i,t[8]=l,t[9]=n):n=t[9];const{data:r}=_(n);return r}function v(){const t=g.c(8),{org:e}=f();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:S,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const o=P(s);let i;t[3]!==o||t[4]!==e.id?(i=A(o,e.id),t[3]=o,t[4]=e.id,t[5]=i):i=t[5];const{data:l}=_(i);let n;return t[6]!==l?.keys?(n=l?.keys??[],t[6]=l?.keys,t[7]=n):n=t[7],n}function R(t){const e=g.c(18),{org:s}=f();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:S,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const i=P(o);let l;e[3]!==t||e[4]!==s.id?(l=m.aiProviderModels(s.id,t??""),e[3]=t,e[4]=s.id,e[5]=l):l=e[5];const n=!!t;let r;e[6]!==i||e[7]!==t?(r=async()=>(await i.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:t}})).structuredContent??null,e[6]=i,e[7]=t,e[8]=r):r=e[8];let u;e[9]!==l||e[10]!==n||e[11]!==r?(u={queryKey:l,enabled:n,staleTime:6e4,queryFn:r},e[9]=l,e[10]=n,e[11]=r,e[12]=u):u=e[12];const{data:c,isLoading:T}=I(u);let a;e[13]!==c?.models?(a=c?.models??[],e[13]=c?.models,e[14]=a):a=e[14];const y=!!t&&T;let d;return e[15]!==a||e[16]!==y?(d={models:a,isLoading:y},e[15]=a,e[16]=y,e[17]=d):d=e[17],d}function p(t){const e=g.c(14),{org:s}=f();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:S,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const i=P(o);let l;e[3]!==t||e[4]!==s.id?(l=m.aiProviderModels(s.id,t),e[3]=t,e[4]=s.id,e[5]=l):l=e[5];let n;e[6]!==i||e[7]!==t?(n=async()=>(await i.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:t}})).structuredContent??null,e[6]=i,e[7]=t,e[8]=n):n=e[8];let r;e[9]!==l||e[10]!==n?(r={queryKey:l,staleTime:6e4,queryFn:n},e[9]=l,e[10]=n,e[11]=r):r=e[11];const{data:u}=_(r);let c;return e[12]!==u?.models?(c=u?.models??[],e[12]=u?.models,e[13]=c):c=e[13],c}export{A as a,R as b,q as c,p as d,v as u};
@@ -1 +1 @@
1
- import{e as q,q as U,K as T,n as x,F as V,a as f,o as g}from"./index-8Av7_XG5.js";import{S as D,u as G}from"./constants-DeFtLUND.js";function Y(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function st(t){const e=q.c(12),{org:s}=U(),o=t??D;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==o?(a={connectionId:o,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o,e[3]=a):a=e[3];const u=G(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let r;e[6]!==u?(r=async()=>{const d=await u.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(Y)},e[6]=u,e[7]=r):r=e[7];const l=!!t;let c;return e[8]!==n||e[9]!==r||e[10]!==l?(c={queryKey:n,queryFn:r,enabled:l,staleTime:3e4},e[8]=n,e[9]=r,e[10]=l,e[11]=c):c=e[11],x(c)}function nt(t){const e=q.c(12),{org:s}=U();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:D,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const a=G(o);let u;e[3]!==s.id||e[4]!==t?(u=T.automations(s.id,t),e[3]=s.id,e[4]=t,e[5]=u):u=e[5];let n;e[6]!==a||e[7]!==t?(n=async()=>{const l=t!=null?{virtual_mcp_id:t}:{},c=await a.callTool({name:"AUTOMATION_LIST",arguments:l});return(c.structuredContent??c).automations},e[6]=a,e[7]=t,e[8]=n):n=e[8];let r;return e[9]!==u||e[10]!==n?(r={queryKey:u,queryFn:n,staleTime:1e4},e[9]=u,e[10]=n,e[11]=r):r=e[11],x(r)}function ot(t){const e=q.c(13),{org:s}=U();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:D,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const a=G(o);let u;e[3]!==t||e[4]!==s.id?(u=T.automation(s.id,t),e[3]=t,e[4]=s.id,e[5]=u):u=e[5];let n;e[6]!==a||e[7]!==t?(n=async()=>{const c=await a.callTool({name:"AUTOMATION_GET",arguments:{id:t}});return(c.structuredContent??c).automation},e[6]=a,e[7]=t,e[8]=n):n=e[8];const r=!!t;let l;return e[9]!==u||e[10]!==n||e[11]!==r?(l={queryKey:u,queryFn:n,enabled:r,staleTime:1e4},e[9]=u,e[10]=n,e[11]=r,e[12]=l):l=e[12],x(l)}function it(t,e){const s=q.c(15),{org:o}=U();let a;s[0]!==o.id||s[1]!==o.slug?(a={connectionId:D,orgId:o.id,orgSlug:o.slug},s[0]=o.id,s[1]=o.slug,s[2]=a):a=s[2];const u=G(a);let n;s[3]!==t||s[4]!==o.id||s[5]!==e?(n=T.automationRunStats(o.id,t,JSON.stringify(e??{})),s[3]=t,s[4]=o.id,s[5]=e,s[6]=n):n=s[6];let r;s[7]!==t||s[8]!==u||s[9]!==e?(r=async()=>{const d=await u.callTool({name:"AUTOMATION_RUN_STATS",arguments:{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}});return d.structuredContent??d},s[7]=t,s[8]=u,s[9]=e,s[10]=r):r=s[10];const l=!!t;let c;return s[11]!==n||s[12]!==r||s[13]!==l?(c={queryKey:n,queryFn:r,enabled:l,staleTime:3e4},s[11]=n,s[12]=r,s[13]=l,s[14]=c):c=s[14],x(c)}function at(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function rt(){const t=q.c(67),{org:e}=U();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:D,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const o=G(s),a=V();let u;t[3]!==e.id||t[4]!==a?(u=()=>a.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[3]=e.id,t[4]=a,t[5]=u):u=t[5];const n=u;let r;t[6]!==e.id||t[7]!==a?(r=m=>a.invalidateQueries({queryKey:T.automation(e.id,m)}),t[6]=e.id,t[7]=a,t[8]=r):r=t[8];const l=r;let c;t[9]!==o?(c=async m=>{const i=await o.callTool({name:"AUTOMATION_CREATE",arguments:m});return i.structuredContent??i},t[9]=o,t[10]=c):c=t[10];let d;t[11]!==n?(d=()=>{n(),g.success("Automation created successfully")},t[11]=n,t[12]=d):d=t[12];let N;t[13]!==c||t[14]!==d?(N={mutationFn:c,onSuccess:d,onError:Z},t[13]=c,t[14]=d,t[15]=N):N=t[15];const k=f(N);let y;t[16]!==o?(y=async m=>{const i=await o.callTool({name:"AUTOMATION_UPDATE",arguments:m});return i.structuredContent??i},t[16]=o,t[17]=y):y=t[17];let _;t[18]!==n||t[19]!==l?(_=(m,i)=>{n(),typeof i.id=="string"&&l(i.id),g.success("Automation updated successfully")},t[18]=n,t[19]=l,t[20]=_):_=t[20];let $;t[21]!==y||t[22]!==_?($={mutationFn:y,onSuccess:_,onError:X},t[21]=y,t[22]=_,t[23]=$):$=t[23];const Q=f($);let A;t[24]!==o?(A=async m=>{const i=await o.callTool({name:"AUTOMATION_DELETE",arguments:{id:m}});return i.structuredContent??i},t[24]=o,t[25]=A):A=t[25];let p;t[26]!==n||t[27]!==e.id||t[28]!==a?(p=(m,i)=>{a.removeQueries({queryKey:T.automation(e.id,i)}),n(),g.success("Automation deleted successfully")},t[26]=n,t[27]=e.id,t[28]=a,t[29]=p):p=t[29];let K;t[30]!==p||t[31]!==A?(K={mutationFn:A,onSuccess:p,onError:W},t[30]=p,t[31]=A,t[32]=K):K=t[32];const j=f(K);let E;t[33]!==o?(E=async m=>{const i=await o.callTool({name:"AUTOMATION_TRIGGER_ADD",arguments:m});if(i.isError){const I=i.content?.[0]?.text??"Failed to add trigger";throw new Error(I)}return i.structuredContent??i},t[33]=o,t[34]=E):E=t[34];let S;t[35]!==n||t[36]!==l?(S=m=>{n(),l(m.automation_id)},t[35]=n,t[36]=l,t[37]=S):S=t[37];let w;t[38]!==E||t[39]!==S?(w={mutationFn:E,onSuccess:S},t[38]=E,t[39]=S,t[40]=w):w=t[40];const P=f(w);let O;t[41]!==o?(O=async m=>{const i=await o.callTool({name:"AUTOMATION_TRIGGER_ROTATE_TOKEN",arguments:{trigger_id:m.trigger_id}});if(i.isError){const I=i.content?.[0]?.text??"Failed to rotate token";throw new Error(I)}return i.structuredContent??i},t[41]=o,t[42]=O):O=t[42];let F;t[43]!==n||t[44]!==l?(F=(m,i)=>{n(),l(i.automation_id)},t[43]=n,t[44]=l,t[45]=F):F=t[45];let b;t[46]!==O||t[47]!==F?(b={mutationFn:O,onSuccess:F},t[46]=O,t[47]=F,t[48]=b):b=t[48];const v=f(b);let R;t[49]!==o?(R=async m=>{const i=await o.callTool({name:"AUTOMATION_TRIGGER_REMOVE",arguments:{trigger_id:m.trigger_id}});return i.structuredContent??i},t[49]=o,t[50]=R):R=t[50];let C;t[51]!==n||t[52]!==l?(C=(m,i)=>{n(),l(i.automation_id)},t[51]=n,t[52]=l,t[53]=C):C=t[53];let L;t[54]!==R||t[55]!==C?(L={mutationFn:R,onSuccess:C},t[54]=R,t[55]=C,t[56]=L):L=t[56];const z=f(L);let M;t[57]!==o?(M={mutationFn:async m=>{const i=await o.callTool({name:"AUTOMATION_RUN",arguments:{id:m}});if(i.isError){const I=i.content?.[0]?.text??"Failed to run automation";throw new Error(I)}return i.structuredContent??i},onSuccess:H,onError:B},t[57]=o,t[58]=M):M=t[58];const J=f(M);let h;return t[59]!==k||t[60]!==j||t[61]!==J||t[62]!==P||t[63]!==z||t[64]!==v||t[65]!==Q?(h={create:k,update:Q,remove:j,triggerAdd:P,triggerRemove:z,triggerRotateToken:v,run:J},t[59]=k,t[60]=j,t[61]=J,t[62]=P,t[63]=z,t[64]=v,t[65]=Q,t[66]=h):h=t[66],h}function B(t){const e=t instanceof Error?t.message:String(t);g.error(`Failed to run automation: ${e}`)}function H(t){t.skipped?g.info(`Automation skipped: ${t.skipped}`):t.error?g.error(`Automation failed: ${t.error}`):g.success("Automation triggered")}function W(t){const e=t instanceof Error?t.message:String(t);g.error(`Failed to delete automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);g.error(`Failed to update automation: ${e}`)}function Z(t){const e=t instanceof Error?t.message:String(t);g.error(`Failed to create automation: ${e}`)}export{st as a,ot as b,nt as c,at as d,it as e,rt as u};
1
+ import{e as q,q as U,K as T,n as x,G as V,a as f,o as g}from"./index-Cpkh2ZIG.js";import{S as D,u as G}from"./constants-Oa_3OHe_.js";function Y(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function st(t){const e=q.c(12),{org:s}=U(),o=t??D;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==o?(a={connectionId:o,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o,e[3]=a):a=e[3];const u=G(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let r;e[6]!==u?(r=async()=>{const d=await u.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(Y)},e[6]=u,e[7]=r):r=e[7];const l=!!t;let c;return e[8]!==n||e[9]!==r||e[10]!==l?(c={queryKey:n,queryFn:r,enabled:l,staleTime:3e4},e[8]=n,e[9]=r,e[10]=l,e[11]=c):c=e[11],x(c)}function nt(t){const e=q.c(12),{org:s}=U();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:D,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const a=G(o);let u;e[3]!==s.id||e[4]!==t?(u=T.automations(s.id,t),e[3]=s.id,e[4]=t,e[5]=u):u=e[5];let n;e[6]!==a||e[7]!==t?(n=async()=>{const l=t!=null?{virtual_mcp_id:t}:{},c=await a.callTool({name:"AUTOMATION_LIST",arguments:l});return(c.structuredContent??c).automations},e[6]=a,e[7]=t,e[8]=n):n=e[8];let r;return e[9]!==u||e[10]!==n?(r={queryKey:u,queryFn:n,staleTime:1e4},e[9]=u,e[10]=n,e[11]=r):r=e[11],x(r)}function ot(t){const e=q.c(13),{org:s}=U();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:D,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const a=G(o);let u;e[3]!==t||e[4]!==s.id?(u=T.automation(s.id,t),e[3]=t,e[4]=s.id,e[5]=u):u=e[5];let n;e[6]!==a||e[7]!==t?(n=async()=>{const c=await a.callTool({name:"AUTOMATION_GET",arguments:{id:t}});return(c.structuredContent??c).automation},e[6]=a,e[7]=t,e[8]=n):n=e[8];const r=!!t;let l;return e[9]!==u||e[10]!==n||e[11]!==r?(l={queryKey:u,queryFn:n,enabled:r,staleTime:1e4},e[9]=u,e[10]=n,e[11]=r,e[12]=l):l=e[12],x(l)}function it(t,e){const s=q.c(15),{org:o}=U();let a;s[0]!==o.id||s[1]!==o.slug?(a={connectionId:D,orgId:o.id,orgSlug:o.slug},s[0]=o.id,s[1]=o.slug,s[2]=a):a=s[2];const u=G(a);let n;s[3]!==t||s[4]!==o.id||s[5]!==e?(n=T.automationRunStats(o.id,t,JSON.stringify(e??{})),s[3]=t,s[4]=o.id,s[5]=e,s[6]=n):n=s[6];let r;s[7]!==t||s[8]!==u||s[9]!==e?(r=async()=>{const d=await u.callTool({name:"AUTOMATION_RUN_STATS",arguments:{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}});return d.structuredContent??d},s[7]=t,s[8]=u,s[9]=e,s[10]=r):r=s[10];const l=!!t;let c;return s[11]!==n||s[12]!==r||s[13]!==l?(c={queryKey:n,queryFn:r,enabled:l,staleTime:3e4},s[11]=n,s[12]=r,s[13]=l,s[14]=c):c=s[14],x(c)}function at(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function rt(){const t=q.c(67),{org:e}=U();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:D,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const o=G(s),a=V();let u;t[3]!==e.id||t[4]!==a?(u=()=>a.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[3]=e.id,t[4]=a,t[5]=u):u=t[5];const n=u;let r;t[6]!==e.id||t[7]!==a?(r=m=>a.invalidateQueries({queryKey:T.automation(e.id,m)}),t[6]=e.id,t[7]=a,t[8]=r):r=t[8];const l=r;let c;t[9]!==o?(c=async m=>{const i=await o.callTool({name:"AUTOMATION_CREATE",arguments:m});return i.structuredContent??i},t[9]=o,t[10]=c):c=t[10];let d;t[11]!==n?(d=()=>{n(),g.success("Automation created successfully")},t[11]=n,t[12]=d):d=t[12];let N;t[13]!==c||t[14]!==d?(N={mutationFn:c,onSuccess:d,onError:Z},t[13]=c,t[14]=d,t[15]=N):N=t[15];const k=f(N);let y;t[16]!==o?(y=async m=>{const i=await o.callTool({name:"AUTOMATION_UPDATE",arguments:m});return i.structuredContent??i},t[16]=o,t[17]=y):y=t[17];let _;t[18]!==n||t[19]!==l?(_=(m,i)=>{n(),typeof i.id=="string"&&l(i.id),g.success("Automation updated successfully")},t[18]=n,t[19]=l,t[20]=_):_=t[20];let $;t[21]!==y||t[22]!==_?($={mutationFn:y,onSuccess:_,onError:X},t[21]=y,t[22]=_,t[23]=$):$=t[23];const Q=f($);let A;t[24]!==o?(A=async m=>{const i=await o.callTool({name:"AUTOMATION_DELETE",arguments:{id:m}});return i.structuredContent??i},t[24]=o,t[25]=A):A=t[25];let p;t[26]!==n||t[27]!==e.id||t[28]!==a?(p=(m,i)=>{a.removeQueries({queryKey:T.automation(e.id,i)}),n(),g.success("Automation deleted successfully")},t[26]=n,t[27]=e.id,t[28]=a,t[29]=p):p=t[29];let K;t[30]!==p||t[31]!==A?(K={mutationFn:A,onSuccess:p,onError:W},t[30]=p,t[31]=A,t[32]=K):K=t[32];const j=f(K);let E;t[33]!==o?(E=async m=>{const i=await o.callTool({name:"AUTOMATION_TRIGGER_ADD",arguments:m});if(i.isError){const I=i.content?.[0]?.text??"Failed to add trigger";throw new Error(I)}return i.structuredContent??i},t[33]=o,t[34]=E):E=t[34];let S;t[35]!==n||t[36]!==l?(S=m=>{n(),l(m.automation_id)},t[35]=n,t[36]=l,t[37]=S):S=t[37];let w;t[38]!==E||t[39]!==S?(w={mutationFn:E,onSuccess:S},t[38]=E,t[39]=S,t[40]=w):w=t[40];const P=f(w);let O;t[41]!==o?(O=async m=>{const i=await o.callTool({name:"AUTOMATION_TRIGGER_ROTATE_TOKEN",arguments:{trigger_id:m.trigger_id}});if(i.isError){const I=i.content?.[0]?.text??"Failed to rotate token";throw new Error(I)}return i.structuredContent??i},t[41]=o,t[42]=O):O=t[42];let R;t[43]!==n||t[44]!==l?(R=(m,i)=>{n(),l(i.automation_id)},t[43]=n,t[44]=l,t[45]=R):R=t[45];let b;t[46]!==O||t[47]!==R?(b={mutationFn:O,onSuccess:R},t[46]=O,t[47]=R,t[48]=b):b=t[48];const v=f(b);let C;t[49]!==o?(C=async m=>{const i=await o.callTool({name:"AUTOMATION_TRIGGER_REMOVE",arguments:{trigger_id:m.trigger_id}});return i.structuredContent??i},t[49]=o,t[50]=C):C=t[50];let F;t[51]!==n||t[52]!==l?(F=(m,i)=>{n(),l(i.automation_id)},t[51]=n,t[52]=l,t[53]=F):F=t[53];let L;t[54]!==C||t[55]!==F?(L={mutationFn:C,onSuccess:F},t[54]=C,t[55]=F,t[56]=L):L=t[56];const z=f(L);let M;t[57]!==o?(M={mutationFn:async m=>{const i=await o.callTool({name:"AUTOMATION_RUN",arguments:{id:m}});if(i.isError){const I=i.content?.[0]?.text??"Failed to run automation";throw new Error(I)}return i.structuredContent??i},onSuccess:H,onError:B},t[57]=o,t[58]=M):M=t[58];const J=f(M);let h;return t[59]!==k||t[60]!==j||t[61]!==J||t[62]!==P||t[63]!==z||t[64]!==v||t[65]!==Q?(h={create:k,update:Q,remove:j,triggerAdd:P,triggerRemove:z,triggerRotateToken:v,run:J},t[59]=k,t[60]=j,t[61]=J,t[62]=P,t[63]=z,t[64]=v,t[65]=Q,t[66]=h):h=t[66],h}function B(t){const e=t instanceof Error?t.message:String(t);g.error(`Failed to run automation: ${e}`)}function H(t){t.skipped?g.info(`Automation skipped: ${t.skipped}`):t.error?g.error(`Automation failed: ${t.error}`):g.success("Automation triggered")}function W(t){const e=t instanceof Error?t.message:String(t);g.error(`Failed to delete automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);g.error(`Failed to update automation: ${e}`)}function Z(t){const e=t instanceof Error?t.message:String(t);g.error(`Failed to create automation: ${e}`)}export{st as a,ot as b,nt as c,at as d,it as e,rt as u};
@@ -1 +1 @@
1
- import{e as u,q as m,n as g,K as p}from"./index-8Av7_XG5.js";const b=new Set(["owner","admin"]);function d(){const e=u.c(11),{org:r,locator:c}=m();let o;e[0]!==c?(o=p.myCapabilities(c),e[0]=c,e[1]=o):o=e[1];let a;e[2]!==r?(a=async()=>{const f=await fetch(`/api/auth/custom/my-capabilities/${encodeURIComponent(r.slug)}`,{credentials:"include"});if(!f.ok)throw new Error(`my-capabilities request failed: ${f.status}`);return await f.json()},e[2]=r,e[3]=a):a=e[3];let i;e[4]!==o||e[5]!==a?(i={queryKey:o,queryFn:a,staleTime:3e4,retry:2},e[4]=o,e[5]=a,e[6]=i):i=e[6];const{data:s,isLoading:l,isError:n}=g(i);let t;return e[7]!==s||e[8]!==n||e[9]!==l?(t={data:s,loading:l,error:n},e[7]=s,e[8]=n,e[9]=l,e[10]=t):t=e[10],t}function _(e){const r=u.c(8),{data:c,loading:o,error:a}=d();if(o){let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!0,error:!1,reason:"loading"},r[0]=t):t=r[0],t}if(a){let t;return r[1]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!0,reason:"error"},r[1]=t):t=r[1],t}const i=c?.role??null;if(!i){let t;return r[2]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!1,reason:"denied"},r[2]=t):t=r[2],t}if(i==="owner"){let t;return r[3]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"owner"},r[3]=t):t=r[3],t}if(i==="admin"){let t;return r[4]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"admin"},r[4]=t):t=r[4],t}const s=c?.capabilities?.[e]===!0,l=s?"role":"denied";let n;return r[5]!==s||r[6]!==l?(n={granted:s,loading:!1,error:!1,reason:l},r[5]=s,r[6]=l,r[7]=n):n=r[7],n}function S(){const e=u.c(10),{data:r,loading:c,error:o}=d(),a=r?.role??void 0;let i;e[0]!==a?(i=a?b.has(a):!1,e[0]=a,e[1]=i):i=e[1];const s=i;let l;e[2]!==r?.capabilities?(l=r?.capabilities??{},e[2]=r?.capabilities,e[3]=l):l=e[3];const n=l;let t;return e[4]!==o||e[5]!==s||e[6]!==c||e[7]!==a||e[8]!==n?(t={capabilities:n,loading:c,error:o,isPrivileged:s,roleSlug:a},e[4]=o,e[5]=s,e[6]=c,e[7]=a,e[8]=n,e[9]=t):t=e[9],t}export{S as a,_ as u};
1
+ import{e as u,q as m,n as g,K as p}from"./index-Cpkh2ZIG.js";const b=new Set(["owner","admin"]);function d(){const e=u.c(11),{org:r,locator:c}=m();let o;e[0]!==c?(o=p.myCapabilities(c),e[0]=c,e[1]=o):o=e[1];let a;e[2]!==r?(a=async()=>{const f=await fetch(`/api/auth/custom/my-capabilities/${encodeURIComponent(r.slug)}`,{credentials:"include"});if(!f.ok)throw new Error(`my-capabilities request failed: ${f.status}`);return await f.json()},e[2]=r,e[3]=a):a=e[3];let i;e[4]!==o||e[5]!==a?(i={queryKey:o,queryFn:a,staleTime:3e4,retry:2},e[4]=o,e[5]=a,e[6]=i):i=e[6];const{data:s,isLoading:l,isError:n}=g(i);let t;return e[7]!==s||e[8]!==n||e[9]!==l?(t={data:s,loading:l,error:n},e[7]=s,e[8]=n,e[9]=l,e[10]=t):t=e[10],t}function _(e){const r=u.c(8),{data:c,loading:o,error:a}=d();if(o){let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!0,error:!1,reason:"loading"},r[0]=t):t=r[0],t}if(a){let t;return r[1]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!0,reason:"error"},r[1]=t):t=r[1],t}const i=c?.role??null;if(!i){let t;return r[2]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!1,reason:"denied"},r[2]=t):t=r[2],t}if(i==="owner"){let t;return r[3]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"owner"},r[3]=t):t=r[3],t}if(i==="admin"){let t;return r[4]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"admin"},r[4]=t):t=r[4],t}const s=c?.capabilities?.[e]===!0,l=s?"role":"denied";let n;return r[5]!==s||r[6]!==l?(n={granted:s,loading:!1,error:!1,reason:l},r[5]=s,r[6]=l,r[7]=n):n=r[7],n}function S(){const e=u.c(10),{data:r,loading:c,error:o}=d(),a=r?.role??void 0;let i;e[0]!==a?(i=a?b.has(a):!1,e[0]=a,e[1]=i):i=e[1];const s=i;let l;e[2]!==r?.capabilities?(l=r?.capabilities??{},e[2]=r?.capabilities,e[3]=l):l=e[3];const n=l;let t;return e[4]!==o||e[5]!==s||e[6]!==c||e[7]!==a||e[8]!==n?(t={capabilities:n,loading:c,error:o,isPrivileged:s,roleSlug:a},e[4]=o,e[5]=s,e[6]=c,e[7]=a,e[8]=n,e[9]=t):t=e[9],t}export{S as a,_ as u};
@@ -0,0 +1 @@
1
+ import{e as v,G as b,a as F,s as x,aO as q,o as _}from"./index-Cpkh2ZIG.js";function Q(e,s,n){const t=[];if(e?.trim()){const o=e.trim(),r=n.map(a=>({field:[String(a)],operator:"contains",value:o}));r.length===1&&r[0]?t.push(r[0]):r.length>1&&t.push({operator:"or",conditions:r})}if(s&&s.length>0)for(const o of s)t.push({field:[o.column],operator:"eq",value:o.value});if(t.length!==0)return t.length===1?t[0]:{operator:"and",conditions:t}}function k(e,s,n){const t=e??n,o=s??"desc";return[{field:[String(t)],direction:o}]}function w(e){if(!e||typeof e!="object")throw new Error("Invalid result");if("isError"in e&&e.isError)throw new Error("content"in e&&Array.isArray(e.content)&&e.content[0]?.type==="text"?e.content[0].text:"Unknown error");if("structuredContent"in e)return e.structuredContent;throw new Error("No structured content found")}function D(e,s,n,t){const o=s.toUpperCase(),r=`COLLECTION_${o}_GET`;return{queryKey:q.collectionItem(t,e,"",o,n??""),queryFn:async()=>{if(!n)return{item:null};const a=await t.callTool({name:r,arguments:{id:n}});return w(a)},staleTime:6e4}}function Y(e,s,n,t){const o=v.c(5);let r;o[0]!==t||o[1]!==s||o[2]!==n||o[3]!==e?(r=D(e,s,n,t),o[0]=t,o[1]=s,o[2]=n,o[3]=e,o[4]=r):r=o[4];const{data:a}=x(r);return a?.item??null}const K={structuredContent:{items:[]},isError:!1};function j(e,s,n,t={}){const{searchTerm:o,filters:r,sortKey:a,sortDirection:L,searchFields:S=["title","description"],defaultSortKey:h="updated_at",pageSize:g=100,additionalToolArgs:c}=t,l=s.toUpperCase(),f=`COLLECTION_${l}_LIST`,p=Q(o,r,S),T=k(a,L,h),u={...p&&{where:p},...T&&{orderBy:T},limit:g,offset:0,...c},m=JSON.stringify(u),C=q.collectionList(n,e,"",l,m),{data:O}=x({queryKey:C,queryFn:async()=>n?await n.callTool({name:f,arguments:u}):K,staleTime:3e4,retry:!1,select:d=>w(d??{})?.items??[]});return O}function z(e,s,n){const t=v.c(34),o=b();let r;t[0]!==s?(r=s.toUpperCase(),t[0]=s,t[1]=r):r=t[1];const a=r,L=`COLLECTION_${a}_CREATE`,S=`COLLECTION_${a}_UPDATE`,h=`COLLECTION_${a}_DELETE`;let g;t[2]!==o||t[3]!==e||t[4]!==a?(g=()=>{o.invalidateQueries({predicate:E=>{const i=E.queryKey;return i[1]===e&&i[3]==="collection"&&i[4]===a}})},t[2]=o,t[3]=e,t[4]=a,t[5]=g):g=t[5];const c=g;let l;t[6]!==n||t[7]!==L?(l=async E=>{const i=await n.callTool({name:L,arguments:{data:E}});if(i.isError)throw new Error(Array.isArray(i.content)?i.content[0]?.text:String(i.content));return w(i).item},t[6]=n,t[7]=L,t[8]=l):l=t[8];let f;t[9]!==c?(f=()=>{c(),_.success("Item created successfully")},t[9]=c,t[10]=f):f=t[10];let p;t[11]!==l||t[12]!==f?(p={mutationFn:l,onSuccess:f,onError:B},t[11]=l,t[12]=f,t[13]=p):p=t[13];const T=F(p);let u;t[14]!==n||t[15]!==S?(u=async E=>{const{id:i,data:A}=E,U=await n.callTool({name:S,arguments:{id:i,data:A}});return w(U).item},t[14]=n,t[15]=S,t[16]=u):u=t[16];let m;t[17]!==c?(m=()=>{c(),_.success("Item updated successfully")},t[17]=c,t[18]=m):m=t[18];let C;t[19]!==u||t[20]!==m?(C={mutationFn:u,onSuccess:m,onError:R},t[19]=u,t[20]=m,t[21]=C):C=t[21];const O=F(C);let d;t[22]!==n||t[23]!==h?(d=async E=>{const i=await n.callTool({name:h,arguments:{id:E}});return w(i).item.id},t[22]=n,t[23]=h,t[24]=d):d=t[24];let y;t[25]!==c?(y=()=>{c(),_.success("Item deleted successfully")},t[25]=c,t[26]=y):y=t[26];let N;t[27]!==d||t[28]!==y?(N={mutationFn:d,onSuccess:y,onError:P},t[27]=d,t[28]=y,t[29]=N):N=t[29];const $=F(N);let I;return t[30]!==T||t[31]!==$||t[32]!==O?(I={create:T,update:O,delete:$},t[30]=T,t[31]=$,t[32]=O,t[33]=I):I=t[33],I}function P(e){const s=e instanceof Error?e.message:String(e);_.error(`Failed to delete item: ${s}`)}function R(e){const s=e instanceof Error?e.message:String(e);_.error(`Failed to update item: ${s}`)}function B(e){const s=e instanceof Error?e.message:String(e);_.error(`Failed to create item: ${s}`)}export{z as a,j as b,D as c,Y as u};
@@ -1 +1 @@
1
- import{e as f,q as C}from"./index-8Av7_XG5.js";import{u as N,b as O,a as S}from"./use-collections-CMMaRmVG.js";import{S as I,u as m}from"./constants-DeFtLUND.js";function E(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let r;o[12]!==e?(r=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=r):r=o[13];let g;o[14]!==s||o[15]!==r?(g={...s,additionalToolArgs:r},o[14]=s,o[15]=r,o[16]=g):g=o[16];const p=g,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:I,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const A=m(a);return O(u.id,"CONNECTIONS",A,p)}function _(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:I,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=m(n);return N(i.id,"CONNECTIONS",t,l)}function x(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:I,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=m(i);return S(o.id,"CONNECTIONS",n)}export{_ as a,x as b,E as u};
1
+ import{e as f,q as C}from"./index-Cpkh2ZIG.js";import{u as N,b as O,a as S}from"./use-collections-D85cxoLq.js";import{S as I,u as m}from"./constants-Oa_3OHe_.js";function E(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let r;o[12]!==e?(r=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=r):r=o[13];let g;o[14]!==s||o[15]!==r?(g={...s,additionalToolArgs:r},o[14]=s,o[15]=r,o[16]=g):g=o[16];const p=g,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:I,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const A=m(a);return O(u.id,"CONNECTIONS",A,p)}function _(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:I,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=m(n);return N(i.id,"CONNECTIONS",t,l)}function x(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:I,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=m(i);return S(o.id,"CONNECTIONS",n)}export{_ as a,x as b,E as u};
@@ -1 +1 @@
1
- import{e as c,r as n}from"./index-8Av7_XG5.js";function p(){const e=c.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async i=>{await navigator.clipboard.writeText(i),a(!0),setTimeout(()=>a(!1),2e3)},e[0]=t):t=e[0];const r=t;let o;return e[1]!==s?(o={handleCopy:r,copied:s},e[1]=s,e[2]=o):o=e[2],o}export{p as u};
1
+ import{e as c,r as n}from"./index-Cpkh2ZIG.js";function p(){const e=c.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async i=>{await navigator.clipboard.writeText(i),a(!0),setTimeout(()=>a(!1),2e3)},e[0]=t):t=e[0];const r=t;let o;return e[1]!==s?(o={handleCopy:r,copied:s},e[1]=s,e[2]=o):o=e[2],o}export{p as u};
@@ -1 +1 @@
1
- import{e as g}from"./index-8Av7_XG5.js";import{b as f}from"./use-virtual-mcp-C_vD2kKw.js";import{k as p}from"./use-navigate-to-agent-C3AzTy7G.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const d=n,{navigateOnCreate:u}=d,r=u===void 0?!1:u,t=f(),c=p();let s;e[2]!==t.create||e[3]!==r||e[4]!==c?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return r&&c(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=r,e[4]=c,e[5]=s):s=e[5];const o=s;let a;return e[6]!==t.create.isPending||e[7]!==o?(a={createVirtualMCP:o,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=o,e[8]=a):a=e[8],a}export{A as u};
1
+ import{e as g}from"./index-Cpkh2ZIG.js";import{b as f}from"./use-virtual-mcp-Ce0GfiFh.js";import{k as p}from"./use-navigate-to-agent-jijw9Ij-.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const d=n,{navigateOnCreate:u}=d,r=u===void 0?!1:u,t=f(),c=p();let s;e[2]!==t.create||e[3]!==r||e[4]!==c?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return r&&c(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=r,e[4]=c,e[5]=s):s=e[5];const o=s;let a;return e[6]!==t.create.isPending||e[7]!==o?(a={createVirtualMCP:o,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=o,e[8]=a):a=e[8],a}export{A as u};
@@ -1 +1 @@
1
- import{r as u}from"./index-8Av7_XG5.js";function l({save:t,delayMs:n=1e3}){const e=u.useRef(t);e.current=t;const r=u.useRef(null),c=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,e.current()},n)},o=()=>(r.current&&(clearTimeout(r.current),r.current=null),e.current());return u.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null,e.current())},[]),{schedule:c,flush:o}}export{l as u};
1
+ import{r as u}from"./index-Cpkh2ZIG.js";function l({save:t,delayMs:n=1e3}){const e=u.useRef(t);e.current=t;const r=u.useRef(null),c=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,e.current()},n)},o=()=>(r.current&&(clearTimeout(r.current),r.current=null),e.current());return u.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null,e.current())},[]),{schedule:c,flush:o}}export{l as u};
@@ -0,0 +1 @@
1
+ import{e as H,j as n,q as P,G as Q,r as G,o as T,bl as J,bm as Y}from"./index-Cpkh2ZIG.js";import{c as w,b as L,d as q,f as R,e as U,g as $,a as k,A as K}from"./alert-dialog-B5GON_rn.js";import{u as z,S as B}from"./constants-Oa_3OHe_.js";function Z(E){const e=H.c(41),{deleteState:s,cancelDelete:i,confirmDelete:c,confirmForceDelete:r}=E,N=s.mode==="deleting";let a;e[0]!==i?(a=I=>{I||i()},e[0]=i,e[1]=a):a=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(w,{children:"Delete Connection?"}),e[2]=f):f=e[2];const A=s.mode==="deleting"&&s.connection.title;let u;e[3]!==A?(u=n.jsxs(L,{children:[f,n.jsxs(q,{children:["This action cannot be undone. This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:A}),"."]})]}),e[3]=A,e[4]=u):u=e[4];let _;e[5]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(R,{children:"Cancel"}),e[5]=_):_=e[5];let g;e[6]!==c?(g=n.jsxs(U,{children:[_,n.jsx($,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[6]=c,e[7]=g):g=e[7];let o;e[8]!==u||e[9]!==g?(o=n.jsxs(k,{children:[u,g]}),e[8]=u,e[9]=g,e[10]=o):o=e[10];let t;e[11]!==N||e[12]!==a||e[13]!==o?(t=n.jsx(K,{open:N,onOpenChange:a,children:o}),e[11]=N,e[12]=a,e[13]=o,e[14]=t):t=e[14];const l=s.mode==="force-deleting";let d;e[15]!==i?(d=I=>{I||i()},e[15]=i,e[16]=d):d=e[16];let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(w,{children:"Connection Used by Agents"}),e[17]=m):m=e[17];const S=s.mode==="force-deleting"&&s.connection.title;let h;e[18]!==S?(h=n.jsx("span",{className:"font-medium text-foreground",children:S}),e[18]=S,e[19]=h):h=e[19];const F=s.mode==="force-deleting"&&s.agentNames;let x;e[20]!==F?(x=n.jsx("span",{className:"font-medium text-foreground",children:F}),e[20]=F,e[21]=x):x=e[21];let C;e[22]!==h||e[23]!==x?(C=n.jsxs("p",{children:["The connection"," ",h," ","is currently used by the following agent(s):"," ",x,"."]}),e[22]=h,e[23]=x,e[24]=C):C=e[24];let O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."}),e[25]=O):O=e[25];let D;e[26]!==C?(D=n.jsxs(L,{children:[m,n.jsx(q,{asChild:!0,children:n.jsxs("div",{children:[C,O]})})]}),e[26]=C,e[27]=D):D=e[27];let b;e[28]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(R,{children:"Cancel"}),e[28]=b):b=e[28];let p;e[29]!==r?(p=n.jsxs(U,{children:[b,n.jsx($,{onClick:r,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]}),e[29]=r,e[30]=p):p=e[30];let y;e[31]!==D||e[32]!==p?(y=n.jsxs(k,{children:[D,p]}),e[31]=D,e[32]=p,e[33]=y):y=e[33];let j;e[34]!==l||e[35]!==d||e[36]!==y?(j=n.jsx(K,{open:l,onOpenChange:d,children:y}),e[34]=l,e[35]=d,e[36]=y,e[37]=j):j=e[37];let v;return e[38]!==j||e[39]!==t?(v=n.jsxs(n.Fragment,{children:[t,j]}),e[38]=j,e[39]=t,e[40]=v):v=e[40],v}function M(E){const e=E.content;return Array.isArray(e)&&e[0]?.type==="text"&&typeof e[0].text=="string"?e[0].text:"Unknown error"}function ee({onSuccess:E}={}){const{org:e}=P(),s=Q(),i=z({connectionId:B,orgId:e.id,orgSlug:e.slug}),[c,r]=G.useState({mode:"idle"}),N=()=>{s.invalidateQueries({predicate:o=>{const t=o.queryKey;return t[1]===e.id&&t[3]==="collection"&&t[4]==="CONNECTIONS"}})},a=o=>{J(o),s.invalidateQueries({predicate:t=>t.queryKey[1]===Y&&t.queryKey[3]===o})},f=o=>{N(),a(o),T.success("Connection deleted successfully"),r({mode:"idle"}),E?.()};return{deleteState:c,requestDelete:o=>{r({mode:"deleting",connection:o})},cancelDelete:()=>{r({mode:"idle"})},confirmDelete:async()=>{if(c.mode!=="deleting")return;const o=c.connection;r({mode:"idle"});try{const t=await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:o.id}});if(t.isError){const l=M(t),d=l.replace(/^Error:\s*/,"");try{const m=JSON.parse(d);if(m.code==="CONNECTION_IN_USE"&&m.agentNames){r({mode:"force-deleting",connection:o,agentNames:m.agentNames.map(S=>`"${S}"`).join(", ")});return}}catch{}T.error(`Failed to delete connection: ${l}`);return}f(o.id)}catch(t){const l=t instanceof Error?t.message:String(t);T.error(`Failed to delete connection: ${l}`)}},confirmForceDelete:async()=>{if(c.mode!=="force-deleting")return;const o=c.connection.id;r({mode:"idle"});try{const t=await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:o,force:!0}});if(t.isError){T.error(`Failed to delete connection: ${M(t)}`);return}f(o)}catch(t){const l=t instanceof Error?t.message:String(t);T.error(`Failed to delete connection: ${l}`)}}}}export{Z as D,ee as u};
@@ -1 +1 @@
1
- import{e as c,q as a,K as g,s as F,n as S,F as y,a as I}from"./index-8Av7_XG5.js";import{S as f,u as d}from"./constants-DeFtLUND.js";import{u as C}from"./unwrap-tool-result-BYXdCQMg.js";function q(){const e=c.c(10),{org:t}=a();let l;e[0]!==t.id||e[1]!==t.slug?(l={connectionId:f,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=l):l=e[2];const o=d(l);let n;e[3]!==t.id?(n=g.fileConfigs(t.id),e[3]=t.id,e[4]=n):n=e[4];let s;e[5]!==o?(s=async()=>{const r=await o.callTool({name:"FILE_CONFIG_LIST",arguments:{}});return C(r)},e[5]=o,e[6]=s):s=e[6];let i;e[7]!==n||e[8]!==s?(i={queryKey:n,staleTime:6e4,queryFn:s},e[7]=n,e[8]=s,e[9]=i):i=e[9];const{data:u}=F(i);return u.configs}function L(){const e=c.c(10),{org:t}=a();let l;e[0]!==t.id||e[1]!==t.slug?(l={connectionId:f,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=l):l=e[2];const o=d(l);let n;e[3]!==t.id?(n=g.fileConfigs(t.id),e[3]=t.id,e[4]=n):n=e[4];let s;e[5]!==o?(s=async()=>{const u=await o.callTool({name:"FILE_CONFIG_LIST",arguments:{}});return C(u)},e[5]=o,e[6]=s):s=e[6];let i;return e[7]!==n||e[8]!==s?(i={queryKey:n,staleTime:6e4,queryFn:s},e[7]=n,e[8]=s,e[9]=i):i=e[9],S(i)}function p(){const e=c.c(11),{org:t}=a();let l;e[0]!==t.id||e[1]!==t.slug?(l={connectionId:f,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=l):l=e[2];const o=d(l),n=y();let s;e[3]!==o?(s=async r=>{const m=await o.callTool({name:"FILE_CONFIG_CREATE",arguments:{...r}});return C(m)},e[3]=o,e[4]=s):s=e[4];let i;e[5]!==t.id||e[6]!==n?(i=()=>{n.invalidateQueries({queryKey:g.fileConfigs(t.id)})},e[5]=t.id,e[6]=n,e[7]=i):i=e[7];let u;return e[8]!==s||e[9]!==i?(u={mutationFn:s,onSuccess:i},e[8]=s,e[9]=i,e[10]=u):u=e[10],I(u)}function K(){const e=c.c(11),{org:t}=a();let l;e[0]!==t.id||e[1]!==t.slug?(l={connectionId:f,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=l):l=e[2];const o=d(l),n=y();let s;e[3]!==o?(s=async r=>{const m=await o.callTool({name:"FILE_CONFIG_DELETE",arguments:{id:r}});return C(m)},e[3]=o,e[4]=s):s=e[4];let i;e[5]!==t.id||e[6]!==n?(i=()=>{n.invalidateQueries({queryKey:g.fileConfigs(t.id)})},e[5]=t.id,e[6]=n,e[7]=i):i=e[7];let u;return e[8]!==s||e[9]!==i?(u={mutationFn:s,onSuccess:i},e[8]=s,e[9]=i,e[10]=u):u=e[10],I(u)}export{p as a,K as b,L as c,q as u};
1
+ import{e as c,q as a,K as g,s as F,n as S,G as y,a as I}from"./index-Cpkh2ZIG.js";import{S as f,u as d}from"./constants-Oa_3OHe_.js";import{u as C}from"./unwrap-tool-result-BYXdCQMg.js";function q(){const e=c.c(10),{org:t}=a();let l;e[0]!==t.id||e[1]!==t.slug?(l={connectionId:f,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=l):l=e[2];const o=d(l);let n;e[3]!==t.id?(n=g.fileConfigs(t.id),e[3]=t.id,e[4]=n):n=e[4];let s;e[5]!==o?(s=async()=>{const r=await o.callTool({name:"FILE_CONFIG_LIST",arguments:{}});return C(r)},e[5]=o,e[6]=s):s=e[6];let i;e[7]!==n||e[8]!==s?(i={queryKey:n,staleTime:6e4,queryFn:s},e[7]=n,e[8]=s,e[9]=i):i=e[9];const{data:u}=F(i);return u.configs}function L(){const e=c.c(10),{org:t}=a();let l;e[0]!==t.id||e[1]!==t.slug?(l={connectionId:f,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=l):l=e[2];const o=d(l);let n;e[3]!==t.id?(n=g.fileConfigs(t.id),e[3]=t.id,e[4]=n):n=e[4];let s;e[5]!==o?(s=async()=>{const u=await o.callTool({name:"FILE_CONFIG_LIST",arguments:{}});return C(u)},e[5]=o,e[6]=s):s=e[6];let i;return e[7]!==n||e[8]!==s?(i={queryKey:n,staleTime:6e4,queryFn:s},e[7]=n,e[8]=s,e[9]=i):i=e[9],S(i)}function p(){const e=c.c(11),{org:t}=a();let l;e[0]!==t.id||e[1]!==t.slug?(l={connectionId:f,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=l):l=e[2];const o=d(l),n=y();let s;e[3]!==o?(s=async r=>{const m=await o.callTool({name:"FILE_CONFIG_CREATE",arguments:{...r}});return C(m)},e[3]=o,e[4]=s):s=e[4];let i;e[5]!==t.id||e[6]!==n?(i=()=>{n.invalidateQueries({queryKey:g.fileConfigs(t.id)})},e[5]=t.id,e[6]=n,e[7]=i):i=e[7];let u;return e[8]!==s||e[9]!==i?(u={mutationFn:s,onSuccess:i},e[8]=s,e[9]=i,e[10]=u):u=e[10],I(u)}function K(){const e=c.c(11),{org:t}=a();let l;e[0]!==t.id||e[1]!==t.slug?(l={connectionId:f,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=l):l=e[2];const o=d(l),n=y();let s;e[3]!==o?(s=async r=>{const m=await o.callTool({name:"FILE_CONFIG_DELETE",arguments:{id:r}});return C(m)},e[3]=o,e[4]=s):s=e[4];let i;e[5]!==t.id||e[6]!==n?(i=()=>{n.invalidateQueries({queryKey:g.fileConfigs(t.id)})},e[5]=t.id,e[6]=n,e[7]=i):i=e[7];let u;return e[8]!==s||e[9]!==i?(u={mutationFn:s,onSuccess:i},e[8]=s,e[9]=i,e[10]=u):u=e[10],I(u)}export{p as a,K as b,L as c,q as u};
@@ -1 +1 @@
1
- import{r as e}from"./index-8Av7_XG5.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
1
+ import{r as e}from"./index-Cpkh2ZIG.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
@@ -1 +1 @@
1
- import{r as u,e as w}from"./index-8Av7_XG5.js";import{u as E}from"./use-view-mode-BwvjqQMY.js";function J(a){const e=`deco-filters-${a}`,[s,i]=u.useState(()=>{try{const t=globalThis.localStorage?.getItem(e);if(t)return JSON.parse(t)}catch(t){console.error("Failed to parse stored filters:",t)}return[]});return[s,t=>{i(t);try{globalThis.localStorage?.setItem(e,JSON.stringify(t))}catch(l){console.error("Failed to save filters:",l)}}]}function N(a){const e=w.c(7),[s,i]=u.useState(a),[r,t]=u.useState(a?"desc":null);let l;e[0]!==r||e[1]!==s?(l=S=>{s!==S?(i(S),t("asc")):r==="asc"?t("desc"):r==="desc"&&(i(void 0),t(null))},e[0]=r,e[1]=s,e[2]=l):l=e[2];const d=l;let o;return e[3]!==d||e[4]!==r||e[5]!==s?(o={sortKey:s,sortDirection:r,handleSort:d},e[3]=d,e[4]=r,e[5]=s,e[6]=o):o=e[6],o}function W(a){const e=w.c(20),{namespace:s,resource:i,defaultSortKey:r,defaultViewMode:t}=a,l=r===void 0?"title":r,d=t===void 0?"table":t,[o,S]=u.useState(""),b=u.useDeferredValue(o),D=`${s}-${i}`,[p,F]=J(D),c=`mesh-${i}-filter-visible-${s}`;let g;e[0]!==c?(g=()=>globalThis.localStorage?.getItem(c)==="true",e[0]=c,e[1]=g):g=e[1];const[n,x]=u.useState(g);let h;e[2]!==c?(h=T=>{x(T),globalThis.localStorage?.setItem(c,String(T))},e[2]=c,e[3]=h):h=e[3];const f=h;let m;e[4]!==n||e[5]!==f?(m=()=>{f(!n)},e[4]=n,e[5]=f,e[6]=m):m=e[6];const V=m,[$,K]=E(`mesh-${i}-${s}`,d),{sortKey:I,sortDirection:v,handleSort:B}=N(l),M=I;let y;return e[7]!==n||e[8]!==p||e[9]!==B||e[10]!==o||e[11]!==b||e[12]!==f||e[13]!==F||e[14]!==K||e[15]!==v||e[16]!==M||e[17]!==V||e[18]!==$?(y={search:o,searchTerm:b,setSearch:S,filters:p,setFilters:F,filterBarVisible:n,setFilterBarVisible:f,toggleFilterBar:V,viewMode:$,setViewMode:K,sortKey:M,sortDirection:v,handleSort:B},e[7]=n,e[8]=p,e[9]=B,e[10]=o,e[11]=b,e[12]=f,e[13]=F,e[14]=K,e[15]=v,e[16]=M,e[17]=V,e[18]=$,e[19]=y):y=e[19],y}export{W as u};
1
+ import{r as u,e as w}from"./index-Cpkh2ZIG.js";import{u as E}from"./use-view-mode-Ce2twUKM.js";function J(a){const e=`deco-filters-${a}`,[s,i]=u.useState(()=>{try{const t=globalThis.localStorage?.getItem(e);if(t)return JSON.parse(t)}catch(t){console.error("Failed to parse stored filters:",t)}return[]});return[s,t=>{i(t);try{globalThis.localStorage?.setItem(e,JSON.stringify(t))}catch(l){console.error("Failed to save filters:",l)}}]}function N(a){const e=w.c(7),[s,i]=u.useState(a),[r,t]=u.useState(a?"desc":null);let l;e[0]!==r||e[1]!==s?(l=S=>{s!==S?(i(S),t("asc")):r==="asc"?t("desc"):r==="desc"&&(i(void 0),t(null))},e[0]=r,e[1]=s,e[2]=l):l=e[2];const d=l;let o;return e[3]!==d||e[4]!==r||e[5]!==s?(o={sortKey:s,sortDirection:r,handleSort:d},e[3]=d,e[4]=r,e[5]=s,e[6]=o):o=e[6],o}function W(a){const e=w.c(20),{namespace:s,resource:i,defaultSortKey:r,defaultViewMode:t}=a,l=r===void 0?"title":r,d=t===void 0?"table":t,[o,S]=u.useState(""),b=u.useDeferredValue(o),D=`${s}-${i}`,[p,F]=J(D),c=`mesh-${i}-filter-visible-${s}`;let g;e[0]!==c?(g=()=>globalThis.localStorage?.getItem(c)==="true",e[0]=c,e[1]=g):g=e[1];const[n,x]=u.useState(g);let h;e[2]!==c?(h=T=>{x(T),globalThis.localStorage?.setItem(c,String(T))},e[2]=c,e[3]=h):h=e[3];const f=h;let m;e[4]!==n||e[5]!==f?(m=()=>{f(!n)},e[4]=n,e[5]=f,e[6]=m):m=e[6];const V=m,[$,K]=E(`mesh-${i}-${s}`,d),{sortKey:I,sortDirection:v,handleSort:B}=N(l),M=I;let y;return e[7]!==n||e[8]!==p||e[9]!==B||e[10]!==o||e[11]!==b||e[12]!==f||e[13]!==F||e[14]!==K||e[15]!==v||e[16]!==M||e[17]!==V||e[18]!==$?(y={search:o,searchTerm:b,setSearch:S,filters:p,setFilters:F,filterBarVisible:n,setFilterBarVisible:f,toggleFilterBar:V,viewMode:$,setViewMode:K,sortKey:M,sortDirection:v,handleSort:B},e[7]=n,e[8]=p,e[9]=B,e[10]=o,e[11]=b,e[12]=f,e[13]=F,e[14]=K,e[15]=v,e[16]=M,e[17]=V,e[18]=$,e[19]=y):y=e[19],y}export{W as u};
@@ -0,0 +1 @@
1
+ import{e as l,n as c,bH as m,bI as f,s as y,aO as n}from"./index-Cpkh2ZIG.js";async function u(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],c(a)}export{q as a,b as g,u as l,g as u};
@@ -0,0 +1 @@
1
+ import{e as m,n as p,s as q,aO as T,a as C}from"./index-Cpkh2ZIG.js";function O(a){const e=m.c(12);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const n=s.staleTime??3e4;let i;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==n?(i={...s,queryKey:l,queryFn:o,staleTime:n,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=n,e[11]=i):i=e[11],q(i)}function K(a){const e=m.c(12);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const n=s.staleTime??3e4;let i;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==n?(i={...s,queryKey:l,queryFn:o,staleTime:n,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=n,e[11]=i):i=e[11],p(i)}function M(a){const e=m.c(21);let t,s,l,o;e[0]!==a?({client:t,toolName:o,toolArguments:l,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let n,i,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const f=JSON.stringify(l??{});u=q,n=s,i=T.mcpToolCall(t,o,f),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let r;e[12]!==t||e[13]!==l||e[14]!==o?(r=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=r):r=e[15];const y=s.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==r||e[19]!==y?(c={...n,queryKey:i,queryFn:r,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=r,e[19]=y,e[20]=c):c=e[20],u(c)}function w(a){const e=m.c(21);let t,s,l,o;e[0]!==a?({client:t,toolName:o,toolArguments:l,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let n,i,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const f=JSON.stringify(l??{});u=p,n=s,i=T.mcpToolCall(t,o,f),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let r;e[12]!==t||e[13]!==l||e[14]!==o?(r=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=r):r=e[15];const y=s.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==r||e[19]!==y?(c={...n,queryKey:i,queryFn:r,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=r,e[19]=y,e[20]=c):c=e[20],u(c)}function F(a){const e=m.c(8);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=async n=>await t.callTool(n),e[3]=t,e[4]=l):l=e[4];let o;return e[5]!==s||e[6]!==l?(o={...s,mutationFn:l},e[5]=s,e[6]=l,e[7]=o):o=e[7],C(o)}export{O as a,K as b,M as c,F as d,w as u};
@@ -1 +1 @@
1
- import{e as n,q as i,s as l,K as m}from"./index-8Av7_XG5.js";import{u as a}from"./use-org-auth-client-BQe59WMu.js";function p(){const e=n.c(7),{locator:o}=i(),u=a();let t;e[0]!==o?(t=m.members(o),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.organization.listMembers(),e[2]=u,e[3]=s):s=e[3];let r;return e[4]!==t||e[5]!==s?(r={queryKey:t,queryFn:s},e[4]=t,e[5]=s,e[6]=r):r=e[6],l(r)}export{p as u};
1
+ import{e as n,q as i,s as l,K as m}from"./index-Cpkh2ZIG.js";import{u as a}from"./use-org-auth-client-BTgQkcc5.js";function p(){const e=n.c(7),{locator:o}=i(),u=a();let t;e[0]!==o?(t=m.members(o),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.organization.listMembers(),e[2]=u,e[3]=s):s=e[3];let r;return e[4]!==t||e[5]!==s?(r={queryKey:t,queryFn:s},e[4]=t,e[5]=s,e[6]=r):r=e[6],l(r)}export{p as u};
@@ -1 +1 @@
1
- import{L as v,r as f,e as C,j,f as N,q as D,b as F}from"./index-8Av7_XG5.js";import{a as q}from"./use-virtual-mcp-C_vD2kKw.js";const h="__tool_call_runs__",w=["requires_action","in_progress","failed","expired","completed"];function te(e){const t=new Map(w.map(r=>[r,[]]));for(const r of e){const n=r.status??"completed";(t.get(n)??t.get("completed")).push(r)}return w.map(r=>({status:r,threads:t.get(r)}))}function re(e,t){const r=new Map;for(const u of e){if(u.id.startsWith("thrd_welcome_"))continue;const c=u.virtual_mcp_id??h,a=r.get(c);a?(a.threads.push(u),(u.updated_at??"")>a.latestUpdatedAt&&(a.latestUpdatedAt=u.updated_at??"")):r.set(c,{virtualMcpId:c,threads:[u],latestUpdatedAt:u.updated_at??""})}const n=t!==null?r.get(t):void 0;n&&t&&r.delete(t);const s=r.get(h);s&&r.delete(h);const o=[...r.values()].sort((u,c)=>c.latestUpdatedAt.localeCompare(u.latestUpdatedAt)),i=[];return n&&n.threads.length>0&&i.push(n),i.push(...o),s&&s.threads.length>0&&i.push(s),i}const R=new Map,A=new Map;function P(e){return`${e.orgId}:${e.userId}`}function E(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}catch{return[]}}function T(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function $(e){const t=P(e),r=R.get(t);if(r)return r;const n=v.sidebarGroupOrder(e.orgId,e.userId);let s=!1;try{s=localStorage.getItem(n)!==null}catch{}let o=O(n);if(!s&&o.length===0&&e.userId!=="anon"){const i=O(E(e.orgId));i.length>0&&(o=i)}return R.set(t,o),o}function p(e,t){const r=new Set(t);return $(e).filter(n=>!r.has(n))}function g(e,t){R.set(P(e),t),T(v.sidebarGroupOrder(e.orgId,e.userId),t)}function m(e){const t=A.get(e);if(t)return t;const r=O(v.sidebarOrgPinnedOrder(e));return A.set(e,r),r}function S(e,t){A.set(e,t),T(v.sidebarOrgPinnedOrder(e),t)}function ne(e,t){g(e,t)}function se(e,t){S(e,t)}function k(e,t){return e===t||e===h}function I(e,t){return t.includes(e)}function B(e,t){return e.map(r=>r.virtualMcpId).filter(r=>!k(r,t))}function oe(e,t,r,n){const s=new Set(n);return B(e,r).filter(o=>t==="org"?s.has(o):!s.has(o))}function J(e,t){const r=new Set(e),n=t.filter(s=>!r.has(s));return n.length===0?e:[...e,...n]}function ie(e,t,r){const n=new Set(r),s=[],o=[];let i,u;for(const c of e){const a=c.virtualMcpId;if(t&&a===t){i=c;continue}if(a===h){u=c;continue}if(n.has(a)){s.push(c);continue}o.push(c)}return{decopilot:i,orgPinned:s,user:o,toolCallRuns:u}}function L(e,t,r,n=[],s=[]){const o=r?e.find(d=>d.virtualMcpId===r):void 0,i=e.find(d=>d.virtualMcpId===h),u=new Set(n),c=n.filter(d=>!k(d,r)),a=J(s,c),l=t.filter(d=>!u.has(d)),x=new Map(e.map(d=>[d.virtualMcpId,d])),_=d=>{const U=x.get(d);return U||{virtualMcpId:d,threads:[],latestUpdatedAt:""}},G=a.filter(d=>u.has(d)).map(_),K=l.map(_),b=[];return o&&b.push(o),b.push(...G,...K),i&&b.push(i),{groups:b,userOrder:l,orgOrder:G.map(d=>d.virtualMcpId)}}function Y(e,t){const r=new Set(t);m(e.orgId).length===0&&t.length>0&&S(e.orgId,[...t]);const s=v.sidebarGroupOrder(e.orgId,e.userId);if(O(s).length>0)return;const o=O(E(e.orgId));if(o.length===0)return;const i=o.filter(u=>!r.has(u));g(e,i)}function M(e,t){const r=new Set(t),n=$(e),s=n.filter(o=>!r.has(o));s.length!==n.length&&g(e,s)}function ue(e,t,r,n=[]){Y(e,n),M(e,n);const s=p(e,n),o=m(e.orgId),{userOrder:i,orgOrder:u}=L(t,s,r,n,o);(i.length!==s.length||i.some((c,a)=>c!==s[a]))&&g(e,i),(u.length!==o.length||u.some((c,a)=>c!==o[a]))&&S(e.orgId,u)}function ae(e,t,r,n=[]){const s=p(e,n),o=m(e.orgId);return L(t,s,r,n,o).groups}function ce(e,t,r){if(r){const o=p(e,[t]).filter(u=>u!==t);g(e,o);const i=m(e.orgId);i.includes(t)||S(e.orgId,[...i,t]);return}const n=m(e.orgId).filter(o=>o!==t);S(e.orgId,n);const s=p(e,[]);s.includes(t)||g(e,[...s,t])}function W(e,t,r=[]){if(r.includes(t))return;const n=p(e,r);n.includes(t)||g(e,[t,...n])}function de(e,t,r=[]){const n=p(e,r),s=n.filter(o=>o!==t);s.length!==n.length&&g(e,s)}function le(e,t,r){const n=e.indexOf(t),s=e.indexOf(r);if(n===-1||s===-1||n===s)return e;const o=[...e],[i]=o.splice(n,1);return i===void 0?e:(o.splice(s,0,i),o)}function fe(e,t,r,n){if(e==="org")return n;const s=p(t,r),o=new Set(n),i=s.filter(u=>!o.has(u));return[...n,...i]}function ge(e,t,r){const n=I(e,r),s=I(t,r);return n===s}const y=f.createContext(null);function pe(e){const t=C.c(7),{children:r}=e,[n,s]=f.useState(!1),[o,i]=f.useState(0);let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i(z),t[0]=u):u=t[0];const c=u;let a;t[1]!==n||t[2]!==o?(a={empty:n,setEmpty:s,orderRevision:o,bumpOrderRevision:c},t[1]=n,t[2]=o,t[3]=a):a=t[3];let l;return t[4]!==r||t[5]!==a?(l=j.jsx(y.Provider,{value:a,children:r}),t[4]=r,t[5]=a,t[6]=l):l=t[6],l}function z(e){return e+1}function he(){return f.useContext(y)?.empty??!1}function Oe(){return f.useContext(y)?.orderRevision??0}function H(){return f.useContext(y)?.bumpOrderRevision??Q}function Q(){}function me(e){const{value:t}=e,r=f.useContext(y),[n,s]=f.useState(null);return r&&n!==t&&(r.setEmpty(t),s(t)),null}function Se(){const e=C.c(9),t=N(),{org:r}=D(),n=q(),{data:s}=F.useSession(),o=s?.user?.id??"anon";let i;e[0]!==n?(i=n.filter(Z).map(X),e[0]=n,e[1]=i):i=e[1];const u=i,c=H();let a;return e[2]!==c||e[3]!==t||e[4]!==r.id||e[5]!==r.slug||e[6]!==u||e[7]!==o?(a=(l,x)=>{W({orgId:r.id,userId:o},l,u),c();const _=crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:_},search:{...x?.search??{},virtualmcpid:l}})},e[2]=c,e[3]=t,e[4]=r.id,e[5]=r.slug,e[6]=u,e[7]=o,e[8]=a):a=e[8],a}function X(e){return e.id}function Z(e){return!!e.pinned}export{me as S,h as T,H as a,W as b,ge as c,fe as d,se as e,ne as f,ue as g,ae as h,Oe as i,re as j,Se as k,te as l,de as m,ce as n,pe as o,ie as p,le as r,oe as s,he as u};
1
+ import{L as v,r as f,e as C,j,f as N,q as D,b as F}from"./index-Cpkh2ZIG.js";import{a as q}from"./use-virtual-mcp-Ce0GfiFh.js";const h="__tool_call_runs__",w=["requires_action","in_progress","failed","expired","completed"];function te(e){const t=new Map(w.map(r=>[r,[]]));for(const r of e){const n=r.status??"completed";(t.get(n)??t.get("completed")).push(r)}return w.map(r=>({status:r,threads:t.get(r)}))}function re(e,t){const r=new Map;for(const u of e){if(u.id.startsWith("thrd_welcome_"))continue;const c=u.virtual_mcp_id??h,a=r.get(c);a?(a.threads.push(u),(u.updated_at??"")>a.latestUpdatedAt&&(a.latestUpdatedAt=u.updated_at??"")):r.set(c,{virtualMcpId:c,threads:[u],latestUpdatedAt:u.updated_at??""})}const n=t!==null?r.get(t):void 0;n&&t&&r.delete(t);const s=r.get(h);s&&r.delete(h);const o=[...r.values()].sort((u,c)=>c.latestUpdatedAt.localeCompare(u.latestUpdatedAt)),i=[];return n&&n.threads.length>0&&i.push(n),i.push(...o),s&&s.threads.length>0&&i.push(s),i}const R=new Map,A=new Map;function P(e){return`${e.orgId}:${e.userId}`}function E(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}catch{return[]}}function T(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function $(e){const t=P(e),r=R.get(t);if(r)return r;const n=v.sidebarGroupOrder(e.orgId,e.userId);let s=!1;try{s=localStorage.getItem(n)!==null}catch{}let o=O(n);if(!s&&o.length===0&&e.userId!=="anon"){const i=O(E(e.orgId));i.length>0&&(o=i)}return R.set(t,o),o}function p(e,t){const r=new Set(t);return $(e).filter(n=>!r.has(n))}function g(e,t){R.set(P(e),t),T(v.sidebarGroupOrder(e.orgId,e.userId),t)}function m(e){const t=A.get(e);if(t)return t;const r=O(v.sidebarOrgPinnedOrder(e));return A.set(e,r),r}function S(e,t){A.set(e,t),T(v.sidebarOrgPinnedOrder(e),t)}function ne(e,t){g(e,t)}function se(e,t){S(e,t)}function k(e,t){return e===t||e===h}function I(e,t){return t.includes(e)}function B(e,t){return e.map(r=>r.virtualMcpId).filter(r=>!k(r,t))}function oe(e,t,r,n){const s=new Set(n);return B(e,r).filter(o=>t==="org"?s.has(o):!s.has(o))}function J(e,t){const r=new Set(e),n=t.filter(s=>!r.has(s));return n.length===0?e:[...e,...n]}function ie(e,t,r){const n=new Set(r),s=[],o=[];let i,u;for(const c of e){const a=c.virtualMcpId;if(t&&a===t){i=c;continue}if(a===h){u=c;continue}if(n.has(a)){s.push(c);continue}o.push(c)}return{decopilot:i,orgPinned:s,user:o,toolCallRuns:u}}function L(e,t,r,n=[],s=[]){const o=r?e.find(d=>d.virtualMcpId===r):void 0,i=e.find(d=>d.virtualMcpId===h),u=new Set(n),c=n.filter(d=>!k(d,r)),a=J(s,c),l=t.filter(d=>!u.has(d)),x=new Map(e.map(d=>[d.virtualMcpId,d])),_=d=>{const U=x.get(d);return U||{virtualMcpId:d,threads:[],latestUpdatedAt:""}},G=a.filter(d=>u.has(d)).map(_),K=l.map(_),b=[];return o&&b.push(o),b.push(...G,...K),i&&b.push(i),{groups:b,userOrder:l,orgOrder:G.map(d=>d.virtualMcpId)}}function Y(e,t){const r=new Set(t);m(e.orgId).length===0&&t.length>0&&S(e.orgId,[...t]);const s=v.sidebarGroupOrder(e.orgId,e.userId);if(O(s).length>0)return;const o=O(E(e.orgId));if(o.length===0)return;const i=o.filter(u=>!r.has(u));g(e,i)}function M(e,t){const r=new Set(t),n=$(e),s=n.filter(o=>!r.has(o));s.length!==n.length&&g(e,s)}function ue(e,t,r,n=[]){Y(e,n),M(e,n);const s=p(e,n),o=m(e.orgId),{userOrder:i,orgOrder:u}=L(t,s,r,n,o);(i.length!==s.length||i.some((c,a)=>c!==s[a]))&&g(e,i),(u.length!==o.length||u.some((c,a)=>c!==o[a]))&&S(e.orgId,u)}function ae(e,t,r,n=[]){const s=p(e,n),o=m(e.orgId);return L(t,s,r,n,o).groups}function ce(e,t,r){if(r){const o=p(e,[t]).filter(u=>u!==t);g(e,o);const i=m(e.orgId);i.includes(t)||S(e.orgId,[...i,t]);return}const n=m(e.orgId).filter(o=>o!==t);S(e.orgId,n);const s=p(e,[]);s.includes(t)||g(e,[...s,t])}function W(e,t,r=[]){if(r.includes(t))return;const n=p(e,r);n.includes(t)||g(e,[t,...n])}function de(e,t,r=[]){const n=p(e,r),s=n.filter(o=>o!==t);s.length!==n.length&&g(e,s)}function le(e,t,r){const n=e.indexOf(t),s=e.indexOf(r);if(n===-1||s===-1||n===s)return e;const o=[...e],[i]=o.splice(n,1);return i===void 0?e:(o.splice(s,0,i),o)}function fe(e,t,r,n){if(e==="org")return n;const s=p(t,r),o=new Set(n),i=s.filter(u=>!o.has(u));return[...n,...i]}function ge(e,t,r){const n=I(e,r),s=I(t,r);return n===s}const y=f.createContext(null);function pe(e){const t=C.c(7),{children:r}=e,[n,s]=f.useState(!1),[o,i]=f.useState(0);let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i(z),t[0]=u):u=t[0];const c=u;let a;t[1]!==n||t[2]!==o?(a={empty:n,setEmpty:s,orderRevision:o,bumpOrderRevision:c},t[1]=n,t[2]=o,t[3]=a):a=t[3];let l;return t[4]!==r||t[5]!==a?(l=j.jsx(y.Provider,{value:a,children:r}),t[4]=r,t[5]=a,t[6]=l):l=t[6],l}function z(e){return e+1}function he(){return f.useContext(y)?.empty??!1}function Oe(){return f.useContext(y)?.orderRevision??0}function H(){return f.useContext(y)?.bumpOrderRevision??Q}function Q(){}function me(e){const{value:t}=e,r=f.useContext(y),[n,s]=f.useState(null);return r&&n!==t&&(r.setEmpty(t),s(t)),null}function Se(){const e=C.c(9),t=N(),{org:r}=D(),n=q(),{data:s}=F.useSession(),o=s?.user?.id??"anon";let i;e[0]!==n?(i=n.filter(Z).map(X),e[0]=n,e[1]=i):i=e[1];const u=i,c=H();let a;return e[2]!==c||e[3]!==t||e[4]!==r.id||e[5]!==r.slug||e[6]!==u||e[7]!==o?(a=(l,x)=>{W({orgId:r.id,userId:o},l,u),c();const _=crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:_},search:{...x?.search??{},virtualmcpid:l}})},e[2]=c,e[3]=t,e[4]=r.id,e[5]=r.slug,e[6]=u,e[7]=o,e[8]=a):a=e[8],a}function X(e){return e.id}function Z(e){return!!e.pinned}export{me as S,h as T,H as a,W as b,ge as c,fe as d,se as e,ne as f,ue as g,ae as h,Oe as i,re as j,Se as k,te as l,de as m,ce as n,pe as o,ie as p,le as r,oe as s,he as u};