decocms 4.213.2 → 4.213.4

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 (228) hide show
  1. package/dist/client/assets/{AlertCircle-BtaPB3r3.js → AlertCircle-DkkZBUv4.js} +1 -1
  2. package/dist/client/assets/{AreaChart-D5z3kdQF.js → AreaChart-xdDbU-OL.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CWRzKYG7.js → ArrowLeft-CCjm2zjh.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-BQptHrCQ.js → ArrowUp-DyVbcDzm.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-CrVt_V-y.js → ArrowUpRight-BFkKFN7l.js} +1 -1
  6. package/dist/client/assets/{Check-C9YirVC4.js → Check-ByJrpIbu.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BNrL_lWP.js → CheckCircle-BJAfVhBt.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-CK4ZVZU5.js → ChevronDown-eBlATgdA.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-DRaQJ8sH.js → ChevronRight-Sb_ED2ND.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-_4Y6lyxd.js → ChevronUp-Clue5bVs.js} +1 -1
  11. package/dist/client/assets/{Copy01-CLX1AbOl.js → Copy01-DEYrMFvd.js} +1 -1
  12. package/dist/client/assets/{CpuChip01-BDJy1J19.js → CpuChip01-CRCFBLGb.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-Dn0eZmYP.js → CreditCard01-DVQ_trwj.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-DrdjZfrd.js → DotsVertical-z4B9-mwO.js} +1 -1
  15. package/dist/client/assets/{Eye-BzFG1M0K.js → Eye-Dq74RklM.js} +1 -1
  16. package/dist/client/assets/{FilterLines-DAnm9bXM.js → FilterLines-G1RXinzK.js} +1 -1
  17. package/dist/client/assets/{Globe01-T4l6-g3P.js → Globe01-CQ3JXEsp.js} +1 -1
  18. package/dist/client/assets/{Globe04-8mu0fUFk.js → Globe04-CylAlwCT.js} +1 -1
  19. package/dist/client/assets/{HardDrive-qcwOZA_m.js → HardDrive-CvmfsJwK.js} +1 -1
  20. package/dist/client/assets/{Key01-DoHyECqo.js → Key01-CHPlABNw.js} +1 -1
  21. package/dist/client/assets/{LayoutLeft-BwNnkGLE.js → LayoutLeft-DLCVgAHc.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-4giR9ii8.js → LinkExternal01-B1uxY5X5.js} +1 -1
  23. package/dist/client/assets/{LogOut01-Bd09T8FP.js → LogOut01-DHePzq8i.js} +1 -1
  24. package/dist/client/assets/{Monitor01-B5dFm4gD.js → Monitor01-BirbpTGo.js} +1 -1
  25. package/dist/client/assets/{Palette-D2vpD9pq.js → Palette-jiE2ucje.js} +1 -1
  26. package/dist/client/assets/{Play-DhkCqwFM.js → Play-CBlCbXyC.js} +1 -1
  27. package/dist/client/assets/{Plus-Dm4WmNSG.js → Plus-C6vzlDQe.js} +1 -1
  28. package/dist/client/assets/{SearchLg-Ck20GG--.js → SearchLg-DdLr3Wv2.js} +1 -1
  29. package/dist/client/assets/{SearchMd-CfFkukig.js → SearchMd-BHNbvSu5.js} +1 -1
  30. package/dist/client/assets/{Settings02-CVAq2JK_.js → Settings02-3x6bXQZc.js} +1 -1
  31. package/dist/client/assets/{Share07-D22bkXr_.js → Share07-5vmoQMtW.js} +1 -1
  32. package/dist/client/assets/{Shield01-AckE4Fkx.js → Shield01-Bu4PHSC-.js} +1 -1
  33. package/dist/client/assets/{Star01-CxRj8IxJ.js → Star01-B5OO0GPG.js} +1 -1
  34. package/dist/client/assets/{Stars01-Sd1pfysM.js → Stars01-D4rY_Ku0.js} +1 -1
  35. package/dist/client/assets/{Stars02-B1BVyXRS.js → Stars02-BMvpgy8d.js} +1 -1
  36. package/dist/client/assets/{Sun-C10MgYGY.js → Sun-DwWGxpiu.js} +1 -1
  37. package/dist/client/assets/{SwitchHorizontal01-BQiSEYjX.js → SwitchHorizontal01-CqvJZY4d.js} +1 -1
  38. package/dist/client/assets/{Tool01-DLaPhB7V.js → Tool01--sCIVxHi.js} +1 -1
  39. package/dist/client/assets/{Tool02-DrvkBQ68.js → Tool02-BEn9yaLs.js} +1 -1
  40. package/dist/client/assets/{Trash01-BVokhopT.js → Trash01-BEKXpRo8.js} +1 -1
  41. package/dist/client/assets/{TrendUp01-BhfBb2kU.js → TrendUp01-Btyd3vJT.js} +1 -1
  42. package/dist/client/assets/{Upload01-DbpOiMD9.js → Upload01-BDYtsE0t.js} +1 -1
  43. package/dist/client/assets/{User01-xEWYNlJX.js → User01-Dyqyv5XT.js} +1 -1
  44. package/dist/client/assets/{Users01-CJZJiXpK.js → Users01-DZiTZbeH.js} +1 -1
  45. package/dist/client/assets/{Users03-aGMnn7GC.js → Users03-BVzZ7I4i.js} +1 -1
  46. package/dist/client/assets/{X-CPPWzFGv.js → X-NFs01Z9e.js} +1 -1
  47. package/dist/client/assets/{XCircle-DiqaNpK5.js → XCircle-Iin33a2j.js} +1 -1
  48. package/dist/client/assets/{XClose-DmdEfX7d.js → XClose-CBND9vXo.js} +1 -1
  49. package/dist/client/assets/{Zap-BrN9iJhf.js → Zap-DLWTPE22.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-D3etv_p8.js → ZapSquare-EIutPaVP.js} +1 -1
  51. package/dist/client/assets/{access-gate-C6VLyHTX.js → access-gate-DQEWD7a7.js} +1 -1
  52. package/dist/client/assets/{agent-icon-Bvh_dN2q.js → agent-icon-tYsl9rf9.js} +1 -1
  53. package/dist/client/assets/{agents-list-5yWNyWYm.js → agents-list-Xtfa9ez4.js} +1 -1
  54. package/dist/client/assets/{ai-providers-D-iMsrLU.js → ai-providers-DuDjK6Bk.js} +1 -1
  55. package/dist/client/assets/{alert-DX1Ywn4R.js → alert-BnpcDCDP.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-N5y_pt8L.js → alert-dialog-BFD6K547.js} +1 -1
  57. package/dist/client/assets/{app-editor-C_aXlWBV.js → app-editor-EIq-bCrd.js} +1 -1
  58. package/dist/client/assets/{auth-CVA5G64j.js → auth-BGSdURbR.js} +1 -1
  59. package/dist/client/assets/{auth-catchall--u2uHz-l.js → auth-catchall-C8f9eF9S.js} +1 -1
  60. package/dist/client/assets/{auth-entry-BajIlMdm.js → auth-entry-CKVJXpSu.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-D6WedxZg.js → auth-split-layout-CB9_ikKJ.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-m-asDg6n.js → authenticate-and-persist-oauth-DRysEq3W.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-DJMycimP.js → automation-list-row-D5DPHf5D.js} +1 -1
  64. package/dist/client/assets/{automation-runs-CqHPmpxv.js → automation-runs-DU_KsyNQ.js} +1 -1
  65. package/dist/client/assets/{automations-C2Lr7QaY.js → automations-Byuf2kXN.js} +1 -1
  66. package/dist/client/assets/{avatar-BWQUoICI.js → avatar-QqLodXpB.js} +1 -1
  67. package/dist/client/assets/{badge-BD99e01N.js → badge-CV_cBugA.js} +1 -1
  68. package/dist/client/assets/{billing-DVQqzRq6.js → billing-BBk_oQIv.js} +2 -2
  69. package/dist/client/assets/{block-document-Dv7Gc42u.js → block-document-CrtLohNk.js} +1 -1
  70. package/dist/client/assets/{brand-context-C0OLaukl.js → brand-context-ykBmS_kH.js} +1 -1
  71. package/dist/client/assets/{buckets-9Z92uR8k.js → buckets-Bj6zhdyA.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-BBWt46dQ.js → bulk-category-panel-lUvcURHE.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-aoMpKIlH.js → capability-load-error-D9qH2fQu.js} +1 -1
  74. package/dist/client/assets/{card-Q8NTBpN6.js → card-Dt7bFpWW.js} +1 -1
  75. package/dist/client/assets/{cards-CPa_UBVS.js → cards-B1tevlIV.js} +1 -1
  76. package/dist/client/assets/{category-editor-DJlTri60.js → category-editor-CxSnVNQr.js} +1 -1
  77. package/dist/client/assets/{chat-context-CoLr-7Td.js → chat-context-MWk3JEWX.js} +1 -1
  78. package/dist/client/assets/{checkbox-BASIfudC.js → checkbox-CpUzTkne.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-BGb-r5QN.js → cli-auth-success-BLFl3FAv.js} +1 -1
  80. package/dist/client/assets/{collection-detail-D-wnO3ND.js → collection-detail-abvuSy_2.js} +1 -1
  81. package/dist/client/assets/{collection-display-button-DqZ6npbm.js → collection-display-button-CNEESLLh.js} +1 -1
  82. package/dist/client/assets/{collection-search-DcjOoVI2.js → collection-search-CrIgHi7T.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-Dk-tpqRQ.js → collection-table-wrapper-CKJCl95k.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-B3mYYxtz.js → collection-tabs-BLnznnX1.js} +1 -1
  85. package/dist/client/assets/{command-Ceu-kj97.js → command-Dlp_QE-Q.js} +1 -1
  86. package/dist/client/assets/{commerce-onboarding-DUJNwI7O.js → commerce-onboarding-C_XUmTqa.js} +1 -1
  87. package/dist/client/assets/{connect-BEPfCsr6.js → connect-D6jF1ctb.js} +1 -1
  88. package/dist/client/assets/{connection-card-Deg3-TR-.js → connection-card-BdPIWlbb.js} +1 -1
  89. package/dist/client/assets/{connection-detail-Bk5VXyWe.js → connection-detail-C0PZNg8B.js} +1 -1
  90. package/dist/client/assets/{connection-form-helpers-CFUSjuXx.js → connection-form-helpers-B1hPYVMc.js} +1 -1
  91. package/dist/client/assets/{connection-DOaeV_kP.js → connection-k1-3F31a.js} +1 -1
  92. package/dist/client/assets/connections-Dl9R3iGS.js +1 -0
  93. package/dist/client/assets/{decopilot-sse-pool-Bq7TSvHG.js → decopilot-sse-pool-CfTcpBf8.js} +1 -1
  94. package/dist/client/assets/{dialog-BZBN7yPR.js → dialog-BRkQoppc.js} +1 -1
  95. package/dist/client/assets/{domain-settings-DrtoaW-K.js → domain-settings-BjaAnyL5.js} +1 -1
  96. package/dist/client/assets/{drawer-Dj5L09kg.js → drawer-DuYF-nKz.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-DHH3iD92.js → dropdown-menu-CeC_XINV.js} +1 -1
  98. package/dist/client/assets/{empty-state-CMN5pa17.js → empty-state-B6bvpPYK.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-DAqv-qPI.js → extract-connection-data-kLsSKsGM.js} +1 -1
  100. package/dist/client/assets/{file-explorer-C557qhnE.js → file-explorer-qHvvQbH4.js} +2 -2
  101. package/dist/client/assets/{file-type-icon-DmvBRayd.js → file-type-icon-CWLS5ci_.js} +1 -1
  102. package/dist/client/assets/{form-gddDxci6.js → form-BjD860k4.js} +1 -1
  103. package/dist/client/assets/{general-NAmVMCQn.js → general-Bn-PIynX.js} +1 -1
  104. package/dist/client/assets/{github-repo-picker-DoldcKAI.js → github-repo-picker-CJSaq-iT.js} +1 -1
  105. package/dist/client/assets/{hooks-BivAORDM.js → hooks-DeqnuCHC.js} +1 -1
  106. package/dist/client/assets/{index-D6wAeEnj.js → index-15Gp4vyN.js} +1 -1
  107. package/dist/client/assets/{index-C3e4oIeI.js → index-BXhXCExd.js} +1 -1
  108. package/dist/client/assets/{index-BXVYW9oP.js → index-Ce7wzSlG.js} +36 -36
  109. package/dist/client/assets/{index-BLUB_qjx.js → index-CqxQikd0.js} +1 -1
  110. package/dist/client/assets/{index-vqCvC9eJ.js → index-CrwluOcd.js} +1 -1
  111. package/dist/client/assets/{index-BI8RlZy1.js → index-D5CA2hs9.js} +6 -6
  112. package/dist/client/assets/{index-BZh9-lzE.js → index-DaxZehX5.js} +4 -4
  113. package/dist/client/assets/{index-DGR7yvKF.js → index-DsmxQAeO.js} +1 -1
  114. package/dist/client/assets/{index-DdGA8161.js → index-DugPB3K1.js} +1 -1
  115. package/dist/client/assets/{index-redirect-CTbbS_hA.js → index-redirect-Bhw89FOF.js} +1 -1
  116. package/dist/client/assets/{index-CZBiyydb.js → index-wkaqGAxQ.js} +1 -1
  117. package/dist/client/assets/{input-DtyDjASp.js → input-DLBQv69K.js} +1 -1
  118. package/dist/client/assets/{integration-icon-C9RLqPaZ.js → integration-icon-DDsS_Lrd.js} +1 -1
  119. package/dist/client/assets/{invite-member-dialog-Br5PsR4J.js → invite-member-dialog-DbrCssdm.js} +1 -1
  120. package/dist/client/assets/{label-D2Kr2ps4.js → label-Bu3ltt0f.js} +1 -1
  121. package/dist/client/assets/{layout-_DSy7bld.js → layout-Ct7-0zrn.js} +1 -1
  122. package/dist/client/assets/{login-B-vpJ6Sv.js → login-CJmVZn4S.js} +1 -1
  123. package/dist/client/assets/{mcp-oauth-D6VatWgr.js → mcp-oauth-CwQVc4wK.js} +1 -1
  124. package/dist/client/assets/{members-CqY-mSvl.js → members-DUx6fvD_.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-D6W9Jn6M.js → monaco-editor-CrcOoYiL.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-BYYAmZwq.js → monitoring-stats-row-BHwg0PBY.js} +3 -3
  127. package/dist/client/assets/{multi-select-F0tvBxHe.js → multi-select-BOz_jhvD.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-Duy_WTtg.js → oauth-callback-Dyz1CVAe.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-ai-provider-BbYdrMki.js → oauth-callback-ai-provider-BiquI4HU.js} +1 -1
  130. package/dist/client/assets/{onboarding-D8vUdXJm.js → onboarding-5ZzyqAdD.js} +1 -1
  131. package/dist/client/assets/{org-layout-PT-cdJq6.js → org-layout-CkYgjwRU.js} +1 -1
  132. package/dist/client/assets/{organization-choice-B4oxFfFi.js → organization-choice-rJQ9Q3J9.js} +1 -1
  133. package/dist/client/assets/{orgs-B72jiP78.js → orgs-Bid9NFiW.js} +1 -1
  134. package/dist/client/assets/{page-seo-form-D9BIlNMP.js → page-seo-form-t_07N54I.js} +1 -1
  135. package/dist/client/assets/{popover-f75RcDnM.js → popover-PwNxRDTf.js} +1 -1
  136. package/dist/client/assets/{post-editor-aKLsNoxQ.js → post-editor-BzSHIlM4.js} +1 -1
  137. package/dist/client/assets/{primitives-BulEqTk5.js → primitives-CM4Mgah8.js} +1 -1
  138. package/dist/client/assets/{profile-Bz5nmZG8.js → profile-DdQOCW-W.js} +1 -1
  139. package/dist/client/assets/{project-app-view-CrLLWzk_.js → project-app-view-DmXmZ-N6.js} +1 -1
  140. package/dist/client/assets/record-editor-J_gnlcq5.js +1 -0
  141. package/dist/client/assets/redirect-editor-DA_xg2De.js +1 -0
  142. package/dist/client/assets/registry-BQUckycR.js +2 -0
  143. package/dist/client/assets/{registry-layout-L13Wfh9O.js → registry-layout-DvtMYXSQ.js} +1 -1
  144. package/dist/client/assets/{reports-CQfwgHi2.js → reports-BREB4Uzx.js} +1 -1
  145. package/dist/client/assets/{require-capability-DQT0lYQq.js → require-capability-I_xvxUX8.js} +1 -1
  146. package/dist/client/assets/{required-auth-layout-D7c0rFdn.js → required-auth-layout-Du_oyovS.js} +1 -1
  147. package/dist/client/assets/{reset-password-BMk18Luc.js → reset-password-DI_jehz0.js} +1 -1
  148. package/dist/client/assets/{roles-wTfozYTs.js → roles-FaShxS3j.js} +1 -1
  149. package/dist/client/assets/{search-input-Cf-LChTS.js → search-input-WW1nmYiH.js} +1 -1
  150. package/dist/client/assets/{secrets-OFSQumDS.js → secrets-CEIhIt9L.js} +1 -1
  151. package/dist/client/assets/{sections-editor-Bwa2gdDU.js → sections-editor-DvdcOepw.js} +1 -1
  152. package/dist/client/assets/{select-aJ268xVp.js → select-D3VWqZ6O.js} +1 -1
  153. package/dist/client/assets/{select-model-CPsRo-oU.js → select-model-B12SxmPa.js} +2 -2
  154. package/dist/client/assets/self-tool-result-P4srATyh.js +1 -0
  155. package/dist/client/assets/{seo-editor-B9rgHeRD.js → seo-editor-Cxi1K5DF.js} +1 -1
  156. package/dist/client/assets/{settings-layout-B6Iq9TWm.js → settings-layout-DaOYARaR.js} +1 -1
  157. package/dist/client/assets/{settings-section-LwQq77KG.js → settings-section-DOF-L-RB.js} +1 -1
  158. package/dist/client/assets/{shell-controls-BX1rmK9p.js → shell-controls-Cn61lFh_.js} +1 -1
  159. package/dist/client/assets/{shell-layout-CPkbkQME.js → shell-layout-DCPnq29F.js} +1 -1
  160. package/dist/client/assets/{sidebar-D0z5Cxuk.js → sidebar-CHd6y1Ct.js} +1 -1
  161. package/dist/client/assets/{skeleton-SjlBCcjX.js → skeleton-BVGrCPJ-.js} +1 -1
  162. package/dist/client/assets/{spinner-CQMfz22E.js → spinner-BCLwugRZ.js} +1 -1
  163. package/dist/client/assets/{sso-C_4KT5op.js → sso-DXo55OWQ.js} +1 -1
  164. package/dist/client/assets/{store-kZT1zfks.js → store-CrrE4BOr.js} +1 -1
  165. package/dist/client/assets/store-registry-Cp3S6oOP.js +2 -0
  166. package/dist/client/assets/{studio-tools-B0_AcSKZ.js → studio-tools-9EYu19Cv.js} +1 -1
  167. package/dist/client/assets/{switch-CIB0IRpT.js → switch-Ce9_wN_9.js} +1 -1
  168. package/dist/client/assets/{synced-repos-DMVeJBA2.js → synced-repos-CGS_HKPX.js} +1 -1
  169. package/dist/client/assets/{tab-id-Byz2SGQX.js → tab-id-BJBaiO6k.js} +1 -1
  170. package/dist/client/assets/{table-DfBXbFhT.js → table-BazdsZQr.js} +1 -1
  171. package/dist/client/assets/{tabs-CI8QRrap.js → tabs-B_UfMbu-.js} +1 -1
  172. package/dist/client/assets/{textarea-BUW4RF90.js → textarea-DP4wAcHO.js} +1 -1
  173. package/dist/client/assets/{toggle-group-toV2h8do.js → toggle-group-Dr-b0W6O.js} +1 -1
  174. package/dist/client/assets/{toolbar-xM6JfAiK.js → toolbar-aj087TVf.js} +1 -1
  175. package/dist/client/assets/{tooltip-CB-3W3BK.js → tooltip-Ddk2UF0M.js} +1 -1
  176. package/dist/client/assets/{track-AKOKRozN.js → track-BG0UIYkX.js} +1 -1
  177. package/dist/client/assets/{use-ai-providers-0mfYVNtG.js → use-ai-providers-_AriHZw0.js} +1 -1
  178. package/dist/client/assets/{use-automations-zV3k_hCm.js → use-automations-CyYE_hVV.js} +1 -1
  179. package/dist/client/assets/{use-autosave-CCaPm49b.js → use-autosave-DQVq2EmC.js} +1 -1
  180. package/dist/client/assets/{use-capability-Bx72zdZ_.js → use-capability-BCL58O59.js} +1 -1
  181. package/dist/client/assets/{use-clock-tick-C6Dl4_Ba.js → use-clock-tick-i-HFZ1a_.js} +1 -1
  182. package/dist/client/assets/{use-connection-CU1SASjJ.js → use-connection-3LK27F94.js} +1 -1
  183. package/dist/client/assets/{use-copy-Ba8GdO7e.js → use-copy-DOXoQchn.js} +1 -1
  184. package/dist/client/assets/{use-create-virtual-mcp-CyajPsvg.js → use-create-virtual-mcp-CGm_4d0e.js} +1 -1
  185. package/dist/client/assets/{use-debounced-autosave-XWEF6ylb.js → use-debounced-autosave-B1d6oEqY.js} +1 -1
  186. package/dist/client/assets/{use-debounced-value-DaP2Vfp5.js → use-debounced-value-CNx8tv1w.js} +1 -1
  187. package/dist/client/assets/{use-deco-credits-D5amWKZw.js → use-deco-credits-Dp0W-Hpc.js} +1 -1
  188. package/dist/client/assets/{use-decopilot-events-DT8RjZZF.js → use-decopilot-events-DMN09RA1.js} +1 -1
  189. package/dist/client/assets/{use-delete-connection-DWapIKyB.js → use-delete-connection-BsLfePq4.js} +1 -1
  190. package/dist/client/assets/{use-deployment-admin-CQ19naZH.js → use-deployment-admin-D6EwkhC6.js} +1 -1
  191. package/dist/client/assets/{use-file-configs-we2-KED_.js → use-file-configs-lXfU4jxU.js} +1 -1
  192. package/dist/client/assets/{use-infinite-scroll-f_QDwgM2.js → use-infinite-scroll-BrpE3bFb.js} +1 -1
  193. package/dist/client/assets/{use-join-requests-CM9otB1q.js → use-join-requests-BjkJksC_.js} +1 -1
  194. package/dist/client/assets/{use-mcp-client-B3Khr26S.js → use-mcp-client-Bd6XHVt1.js} +4 -4
  195. package/dist/client/assets/{use-mcp-tools-DWI2d4P3.js → use-mcp-tools-DB8B57k0.js} +1 -1
  196. package/dist/client/assets/{use-members-nTp0kq-0.js → use-members-Dho3_Q8z.js} +1 -1
  197. package/dist/client/assets/{use-mobile-BY2sIYXP.js → use-mobile-DM0DUpr3.js} +1 -1
  198. package/dist/client/assets/{use-navigate-to-agent-BHUKMXo3.js → use-navigate-to-agent-DOrZy0up.js} +1 -1
  199. package/dist/client/assets/{use-open-billing-url-95NAs9uM.js → use-open-billing-url-CfkRZNP3.js} +1 -1
  200. package/dist/client/assets/{use-org-auth-client-DNlUjzOt.js → use-org-auth-client-2AF9YuHH.js} +1 -1
  201. package/dist/client/assets/{use-org-sso-BnAzSLsE.js → use-org-sso-KldGzQMx.js} +1 -1
  202. package/dist/client/assets/{use-organization-roles-ISpyLphz.js → use-organization-roles-9Dg6SJdN.js} +1 -1
  203. package/dist/client/assets/{use-organization-settings-DfmtKg6Y.js → use-organization-settings-DebQZ72D.js} +1 -1
  204. package/dist/client/assets/{use-registry-connections-CDv9RFLk.js → use-registry-connections-DMtB0M_t.js} +1 -1
  205. package/dist/client/assets/{use-secrets-C_hE5_Ph.js → use-secrets-DvfKEove.js} +1 -1
  206. package/dist/client/assets/{use-section-preview-base-DtbFyFHR.js → use-section-preview-base-Cpg3CUDp.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-Bhnnb3cr.js → use-status-sounds-Dcpo4Ugg.js} +1 -1
  208. package/dist/client/assets/{use-tags-BDvedplZ.js → use-tags-BkfXT29z.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-D9uXQ7e4.js → use-view-mode-Du9tSFNk.js} +1 -1
  210. package/dist/client/assets/{use-virtual-mcp-C-5DJUHP.js → use-virtual-mcp-CWHDMpbS.js} +1 -1
  211. package/dist/client/assets/useInfiniteQuery-D3bS8I-l.js +1 -0
  212. package/dist/client/assets/{useRouterState-Cv8oHX_r.js → useRouterState-CizG-ZOX.js} +1 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-CvmxgTX4.js +1 -0
  214. package/dist/client/assets/{users-BHiQlXv0.js → users-nmR-M5b6.js} +1 -1
  215. package/dist/client/assets/{variant-calendar-6Gxt9aCh.js → variant-calendar-E5Hn2ZNx.js} +1 -1
  216. package/dist/client/assets/{view-mode-toggle-bHA445xz.js → view-mode-toggle-BM7KOgO6.js} +1 -1
  217. package/dist/client/index.html +1 -1
  218. package/dist/server/cli.js +437 -437
  219. package/dist/server/server.js +300 -300
  220. package/package.json +1 -1
  221. package/dist/client/assets/connections-LSfHgCu1.js +0 -1
  222. package/dist/client/assets/record-editor-Ex3YfX4K.js +0 -1
  223. package/dist/client/assets/redirect-editor-BoPWn8Ri.js +0 -1
  224. package/dist/client/assets/registry-DpLBrpGJ.js +0 -2
  225. package/dist/client/assets/self-tool-result-DXhPzl10.js +0 -1
  226. package/dist/client/assets/store-registry-Jb0qyTz9.js +0 -2
  227. package/dist/client/assets/useInfiniteQuery-BhIEZ0f1.js +0 -1
  228. package/dist/client/assets/useSuspenseInfiniteQuery-Dlc1Th2H.js +0 -1
