@xpert-ai/chatkit-ui 0.5.2 → 0.5.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 (338) hide show
  1. package/dist/app/assets/{_baseUniq-DMPA_oa4.js → _baseUniq-DMOCw35x.js} +1 -1
  2. package/dist/app/assets/{abap-Cj2zL0JN.js → abap-Bwac32zp.js} +1 -1
  3. package/dist/app/assets/{abnf-CX4bCmMj.js → abnf-XuDqV3sf.js} +1 -1
  4. package/dist/app/assets/{actionscript-D-EhiET_.js → actionscript-CWEQruXL.js} +1 -1
  5. package/dist/app/assets/{ada-Bqjbr4-K.js → ada-BeyOoTNZ.js} +1 -1
  6. package/dist/app/assets/{agda-DTG3BItC.js → agda-DM2nELzN.js} +1 -1
  7. package/dist/app/assets/{al-quk_zUjL.js → al-BoMzGy9R.js} +1 -1
  8. package/dist/app/assets/{antlr4-C-SKSOZR.js → antlr4-Bjlafc2T.js} +1 -1
  9. package/dist/app/assets/{apacheconf-B4MHVph_.js → apacheconf-CDbPiwWC.js} +1 -1
  10. package/dist/app/assets/{apex-cbqOGViP.js → apex-E4CSbA6l.js} +1 -1
  11. package/dist/app/assets/{apl-BLpOFeja.js → apl-DndAMDM0.js} +1 -1
  12. package/dist/app/assets/{applescript-CK66K0iL.js → applescript-CF_1Snqu.js} +1 -1
  13. package/dist/app/assets/{aql-BeBrwxVC.js → aql-BaOiUvRD.js} +1 -1
  14. package/dist/app/assets/{arc-CcRTWZ_M.js → arc-Clg4el_l.js} +1 -1
  15. package/dist/app/assets/{architectureDiagram-Q4EWVU46-BGOqzZxe.js → architectureDiagram-Q4EWVU46-BQjH7jPS.js} +1 -1
  16. package/dist/app/assets/{arduino-CuMzU4Nc.js → arduino-B_RAK_0k.js} +1 -1
  17. package/dist/app/assets/{arff-D6des0tj.js → arff-ALjJPG-v.js} +1 -1
  18. package/dist/app/assets/{asciidoc-DkUYz8D6.js → asciidoc-C5DKyBG_.js} +1 -1
  19. package/dist/app/assets/{asm6502-CDxIqge4.js → asm6502-B3Mlc96p.js} +1 -1
  20. package/dist/app/assets/{asmatmel-DA5GvT3C.js → asmatmel-C1tzeqyn.js} +1 -1
  21. package/dist/app/assets/{aspnet-DwHgq8BN.js → aspnet-FJjQJZ-l.js} +1 -1
  22. package/dist/app/assets/{autohotkey-m_x4HDjz.js → autohotkey-Ba-oQsKG.js} +1 -1
  23. package/dist/app/assets/{autoit-DD3JIMtp.js → autoit-gdQ0fcTW.js} +1 -1
  24. package/dist/app/assets/{avisynth-BQ6krU9c.js → avisynth-D8feN2CN.js} +1 -1
  25. package/dist/app/assets/{avro-idl-RNMFYlHc.js → avro-idl-BvOZAG1C.js} +1 -1
  26. package/dist/app/assets/{bash-DsSMsygL.js → bash-CWG_jeOA.js} +1 -1
  27. package/dist/app/assets/{basic-CWxIL949.js → basic-B8xqGayQ.js} +1 -1
  28. package/dist/app/assets/{batch-B_YcBqUM.js → batch-DL8dfZHp.js} +1 -1
  29. package/dist/app/assets/{bbcode-m2CB613Z.js → bbcode-BshzRgA_.js} +1 -1
  30. package/dist/app/assets/{bicep-CZoEzXRK.js → bicep-Bfl07x5z.js} +1 -1
  31. package/dist/app/assets/{birb-C45GxEuv.js → birb-hQTWt4gT.js} +1 -1
  32. package/dist/app/assets/{bison-B2Cyv-Jg.js → bison-BZqgUQ29.js} +1 -1
  33. package/dist/app/assets/{blockDiagram-DXYQGD6D-Bw_AvB9J.js → blockDiagram-DXYQGD6D-YShqaJER.js} +1 -1
  34. package/dist/app/assets/{bnf-Bqy7WaG8.js → bnf-DUVse2KP.js} +1 -1
  35. package/dist/app/assets/{brainfuck-CZfj6bhY.js → brainfuck-Bu3NW3aS.js} +1 -1
  36. package/dist/app/assets/{brightscript-CYTjxugS.js → brightscript-C0GeKHI_.js} +1 -1
  37. package/dist/app/assets/{bro-TUn5kzss.js → bro-BLds2A1m.js} +1 -1
  38. package/dist/app/assets/{bsl-DIouJkZU.js → bsl-DmHvdU2a.js} +1 -1
  39. package/dist/app/assets/{c-DgEMJzlq.js → c-BS2cF__m.js} +1 -1
  40. package/dist/app/assets/{c4Diagram-AHTNJAMY-BZ1aSEKn.js → c4Diagram-AHTNJAMY-BXzNi2Xz.js} +1 -1
  41. package/dist/app/assets/{cfscript-CXMqhOEs.js → cfscript-BYSTy-me.js} +1 -1
  42. package/dist/app/assets/{chaiscript-CbswHI99.js → chaiscript-DgP4hQHX.js} +1 -1
  43. package/dist/app/assets/channel-ZWsVuMuK.js +1 -0
  44. package/dist/app/assets/{chunk-4BX2VUAB-C1NxsBOT.js → chunk-4BX2VUAB-DExUwpHa.js} +1 -1
  45. package/dist/app/assets/{chunk-4TB4RGXK-DVMRNBq9.js → chunk-4TB4RGXK-BOkQHv8_.js} +1 -1
  46. package/dist/app/assets/{chunk-55IACEB6-Cc2HT1dN.js → chunk-55IACEB6-CLQ6xN1-.js} +1 -1
  47. package/dist/app/assets/{chunk-EDXVE4YY-CE4IFknJ.js → chunk-EDXVE4YY-BeUFxqxB.js} +1 -1
  48. package/dist/app/assets/{chunk-FMBD7UC4-Dpwq2Fyq.js → chunk-FMBD7UC4-DQbOG9LT.js} +1 -1
  49. package/dist/app/assets/{chunk-OYMX7WX6-B5HRrsAE.js → chunk-OYMX7WX6-BOWS5K_U.js} +1 -1
  50. package/dist/app/assets/{chunk-QZHKN3VN-DW4jQzcx.js → chunk-QZHKN3VN-B7BYmIon.js} +1 -1
  51. package/dist/app/assets/{chunk-YZCP3GAM-DibQdouJ.js → chunk-YZCP3GAM-DsHse404.js} +1 -1
  52. package/dist/app/assets/{cil-BoU9SAC0.js → cil-w2QHvA4j.js} +1 -1
  53. package/dist/app/assets/classDiagram-6PBFFD2Q-lDdKGvxc.js +1 -0
  54. package/dist/app/assets/classDiagram-v2-HSJHXN6E-lDdKGvxc.js +1 -0
  55. package/dist/app/assets/{clike-_aTdr-fb.js → clike-Br9rvy8L.js} +1 -1
  56. package/dist/app/assets/{clojure-C9TT8oBQ.js → clojure-8ZXdIPPq.js} +1 -1
  57. package/dist/app/assets/clone-CS3cnCuu.js +1 -0
  58. package/dist/app/assets/{cmake-Dy5-b1yK.js → cmake-CvEaJy7h.js} +1 -1
  59. package/dist/app/assets/{cobol-NUAmiaV7.js → cobol-M72fZmMC.js} +1 -1
  60. package/dist/app/assets/{coffeescript-CNW8xSj3.js → coffeescript-C5xJdhaj.js} +1 -1
  61. package/dist/app/assets/{concurnas-zmOlqEBl.js → concurnas-CdlNXgIt.js} +1 -1
  62. package/dist/app/assets/{coq-BjQlvNZL.js → coq-BYQTyuV-.js} +1 -1
  63. package/dist/app/assets/{core-CjEsXh7s.js → core-DnOolKys.js} +1 -1
  64. package/dist/app/assets/{cose-bilkent-S5V4N54A-DTpBdRjm.js → cose-bilkent-S5V4N54A-sFy0HB_g.js} +1 -1
  65. package/dist/app/assets/{cpp-DlbtfO9_.js → cpp-CZphUwmQ.js} +1 -1
  66. package/dist/app/assets/{crystal-D_FpS8EO.js → crystal-CUe5clIL.js} +1 -1
  67. package/dist/app/assets/{csharp-CcBkcqul.js → csharp-BJgKnlvC.js} +1 -1
  68. package/dist/app/assets/{cshtml-Co8xpPOu.js → cshtml-C9vsKRks.js} +1 -1
  69. package/dist/app/assets/{csp-I3DvvTD_.js → csp-DIXOXJub.js} +1 -1
  70. package/dist/app/assets/{css-extras-DK8RR_-K.js → css-extras-DjOIy_vc.js} +1 -1
  71. package/dist/app/assets/{css-B96lK0h5.js → css-mB1wvHfo.js} +1 -1
  72. package/dist/app/assets/{csv-COrR5Oay.js → csv-DXsT9LhL.js} +1 -1
  73. package/dist/app/assets/{cypher-BT7uRwlq.js → cypher-YE9UQm-0.js} +1 -1
  74. package/dist/app/assets/{d-BgMcdgIJ.js → d-BnVGSkU6.js} +1 -1
  75. package/dist/app/assets/{dagre-KV5264BT-BzAdnA6d.js → dagre-KV5264BT-Qs4OIWYq.js} +1 -1
  76. package/dist/app/assets/{dart-yK6F88CW.js → dart-DBwvOqyJ.js} +1 -1
  77. package/dist/app/assets/{dataweave-Dm-qpzhK.js → dataweave-DDd-NH0e.js} +1 -1
  78. package/dist/app/assets/{dax-Cj2gxnM-.js → dax-BWU_B3kH.js} +1 -1
  79. package/dist/app/assets/{dhall-nQjelIAq.js → dhall-BBvMj82b.js} +1 -1
  80. package/dist/app/assets/{diagram-5BDNPKRD-CvZU2QL3.js → diagram-5BDNPKRD-RXruFkHY.js} +1 -1
  81. package/dist/app/assets/{diagram-G4DWMVQ6-CQ5Hcvj3.js → diagram-G4DWMVQ6-Bzx7lA4J.js} +1 -1
  82. package/dist/app/assets/{diagram-MMDJMWI5-yACl-dt-.js → diagram-MMDJMWI5-B8rWkSor.js} +1 -1
  83. package/dist/app/assets/{diagram-TYMM5635-BUu215MN.js → diagram-TYMM5635-EZPdbp6x.js} +1 -1
  84. package/dist/app/assets/{diff-D4n6eVkt.js → diff-jE6nXQ7L.js} +1 -1
  85. package/dist/app/assets/{django-B9MiHxlG.js → django-Brhbv2JO.js} +1 -1
  86. package/dist/app/assets/{dns-zone-file-VD8eyEBf.js → dns-zone-file-Ce5cMsLg.js} +1 -1
  87. package/dist/app/assets/{docker-Dd8HMn45.js → docker-Bfq4doN7.js} +1 -1
  88. package/dist/app/assets/{dot-nHpGp3MO.js → dot-DMWN4mEC.js} +1 -1
  89. package/dist/app/assets/{ebnf-ZDntitCJ.js → ebnf-DYXRLHUG.js} +1 -1
  90. package/dist/app/assets/{editorconfig-D_mDhoqj.js → editorconfig-CbJknMcb.js} +1 -1
  91. package/dist/app/assets/{eiffel-BBAjnLtv.js → eiffel-B4EZvlGs.js} +1 -1
  92. package/dist/app/assets/{ejs-D41FeLkK.js → ejs-BEU-qjf7.js} +1 -1
  93. package/dist/app/assets/{elixir-CJpjQBGg.js → elixir-B_a2ycY4.js} +1 -1
  94. package/dist/app/assets/{elm-C8xeCxT5.js → elm-leMW8E0P.js} +1 -1
  95. package/dist/app/assets/{erDiagram-SMLLAGMA-B_XYwb20.js → erDiagram-SMLLAGMA-LzJyKDT4.js} +1 -1
  96. package/dist/app/assets/{erb-CDlRljTJ.js → erb-D3vrulF7.js} +1 -1
  97. package/dist/app/assets/{erlang-DAsGKBqs.js → erlang-RNH0tzGN.js} +1 -1
  98. package/dist/app/assets/{etlua-080SN-ad.js → etlua-BFVTp3-T.js} +1 -1
  99. package/dist/app/assets/{excel-formula-C1ourZkH.js → excel-formula-DlSyXE4L.js} +1 -1
  100. package/dist/app/assets/{factor-3iu3Iq_3.js → factor-uwksoWD7.js} +1 -1
  101. package/dist/app/assets/{false-BssRf9La.js → false-BpdJd_Yz.js} +1 -1
  102. package/dist/app/assets/{firestore-security-rules-CBt6qjzb.js → firestore-security-rules-C5uPMG3k.js} +1 -1
  103. package/dist/app/assets/{flow-B6-gkILu.js → flow-BL5s74Nr.js} +1 -1
  104. package/dist/app/assets/{flowDiagram-DWJPFMVM-BW8OeHws.js → flowDiagram-DWJPFMVM-D0X8qkzm.js} +1 -1
  105. package/dist/app/assets/{fortran--gLPNveO.js → fortran-B9uAh6kv.js} +1 -1
  106. package/dist/app/assets/{fsharp-Ccsw25Pl.js → fsharp-CFUi3hZF.js} +1 -1
  107. package/dist/app/assets/{ftl-BAbnPQW4.js → ftl-BmFITVHz.js} +1 -1
  108. package/dist/app/assets/{ganttDiagram-T4ZO3ILL-Cjx_nnPG.js → ganttDiagram-T4ZO3ILL-BumD1IN7.js} +1 -1
  109. package/dist/app/assets/{gap-Ccu9ovLm.js → gap-eoD5aEtL.js} +1 -1
  110. package/dist/app/assets/{gcode-Cy1a8PDW.js → gcode-Ct0C6tkJ.js} +1 -1
  111. package/dist/app/assets/{gdscript-y4aaFG00.js → gdscript-IAeaSiET.js} +1 -1
  112. package/dist/app/assets/{gedcom-BuHJMovk.js → gedcom-Cp6ETPlx.js} +1 -1
  113. package/dist/app/assets/{gherkin-DI_FlrZP.js → gherkin-gQBC5_Tm.js} +1 -1
  114. package/dist/app/assets/{git-CdMKKQEU.js → git-BUb2Ef5G.js} +1 -1
  115. package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-CdHhQZSB.js → gitGraphDiagram-UUTBAWPF-CwIjnG1f.js} +1 -1
  116. package/dist/app/assets/{glsl-4F4N5Sux.js → glsl-ha500tad.js} +1 -1
  117. package/dist/app/assets/{gml-D81YX-Rx.js → gml-D9UKe8HS.js} +1 -1
  118. package/dist/app/assets/{gn-DnsgJxRB.js → gn-BSitOcQd.js} +1 -1
  119. package/dist/app/assets/{go-CfGHIbHP.js → go-DMF0ihJu.js} +1 -1
  120. package/dist/app/assets/{go-module-v1qReyj4.js → go-module-DMB1tWdY.js} +1 -1
  121. package/dist/app/assets/{graph-BXB1kC50.js → graph-DLHVWCQv.js} +1 -1
  122. package/dist/app/assets/{graphql-B3jwaFVl.js → graphql-CEPu_6ph.js} +1 -1
  123. package/dist/app/assets/{groovy-CqJsjrfP.js → groovy-eBWL80CL.js} +1 -1
  124. package/dist/app/assets/{haml-CnEGtX4u.js → haml-BCDJxgmu.js} +1 -1
  125. package/dist/app/assets/{handlebars-BMvQ3BzY.js → handlebars-CapCjGml.js} +1 -1
  126. package/dist/app/assets/{haskell-Cf0RBiXF.js → haskell-HSDXTiY3.js} +1 -1
  127. package/dist/app/assets/{haxe-CUFzN8sZ.js → haxe-CYhicWLF.js} +1 -1
  128. package/dist/app/assets/{hcl-BAnkSgip.js → hcl-DaEJ63gk.js} +1 -1
  129. package/dist/app/assets/{hlsl-DCwNlMrb.js → hlsl-R7suMNE4.js} +1 -1
  130. package/dist/app/assets/{hoon-C15vAmJ-.js → hoon-Bv-chbF9.js} +1 -1
  131. package/dist/app/assets/{hpkp-C3kAfIYl.js → hpkp-C4ADGtou.js} +1 -1
  132. package/dist/app/assets/{hsts-Bhenzx1_.js → hsts-CB5oK3VS.js} +1 -1
  133. package/dist/app/assets/{http-DPLUui5c.js → http-C1PyXYUv.js} +1 -1
  134. package/dist/app/assets/{ichigojam-CjxT7NsH.js → ichigojam-CE_ZgXG6.js} +1 -1
  135. package/dist/app/assets/{icon-Cbzclc37.js → icon-uu24hWNu.js} +1 -1
  136. package/dist/app/assets/{icu-message-format-39S6o6G6.js → icu-message-format-Cp77XkuC.js} +1 -1
  137. package/dist/app/assets/{idris-CzUqPzGL.js → idris-Wy9aFZCq.js} +1 -1
  138. package/dist/app/assets/{iecst-D75uKMw6.js → iecst-BaML-dA3.js} +1 -1
  139. package/dist/app/assets/{ignore-DD-Nam9y.js → ignore-DZVOppkK.js} +1 -1
  140. package/dist/app/assets/index-LG2WR4hb.css +1 -0
  141. package/dist/app/assets/index-_eY4MICm.js +785 -0
  142. package/dist/app/assets/{infoDiagram-42DDH7IO-B8Rc8Ml2.js → infoDiagram-42DDH7IO-CKVpsNj5.js} +1 -1
  143. package/dist/app/assets/{inform7-DnYdJ-VQ.js → inform7-B3imwI6a.js} +1 -1
  144. package/dist/app/assets/{ini-CvifbSz9.js → ini-Dr_5Tj7S.js} +1 -1
  145. package/dist/app/assets/{io-DVWzqa0n.js → io-Dd7l3Ejv.js} +1 -1
  146. package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-D5_HvTRV.js → ishikawaDiagram-UXIWVN3A-CtXPpTJL.js} +1 -1
  147. package/dist/app/assets/{j-BY7qyUJ5.js → j-Bl30FFSs.js} +1 -1
  148. package/dist/app/assets/{java-ChK2qUMm.js → java-p9valxE9.js} +1 -1
  149. package/dist/app/assets/{javadoc-CX4rgTSj.js → javadoc-BdL9LnX5.js} +1 -1
  150. package/dist/app/assets/{javadoclike-IU9Y8dsz.js → javadoclike-CySMyw18.js} +1 -1
  151. package/dist/app/assets/{javascript-mp-N-liG.js → javascript-C48aNs7d.js} +1 -1
  152. package/dist/app/assets/{javastacktrace-CijsCdli.js → javastacktrace-6b_tZrg9.js} +1 -1
  153. package/dist/app/assets/{jexl-CdTS_LMa.js → jexl-B3GBQzoE.js} +1 -1
  154. package/dist/app/assets/{jolie-CSLVrie0.js → jolie-Btit-ayQ.js} +1 -1
  155. package/dist/app/assets/{journeyDiagram-VCZTEJTY-T4W9I372.js → journeyDiagram-VCZTEJTY-DMKzhP-U.js} +1 -1
  156. package/dist/app/assets/{jq-BCAti0ZE.js → jq-n-PpCC5g.js} +1 -1
  157. package/dist/app/assets/{js-extras-C0llDM_8.js → js-extras-B4ul5r_s.js} +1 -1
  158. package/dist/app/assets/{js-templates-BBzwC4yV.js → js-templates-C6x6N4O8.js} +1 -1
  159. package/dist/app/assets/{jsdoc-B5c682J0.js → jsdoc-RY0uysf7.js} +1 -1
  160. package/dist/app/assets/{json-B6fifvmp.js → json-CoYnVzf7.js} +1 -1
  161. package/dist/app/assets/{json5-lhM974rx.js → json5-wfhl3hVZ.js} +1 -1
  162. package/dist/app/assets/{jsonp-Df-i1Psr.js → jsonp-D7odwsds.js} +1 -1
  163. package/dist/app/assets/{jsstacktrace-CGlls4Vc.js → jsstacktrace-CIqOyedq.js} +1 -1
  164. package/dist/app/assets/{jsx-CyoPYOBK.js → jsx-CA2INXPZ.js} +1 -1
  165. package/dist/app/assets/{julia-3ryHaHXf.js → julia-DRAXTapb.js} +1 -1
  166. package/dist/app/assets/{kanban-definition-6JOO6SKY-Dg098cTB.js → kanban-definition-6JOO6SKY-CSlAUcL1.js} +1 -1
  167. package/dist/app/assets/{keepalived-D_ad2ZoL.js → keepalived-dklp9jjH.js} +1 -1
  168. package/dist/app/assets/{keyman-BcEhx9gP.js → keyman-meTz7YQ0.js} +1 -1
  169. package/dist/app/assets/{kotlin-Da5vJL1Z.js → kotlin-lzQH4oZA.js} +1 -1
  170. package/dist/app/assets/{kumir-CjOTreP0.js → kumir-BVPwdvkd.js} +1 -1
  171. package/dist/app/assets/{kusto-DapEHOsI.js → kusto-CCesvOw9.js} +1 -1
  172. package/dist/app/assets/{latex-2otmSFTQ.js → latex-C0A08YOT.js} +1 -1
  173. package/dist/app/assets/{latte-CHcNDgGe.js → latte-DRyPL0o_.js} +1 -1
  174. package/dist/app/assets/{layout-DdWXXHsC.js → layout-Ft7nrLFj.js} +1 -1
  175. package/dist/app/assets/{less-1cuPUrve.js → less-0YGaK1Ny.js} +1 -1
  176. package/dist/app/assets/{lilypond-C01MfJr5.js → lilypond-xc0GRZDM.js} +1 -1
  177. package/dist/app/assets/{linear-Cue29L8J.js → linear-C0AD7ApO.js} +1 -1
  178. package/dist/app/assets/{liquid-T3d-Jjz8.js → liquid-CAIlXM7k.js} +1 -1
  179. package/dist/app/assets/{lisp-DlC_64cM.js → lisp-CWIf4a4E.js} +1 -1
  180. package/dist/app/assets/{livescript-X_Nv563A.js → livescript-W1wch9_n.js} +1 -1
  181. package/dist/app/assets/{llvm-BlMM3E2w.js → llvm-D35zJvME.js} +1 -1
  182. package/dist/app/assets/{log-cRhyBxgW.js → log-B35gSywI.js} +1 -1
  183. package/dist/app/assets/{lolcode-B710kwlH.js → lolcode-CXJWr_kr.js} +1 -1
  184. package/dist/app/assets/{lua-NNXJ23Pq.js → lua-DZP9Jv1z.js} +1 -1
  185. package/dist/app/assets/{magma-q5JeQg-k.js → magma-DqAgLAeM.js} +1 -1
  186. package/dist/app/assets/{makefile-PAGfpPD0.js → makefile-D33QCWzY.js} +1 -1
  187. package/dist/app/assets/{markdown-B8N4gsSe.js → markdown-hEkMDik6.js} +1 -1
  188. package/dist/app/assets/{markup-DhDTZYHM.js → markup-B_53o2jo.js} +1 -1
  189. package/dist/app/assets/{markup-templating-DDsqqM79.js → markup-templating-D1WOoUgZ.js} +1 -1
  190. package/dist/app/assets/{matlab-BXuUDvsA.js → matlab-Dqmrg6Ws.js} +1 -1
  191. package/dist/app/assets/{maxscript-Ck9qDjH2.js → maxscript-CimjIQuJ.js} +1 -1
  192. package/dist/app/assets/{mel-7zzDDxVd.js → mel-ofsHC9z3.js} +1 -1
  193. package/dist/app/assets/{mermaid-iLA8KbdM.js → mermaid-XfHMFgmD.js} +1 -1
  194. package/dist/app/assets/{min-CNdWWplt.js → min-BYbIgXZp.js} +1 -1
  195. package/dist/app/assets/{mindmap-definition-QFDTVHPH-0OnT-ARj.js → mindmap-definition-QFDTVHPH-a6Q2rDfi.js} +1 -1
  196. package/dist/app/assets/{mizar-BHRRxVF_.js → mizar-BNQ6o-Bx.js} +1 -1
  197. package/dist/app/assets/{mongodb-LWsLd7ke.js → mongodb-lpxH5Xg9.js} +1 -1
  198. package/dist/app/assets/{monkey-BuQXg-U8.js → monkey-Bba_gZQn.js} +1 -1
  199. package/dist/app/assets/{moonscript-BE_r-EfQ.js → moonscript-DWR-S8NH.js} +1 -1
  200. package/dist/app/assets/{n1ql-DmSGOs0a.js → n1ql-ChFtbfC1.js} +1 -1
  201. package/dist/app/assets/{n4js-CJ1VQre2.js → n4js-ubMYO9Op.js} +1 -1
  202. package/dist/app/assets/{nand2tetris-hdl-BRqm3JJX.js → nand2tetris-hdl-BMx7J0Cm.js} +1 -1
  203. package/dist/app/assets/{naniscript-B54PZYOr.js → naniscript-B94tammc.js} +1 -1
  204. package/dist/app/assets/{nasm-Bw7pDJBj.js → nasm-Bw4v9N74.js} +1 -1
  205. package/dist/app/assets/{neon-Btmhw7Ub.js → neon-BPjulnW3.js} +1 -1
  206. package/dist/app/assets/{nevod-DhI0_sqm.js → nevod-BLFD8Hth.js} +1 -1
  207. package/dist/app/assets/{nginx-DW1MSbQn.js → nginx-NgR-A9p9.js} +1 -1
  208. package/dist/app/assets/{nim-CXfKNptR.js → nim-2UMsJk0h.js} +1 -1
  209. package/dist/app/assets/{nix-BI9LrRLV.js → nix-DzhMPUNa.js} +1 -1
  210. package/dist/app/assets/{nsis-C45AtXuI.js → nsis-D5JKfUzv.js} +1 -1
  211. package/dist/app/assets/{objectivec-DoO786la.js → objectivec-BFcK3aFm.js} +1 -1
  212. package/dist/app/assets/{ocaml-DrOZ6uhT.js → ocaml-cs-S8ytT.js} +1 -1
  213. package/dist/app/assets/{opencl-f3QHGMdv.js → opencl-BR0vmM-J.js} +1 -1
  214. package/dist/app/assets/{openqasm-DnrYX2xV.js → openqasm-DjYO7UoV.js} +1 -1
  215. package/dist/app/assets/{oz-Cve8q8bA.js → oz-vHrTzEJX.js} +1 -1
  216. package/dist/app/assets/{parigp-Lh1bwfe1.js → parigp-Br7qKWCs.js} +1 -1
  217. package/dist/app/assets/{parser-BuuUTn0B.js → parser-DhDTWFrT.js} +1 -1
  218. package/dist/app/assets/{pascal-B44YxN9A.js → pascal-kENE5zmU.js} +1 -1
  219. package/dist/app/assets/{pascaligo-scYe-UN-.js → pascaligo-BAPxnaBd.js} +1 -1
  220. package/dist/app/assets/{pcaxis-D-IBiT9E.js → pcaxis-BA1b4CIO.js} +1 -1
  221. package/dist/app/assets/{peoplecode-D3sw6W4w.js → peoplecode-p7XS_-Wa.js} +1 -1
  222. package/dist/app/assets/{perl-CAWraJC1.js → perl-D5mJsCLY.js} +1 -1
  223. package/dist/app/assets/{php-CDW877Rv.js → php-DUBpHLia.js} +1 -1
  224. package/dist/app/assets/{php-extras-Ex6l_6iC.js → php-extras-BWnVpw6t.js} +1 -1
  225. package/dist/app/assets/{phpdoc-BjNC6X9h.js → phpdoc-DM85q7ja.js} +1 -1
  226. package/dist/app/assets/{pieDiagram-DEJITSTG-BtzVkX77.js → pieDiagram-DEJITSTG-Dg7k6vMC.js} +1 -1
  227. package/dist/app/assets/{plsql-CQQK_Pez.js → plsql-CcON0sDP.js} +1 -1
  228. package/dist/app/assets/{powerquery-CJuVpd-P.js → powerquery-w3urf2s7.js} +1 -1
  229. package/dist/app/assets/{powershell-Cc1fiasK.js → powershell-RBZ_T_y0.js} +1 -1
  230. package/dist/app/assets/{processing-CDodPUaF.js → processing-CE_dP2y5.js} +1 -1
  231. package/dist/app/assets/{prolog-Ji8Z1wBQ.js → prolog-CCjdx3vK.js} +1 -1
  232. package/dist/app/assets/{promql-B504eXKs.js → promql-DF2l993Q.js} +1 -1
  233. package/dist/app/assets/{properties-4pit0xKE.js → properties-Dz9yMKdu.js} +1 -1
  234. package/dist/app/assets/{protobuf-D65fgnCD.js → protobuf-DpCG-FTC.js} +1 -1
  235. package/dist/app/assets/{psl-BKfdnwL1.js → psl-DiIv5-zc.js} +1 -1
  236. package/dist/app/assets/{pug-44XVrvbS.js → pug-CBSV-T7k.js} +1 -1
  237. package/dist/app/assets/{puppet-CQ6pr95X.js → puppet-CoJZxRyQ.js} +1 -1
  238. package/dist/app/assets/{pure-B4d8unMA.js → pure-DDJg8__Y.js} +1 -1
  239. package/dist/app/assets/{purebasic-DIykjgce.js → purebasic-Do52PcJ6.js} +1 -1
  240. package/dist/app/assets/{purescript-b6UyO-Xd.js → purescript-CseI23J6.js} +1 -1
  241. package/dist/app/assets/{q-Dnh5m5NP.js → q-CQ0Fi_W7.js} +1 -1
  242. package/dist/app/assets/{qml-DT98Gva2.js → qml-tusJIup1.js} +1 -1
  243. package/dist/app/assets/{qore-DCDmqmqp.js → qore-BtvvaJR_.js} +1 -1
  244. package/dist/app/assets/{qsharp-DlVIr-Lk.js → qsharp-BfVEvXBF.js} +1 -1
  245. package/dist/app/assets/{quadrantDiagram-34T5L4WZ-CPX0aeas.js → quadrantDiagram-34T5L4WZ-eEHJOsLr.js} +1 -1
  246. package/dist/app/assets/{r-C0SqQ1if.js → r-CFBNVcXJ.js} +1 -1
  247. package/dist/app/assets/{racket-D6Rv9Y58.js → racket-CvgNN1WQ.js} +1 -1
  248. package/dist/app/assets/{reason-DOnbeD4h.js → reason-CUswFuTE.js} +1 -1
  249. package/dist/app/assets/{regex-BCE-dtFq.js → regex-DnbwmfQN.js} +1 -1
  250. package/dist/app/assets/{rego-CrqPRQqA.js → rego-DpVCunB6.js} +1 -1
  251. package/dist/app/assets/{renpy-DIdQy3U0.js → renpy-B0lK40hX.js} +1 -1
  252. package/dist/app/assets/{requirementDiagram-MS252O5E-DFqVROz9.js → requirementDiagram-MS252O5E-CoedzQM0.js} +1 -1
  253. package/dist/app/assets/{rest-lUPl_Dmb.js → rest-tHxDA5UT.js} +1 -1
  254. package/dist/app/assets/{rip-DpzQKsBT.js → rip-DHl6JkL5.js} +1 -1
  255. package/dist/app/assets/{roboconf-_7841m8Q.js → roboconf-BUo2Guju.js} +1 -1
  256. package/dist/app/assets/{robotframework-Byk4ohWk.js → robotframework-k6_Fb56G.js} +1 -1
  257. package/dist/app/assets/{ruby-BqQe_4Re.js → ruby-CLb5Fz0R.js} +1 -1
  258. package/dist/app/assets/{rust-By7W81wI.js → rust-BXLrPbwf.js} +1 -1
  259. package/dist/app/assets/{sankeyDiagram-XADWPNL6-C153VKrH.js → sankeyDiagram-XADWPNL6-CqaF9kZ3.js} +1 -1
  260. package/dist/app/assets/{sas-CCW8wZ8Y.js → sas-Bpgnp1ig.js} +1 -1
  261. package/dist/app/assets/{sass-Che-FE1n.js → sass-Cgz-UsH3.js} +1 -1
  262. package/dist/app/assets/{scala-Bzj7EBGD.js → scala-Dmm3REVa.js} +1 -1
  263. package/dist/app/assets/{scheme-CXNP4zbg.js → scheme-CQmKio0N.js} +1 -1
  264. package/dist/app/assets/{scss-BifR9Paq.js → scss-BLP0nDvE.js} +1 -1
  265. package/dist/app/assets/{sequenceDiagram-FGHM5R23-CwrMkWeC.js → sequenceDiagram-FGHM5R23-B5MJ9gfZ.js} +1 -1
  266. package/dist/app/assets/{shell-session-BIeaOWoA.js → shell-session-BWkQN5bW.js} +1 -1
  267. package/dist/app/assets/{smali-BhhFxYnC.js → smali-DP-sUoIm.js} +1 -1
  268. package/dist/app/assets/{smalltalk-CqeF5SEc.js → smalltalk-j0aPXd7c.js} +1 -1
  269. package/dist/app/assets/{smarty-DODx5tBJ.js → smarty-DP8LPkcc.js} +1 -1
  270. package/dist/app/assets/{sml-CMLl-jfZ.js → sml-Cu-zdNr3.js} +1 -1
  271. package/dist/app/assets/{solidity-DfihEf5n.js → solidity-Xjl7eHDy.js} +1 -1
  272. package/dist/app/assets/{solution-file-C-G5iX9Q.js → solution-file-BNt1IPOz.js} +1 -1
  273. package/dist/app/assets/{soy-BjYcrOfB.js → soy-DyX2-Hmb.js} +1 -1
  274. package/dist/app/assets/{sparql-Bo9ifGdT.js → sparql-7i1KmBR3.js} +1 -1
  275. package/dist/app/assets/{splunk-spl-C1rMe6Nu.js → splunk-spl-CO-w6uHT.js} +1 -1
  276. package/dist/app/assets/{sqf-DTlxXox6.js → sqf-fZNyI68i.js} +1 -1
  277. package/dist/app/assets/{sql-Bw_EHPvn.js → sql-CLyoIc_c.js} +1 -1
  278. package/dist/app/assets/{squirrel-DW457Ax9.js → squirrel-DrAMhT71.js} +1 -1
  279. package/dist/app/assets/{stan-B7n50noR.js → stan-BypwYcFh.js} +1 -1
  280. package/dist/app/assets/{stateDiagram-FHFEXIEX-CEQf98RN.js → stateDiagram-FHFEXIEX-oJFgiWhq.js} +1 -1
  281. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-Dyl4RScY.js +1 -0
  282. package/dist/app/assets/{stylus-Dv2Gpd2n.js → stylus-BidBaX29.js} +1 -1
  283. package/dist/app/assets/{swift-BAIbo1ZL.js → swift-Bn0pagVh.js} +1 -1
  284. package/dist/app/assets/{systemd-CM8gGPdt.js → systemd-CZ1o-JQg.js} +1 -1
  285. package/dist/app/assets/{t4-cs-DJQvnuVA.js → t4-cs-Bkh2kv5Q.js} +1 -1
  286. package/dist/app/assets/{t4-templating---KLNzA1.js → t4-templating-8Qw7j-Xz.js} +1 -1
  287. package/dist/app/assets/{t4-vb-Cseiaqvq.js → t4-vb-C60BV6kL.js} +1 -1
  288. package/dist/app/assets/{tap-BI8A4lyv.js → tap-D822RxOA.js} +1 -1
  289. package/dist/app/assets/{tcl-D0Ygia4-.js → tcl-C2D2mZvS.js} +1 -1
  290. package/dist/app/assets/{textile-Ckovp5lE.js → textile-CI5t3Qqr.js} +1 -1
  291. package/dist/app/assets/{timeline-definition-GMOUNBTQ-QGPqOu2_.js → timeline-definition-GMOUNBTQ-SDBaeRi8.js} +1 -1
  292. package/dist/app/assets/{toml-ic0y606Q.js → toml-B_Eg4X8A.js} +1 -1
  293. package/dist/app/assets/{tremor-DjtMl9Xw.js → tremor-CHIIVOuv.js} +1 -1
  294. package/dist/app/assets/{tt2-DIAkCzMt.js → tt2-BYHSEepO.js} +1 -1
  295. package/dist/app/assets/{turtle-CRztIQUt.js → turtle-Dt6tpQUG.js} +1 -1
  296. package/dist/app/assets/{twig-DMU8J6pK.js → twig-_HFRCYxa.js} +1 -1
  297. package/dist/app/assets/{typescript-Iz5CtnCc.js → typescript-BnPtnkdK.js} +1 -1
  298. package/dist/app/assets/{typoscript-zTZzZE8x.js → typoscript-C7j6S0bP.js} +1 -1
  299. package/dist/app/assets/{unrealscript-CODlSqBt.js → unrealscript-CZlqMla5.js} +1 -1
  300. package/dist/app/assets/{uorazor-TLqdcdSp.js → uorazor-Csue52-p.js} +1 -1
  301. package/dist/app/assets/{uri-X04B-1Ku.js → uri-BiN1ta3O.js} +1 -1
  302. package/dist/app/assets/{v-uEza4RBu.js → v-BtfXUB0f.js} +1 -1
  303. package/dist/app/assets/{vala-D9bku9j-.js → vala-CE2F_wJv.js} +1 -1
  304. package/dist/app/assets/{vbnet-DW8U376e.js → vbnet-BU5QIJlD.js} +1 -1
  305. package/dist/app/assets/{velocity-Chey_Yus.js → velocity-CmWxHoQq.js} +1 -1
  306. package/dist/app/assets/{vennDiagram-DHZGUBPP-aPpSiaPL.js → vennDiagram-DHZGUBPP-C9fT-XZa.js} +1 -1
  307. package/dist/app/assets/{verilog-BQ8HwcNa.js → verilog-ls1aPPY9.js} +1 -1
  308. package/dist/app/assets/{vhdl-BrZZFPeO.js → vhdl-Bu0bjyCA.js} +1 -1
  309. package/dist/app/assets/{vim-CIqO-Os5.js → vim-BJl0TEm7.js} +1 -1
  310. package/dist/app/assets/{visual-basic-Dt7-DW2C.js → visual-basic-BrKILmGh.js} +1 -1
  311. package/dist/app/assets/{wardley-RL74JXVD-BIubZMCY.js → wardley-RL74JXVD-DvBkFeP9.js} +1 -1
  312. package/dist/app/assets/{wardleyDiagram-NUSXRM2D-DYAY6Rx4.js → wardleyDiagram-NUSXRM2D-Bv8biw-m.js} +1 -1
  313. package/dist/app/assets/{warpscript-BaRoeM5L.js → warpscript-L4xE7joB.js} +1 -1
  314. package/dist/app/assets/{wasm-czQaol6D.js → wasm-sBd3DoVe.js} +1 -1
  315. package/dist/app/assets/{web-idl-Bsa21vQT.js → web-idl-N21KHGKr.js} +1 -1
  316. package/dist/app/assets/{wiki-LSYNKBVL.js → wiki-Cch7G73V.js} +1 -1
  317. package/dist/app/assets/{wolfram-C5If9Dhv.js → wolfram-TjVuyqlD.js} +1 -1
  318. package/dist/app/assets/{wren-DDo7JOZT.js → wren-DTY3PAiS.js} +1 -1
  319. package/dist/app/assets/{xeora-Ktg8q8zo.js → xeora-C4v3g3wC.js} +1 -1
  320. package/dist/app/assets/{xml-doc-DBE-2UUP.js → xml-doc-auzoR3BG.js} +1 -1
  321. package/dist/app/assets/{xojo-DWfIpwtt.js → xojo-DybgyESv.js} +1 -1
  322. package/dist/app/assets/{xquery-CFJU3zRn.js → xquery-UwgeP1gv.js} +1 -1
  323. package/dist/app/assets/{xychartDiagram-5P7HB3ND-BJY2wkwC.js → xychartDiagram-5P7HB3ND-Cv9o5KMB.js} +1 -1
  324. package/dist/app/assets/{yaml-DJmmt8p-.js → yaml-BU5qIDxs.js} +1 -1
  325. package/dist/app/assets/{yang-Bf5HN1Sx.js → yang-vmPGVjAI.js} +1 -1
  326. package/dist/app/assets/{zig-Sgl0VF72.js → zig-Cxu7_0qW.js} +1 -1
  327. package/dist/app/index.html +2 -2
  328. package/dist/app/mcp-app-sandbox-proxy.html +114 -0
  329. package/dist/index.cjs +1252 -217
  330. package/dist/index.js +1276 -234
  331. package/package.json +4 -4
  332. package/dist/app/assets/channel-C9F_V90G.js +0 -1
  333. package/dist/app/assets/classDiagram-6PBFFD2Q-Cf8DAzB0.js +0 -1
  334. package/dist/app/assets/classDiagram-v2-HSJHXN6E-Cf8DAzB0.js +0 -1
  335. package/dist/app/assets/clone-1urtxbkU.js +0 -1
  336. package/dist/app/assets/index-ByEJy9Db.css +0 -1
  337. package/dist/app/assets/index-C4MhPDCR.js +0 -783
  338. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-DN7a7q3Y.js +0 -1
