decocms 3.96.4 → 3.96.5

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 (212) hide show
  1. package/dist/client/assets/{AlertCircle-dbftHQmK.js → AlertCircle-CGI9YeEW.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BL1Px0E9.js → ArrowUpRight-vvnxfrhD.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-DBeznK5m.js → CheckCircle-CV8dPqCC.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-COzQtuhj.js → ChevronDown-CFQ6x03W.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-DC-jImh5.js → ChevronLeft-oVnhOCcx.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-B7wnb55N.js → ChevronRight-DgpQ9Y5V.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-CKeSWNtI.js → ChevronUp-BmVTUI2P.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-BPcJKzLc.js → DotsVertical-DcdvaEO1.js} +1 -1
  9. package/dist/client/assets/{Eye-Bpanobic.js → Eye-BTw9kDZA.js} +1 -1
  10. package/dist/client/assets/{FilterLines-S9HB4c8r.js → FilterLines-DKlrz69S.js} +1 -1
  11. package/dist/client/assets/{Globe01-4_Ewv1K-.js → Globe01-DttyUzO7.js} +1 -1
  12. package/dist/client/assets/{Globe04-C3wSrtbi.js → Globe04-DW6IRVMY.js} +1 -1
  13. package/dist/client/assets/{HardDrive-CpeuKWhh.js → HardDrive-YKPdMqiS.js} +1 -1
  14. package/dist/client/assets/{Key01-wXHzLtUH.js → Key01-BhO9abqN.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-BdFmYjbe.js → LayoutLeft-aXTNra6X.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-CHtwdZjh.js → LinkExternal01-C062SZZa.js} +1 -1
  17. package/dist/client/assets/{Monitor01-BuP48Mm8.js → Monitor01-D78svAnt.js} +1 -1
  18. package/dist/client/assets/{Palette-DYAliuC4.js → Palette-DFWqcmWQ.js} +1 -1
  19. package/dist/client/assets/{Play-NqlNWemN.js → Play-rgTMUAag.js} +1 -1
  20. package/dist/client/assets/{Plus-CTFCOBSH.js → Plus-DdqDA8_u.js} +1 -1
  21. package/dist/client/assets/{SearchMd-CWI6U0qY.js → SearchMd-rLeI5er0.js} +1 -1
  22. package/dist/client/assets/{Settings02-reHKDGzE.js → Settings02-tUb8KXCV.js} +1 -1
  23. package/dist/client/assets/{Shield01-DtIA1JOW.js → Shield01-BC1nfph5.js} +1 -1
  24. package/dist/client/assets/{Star01-DcDNHFNK.js → Star01-DrAQvnH_.js} +1 -1
  25. package/dist/client/assets/{Stars01-JWMmR9fv.js → Stars01-CgojkEWv.js} +1 -1
  26. package/dist/client/assets/{Stars02-CDLI_j5A.js → Stars02-Opf9zfSz.js} +1 -1
  27. package/dist/client/assets/{Sun-bUJzdMa0.js → Sun-Dc9ceJdQ.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-vAH_wjyu.js → SwitchHorizontal01-CJkFhePk.js} +1 -1
  29. package/dist/client/assets/{Tool01-DLiIJmav.js → Tool01-J-T-mSEo.js} +1 -1
  30. package/dist/client/assets/{Trash01-Djrhg6zQ.js → Trash01-Sp9ZUek7.js} +1 -1
  31. package/dist/client/assets/{Upload01-CcIe4tS2.js → Upload01-BCTP4Z0b.js} +1 -1
  32. package/dist/client/assets/{User01-BI07bAI_.js → User01-juLKFEru.js} +1 -1
  33. package/dist/client/assets/{Users01-8gjSr888.js → Users01-BmcTtaQC.js} +1 -1
  34. package/dist/client/assets/{Users03-B0tibYwm.js → Users03-DL0Fo9Xd.js} +1 -1
  35. package/dist/client/assets/{X-Gzr8PKvq.js → X-CBDZXUmU.js} +1 -1
  36. package/dist/client/assets/{XCircle-BoVtAfmd.js → XCircle-CQ4pWiQn.js} +1 -1
  37. package/dist/client/assets/{XClose-F67o03dn.js → XClose-DdRGs2Zy.js} +1 -1
  38. package/dist/client/assets/{Zap-GE8xc0c-.js → Zap-zsf-zZZV.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-BcRHgSfa.js → ZapSquare-CLtnN3HY.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-DQSoQNVt.js → ZoomOut-ClLyV8h9.js} +1 -1
  41. package/dist/client/assets/{access-gate-BdOJnaAk.js → access-gate-CkeiTGmg.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-BahTuNDb.js → add-section-modal-08bfake5.js} +1 -1
  43. package/dist/client/assets/{agent-icon-B_3e-iYc.js → agent-icon-DlWnRnUi.js} +1 -1
  44. package/dist/client/assets/{agents-list-DgFpvXTs.js → agents-list-IJ21Hiy6.js} +1 -1
  45. package/dist/client/assets/{ai-providers-CHlIQ1l_.js → ai-providers-8IQFnrj7.js} +1 -1
  46. package/dist/client/assets/{alert-BTVkye0E.js → alert-B4cc2HyW.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-Z3EoybWN.js → alert-dialog-DATF3lW9.js} +1 -1
  48. package/dist/client/assets/{app-editor-DjRkkFxo.js → app-editor-hJ91IzuA.js} +1 -1
  49. package/dist/client/assets/{auth-Cp97bBQe.js → auth-BkJFSmmc.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-B4z0xq_6.js → auth-catchall-DWPDVD00.js} +1 -1
  51. package/dist/client/assets/{auth-entry-C-Ya2dTz.js → auth-entry-OkX869K2.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-Dx-aufas.js → auth-split-layout-CaLFfPo-.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-BdsQHxSx.js → authenticate-and-persist-oauth-BBlle4qr.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-Cz_lbNyv.js → automation-list-row-DK0gnmJ0.js} +1 -1
  55. package/dist/client/assets/{automation-runs-DxLEYCBc.js → automation-runs-Bg9vuuli.js} +1 -1
  56. package/dist/client/assets/{automations-DY6H77BM.js → automations-uepEmcUH.js} +1 -1
  57. package/dist/client/assets/{avatar-0NYZSzd7.js → avatar-CPo1nig0.js} +1 -1
  58. package/dist/client/assets/{badge-DZeTYH6R.js → badge-B1gtEAIw.js} +1 -1
  59. package/dist/client/assets/{block-document-DqiGh6dO.js → block-document-DQJVZQhL.js} +1 -1
  60. package/dist/client/assets/{brand-context-POkJCnAK.js → brand-context-BL_wxRIA.js} +1 -1
  61. package/dist/client/assets/{buckets-kkfv_CZO.js → buckets-CewM0o6Y.js} +1 -1
  62. package/dist/client/assets/{capability-load-error-BqnmcNP0.js → capability-load-error-BQSeacoX.js} +1 -1
  63. package/dist/client/assets/{card-CPc8005q.js → card-301-f9oZ.js} +1 -1
  64. package/dist/client/assets/{category-editor-DzQTcpsS.js → category-editor-D0yzd-p1.js} +1 -1
  65. package/dist/client/assets/{chat-context-COfZxjyk.js → chat-context-C-g8HnbO.js} +1 -1
  66. package/dist/client/assets/{checkbox-D7Ln6xAq.js → checkbox-C2AtwjWU.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-DD49NKVj.js → cli-auth-success-BQdN3zl2.js} +1 -1
  68. package/dist/client/assets/{collection-detail-BM39Yako.js → collection-detail-BEgN_hwE.js} +1 -1
  69. package/dist/client/assets/{collection-display-button-DdSafU-n.js → collection-display-button-BDmxh6OU.js} +1 -1
  70. package/dist/client/assets/{collection-search-D9j8y3be.js → collection-search-CI2jKtSY.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-CsYK3TsS.js → collection-tabs-B4YIMs1F.js} +1 -1
  72. package/dist/client/assets/{command-BTzbLSgw.js → command-he4zIwLS.js} +1 -1
  73. package/dist/client/assets/{commerce-onboarding-CP30bP7i.js → commerce-onboarding-B5Zsnfbg.js} +1 -1
  74. package/dist/client/assets/{connect-desktop-dialog-CsY3UBRm.js → connect-desktop-dialog-BzREaNyR.js} +1 -1
  75. package/dist/client/assets/{connection-card-uzLg1Gbb.js → connection-card-DbJd9GDr.js} +1 -1
  76. package/dist/client/assets/{connection-detail-BJ3qIrfM.js → connection-detail-C84cBbuw.js} +1 -1
  77. package/dist/client/assets/{connection-form-helpers-ChpMmEgA.js → connection-form-helpers-BHUSQkEW.js} +1 -1
  78. package/dist/client/assets/{connections-ZOurBc8l.js → connections-zLHS23D9.js} +1 -1
  79. package/dist/client/assets/{context-menu-R2y4cCX-.js → context-menu-4xzDWZlX.js} +1 -1
  80. package/dist/client/assets/{decopilot-sse-pool-zWYx6dP0.js → decopilot-sse-pool-CyfRQDKq.js} +1 -1
  81. package/dist/client/assets/{decopilot--oHgsisq.js → decopilot-uL2xWxTU.js} +1 -1
  82. package/dist/client/assets/{dialog-yThFXMvQ.js → dialog-oqf4Z70C.js} +1 -1
  83. package/dist/client/assets/{domain-settings-C4taWk2n.js → domain-settings-BOv1TnH0.js} +1 -1
  84. package/dist/client/assets/{drawer-1JZXM5JR.js → drawer-DHWoMRsI.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-REyIaR8O.js → dropdown-menu-CRMVpccp.js} +1 -1
  86. package/dist/client/assets/{empty-state-Tl4LG3em.js → empty-state--KE_JrbZ.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-DokKs9Ll.js → extract-connection-data-CWGDMNpL.js} +1 -1
  88. package/dist/client/assets/{file-explorer-D27IEZCa.js → file-explorer-D-FLDfeS.js} +1 -1
  89. package/dist/client/assets/{file-type-icon-DVTAHGnU.js → file-type-icon-CUmQjTlJ.js} +1 -1
  90. package/dist/client/assets/{files-DqYny8di.js → files-Ok4AUNAT.js} +1 -1
  91. package/dist/client/assets/{form-C-5v_otJ.js → form-bc6He2pm.js} +1 -1
  92. package/dist/client/assets/{general-xoC8noxR.js → general-BgU73zuM.js} +1 -1
  93. package/dist/client/assets/{github-repo-picker-DZomcn1p.js → github-repo-picker-BGkkYxNL.js} +1 -1
  94. package/dist/client/assets/{hooks-CZZpYk_n.js → hooks-EZaWpiDA.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-hHJH44XO.js → import-from-deco-dialog-rGGPIhtB.js} +1 -1
  96. package/dist/client/assets/{index-7LzOhXIl.js → index-BBWx35pc.js} +1 -1
  97. package/dist/client/assets/{index-BW5QDZjS.js → index-BLr-QcN3.js} +1 -1
  98. package/dist/client/assets/{index-B7tzG_Gm.js → index-BTZgb2Ta.js} +1 -1
  99. package/dist/client/assets/{index-CIdyczkg.js → index-BgQqsveF.js} +1 -1
  100. package/dist/client/assets/{index-Rt1M74Q-.js → index-BqO1unRD.js} +1 -1
  101. package/dist/client/assets/{index-B3SfOQW0.js → index-BvNKXplh.js} +1 -1
  102. package/dist/client/assets/{index-Ci6vxoxx.js → index-CEiAOVkZ.js} +1 -1
  103. package/dist/client/assets/{index-DhKBvPAn.js → index-D8pYLchm.js} +1 -1
  104. package/dist/client/assets/{index-BbfBe-CR.js → index-DLCC_PUB.js} +1 -1
  105. package/dist/client/assets/{index-CCUd-Voz.js → index-DWK5-mXM.js} +3 -3
  106. package/dist/client/assets/{index-uWQvS5wR.js → index-DsxfHih8.js} +1 -1
  107. package/dist/client/assets/{index-CKv0Xz7X.js → index-DyhAduKY.js} +1 -1
  108. package/dist/client/assets/{index-DgCHPBry.js → index-O1nb3EXd.js} +1 -1
  109. package/dist/client/assets/{index-DfCO9yS7.js → index-_4-LDEiN.js} +5 -5
  110. package/dist/client/assets/{index-redirect-Cm7rQ-B3.js → index-redirect-CsbPuQQG.js} +1 -1
  111. package/dist/client/assets/{input-BVQ8xSqA.js → input-0pg4MEkU.js} +1 -1
  112. package/dist/client/assets/{integration-icon-DYpngaF4.js → integration-icon-BpZ9CVa4.js} +1 -1
  113. package/dist/client/assets/{label-32vlyB30.js → label-CXGaTI6I.js} +1 -1
  114. package/dist/client/assets/{login-CQMmW__Q.js → login-DqZwlZrC.js} +1 -1
  115. package/dist/client/assets/{mcp-oauth-DkbiQ8UX.js → mcp-oauth-C_J5OPHY.js} +1 -1
  116. package/dist/client/assets/{members-DN8bXPVe.js → members-Djk8pcpn.js} +1 -1
  117. package/dist/client/assets/{monaco-editor-Dg9BYb2X.js → monaco-editor-Ccvou2F3.js} +1 -1
  118. package/dist/client/assets/{monitoring-stats-row-BAFCLI14.js → monitoring-stats-row-2K_gWpKl.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-CsjSPaQQ.js → oauth-callback-CpFoiSt2.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-ai-provider-B-WKKOAZ.js → oauth-callback-ai-provider-Cw4ryAyd.js} +1 -1
  121. package/dist/client/assets/{onboarding-D54KhHY5.js → onboarding-CoIkkJfx.js} +1 -1
  122. package/dist/client/assets/{org-install-fO5-x4DG.js → org-install-CSHGu0I5.js} +1 -1
  123. package/dist/client/assets/{org-layout-BqunduDR.js → org-layout-A_pLrezL.js} +1 -1
  124. package/dist/client/assets/{organization-choice-QBjICBHY.js → organization-choice-wcca8EM6.js} +1 -1
  125. package/dist/client/assets/{page-seo-form-DYIvU6go.js → page-seo-form-CdQ5MDby.js} +1 -1
  126. package/dist/client/assets/page-seo-sheet-DCGpFgYN.js +1 -0
  127. package/dist/client/assets/{popover-CoUGww4S.js → popover-2guStUMP.js} +1 -1
  128. package/dist/client/assets/{post-editor-CZn9OilW.js → post-editor-DUc-pXnk.js} +1 -1
  129. package/dist/client/assets/{preview-dialog-OpResFOB.js → preview-dialog-d1t2GI9N.js} +1 -1
  130. package/dist/client/assets/{primitives-Bay6Myt9.js → primitives-B7tCjb6w.js} +1 -1
  131. package/dist/client/assets/{profile-BEPBZywd.js → profile-DRZIkESY.js} +1 -1
  132. package/dist/client/assets/project-app-view-CGbP7s9_.js +1 -0
  133. package/dist/client/assets/record-editor-CSAkv-Ts.js +1 -0
  134. package/dist/client/assets/registry-B3aV8vQy.js +2 -0
  135. package/dist/client/assets/{registry-layout-DsDQkrP1.js → registry-layout-XB6VuZ-B.js} +1 -1
  136. package/dist/client/assets/{require-capability-Nb60piYr.js → require-capability-jUfpU2Ei.js} +1 -1
  137. package/dist/client/assets/{required-auth-layout-DDS__kuH.js → required-auth-layout-BbiuTSh9.js} +1 -1
  138. package/dist/client/assets/{reset-password-Csd4wetu.js → reset-password-BUL1kJKE.js} +1 -1
  139. package/dist/client/assets/{roles-Bg9VstYY.js → roles-BdhIJ6hD.js} +1 -1
  140. package/dist/client/assets/{save-status-r_4WHovO.js → save-status-lA_SizpN.js} +1 -1
  141. package/dist/client/assets/{scroll-area-BylXHTu0.js → scroll-area-CZjJeKoi.js} +1 -1
  142. package/dist/client/assets/{search-input-BrY5jFZ8.js → search-input-D_k-CkjM.js} +1 -1
  143. package/dist/client/assets/{secrets-DLnzC_s-.js → secrets-DkCi0zkZ.js} +1 -1
  144. package/dist/client/assets/{sections-editor-D_cOhHVR.js → sections-editor-Bu4IaugN.js} +1 -1
  145. package/dist/client/assets/{select-BW8okfAt.js → select-10n1TDUB.js} +1 -1
  146. package/dist/client/assets/{select-model-BEAgYVCc.js → select-model-CsdWgsh9.js} +1 -1
  147. package/dist/client/assets/{seo-editor-DQwATcqL.js → seo-editor-C4K0aGge.js} +1 -1
  148. package/dist/client/assets/{settings-layout-CKIqYQAn.js → settings-layout-Bz3gg4jE.js} +1 -1
  149. package/dist/client/assets/{settings-section-D6wgcG2l.js → settings-section-ocxYpxO5.js} +1 -1
  150. package/dist/client/assets/{sheet-BQ9RKgQG.js → sheet-BN0sAkeB.js} +1 -1
  151. package/dist/client/assets/{shell-controls-paJw7uFi.js → shell-controls-5IazGNpv.js} +1 -1
  152. package/dist/client/assets/{shell-layout-Dgskww4m.js → shell-layout-BM1lnVCu.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-AI4Sfb_6.js → shell-route-loading-BzB-HK5n.js} +1 -1
  154. package/dist/client/assets/{sidebar-Bl9NEhpC.js → sidebar-BBXcFmVB.js} +1 -1
  155. package/dist/client/assets/{skeleton-CJMhPLg9.js → skeleton-C7l1EvAp.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-B-qjMTd2.js → sortable.esm-DdU8Z993.js} +1 -1
  157. package/dist/client/assets/{sso-BK1wBncU.js → sso-D31VGqgg.js} +1 -1
  158. package/dist/client/assets/store-registry-W349GgmG.js +2 -0
  159. package/dist/client/assets/{store-CtZiSf3h.js → store-yPvAMxIf.js} +1 -1
  160. package/dist/client/assets/{studio-tools-BcFzFyMx.js → studio-tools-BEElHn9g.js} +1 -1
  161. package/dist/client/assets/{switch-CDFxUsyI.js → switch-CuQ5F5ud.js} +1 -1
  162. package/dist/client/assets/{table-C8sZafeS.js → table-BTePsGzF.js} +1 -1
  163. package/dist/client/assets/{tabs-CeLfQ8Ev.js → tabs-DN-S3fYo.js} +1 -1
  164. package/dist/client/assets/{task-status-DqdwZCPJ.js → task-status-Dz9fl1uz.js} +1 -1
  165. package/dist/client/assets/{textarea-BmrHq9o-.js → textarea-BBBN00AO.js} +1 -1
  166. package/dist/client/assets/{toggle-group-DsXmQJP7.js → toggle-group-Dp0mXYl5.js} +1 -1
  167. package/dist/client/assets/{toolbar-Bs4Lh-jd.js → toolbar-CoqaEC7w.js} +1 -1
  168. package/dist/client/assets/{tooltip-CCclMglh.js → tooltip-9nuSf0Eo.js} +1 -1
  169. package/dist/client/assets/{types-B066iJEK.js → types-DJ4e5Dwk.js} +15 -15
  170. package/dist/client/assets/{use-ai-providers-DA1lQlwz.js → use-ai-providers-DHY4EukY.js} +1 -1
  171. package/dist/client/assets/{use-automations-CD15Lwph.js → use-automations-BX2_pqMj.js} +1 -1
  172. package/dist/client/assets/{use-capability-Df8DWOlr.js → use-capability-Bc2arkRi.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-BrToPw0g.js → use-clock-tick-B4gEbGkY.js} +1 -1
  174. package/dist/client/assets/{use-collections-vaY04X7G.js → use-collections-BBNXU__l.js} +1 -1
  175. package/dist/client/assets/{use-connection-BCpkvz33.js → use-connection-Bp3I0zHx.js} +1 -1
  176. package/dist/client/assets/{use-copy-DzkSW3zW.js → use-copy-CD0A5U6A.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-Ba8HEd9M.js → use-create-virtual-mcp-Ziw_phai.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-CwikoZVg.js → use-debounced-autosave-Ds4ekdYJ.js} +1 -1
  179. package/dist/client/assets/{use-delete-connection-DAAotokM.js → use-delete-connection-CU5lZ7mD.js} +1 -1
  180. package/dist/client/assets/{use-file-configs-Bq2hwD2F.js → use-file-configs-CFmsdqGE.js} +1 -1
  181. package/dist/client/assets/{use-infinite-scroll-vfqkm6vH.js → use-infinite-scroll-BvzAR1m3.js} +1 -1
  182. package/dist/client/assets/{use-join-requests-_cojx5m1.js → use-join-requests-WFq2zJFp.js} +1 -1
  183. package/dist/client/assets/{use-mcp-client-D9-QWVA2.js → use-mcp-client-CtNpDxS2.js} +1 -1
  184. package/dist/client/assets/{use-mcp-prompts-CAL52sQg.js → use-mcp-prompts-DPHk7QcK.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-CgxT897W.js → use-mcp-tools-DqoTBu2f.js} +1 -1
  186. package/dist/client/assets/{use-members-CR16VHQ0.js → use-members-CIo8LAwH.js} +1 -1
  187. package/dist/client/assets/{use-mobile-D3X5Vcfl.js → use-mobile-Bmv9jQYA.js} +1 -1
  188. package/dist/client/assets/{use-navigate-to-agent-C_XaBi9m.js → use-navigate-to-agent-D_Ssa6F6.js} +1 -1
  189. package/dist/client/assets/{use-org-auth-client-Dwnmzpnb.js → use-org-auth-client-CgJBT_OH.js} +1 -1
  190. package/dist/client/assets/{use-org-sso-DwW6hYMd.js → use-org-sso-BMgSaVo8.js} +1 -1
  191. package/dist/client/assets/{use-organization-roles-B7wmDYFm.js → use-organization-roles-Kuszj5ry.js} +1 -1
  192. package/dist/client/assets/{use-organization-settings-Ba96OUeb.js → use-organization-settings-B2MQwujT.js} +1 -1
  193. package/dist/client/assets/{use-registry-connections-BFVK-RAT.js → use-registry-connections-_9RxXThD.js} +1 -1
  194. package/dist/client/assets/{use-secrets-HRPgwn9E.js → use-secrets-CsDQveVs.js} +1 -1
  195. package/dist/client/assets/{use-status-sounds-DyWmjXBb.js → use-status-sounds-RG0Tguvk.js} +1 -1
  196. package/dist/client/assets/{use-view-mode-CFhJa7yQ.js → use-view-mode-Bp0J-dDg.js} +1 -1
  197. package/dist/client/assets/{use-virtual-mcp-BeAABJAf.js → use-virtual-mcp-CIINi4nG.js} +1 -1
  198. package/dist/client/assets/useInfiniteQuery-jq8bYChD.js +1 -0
  199. package/dist/client/assets/useSuspenseInfiniteQuery-C0tNVDLp.js +1 -0
  200. package/dist/client/assets/{useSuspenseQueries-fHl-FN4C.js → useSuspenseQueries-B2nnZUjN.js} +1 -1
  201. package/dist/client/assets/{variant-calendar-B0CuSWJv.js → variant-calendar-CPEOIGFW.js} +1 -1
  202. package/dist/client/assets/{view-mode-toggle-B4pxENgz.js → view-mode-toggle-DMu6K7dq.js} +1 -1
  203. package/dist/client/index.html +1 -1
  204. package/dist/server/cli.js +1 -1
  205. package/package.json +1 -1
  206. package/dist/client/assets/page-seo-sheet-RoBaXPrv.js +0 -1
  207. package/dist/client/assets/project-app-view-L0iI_EAc.js +0 -1
  208. package/dist/client/assets/record-editor-BtyrW4NY.js +0 -1
  209. package/dist/client/assets/registry-BbGMMFGB.js +0 -2
  210. package/dist/client/assets/store-registry-Cvknd8-t.js +0 -2
  211. package/dist/client/assets/useInfiniteQuery-voQ7P-ZC.js +0 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-BxwheVES.js +0 -1