@@ -1,4 +1,4 @@
1
- import{bi as f,bj as t,a3 as R,$ as c,c7 as z,Z as s,a4 as v,_ as g,aP as b,b8 as H,bg as V,c8 as xe,c9 as we,ca as K,cb as W,cc as Ce,cd as Re,ce as Z,cf as ke,cg as qe,ch as Te,ci as Ie,cj as Ee,ck as Le,cl as ze,cm as Ae,bv as De,cn as Ue,co as Ne,cp as $e,cq as Oe,cr as je,cs as Be,ct as Fe,bt as Ve,r as se,c as J,j as w,cu as We,cv as Ke,p as Ze,v as Je,m as ie,bx as Ye}from"./index-BXVYW9oP.js";import{P as Qe}from"./use-mcp-client-B3Khr26S.js";const ue=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function Ge(r,e={}){const i=`<meta http-equiv="Content-Security-Policy" content="${et(e)}">`,n=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,l=r.match(n);if(l){const m=(l.index??0)+l[0].length;return r.slice(0,m)+`
1
+ import{bj as f,bk as t,a3 as R,$ as c,c8 as z,Z as s,a4 as v,_ as g,aP as b,b9 as H,bh as V,c9 as xe,ca as we,cb as K,cc as W,cd as Ce,ce as Re,cf as Z,cg as Pe,ch as qe,ci as Te,cj as Ie,ck as Ee,cl as Le,cm as ze,cn as Ae,bw as De,co as Ue,cp as Ne,cq as $e,cr as Oe,cs as je,ct as Be,cu as Fe,bu as Ve,r as se,c as J,j as w,cv as We,cw as Ke,p as Ze,v as Je,m as ie,by as Ye}from"./index-Ce7wzSlG.js";import{P as Qe}from"./use-mcp-client-Bd6XHVt1.js";const ue=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function Ge(r,e={}){const i=`<meta http-equiv="Content-Security-Policy" content="${et(e)}">`,n=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,l=r.match(n);if(l){const m=(l.index??0)+l[0].length;return r.slice(0,m)+`
2
2
  `+i+r.slice(m)}const d=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,u=r.match(d);if(u){const m=(u.index??0)+u[0].length;return r.slice(0,m)+`
3
3
  <head>
4
4
  `+i+`
@@ -46,7 +46,7 @@ Boolean requesting whether a visible border and background is provided by the ho
46
46
  - omitted: host decides border`)});var he=s({method:t("ui/request-display-mode"),params:s({mode:D.describe("The display mode being requested.")})});s({mode:D.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough();var gt=f([t("model"),t("app")]).describe("Tool visibility scope - who can access the tool.");s({resourceUri:c().optional(),visibility:g(gt).optional().describe(`Who can access this tool. Default: ["model", "app"]
47
47
  - "model": Tool visible to and callable by the agent
48
48
  - "app": Tool callable by the app from this server only`),csp:V().optional(),permissions:V().optional()});s({mimeTypes:g(c()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});var bt=s({method:t("ui/download-file"),params:s({contents:g(f([xe,we])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),yt=s({method:t("ui/message"),params:s({role:t("user").describe('Message role, currently only "user" is supported.'),content:g(K).describe("Message content blocks (text, image, etc.).")})});s({method:t("ui/notifications/sandbox-resource-ready"),params:s({html:c().describe("HTML content to load into the inner iframe."),sandbox:c().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:ae.optional().describe("CSP configuration from resource metadata."),permissions:le.optional().describe("Sandbox permissions from resource metadata.")})});s({method:t("ui/notifications/tool-result"),params:W.describe("Standard MCP tool execution result.")});var _e=s({toolInfo:s({id:Re.optional().describe("JSON-RPC id of the tools/call request."),tool:Ce.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:st.optional().describe("Current color theme preference."),styles:dt.optional().describe("Style configuration for theming the app."),displayMode:D.optional().describe("How the UI is currently displayed."),availableDisplayModes:g(D).optional().describe("Display modes the host supports."),containerDimensions:f([s({height:b().describe("Fixed container height in pixels.")}),s({maxHeight:f([b(),z()]).optional().describe("Maximum container height in pixels.")})]).and(f([s({width:b().describe("Fixed container width in pixels.")}),s({maxWidth:f([b(),z()]).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:c().optional().describe("User's language and region preference in BCP 47 format."),timeZone:c().optional().describe("User's timezone in IANA format."),userAgent:c().optional().describe("Host application identifier."),platform:f([t("web"),t("desktop"),t("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:s({touch:v().optional().describe("Whether the device supports touch input."),hover:v().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:s({top:b().describe("Top safe area inset in pixels."),right:b().describe("Right safe area inset in pixels."),bottom:b().describe("Bottom safe area inset in pixels."),left:b().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough();s({method:t("ui/notifications/host-context-changed"),params:_e.describe("Partial context update containing only changed fields.")});var vt=s({method:t("ui/update-model-context"),params:s({content:g(K).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:R(c(),H().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),xt=s({method:t("ui/initialize"),params:s({appInfo:Z.describe("App identification (name and version)."),appCapabilities:mt.describe("Features and capabilities this app provides."),protocolVersion:c().describe("Protocol version this app supports.")})});s({protocolVersion:c().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Z.describe("Host application identification and version."),hostCapabilities:ht.describe("Features and capabilities provided by the host."),hostContext:_e.describe("Rich context about the host environment.")}).passthrough();class wt{eventTarget;eventSource;messageListener;constructor(e=window.parent,o){this.eventTarget=e,this.eventSource=o,this.messageListener=i=>{if(o&&i.source!==this.eventSource){console.debug("Ignoring message from unknown source",i);return}let n=Ve.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!==ot&&console.debug("Sending message",e),this.eventTarget.postMessage(e,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var Ct="ui/resourceUri";function Rt(r){let e=r._meta?.ui?.resourceUri;if(e===void 0&&(e=r._meta?.[Ct]),typeof e=="string"&&e.startsWith("ui://"))return e;if(e!==void 0)throw Error(`Invalid UI resource URI: ${JSON.stringify(e)}`)}var St=[Se];class _t extends tt{_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:lt,sandboxready:at,initialized:ft,requestteardown:pt,loggingmessage:ke};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(xt,l=>this._oninitialize(l)),this.setRequestHandler(qe,(l,d)=>(this.onping?.(l.params,d),{})),this.replaceRequestHandler(he,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(yt,async(o,i)=>{if(!this._onmessage)throw Error("No onmessage handler set");return this._onmessage(o.params,i)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(e){this.warnIfRequestHandlerReplaced("onopenlink",this._onopenlink,e),this._onopenlink=e,this.replaceRequestHandler(nt,async(o,i)=>{if(!this._onopenlink)throw Error("No onopenlink handler set");return this._onopenlink(o.params,i)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(e){this.warnIfRequestHandlerReplaced("ondownloadfile",this._ondownloadfile,e),this._ondownloadfile=e,this.replaceRequestHandler(bt,async(o,i)=>{if(!this._ondownloadfile)throw Error("No ondownloadfile handler set");return this._ondownloadfile(o.params,i)})}get onrequestteardown(){return this.getEventHandler("requestteardown")}set onrequestteardown(e){this.setEventHandler("requestteardown",e)}_onrequestdisplaymode;get onrequestdisplaymode(){return this._onrequestdisplaymode}set onrequestdisplaymode(e){this.warnIfRequestHandlerReplaced("onrequestdisplaymode",this._onrequestdisplaymode,e),this._onrequestdisplaymode=e,this.replaceRequestHandler(he,async(o,i)=>{if(!this._onrequestdisplaymode)throw Error("No onrequestdisplaymode handler set");return this._onrequestdisplaymode(o.params,i)})}get onloggingmessage(){return this.getEventHandler("loggingmessage")}set onloggingmessage(e){this.setEventHandler("loggingmessage",e)}_onupdatemodelcontext;get onupdatemodelcontext(){return this._onupdatemodelcontext}set onupdatemodelcontext(e){this.warnIfRequestHandlerReplaced("onupdatemodelcontext",this._onupdatemodelcontext,e),this._onupdatemodelcontext=e,this.replaceRequestHandler(vt,async(o,i)=>{if(!this._onupdatemodelcontext)throw Error("No onupdatemodelcontext handler set");return this._onupdatemodelcontext(o.params,i)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(Te,async(o,i)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(o.params,i)})}set oncreatesamplingmessage(e){this.setRequestHandler(Ie,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(Ee,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(Le,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(ze,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(Ae,async(o,i)=>{if(!this._onlistprompts)throw Error("No onlistprompts handler set");return this._onlistprompts(o.params,i)})}sendPromptListChanged(e={}){return this.notification({method:"notifications/prompts/list_changed",params:e})}assertCapabilityForMethod(e){}assertRequestHandlerCapability(e){}assertNotificationCapability(e){}assertTaskCapability(e){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(e){throw Error("Task handlers are not supported in MCP Apps")}getCapabilities(){return this._capabilities}async _oninitialize(e){let o=e.params.protocolVersion;return this._appInfo!==void 0&&console.warn("[ext-apps] AppBridge received a second ui/initialize. The View may be double-mounting (e.g. React StrictMode in dev) without closing the previous App instance. Responding normally; the latest appInfo/appCapabilities replace the previous values."),this._appCapabilities=e.params.appCapabilities,this._appInfo=e.params.appInfo,{protocolVersion:St.includes(o)?o:Se,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],d=e[n];Ht(l,d)||(o[n]=d,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},ut,o)}sendResourceTeardown=this.teardownResource;callTool(e,o){return this.request({method:"tools/call",params:e},W,o)}listTools(e,o){return this.request({method:"tools/list",params:e},De,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},W,{signal:n.signal}),o.tools.listChanged&&this._client.setNotificationHandler(Ue,i=>this.sendToolListChanged(i.params))),o.resources&&(this.onlistresources=async(i,n)=>this._client.request({method:"resources/list",params:i},Ne,{signal:n.signal}),this.onlistresourcetemplates=async(i,n)=>this._client.request({method:"resources/templates/list",params:i},$e,{signal:n.signal}),this.onreadresource=async(i,n)=>this._client.request({method:"resources/read",params:i},Oe,{signal:n.signal}),o.resources.listChanged&&this._client.setNotificationHandler(je,i=>this.sendResourceListChanged(i.params))),o.prompts&&(this.onlistprompts=async(i,n)=>this._client.request({method:"prompts/list",params:i},Be,{signal:n.signal}),o.prompts.listChanged&&this._client.setNotificationHandler(Fe,i=>this.sendPromptListChanged(i.params)))}return super.connect(e)}}function Ht(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 Mt=f([t("light"),t("dark")]).describe("Color theme preference for the host environment."),U=f([t("inline"),t("fullscreen"),t("pip")]).describe("Display mode for UI presentation."),Pt=f([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."),kt=R(Pt.describe(`Style variables for theming MCP apps.
49
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:c().optional().describe("User's language and region preference in BCP 47 format."),timeZone:c().optional().describe("User's timezone in IANA format."),userAgent:c().optional().describe("Host application identifier."),platform:f([t("web"),t("desktop"),t("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:s({touch:v().optional().describe("Whether the device supports touch input."),hover:v().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:s({top:b().describe("Top safe area inset in pixels."),right:b().describe("Right safe area inset in pixels."),bottom:b().describe("Bottom safe area inset in pixels."),left:b().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough();s({method:t("ui/notifications/host-context-changed"),params:_e.describe("Partial context update containing only changed fields.")});var vt=s({method:t("ui/update-model-context"),params:s({content:g(K).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:R(c(),H().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),xt=s({method:t("ui/initialize"),params:s({appInfo:Z.describe("App identification (name and version)."),appCapabilities:mt.describe("Features and capabilities this app provides."),protocolVersion:c().describe("Protocol version this app supports.")})});s({protocolVersion:c().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Z.describe("Host application identification and version."),hostCapabilities:ht.describe("Features and capabilities provided by the host."),hostContext:_e.describe("Rich context about the host environment.")}).passthrough();class wt{eventTarget;eventSource;messageListener;constructor(e=window.parent,o){this.eventTarget=e,this.eventSource=o,this.messageListener=i=>{if(o&&i.source!==this.eventSource){console.debug("Ignoring message from unknown source",i);return}let n=Ve.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!==ot&&console.debug("Sending message",e),this.eventTarget.postMessage(e,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var Ct="ui/resourceUri";function Rt(r){let e=r._meta?.ui?.resourceUri;if(e===void 0&&(e=r._meta?.[Ct]),typeof e=="string"&&e.startsWith("ui://"))return e;if(e!==void 0)throw Error(`Invalid UI resource URI: ${JSON.stringify(e)}`)}var St=[Se];class _t extends tt{_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:lt,sandboxready:at,initialized:ft,requestteardown:pt,loggingmessage:Pe};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(xt,l=>this._oninitialize(l)),this.setRequestHandler(qe,(l,d)=>(this.onping?.(l.params,d),{})),this.replaceRequestHandler(he,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(yt,async(o,i)=>{if(!this._onmessage)throw Error("No onmessage handler set");return this._onmessage(o.params,i)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(e){this.warnIfRequestHandlerReplaced("onopenlink",this._onopenlink,e),this._onopenlink=e,this.replaceRequestHandler(nt,async(o,i)=>{if(!this._onopenlink)throw Error("No onopenlink handler set");return this._onopenlink(o.params,i)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(e){this.warnIfRequestHandlerReplaced("ondownloadfile",this._ondownloadfile,e),this._ondownloadfile=e,this.replaceRequestHandler(bt,async(o,i)=>{if(!this._ondownloadfile)throw Error("No ondownloadfile handler set");return this._ondownloadfile(o.params,i)})}get onrequestteardown(){return this.getEventHandler("requestteardown")}set onrequestteardown(e){this.setEventHandler("requestteardown",e)}_onrequestdisplaymode;get onrequestdisplaymode(){return this._onrequestdisplaymode}set onrequestdisplaymode(e){this.warnIfRequestHandlerReplaced("onrequestdisplaymode",this._onrequestdisplaymode,e),this._onrequestdisplaymode=e,this.replaceRequestHandler(he,async(o,i)=>{if(!this._onrequestdisplaymode)throw Error("No onrequestdisplaymode handler set");return this._onrequestdisplaymode(o.params,i)})}get onloggingmessage(){return this.getEventHandler("loggingmessage")}set onloggingmessage(e){this.setEventHandler("loggingmessage",e)}_onupdatemodelcontext;get onupdatemodelcontext(){return this._onupdatemodelcontext}set onupdatemodelcontext(e){this.warnIfRequestHandlerReplaced("onupdatemodelcontext",this._onupdatemodelcontext,e),this._onupdatemodelcontext=e,this.replaceRequestHandler(vt,async(o,i)=>{if(!this._onupdatemodelcontext)throw Error("No onupdatemodelcontext handler set");return this._onupdatemodelcontext(o.params,i)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(Te,async(o,i)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(o.params,i)})}set oncreatesamplingmessage(e){this.setRequestHandler(Ie,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(Ee,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(Le,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(ze,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(Ae,async(o,i)=>{if(!this._onlistprompts)throw Error("No onlistprompts handler set");return this._onlistprompts(o.params,i)})}sendPromptListChanged(e={}){return this.notification({method:"notifications/prompts/list_changed",params:e})}assertCapabilityForMethod(e){}assertRequestHandlerCapability(e){}assertNotificationCapability(e){}assertTaskCapability(e){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(e){throw Error("Task handlers are not supported in MCP Apps")}getCapabilities(){return this._capabilities}async _oninitialize(e){let o=e.params.protocolVersion;return this._appInfo!==void 0&&console.warn("[ext-apps] AppBridge received a second ui/initialize. The View may be double-mounting (e.g. React StrictMode in dev) without closing the previous App instance. Responding normally; the latest appInfo/appCapabilities replace the previous values."),this._appCapabilities=e.params.appCapabilities,this._appInfo=e.params.appInfo,{protocolVersion:St.includes(o)?o:Se,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],d=e[n];Ht(l,d)||(o[n]=d,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},ut,o)}sendResourceTeardown=this.teardownResource;callTool(e,o){return this.request({method:"tools/call",params:e},W,o)}listTools(e,o){return this.request({method:"tools/list",params:e},De,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},W,{signal:n.signal}),o.tools.listChanged&&this._client.setNotificationHandler(Ue,i=>this.sendToolListChanged(i.params))),o.resources&&(this.onlistresources=async(i,n)=>this._client.request({method:"resources/list",params:i},Ne,{signal:n.signal}),this.onlistresourcetemplates=async(i,n)=>this._client.request({method:"resources/templates/list",params:i},$e,{signal:n.signal}),this.onreadresource=async(i,n)=>this._client.request({method:"resources/read",params:i},Oe,{signal:n.signal}),o.resources.listChanged&&this._client.setNotificationHandler(je,i=>this.sendResourceListChanged(i.params))),o.prompts&&(this.onlistprompts=async(i,n)=>this._client.request({method:"prompts/list",params:i},Be,{signal:n.signal}),o.prompts.listChanged&&this._client.setNotificationHandler(Fe,i=>this.sendPromptListChanged(i.params)))}return super.connect(e)}}function Ht(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 Mt=f([t("light"),t("dark")]).describe("Color theme preference for the host environment."),U=f([t("inline"),t("fullscreen"),t("pip")]).describe("Display mode for UI presentation."),kt=f([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."),Pt=R(kt.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.).
@@ -67,7 +67,7 @@ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Rec
67
67
  for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);s({method:t("ui/open-link"),params:s({url:c().describe("URL to open in the host's browser")})});s({isError:v().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough();s({isError:v().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough();s({isError:v().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 ce=s({connectDomains:g(c()).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:g(c()).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:g(c()).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:g(c()).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'`)")}),de=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:b().optional().describe("New width in pixels."),height:b().optional().describe("New height in pixels.")})});s({method:t("ui/notifications/tool-input"),params:s({arguments:R(c(),H().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:R(c(),H().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:c().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})});var qt=s({fonts:c().optional()}),Tt=s({variables:kt.optional().describe("CSS variables for theming the app."),css:qt.optional().describe("CSS blocks that apps can inject.")});s({method:t("ui/resource-teardown"),params:s({})});R(c(),H());var me=s({text:s({}).optional().describe("Host supports text content blocks."),image:s({}).optional().describe("Host supports image content blocks."),audio:s({}).optional().describe("Host supports audio content blocks."),resource:s({}).optional().describe("Host supports resource content blocks."),resourceLink:s({}).optional().describe("Host supports resource link content blocks."),structuredContent:s({}).optional().describe("Host supports structured content.")});s({method:t("ui/notifications/request-teardown"),params:s({}).optional()});var It=s({experimental:s({}).optional().describe("Experimental features (structure TBD)."),openLinks:s({}).optional().describe("Host supports opening external URLs."),downloadFile:s({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:s({listChanged:v().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:s({listChanged:v().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:de.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:ce.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:me.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:me.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:s({tools:s({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),Et=s({experimental:s({}).optional().describe("Experimental features (structure TBD)."),tools:s({listChanged:v().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:g(U).optional().describe("Display modes the app supports.")});s({method:t("ui/notifications/initialized"),params:s({}).optional()});s({csp:ce.optional().describe("Content Security Policy configuration for UI resources."),permissions:de.optional().describe("Sandbox permissions requested by the UI resource."),domain:c().optional().describe(`Dedicated origin for view sandbox.
70
+ - Empty or omitted → no network connections (secure default)`),resourceDomains:g(c()).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:g(c()).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:g(c()).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'`)")}),de=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:b().optional().describe("New width in pixels."),height:b().optional().describe("New height in pixels.")})});s({method:t("ui/notifications/tool-input"),params:s({arguments:R(c(),H().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:R(c(),H().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:c().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})});var qt=s({fonts:c().optional()}),Tt=s({variables:Pt.optional().describe("CSS variables for theming the app."),css:qt.optional().describe("CSS blocks that apps can inject.")});s({method:t("ui/resource-teardown"),params:s({})});R(c(),H());var me=s({text:s({}).optional().describe("Host supports text content blocks."),image:s({}).optional().describe("Host supports image content blocks."),audio:s({}).optional().describe("Host supports audio content blocks."),resource:s({}).optional().describe("Host supports resource content blocks."),resourceLink:s({}).optional().describe("Host supports resource link content blocks."),structuredContent:s({}).optional().describe("Host supports structured content.")});s({method:t("ui/notifications/request-teardown"),params:s({}).optional()});var It=s({experimental:s({}).optional().describe("Experimental features (structure TBD)."),openLinks:s({}).optional().describe("Host supports opening external URLs."),downloadFile:s({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:s({listChanged:v().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:s({listChanged:v().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:de.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:ce.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:me.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:me.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:s({tools:s({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),Et=s({experimental:s({}).optional().describe("Experimental features (structure TBD)."),tools:s({listChanged:v().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:g(U).optional().describe("Display modes the app supports.")});s({method:t("ui/notifications/initialized"),params:s({}).optional()});s({csp:ce.optional().describe("Content Security Policy configuration for UI resources."),permissions:de.optional().describe("Sandbox permissions requested by the UI resource."),domain:c().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
 
@@ -84,4 +84,4 @@ Boolean requesting whether a visible border and background is provided by the ho
84
84
  - omitted: host decides border`)});s({method:t("ui/request-display-mode"),params:s({mode:U.describe("The display mode being requested.")})});s({mode:U.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough();var Lt=f([t("model"),t("app")]).describe("Tool visibility scope - who can access the tool.");s({resourceUri:c().optional(),visibility:g(Lt).optional().describe(`Who can access this tool. Default: ["model", "app"]
85
85
  - "model": Tool visible to and callable by the agent
86
86
  - "app": Tool callable by the app from this server only`),csp:V().optional(),permissions:V().optional()});s({mimeTypes:g(c()).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:g(f([xe,we])).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:g(K).describe("Message content blocks (text, image, etc.).")})});s({method:t("ui/notifications/sandbox-resource-ready"),params:s({html:c().describe("HTML content to load into the inner iframe."),sandbox:c().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:ce.optional().describe("CSP configuration from resource metadata."),permissions:de.optional().describe("Sandbox permissions from resource metadata.")})});s({method:t("ui/notifications/tool-result"),params:W.describe("Standard MCP tool execution result.")});var He=s({toolInfo:s({id:Re.optional().describe("JSON-RPC id of the tools/call request."),tool:Ce.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:Mt.optional().describe("Current color theme preference."),styles:Tt.optional().describe("Style configuration for theming the app."),displayMode:U.optional().describe("How the UI is currently displayed."),availableDisplayModes:g(U).optional().describe("Display modes the host supports."),containerDimensions:f([s({height:b().describe("Fixed container height in pixels.")}),s({maxHeight:f([b(),z()]).optional().describe("Maximum container height in pixels.")})]).and(f([s({width:b().describe("Fixed container width in pixels.")}),s({maxWidth:f([b(),z()]).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:c().optional().describe("User's language and region preference in BCP 47 format."),timeZone:c().optional().describe("User's timezone in IANA format."),userAgent:c().optional().describe("Host application identifier."),platform:f([t("web"),t("desktop"),t("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:s({touch:v().optional().describe("Whether the device supports touch input."),hover:v().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:s({top:b().describe("Top safe area inset in pixels."),right:b().describe("Right safe area inset in pixels."),bottom:b().describe("Bottom safe area inset in pixels."),left:b().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:He.describe("Partial context update containing only changed fields.")});s({method:t("ui/update-model-context"),params:s({content:g(K).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:R(c(),H().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:Z.describe("App identification (name and version)."),appCapabilities:Et.describe("Features and capabilities this app provides."),protocolVersion:c().describe("Protocol version this app supports.")})});s({protocolVersion:c().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Z.describe("Host application identification and version."),hostCapabilities:It.describe("Features and capabilities provided by the host."),hostContext:He.describe("Rich context about the host environment.")}).passthrough();function zt(){let r=document.documentElement.getAttribute("data-theme");return r==="dark"||r==="light"?r:document.documentElement.classList.contains("dark")?"dark":"light"}const At=[["--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 Dt(){if(typeof document>"u")return{};const r=getComputedStyle(document.documentElement),e={};for(const[o,i]of At){const n=r.getPropertyValue(o).trim();n&&(e[i]=n)}return{variables:e}}const Ut={name:"Studio",version:"1.0.0"},Nt={openLinks:{},serverTools:{},serverResources:{},logging:{},message:{},downloadFile:{},updateModelContext:{text:{}}},$t=15e3;function Ot(){return typeof navigator>"u"?"en":navigator.language??"en"}function jt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}function Bt(){return typeof navigator>"u"?"web":/Mobi|Android/i.test(navigator.userAgent)?"mobile":"web"}function fe(r,e,o,i,n){return{theme:zt(),styles:Dt(),displayMode:r,availableDisplayModes:["inline","fullscreen"],locale:n??Ot(),timeZone:jt(),platform:Bt(),...e!=null&&{toolInfo:e},...o!=null&&{containerDimensions:{maxHeight:o}},...i!=null&&{orgId:i}}}const ne=new Set;let ge=!1;function Ft(){if(ge||typeof document>"u")return;ge=!0;const r=()=>ne.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 Vt(r){return ne.add(r),Ft(),()=>ne.delete(r)}class Wt{bridge=null;timeout=null;disposed=!1;unsubTheme=null;snapshot;listeners=new Set;config;constructor(e){this.config=e,this.snapshot=Object.freeze({height:e.minHeight,isLoading:!0,error:null})}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snapshot;updateConfig(e){const o=this.config;this.config=e,!(!this.bridge||this.disposed)&&((e.displayMode!==o.displayMode||e.locale!==o.locale)&&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,locale:l}=this.config;this.bridge.setHostContext(fe(e,i,o,n,l))}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:d,locale:u}=this.config,h=fe(i,l,n,d,u),y=new _t(o,Ut,Nt,{hostContext:h});this.bridge=y,this.registerHandlers(y),this.startInitTimeout(),this.registerInitHandler(y),this.connectTransport(y,e),this.unsubTheme=Vt(()=>this.pushHostContext())}catch(o){this.clearTimeout(),console.error("Failed to create AppBridge:",o),this.set({error:o instanceof Error?o.message:"Unknown error",isLoading:!1})}}registerHandlers(e){e.onopenlink=async({url:o})=>{let i=null;try{i=new URL(o)}catch{}if(!i||!["http:","https:"].includes(i.protocol))throw new Error("Only http and https URLs are allowed");return window.open(o,"_blank","noopener,noreferrer"),{}},e.onmessage=async o=>(this.config.onMessage?.(o),{}),e.onupdatemodelcontext=async o=>(this.config.onUpdateModelContext?.(o),{}),e.onsizechange=({height:o})=>{if(!this.disposed&&o!=null){const{minHeight:i,maxHeight: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}),d=URL.createObjectURL(l),u=document.createElement("a");u.href=d,u.download=n.uri.split("/").pop()??"download",u.click(),URL.revokeObjectURL(d)}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})},$t)}clearTimeout(){this.timeout&&(globalThis.clearTimeout(this.timeout),this.timeout=null)}connectTransport(e,o){if(!o.contentWindow){console.warn("iframe contentWindow not yet available");return}const i=new wt(o.contentWindow,o.contentWindow);e.connect(i).catch(n=>{this.disposed||(this.clearTimeout(),console.error("AppBridge connect failed:",n),this.set({error:n instanceof Error?n.message:"Connection failed",isLoading:!1}))})}}function Kt(r){const e=se.useRef(new Wt(r));se.useEffect(()=>{e.current.updateConfig(r)},[r]);const{height:o,isLoading:i,error:n}=se.useSyncExternalStore(e.current.subscribe,e.current.getSnapshot);return{height:o,isLoading:i,error:n,iframeRef:e.current.attach}}const be=new Set;function Zt(r){const e=r?.contents?.[0];return!e||!("text"in e)||!e.text?null:Ge(e.text,{resourceCsp:e._meta?.ui?.csp})}function Me(r){const e=J.c(40),{html:o,uri:i,orgId:n,toolInfo:l,toolInput:d,toolResult:u,displayMode:h,minHeight:y,maxHeight:m,client:S,onMessage:_,onUpdateModelContext:A,onTeardown:M,onRequestDisplayMode:x,className:a}=r,C=h===void 0?"inline":h,Y=y===void 0?150:y,Q=m===void 0?600:m;i&&!be.has(i)&&(be.add(i),Ze("mcp_app_opened",{resource_uri:i,display_mode:C,tool_name:l?.tool?.name??null}));const[G]=Je();let N;e[0]!==S||e[1]!==C||e[2]!==Q||e[3]!==Y||e[4]!==_||e[5]!==x||e[6]!==M||e[7]!==A||e[8]!==n||e[9]!==G.language||e[10]!==l||e[11]!==d||e[12]!==u?(N={client:S,displayMode:C,minHeight:Y,maxHeight:Q,orgId:n,locale:G.language,toolInfo:l,toolInput:d,toolResult:u,onMessage:_,onUpdateModelContext:A,onTeardown:M,onRequestDisplayMode:x},e[0]=S,e[1]=C,e[2]=Q,e[3]=Y,e[4]=_,e[5]=x,e[6]=M,e[7]=A,e[8]=n,e[9]=G.language,e[10]=l,e[11]=d,e[12]=u,e[13]=N):N=e[13];const{height:X,isLoading:$,error:O,iframeRef:ee}=Kt(N);if(!o)return null;if(O){let E;e[14]!==a?(E=ie("flex items-center justify-center p-4 text-destructive bg-destructive/10 rounded-lg",a),e[14]=a,e[15]=E):E=e[15];let L;e[16]!==O?(L=w.jsx("span",{className:"text-sm",children:O}),e[16]=O,e[17]=L):L=e[17];let B;return e[18]!==E||e[19]!==L?(B=w.jsx("div",{className:E,children:L}),e[18]=E,e[19]=L,e[20]=B):B=e[20],B}const Pe=l?.tool.name;let P;e[21]!==a?(P=ie("relative w-full overflow-hidden rounded-lg",a),e[21]=a,e[22]=P):P=e[22];let k;e[23]!==C||e[24]!==X?(k=C!=="fullscreen"?{height:`${X}px`}:void 0,e[23]=C,e[24]=X,e[25]=k):k=e[25];let q;e[26]!==$?(q=$&&w.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background z-10",children:w.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[w.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),w.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),e[26]=$,e[27]=q):q=e[27];const te=$&&"invisible";let T;e[28]!==te?(T=ie("w-full h-full border-0",te),e[28]=te,e[29]=T):T=e[29];const oe=`MCP App: ${Pe??i}`;let I;e[30]!==o||e[31]!==ee||e[32]!==oe||e[33]!==T?(I=w.jsx("iframe",{ref:ee,srcDoc:o,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-downloads",className:T,title:oe}),e[30]=o,e[31]=ee,e[32]=oe,e[33]=T,e[34]=I):I=e[34];let j;return e[35]!==I||e[36]!==P||e[37]!==k||e[38]!==q?(j=w.jsxs("div",{className:P,style:k,children:[q,I]}),e[35]=I,e[36]=P,e[37]=k,e[38]=q,e[39]=j):j=e[39],j}function Jt(r){const e=J.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 d;e[5]!==o||e[6]!==n||e[7]!==l?(d={orgSlug:n,connectionId:o,uri:l,staleTime:3e4},e[5]=o,e[6]=n,e[7]=l,e[8]=d):d=e[8];const u=We(d);let h;return e[9]!==i||e[10]!==u.data||e[11]!==l?(h=w.jsx(Me,{html:u.data,uri:l,...i}),e[9]=i,e[10]=u.data,e[11]=l,e[12]=h):h=e[12],h}function Yt(r){const e=J.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}=Ke(n),d=Zt(l);let u;return e[6]!==o||e[7]!==d||e[8]!==i?(u=w.jsx(Me,{html:d,uri:i,...o}),e[6]=o,e[7]=d,e[8]=i,e[9]=u):u=e[9],u}function oo(r){const e=J.c(4);if(r.orgSlug&&r.connectionId){let i;return e[0]!==r?(i=w.jsx(Jt,{...r,orgSlug:r.orgSlug,connectionId:r.connectionId}),e[0]=r,e[1]=i):i=e[1],i}let o;return e[2]!==r?(o=w.jsx(Yt,{...r}),e[2]=r,e[3]=o):o=e[3],o}const so={view:{minHeight:400,maxHeight:800},fullscreen:{minHeight:600,maxHeight:1200}};function io(r){if(!(r==null||typeof r!="object"))try{return Rt({_meta:r})}catch{return}}var re={exports:{}},p={};var ye;function Qt(){if(ye)return p;ye=1;var r=Symbol.for("react.element"),e=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),d=Symbol.for("react.context"),u=Symbol.for("react.server_context"),h=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),M;M=Symbol.for("react.module.reference");function x(a){if(typeof a=="object"&&a!==null){var C=a.$$typeof;switch(C){case r:switch(a=a.type,a){case o:case n:case i:case y:case m:return a;default:switch(a=a&&a.$$typeof,a){case u:case d:case h:case _:case S:case l:return a;default:return C}}case e:return C}}}return p.ContextConsumer=d,p.ContextProvider=l,p.Element=r,p.ForwardRef=h,p.Fragment=o,p.Lazy=_,p.Memo=S,p.Portal=e,p.Profiler=n,p.StrictMode=i,p.Suspense=y,p.SuspenseList=m,p.isAsyncMode=function(){return!1},p.isConcurrentMode=function(){return!1},p.isContextConsumer=function(a){return x(a)===d},p.isContextProvider=function(a){return x(a)===l},p.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===r},p.isForwardRef=function(a){return x(a)===h},p.isFragment=function(a){return x(a)===o},p.isLazy=function(a){return x(a)===_},p.isMemo=function(a){return x(a)===S},p.isPortal=function(a){return x(a)===e},p.isProfiler=function(a){return x(a)===n},p.isStrictMode=function(a){return x(a)===i},p.isSuspense=function(a){return x(a)===y},p.isSuspenseList=function(a){return x(a)===m},p.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===o||a===n||a===i||a===y||a===m||a===A||typeof a=="object"&&a!==null&&(a.$$typeof===_||a.$$typeof===S||a.$$typeof===l||a.$$typeof===d||a.$$typeof===h||a.$$typeof===M||a.getModuleId!==void 0)},p.typeOf=x,p}var ve;function Gt(){return ve||(ve=1,re.exports=Qt()),re.exports}var Xt=Gt();const ro=Ye(Xt);export{oo as M,ro as R,so as a,io as g,Xt as r};
87
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:c().optional().describe("User's language and region preference in BCP 47 format."),timeZone:c().optional().describe("User's timezone in IANA format."),userAgent:c().optional().describe("Host application identifier."),platform:f([t("web"),t("desktop"),t("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:s({touch:v().optional().describe("Whether the device supports touch input."),hover:v().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:s({top:b().describe("Top safe area inset in pixels."),right:b().describe("Right safe area inset in pixels."),bottom:b().describe("Bottom safe area inset in pixels."),left:b().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:He.describe("Partial context update containing only changed fields.")});s({method:t("ui/update-model-context"),params:s({content:g(K).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:R(c(),H().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:Z.describe("App identification (name and version)."),appCapabilities:Et.describe("Features and capabilities this app provides."),protocolVersion:c().describe("Protocol version this app supports.")})});s({protocolVersion:c().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Z.describe("Host application identification and version."),hostCapabilities:It.describe("Features and capabilities provided by the host."),hostContext:He.describe("Rich context about the host environment.")}).passthrough();function zt(){let r=document.documentElement.getAttribute("data-theme");return r==="dark"||r==="light"?r:document.documentElement.classList.contains("dark")?"dark":"light"}const At=[["--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 Dt(){if(typeof document>"u")return{};const r=getComputedStyle(document.documentElement),e={};for(const[o,i]of At){const n=r.getPropertyValue(o).trim();n&&(e[i]=n)}return{variables:e}}const Ut={name:"Studio",version:"1.0.0"},Nt={openLinks:{},serverTools:{},serverResources:{},logging:{},message:{},downloadFile:{},updateModelContext:{text:{}}},$t=15e3;function Ot(){return typeof navigator>"u"?"en":navigator.language??"en"}function jt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}function Bt(){return typeof navigator>"u"?"web":/Mobi|Android/i.test(navigator.userAgent)?"mobile":"web"}function fe(r,e,o,i,n){return{theme:zt(),styles:Dt(),displayMode:r,availableDisplayModes:["inline","fullscreen"],locale:n??Ot(),timeZone:jt(),platform:Bt(),...e!=null&&{toolInfo:e},...o!=null&&{containerDimensions:{maxHeight:o}},...i!=null&&{orgId:i}}}const ne=new Set;let ge=!1;function Ft(){if(ge||typeof document>"u")return;ge=!0;const r=()=>ne.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 Vt(r){return ne.add(r),Ft(),()=>ne.delete(r)}class Wt{bridge=null;timeout=null;disposed=!1;unsubTheme=null;snapshot;listeners=new Set;config;constructor(e){this.config=e,this.snapshot=Object.freeze({height:e.minHeight,isLoading:!0,error:null})}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snapshot;updateConfig(e){const o=this.config;this.config=e,!(!this.bridge||this.disposed)&&((e.displayMode!==o.displayMode||e.locale!==o.locale)&&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,locale:l}=this.config;this.bridge.setHostContext(fe(e,i,o,n,l))}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:d,locale:u}=this.config,h=fe(i,l,n,d,u),y=new _t(o,Ut,Nt,{hostContext:h});this.bridge=y,this.registerHandlers(y),this.startInitTimeout(),this.registerInitHandler(y),this.connectTransport(y,e),this.unsubTheme=Vt(()=>this.pushHostContext())}catch(o){this.clearTimeout(),console.error("Failed to create AppBridge:",o),this.set({error:o instanceof Error?o.message:"Unknown error",isLoading:!1})}}registerHandlers(e){e.onopenlink=async({url:o})=>{let i=null;try{i=new URL(o)}catch{}if(!i||!["http:","https:"].includes(i.protocol))throw new Error("Only http and https URLs are allowed");return window.open(o,"_blank","noopener,noreferrer"),{}},e.onmessage=async o=>(this.config.onMessage?.(o),{}),e.onupdatemodelcontext=async o=>(this.config.onUpdateModelContext?.(o),{}),e.onsizechange=({height:o})=>{if(!this.disposed&&o!=null){const{minHeight:i,maxHeight: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}),d=URL.createObjectURL(l),u=document.createElement("a");u.href=d,u.download=n.uri.split("/").pop()??"download",u.click(),URL.revokeObjectURL(d)}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})},$t)}clearTimeout(){this.timeout&&(globalThis.clearTimeout(this.timeout),this.timeout=null)}connectTransport(e,o){if(!o.contentWindow){console.warn("iframe contentWindow not yet available");return}const i=new wt(o.contentWindow,o.contentWindow);e.connect(i).catch(n=>{this.disposed||(this.clearTimeout(),console.error("AppBridge connect failed:",n),this.set({error:n instanceof Error?n.message:"Connection failed",isLoading:!1}))})}}function Kt(r){const e=se.useRef(new Wt(r));se.useEffect(()=>{e.current.updateConfig(r)},[r]);const{height:o,isLoading:i,error:n}=se.useSyncExternalStore(e.current.subscribe,e.current.getSnapshot);return{height:o,isLoading:i,error:n,iframeRef:e.current.attach}}const be=new Set;function Zt(r){const e=r?.contents?.[0];return!e||!("text"in e)||!e.text?null:Ge(e.text,{resourceCsp:e._meta?.ui?.csp})}function Me(r){const e=J.c(40),{html:o,uri:i,orgId:n,toolInfo:l,toolInput:d,toolResult:u,displayMode:h,minHeight:y,maxHeight:m,client:S,onMessage:_,onUpdateModelContext:A,onTeardown:M,onRequestDisplayMode:x,className:a}=r,C=h===void 0?"inline":h,Y=y===void 0?150:y,Q=m===void 0?600:m;i&&!be.has(i)&&(be.add(i),Ze("mcp_app_opened",{resource_uri:i,display_mode:C,tool_name:l?.tool?.name??null}));const[G]=Je();let N;e[0]!==S||e[1]!==C||e[2]!==Q||e[3]!==Y||e[4]!==_||e[5]!==x||e[6]!==M||e[7]!==A||e[8]!==n||e[9]!==G.language||e[10]!==l||e[11]!==d||e[12]!==u?(N={client:S,displayMode:C,minHeight:Y,maxHeight:Q,orgId:n,locale:G.language,toolInfo:l,toolInput:d,toolResult:u,onMessage:_,onUpdateModelContext:A,onTeardown:M,onRequestDisplayMode:x},e[0]=S,e[1]=C,e[2]=Q,e[3]=Y,e[4]=_,e[5]=x,e[6]=M,e[7]=A,e[8]=n,e[9]=G.language,e[10]=l,e[11]=d,e[12]=u,e[13]=N):N=e[13];const{height:X,isLoading:$,error:O,iframeRef:ee}=Kt(N);if(!o)return null;if(O){let E;e[14]!==a?(E=ie("flex items-center justify-center p-4 text-destructive bg-destructive/10 rounded-lg",a),e[14]=a,e[15]=E):E=e[15];let L;e[16]!==O?(L=w.jsx("span",{className:"text-sm",children:O}),e[16]=O,e[17]=L):L=e[17];let B;return e[18]!==E||e[19]!==L?(B=w.jsx("div",{className:E,children:L}),e[18]=E,e[19]=L,e[20]=B):B=e[20],B}const ke=l?.tool.name;let k;e[21]!==a?(k=ie("relative w-full overflow-hidden rounded-lg",a),e[21]=a,e[22]=k):k=e[22];let P;e[23]!==C||e[24]!==X?(P=C!=="fullscreen"?{height:`${X}px`}:void 0,e[23]=C,e[24]=X,e[25]=P):P=e[25];let q;e[26]!==$?(q=$&&w.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background z-10",children:w.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[w.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),w.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),e[26]=$,e[27]=q):q=e[27];const te=$&&"invisible";let T;e[28]!==te?(T=ie("w-full h-full border-0",te),e[28]=te,e[29]=T):T=e[29];const oe=`MCP App: ${ke??i}`;let I;e[30]!==o||e[31]!==ee||e[32]!==oe||e[33]!==T?(I=w.jsx("iframe",{ref:ee,srcDoc:o,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-downloads",className:T,title:oe}),e[30]=o,e[31]=ee,e[32]=oe,e[33]=T,e[34]=I):I=e[34];let j;return e[35]!==I||e[36]!==k||e[37]!==P||e[38]!==q?(j=w.jsxs("div",{className:k,style:P,children:[q,I]}),e[35]=I,e[36]=k,e[37]=P,e[38]=q,e[39]=j):j=e[39],j}function Jt(r){const e=J.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 d;e[5]!==o||e[6]!==n||e[7]!==l?(d={orgSlug:n,connectionId:o,uri:l,staleTime:3e4},e[5]=o,e[6]=n,e[7]=l,e[8]=d):d=e[8];const u=We(d);let h;return e[9]!==i||e[10]!==u.data||e[11]!==l?(h=w.jsx(Me,{html:u.data,uri:l,...i}),e[9]=i,e[10]=u.data,e[11]=l,e[12]=h):h=e[12],h}function Yt(r){const e=J.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}=Ke(n),d=Zt(l);let u;return e[6]!==o||e[7]!==d||e[8]!==i?(u=w.jsx(Me,{html:d,uri:i,...o}),e[6]=o,e[7]=d,e[8]=i,e[9]=u):u=e[9],u}function oo(r){const e=J.c(4);if(r.orgSlug&&r.connectionId){let i;return e[0]!==r?(i=w.jsx(Jt,{...r,orgSlug:r.orgSlug,connectionId:r.connectionId}),e[0]=r,e[1]=i):i=e[1],i}let o;return e[2]!==r?(o=w.jsx(Yt,{...r}),e[2]=r,e[3]=o):o=e[3],o}const so={view:{minHeight:400,maxHeight:800},fullscreen:{minHeight:600,maxHeight:1200}};function io(r){if(!(r==null||typeof r!="object"))try{return Rt({_meta:r})}catch{return}}var re={exports:{}},p={};var ye;function Qt(){if(ye)return p;ye=1;var r=Symbol.for("react.element"),e=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),d=Symbol.for("react.context"),u=Symbol.for("react.server_context"),h=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),M;M=Symbol.for("react.module.reference");function x(a){if(typeof a=="object"&&a!==null){var C=a.$$typeof;switch(C){case r:switch(a=a.type,a){case o:case n:case i:case y:case m:return a;default:switch(a=a&&a.$$typeof,a){case u:case d:case h:case _:case S:case l:return a;default:return C}}case e:return C}}}return p.ContextConsumer=d,p.ContextProvider=l,p.Element=r,p.ForwardRef=h,p.Fragment=o,p.Lazy=_,p.Memo=S,p.Portal=e,p.Profiler=n,p.StrictMode=i,p.Suspense=y,p.SuspenseList=m,p.isAsyncMode=function(){return!1},p.isConcurrentMode=function(){return!1},p.isContextConsumer=function(a){return x(a)===d},p.isContextProvider=function(a){return x(a)===l},p.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===r},p.isForwardRef=function(a){return x(a)===h},p.isFragment=function(a){return x(a)===o},p.isLazy=function(a){return x(a)===_},p.isMemo=function(a){return x(a)===S},p.isPortal=function(a){return x(a)===e},p.isProfiler=function(a){return x(a)===n},p.isStrictMode=function(a){return x(a)===i},p.isSuspense=function(a){return x(a)===y},p.isSuspenseList=function(a){return x(a)===m},p.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===o||a===n||a===i||a===y||a===m||a===A||typeof a=="object"&&a!==null&&(a.$$typeof===_||a.$$typeof===S||a.$$typeof===l||a.$$typeof===d||a.$$typeof===h||a.$$typeof===M||a.getModuleId!==void 0)},p.typeOf=x,p}var ve;function Gt(){return ve||(ve=1,re.exports=Qt()),re.exports}var Xt=Gt();const ro=Ye(Xt);export{oo as M,ro as R,so as a,io as g,Xt as r};