package/dist/index.js CHANGED
@@ -2344,6 +2344,14 @@ var en_US_default = {
2344
2344
  },
2345
2345
  hitl: {
2346
2346
  title: "Action review",
2347
+ mcpElicitationTitle: "MCP Elicitation",
2348
+ fieldProgress: "Field {{current}}/{{total}}",
2349
+ requiredUnanswered: "1 required unanswered",
2350
+ requiredAnswered: "All required fields answered",
2351
+ true: "True",
2352
+ false: "False",
2353
+ cancel: "Cancel",
2354
+ elicitationSubmit: "Submit",
2347
2355
  actionProgress: "{{current}} of {{total}}",
2348
2356
  previousAction: "Previous action",
2349
2357
  nextAction: "Next action",
@@ -2479,7 +2487,16 @@ var en_US_default = {
2479
2487
  moreTags: "+{{count}}"
2480
2488
  },
2481
2489
  mcpApp: {
2482
- loading: "Loading MCP App"
2490
+ loading: "Loading MCP App",
2491
+ fullscreen: "Open fullscreen",
2492
+ pictureInPicture: "Open picture in picture",
2493
+ returnInline: "Return inline",
2494
+ approvalTitle: "Confirm MCP App action",
2495
+ toolApprovalDescription: 'The app wants to run "{{tool}}". Review the request before allowing it.',
2496
+ downloadApprovalDescription: "The app wants to download files to this device. Review the file details before allowing it.",
2497
+ requestDetails: "Request details",
2498
+ approve: "Allow",
2499
+ reject: "Reject"
2483
2500
  },
2484
2501
  contextCompression: {
2485
2502
  running: "Automatically compressing context",
@@ -2827,6 +2844,14 @@ var zh_CN_default = {
2827
2844
  },
2828
2845
  hitl: {
2829
2846
  title: "\u64CD\u4F5C\u5BA1\u6838",
2847
+ mcpElicitationTitle: "MCP Elicitation",
2848
+ fieldProgress: "\u5B57\u6BB5 {{current}}/{{total}}",
2849
+ requiredUnanswered: "1 \u4E2A\u5FC5\u586B\u9879\u5F85\u56DE\u7B54",
2850
+ requiredAnswered: "\u5FC5\u586B\u9879\u5DF2\u56DE\u7B54",
2851
+ true: "\u662F",
2852
+ false: "\u5426",
2853
+ cancel: "\u53D6\u6D88",
2854
+ elicitationSubmit: "\u63D0\u4EA4",
2830
2855
  actionProgress: "{{current}} / {{total}}",
2831
2856
  previousAction: "\u4E0A\u4E00\u4E2A\u64CD\u4F5C",
2832
2857
  nextAction: "\u4E0B\u4E00\u4E2A\u64CD\u4F5C",
@@ -2962,7 +2987,16 @@ var zh_CN_default = {
2962
2987
  moreTags: "+{{count}}"
2963
2988
  },
2964
2989
  mcpApp: {
2965
- loading: "\u6B63\u5728\u52A0\u8F7D MCP App"
2990
+ loading: "\u6B63\u5728\u52A0\u8F7D MCP App",
2991
+ fullscreen: "\u5168\u5C4F\u663E\u793A",
2992
+ pictureInPicture: "\u753B\u4E2D\u753B\u663E\u793A",
2993
+ returnInline: "\u8FD4\u56DE\u884C\u5185\u663E\u793A",
2994
+ approvalTitle: "\u786E\u8BA4 MCP App \u64CD\u4F5C",
2995
+ toolApprovalDescription: "App \u8BF7\u6C42\u8FD0\u884C\u201C{{tool}}\u201D\u3002\u8BF7\u68C0\u67E5\u8BF7\u6C42\u5185\u5BB9\u540E\u518D\u51B3\u5B9A\u662F\u5426\u5141\u8BB8\u3002",
2996
+ downloadApprovalDescription: "App \u8BF7\u6C42\u5C06\u6587\u4EF6\u4E0B\u8F7D\u5230\u6B64\u8BBE\u5907\u3002\u8BF7\u68C0\u67E5\u6587\u4EF6\u8BE6\u60C5\u540E\u518D\u51B3\u5B9A\u662F\u5426\u5141\u8BB8\u3002",
2997
+ requestDetails: "\u8BF7\u6C42\u8BE6\u60C5",
2998
+ approve: "\u5141\u8BB8",
2999
+ reject: "\u62D2\u7EDD"
2966
3000
  },
2967
3001
  contextCompression: {
2968
3002
  running: "\u6B63\u5728\u81EA\u52A8\u538B\u7F29\u4E0A\u4E0B\u6587",
@@ -5835,8 +5869,8 @@ function JsonTreeNode({
5835
5869
  depth = 0
5836
5870
  }) {
5837
5871
  const isArray = Array.isArray(value);
5838
- const isObject2 = isJsonObjectValue(value);
5839
- const isExpandable = isArray || isObject2;
5872
+ const isObject3 = isJsonObjectValue(value);
5873
+ const isExpandable = isArray || isObject3;
5840
5874
  const [isExpanded, setIsExpanded] = React18.useState(depth < 2);
5841
5875
  if (!isExpandable) {
5842
5876
  return /* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 gap-2 leading-6", children: [
@@ -6135,6 +6169,199 @@ function HITLApprovalPanel({
6135
6169
  onDismiss,
6136
6170
  attachToComposer = true,
6137
6171
  className
6172
+ }) {
6173
+ if (request?.request.elicitation?.kind === "mcp_elicitation" && request.request.actionRequests.length === 1 && request.request.actionRequests[0]?.name === request.request.elicitation.actionName) {
6174
+ return /* @__PURE__ */ jsx22(
6175
+ MCPBooleanElicitationPanel,
6176
+ {
6177
+ request,
6178
+ onSubmit,
6179
+ onDismiss,
6180
+ attachToComposer,
6181
+ className
6182
+ }
6183
+ );
6184
+ }
6185
+ return /* @__PURE__ */ jsx22(
6186
+ ActionReviewPanel,
6187
+ {
6188
+ request,
6189
+ onSubmit,
6190
+ onDismiss,
6191
+ attachToComposer,
6192
+ className
6193
+ }
6194
+ );
6195
+ }
6196
+ function MCPBooleanElicitationPanel({
6197
+ request,
6198
+ onSubmit,
6199
+ onDismiss,
6200
+ attachToComposer = true,
6201
+ className
6202
+ }) {
6203
+ const { t } = useChatkitTranslation();
6204
+ const rounded = useRoundedClasses4();
6205
+ const [decision, setDecision] = React19.useState(
6206
+ null
6207
+ );
6208
+ const elicitation = request?.request.elicitation;
6209
+ const action = request?.request.actionRequests.find(
6210
+ (candidate) => candidate.name === elicitation?.actionName
6211
+ );
6212
+ React19.useEffect(() => {
6213
+ setDecision(null);
6214
+ }, [request?.id]);
6215
+ React19.useEffect(() => {
6216
+ if (!request || !onDismiss) return;
6217
+ const handleKeyDown = (event) => {
6218
+ if (event.isComposing) return;
6219
+ if (event.key !== "Escape" && event.key !== "Esc") return;
6220
+ event.preventDefault();
6221
+ onDismiss();
6222
+ };
6223
+ document.addEventListener("keydown", handleKeyDown);
6224
+ return () => document.removeEventListener("keydown", handleKeyDown);
6225
+ }, [onDismiss, request]);
6226
+ if (!request || !elicitation || !action) return null;
6227
+ const fieldTitle = elicitation.field.title ?? action.name;
6228
+ const options = [
6229
+ {
6230
+ decision: "approve",
6231
+ label: t("composer.hitl.true")
6232
+ },
6233
+ {
6234
+ decision: "reject",
6235
+ label: t("composer.hitl.false")
6236
+ }
6237
+ ];
6238
+ return /* @__PURE__ */ jsxs14(
6239
+ "section",
6240
+ {
6241
+ "aria-label": t("composer.hitl.mcpElicitationTitle"),
6242
+ "aria-live": "polite",
6243
+ className: cn(
6244
+ "mx-2 border border-border bg-background/95 shadow-sm",
6245
+ rounded.density.section,
6246
+ attachToComposer ? "border-b-0" : null,
6247
+ attachToComposer ? rounded.top : rounded.panel,
6248
+ className
6249
+ ),
6250
+ children: [
6251
+ /* @__PURE__ */ jsxs14(
6252
+ "div",
6253
+ {
6254
+ className: cn(
6255
+ "flex items-center gap-1.5 font-medium text-muted-foreground",
6256
+ rounded.density.eyebrow
6257
+ ),
6258
+ children: [
6259
+ /* @__PURE__ */ jsx22(ShieldCheck, { className: "h-3.5 w-3.5" }),
6260
+ /* @__PURE__ */ jsx22("span", { children: t("composer.hitl.mcpElicitationTitle") })
6261
+ ]
6262
+ }
6263
+ ),
6264
+ /* @__PURE__ */ jsxs14("div", { className: cn("space-y-2.5", rounded.density.body), children: [
6265
+ /* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs font-medium text-muted-foreground", children: [
6266
+ /* @__PURE__ */ jsx22("span", { children: t("composer.hitl.fieldProgress", { current: 1, total: 1 }) }),
6267
+ /* @__PURE__ */ jsx22("span", { "aria-hidden": "true", children: "\xB7" }),
6268
+ /* @__PURE__ */ jsx22("span", { children: decision ? t("composer.hitl.requiredAnswered") : t("composer.hitl.requiredUnanswered") })
6269
+ ] }),
6270
+ /* @__PURE__ */ jsxs14("div", { children: [
6271
+ /* @__PURE__ */ jsx22(
6272
+ "h3",
6273
+ {
6274
+ className: cn(
6275
+ "font-semibold text-foreground",
6276
+ rounded.density.title
6277
+ ),
6278
+ children: fieldTitle
6279
+ }
6280
+ ),
6281
+ action.description ? /* @__PURE__ */ jsx22("p", { className: "mt-1 whitespace-pre-wrap text-sm leading-5 text-muted-foreground", children: action.description }) : null
6282
+ ] }),
6283
+ /* @__PURE__ */ jsx22("div", { role: "radiogroup", "aria-label": fieldTitle, className: "grid gap-1.5", children: options.map((option) => {
6284
+ const selected = decision === option.decision;
6285
+ return /* @__PURE__ */ jsxs14(
6286
+ "button",
6287
+ {
6288
+ type: "button",
6289
+ role: "radio",
6290
+ "aria-checked": selected,
6291
+ onClick: () => setDecision(option.decision),
6292
+ className: cn(
6293
+ "flex w-full items-center gap-2.5 border px-3 py-2 text-left text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
6294
+ rounded.control,
6295
+ selected ? "border-primary/50 bg-primary/10 text-foreground" : "border-border bg-background text-foreground/85 hover:bg-muted/70"
6296
+ ),
6297
+ children: [
6298
+ /* @__PURE__ */ jsx22(
6299
+ "span",
6300
+ {
6301
+ className: cn(
6302
+ "flex h-4 w-4 shrink-0 items-center justify-center rounded-full border",
6303
+ selected ? "border-primary" : "border-muted-foreground/45"
6304
+ ),
6305
+ children: selected ? /* @__PURE__ */ jsx22("span", { className: "h-2 w-2 rounded-full bg-primary" }) : null
6306
+ }
6307
+ ),
6308
+ /* @__PURE__ */ jsx22("span", { children: option.label })
6309
+ ]
6310
+ },
6311
+ option.decision
6312
+ );
6313
+ }) })
6314
+ ] }),
6315
+ /* @__PURE__ */ jsxs14(
6316
+ "div",
6317
+ {
6318
+ className: cn("flex items-center justify-end", rounded.density.footer),
6319
+ children: [
6320
+ onDismiss ? /* @__PURE__ */ jsx22(
6321
+ "button",
6322
+ {
6323
+ type: "button",
6324
+ onClick: onDismiss,
6325
+ className: cn(
6326
+ "inline-flex items-center justify-center font-medium text-muted-foreground hover:text-foreground",
6327
+ rounded.control,
6328
+ rounded.density.dismissButton
6329
+ ),
6330
+ children: t("composer.hitl.cancel")
6331
+ }
6332
+ ) : null,
6333
+ /* @__PURE__ */ jsxs14(
6334
+ "button",
6335
+ {
6336
+ type: "button",
6337
+ disabled: !decision,
6338
+ onClick: () => {
6339
+ if (decision) onSubmit([{ type: decision }]);
6340
+ },
6341
+ className: cn(
6342
+ "inline-flex shrink-0 items-center justify-center gap-1.5 bg-primary font-semibold text-primary-foreground hover:bg-primary/90 disabled:pointer-events-none disabled:opacity-45",
6343
+ rounded.control,
6344
+ rounded.density.continueButton
6345
+ ),
6346
+ children: [
6347
+ /* @__PURE__ */ jsx22(CornerDownLeft2, { className: rounded.density.continueIcon }),
6348
+ /* @__PURE__ */ jsx22("span", { children: t("composer.hitl.elicitationSubmit") })
6349
+ ]
6350
+ }
6351
+ )
6352
+ ]
6353
+ }
6354
+ )
6355
+ ]
6356
+ }
6357
+ );
6358
+ }
6359
+ function ActionReviewPanel({
6360
+ request,
6361
+ onSubmit,
6362
+ onDismiss,
6363
+ attachToComposer = true,
6364
+ className
6138
6365
  }) {
6139
6366
  const { t } = useChatkitTranslation();
6140
6367
  const rounded = useRoundedClasses4();
@@ -9629,8 +9856,8 @@ function getFallbackPalette(isDarkMode) {
9629
9856
  text: "#18181b"
9630
9857
  };
9631
9858
  }
9632
- function resolveColor(styles, property, fallback, background) {
9633
- const parsed = parseCssColor(styles.getPropertyValue(property));
9859
+ function resolveColor(styles, property2, fallback, background) {
9860
+ const parsed = parseCssColor(styles.getPropertyValue(property2));
9634
9861
  if (!parsed) return fallback;
9635
9862
  if (parsed.a < 1 && background) {
9636
9863
  return rgbaToHex(compositeColor(parsed, background));
@@ -13207,15 +13434,15 @@ function getObjectProperty(value, key) {
13207
13434
  if (!isPlainObject2(value)) {
13208
13435
  return void 0;
13209
13436
  }
13210
- const property = value[key];
13211
- return isPlainObject2(property) ? property : void 0;
13437
+ const property2 = value[key];
13438
+ return isPlainObject2(property2) ? property2 : void 0;
13212
13439
  }
13213
13440
  function getStringProperty(value, key) {
13214
13441
  if (!isPlainObject2(value)) {
13215
13442
  return void 0;
13216
13443
  }
13217
- const property = value[key];
13218
- return typeof property === "string" ? property : void 0;
13444
+ const property2 = value[key];
13445
+ return typeof property2 === "string" ? property2 : void 0;
13219
13446
  }
13220
13447
  function isPlainObject2(value) {
13221
13448
  return !!value && typeof value === "object" && !Array.isArray(value);
@@ -13229,8 +13456,232 @@ import * as React37 from "react";
13229
13456
  import {
13230
13457
  resolveLocalizedText as resolveLocalizedText3
13231
13458
  } from "@xpert-ai/chatkit-types";
13232
- import { AlertCircle as AlertCircle2, Loader2 as Loader28 } from "lucide-react";
13233
- import { jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
13459
+ import {
13460
+ AlertCircle as AlertCircle2,
13461
+ Loader2 as Loader28,
13462
+ Maximize2,
13463
+ Minimize2,
13464
+ PictureInPicture2,
13465
+ ShieldAlert
13466
+ } from "lucide-react";
13467
+
13468
+ // src/components/thread/messages/mcp-app/host.ts
13469
+ function isObject2(value) {
13470
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
13471
+ }
13472
+ function property(value, key) {
13473
+ return Reflect.get(value, key);
13474
+ }
13475
+ function stringProperty(value, key) {
13476
+ const field = property(value, key);
13477
+ return typeof field === "string" && field.trim() ? field.trim() : void 0;
13478
+ }
13479
+ function isMcpAppRpcSuccess(value) {
13480
+ return isObject2(value) && Reflect.has(value, "result") && !Reflect.has(value, "error");
13481
+ }
13482
+ function readMcpAppDisplayMode(value) {
13483
+ if (!isObject2(value)) return void 0;
13484
+ const result = property(value, "result");
13485
+ if (!isObject2(result)) return void 0;
13486
+ const mode = property(result, "mode");
13487
+ if (mode === "picture-in-picture") return "pip";
13488
+ return mode === "inline" || mode === "fullscreen" || mode === "pip" ? mode : void 0;
13489
+ }
13490
+ function readMcpAppPendingApproval(response, request) {
13491
+ if (!isObject2(response)) return null;
13492
+ const error = property(response, "error");
13493
+ if (!isObject2(error) || property(error, "code") !== -32001) return null;
13494
+ const data = property(error, "data");
13495
+ if (!isObject2(data)) return null;
13496
+ const approvalId = stringProperty(data, "approvalId");
13497
+ const risk = property(data, "risk");
13498
+ const expiresAt = property(data, "expiresAt");
13499
+ if (!approvalId || risk !== "write" && risk !== "destructive" || typeof expiresAt !== "number" || !Number.isFinite(expiresAt)) {
13500
+ return null;
13501
+ }
13502
+ const params = isObject2(request.params) ? request.params : void 0;
13503
+ const requestedTool = params ? stringProperty(params, "name") : void 0;
13504
+ const kind = request.method === "ui/download-file" ? "download" : "tool";
13505
+ return {
13506
+ approvalId,
13507
+ risk,
13508
+ expiresAt,
13509
+ toolName: kind === "download" ? "ui/download-file" : requestedTool ?? request.method ?? "tools/call",
13510
+ kind,
13511
+ request,
13512
+ details: kind === "download" ? formatDownloadApprovalDetails(request.params) : formatApprovalDetails(request.params)
13513
+ };
13514
+ }
13515
+ function withMcpAppApprovalId(request, approvalId) {
13516
+ return {
13517
+ ...request,
13518
+ params: {
13519
+ ...isObject2(request.params) ? request.params : {},
13520
+ approvalId
13521
+ }
13522
+ };
13523
+ }
13524
+ function formatApprovalDetails(value) {
13525
+ try {
13526
+ const text = JSON.stringify(redactSensitiveValue(value, 0), null, 2);
13527
+ if (!text) return "{}";
13528
+ return text.length > 4e3 ? `${text.slice(0, 4e3)}
13529
+ \u2026` : text;
13530
+ } catch {
13531
+ return "[Request details unavailable]";
13532
+ }
13533
+ }
13534
+ function redactSensitiveValue(value, depth) {
13535
+ if (depth >= 6) return "[Nested value omitted]";
13536
+ if (typeof value === "string" && value.length > 1e3) {
13537
+ return `${value.slice(0, 1e3)}\u2026 [${value.length} characters]`;
13538
+ }
13539
+ if (Array.isArray(value)) {
13540
+ return value.slice(0, 20).map((item) => redactSensitiveValue(item, depth + 1));
13541
+ }
13542
+ if (!isObject2(value)) return value;
13543
+ const output = {};
13544
+ for (const [key, field] of Object.entries(value).slice(0, 50)) {
13545
+ output[key] = /password|secret|token|authorization|api[-_]?key/i.test(key) ? "[Redacted]" : redactSensitiveValue(field, depth + 1);
13546
+ }
13547
+ return output;
13548
+ }
13549
+ function formatDownloadApprovalDetails(value) {
13550
+ if (!isObject2(value)) return "{}";
13551
+ const contents = property(value, "contents");
13552
+ if (!Array.isArray(contents)) return "{}";
13553
+ const summary = contents.slice(0, 20).map((item) => {
13554
+ if (!isObject2(item)) return { type: "invalid" };
13555
+ if (property(item, "type") === "resource_link") {
13556
+ return {
13557
+ type: "resource_link",
13558
+ name: stringProperty(item, "name"),
13559
+ uri: stringProperty(item, "uri"),
13560
+ mimeType: stringProperty(item, "mimeType")
13561
+ };
13562
+ }
13563
+ const resource = property(item, "resource");
13564
+ if (!isObject2(resource)) return { type: property(item, "type") };
13565
+ const text = property(resource, "text");
13566
+ const blob = property(resource, "blob");
13567
+ return {
13568
+ type: "resource",
13569
+ name: stringProperty(resource, "name"),
13570
+ uri: stringProperty(resource, "uri"),
13571
+ mimeType: stringProperty(resource, "mimeType"),
13572
+ size: typeof text === "string" ? `${new TextEncoder().encode(text).byteLength} bytes` : typeof blob === "string" ? `approximately ${Math.floor(blob.length * 3 / 4)} bytes` : void 0
13573
+ };
13574
+ });
13575
+ return JSON.stringify({ files: summary }, null, 2);
13576
+ }
13577
+ function triggerMcpAppDownloads(value) {
13578
+ const downloads = parseDownloadItems(value);
13579
+ for (const download of downloads) {
13580
+ if (download.kind === "link") {
13581
+ clickDownload(download.uri, download.filename);
13582
+ continue;
13583
+ }
13584
+ const blob = new Blob(
13585
+ [
13586
+ download.text !== void 0 ? download.text : decodeBase64(download.blob ?? "")
13587
+ ],
13588
+ { type: download.mimeType }
13589
+ );
13590
+ const url = URL.createObjectURL(blob);
13591
+ clickDownload(url, download.filename);
13592
+ window.setTimeout(() => URL.revokeObjectURL(url), 0);
13593
+ }
13594
+ }
13595
+ function parseDownloadItems(value) {
13596
+ if (!isObject2(value)) throw new Error("Download params must be an object");
13597
+ if (property(value, "isError") === true) {
13598
+ throw new Error("The MCP App reported that the download failed");
13599
+ }
13600
+ const contents = property(value, "contents");
13601
+ if (!Array.isArray(contents) || contents.length === 0) {
13602
+ throw new Error("Download contents must be a non-empty array");
13603
+ }
13604
+ return contents.map((item, index) => {
13605
+ if (!isObject2(item)) throw new Error("Download content is invalid");
13606
+ const type = property(item, "type");
13607
+ if (type === "resource_link") {
13608
+ const uri2 = stringProperty(item, "uri");
13609
+ const name = stringProperty(item, "name");
13610
+ if (!uri2 || !name || !isHttpUrl(uri2)) {
13611
+ throw new Error(
13612
+ "Download link must use HTTP or HTTPS and include a name"
13613
+ );
13614
+ }
13615
+ return {
13616
+ kind: "link",
13617
+ filename: sanitizeFilename(name, index),
13618
+ uri: uri2
13619
+ };
13620
+ }
13621
+ if (type !== "resource") {
13622
+ throw new Error("Download content type is unsupported");
13623
+ }
13624
+ const resource = property(item, "resource");
13625
+ if (!isObject2(resource)) throw new Error("Embedded download is invalid");
13626
+ const uri = stringProperty(resource, "uri");
13627
+ if (!uri) throw new Error("Embedded download URI is required");
13628
+ const text = property(resource, "text");
13629
+ const blob = property(resource, "blob");
13630
+ if (typeof text !== "string" && typeof blob !== "string") {
13631
+ throw new Error("Embedded download must include text or base64 data");
13632
+ }
13633
+ const common = {
13634
+ kind: "embedded",
13635
+ filename: sanitizeFilename(
13636
+ stringProperty(resource, "name") ?? filenameFromUri(uri),
13637
+ index
13638
+ ),
13639
+ mimeType: stringProperty(resource, "mimeType") ?? "application/octet-stream"
13640
+ };
13641
+ return typeof text === "string" ? { ...common, text } : { ...common, blob };
13642
+ });
13643
+ }
13644
+ function decodeBase64(value) {
13645
+ const decoded = window.atob(value);
13646
+ return Uint8Array.from(decoded, (character) => character.charCodeAt(0));
13647
+ }
13648
+ function filenameFromUri(uri) {
13649
+ try {
13650
+ const pathname = new URL(uri).pathname;
13651
+ const segment = pathname.split("/").filter(Boolean).at(-1);
13652
+ return segment ? decodeURIComponent(segment) : "download";
13653
+ } catch {
13654
+ return uri.split("/").filter(Boolean).at(-1) ?? "download";
13655
+ }
13656
+ }
13657
+ function sanitizeFilename(value, index) {
13658
+ const sanitized = Array.from(
13659
+ value,
13660
+ (character) => character.charCodeAt(0) <= 31 || /[\\/:*?"<>|]/.test(character) ? "_" : character
13661
+ ).join("").trim().slice(0, 255);
13662
+ return sanitized || `download-${index + 1}`;
13663
+ }
13664
+ function isHttpUrl(value) {
13665
+ try {
13666
+ const url = new URL(value);
13667
+ return url.protocol === "http:" || url.protocol === "https:";
13668
+ } catch {
13669
+ return false;
13670
+ }
13671
+ }
13672
+ function clickDownload(uri, filename) {
13673
+ const anchor = document.createElement("a");
13674
+ anchor.href = uri;
13675
+ anchor.download = filename;
13676
+ anchor.rel = "noopener noreferrer";
13677
+ anchor.hidden = true;
13678
+ document.body.append(anchor);
13679
+ anchor.click();
13680
+ anchor.remove();
13681
+ }
13682
+
13683
+ // src/components/thread/messages/mcp-app.tsx
13684
+ import { Fragment as Fragment8, jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
13234
13685
  var EMPTY_INPUT_SCHEMA = {
13235
13686
  type: "object",
13236
13687
  properties: {}
@@ -13262,53 +13713,28 @@ function readIconDefinition(value) {
13262
13713
  }
13263
13714
  function readStringList(value) {
13264
13715
  if (!Array.isArray(value)) return void 0;
13265
- const strings = value.filter((item) => typeof item === "string");
13716
+ const strings = value.filter(
13717
+ (item) => typeof item === "string"
13718
+ );
13266
13719
  return strings.length ? strings : void 0;
13267
13720
  }
13268
- function buildXpertApiUrl(apiUrl, path) {
13269
- const normalizedApiUrl = apiUrl.trim();
13270
- if (!normalizedApiUrl) return path;
13271
- try {
13272
- const url = new URL(normalizedApiUrl);
13273
- return `${url.origin}${path}`;
13274
- } catch {
13275
- return path;
13276
- }
13277
- }
13278
- function appendQuery(path, params) {
13279
- const query = params.toString();
13280
- return query ? `${path}?${query}` : path;
13281
- }
13282
- function buildMcpAppReviveParams(data, options) {
13283
- const params = new URLSearchParams();
13284
- const add = (key, value) => {
13285
- if (value) {
13286
- params.set(key, value);
13287
- }
13721
+ function buildMcpAppReviveQuery(data, options) {
13722
+ return {
13723
+ toolsetId: data.toolsetId,
13724
+ serverName: data.serverName,
13725
+ toolName: data.toolName,
13726
+ toolCallId: data.toolCallId,
13727
+ resourceUri: data.resourceUri,
13728
+ title: typeof data.title === "string" ? data.title : void 0,
13729
+ messageId: options?.messageId,
13730
+ token: options?.appInstanceToken ?? data.appInstanceToken
13288
13731
  };
13289
- add("toolsetId", data.toolsetId);
13290
- add("serverName", data.serverName);
13291
- add("toolName", data.toolName);
13292
- add("toolCallId", data.toolCallId);
13293
- add("resourceUri", data.resourceUri);
13294
- add("title", typeof data.title === "string" ? data.title : void 0);
13295
- add("messageId", options?.messageId);
13296
- add("token", options?.appInstanceToken ?? data.appInstanceToken);
13297
- return params;
13298
- }
13299
- function buildMcpAppEndpointPath(data, endpoint, options) {
13300
- return appendQuery(
13301
- `/api/xpert-toolset/mcp-apps/${encodeURIComponent(
13302
- data.appInstanceId
13303
- )}/${endpoint}`,
13304
- buildMcpAppReviveParams(data, options)
13305
- );
13306
13732
  }
13307
13733
  function escapeHtmlAttribute(value) {
13308
13734
  return value.replaceAll("&", "&amp;").replaceAll('"', "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
13309
13735
  }
13310
13736
  function domains(values) {
13311
- return values?.filter((value) => value.trim()).join(" ") ?? "";
13737
+ return values?.map((value) => value.trim()).filter((value) => value && !/[\s;'"<>]/.test(value)).join(" ") ?? "";
13312
13738
  }
13313
13739
  function buildCsp(csp) {
13314
13740
  const resourceDomains = domains(csp?.resourceDomains);
@@ -13323,7 +13749,9 @@ function buildCsp(csp) {
13323
13749
  `media-src data: blob: ${resourceDomains}`.trim(),
13324
13750
  `font-src data: ${resourceDomains}`.trim(),
13325
13751
  `connect-src ${connectDomains}`,
13752
+ `form-action ${connectDomains}`,
13326
13753
  `frame-src ${frameDomains}`,
13754
+ "object-src 'none'",
13327
13755
  `base-uri ${baseUriDomains}`
13328
13756
  ].join("; ");
13329
13757
  }
@@ -13409,13 +13837,14 @@ function jsonRpcResult(id, result) {
13409
13837
  result
13410
13838
  };
13411
13839
  }
13412
- function jsonRpcError(id, message) {
13840
+ function jsonRpcError(id, message, code = -32e3, data) {
13413
13841
  return {
13414
13842
  jsonrpc: "2.0",
13415
13843
  id: id ?? null,
13416
13844
  error: {
13417
- code: -32e3,
13418
- message
13845
+ code,
13846
+ message,
13847
+ ...data === void 0 ? {} : { data }
13419
13848
  }
13420
13849
  };
13421
13850
  }
@@ -13466,11 +13895,7 @@ var MCP_APP_THEME_COLOR_TOKENS = [
13466
13895
  ["--background", "--mcp-app-color-background", "oklch(1 0 0)"],
13467
13896
  ["--foreground", "--mcp-app-color-foreground", "oklch(0.145 0 0)"],
13468
13897
  ["--card", "--mcp-app-color-card", "oklch(1 0 0)"],
13469
- [
13470
- "--card-foreground",
13471
- "--mcp-app-color-card-foreground",
13472
- "oklch(0.145 0 0)"
13473
- ],
13898
+ ["--card-foreground", "--mcp-app-color-card-foreground", "oklch(0.145 0 0)"],
13474
13899
  ["--popover", "--mcp-app-color-popover", "oklch(1 0 0)"],
13475
13900
  [
13476
13901
  "--popover-foreground",
@@ -13501,11 +13926,7 @@ var MCP_APP_THEME_COLOR_TOKENS = [
13501
13926
  "--mcp-app-color-accent-foreground",
13502
13927
  "oklch(0.205 0 0)"
13503
13928
  ],
13504
- [
13505
- "--destructive",
13506
- "--mcp-app-color-destructive",
13507
- "oklch(0.577 0.245 27.325)"
13508
- ],
13929
+ ["--destructive", "--mcp-app-color-destructive", "oklch(0.577 0.245 27.325)"],
13509
13930
  [
13510
13931
  "--destructive-foreground",
13511
13932
  "--mcp-app-color-destructive-foreground",
@@ -13619,9 +14040,7 @@ function normalizeMcpAppToolInfo(value, data, resource = {}) {
13619
14040
  ...rawTool,
13620
14041
  name: originalName,
13621
14042
  title: readLocalizedText(rawTool.title) ?? title,
13622
- inputSchema: normalizeInputSchema(
13623
- rawTool.inputSchema ?? raw.inputSchema
13624
- ),
14043
+ inputSchema: normalizeInputSchema(rawTool.inputSchema ?? raw.inputSchema),
13625
14044
  ...description ? {
13626
14045
  description: readLocalizedText(rawTool.description) ?? description
13627
14046
  } : {},
@@ -13650,10 +14069,66 @@ function buildIframeAllow(permissions) {
13650
14069
  return policies.length ? policies.join("; ") : void 0;
13651
14070
  }
13652
14071
  function buildSandboxAttribute() {
13653
- return ["allow-downloads", "allow-forms", "allow-modals", "allow-scripts"].join(
13654
- " "
14072
+ return ["allow-forms", "allow-modals", "allow-scripts"].join(" ");
14073
+ }
14074
+ function isLoopbackHostname(hostname) {
14075
+ return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]";
14076
+ }
14077
+ function normalizeRequestedDomain(value) {
14078
+ const domain = value?.trim().toLowerCase().replace(/\.$/, "");
14079
+ if (!domain || /[/:?#@]/.test(domain)) return null;
14080
+ try {
14081
+ const parsed = new URL(`https://${domain}`);
14082
+ return parsed.hostname === domain && !parsed.port ? domain : null;
14083
+ } catch {
14084
+ return null;
14085
+ }
14086
+ }
14087
+ function domainMatchesAllowlist(domain, allowedDomains) {
14088
+ return Boolean(
14089
+ allowedDomains?.some((value) => {
14090
+ const entry = value.trim().toLowerCase().replace(/\.$/, "");
14091
+ if (entry.startsWith("*.")) {
14092
+ const suffix = entry.slice(2);
14093
+ return Boolean(suffix) && domain !== suffix && domain.endsWith(`.${suffix}`);
14094
+ }
14095
+ return domain === entry;
14096
+ })
13655
14097
  );
13656
14098
  }
14099
+ function resolveMcpAppSandboxProxy(options, requestedDomain, hostLocation = window.location.href) {
14100
+ const configuredUrl = options?.sandboxProxyUrl?.trim();
14101
+ if (!configuredUrl) return null;
14102
+ try {
14103
+ const hostOrigin = new URL(hostLocation).origin;
14104
+ const proxyUrl = new URL(configuredUrl, hostLocation);
14105
+ if (proxyUrl.protocol !== "https:" && !(proxyUrl.protocol === "http:" && isLoopbackHostname(proxyUrl.hostname))) {
14106
+ return null;
14107
+ }
14108
+ const domain = normalizeRequestedDomain(requestedDomain);
14109
+ const dedicatedOrigin = Boolean(
14110
+ domain && (domain === proxyUrl.hostname.toLowerCase() || domainMatchesAllowlist(domain, options?.allowedDomains))
14111
+ );
14112
+ if (domain && dedicatedOrigin) {
14113
+ proxyUrl.hostname = domain;
14114
+ proxyUrl.port = "";
14115
+ }
14116
+ if (proxyUrl.origin === hostOrigin) return null;
14117
+ const fragment = new URLSearchParams(proxyUrl.hash.slice(1));
14118
+ fragment.set("parentOrigin", hostOrigin);
14119
+ proxyUrl.hash = fragment.toString();
14120
+ return {
14121
+ url: proxyUrl.toString(),
14122
+ origin: proxyUrl.origin,
14123
+ dedicatedOrigin
14124
+ };
14125
+ } catch {
14126
+ return null;
14127
+ }
14128
+ }
14129
+ function buildMcpAppInnerSandbox(dedicatedOrigin) {
14130
+ return dedicatedOrigin ? `${buildSandboxAttribute()} allow-same-origin` : buildSandboxAttribute();
14131
+ }
13657
14132
  function stringifyToolResult(value) {
13658
14133
  if (typeof value === "string") return value;
13659
14134
  try {
@@ -13776,7 +14251,7 @@ function normalizeMcpAppResourceResponse(value, data) {
13776
14251
  rawToolResult
13777
14252
  };
13778
14253
  }
13779
- function isHttpUrl(value) {
14254
+ function isHttpUrl2(value) {
13780
14255
  try {
13781
14256
  const url = new URL(value);
13782
14257
  return url.protocol === "http:" || url.protocol === "https:";
@@ -13784,91 +14259,330 @@ function isHttpUrl(value) {
13784
14259
  return false;
13785
14260
  }
13786
14261
  }
13787
- function contentBlocksToText(content) {
13788
- if (!Array.isArray(content)) return null;
13789
- const parts = content.map((item) => {
13790
- if (!isRecord5(item)) return "";
13791
- if (item.type === "text" && typeof item.text === "string") {
13792
- return item.text;
13793
- }
13794
- if (item.type === "resource_link" && typeof item.uri === "string") {
13795
- return item.uri;
13796
- }
13797
- if (item.type === "image" || item.type === "audio") {
13798
- return `[${item.type}]`;
13799
- }
13800
- return stringifyToolResult(item);
13801
- }).map((part) => part.trim()).filter(Boolean);
13802
- return parts.length ? parts.join("\n\n") : null;
14262
+ var MCP_APP_MESSAGE_MAX_BINARY_BYTES = 25 * 1024 * 1024;
14263
+ function normalizeMcpMimeType(value, fallback) {
14264
+ const mimeType = typeof value === "string" ? value.trim() : fallback;
14265
+ return mimeType && /^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$/i.test(mimeType) ? mimeType.toLowerCase() : null;
13803
14266
  }
13804
- function isMcpAppComponentData(data) {
13805
- return isRecord5(data) && data.type === "McpApp" && typeof data.appInstanceId === "string" && typeof data.resourceUri === "string";
14267
+ function normalizeMcpBase64(value) {
14268
+ if (typeof value !== "string") return null;
14269
+ const data = value.replace(/\s/g, "");
14270
+ if (!data || data.length % 4 !== 0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(data)) {
14271
+ return null;
14272
+ }
14273
+ return data;
13806
14274
  }
13807
- function McpAppMessage({
13808
- data,
13809
- messageId,
13810
- className
13811
- }) {
13812
- const { i18n: i18n2 } = useChatkitTranslation();
13813
- const {
13814
- apiUrl,
13815
- authenticatedFetch,
13816
- isLoading: streamIsLoading,
13817
- submit
13818
- } = useStreamContext();
14275
+ function decodedBase64Bytes(data) {
14276
+ const padding = data.endsWith("==") ? 2 : data.endsWith("=") ? 1 : 0;
14277
+ return data.length / 4 * 3 - padding;
14278
+ }
14279
+ function mcpMessageFile(data, mimeType, name) {
14280
+ return {
14281
+ name,
14282
+ originalName: name,
14283
+ mimeType,
14284
+ fileUrl: `data:${mimeType};base64,${data}`
14285
+ };
14286
+ }
14287
+ function resourceLabel(resource) {
14288
+ const details = {
14289
+ uri: readString3(resource.uri),
14290
+ mimeType: readString3(resource.mimeType)
14291
+ };
14292
+ return `[Resource ${stringifyToolResult(details)}]`;
14293
+ }
14294
+ function resourceLinkLabel(resourceLink) {
14295
+ const details = {
14296
+ uri: readString3(resourceLink.uri),
14297
+ name: readString3(resourceLink.name),
14298
+ description: readString3(resourceLink.description),
14299
+ mimeType: readString3(resourceLink.mimeType),
14300
+ size: typeof resourceLink.size === "number" ? resourceLink.size : void 0
14301
+ };
14302
+ return `[Resource link ${stringifyToolResult(details)}]`;
14303
+ }
14304
+ function contentBlocksToChatInput(content) {
14305
+ if (!Array.isArray(content)) {
14306
+ throw new Error("ui/message content must be an array");
14307
+ }
14308
+ const text = [];
14309
+ const files = [];
14310
+ let binaryBytes = 0;
14311
+ content.forEach((item, index) => {
14312
+ if (!isRecord5(item) || typeof item.type !== "string") {
14313
+ throw new Error(`ui/message content block ${index + 1} is invalid`);
14314
+ }
14315
+ if (item.type === "text") {
14316
+ if (typeof item.text !== "string") {
14317
+ throw new Error(`ui/message text block ${index + 1} is invalid`);
14318
+ }
14319
+ if (item.text.length) text.push(item.text);
14320
+ return;
14321
+ }
14322
+ if (item.type === "image" || item.type === "audio") {
14323
+ const mimeType = normalizeMcpMimeType(item.mimeType);
14324
+ const data = normalizeMcpBase64(item.data);
14325
+ if (!mimeType || !data || !mimeType.startsWith(`${item.type}/`)) {
14326
+ throw new Error(
14327
+ `ui/message ${item.type} block ${index + 1} is invalid`
14328
+ );
14329
+ }
14330
+ binaryBytes += decodedBase64Bytes(data);
14331
+ files.push(
14332
+ mcpMessageFile(data, mimeType, `mcp-app-${item.type}-${index + 1}`)
14333
+ );
14334
+ return;
14335
+ }
14336
+ if (item.type === "resource") {
14337
+ const resource = readRecord(item.resource);
14338
+ if (!resource || typeof resource.uri !== "string") {
14339
+ throw new Error(`ui/message resource block ${index + 1} is invalid`);
14340
+ }
14341
+ const label = resourceLabel(resource);
14342
+ if (typeof resource.text === "string") {
14343
+ text.push(`${label}
14344
+ ${resource.text}`);
14345
+ return;
14346
+ }
14347
+ const data = normalizeMcpBase64(resource.blob);
14348
+ const mimeType = normalizeMcpMimeType(
14349
+ resource.mimeType,
14350
+ "application/octet-stream"
14351
+ );
14352
+ if (!data || !mimeType) {
14353
+ throw new Error(`ui/message resource block ${index + 1} is invalid`);
14354
+ }
14355
+ binaryBytes += decodedBase64Bytes(data);
14356
+ text.push(label);
14357
+ files.push(
14358
+ mcpMessageFile(data, mimeType, `mcp-app-resource-${index + 1}`)
14359
+ );
14360
+ return;
14361
+ }
14362
+ if (item.type === "resource_link" && typeof item.uri === "string") {
14363
+ text.push(resourceLinkLabel(item));
14364
+ return;
14365
+ }
14366
+ throw new Error(
14367
+ `ui/message content block ${index + 1} uses an unsupported type`
14368
+ );
14369
+ });
14370
+ if (binaryBytes > MCP_APP_MESSAGE_MAX_BINARY_BYTES) {
14371
+ throw new Error("ui/message binary content exceeds the 25 MiB limit");
14372
+ }
14373
+ if (!text.length && !files.length) {
14374
+ throw new Error("ui/message content is empty");
14375
+ }
14376
+ return {
14377
+ input: text.join("\n\n"),
14378
+ files
14379
+ };
14380
+ }
14381
+ function isMcpAppComponentData(data) {
14382
+ return isRecord5(data) && data.type === "McpApp" && typeof data.appInstanceId === "string" && typeof data.resourceUri === "string";
14383
+ }
14384
+ function McpAppMessage({
14385
+ data,
14386
+ messageId,
14387
+ className,
14388
+ mcpApps
14389
+ }) {
14390
+ const { i18n: i18n2 } = useChatkitTranslation();
14391
+ const { client, isLoading: streamIsLoading, submit } = useStreamContext();
13819
14392
  const iframeRef = React37.useRef(null);
14393
+ const appWindowRef = React37.useRef(null);
13820
14394
  const containerRef = React37.useRef(null);
13821
14395
  const initializedRef = React37.useRef(false);
13822
14396
  const sentInitialResultRef = React37.useRef(false);
13823
14397
  const modelContextRef = React37.useRef(null);
14398
+ const pendingApprovalRef = React37.useRef(null);
14399
+ const approvalActionRef = React37.useRef(null);
14400
+ const runtimeAppInstanceTokenRef = React37.useRef(
14401
+ data.appInstanceToken
14402
+ );
14403
+ const teardownGenerationRef = React37.useRef(0);
14404
+ const teardownStartedRef = React37.useRef(false);
14405
+ const activeAppInstanceIdRef = React37.useRef(data.appInstanceId);
13824
14406
  const [resource, setResource] = React37.useState(null);
13825
14407
  const [runtimeAppInstanceToken, setRuntimeAppInstanceToken] = React37.useState(data.appInstanceToken);
13826
14408
  const [srcDoc, setSrcDoc] = React37.useState(null);
13827
14409
  const [height, setHeight] = React37.useState(420);
14410
+ const [displayMode, setDisplayMode] = React37.useState("inline");
14411
+ const [pendingApproval, setPendingApproval] = React37.useState(null);
14412
+ const [approvalAction, setApprovalAction] = React37.useState(null);
14413
+ const [approvalError, setApprovalError] = React37.useState(null);
13828
14414
  const [error, setError] = React37.useState(null);
13829
14415
  const [isLoading, setIsLoading] = React37.useState(true);
13830
- const resourceUrl = React37.useMemo(
13831
- () => buildXpertApiUrl(
13832
- apiUrl,
13833
- buildMcpAppEndpointPath(data, "resource", {
13834
- messageId
13835
- })
13836
- ),
13837
- [apiUrl, data, messageId]
14416
+ const [isTornDown, setIsTornDown] = React37.useState(false);
14417
+ const sandboxProxy = React37.useMemo(
14418
+ () => resolveMcpAppSandboxProxy(mcpApps, resource?.domain ?? data.domain),
14419
+ [data.domain, mcpApps, resource?.domain]
13838
14420
  );
13839
- const rpcUrl = React37.useMemo(
13840
- () => buildXpertApiUrl(
13841
- apiUrl,
13842
- buildMcpAppEndpointPath(data, "rpc", {
13843
- appInstanceToken: runtimeAppInstanceToken,
13844
- messageId
13845
- })
13846
- ),
13847
- [apiUrl, data, messageId, runtimeAppInstanceToken]
14421
+ React37.useEffect(() => {
14422
+ runtimeAppInstanceTokenRef.current = runtimeAppInstanceToken;
14423
+ }, [runtimeAppInstanceToken]);
14424
+ const bindIframeRef = React37.useCallback(
14425
+ (iframe) => {
14426
+ iframeRef.current = iframe;
14427
+ if (iframe?.contentWindow) {
14428
+ appWindowRef.current = iframe.contentWindow;
14429
+ }
14430
+ },
14431
+ []
14432
+ );
14433
+ const postToApp = React37.useCallback(
14434
+ (message) => {
14435
+ iframeRef.current?.contentWindow?.postMessage(
14436
+ message,
14437
+ sandboxProxy?.origin ?? "*"
14438
+ );
14439
+ },
14440
+ [sandboxProxy?.origin]
13848
14441
  );
13849
- const postToApp = React37.useCallback((message) => {
13850
- iframeRef.current?.contentWindow?.postMessage(message, "*");
13851
- }, []);
13852
14442
  const callHostRpc = React37.useCallback(
13853
14443
  async (request) => {
13854
- const response = await authenticatedFetch(rpcUrl, {
13855
- method: "POST",
13856
- headers: {
13857
- "content-type": "application/json"
13858
- },
13859
- body: JSON.stringify({
14444
+ return client.mcp.apps.rpc(
14445
+ data.appInstanceId,
14446
+ {
13860
14447
  jsonrpc: "2.0",
13861
14448
  id: request.id ?? null,
13862
14449
  method: request.method,
13863
14450
  params: request.params
14451
+ },
14452
+ buildMcpAppReviveQuery(data, {
14453
+ appInstanceToken: runtimeAppInstanceToken,
14454
+ messageId
13864
14455
  })
14456
+ );
14457
+ },
14458
+ [client, data, messageId, runtimeAppInstanceToken]
14459
+ );
14460
+ const clearPendingApproval = React37.useCallback(() => {
14461
+ pendingApprovalRef.current = null;
14462
+ approvalActionRef.current = null;
14463
+ setPendingApproval(null);
14464
+ setApprovalAction(null);
14465
+ setApprovalError(null);
14466
+ }, []);
14467
+ const isSupersededStrictModeTeardown = React37.useCallback(
14468
+ (generation, appInstanceId) => teardownGenerationRef.current !== generation && activeAppInstanceIdRef.current === appInstanceId,
14469
+ []
14470
+ );
14471
+ const processHostRpcResponse = React37.useCallback(
14472
+ (request, response) => {
14473
+ const nextApproval = readMcpAppPendingApproval(response, request);
14474
+ if (nextApproval) {
14475
+ if (pendingApprovalRef.current) {
14476
+ postToApp(
14477
+ jsonRpcError(
14478
+ request.id,
14479
+ "Another MCP App approval request is already pending",
14480
+ -32004
14481
+ )
14482
+ );
14483
+ return;
14484
+ }
14485
+ pendingApprovalRef.current = nextApproval;
14486
+ setPendingApproval(nextApproval);
14487
+ setApprovalError(null);
14488
+ return;
14489
+ }
14490
+ const nextDisplayMode = readMcpAppDisplayMode(response);
14491
+ if (request.method === "ui/request-display-mode" && nextDisplayMode) {
14492
+ setDisplayMode(nextDisplayMode);
14493
+ }
14494
+ if (request.method === "ui/download-file" && isMcpAppRpcSuccess(response)) {
14495
+ try {
14496
+ triggerMcpAppDownloads(request.params);
14497
+ } catch (downloadError) {
14498
+ postToApp(
14499
+ jsonRpcError(request.id, getErrorMessage(downloadError), -32005)
14500
+ );
14501
+ return;
14502
+ }
14503
+ }
14504
+ postToApp(response);
14505
+ },
14506
+ [postToApp]
14507
+ );
14508
+ const dispatchHostRpc = React37.useCallback(
14509
+ async (request) => {
14510
+ try {
14511
+ processHostRpcResponse(request, await callHostRpc(request));
14512
+ } catch (rpcError) {
14513
+ postToApp(jsonRpcError(request.id, getErrorMessage(rpcError)));
14514
+ }
14515
+ },
14516
+ [callHostRpc, postToApp, processHostRpcResponse]
14517
+ );
14518
+ const resolvePendingApproval = React37.useCallback(
14519
+ async (action) => {
14520
+ const approval = pendingApprovalRef.current;
14521
+ if (!approval || approvalActionRef.current) return;
14522
+ if (approval.expiresAt <= Date.now()) {
14523
+ clearPendingApproval();
14524
+ postToApp(
14525
+ jsonRpcError(
14526
+ approval.request.id,
14527
+ "The MCP App approval request expired",
14528
+ -32003
14529
+ )
14530
+ );
14531
+ return;
14532
+ }
14533
+ approvalActionRef.current = action;
14534
+ setApprovalAction(action);
14535
+ setApprovalError(null);
14536
+ const query = buildMcpAppReviveQuery(data, {
14537
+ appInstanceToken: runtimeAppInstanceToken,
14538
+ messageId
13865
14539
  });
13866
- if (!response.ok) {
13867
- throw new Error(`MCP App RPC failed with ${response.status}`);
14540
+ try {
14541
+ if (action === "reject") {
14542
+ await client.mcp.apps.reject(
14543
+ data.appInstanceId,
14544
+ approval.approvalId,
14545
+ query
14546
+ );
14547
+ clearPendingApproval();
14548
+ postToApp(
14549
+ jsonRpcError(
14550
+ approval.request.id,
14551
+ "The user rejected the MCP App action",
14552
+ -32002,
14553
+ { approvalId: approval.approvalId, rejected: true }
14554
+ )
14555
+ );
14556
+ return;
14557
+ }
14558
+ await client.mcp.apps.approve(
14559
+ data.appInstanceId,
14560
+ approval.approvalId,
14561
+ query
14562
+ );
14563
+ const retryRequest = withMcpAppApprovalId(
14564
+ approval.request,
14565
+ approval.approvalId
14566
+ );
14567
+ const response = await callHostRpc(retryRequest);
14568
+ clearPendingApproval();
14569
+ processHostRpcResponse(retryRequest, response);
14570
+ } catch (approvalRequestError) {
14571
+ approvalActionRef.current = null;
14572
+ setApprovalAction(null);
14573
+ setApprovalError(getErrorMessage(approvalRequestError));
13868
14574
  }
13869
- return response.json();
13870
14575
  },
13871
- [authenticatedFetch, rpcUrl]
14576
+ [
14577
+ callHostRpc,
14578
+ clearPendingApproval,
14579
+ client,
14580
+ data,
14581
+ messageId,
14582
+ postToApp,
14583
+ processHostRpcResponse,
14584
+ runtimeAppInstanceToken
14585
+ ]
13872
14586
  );
13873
14587
  const sendInitialToolNotifications = React37.useCallback(() => {
13874
14588
  if (!initializedRef.current || sentInitialResultRef.current || !resource) {
@@ -13901,28 +14615,35 @@ function McpAppMessage({
13901
14615
  const controller = new AbortController();
13902
14616
  initializedRef.current = false;
13903
14617
  sentInitialResultRef.current = false;
14618
+ pendingApprovalRef.current = null;
14619
+ approvalActionRef.current = null;
13904
14620
  setRuntimeAppInstanceToken(data.appInstanceToken);
14621
+ runtimeAppInstanceTokenRef.current = data.appInstanceToken;
14622
+ teardownStartedRef.current = false;
14623
+ setIsTornDown(false);
14624
+ setDisplayMode("inline");
14625
+ setPendingApproval(null);
14626
+ setApprovalAction(null);
14627
+ setApprovalError(null);
13905
14628
  setIsLoading(true);
13906
14629
  setError(null);
13907
14630
  setResource(null);
13908
14631
  setSrcDoc(null);
13909
14632
  void (async () => {
13910
14633
  try {
13911
- const response = await authenticatedFetch(resourceUrl, {
13912
- signal: controller.signal
13913
- });
13914
- if (!response.ok) {
13915
- throw new Error(`MCP App resource failed with ${response.status}`);
13916
- }
13917
- const payload = await response.json();
14634
+ const payload = await client.mcp.apps.getResource(
14635
+ data.appInstanceId,
14636
+ buildMcpAppReviveQuery(data, { messageId }),
14637
+ { signal: controller.signal }
14638
+ );
13918
14639
  const normalizedResource = normalizeMcpAppResourceResponse(
13919
14640
  payload,
13920
14641
  data
13921
14642
  );
13922
14643
  setResource(normalizedResource);
13923
- setRuntimeAppInstanceToken(
13924
- normalizedResource.appInstanceToken ?? data.appInstanceToken
13925
- );
14644
+ const nextAppInstanceToken = normalizedResource.appInstanceToken ?? data.appInstanceToken;
14645
+ runtimeAppInstanceTokenRef.current = nextAppInstanceToken;
14646
+ setRuntimeAppInstanceToken(nextAppInstanceToken);
13926
14647
  const hostLocale = normalizeHostLocale(i18n2.language);
13927
14648
  setSrcDoc(
13928
14649
  injectMcpAppTheme(
@@ -13947,26 +14668,131 @@ function McpAppMessage({
13947
14668
  controller.abort();
13948
14669
  };
13949
14670
  }, [
13950
- authenticatedFetch,
14671
+ client,
13951
14672
  data,
13952
14673
  data.appInstanceId,
13953
14674
  data.appInstanceToken,
13954
14675
  data.csp,
13955
14676
  i18n2.language,
13956
- resourceUrl
14677
+ messageId
14678
+ ]);
14679
+ React37.useEffect(() => {
14680
+ const generation = ++teardownGenerationRef.current;
14681
+ activeAppInstanceIdRef.current = data.appInstanceId;
14682
+ return () => {
14683
+ const appWindow = appWindowRef.current;
14684
+ const appOrigin = sandboxProxy?.origin ?? "*";
14685
+ const query = buildMcpAppReviveQuery(data, {
14686
+ appInstanceToken: runtimeAppInstanceTokenRef.current,
14687
+ messageId
14688
+ });
14689
+ const approval = pendingApprovalRef.current;
14690
+ queueMicrotask(() => {
14691
+ if (isSupersededStrictModeTeardown(generation, data.appInstanceId)) {
14692
+ return;
14693
+ }
14694
+ if (teardownStartedRef.current) {
14695
+ return;
14696
+ }
14697
+ teardownStartedRef.current = true;
14698
+ try {
14699
+ appWindow?.postMessage(
14700
+ {
14701
+ jsonrpc: "2.0",
14702
+ id: `xpert-teardown-${data.appInstanceId}`,
14703
+ method: "ui/resource-teardown",
14704
+ params: { reason: "host-unmount" }
14705
+ },
14706
+ appOrigin
14707
+ );
14708
+ } catch {
14709
+ }
14710
+ void (async () => {
14711
+ if (approval) {
14712
+ await client.mcp.apps.reject(data.appInstanceId, approval.approvalId, query).catch(() => void 0);
14713
+ }
14714
+ await client.mcp.apps.teardown(data.appInstanceId, query).catch(() => void 0);
14715
+ })();
14716
+ });
14717
+ };
14718
+ }, [
14719
+ client,
14720
+ data,
14721
+ data.appInstanceId,
14722
+ isSupersededStrictModeTeardown,
14723
+ messageId,
14724
+ sandboxProxy?.origin
13957
14725
  ]);
14726
+ React37.useEffect(() => {
14727
+ if (!pendingApproval) return;
14728
+ const remaining = pendingApproval.expiresAt - Date.now();
14729
+ if (remaining <= 0) {
14730
+ clearPendingApproval();
14731
+ postToApp(
14732
+ jsonRpcError(
14733
+ pendingApproval.request.id,
14734
+ "The MCP App approval request expired",
14735
+ -32003
14736
+ )
14737
+ );
14738
+ return;
14739
+ }
14740
+ const timeout = window.setTimeout(() => {
14741
+ if (pendingApprovalRef.current?.approvalId !== pendingApproval.approvalId) {
14742
+ return;
14743
+ }
14744
+ clearPendingApproval();
14745
+ postToApp(
14746
+ jsonRpcError(
14747
+ pendingApproval.request.id,
14748
+ "The MCP App approval request expired",
14749
+ -32003
14750
+ )
14751
+ );
14752
+ }, remaining);
14753
+ return () => window.clearTimeout(timeout);
14754
+ }, [clearPendingApproval, pendingApproval, postToApp]);
13958
14755
  React37.useEffect(() => {
13959
14756
  sendInitialToolNotifications();
13960
14757
  }, [sendInitialToolNotifications]);
14758
+ React37.useEffect(() => {
14759
+ if (!initializedRef.current) return;
14760
+ postToApp({
14761
+ jsonrpc: "2.0",
14762
+ method: "ui/notifications/host-context-changed",
14763
+ params: {
14764
+ displayMode,
14765
+ containerDimensions: getContainerDimensions(containerRef.current)
14766
+ }
14767
+ });
14768
+ }, [displayMode, height, postToApp]);
13961
14769
  React37.useEffect(() => {
13962
14770
  const handleMessage = async (event) => {
13963
14771
  if (event.source !== iframeRef.current?.contentWindow) {
13964
14772
  return;
13965
14773
  }
14774
+ if (sandboxProxy && event.origin !== sandboxProxy.origin) {
14775
+ return;
14776
+ }
13966
14777
  const request = normalizeJsonRpcMessage(event.data);
13967
14778
  if (!request?.method) {
13968
14779
  return;
13969
14780
  }
14781
+ if (request.method === "ui/notifications/sandbox-proxy-ready" && sandboxProxy && srcDoc) {
14782
+ const permissions = resource?.permissions ?? data.permissions;
14783
+ const csp = resource?.csp ?? data.csp;
14784
+ postToApp({
14785
+ jsonrpc: "2.0",
14786
+ method: "ui/notifications/sandbox-resource-ready",
14787
+ params: {
14788
+ html: srcDoc,
14789
+ sandbox: buildMcpAppInnerSandbox(sandboxProxy.dedicatedOrigin),
14790
+ ...csp ? { csp } : {},
14791
+ ...permissions ? { permissions } : {}
14792
+ }
14793
+ });
14794
+ return;
14795
+ }
13970
14796
  if (request.method === "ui/notifications/initialized") {
13971
14797
  initializedRef.current = true;
13972
14798
  sendInitialToolNotifications();
@@ -13979,6 +14805,39 @@ function McpAppMessage({
13979
14805
  }
13980
14806
  return;
13981
14807
  }
14808
+ if (request.method === "ui/notifications/request-teardown") {
14809
+ if (teardownStartedRef.current) {
14810
+ return;
14811
+ }
14812
+ teardownStartedRef.current = true;
14813
+ postToApp({
14814
+ jsonrpc: "2.0",
14815
+ id: `xpert-teardown-${data.appInstanceId}`,
14816
+ method: "ui/resource-teardown",
14817
+ params: { reason: "app-requested" }
14818
+ });
14819
+ const query = buildMcpAppReviveQuery(data, {
14820
+ appInstanceToken: runtimeAppInstanceTokenRef.current,
14821
+ messageId
14822
+ });
14823
+ const approval = pendingApprovalRef.current;
14824
+ try {
14825
+ if (approval) {
14826
+ await client.mcp.apps.reject(
14827
+ data.appInstanceId,
14828
+ approval.approvalId,
14829
+ query
14830
+ );
14831
+ }
14832
+ await client.mcp.apps.teardown(data.appInstanceId, query);
14833
+ clearPendingApproval();
14834
+ setIsTornDown(true);
14835
+ } catch (teardownError) {
14836
+ teardownStartedRef.current = false;
14837
+ setError(getErrorMessage(teardownError));
14838
+ }
14839
+ return;
14840
+ }
13982
14841
  if (request.method === "ui/initialize") {
13983
14842
  initializedRef.current = true;
13984
14843
  const permissions = resource?.permissions ?? data.permissions;
@@ -14002,7 +14861,11 @@ function McpAppMessage({
14002
14861
  openLinks: {},
14003
14862
  logging: {},
14004
14863
  message: {
14005
- text: {}
14864
+ text: {},
14865
+ image: {},
14866
+ audio: {},
14867
+ resource: {},
14868
+ resourceLink: {}
14006
14869
  },
14007
14870
  updateModelContext: {
14008
14871
  text: {},
@@ -14011,29 +14874,33 @@ function McpAppMessage({
14011
14874
  sandbox: {
14012
14875
  ...permissions ? { permissions } : {},
14013
14876
  ...csp ? { csp } : {}
14014
- }
14877
+ },
14878
+ downloadFile: {}
14015
14879
  },
14016
14880
  hostContext: {
14017
14881
  toolInfo,
14018
14882
  theme: theme.mode,
14883
+ styles: {
14884
+ variables: theme.cssVariables
14885
+ },
14019
14886
  themeCssVariables: theme.cssVariables,
14020
14887
  locale: hostLocale,
14021
14888
  language: hostLanguage,
14022
14889
  direction: hostDirection,
14023
14890
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
14024
- displayMode: "inline",
14025
- availableDisplayModes: ["inline"],
14891
+ displayMode,
14892
+ availableDisplayModes: ["inline", "fullscreen", "pip"],
14026
14893
  containerDimensions: getContainerDimensions(containerRef.current),
14027
14894
  userAgent: "xpert-chatkit",
14028
14895
  platform: "web",
14029
14896
  deviceCapabilities: {
14030
14897
  touch: navigator.maxTouchPoints > 0,
14031
- hover: window.matchMedia("(hover: hover)").matches
14898
+ hover: typeof window.matchMedia === "function" ? window.matchMedia("(hover: hover)").matches : false
14032
14899
  }
14033
14900
  },
14034
14901
  // Legacy compatibility for apps written before the 2026-01-26 result shape.
14035
14902
  capabilities: {
14036
- displayModes: ["inline"],
14903
+ displayModes: ["inline", "fullscreen", "pip"],
14037
14904
  serverTools: true,
14038
14905
  serverResources: true,
14039
14906
  openLinks: true
@@ -14046,8 +14913,8 @@ function McpAppMessage({
14046
14913
  language: hostLanguage,
14047
14914
  direction: hostDirection,
14048
14915
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
14049
- displayMode: "inline",
14050
- availableDisplayModes: ["inline"],
14916
+ displayMode,
14917
+ availableDisplayModes: ["inline", "fullscreen", "pip"],
14051
14918
  containerDimensions: getContainerDimensions(containerRef.current),
14052
14919
  userAgent: navigator.userAgent,
14053
14920
  platform: navigator.platform
@@ -14059,20 +14926,33 @@ function McpAppMessage({
14059
14926
  }
14060
14927
  if (request.method === "ui/open-link") {
14061
14928
  const href = isRecord5(request.params) && typeof request.params.url === "string" ? request.params.url : isRecord5(request.params) && typeof request.params.href === "string" ? request.params.href : null;
14062
- if (href && isHttpUrl(href)) {
14063
- window.open(href, "_blank", "noopener,noreferrer");
14929
+ if (!href || !isHttpUrl2(href)) {
14064
14930
  if (request.id !== void 0) {
14065
- postToApp(jsonRpcResult(request.id, {}));
14931
+ postToApp(jsonRpcError(request.id, "Invalid URL"));
14932
+ }
14933
+ return;
14934
+ }
14935
+ try {
14936
+ const response = await callHostRpc({
14937
+ ...request,
14938
+ params: { url: href }
14939
+ });
14940
+ if (isMcpAppRpcSuccess(response)) {
14941
+ window.open(href, "_blank", "noopener,noreferrer");
14066
14942
  }
14067
- } else if (request.id !== void 0) {
14068
- postToApp(jsonRpcResult(request.id, { isError: true }));
14943
+ postToApp(response);
14944
+ } catch (linkError) {
14945
+ postToApp(jsonRpcError(request.id, getErrorMessage(linkError)));
14069
14946
  }
14070
14947
  return;
14071
14948
  }
14072
14949
  if (request.method === "ui/update-model-context") {
14073
- modelContextRef.current = request.params;
14074
14950
  try {
14075
- postToApp(await callHostRpc(request));
14951
+ const response = await callHostRpc(request);
14952
+ if (isMcpAppRpcSuccess(response)) {
14953
+ modelContextRef.current = request.params;
14954
+ }
14955
+ postToApp(response);
14076
14956
  } catch (rpcError) {
14077
14957
  postToApp(jsonRpcError(request.id, getErrorMessage(rpcError)));
14078
14958
  }
@@ -14090,14 +14970,12 @@ function McpAppMessage({
14090
14970
  postToApp(hostResponse);
14091
14971
  return;
14092
14972
  }
14093
- const inputText = contentBlocksToText(request.params.content);
14094
- if (!inputText) {
14095
- throw new Error("ui/message content did not include text");
14096
- }
14973
+ const messageInput = contentBlocksToChatInput(request.params.content);
14097
14974
  await submit(
14098
14975
  {
14099
14976
  input: {
14100
- input: inputText
14977
+ input: messageInput.input,
14978
+ ...messageInput.files.length ? { files: messageInput.files } : {}
14101
14979
  }
14102
14980
  },
14103
14981
  {
@@ -14122,11 +15000,7 @@ function McpAppMessage({
14122
15000
  if (request.id === void 0 && request.method.startsWith("ui/")) {
14123
15001
  return;
14124
15002
  }
14125
- try {
14126
- postToApp(await callHostRpc(request));
14127
- } catch (rpcError) {
14128
- postToApp(jsonRpcError(request.id, getErrorMessage(rpcError)));
14129
- }
15003
+ await dispatchHostRpc(request);
14130
15004
  };
14131
15005
  window.addEventListener("message", handleMessage);
14132
15006
  return () => {
@@ -14134,19 +15008,20 @@ function McpAppMessage({
14134
15008
  };
14135
15009
  }, [
14136
15010
  callHostRpc,
14137
- data.appInstanceId,
14138
- data.csp,
14139
- data.permissions,
14140
- data.resourceUri,
14141
- data.title,
14142
- data.toolCallId,
14143
- data.toolName,
15011
+ clearPendingApproval,
15012
+ client,
15013
+ data,
15014
+ dispatchHostRpc,
15015
+ displayMode,
14144
15016
  i18n2.language,
15017
+ messageId,
14145
15018
  postToApp,
14146
15019
  resource?.csp,
14147
15020
  resource?.permissions,
14148
15021
  resource?.toolInfo,
15022
+ sandboxProxy,
14149
15023
  sendInitialToolNotifications,
15024
+ srcDoc,
14150
15025
  streamIsLoading,
14151
15026
  submit
14152
15027
  ]);
@@ -14155,7 +15030,7 @@ function McpAppMessage({
14155
15030
  () => buildIframeAllow(iframePermissions),
14156
15031
  [iframePermissions]
14157
15032
  );
14158
- const sandbox = React37.useMemo(() => buildSandboxAttribute(), []);
15033
+ const sandbox = sandboxProxy ? "allow-scripts allow-same-origin" : buildSandboxAttribute();
14159
15034
  const prefersBorder = resource?.prefersBorder ?? data.prefersBorder ?? true;
14160
15035
  const displayTitle = resolveLocalizedText3(resource?.title ?? data.title, i18n2.language) ?? data.toolName;
14161
15036
  const displayDescription = resolveLocalizedText3(
@@ -14163,56 +15038,212 @@ function McpAppMessage({
14163
15038
  i18n2.language
14164
15039
  );
14165
15040
  const displayIcon = resource?.icon ?? data.icon;
14166
- return /* @__PURE__ */ jsxs29(
14167
- "div",
14168
- {
14169
- ref: containerRef,
14170
- className: cn(
14171
- "overflow-hidden rounded-lg border bg-background shadow-sm",
14172
- !prefersBorder && "border-transparent shadow-none",
14173
- className
14174
- ),
14175
- children: [
14176
- /* @__PURE__ */ jsxs29("div", { className: "flex min-h-10 items-center justify-between gap-3 border-b px-3 py-2", children: [
14177
- /* @__PURE__ */ jsxs29("div", { className: "flex min-w-0 items-center gap-2", children: [
14178
- displayIcon ? /* @__PURE__ */ jsx43(
14179
- IconDefinitionRenderer,
14180
- {
14181
- icon: displayIcon,
14182
- size: 18,
14183
- className: "shrink-0",
14184
- decorative: true
14185
- }
14186
- ) : null,
14187
- /* @__PURE__ */ jsxs29("div", { className: "min-w-0", children: [
14188
- /* @__PURE__ */ jsx43("div", { className: "truncate text-sm font-medium", children: displayTitle }),
14189
- /* @__PURE__ */ jsx43("div", { className: "truncate text-[11px] text-muted-foreground", children: displayDescription ?? data.resourceUri })
15041
+ const elevatedDisplayMode = displayMode !== "inline";
15042
+ if (isTornDown) {
15043
+ return null;
15044
+ }
15045
+ return /* @__PURE__ */ jsxs29(Fragment8, { children: [
15046
+ displayMode === "fullscreen" ? /* @__PURE__ */ jsx43(
15047
+ "div",
15048
+ {
15049
+ "aria-hidden": "true",
15050
+ className: "fixed inset-0 z-[79] bg-background/80 backdrop-blur-sm"
15051
+ }
15052
+ ) : null,
15053
+ /* @__PURE__ */ jsxs29(
15054
+ "div",
15055
+ {
15056
+ ref: containerRef,
15057
+ "data-display-mode": displayMode,
15058
+ className: cn(
15059
+ "relative flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm",
15060
+ displayMode === "fullscreen" && "fixed inset-4 z-[80] shadow-2xl",
15061
+ displayMode === "pip" && "fixed right-4 bottom-4 z-[80] h-[min(640px,calc(100vh-2rem))] w-[min(480px,calc(100vw-2rem))] shadow-2xl",
15062
+ !prefersBorder && "border-transparent shadow-none",
15063
+ className
15064
+ ),
15065
+ children: [
15066
+ /* @__PURE__ */ jsxs29("div", { className: "flex min-h-10 items-center justify-between gap-3 border-b px-3 py-2", children: [
15067
+ /* @__PURE__ */ jsxs29("div", { className: "flex min-w-0 items-center gap-2", children: [
15068
+ displayIcon ? /* @__PURE__ */ jsx43(
15069
+ IconDefinitionRenderer,
15070
+ {
15071
+ icon: displayIcon,
15072
+ size: 18,
15073
+ className: "shrink-0",
15074
+ decorative: true
15075
+ }
15076
+ ) : null,
15077
+ /* @__PURE__ */ jsxs29("div", { className: "min-w-0", children: [
15078
+ /* @__PURE__ */ jsx43("div", { className: "truncate text-sm font-medium", children: displayTitle }),
15079
+ /* @__PURE__ */ jsx43("div", { className: "truncate text-[11px] text-muted-foreground", children: displayDescription ?? data.resourceUri })
15080
+ ] })
15081
+ ] }),
15082
+ /* @__PURE__ */ jsxs29("div", { className: "flex shrink-0 items-center gap-1", children: [
15083
+ displayMode !== "fullscreen" ? /* @__PURE__ */ jsx43(
15084
+ Button,
15085
+ {
15086
+ type: "button",
15087
+ variant: "ghost",
15088
+ size: "icon-xs",
15089
+ title: i18n2.t("message.mcpApp.fullscreen"),
15090
+ "aria-label": i18n2.t("message.mcpApp.fullscreen"),
15091
+ onClick: () => setDisplayMode("fullscreen"),
15092
+ children: /* @__PURE__ */ jsx43(Maximize2, {})
15093
+ }
15094
+ ) : null,
15095
+ displayMode !== "pip" ? /* @__PURE__ */ jsx43(
15096
+ Button,
15097
+ {
15098
+ type: "button",
15099
+ variant: "ghost",
15100
+ size: "icon-xs",
15101
+ title: i18n2.t("message.mcpApp.pictureInPicture"),
15102
+ "aria-label": i18n2.t("message.mcpApp.pictureInPicture"),
15103
+ onClick: () => setDisplayMode("pip"),
15104
+ children: /* @__PURE__ */ jsx43(PictureInPicture2, {})
15105
+ }
15106
+ ) : null,
15107
+ elevatedDisplayMode ? /* @__PURE__ */ jsx43(
15108
+ Button,
15109
+ {
15110
+ type: "button",
15111
+ variant: "ghost",
15112
+ size: "icon-xs",
15113
+ title: i18n2.t("message.mcpApp.returnInline"),
15114
+ "aria-label": i18n2.t("message.mcpApp.returnInline"),
15115
+ onClick: () => setDisplayMode("inline"),
15116
+ children: /* @__PURE__ */ jsx43(Minimize2, {})
15117
+ }
15118
+ ) : null,
15119
+ /* @__PURE__ */ jsx43(Badge, { variant: "secondary", className: "ml-1 rounded-md", children: "MCP App" })
14190
15120
  ] })
14191
15121
  ] }),
14192
- /* @__PURE__ */ jsx43(Badge, { variant: "secondary", className: "shrink-0 rounded-md", children: "MCP App" })
14193
- ] }),
14194
- isLoading ? /* @__PURE__ */ jsxs29("div", { className: "flex h-40 items-center justify-center gap-2 text-sm text-muted-foreground", children: [
14195
- /* @__PURE__ */ jsx43(Loader28, { className: "h-4 w-4 animate-spin" }),
14196
- /* @__PURE__ */ jsx43("span", { children: i18n2.t("message.mcpApp.loading") })
14197
- ] }) : error ? /* @__PURE__ */ jsxs29("div", { className: "flex h-40 items-center justify-center gap-2 px-4 text-sm text-destructive", children: [
14198
- /* @__PURE__ */ jsx43(AlertCircle2, { className: "h-4 w-4 shrink-0" }),
14199
- /* @__PURE__ */ jsx43("span", { className: "min-w-0 break-words", children: error })
14200
- ] }) : srcDoc ? /* @__PURE__ */ jsx43(
14201
- "iframe",
14202
- {
14203
- ref: iframeRef,
14204
- title: displayTitle,
14205
- srcDoc,
14206
- className: "block w-full bg-background",
14207
- style: { height },
14208
- sandbox,
14209
- allow: iframeAllow,
14210
- referrerPolicy: "no-referrer"
14211
- }
14212
- ) : null
14213
- ]
14214
- }
14215
- );
15122
+ pendingApproval ? /* @__PURE__ */ jsx43(
15123
+ "div",
15124
+ {
15125
+ role: "alertdialog",
15126
+ "aria-modal": "true",
15127
+ "aria-labelledby": `mcp-app-approval-${pendingApproval.approvalId}`,
15128
+ className: "absolute inset-0 z-20 flex items-center justify-center bg-background/90 p-4 backdrop-blur-sm",
15129
+ children: /* @__PURE__ */ jsxs29("div", { className: "flex max-h-full w-full max-w-lg flex-col gap-4 overflow-hidden rounded-lg border bg-background p-4 shadow-xl", children: [
15130
+ /* @__PURE__ */ jsxs29("div", { className: "flex items-start gap-3", children: [
15131
+ /* @__PURE__ */ jsx43("div", { className: "rounded-full bg-destructive/10 p-2 text-destructive", children: /* @__PURE__ */ jsx43(ShieldAlert, { className: "size-5" }) }),
15132
+ /* @__PURE__ */ jsxs29("div", { className: "min-w-0 flex-1", children: [
15133
+ /* @__PURE__ */ jsxs29("div", { className: "flex flex-wrap items-center gap-2", children: [
15134
+ /* @__PURE__ */ jsx43(
15135
+ "h3",
15136
+ {
15137
+ id: `mcp-app-approval-${pendingApproval.approvalId}`,
15138
+ className: "text-sm font-semibold",
15139
+ children: i18n2.t("message.mcpApp.approvalTitle")
15140
+ }
15141
+ ),
15142
+ /* @__PURE__ */ jsx43(
15143
+ Badge,
15144
+ {
15145
+ variant: "outline",
15146
+ className: "border-destructive/40 text-destructive",
15147
+ children: pendingApproval.risk
15148
+ }
15149
+ )
15150
+ ] }),
15151
+ /* @__PURE__ */ jsx43("p", { className: "mt-1 text-xs text-muted-foreground", children: i18n2.t(
15152
+ pendingApproval.kind === "download" ? "message.mcpApp.downloadApprovalDescription" : "message.mcpApp.toolApprovalDescription",
15153
+ { tool: pendingApproval.toolName }
15154
+ ) })
15155
+ ] })
15156
+ ] }),
15157
+ /* @__PURE__ */ jsxs29("div", { className: "min-h-0", children: [
15158
+ /* @__PURE__ */ jsx43("div", { className: "mb-1 text-xs font-medium", children: i18n2.t("message.mcpApp.requestDetails") }),
15159
+ /* @__PURE__ */ jsx43("pre", { className: "max-h-48 overflow-auto rounded-md border bg-muted/40 p-3 text-[11px] leading-5 whitespace-pre-wrap break-all", children: pendingApproval.details })
15160
+ ] }),
15161
+ approvalError ? /* @__PURE__ */ jsxs29(
15162
+ "div",
15163
+ {
15164
+ role: "alert",
15165
+ className: "flex items-start gap-2 text-xs text-destructive",
15166
+ children: [
15167
+ /* @__PURE__ */ jsx43(AlertCircle2, { className: "mt-0.5 size-4 shrink-0" }),
15168
+ /* @__PURE__ */ jsx43("span", { children: approvalError })
15169
+ ]
15170
+ }
15171
+ ) : null,
15172
+ /* @__PURE__ */ jsxs29("div", { className: "flex justify-end gap-2", children: [
15173
+ /* @__PURE__ */ jsxs29(
15174
+ Button,
15175
+ {
15176
+ type: "button",
15177
+ variant: "outline",
15178
+ disabled: approvalAction !== null,
15179
+ onClick: () => void resolvePendingApproval("reject"),
15180
+ children: [
15181
+ approvalAction === "reject" ? /* @__PURE__ */ jsx43(Loader28, { className: "animate-spin" }) : null,
15182
+ i18n2.t("message.mcpApp.reject")
15183
+ ]
15184
+ }
15185
+ ),
15186
+ /* @__PURE__ */ jsxs29(
15187
+ Button,
15188
+ {
15189
+ type: "button",
15190
+ variant: pendingApproval.risk === "destructive" ? "destructive" : "default",
15191
+ disabled: approvalAction !== null,
15192
+ onClick: () => void resolvePendingApproval("approve"),
15193
+ children: [
15194
+ approvalAction === "approve" ? /* @__PURE__ */ jsx43(Loader28, { className: "animate-spin" }) : null,
15195
+ i18n2.t("message.mcpApp.approve")
15196
+ ]
15197
+ }
15198
+ )
15199
+ ] })
15200
+ ] })
15201
+ }
15202
+ ) : null,
15203
+ isLoading ? /* @__PURE__ */ jsxs29(
15204
+ "div",
15205
+ {
15206
+ className: cn(
15207
+ "flex h-40 items-center justify-center gap-2 text-sm text-muted-foreground",
15208
+ elevatedDisplayMode && "min-h-0 flex-1"
15209
+ ),
15210
+ children: [
15211
+ /* @__PURE__ */ jsx43(Loader28, { className: "h-4 w-4 animate-spin" }),
15212
+ /* @__PURE__ */ jsx43("span", { children: i18n2.t("message.mcpApp.loading") })
15213
+ ]
15214
+ }
15215
+ ) : error ? /* @__PURE__ */ jsxs29(
15216
+ "div",
15217
+ {
15218
+ className: cn(
15219
+ "flex h-40 items-center justify-center gap-2 px-4 text-sm text-destructive",
15220
+ elevatedDisplayMode && "min-h-0 flex-1"
15221
+ ),
15222
+ children: [
15223
+ /* @__PURE__ */ jsx43(AlertCircle2, { className: "h-4 w-4 shrink-0" }),
15224
+ /* @__PURE__ */ jsx43("span", { className: "min-w-0 break-words", children: error })
15225
+ ]
15226
+ }
15227
+ ) : srcDoc ? /* @__PURE__ */ jsx43(
15228
+ "iframe",
15229
+ {
15230
+ ref: bindIframeRef,
15231
+ title: displayTitle,
15232
+ ...sandboxProxy ? { src: sandboxProxy.url } : { srcDoc },
15233
+ className: cn(
15234
+ "block w-full bg-background",
15235
+ elevatedDisplayMode && "min-h-0 flex-1"
15236
+ ),
15237
+ style: elevatedDisplayMode ? void 0 : { height },
15238
+ sandbox,
15239
+ allow: iframeAllow,
15240
+ referrerPolicy: "no-referrer"
15241
+ }
15242
+ ) : null
15243
+ ]
15244
+ }
15245
+ )
15246
+ ] });
14216
15247
  }
14217
15248
 
14218
15249
  // src/components/thread/messages/ai.tsx
@@ -14500,7 +15531,14 @@ function renderContentItem(content, index, message, lookupMessages, options) {
14500
15531
  return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
14501
15532
  }
14502
15533
  if (isMcpAppComponent(content)) {
14503
- return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(McpAppMessage, { messageId, data: content.data }) }, content.id ?? `mcp-app-${index}`);
15534
+ return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(
15535
+ McpAppMessage,
15536
+ {
15537
+ messageId,
15538
+ data: content.data,
15539
+ mcpApps: options?.mcpApps
15540
+ }
15541
+ ) }, content.id ?? `mcp-app-${index}`);
14504
15542
  }
14505
15543
  if (getComponentMessagePresentation(content, getToolStepData(content)) === "grouped-step") {
14506
15544
  return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(
@@ -14530,7 +15568,8 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
14530
15568
  isThreadRunning: options?.isThreadRunning,
14531
15569
  organizationId: options?.organizationId,
14532
15570
  apiUrl: options?.apiUrl,
14533
- isAgentOutput: options?.isAgentOutput
15571
+ isAgentOutput: options?.isAgentOutput,
15572
+ mcpApps: options?.mcpApps
14534
15573
  });
14535
15574
  }
14536
15575
  return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(
@@ -14681,7 +15720,8 @@ function AssistantMessage({
14681
15720
  isThreadRunning,
14682
15721
  organizationId,
14683
15722
  apiUrl,
14684
- pet
15723
+ pet,
15724
+ mcpApps
14685
15725
  }) {
14686
15726
  const { t } = useChatkitTranslation();
14687
15727
  const renderTree = buildAssistantRenderTree(
@@ -14697,7 +15737,8 @@ function AssistantMessage({
14697
15737
  const answerNode = renderContent(message, lookupMessages, {
14698
15738
  isThreadRunning,
14699
15739
  organizationId,
14700
- apiUrl
15740
+ apiUrl,
15741
+ mcpApps
14701
15742
  });
14702
15743
  const reasoningNode = hasReasoning ? /* @__PURE__ */ jsx44(ReasoningBlock, { reasoning: rootReasoning ?? [] }) : null;
14703
15744
  if (!hasContent && !hasReasoning && !resolvedStreamingStatus) return null;
@@ -16962,13 +18003,13 @@ import {
16962
18003
  } from "@xpert-ai/xpert-sdk";
16963
18004
  import {
16964
18005
  Loader2 as Loader210,
16965
- Maximize2,
16966
- Minimize2,
18006
+ Maximize2 as Maximize22,
18007
+ Minimize2 as Minimize22,
16967
18008
  PanelRight,
16968
18009
  RotateCcw,
16969
18010
  X as X8
16970
18011
  } from "lucide-react";
16971
- import { Fragment as Fragment9, jsx as jsx57, jsxs as jsxs39 } from "react/jsx-runtime";
18012
+ import { Fragment as Fragment10, jsx as jsx57, jsxs as jsxs39 } from "react/jsx-runtime";
16972
18013
  var WorkbenchContext = React52.createContext({
16973
18014
  enabled: false,
16974
18015
  open: false,
@@ -18344,7 +19385,7 @@ function formatElapsed(value) {
18344
19385
  }
18345
19386
 
18346
19387
  // src/components/chat.tsx
18347
- import { Fragment as Fragment11, jsx as jsx60, jsxs as jsxs42 } from "react/jsx-runtime";
19388
+ import { Fragment as Fragment12, jsx as jsx60, jsxs as jsxs42 } from "react/jsx-runtime";
18348
19389
  var defaultApiUrl2 = import.meta.env.VITE_XPERTAI_API_URL;
18349
19390
  var COMPOSER_INPUT_MAX_HEIGHT = 128;
18350
19391
  var LONG_TEXT_REFERENCE_THRESHOLD = 5e3;
@@ -20472,7 +21513,7 @@ function Chat({
20472
21513
  ) }) }),
20473
21514
  /* @__PURE__ */ jsx60(TooltipContent, { side: "bottom", children: t("settings.open") })
20474
21515
  ] }),
20475
- history?.enabled !== false && /* @__PURE__ */ jsxs42(Fragment11, { children: [
21516
+ history?.enabled !== false && /* @__PURE__ */ jsxs42(Fragment12, { children: [
20476
21517
  /* @__PURE__ */ jsxs42(Tooltip, { children: [
20477
21518
  /* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx60("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx60(
20478
21519
  "button",
@@ -20649,9 +21690,10 @@ function Chat({
20649
21690
  isThreadRunning: currentThreadIsRunning,
20650
21691
  organizationId: stream.organizationId,
20651
21692
  apiUrl: stream.apiUrl,
20652
- pet: effectivePet
21693
+ pet: effectivePet,
21694
+ mcpApps: options?.mcpApps
20653
21695
  }
20654
- ) : /* @__PURE__ */ jsxs42(Fragment11, { children: [
21696
+ ) : /* @__PURE__ */ jsxs42(Fragment12, { children: [
20655
21697
  message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsx60(
20656
21698
  HumanRuntimeCapabilityChips,
20657
21699
  {