@@ -1,14 +1,14 @@
1
- import{bl as p,bm as t,aF as y,s as a,c5 as q,o as s,aG as f,aD as u,al as m,b7 as x,bj as O,c6 as fe,c7 as ge,c8 as $,c9 as j,ca as be,cb as ye,cc as B,cd as Se,ce as _e,cf as He,cg as Me,ch as ke,ci as Pe,cj as qe,ck as Te,bx as Ie,cl as Ee,cm as Le,cn as ze,co as De,cp as Ae,cq as Ue,cr as Ne,bw as Oe,r as te,c as F,j as b,cs as je,ct as $e,w as Be,l as oe}from"./index-CCUd-Voz.js";import{P as Fe}from"./use-mcp-client-D9-QWVA2.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 Ve(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)+`
1
+ import{bl as p,bm as t,aF as y,s as a,c5 as q,o as s,aG as g,aD as u,al as m,b7 as x,bj as O,c6 as ge,c7 as fe,c8 as B,c9 as j,ca as be,cb as ye,cc as $,cd as Se,ce as _e,cf as He,cg as Me,ch as ke,ci as Pe,cj as qe,ck as Te,bx as Ie,cl as Ee,cm as Le,cn as ze,co as De,cp as Ae,cq as Ue,cr as Ne,bw as Oe,r as te,c as F,j as b,cs as je,ct as Be,w as $e,l as oe}from"./index-DWK5-mXM.js";import{P as Fe}from"./use-mcp-client-CtNpDxS2.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 Ve(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 f=(l.index??0)+l[0].length;return r.slice(0,f)+`
2
+ `+i+r.slice(f)}const c=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,d=r.match(c);if(d){const f=(d.index??0)+d[0].length;return r.slice(0,f)+`
3
3
  <head>
4
4
  `+i+`
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)+`
5
+ </head>`+r.slice(f)}const h=/<!DOCTYPE[^>]*>/i,v=r.match(h);if(v){const f=(v.index??0)+v[0].length;return r.slice(0,f)+`
6
6
  <head>
7
7
  `+i+`
8
- </head>`+r.slice(g)}return`<head>
8
+ </head>`+r.slice(f)}return`<head>
9
9
  `+i+`
10
10
  </head>
11
- `+r}const We=/^https?:\/\/(\*\.)?[a-zA-Z0-9._-]+(:\d+)?\/?$/;function N(r){return!r||r.length===0?[]:r.filter(e=>We.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 Fe{_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.
11
+ `+r}const We=/^https?:\/\/(\*\.)?[a-zA-Z0-9._-]+(:\d+)?\/?$/;function N(r){return!r||r.length===0?[]:r.filter(e=>We.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 f=o.join(" ");return["default-src 'none'",c?`script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval' ${f}`:"script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'",c?`style-src 'unsafe-inline' ${f}`:"style-src 'unsafe-inline'",c?`img-src * data: blob: ${f}`:"img-src * data: blob:",c?`media-src * data: blob: ${f}`:"media-src * data: blob:",c?`font-src data: ${f}`:"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 Fe{_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.).
@@ -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.`),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).
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: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 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(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.
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: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: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: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.")}),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,7 +37,7 @@ 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:f().optional().describe(`Visual boundary preference - true if view prefers a visible border.
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.
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
 
@@ -45,8 +45,8 @@ Boolean requesting whether a visible border and background is provided by the ho
45
45
  - \`false\`: request no visible border + background
46
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: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},De,{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},Ue,{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.
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([ge,fe])).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(B).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: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: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(B).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:$.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:$.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 gt="ui/resourceUri";function ft(r){let e=r._meta?.ui?.resourceUri;if(e===void 0&&(e=r._meta?.[gt]),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},De,{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},Ue,{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.).
@@ -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: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).
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: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 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(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.
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: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.")}),Ht=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: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,7 +75,7 @@ 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:f().optional().describe(`Visual boundary preference - true if view prefers a visible border.
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.
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
 
@@ -83,5 +83,5 @@ Boolean requesting whether a visible border and background is provided by the ho
83
83
  - \`false\`: request no visible border + background
84
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: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 Dt(){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:Dt(),...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 Ut(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=Ut(()=>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:Ve(e.text,{resourceCsp:e._meta?.ui?.csp})}function Ce(r){const e=F.c(39),{html:o,uri:i,orgId:n,toolInfo:l,toolInput:c,toolResult:d,displayMode:h,minHeight:v,maxHeight:g,client:E,onMessage:V,onUpdateModelContext:W,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]!==V||e[5]!==Z||e[6]!==K||e[7]!==W||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:V,onUpdateModelContext:W,onTeardown:K,onRequestDisplayMode:Z},e[0]=E,e[1]=w,e[2]=Y,e[3]=J,e[4]=V,e[5]=Z,e[6]=K,e[7]=W,e[8]=n,e[9]=l,e[10]=c,e[11]=d,e[12]=L):L=e[12];const{height:Q,isLoading:z,error:D,iframeRef:G}=Ot(L);if(!o)return null;if(D){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]!==D?(P=b.jsx("span",{className:"text-sm",children:D}),e[15]=D,e[16]=P):P=e[16];let U;return e[17]!==k||e[18]!==P?(U=b.jsx("div",{className:k,children:P}),e[17]=k,e[18]=P,e[19]=U):U=e[19],U}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=F.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=F.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 Wt(r){const e=F.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{Wt as M,Kt as a,Zt as g};
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([ge,fe])).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(B).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: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: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(B).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:$.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:$.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 Dt(){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:Dt(),...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 Ut(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)return;e.onerror=()=>{this.disposed||this.set({error:"Failed to load app",isLoading:!1})};let o=!1;e.onload=()=>{if(!this.disposed){if(!o){o=!0;return}this.set({height:this.config.minHeight,isLoading:!0,error:null}),this.connectBridge(e)}},this.connectBridge(e)};connectBridge(e){this.clearTimeout(),this.unsubTheme?.(),this.unsubTheme=null,this.bridge&&(this.bridge.close(),this.bridge=null);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=Ut(()=>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:Ve(e.text,{resourceCsp:e._meta?.ui?.csp})}function Ce(r){const e=F.c(39),{html:o,uri:i,orgId:n,toolInfo:l,toolInput:c,toolResult:d,displayMode:h,minHeight:v,maxHeight:f,client:E,onMessage:V,onUpdateModelContext:W,onTeardown:K,onRequestDisplayMode:Z,className:C}=r,w=h===void 0?"inline":h,J=v===void 0?150:v,Y=f===void 0?600:f;i&&!me.has(i)&&(me.add(i),$e("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]!==V||e[5]!==Z||e[6]!==K||e[7]!==W||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:V,onUpdateModelContext:W,onTeardown:K,onRequestDisplayMode:Z},e[0]=E,e[1]=w,e[2]=Y,e[3]=J,e[4]=V,e[5]=Z,e[6]=K,e[7]=W,e[8]=n,e[9]=l,e[10]=c,e[11]=d,e[12]=L):L=e[12];const{height:Q,isLoading:z,error:D,iframeRef:G}=Ot(L);if(!o)return null;if(D){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]!==D?(P=b.jsx("span",{className:"text-sm",children:D}),e[15]=D,e[16]=P):P=e[16];let U;return e[17]!==k||e[18]!==P?(U=b.jsx("div",{className:k,children:P}),e[17]=k,e[18]=P,e[19]=U):U=e[19],U}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 Bt(r){const e=F.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 $t(r){const e=F.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}=Be(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 Wt(r){const e=F.c(4);if(r.orgSlug&&r.connectionId){let i;return e[0]!==r?(i=b.jsx(Bt,{...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($t,{...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 ft({_meta:r})}catch{return}}export{Wt as M,Kt as a,Zt as g};
@@ -1 +1 @@
1
- import{c as d,D as f,q as P,K as m,k as K}from"./index-CCUd-Voz.js";import{u as S,c as T}from"./studio-tools-BcFzFyMx.js";function g(s,e){return{queryKey:m.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>await T(s,"AI_PROVIDER_KEY_LIST",{})}}function E(){const s=d.c(7),{org:e}=f(),o=S();let i;s[0]!==e.id?(i=m.aiProviders(e.id),s[0]=e.id,s[1]=i):i=s[1];let t;s[2]!==o?(t=async()=>await o.call("AI_PROVIDERS_LIST",{}),s[2]=o,s[3]=t):t=s[3];let l;s[4]!==i||s[5]!==t?(l={queryKey:i,staleTime:1/0,queryFn:t},s[4]=i,s[5]=t,s[6]=l):l=s[6];const{data:r}=P(l);return r}function R(){const s=d.c(5),{org:e}=f();let o;s[0]!==e.id||s[1]!==e.slug?(o=g(e.slug,e.id),s[0]=e.id,s[1]=e.slug,s[2]=o):o=s[2];const{data:i}=P(o);let t;return s[3]!==i?.keys?(t=i?.keys??[],s[3]=i?.keys,s[4]=t):t=s[4],t}function p(s){const e=d.c(15),{org:o}=f(),i=S();let t;e[0]!==s||e[1]!==o.id?(t=m.aiProviderModels(o.id,s??""),e[0]=s,e[1]=o.id,e[2]=t):t=e[2];const l=!!s;let r;e[3]!==s||e[4]!==i?(r=async()=>await i.call("AI_PROVIDERS_LIST_MODELS",{keyId:s??""}),e[3]=s,e[4]=i,e[5]=r):r=e[5];let n;e[6]!==t||e[7]!==l||e[8]!==r?(n={queryKey:t,enabled:l,staleTime:6e4,queryFn:r},e[6]=t,e[7]=l,e[8]=r,e[9]=n):n=e[9];const{data:a,isLoading:_}=K(n);let u;e[10]!==a?.models?(u=a?.models??[],e[10]=a?.models,e[11]=u):u=e[11];const y=!!s&&_;let c;return e[12]!==u||e[13]!==y?(c={models:u,isLoading:y},e[12]=u,e[13]=y,e[14]=c):c=e[14],c}function A(s){const e=d.c(11),{org:o}=f(),i=S();let t;e[0]!==s||e[1]!==o.id?(t=m.aiProviderModels(o.id,s),e[0]=s,e[1]=o.id,e[2]=t):t=e[2];let l;e[3]!==s||e[4]!==i?(l=async()=>await i.call("AI_PROVIDERS_LIST_MODELS",{keyId:s}),e[3]=s,e[4]=i,e[5]=l):l=e[5];let r;e[6]!==t||e[7]!==l?(r={queryKey:t,staleTime:6e4,queryFn:l},e[6]=t,e[7]=l,e[8]=r):r=e[8];const{data:n}=P(r);let a;return e[9]!==n?.models?(a=n?.models??[],e[9]=n?.models,e[10]=a):a=e[10],a}export{g as a,p as b,E as c,A as d,R as u};
1
+ import{c as d,D as f,q as P,K as m,k as K}from"./index-DWK5-mXM.js";import{u as S,c as T}from"./studio-tools-BEElHn9g.js";function g(s,e){return{queryKey:m.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>await T(s,"AI_PROVIDER_KEY_LIST",{})}}function E(){const s=d.c(7),{org:e}=f(),o=S();let i;s[0]!==e.id?(i=m.aiProviders(e.id),s[0]=e.id,s[1]=i):i=s[1];let t;s[2]!==o?(t=async()=>await o.call("AI_PROVIDERS_LIST",{}),s[2]=o,s[3]=t):t=s[3];let l;s[4]!==i||s[5]!==t?(l={queryKey:i,staleTime:1/0,queryFn:t},s[4]=i,s[5]=t,s[6]=l):l=s[6];const{data:r}=P(l);return r}function R(){const s=d.c(5),{org:e}=f();let o;s[0]!==e.id||s[1]!==e.slug?(o=g(e.slug,e.id),s[0]=e.id,s[1]=e.slug,s[2]=o):o=s[2];const{data:i}=P(o);let t;return s[3]!==i?.keys?(t=i?.keys??[],s[3]=i?.keys,s[4]=t):t=s[4],t}function p(s){const e=d.c(15),{org:o}=f(),i=S();let t;e[0]!==s||e[1]!==o.id?(t=m.aiProviderModels(o.id,s??""),e[0]=s,e[1]=o.id,e[2]=t):t=e[2];const l=!!s;let r;e[3]!==s||e[4]!==i?(r=async()=>await i.call("AI_PROVIDERS_LIST_MODELS",{keyId:s??""}),e[3]=s,e[4]=i,e[5]=r):r=e[5];let n;e[6]!==t||e[7]!==l||e[8]!==r?(n={queryKey:t,enabled:l,staleTime:6e4,queryFn:r},e[6]=t,e[7]=l,e[8]=r,e[9]=n):n=e[9];const{data:a,isLoading:_}=K(n);let u;e[10]!==a?.models?(u=a?.models??[],e[10]=a?.models,e[11]=u):u=e[11];const y=!!s&&_;let c;return e[12]!==u||e[13]!==y?(c={models:u,isLoading:y},e[12]=u,e[13]=y,e[14]=c):c=e[14],c}function A(s){const e=d.c(11),{org:o}=f(),i=S();let t;e[0]!==s||e[1]!==o.id?(t=m.aiProviderModels(o.id,s),e[0]=s,e[1]=o.id,e[2]=t):t=e[2];let l;e[3]!==s||e[4]!==i?(l=async()=>await i.call("AI_PROVIDERS_LIST_MODELS",{keyId:s}),e[3]=s,e[4]=i,e[5]=l):l=e[5];let r;e[6]!==t||e[7]!==l?(r={queryKey:t,staleTime:6e4,queryFn:l},e[6]=t,e[7]=l,e[8]=r):r=e[8];const{data:n}=P(r);let a;return e[9]!==n?.models?(a=n?.models??[],e[9]=n?.models,e[10]=a):a=e[10],a}export{g as a,p as b,E as c,A as d,R as u};
@@ -1 +1 @@
1
- import{c as D,D as U,K as T,k as I,m as x,d as y,t as m}from"./index-CCUd-Voz.js";import{S as z,u as J}from"./use-mcp-client-D9-QWVA2.js";import{u as k}from"./studio-tools-BcFzFyMx.js";function V(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=D.c(12),{org:s}=U(),l=t??z;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==l?(a={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l,e[3]=a):a=e[3];const i=J(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==i?(o=async()=>{const d=await i.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(V)},e[6]=i,e[7]=o):o=e[7];const c=!!t;let r;return e[8]!==n||e[9]!==o||e[10]!==c?(r={queryKey:n,queryFn:o,enabled:c,staleTime:3e4},e[8]=n,e[9]=o,e[10]=c,e[11]=r):r=e[11],I(r)}function it(t){const e=D.c(9),{org:s}=U(),l=k();let a;e[0]!==s.id||e[1]!==t?(a=T.automations(s.id,t),e[0]=s.id,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==l||e[4]!==t?(i=async()=>(await l.call("AUTOMATION_LIST",t!=null?{virtual_mcp_id:t}:{})).automations,e[3]=l,e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==a||e[7]!==i?(n={queryKey:a,queryFn:i,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n):n=e[8],I(n)}function ot(t){const e=D.c(10),{org:s}=U(),l=k();let a;e[0]!==t||e[1]!==s.id?(a=T.automation(s.id,t),e[0]=t,e[1]=s.id,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>(await l.call("AUTOMATION_GET",{id:t})).automation,e[3]=t,e[4]=l,e[5]=i):i=e[5];const n=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==n?(o={queryKey:a,queryFn:i,enabled:n,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n,e[9]=o):o=e[9],I(o)}function at(t,e){const s=D.c(12),{org:l}=U(),a=k();let i;s[0]!==t||s[1]!==l.id||s[2]!==e?(i=T.automationRunStats(l.id,t,JSON.stringify(e??{})),s[0]=t,s[1]=l.id,s[2]=e,s[3]=i):i=s[3];let n;s[4]!==t||s[5]!==e||s[6]!==a?(n=async()=>await a.call("AUTOMATION_RUN_STATS",{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}),s[4]=t,s[5]=e,s[6]=a,s[7]=n):n=s[7];const o=!!t;let c;return s[8]!==i||s[9]!==n||s[10]!==o?(c={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=c):c=s[11],I(c)}function nt(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function lt(){const t=D.c(64),{org:e}=U(),s=k(),l=x();let a;t[0]!==e||t[1]!==l?(a=()=>l.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[0]=e,t[1]=l,t[2]=a):a=t[2];const i=a;let n;t[3]!==e||t[4]!==l?(n=u=>l.invalidateQueries({queryKey:T.automation(e.id,u)}),t[3]=e,t[4]=l,t[5]=n):n=t[5];const o=n;let c;t[6]!==s?(c=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=c):c=t[7];let r;t[8]!==i?(r=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=r):r=t[9];let d;t[10]!==c||t[11]!==r?(d={mutationFn:c,onSuccess:r,onError:X},t[10]=c,t[11]=r,t[12]=d):d=t[12];const q=y(d);let A;t[13]!==s?(A=async u=>await s.call("AUTOMATION_UPDATE",u),t[13]=s,t[14]=A):A=t[14];let p;t[15]!==i||t[16]!==o?(p=(u,f)=>{i(),typeof f.id=="string"&&o(f.id),m.success("Automation updated successfully")},t[15]=i,t[16]=o,t[17]=p):p=t[17];let G;t[18]!==A||t[19]!==p?(G={mutationFn:A,onSuccess:p,onError:W},t[18]=A,t[19]=p,t[20]=G):G=t[20];const Q=y(G);let g;t[21]!==s?(g=async u=>await s.call("AUTOMATION_DELETE",{id:u}),t[21]=s,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==e||t[25]!==l?(_=(u,f)=>{l.removeQueries({queryKey:T.automation(e.id,f)}),i(),m.success("Automation deleted successfully")},t[23]=i,t[24]=e,t[25]=l,t[26]=_):_=t[26];let $;t[27]!==g||t[28]!==_?($={mutationFn:g,onSuccess:_,onError:H},t[27]=g,t[28]=_,t[29]=$):$=t[29];const j=y($);let S;t[30]!==s?(S=async u=>await s.call("AUTOMATION_TRIGGER_ADD",u),t[30]=s,t[31]=S):S=t[31];let E;t[32]!==i||t[33]!==o?(E=u=>{i(),o(u.automation_id)},t[32]=i,t[33]=o,t[34]=E):E=t[34];let K;t[35]!==S||t[36]!==E?(K={mutationFn:S,onSuccess:E},t[35]=S,t[36]=E,t[37]=K):K=t[37];const P=y(K);let O;t[38]!==s?(O=async u=>await s.call("AUTOMATION_TRIGGER_ROTATE_TOKEN",{trigger_id:u.trigger_id}),t[38]=s,t[39]=O):O=t[39];let R;t[40]!==i||t[41]!==o?(R=(u,f)=>{i(),o(f.automation_id)},t[40]=i,t[41]=o,t[42]=R):R=t[42];let C;t[43]!==O||t[44]!==R?(C={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=C):C=t[45];const h=y(C);let F;t[46]!==s?(F=async u=>await s.call("AUTOMATION_TRIGGER_REMOVE",{trigger_id:u.trigger_id}),t[46]=s,t[47]=F):F=t[47];let N;t[48]!==i||t[49]!==o?(N=(u,f)=>{i(),o(f.automation_id)},t[48]=i,t[49]=o,t[50]=N):N=t[50];let b;t[51]!==F||t[52]!==N?(b={mutationFn:F,onSuccess:N},t[51]=F,t[52]=N,t[53]=b):b=t[53];const v=y(b);let L;t[54]!==s?(L={mutationFn:async u=>await s.call("AUTOMATION_RUN",{id:u}),onSuccess:B,onError:Y},t[54]=s,t[55]=L):L=t[55];const w=y(L);let M;return t[56]!==q||t[57]!==j||t[58]!==w||t[59]!==P||t[60]!==v||t[61]!==h||t[62]!==Q?(M={create:q,update:Q,remove:j,triggerAdd:P,triggerRemove:v,triggerRotateToken:h,run:w},t[56]=q,t[57]=j,t[58]=w,t[59]=P,t[60]=v,t[61]=h,t[62]=Q,t[63]=M):M=t[63],M}function Y(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to run automation: ${e}`)}function B(t){t.skipped?m.info(`Automation skipped: ${t.skipped}`):t.error?m.error(`Automation failed: ${t.error}`):m.success("Automation triggered")}function H(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to delete automation: ${e}`)}function W(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to update automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to create automation: ${e}`)}export{st as a,ot as b,it as c,nt as d,at as e,lt as u};
1
+ import{c as D,D as U,K as T,k as I,m as x,d as y,t as m}from"./index-DWK5-mXM.js";import{S as z,u as J}from"./use-mcp-client-CtNpDxS2.js";import{u as k}from"./studio-tools-BEElHn9g.js";function V(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=D.c(12),{org:s}=U(),l=t??z;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==l?(a={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l,e[3]=a):a=e[3];const i=J(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==i?(o=async()=>{const d=await i.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(V)},e[6]=i,e[7]=o):o=e[7];const c=!!t;let r;return e[8]!==n||e[9]!==o||e[10]!==c?(r={queryKey:n,queryFn:o,enabled:c,staleTime:3e4},e[8]=n,e[9]=o,e[10]=c,e[11]=r):r=e[11],I(r)}function it(t){const e=D.c(9),{org:s}=U(),l=k();let a;e[0]!==s.id||e[1]!==t?(a=T.automations(s.id,t),e[0]=s.id,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==l||e[4]!==t?(i=async()=>(await l.call("AUTOMATION_LIST",t!=null?{virtual_mcp_id:t}:{})).automations,e[3]=l,e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==a||e[7]!==i?(n={queryKey:a,queryFn:i,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n):n=e[8],I(n)}function ot(t){const e=D.c(10),{org:s}=U(),l=k();let a;e[0]!==t||e[1]!==s.id?(a=T.automation(s.id,t),e[0]=t,e[1]=s.id,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>(await l.call("AUTOMATION_GET",{id:t})).automation,e[3]=t,e[4]=l,e[5]=i):i=e[5];const n=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==n?(o={queryKey:a,queryFn:i,enabled:n,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n,e[9]=o):o=e[9],I(o)}function at(t,e){const s=D.c(12),{org:l}=U(),a=k();let i;s[0]!==t||s[1]!==l.id||s[2]!==e?(i=T.automationRunStats(l.id,t,JSON.stringify(e??{})),s[0]=t,s[1]=l.id,s[2]=e,s[3]=i):i=s[3];let n;s[4]!==t||s[5]!==e||s[6]!==a?(n=async()=>await a.call("AUTOMATION_RUN_STATS",{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}),s[4]=t,s[5]=e,s[6]=a,s[7]=n):n=s[7];const o=!!t;let c;return s[8]!==i||s[9]!==n||s[10]!==o?(c={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=c):c=s[11],I(c)}function nt(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function lt(){const t=D.c(64),{org:e}=U(),s=k(),l=x();let a;t[0]!==e||t[1]!==l?(a=()=>l.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[0]=e,t[1]=l,t[2]=a):a=t[2];const i=a;let n;t[3]!==e||t[4]!==l?(n=u=>l.invalidateQueries({queryKey:T.automation(e.id,u)}),t[3]=e,t[4]=l,t[5]=n):n=t[5];const o=n;let c;t[6]!==s?(c=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=c):c=t[7];let r;t[8]!==i?(r=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=r):r=t[9];let d;t[10]!==c||t[11]!==r?(d={mutationFn:c,onSuccess:r,onError:X},t[10]=c,t[11]=r,t[12]=d):d=t[12];const q=y(d);let A;t[13]!==s?(A=async u=>await s.call("AUTOMATION_UPDATE",u),t[13]=s,t[14]=A):A=t[14];let p;t[15]!==i||t[16]!==o?(p=(u,f)=>{i(),typeof f.id=="string"&&o(f.id),m.success("Automation updated successfully")},t[15]=i,t[16]=o,t[17]=p):p=t[17];let G;t[18]!==A||t[19]!==p?(G={mutationFn:A,onSuccess:p,onError:W},t[18]=A,t[19]=p,t[20]=G):G=t[20];const Q=y(G);let g;t[21]!==s?(g=async u=>await s.call("AUTOMATION_DELETE",{id:u}),t[21]=s,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==e||t[25]!==l?(_=(u,f)=>{l.removeQueries({queryKey:T.automation(e.id,f)}),i(),m.success("Automation deleted successfully")},t[23]=i,t[24]=e,t[25]=l,t[26]=_):_=t[26];let $;t[27]!==g||t[28]!==_?($={mutationFn:g,onSuccess:_,onError:H},t[27]=g,t[28]=_,t[29]=$):$=t[29];const j=y($);let S;t[30]!==s?(S=async u=>await s.call("AUTOMATION_TRIGGER_ADD",u),t[30]=s,t[31]=S):S=t[31];let E;t[32]!==i||t[33]!==o?(E=u=>{i(),o(u.automation_id)},t[32]=i,t[33]=o,t[34]=E):E=t[34];let K;t[35]!==S||t[36]!==E?(K={mutationFn:S,onSuccess:E},t[35]=S,t[36]=E,t[37]=K):K=t[37];const P=y(K);let O;t[38]!==s?(O=async u=>await s.call("AUTOMATION_TRIGGER_ROTATE_TOKEN",{trigger_id:u.trigger_id}),t[38]=s,t[39]=O):O=t[39];let R;t[40]!==i||t[41]!==o?(R=(u,f)=>{i(),o(f.automation_id)},t[40]=i,t[41]=o,t[42]=R):R=t[42];let C;t[43]!==O||t[44]!==R?(C={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=C):C=t[45];const h=y(C);let F;t[46]!==s?(F=async u=>await s.call("AUTOMATION_TRIGGER_REMOVE",{trigger_id:u.trigger_id}),t[46]=s,t[47]=F):F=t[47];let N;t[48]!==i||t[49]!==o?(N=(u,f)=>{i(),o(f.automation_id)},t[48]=i,t[49]=o,t[50]=N):N=t[50];let b;t[51]!==F||t[52]!==N?(b={mutationFn:F,onSuccess:N},t[51]=F,t[52]=N,t[53]=b):b=t[53];const v=y(b);let L;t[54]!==s?(L={mutationFn:async u=>await s.call("AUTOMATION_RUN",{id:u}),onSuccess:B,onError:Y},t[54]=s,t[55]=L):L=t[55];const w=y(L);let M;return t[56]!==q||t[57]!==j||t[58]!==w||t[59]!==P||t[60]!==v||t[61]!==h||t[62]!==Q?(M={create:q,update:Q,remove:j,triggerAdd:P,triggerRemove:v,triggerRotateToken:h,run:w},t[56]=q,t[57]=j,t[58]=w,t[59]=P,t[60]=v,t[61]=h,t[62]=Q,t[63]=M):M=t[63],M}function Y(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to run automation: ${e}`)}function B(t){t.skipped?m.info(`Automation skipped: ${t.skipped}`):t.error?m.error(`Automation failed: ${t.error}`):m.success("Automation triggered")}function H(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to delete automation: ${e}`)}function W(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to update automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to create automation: ${e}`)}export{st as a,ot as b,it as c,nt as d,at as e,lt as u};
@@ -1 +1 @@
1
- import{c as u,D as m,k as g,K as p}from"./index-CCUd-Voz.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{c as u,D as m,k as g,K as p}from"./index-DWK5-mXM.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 +1 @@
1
- import{d as a}from"./differenceInSeconds-NQ4PDo0z.js";import{c as u,r as f}from"./index-CCUd-Voz.js";function p(r){const t=a(new Date,r);return t<60?"<1m":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:t<604800?`${Math.floor(t/86400)}d ago`:t<2592e3?`${Math.floor(t/604800)}w ago`:t<31536e3?`${Math.floor(t/2592e3)}mo ago`:`${Math.floor(t/31536e3)}y ago`}function g(r){if(r==null||r==="")return null;const t=r instanceof Date?r.getTime():Date.parse(r);return Number.isFinite(t)?t:null}function h(r,t){const e=t-r;return e>0?e:0}function M(r){if(r<60)return`${r.toFixed(1)}s`;const t=Math.round(r%60*10)/10,e=t>=60?1:0;return`${Math.floor(r/60)+e}m ${(e?0:t).toFixed(1)}s`}const s=new Map;function i(r){let t=s.get(r);return t||(t={tick:0,subscribers:new Set,intervalId:null},s.set(r,t)),t}function l(r,t){const e=i(r);return e.subscribers.add(t),e.intervalId===null&&(e.intervalId=setInterval(()=>{e.tick+=1;for(const n of e.subscribers)n()},r)),()=>{e.subscribers.delete(t),e.subscribers.size===0&&e.intervalId!==null&&(clearInterval(e.intervalId),e.intervalId=null)}}function $(r){const t=u.c(3),e=r===void 0?6e4:r;let n,o;return t[0]!==e?(n=c=>l(e,c),o=()=>i(e).tick,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),f.useSyncExternalStore(n,o,m)}function m(){return 0}export{M as a,h as c,p as f,g as t,$ as u};
1
+ import{d as a}from"./differenceInSeconds-NQ4PDo0z.js";import{c as u,r as f}from"./index-DWK5-mXM.js";function p(r){const t=a(new Date,r);return t<60?"<1m":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:t<604800?`${Math.floor(t/86400)}d ago`:t<2592e3?`${Math.floor(t/604800)}w ago`:t<31536e3?`${Math.floor(t/2592e3)}mo ago`:`${Math.floor(t/31536e3)}y ago`}function g(r){if(r==null||r==="")return null;const t=r instanceof Date?r.getTime():Date.parse(r);return Number.isFinite(t)?t:null}function h(r,t){const e=t-r;return e>0?e:0}function M(r){if(r<60)return`${r.toFixed(1)}s`;const t=Math.round(r%60*10)/10,e=t>=60?1:0;return`${Math.floor(r/60)+e}m ${(e?0:t).toFixed(1)}s`}const s=new Map;function i(r){let t=s.get(r);return t||(t={tick:0,subscribers:new Set,intervalId:null},s.set(r,t)),t}function l(r,t){const e=i(r);return e.subscribers.add(t),e.intervalId===null&&(e.intervalId=setInterval(()=>{e.tick+=1;for(const n of e.subscribers)n()},r)),()=>{e.subscribers.delete(t),e.subscribers.size===0&&e.intervalId!==null&&(clearInterval(e.intervalId),e.intervalId=null)}}function $(r){const t=u.c(3),e=r===void 0?6e4:r;let n,o;return t[0]!==e?(n=c=>l(e,c),o=()=>i(e).tick,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),f.useSyncExternalStore(n,o,m)}function m(){return 0}export{M as a,h as c,p as f,g as t,$ as u};
@@ -1 +1 @@
1
- import{q,c as v,m as b,d as F,aK as x,t as _}from"./index-CCUd-Voz.js";function K(e,s,o){const t=[];if(e?.trim()){const n=e.trim(),r=o.map(a=>({field:[String(a)],operator:"contains",value:n}));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 n of s)t.push({field:[n.column],operator:"eq",value:n.value});if(t.length!==0)return t.length===1?t[0]:{operator:"and",conditions:t}}function Q(e,s,o){const t=e??o,n=s??"desc";return[{field:[String(t)],direction:n}]}function O(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 k(e,s,o,t){const n=s.toUpperCase(),r=`COLLECTION_${n}_GET`;return{queryKey:x.collectionItem(t,e,"",n,o??""),queryFn:async()=>{if(!o)return{item:null};const a=await t.callTool({name:r,arguments:{id:o}});return O(a)},staleTime:6e4}}function j(e,s,o,t){const n=v.c(5);let r;n[0]!==t||n[1]!==s||n[2]!==o||n[3]!==e?(r=k(e,s,o,t),n[0]=t,n[1]=s,n[2]=o,n[3]=e,n[4]=r):r=n[4];const{data:a}=q(r);return a?.item??null}const D={structuredContent:{items:[]},isError:!1};function z(e,s,o,t={}){const{searchTerm:n,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=K(n,r,S),T=Q(a,L,h),u={...p&&{where:p},...T&&{orderBy:T},limit:g,offset:0,...c},m=JSON.stringify(u),C=x.collectionList(o,e,"",l,m),{data:w}=q({queryKey:C,queryFn:async()=>o?await o.callTool({name:f,arguments:u}):D,staleTime:3e4,retry:!1,select:d=>O(d??{})?.items??[]});return w}function G(e,s,o){const t=v.c(34),n=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]!==n||t[3]!==e||t[4]!==a?(g=()=>{n.invalidateQueries({predicate:E=>{const i=E.queryKey;return i[1]===e&&i[3]==="collection"&&i[4]===a}})},t[2]=n,t[3]=e,t[4]=a,t[5]=g):g=t[5];const c=g;let l;t[6]!==o||t[7]!==L?(l=async E=>{const i=await o.callTool({name:L,arguments:{data:E}});if(i.isError)throw new Error(Array.isArray(i.content)?i.content[0]?.text:String(i.content));return O(i).item},t[6]=o,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]!==o||t[15]!==S?(u=async E=>{const{id:i,data:A}=E,U=await o.callTool({name:S,arguments:{id:i,data:A}});return O(U).item},t[14]=o,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 w=F(C);let d;t[22]!==o||t[23]!==h?(d=async E=>{const i=await o.callTool({name:h,arguments:{id:E}});return O(i).item.id},t[22]=o,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]!==w?(I={create:T,update:w,delete:$},t[30]=T,t[31]=$,t[32]=w,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{G as a,z as b,k as c,j as u};
1
+ import{q,c as v,m as b,d as F,aK as x,t as _}from"./index-DWK5-mXM.js";function K(e,s,o){const t=[];if(e?.trim()){const n=e.trim(),r=o.map(a=>({field:[String(a)],operator:"contains",value:n}));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 n of s)t.push({field:[n.column],operator:"eq",value:n.value});if(t.length!==0)return t.length===1?t[0]:{operator:"and",conditions:t}}function Q(e,s,o){const t=e??o,n=s??"desc";return[{field:[String(t)],direction:n}]}function O(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 k(e,s,o,t){const n=s.toUpperCase(),r=`COLLECTION_${n}_GET`;return{queryKey:x.collectionItem(t,e,"",n,o??""),queryFn:async()=>{if(!o)return{item:null};const a=await t.callTool({name:r,arguments:{id:o}});return O(a)},staleTime:6e4}}function j(e,s,o,t){const n=v.c(5);let r;n[0]!==t||n[1]!==s||n[2]!==o||n[3]!==e?(r=k(e,s,o,t),n[0]=t,n[1]=s,n[2]=o,n[3]=e,n[4]=r):r=n[4];const{data:a}=q(r);return a?.item??null}const D={structuredContent:{items:[]},isError:!1};function z(e,s,o,t={}){const{searchTerm:n,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=K(n,r,S),T=Q(a,L,h),u={...p&&{where:p},...T&&{orderBy:T},limit:g,offset:0,...c},m=JSON.stringify(u),C=x.collectionList(o,e,"",l,m),{data:w}=q({queryKey:C,queryFn:async()=>o?await o.callTool({name:f,arguments:u}):D,staleTime:3e4,retry:!1,select:d=>O(d??{})?.items??[]});return w}function G(e,s,o){const t=v.c(34),n=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]!==n||t[3]!==e||t[4]!==a?(g=()=>{n.invalidateQueries({predicate:E=>{const i=E.queryKey;return i[1]===e&&i[3]==="collection"&&i[4]===a}})},t[2]=n,t[3]=e,t[4]=a,t[5]=g):g=t[5];const c=g;let l;t[6]!==o||t[7]!==L?(l=async E=>{const i=await o.callTool({name:L,arguments:{data:E}});if(i.isError)throw new Error(Array.isArray(i.content)?i.content[0]?.text:String(i.content));return O(i).item},t[6]=o,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]!==o||t[15]!==S?(u=async E=>{const{id:i,data:A}=E,U=await o.callTool({name:S,arguments:{id:i,data:A}});return O(U).item},t[14]=o,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 w=F(C);let d;t[22]!==o||t[23]!==h?(d=async E=>{const i=await o.callTool({name:h,arguments:{id:E}});return O(i).item.id},t[22]=o,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]!==w?(I={create:T,update:w,delete:$},t[30]=T,t[31]=$,t[32]=w,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{G as a,z as b,k as c,j as u};
@@ -1 +1 @@
1
- import{c as f,D as C}from"./index-CCUd-Voz.js";import{a as N,b as O,u as S}from"./use-collections-vaY04X7G.js";import{S as I,u as m}from"./use-mcp-client-D9-QWVA2.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 S(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 N(o.id,"CONNECTIONS",n)}export{_ as a,x as b,E as u};
1
+ import{c as f,D as C}from"./index-DWK5-mXM.js";import{a as N,b as O,u as S}from"./use-collections-BBNXU__l.js";import{S as I,u as m}from"./use-mcp-client-CtNpDxS2.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 S(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 N(o.id,"CONNECTIONS",n)}export{_ as a,x as b,E as u};
@@ -1 +1 @@
1
- import{c as i,r as n}from"./index-CCUd-Voz.js";function p(){const e=i.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async c=>{await navigator.clipboard.writeText(c),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{c as i,r as n}from"./index-DWK5-mXM.js";function p(){const e=i.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async c=>{await navigator.clipboard.writeText(c),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{c as g}from"./index-CCUd-Voz.js";import{b as f}from"./use-virtual-mcp-BeAABJAf.js";import{m}from"./use-navigate-to-agent-C_XaBi9m.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,c=u===void 0?!1:u,t=f(),r=m();let s;e[2]!==t.create||e[3]!==c||e[4]!==r?(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 c&&r(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=c,e[4]=r,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{c as g}from"./index-DWK5-mXM.js";import{b as f}from"./use-virtual-mcp-CIINi4nG.js";import{m}from"./use-navigate-to-agent-D_Ssa6F6.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,c=u===void 0?!1:u,t=f(),r=m();let s;e[2]!==t.create||e[3]!==c||e[4]!==r?(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 c&&r(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=c,e[4]=r,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-CCUd-Voz.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-DWK5-mXM.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 +1 @@
1
- import{c as H,j as t,D as Q,m as J,r as M,t as F,be as P,bf as Y}from"./index-CCUd-Voz.js";import{c as I,b as L,d as R,A as q,e as U,g as k,a as K,f as $}from"./alert-dialog-Z3EoybWN.js";import{u as z}from"./studio-tools-BcFzFyMx.js";function W(T){const e=H.c(41),{deleteState:s,cancelDelete:c,confirmDelete:i,confirmForceDelete:l}=T,N=s.mode==="deleting";let r;e[0]!==c?(r=w=>{w||c()},e[0]=c,e[1]=r):r=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(I,{children:"Delete Connection?"}),e[2]=f):f=e[2];const S=s.mode==="deleting"&&s.connection.title;let u;e[3]!==S?(u=t.jsxs(L,{children:[f,t.jsxs(R,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:S}),"."]})]}),e[3]=S,e[4]=u):u=e[4];let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(q,{children:"Cancel"}),e[5]=E):E=e[5];let h;e[6]!==i?(h=t.jsxs(U,{children:[E,t.jsx(k,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[6]=i,e[7]=h):h=e[7];let n;e[8]!==u||e[9]!==h?(n=t.jsxs(K,{children:[u,h]}),e[8]=u,e[9]=h,e[10]=n):n=e[10];let o;e[11]!==N||e[12]!==r||e[13]!==n?(o=t.jsx($,{open:N,onOpenChange:r,children:n}),e[11]=N,e[12]=r,e[13]=n,e[14]=o):o=e[14];const a=s.mode==="force-deleting";let d;e[15]!==c?(d=w=>{w||c()},e[15]=c,e[16]=d):d=e[16];let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(I,{children:"Connection Used by Agents"}),e[17]=m):m=e[17];const _=s.mode==="force-deleting"&&s.connection.title;let g;e[18]!==_?(g=t.jsx("span",{className:"font-medium text-foreground",children:_}),e[18]=_,e[19]=g):g=e[19];const A=s.mode==="force-deleting"&&s.agentNames;let x;e[20]!==A?(x=t.jsx("span",{className:"font-medium text-foreground",children:A}),e[20]=A,e[21]=x):x=e[21];let C;e[22]!==g||e[23]!==x?(C=t.jsxs("p",{children:["The connection"," ",g," ","is currently used by the following agent(s):"," ",x,"."]}),e[22]=g,e[23]=x,e[24]=C):C=e[24];let O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=t.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=t.jsxs(L,{children:[m,t.jsx(R,{asChild:!0,children:t.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=t.jsx(q,{children:"Cancel"}),e[28]=b):b=e[28];let j;e[29]!==l?(j=t.jsxs(U,{children:[b,t.jsx(k,{onClick:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]}),e[29]=l,e[30]=j):j=e[30];let p;e[31]!==D||e[32]!==j?(p=t.jsxs(K,{children:[D,j]}),e[31]=D,e[32]=j,e[33]=p):p=e[33];let y;e[34]!==a||e[35]!==d||e[36]!==p?(y=t.jsx($,{open:a,onOpenChange:d,children:p}),e[34]=a,e[35]=d,e[36]=p,e[37]=y):y=e[37];let v;return e[38]!==y||e[39]!==o?(v=t.jsxs(t.Fragment,{children:[o,y]}),e[38]=y,e[39]=o,e[40]=v):v=e[40],v}function X({onSuccess:T}={}){const{org:e}=Q(),s=J(),c=z(),[i,l]=M.useState({mode:"idle"}),N=()=>{s.invalidateQueries({predicate:n=>{const o=n.queryKey;return o[1]===e.id&&o[3]==="collection"&&o[4]==="CONNECTIONS"}})},r=n=>{P(n),s.invalidateQueries({predicate:o=>o.queryKey[1]===Y&&o.queryKey[3]===n})},f=n=>{N(),r(n),F.success("Connection deleted successfully"),l({mode:"idle"}),T?.()};return{deleteState:i,requestDelete:n=>{l({mode:"deleting",connection:n})},cancelDelete:()=>{l({mode:"idle"})},confirmDelete:async()=>{if(i.mode!=="deleting")return;const n=i.connection;l({mode:"idle"});try{await c.call("COLLECTION_CONNECTIONS_DELETE",{id:n.id}),f(n.id)}catch(o){const a=o instanceof Error?o.message:String(o),d=a.replace(/^Error:\s*/,"");try{const m=JSON.parse(d);if(m.code==="CONNECTION_IN_USE"&&m.agentNames){l({mode:"force-deleting",connection:n,agentNames:m.agentNames.map(_=>`"${_}"`).join(", ")});return}}catch{}F.error(`Failed to delete connection: ${a}`)}},confirmForceDelete:async()=>{if(i.mode!=="force-deleting")return;const n=i.connection.id;l({mode:"idle"});try{await c.call("COLLECTION_CONNECTIONS_DELETE",{id:n,force:!0}),f(n)}catch(o){const a=o instanceof Error?o.message:String(o);F.error(`Failed to delete connection: ${a}`)}}}}export{W as D,X as u};
1
+ import{c as H,j as t,D as Q,m as J,r as M,t as F,be as P,bf as Y}from"./index-DWK5-mXM.js";import{c as I,b as L,d as R,A as q,e as U,g as k,a as K,f as $}from"./alert-dialog-DATF3lW9.js";import{u as z}from"./studio-tools-BEElHn9g.js";function W(T){const e=H.c(41),{deleteState:s,cancelDelete:c,confirmDelete:i,confirmForceDelete:l}=T,N=s.mode==="deleting";let r;e[0]!==c?(r=w=>{w||c()},e[0]=c,e[1]=r):r=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(I,{children:"Delete Connection?"}),e[2]=f):f=e[2];const S=s.mode==="deleting"&&s.connection.title;let u;e[3]!==S?(u=t.jsxs(L,{children:[f,t.jsxs(R,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:S}),"."]})]}),e[3]=S,e[4]=u):u=e[4];let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(q,{children:"Cancel"}),e[5]=E):E=e[5];let h;e[6]!==i?(h=t.jsxs(U,{children:[E,t.jsx(k,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[6]=i,e[7]=h):h=e[7];let n;e[8]!==u||e[9]!==h?(n=t.jsxs(K,{children:[u,h]}),e[8]=u,e[9]=h,e[10]=n):n=e[10];let o;e[11]!==N||e[12]!==r||e[13]!==n?(o=t.jsx($,{open:N,onOpenChange:r,children:n}),e[11]=N,e[12]=r,e[13]=n,e[14]=o):o=e[14];const a=s.mode==="force-deleting";let d;e[15]!==c?(d=w=>{w||c()},e[15]=c,e[16]=d):d=e[16];let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(I,{children:"Connection Used by Agents"}),e[17]=m):m=e[17];const _=s.mode==="force-deleting"&&s.connection.title;let g;e[18]!==_?(g=t.jsx("span",{className:"font-medium text-foreground",children:_}),e[18]=_,e[19]=g):g=e[19];const A=s.mode==="force-deleting"&&s.agentNames;let x;e[20]!==A?(x=t.jsx("span",{className:"font-medium text-foreground",children:A}),e[20]=A,e[21]=x):x=e[21];let C;e[22]!==g||e[23]!==x?(C=t.jsxs("p",{children:["The connection"," ",g," ","is currently used by the following agent(s):"," ",x,"."]}),e[22]=g,e[23]=x,e[24]=C):C=e[24];let O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=t.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=t.jsxs(L,{children:[m,t.jsx(R,{asChild:!0,children:t.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=t.jsx(q,{children:"Cancel"}),e[28]=b):b=e[28];let j;e[29]!==l?(j=t.jsxs(U,{children:[b,t.jsx(k,{onClick:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]}),e[29]=l,e[30]=j):j=e[30];let p;e[31]!==D||e[32]!==j?(p=t.jsxs(K,{children:[D,j]}),e[31]=D,e[32]=j,e[33]=p):p=e[33];let y;e[34]!==a||e[35]!==d||e[36]!==p?(y=t.jsx($,{open:a,onOpenChange:d,children:p}),e[34]=a,e[35]=d,e[36]=p,e[37]=y):y=e[37];let v;return e[38]!==y||e[39]!==o?(v=t.jsxs(t.Fragment,{children:[o,y]}),e[38]=y,e[39]=o,e[40]=v):v=e[40],v}function X({onSuccess:T}={}){const{org:e}=Q(),s=J(),c=z(),[i,l]=M.useState({mode:"idle"}),N=()=>{s.invalidateQueries({predicate:n=>{const o=n.queryKey;return o[1]===e.id&&o[3]==="collection"&&o[4]==="CONNECTIONS"}})},r=n=>{P(n),s.invalidateQueries({predicate:o=>o.queryKey[1]===Y&&o.queryKey[3]===n})},f=n=>{N(),r(n),F.success("Connection deleted successfully"),l({mode:"idle"}),T?.()};return{deleteState:i,requestDelete:n=>{l({mode:"deleting",connection:n})},cancelDelete:()=>{l({mode:"idle"})},confirmDelete:async()=>{if(i.mode!=="deleting")return;const n=i.connection;l({mode:"idle"});try{await c.call("COLLECTION_CONNECTIONS_DELETE",{id:n.id}),f(n.id)}catch(o){const a=o instanceof Error?o.message:String(o),d=a.replace(/^Error:\s*/,"");try{const m=JSON.parse(d);if(m.code==="CONNECTION_IN_USE"&&m.agentNames){l({mode:"force-deleting",connection:n,agentNames:m.agentNames.map(_=>`"${_}"`).join(", ")});return}}catch{}F.error(`Failed to delete connection: ${a}`)}},confirmForceDelete:async()=>{if(i.mode!=="force-deleting")return;const n=i.connection.id;l({mode:"idle"});try{await c.call("COLLECTION_CONNECTIONS_DELETE",{id:n,force:!0}),f(n)}catch(o){const a=o instanceof Error?o.message:String(o);F.error(`Failed to delete connection: ${a}`)}}}}export{W as D,X as u};
@@ -1 +1 @@
1
- import{c as u,D as c,K as r,q as y,m as C,d,k as F}from"./index-CCUd-Voz.js";import{u as f}from"./studio-tools-BcFzFyMx.js";function E(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=y(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],F(s)}function q(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_CREATE",{...a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function _(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_DELETE",{id:a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{I as a,q as b,_ as c,E as u};
1
+ import{c as u,D as c,K as r,q as y,m as C,d,k as F}from"./index-DWK5-mXM.js";import{u as f}from"./studio-tools-BEElHn9g.js";function E(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=y(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],F(s)}function q(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_CREATE",{...a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function _(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_DELETE",{id:a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{I as a,q as b,_ as c,E as u};
@@ -1 +1 @@
1
- import{as as d,dE as l,dF as v,r as i}from"./index-CCUd-Voz.js";var p=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:r,isRefetching:h,isError:a,isRefetchError:g}=u,s=n.fetchMeta?.fetchMore?.direction,o=a&&s==="forward",P=r&&s==="forward",c=a&&s==="backward",f=r&&s==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,n.data),hasPreviousPage:l(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function b(e,t,n=!1,u){const r=i.useRef(null),h=i.useRef(null),a=i.useRef(e),g=i.useRef(t),s=i.useRef(n),o=i.useRef(u);a.current=e,g.current=t,s.current=n,o.current=u;const[P]=i.useState(()=>c=>{h.current=c,r.current&&(r.current.disconnect(),r.current=null),c&&queueMicrotask(()=>{if(h.current!==c)return;const f=new IntersectionObserver(R=>{R[0]?.isIntersecting&&g.current&&!s.current&&a.current()},{root:o.current?.current??null,rootMargin:"0px 0px 200px 0px"});f.observe(c),r.current=f})});return P}export{p as I,b as u};
1
+ import{as as d,dE as l,dF as v,r as i}from"./index-DWK5-mXM.js";var p=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:r,isRefetching:h,isError:a,isRefetchError:g}=u,s=n.fetchMeta?.fetchMore?.direction,o=a&&s==="forward",P=r&&s==="forward",c=a&&s==="backward",f=r&&s==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,n.data),hasPreviousPage:l(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function b(e,t,n=!1,u){const r=i.useRef(null),h=i.useRef(null),a=i.useRef(e),g=i.useRef(t),s=i.useRef(n),o=i.useRef(u);a.current=e,g.current=t,s.current=n,o.current=u;const[P]=i.useState(()=>c=>{h.current=c,r.current&&(r.current.disconnect(),r.current=null),c&&queueMicrotask(()=>{if(h.current!==c)return;const f=new IntersectionObserver(R=>{R[0]?.isIntersecting&&g.current&&!s.current&&a.current()},{root:o.current?.current??null,rootMargin:"0px 0px 200px 0px"});f.observe(c),r.current=f})});return P}export{p as I,b as u};
@@ -1 +1 @@
1
- import{c as g,D as N,K as y,k as _,m as A,d as I,t as q}from"./index-CCUd-Voz.js";import{a as S}from"./use-capability-Df8DWOlr.js";import{u as O}from"./studio-tools-BcFzFyMx.js";function F(){const e=g.c(10),{org:r}=N(),u=O(),{capabilities:a,isPrivileged:c}=S(),d=c||!!a["members:manage"];let t;e[0]!==r.id?(t=y.organizationJoinRequests(r.id),e[0]=r.id,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=u,e[3]=s):s=e[3];const i=!!r.id&&d;let n;e[4]!==t||e[5]!==s||e[6]!==i?(n={queryKey:t,queryFn:s,enabled:i},e[4]=t,e[5]=s,e[6]=i,e[7]=n):n=e[7];const{data:l}=_(n);let o;return e[8]!==l?.requests?(o=l?.requests??[],e[8]=l?.requests,e[9]=o):o=e[9],o}function K(){const e=g.c(21),{org:r,locator:u}=N(),a=O(),c=A();let d;e[0]!==u||e[1]!==r||e[2]!==c?(d=()=>{c.invalidateQueries({queryKey:y.organizationJoinRequests(r.id)}),c.invalidateQueries({queryKey:y.members(u)})},e[0]=u,e[1]=r,e[2]=c,e[3]=d):d=e[3];const t=d;let s;e[4]!==a?(s=R=>a.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:R}),e[4]=a,e[5]=s):s=e[5];let i;e[6]!==t?(i=()=>{t(),q.success("Request approved")},e[6]=t,e[7]=i):i=e[7];let n;e[8]!==s||e[9]!==i?(n={mutationFn:s,onSuccess:i,onError:v},e[8]=s,e[9]=i,e[10]=n):n=e[10];const l=I(n);let o;e[11]!==a?(o=R=>a.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:R}),e[11]=a,e[12]=o):o=e[12];let f;e[13]!==t?(f=()=>{t(),q.success("Request denied")},e[13]=t,e[14]=f):f=e[14];let m;e[15]!==o||e[16]!==f?(m={mutationFn:o,onSuccess:f,onError:T},e[15]=o,e[16]=f,e[17]=m):m=e[17];const E=I(m);let p;return e[18]!==l||e[19]!==E?(p={approve:l,deny:E},e[18]=l,e[19]=E,e[20]=p):p=e[20],p}function T(e){return q.error(e instanceof Error?e.message:"Failed to deny")}function v(e){return q.error(e instanceof Error?e.message:"Failed to approve")}export{F as a,K as u};
1
+ import{c as g,D as N,K as y,k as _,m as A,d as I,t as q}from"./index-DWK5-mXM.js";import{a as S}from"./use-capability-Bc2arkRi.js";import{u as O}from"./studio-tools-BEElHn9g.js";function F(){const e=g.c(10),{org:r}=N(),u=O(),{capabilities:a,isPrivileged:c}=S(),d=c||!!a["members:manage"];let t;e[0]!==r.id?(t=y.organizationJoinRequests(r.id),e[0]=r.id,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=u,e[3]=s):s=e[3];const i=!!r.id&&d;let n;e[4]!==t||e[5]!==s||e[6]!==i?(n={queryKey:t,queryFn:s,enabled:i},e[4]=t,e[5]=s,e[6]=i,e[7]=n):n=e[7];const{data:l}=_(n);let o;return e[8]!==l?.requests?(o=l?.requests??[],e[8]=l?.requests,e[9]=o):o=e[9],o}function K(){const e=g.c(21),{org:r,locator:u}=N(),a=O(),c=A();let d;e[0]!==u||e[1]!==r||e[2]!==c?(d=()=>{c.invalidateQueries({queryKey:y.organizationJoinRequests(r.id)}),c.invalidateQueries({queryKey:y.members(u)})},e[0]=u,e[1]=r,e[2]=c,e[3]=d):d=e[3];const t=d;let s;e[4]!==a?(s=R=>a.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:R}),e[4]=a,e[5]=s):s=e[5];let i;e[6]!==t?(i=()=>{t(),q.success("Request approved")},e[6]=t,e[7]=i):i=e[7];let n;e[8]!==s||e[9]!==i?(n={mutationFn:s,onSuccess:i,onError:v},e[8]=s,e[9]=i,e[10]=n):n=e[10];const l=I(n);let o;e[11]!==a?(o=R=>a.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:R}),e[11]=a,e[12]=o):o=e[12];let f;e[13]!==t?(f=()=>{t(),q.success("Request denied")},e[13]=t,e[14]=f):f=e[14];let m;e[15]!==o||e[16]!==f?(m={mutationFn:o,onSuccess:f,onError:T},e[15]=o,e[16]=f,e[17]=m):m=e[17];const E=I(m);let p;return e[18]!==l||e[19]!==E?(p={approve:l,deny:E},e[18]=l,e[19]=E,e[20]=p):p=e[20],p}function T(e){return q.error(e instanceof Error?e.message:"Failed to deny")}function v(e){return q.error(e instanceof Error?e.message:"Failed to approve")}export{F as a,K as u};