@xpert-ai/chatkit-ui 0.11.0 → 0.11.2

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 (344) hide show
  1. package/dist/app/assets/{CodeEditor-BMd8uMGB.js → CodeEditor-CkEfOT9Y.js} +1 -1
  2. package/dist/app/assets/{DocxEditor-hvscWnw3.js → DocxEditor-yTTKzj6U.js} +4 -4
  3. package/dist/app/assets/{FileChangeReview-B7VqQsRG.js → FileChangeReview-C7gyCK_j.js} +3 -3
  4. package/dist/app/assets/{PptxEditor-DcI05MK8.js → PptxEditor-BRsbM1NU.js} +3 -3
  5. package/dist/app/assets/{SpreadsheetEditor-Hb6fJwdq.js → SpreadsheetEditor-DeP_NBKx.js} +1 -1
  6. package/dist/app/assets/{UTIF-0ZuTiCmi.js → UTIF-Df_VEwu2.js} +1 -1
  7. package/dist/app/assets/{WorkbenchTerminal-B6mzbO1J.js → WorkbenchTerminal-CyU1b2ua.js} +1 -1
  8. package/dist/app/assets/{_baseUniq-zNCkWRMr.js → _baseUniq-BItsX9dZ.js} +1 -1
  9. package/dist/app/assets/{abap-FxzxrGv_.js → abap-CqbAP5VJ.js} +1 -1
  10. package/dist/app/assets/{abnf-D2EwS92z.js → abnf-chpMxV7i.js} +1 -1
  11. package/dist/app/assets/{actionscript-DIvGV2CG.js → actionscript-iDizYOyI.js} +1 -1
  12. package/dist/app/assets/{ada-CXudAkdO.js → ada-BwR_piCn.js} +1 -1
  13. package/dist/app/assets/{agda-CPKosats.js → agda-DItghU1v.js} +1 -1
  14. package/dist/app/assets/{al-AB79aqpn.js → al-Cn9iRklY.js} +1 -1
  15. package/dist/app/assets/{antlr4-D33lkC_v.js → antlr4-BHaybfLu.js} +1 -1
  16. package/dist/app/assets/{apacheconf-DGA1W1V0.js → apacheconf-7G1Isose.js} +1 -1
  17. package/dist/app/assets/{apex-DOMf3QQT.js → apex-B2q1-VZ0.js} +1 -1
  18. package/dist/app/assets/{apl-DIjPkMHh.js → apl-C_Bt1fXt.js} +1 -1
  19. package/dist/app/assets/{applescript-Tql-0emq.js → applescript-ClCAsCUD.js} +1 -1
  20. package/dist/app/assets/{aql-DnnhTsbR.js → aql-BHKh6tsA.js} +1 -1
  21. package/dist/app/assets/{arc-C3DyEbZE.js → arc-B1u5aHAj.js} +1 -1
  22. package/dist/app/assets/{architectureDiagram-Q4EWVU46-CM8SyLAE.js → architectureDiagram-Q4EWVU46-BwM5Ih-e.js} +1 -1
  23. package/dist/app/assets/{arduino-DCy67jnp.js → arduino-Cvs7MW6d.js} +1 -1
  24. package/dist/app/assets/{arff-ChjrA-MP.js → arff-BtQEt-w-.js} +1 -1
  25. package/dist/app/assets/{asciidoc-CtZoH7c-.js → asciidoc-BWsNKxsy.js} +1 -1
  26. package/dist/app/assets/{asm6502-BKzW1Pnl.js → asm6502-B3tFsA7S.js} +1 -1
  27. package/dist/app/assets/{asmatmel-Bk2fugE5.js → asmatmel-DMJIAcxu.js} +1 -1
  28. package/dist/app/assets/{aspnet-Co_luXPl.js → aspnet-BZjQxYxl.js} +1 -1
  29. package/dist/app/assets/{autohotkey-WrAoOh8o.js → autohotkey-CcncmCqi.js} +1 -1
  30. package/dist/app/assets/{autoit-f3t6GtB5.js → autoit-BK9NxDra.js} +1 -1
  31. package/dist/app/assets/{avisynth-wSIQUVWg.js → avisynth-DPzTZVZd.js} +1 -1
  32. package/dist/app/assets/{avro-idl-BkrpSKsz.js → avro-idl-C8vSamJL.js} +1 -1
  33. package/dist/app/assets/{bash-bVgzw1Yx.js → bash-BuICApby.js} +1 -1
  34. package/dist/app/assets/{basic-BNXe4Ydo.js → basic-CNU-aVUM.js} +1 -1
  35. package/dist/app/assets/{batch-CB4G1LnU.js → batch-Dh0g3bad.js} +1 -1
  36. package/dist/app/assets/{bbcode-DxDWYiQ7.js → bbcode-BMnS1Ogt.js} +1 -1
  37. package/dist/app/assets/{bicep-oVPIz-U_.js → bicep-Dr2QNZIE.js} +1 -1
  38. package/dist/app/assets/{birb-B2qIZ0Q3.js → birb-BBpAn9_Z.js} +1 -1
  39. package/dist/app/assets/{bison-ZnRkUusp.js → bison-DyCzjhCr.js} +1 -1
  40. package/dist/app/assets/{blockDiagram-DXYQGD6D-IGvs0ReR.js → blockDiagram-DXYQGD6D-Da4FDDlD.js} +1 -1
  41. package/dist/app/assets/{bnf-BGvR1KgO.js → bnf-BjCmHNl7.js} +1 -1
  42. package/dist/app/assets/{brainfuck-BHWevSod.js → brainfuck-D_ad5ykV.js} +1 -1
  43. package/dist/app/assets/{brightscript-BMNxpOzO.js → brightscript-BOuFomnC.js} +1 -1
  44. package/dist/app/assets/{bro-Cy9xesxi.js → bro-bwbGAIPn.js} +1 -1
  45. package/dist/app/assets/{bsl-BGUzfBpl.js → bsl-Cd0OZu50.js} +1 -1
  46. package/dist/app/assets/{c-DXwSYCfZ.js → c-C4qH8P7e.js} +1 -1
  47. package/dist/app/assets/{c4Diagram-AHTNJAMY-DavZ5kER.js → c4Diagram-AHTNJAMY-Dt-tX7hp.js} +1 -1
  48. package/dist/app/assets/{cfscript-EVB8CcgT.js → cfscript-BtLuAap6.js} +1 -1
  49. package/dist/app/assets/{chaiscript-gMZkcA9A.js → chaiscript-DfhI4vFK.js} +1 -1
  50. package/dist/app/assets/channel-CwNVZCQ4.js +1 -0
  51. package/dist/app/assets/{chunk-4BX2VUAB-C_C-m_br.js → chunk-4BX2VUAB-DErkZghS.js} +1 -1
  52. package/dist/app/assets/{chunk-4TB4RGXK-CMVYK06B.js → chunk-4TB4RGXK-9syV4RA8.js} +1 -1
  53. package/dist/app/assets/{chunk-55IACEB6-0kwMzVtH.js → chunk-55IACEB6-CkYTIvmQ.js} +1 -1
  54. package/dist/app/assets/{chunk-EDXVE4YY-C4_HNDvP.js → chunk-EDXVE4YY-w1lS6MjE.js} +1 -1
  55. package/dist/app/assets/{chunk-FMBD7UC4-XQBzbmTs.js → chunk-FMBD7UC4-CQae_nTG.js} +1 -1
  56. package/dist/app/assets/{chunk-OYMX7WX6-BhW-fjK3.js → chunk-OYMX7WX6-DQPwcOqP.js} +1 -1
  57. package/dist/app/assets/{chunk-QZHKN3VN-CUJJGTFt.js → chunk-QZHKN3VN-CUPf69en.js} +1 -1
  58. package/dist/app/assets/{chunk-YZCP3GAM-B1dvKRQu.js → chunk-YZCP3GAM-DZ2w0Uo6.js} +1 -1
  59. package/dist/app/assets/{cil-DhzXB_r0.js → cil-BA-UuYDm.js} +1 -1
  60. package/dist/app/assets/classDiagram-6PBFFD2Q-BfUAwFzn.js +1 -0
  61. package/dist/app/assets/classDiagram-v2-HSJHXN6E-BfUAwFzn.js +1 -0
  62. package/dist/app/assets/{clike-Bp8whLVh.js → clike-CkrJIoXf.js} +1 -1
  63. package/dist/app/assets/{clojure-DS2n7X9D.js → clojure-De7zisG7.js} +1 -1
  64. package/dist/app/assets/clone-DmP83D3u.js +1 -0
  65. package/dist/app/assets/{cmake-C1nCIHl1.js → cmake-Dtpiq6V_.js} +1 -1
  66. package/dist/app/assets/{cobol-D-aVthhQ.js → cobol-DlKH8b_d.js} +1 -1
  67. package/dist/app/assets/{coffeescript-BiyiruO-.js → coffeescript-C20eNRop.js} +1 -1
  68. package/dist/app/assets/{concurnas-BRqgzWKh.js → concurnas-CkwZbl3G.js} +1 -1
  69. package/dist/app/assets/{coq-Dx6r_1E-.js → coq-BJqm-Vwq.js} +1 -1
  70. package/dist/app/assets/{core-B9Ndd9Sb.js → core-BeYgHLnP.js} +1 -1
  71. package/dist/app/assets/{cose-bilkent-S5V4N54A-BIV35Ny_.js → cose-bilkent-S5V4N54A-ZQRpbJ-9.js} +1 -1
  72. package/dist/app/assets/{cpp-BNAevxHX.js → cpp-CCK-QhpZ.js} +1 -1
  73. package/dist/app/assets/{crystal-C69D8bsr.js → crystal-D1WMkcyR.js} +1 -1
  74. package/dist/app/assets/{csharp-DMD3WU2G.js → csharp-CeaNoGzT.js} +1 -1
  75. package/dist/app/assets/{cshtml-CJzbtnPi.js → cshtml-COTvhMwv.js} +1 -1
  76. package/dist/app/assets/{csp-CTYsC3im.js → csp-Dtt7oi-z.js} +1 -1
  77. package/dist/app/assets/{css-4wm7kjkC.js → css-A1NYvfcV.js} +1 -1
  78. package/dist/app/assets/{css-extras-BgRI9psb.js → css-extras-DSsOd8f_.js} +1 -1
  79. package/dist/app/assets/{csv-DSLo0eXd.js → csv-BrdkiUQb.js} +1 -1
  80. package/dist/app/assets/{cypher-B0bKnH-a.js → cypher-MWVOm8yN.js} +1 -1
  81. package/dist/app/assets/{d-CiBfx57T.js → d-BpOrYr7d.js} +1 -1
  82. package/dist/app/assets/{dagre-KV5264BT-t8MgsKTV.js → dagre-KV5264BT-BrSuD7-U.js} +1 -1
  83. package/dist/app/assets/{dart-Cb7rlZ2e.js → dart-C0GBSKHy.js} +1 -1
  84. package/dist/app/assets/{dataweave-D1owu29v.js → dataweave-BaRmBwDh.js} +1 -1
  85. package/dist/app/assets/{dax-BF9Ir7-J.js → dax-D9knB6HK.js} +1 -1
  86. package/dist/app/assets/{dhall-BnQ8k0M9.js → dhall-CRtWuM7k.js} +1 -1
  87. package/dist/app/assets/{diagram-5BDNPKRD-BDWynrjl.js → diagram-5BDNPKRD-Dg_BPUr3.js} +1 -1
  88. package/dist/app/assets/{diagram-G4DWMVQ6-MAE_lQOE.js → diagram-G4DWMVQ6-CuNG3uS8.js} +1 -1
  89. package/dist/app/assets/{diagram-MMDJMWI5-IHJtjsaw.js → diagram-MMDJMWI5-gyjqG3UJ.js} +1 -1
  90. package/dist/app/assets/{diagram-TYMM5635-Vd0KV2Dg.js → diagram-TYMM5635-BOBArauA.js} +1 -1
  91. package/dist/app/assets/{diff-BNRQhA_b.js → diff-1jXFAE9-.js} +1 -1
  92. package/dist/app/assets/{dist-PKZR6RSH-CLGtZTqg.js → dist-PKZR6RSH-CihMZwfS.js} +1 -1
  93. package/dist/app/assets/{django-zsC7SSCl.js → django-B8Fvwagw.js} +1 -1
  94. package/dist/app/assets/{dns-zone-file-C3IhsU8v.js → dns-zone-file-eYrA3DMk.js} +1 -1
  95. package/dist/app/assets/{docker-JEH9Kikw.js → docker-DcwG3M3S.js} +1 -1
  96. package/dist/app/assets/{dot-C7urzMKu.js → dot-7LgW6Pxt.js} +1 -1
  97. package/dist/app/assets/{ebnf-BMx_o1k8.js → ebnf-BIBhxWki.js} +1 -1
  98. package/dist/app/assets/{editorconfig-CW9m_PZG.js → editorconfig-aS9yZiII.js} +1 -1
  99. package/dist/app/assets/{eiffel-441GzAvA.js → eiffel-CbtB_wg4.js} +1 -1
  100. package/dist/app/assets/{ejs-DHcmqbA6.js → ejs-CAyJOUgz.js} +1 -1
  101. package/dist/app/assets/{elixir-CZtkyA_h.js → elixir-CJTRbv1S.js} +1 -1
  102. package/dist/app/assets/{elm-ChJkcckU.js → elm-rs-d6fza.js} +1 -1
  103. package/dist/app/assets/{erDiagram-SMLLAGMA-D1dwPtMQ.js → erDiagram-SMLLAGMA-cwYzboAh.js} +1 -1
  104. package/dist/app/assets/{erb-BdooSGIB.js → erb-CUzxl3q1.js} +1 -1
  105. package/dist/app/assets/{erlang-Ds-OZylg.js → erlang-B9-MMmZw.js} +1 -1
  106. package/dist/app/assets/{etlua-BEY70xf6.js → etlua-BolNWEL6.js} +1 -1
  107. package/dist/app/assets/{excel-formula-DsTqG-tz.js → excel-formula-Dgpq9kjo.js} +1 -1
  108. package/dist/app/assets/{factor-DdV038qZ.js → factor-BWuJXGFq.js} +1 -1
  109. package/dist/app/assets/{false-DzLciyDd.js → false-D-oTDaaL.js} +1 -1
  110. package/dist/app/assets/{firestore-security-rules-DdFk1xxf.js → firestore-security-rules-BraxdQEs.js} +1 -1
  111. package/dist/app/assets/{flow-DnXddxaF.js → flow-BPYSMfYG.js} +1 -1
  112. package/dist/app/assets/{flowDiagram-DWJPFMVM-CMl61c9m.js → flowDiagram-DWJPFMVM-DgzkJClR.js} +1 -1
  113. package/dist/app/assets/{fortran-DosDnVNK.js → fortran-T_iQIE2B.js} +1 -1
  114. package/dist/app/assets/{fsharp-Wz_WfWqS.js → fsharp-DqD5OmJK.js} +1 -1
  115. package/dist/app/assets/{ftl-TeerKn0Z.js → ftl-BovgQIrB.js} +1 -1
  116. package/dist/app/assets/{ganttDiagram-T4ZO3ILL-BeB_sCH7.js → ganttDiagram-T4ZO3ILL-CBzD8A0w.js} +1 -1
  117. package/dist/app/assets/{gap-BCKVBhy2.js → gap-85TS250G.js} +1 -1
  118. package/dist/app/assets/{gcode-CVLqDAV3.js → gcode-BW6Qk-5-.js} +1 -1
  119. package/dist/app/assets/{gdscript-Md3Pew6i.js → gdscript-CLxmTRf5.js} +1 -1
  120. package/dist/app/assets/{gedcom-vq4c5Mhz.js → gedcom-Cb7Ao7zc.js} +1 -1
  121. package/dist/app/assets/{gherkin-DLMAVDHb.js → gherkin-BJuAxsMs.js} +1 -1
  122. package/dist/app/assets/{git-Ddppbzmg.js → git-C2pBzbsu.js} +1 -1
  123. package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-KMhChbCu.js → gitGraphDiagram-UUTBAWPF-_tqBjJON.js} +1 -1
  124. package/dist/app/assets/{glsl-BA_4Uw6h.js → glsl-CC9Lx2uz.js} +1 -1
  125. package/dist/app/assets/{gml-C8mWZW1o.js → gml-Cb4YXigx.js} +1 -1
  126. package/dist/app/assets/{gn-91bO-la4.js → gn-kQb5aGb5.js} +1 -1
  127. package/dist/app/assets/{go-CvRVEV_l.js → go-DNAlVb2O.js} +1 -1
  128. package/dist/app/assets/{go-module-_Icv0nZv.js → go-module-C_VDBUP4.js} +1 -1
  129. package/dist/app/assets/{graph-DUSo9Sje.js → graph-RvCEEoBA.js} +1 -1
  130. package/dist/app/assets/{graphql-BW8LUdqC.js → graphql-W05aJ9xQ.js} +1 -1
  131. package/dist/app/assets/{groovy-ywYXeaQB.js → groovy-DHhMsfeb.js} +1 -1
  132. package/dist/app/assets/{haml-CSzhwz9e.js → haml-D-E4bZH-.js} +1 -1
  133. package/dist/app/assets/{handlebars-CTU4xa_2.js → handlebars-CscBBTqv.js} +1 -1
  134. package/dist/app/assets/{haskell-COx8jem2.js → haskell-zlEk3XCa.js} +1 -1
  135. package/dist/app/assets/{haxe-4IhqmVsu.js → haxe-DStWUlo8.js} +1 -1
  136. package/dist/app/assets/{hcl-DL1FUuBN.js → hcl-Cz7FUhgX.js} +1 -1
  137. package/dist/app/assets/{hlsl-CRyhDjW0.js → hlsl-C_iG3tnK.js} +1 -1
  138. package/dist/app/assets/{hoon-D8rd1Z96.js → hoon-CP_MZxgs.js} +1 -1
  139. package/dist/app/assets/{hpkp-C-9xmxq3.js → hpkp-ex07fbEj.js} +1 -1
  140. package/dist/app/assets/{hsts-CdisgsQe.js → hsts-BPQ_l1UN.js} +1 -1
  141. package/dist/app/assets/{http-D6DbkYMj.js → http-OrRAX_xg.js} +1 -1
  142. package/dist/app/assets/{ichigojam-DhDIPquW.js → ichigojam-_EHo3Vus.js} +1 -1
  143. package/dist/app/assets/{icon-DCWiFL2p.js → icon-D--jckSQ.js} +1 -1
  144. package/dist/app/assets/{icu-message-format-qlzAVFtk.js → icu-message-format-BLzJeT5b.js} +1 -1
  145. package/dist/app/assets/{idris-CuifC-Ea.js → idris-m5bn3p8K.js} +1 -1
  146. package/dist/app/assets/{iecst-DZTSS_Mx.js → iecst-C3iDlseF.js} +1 -1
  147. package/dist/app/assets/{ignore-HIsAm8c8.js → ignore-jQg1pBvx.js} +1 -1
  148. package/dist/app/assets/{index-D0YKTBe8.js → index-zFXf25RZ.js} +189 -189
  149. package/dist/app/assets/{infoDiagram-42DDH7IO-XzzxMfvC.js → infoDiagram-42DDH7IO-Co6iBt5T.js} +1 -1
  150. package/dist/app/assets/{inform7-CiVe6C4f.js → inform7-D5m58Y4T.js} +1 -1
  151. package/dist/app/assets/{ini-DbnIcvok.js → ini-U99GmdZD.js} +1 -1
  152. package/dist/app/assets/{io-BDrIfcxa.js → io-3ii9gOuT.js} +1 -1
  153. package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-D9s4eo9i.js → ishikawaDiagram-UXIWVN3A-4dAZpmVu.js} +1 -1
  154. package/dist/app/assets/{j-BGt4pQcu.js → j-DeoVcD4r.js} +1 -1
  155. package/dist/app/assets/{java-CHPYmuYh.js → java-DhS74ZiS.js} +1 -1
  156. package/dist/app/assets/{javadoc-BDYK__NB.js → javadoc-D_UUB6dm.js} +1 -1
  157. package/dist/app/assets/{javadoclike-D6NiEMXI.js → javadoclike-BoEjGF-R.js} +1 -1
  158. package/dist/app/assets/{javascript-qytty7K5.js → javascript-p3NQWzRq.js} +1 -1
  159. package/dist/app/assets/{javastacktrace-X-IcFPNl.js → javastacktrace-D4FIcAET.js} +1 -1
  160. package/dist/app/assets/{jexl-ByKXqTel.js → jexl-DmvRiAUk.js} +1 -1
  161. package/dist/app/assets/{jolie-TvvsyTgo.js → jolie-B0b5yOXD.js} +1 -1
  162. package/dist/app/assets/{journeyDiagram-VCZTEJTY-CNdVUup1.js → journeyDiagram-VCZTEJTY-Bor603I6.js} +1 -1
  163. package/dist/app/assets/{jq-BlWlwz2r.js → jq-DBpc5y5q.js} +1 -1
  164. package/dist/app/assets/{js-extras-iKDTA1qk.js → js-extras-BitHRC94.js} +1 -1
  165. package/dist/app/assets/{js-templates-CZgxIp76.js → js-templates-bAbwg7K4.js} +1 -1
  166. package/dist/app/assets/{jsdoc-Mosrl0Yy.js → jsdoc-CHov7UEh.js} +1 -1
  167. package/dist/app/assets/{json-Dg8fLZwo.js → json-B-UgUOcv.js} +1 -1
  168. package/dist/app/assets/{json5-CBfBGp9T.js → json5-CCSh4M_u.js} +1 -1
  169. package/dist/app/assets/{jsonp-BG40RAdB.js → jsonp-2gpJDalc.js} +1 -1
  170. package/dist/app/assets/{jsstacktrace-CipEiBvr.js → jsstacktrace-YhInxKZX.js} +1 -1
  171. package/dist/app/assets/{jsx-ymh1q22x.js → jsx-D1UpiF2P.js} +1 -1
  172. package/dist/app/assets/{jszip.min-DSgmDoy9.js → jszip.min-Dt-AHYC0.js} +1 -1
  173. package/dist/app/assets/{julia-vnOiDr5f.js → julia-CyjWo2i8.js} +1 -1
  174. package/dist/app/assets/{kanban-definition-6JOO6SKY-MGGBnrXG.js → kanban-definition-6JOO6SKY-U-hYiLA-.js} +1 -1
  175. package/dist/app/assets/{keepalived-hb8WtW0H.js → keepalived-BYriwcGy.js} +1 -1
  176. package/dist/app/assets/{keyman-DUm3IQsC.js → keyman-34br4hCO.js} +1 -1
  177. package/dist/app/assets/{kotlin-CdURhZiu.js → kotlin-Bkqpta0R.js} +1 -1
  178. package/dist/app/assets/{kumir-BjnIsauc.js → kumir-DWXuCeXz.js} +1 -1
  179. package/dist/app/assets/{kusto-DL2yehMT.js → kusto-0O4e57D9.js} +1 -1
  180. package/dist/app/assets/{latex-Dug78S0w.js → latex-CMlF4dEe.js} +1 -1
  181. package/dist/app/assets/{latte-BScBfZxd.js → latte-D1e6h-zD.js} +1 -1
  182. package/dist/app/assets/{layout-gq0zpE_E.js → layout-eGBUxe5W.js} +1 -1
  183. package/dist/app/assets/{less-BLwwHp2U.js → less-C13T9UPd.js} +1 -1
  184. package/dist/app/assets/{lilypond-9n9xTIJ4.js → lilypond-Dn5zAXrr.js} +1 -1
  185. package/dist/app/assets/{linear-DJDekCN_.js → linear-DgFEqEXs.js} +1 -1
  186. package/dist/app/assets/{liquid-BbVeJmK_.js → liquid-C-Pt_Vny.js} +1 -1
  187. package/dist/app/assets/{lisp-CFSGFBAA.js → lisp-BO5glOUn.js} +1 -1
  188. package/dist/app/assets/{livescript-Cat7VUY0.js → livescript-Dd6zEmXh.js} +1 -1
  189. package/dist/app/assets/{llvm-BZY36CvO.js → llvm-CYjba539.js} +1 -1
  190. package/dist/app/assets/{log-Z7bD7Dm2.js → log-a0wt7bko.js} +1 -1
  191. package/dist/app/assets/{lolcode-BcdEaoXf.js → lolcode-0JFVhyfh.js} +1 -1
  192. package/dist/app/assets/{lua-CIMWuOWn.js → lua-DRO0x4Co.js} +1 -1
  193. package/dist/app/assets/{magma-BFW4G9Ie.js → magma-bkMcN84t.js} +1 -1
  194. package/dist/app/assets/{makefile-6wOxKuUZ.js → makefile-CsXB54hy.js} +1 -1
  195. package/dist/app/assets/{markdown-B6JNRyIW.js → markdown-Ca3OokvM.js} +1 -1
  196. package/dist/app/assets/{markup-ClXJVXkw.js → markup-C11HSQJl.js} +1 -1
  197. package/dist/app/assets/{markup-templating-CJ-wLX4_.js → markup-templating-CWaNNuuv.js} +1 -1
  198. package/dist/app/assets/{matlab-D_niiE2O.js → matlab-BHxkh0cK.js} +1 -1
  199. package/dist/app/assets/{maxscript-pus5rJ_0.js → maxscript-CenV4s5A.js} +1 -1
  200. package/dist/app/assets/{mel-ZdRcVFP0.js → mel-D5b9wd9J.js} +1 -1
  201. package/dist/app/assets/{mermaid-BDnR9Ohc.js → mermaid-DpwUW522.js} +1 -1
  202. package/dist/app/assets/{min-BbOq_n6W.js → min-ZXeeloXH.js} +1 -1
  203. package/dist/app/assets/{mindmap-definition-QFDTVHPH-DpIvQAhR.js → mindmap-definition-QFDTVHPH-DJd5id_i.js} +1 -1
  204. package/dist/app/assets/{mizar-xsXyQ6rQ.js → mizar-DklHxYKD.js} +1 -1
  205. package/dist/app/assets/{mongodb-BTgL3ZWT.js → mongodb-BG3ojuXH.js} +1 -1
  206. package/dist/app/assets/{monkey-F9znNaXb.js → monkey-VpryXw-8.js} +1 -1
  207. package/dist/app/assets/{moonscript-BVOnwLtu.js → moonscript-D76ynE1M.js} +1 -1
  208. package/dist/app/assets/{n1ql-CTJLY5PH.js → n1ql-C3IMeS46.js} +1 -1
  209. package/dist/app/assets/{n4js-DtbwPzA6.js → n4js-Cvjzz6v5.js} +1 -1
  210. package/dist/app/assets/{nand2tetris-hdl-C53Xsmj_.js → nand2tetris-hdl-CGK2rJb_.js} +1 -1
  211. package/dist/app/assets/{naniscript-5XkMf0Gg.js → naniscript-z5gCYRIw.js} +1 -1
  212. package/dist/app/assets/{nasm-BFvvM3DJ.js → nasm-DuSg-eT9.js} +1 -1
  213. package/dist/app/assets/{neon-ChSQ8_23.js → neon-Djjs3REP.js} +1 -1
  214. package/dist/app/assets/{nevod-BjKo9A7p.js → nevod-CN5G_5rU.js} +1 -1
  215. package/dist/app/assets/{nginx-LeCIbnrg.js → nginx-BWWt8A1j.js} +1 -1
  216. package/dist/app/assets/{nim-4dNKlvi_.js → nim-HOSGhPSy.js} +1 -1
  217. package/dist/app/assets/{nix-CI3vYyZf.js → nix-D12N_kci.js} +1 -1
  218. package/dist/app/assets/{nsis-BCXMhWuQ.js → nsis-B1v-kqJf.js} +1 -1
  219. package/dist/app/assets/{objectivec-CBNQ964u.js → objectivec-Brgm4idR.js} +1 -1
  220. package/dist/app/assets/{ocaml-CreqCcvn.js → ocaml-7vtyt6C7.js} +1 -1
  221. package/dist/app/assets/{opencl-U00h5NuL.js → opencl-1Y6L_YpV.js} +1 -1
  222. package/dist/app/assets/{openqasm-5JmoAEK_.js → openqasm-C3cbIpYJ.js} +1 -1
  223. package/dist/app/assets/{oz-ByO6sRj5.js → oz-DuJJROqC.js} +1 -1
  224. package/dist/app/assets/{parigp-BWsCdOUG.js → parigp-CqzuXo0B.js} +1 -1
  225. package/dist/app/assets/{parser-D1DiUamc.js → parser-DPIFi1zk.js} +1 -1
  226. package/dist/app/assets/{pascal-BemGcm18.js → pascal-8jBCOys9.js} +1 -1
  227. package/dist/app/assets/{pascaligo-Co4F9g0w.js → pascaligo-BYAmePB4.js} +1 -1
  228. package/dist/app/assets/{pcaxis-b_4ajNUm.js → pcaxis-CH_jwvLo.js} +1 -1
  229. package/dist/app/assets/{peoplecode-CY7MbA6u.js → peoplecode-BCEe26dc.js} +1 -1
  230. package/dist/app/assets/{perl-CKQA8rPB.js → perl-CfyL0fkk.js} +1 -1
  231. package/dist/app/assets/{php-C-5V30Sh.js → php-BEdNzSLG.js} +1 -1
  232. package/dist/app/assets/{php-extras-C9xN5vf_.js → php-extras-Cdo7FfZH.js} +1 -1
  233. package/dist/app/assets/{phpdoc-CFxW1Wxv.js → phpdoc-5uiCeBAb.js} +1 -1
  234. package/dist/app/assets/{pieDiagram-DEJITSTG-DgRh7Zap.js → pieDiagram-DEJITSTG-5Xgf1apo.js} +1 -1
  235. package/dist/app/assets/{plsql-CUKGtN80.js → plsql-CaFGgNQX.js} +1 -1
  236. package/dist/app/assets/{powerquery-BA3fVcGH.js → powerquery-U6G7w8j2.js} +1 -1
  237. package/dist/app/assets/{powershell-Y_JLkq70.js → powershell-BEQa27Pd.js} +1 -1
  238. package/dist/app/assets/{processing-BKwdaseE.js → processing-CPJVmlX3.js} +1 -1
  239. package/dist/app/assets/{prolog-HM24nA-k.js → prolog-DQ4S2uId.js} +1 -1
  240. package/dist/app/assets/{promql-OVtibSyw.js → promql-DHu3TLQW.js} +1 -1
  241. package/dist/app/assets/{properties-Bw8iDk08.js → properties-BEEa0JNa.js} +1 -1
  242. package/dist/app/assets/{protobuf-DfDNnn1n.js → protobuf-DnIXDpDi.js} +1 -1
  243. package/dist/app/assets/{psl-C4A_FgBY.js → psl-D6F0X7gI.js} +1 -1
  244. package/dist/app/assets/{pug-Bbo_gUmT.js → pug-usp0TnS_.js} +1 -1
  245. package/dist/app/assets/{puppet-DKuYrmko.js → puppet-CCmIBC5o.js} +1 -1
  246. package/dist/app/assets/{pure-BbBX4Ygi.js → pure-CxW_7PSX.js} +1 -1
  247. package/dist/app/assets/{purebasic-DDk2f6p7.js → purebasic-CUlLSqEL.js} +1 -1
  248. package/dist/app/assets/{purescript-DAyc5SMt.js → purescript-DIdsMdqD.js} +1 -1
  249. package/dist/app/assets/{q-05YeV9ON.js → q-r79YD-RS.js} +1 -1
  250. package/dist/app/assets/{qml-Bcp3grlx.js → qml-BC7wMM6Q.js} +1 -1
  251. package/dist/app/assets/{qore-DyXDLOB2.js → qore-WxsAKgCD.js} +1 -1
  252. package/dist/app/assets/{qsharp-CJerorSH.js → qsharp-D7lLZD3n.js} +1 -1
  253. package/dist/app/assets/{quadrantDiagram-34T5L4WZ-B8WY1LsE.js → quadrantDiagram-34T5L4WZ-DTIcGAOk.js} +1 -1
  254. package/dist/app/assets/{r-Bk-EmTE-.js → r-P0CM9urb.js} +1 -1
  255. package/dist/app/assets/{racket-Bm9RxNSE.js → racket-DVeucTFY.js} +1 -1
  256. package/dist/app/assets/{reason-ByxYflge.js → reason-BgQvAQAD.js} +1 -1
  257. package/dist/app/assets/{regex-n3Pg4C2o.js → regex-sqaSbvSv.js} +1 -1
  258. package/dist/app/assets/{rego-sND5xFsX.js → rego-CJIg56LF.js} +1 -1
  259. package/dist/app/assets/{renpy-Dw3awaxL.js → renpy-_gDjY0Al.js} +1 -1
  260. package/dist/app/assets/{requirementDiagram-MS252O5E-C28I-Qs_.js → requirementDiagram-MS252O5E-CE7JMmce.js} +1 -1
  261. package/dist/app/assets/{rest-DUyjihZy.js → rest-CiU1bgMd.js} +1 -1
  262. package/dist/app/assets/{rip-DQD1PpI1.js → rip-DggWyO7M.js} +1 -1
  263. package/dist/app/assets/{roboconf-zgTRBG-b.js → roboconf-CSJ0x616.js} +1 -1
  264. package/dist/app/assets/{robotframework-DeFCJe2B.js → robotframework-CDF7dCNt.js} +1 -1
  265. package/dist/app/assets/{ruby-DGxfrUjf.js → ruby-DiJ0PRoD.js} +1 -1
  266. package/dist/app/assets/{rust-Dw2emRbt.js → rust-BFlAZ4n1.js} +1 -1
  267. package/dist/app/assets/{sankeyDiagram-XADWPNL6-B0mHlnDH.js → sankeyDiagram-XADWPNL6-C6L2VVck.js} +1 -1
  268. package/dist/app/assets/{sas-9J3OAgqN.js → sas-Cqi8ANTk.js} +1 -1
  269. package/dist/app/assets/{sass-BQsiGIZh.js → sass-Fcz-_iW-.js} +1 -1
  270. package/dist/app/assets/{scala-fVID0vPk.js → scala-CxvM-FLQ.js} +1 -1
  271. package/dist/app/assets/{scheme-KCB1LwX_.js → scheme-kpBg6tVA.js} +1 -1
  272. package/dist/app/assets/{scss-BgSYJF8F.js → scss-DXz1iRbh.js} +1 -1
  273. package/dist/app/assets/{sequenceDiagram-FGHM5R23-D5LSBA72.js → sequenceDiagram-FGHM5R23-x40S7kZo.js} +1 -1
  274. package/dist/app/assets/{shell-session-DmBypuZB.js → shell-session-DFP85I_o.js} +1 -1
  275. package/dist/app/assets/{smali-2I2f2uV2.js → smali-B-rVIGx2.js} +1 -1
  276. package/dist/app/assets/{smalltalk-xmEVtq3b.js → smalltalk-DZhpacIf.js} +1 -1
  277. package/dist/app/assets/{smarty-DuVe4-fD.js → smarty-BYkPoV7-.js} +1 -1
  278. package/dist/app/assets/{sml-Bb5jOVPw.js → sml-Bpl2hT9d.js} +1 -1
  279. package/dist/app/assets/{solidity-7DS3rQ0f.js → solidity-m14I6_Ub.js} +1 -1
  280. package/dist/app/assets/{solution-file-DpitFDwQ.js → solution-file-lgJK1sXF.js} +1 -1
  281. package/dist/app/assets/{soy-xa62VSYb.js → soy-CmkNlVMo.js} +1 -1
  282. package/dist/app/assets/{sparql-nIdLKdzE.js → sparql-C8X9qBCV.js} +1 -1
  283. package/dist/app/assets/{splunk-spl-DT8vzqTd.js → splunk-spl-D340jzbt.js} +1 -1
  284. package/dist/app/assets/{sqf-D_J1wPSO.js → sqf-Cy9hNmyR.js} +1 -1
  285. package/dist/app/assets/{sql-BXPs4lkf.js → sql-BuosKQRc.js} +1 -1
  286. package/dist/app/assets/{squirrel-Bt2TOoZD.js → squirrel-8Uir-D81.js} +1 -1
  287. package/dist/app/assets/{stan-bh8Ffooh.js → stan-DwOB-m45.js} +1 -1
  288. package/dist/app/assets/{stateDiagram-FHFEXIEX-DNkKFWr2.js → stateDiagram-FHFEXIEX-eK4Mr2m1.js} +1 -1
  289. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-C3M7UFxa.js +1 -0
  290. package/dist/app/assets/{stylus-BAUtbs2c.js → stylus-D9o8ycmV.js} +1 -1
  291. package/dist/app/assets/{swift-l0hP6yV7.js → swift-6P1oJjtu.js} +1 -1
  292. package/dist/app/assets/{systemd-Btc4Qz3J.js → systemd-CB40GGbI.js} +1 -1
  293. package/dist/app/assets/{t4-cs-BjAV5Ns6.js → t4-cs-oDtZSVDr.js} +1 -1
  294. package/dist/app/assets/{t4-templating-0HrVV_I1.js → t4-templating-BNqgqrov.js} +1 -1
  295. package/dist/app/assets/{t4-vb-CqIBNZ1b.js → t4-vb-Cv8f7UA2.js} +1 -1
  296. package/dist/app/assets/{tap-B-8X0Drv.js → tap-CbrEfuBB.js} +1 -1
  297. package/dist/app/assets/{tcl-Dsqf3ZPx.js → tcl-BO7rxJbt.js} +1 -1
  298. package/dist/app/assets/{textile-DSYQsA-I.js → textile-BTqL4BpR.js} +1 -1
  299. package/dist/app/assets/{timeline-definition-GMOUNBTQ-CEtXto8g.js → timeline-definition-GMOUNBTQ-Bx9k8UuZ.js} +1 -1
  300. package/dist/app/assets/{toNumber-BMcN9Ax7.js → toNumber-BHLUnJCk.js} +1 -1
  301. package/dist/app/assets/{toml-CpRMaMrB.js → toml-KtQBEurb.js} +1 -1
  302. package/dist/app/assets/{tremor-CGh7Sa_N.js → tremor-Dk70TmsK.js} +1 -1
  303. package/dist/app/assets/{tt2-DH4IySIU.js → tt2-DnQZgW9E.js} +1 -1
  304. package/dist/app/assets/{turtle-CCArav6x.js → turtle-D8QBc8HO.js} +1 -1
  305. package/dist/app/assets/{twig-CMfNIdZ-.js → twig-BOYkX3KT.js} +1 -1
  306. package/dist/app/assets/{typescript-Bizq75_T.js → typescript-B7MN9vbP.js} +1 -1
  307. package/dist/app/assets/{typoscript-BKwq_Pv3.js → typoscript-CJp8dvAS.js} +1 -1
  308. package/dist/app/assets/{unrealscript-C7cPGt_d.js → unrealscript-CgTA2YQi.js} +1 -1
  309. package/dist/app/assets/{uorazor-Zphes3kf.js → uorazor-APvKotZB.js} +1 -1
  310. package/dist/app/assets/{uri-BIZ2Bbco.js → uri-D-yR2anw.js} +1 -1
  311. package/dist/app/assets/{v-4CeCdJxQ.js → v-BDwYNgP_.js} +1 -1
  312. package/dist/app/assets/{vala-BGjzZngz.js → vala-DgEvv5Sb.js} +1 -1
  313. package/dist/app/assets/{vbnet-DcGWvrm1.js → vbnet-DN-ptnmb.js} +1 -1
  314. package/dist/app/assets/{velocity-DLFRqsWq.js → velocity-s30ZYDZQ.js} +1 -1
  315. package/dist/app/assets/{vennDiagram-DHZGUBPP-iLPwgfwf.js → vennDiagram-DHZGUBPP-DXNVFN6S.js} +1 -1
  316. package/dist/app/assets/{verilog-VXPCXmmb.js → verilog-BW90SBzF.js} +1 -1
  317. package/dist/app/assets/{vhdl-OiJgxIIr.js → vhdl-BBFaZHgH.js} +1 -1
  318. package/dist/app/assets/{vim-UHqZ5huH.js → vim-CB_5_dbu.js} +1 -1
  319. package/dist/app/assets/{visual-basic-DrmZqU06.js → visual-basic-C7gSM6IL.js} +1 -1
  320. package/dist/app/assets/{wardley-RL74JXVD-J7Wj2Imv.js → wardley-RL74JXVD-Bc8bssEU.js} +1 -1
  321. package/dist/app/assets/{wardleyDiagram-NUSXRM2D-BXmwhZ7A.js → wardleyDiagram-NUSXRM2D-ChZrbBkL.js} +1 -1
  322. package/dist/app/assets/{warpscript-DeTsNI2X.js → warpscript-CTVS4vLW.js} +1 -1
  323. package/dist/app/assets/{wasm-DRdFvZi2.js → wasm-DrDg6k1Q.js} +1 -1
  324. package/dist/app/assets/{web-idl-BUn07EHT.js → web-idl-aPR6ivRq.js} +1 -1
  325. package/dist/app/assets/{wiki-BVI5drcr.js → wiki-DQ0WLnSI.js} +1 -1
  326. package/dist/app/assets/{wolfram-DbnOY8AT.js → wolfram-DKc_7m0c.js} +1 -1
  327. package/dist/app/assets/{wren-Buf8bMya.js → wren-BfynSjz-.js} +1 -1
  328. package/dist/app/assets/{xeora-ngw7GF5O.js → xeora-BG1TDQ7h.js} +1 -1
  329. package/dist/app/assets/{xml-doc-DaNehWRN.js → xml-doc-BteNMTDL.js} +1 -1
  330. package/dist/app/assets/{xojo-TxJkqaS8.js → xojo-hLVHJe-j.js} +1 -1
  331. package/dist/app/assets/{xquery-1o_Sf4Sq.js → xquery-D5eD5vY-.js} +1 -1
  332. package/dist/app/assets/{xychartDiagram-5P7HB3ND-DJJrUWxd.js → xychartDiagram-5P7HB3ND-DSRp0xPw.js} +1 -1
  333. package/dist/app/assets/{yaml-CrBHyf9u.js → yaml-D_xQTJJ6.js} +1 -1
  334. package/dist/app/assets/{yang-g8dRVUhJ.js → yang-QHRqi2r2.js} +1 -1
  335. package/dist/app/assets/{zig-2EHR4M92.js → zig-CaTmNDOs.js} +1 -1
  336. package/dist/app/index.html +1 -1
  337. package/dist/index.cjs +926 -587
  338. package/dist/index.js +932 -590
  339. package/package.json +5 -5
  340. package/dist/app/assets/channel-53ErRBg2.js +0 -1
  341. package/dist/app/assets/classDiagram-6PBFFD2Q-Cz_aN_Mk.js +0 -1
  342. package/dist/app/assets/classDiagram-v2-HSJHXN6E-Cz_aN_Mk.js +0 -1
  343. package/dist/app/assets/clone-B8LwPs5_.js +0 -1
  344. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-CVLVuLVv.js +0 -1
package/dist/index.cjs CHANGED
@@ -1134,6 +1134,11 @@ var en_US_default = {
1134
1134
  clientCommandUnavailable: "No handler is configured for client command {{commandKey}}."
1135
1135
  },
1136
1136
  externalAssistants: {
1137
+ cancel: "Cancel",
1138
+ cancelRun: "Cancel execution: {{name}}",
1139
+ cancelling: "Cancelling\u2026",
1140
+ cancelRequested: "Cancellation requested",
1141
+ cancelFailed: "Could not cancel the execution. Please try again.",
1137
1142
  title: "External assistants",
1138
1143
  openRun: "View execution: {{name}}",
1139
1144
  back: "Back to executions",
@@ -1542,6 +1547,7 @@ var en_US_default = {
1542
1547
  select: "Select project",
1543
1548
  none: "No project",
1544
1549
  autoNew: "New project \xB7 Create on send",
1550
+ confirmNew: "New project \xB7 Confirm settings first",
1545
1551
  search: "Search projects",
1546
1552
  new: "New project",
1547
1553
  create: "Create",
@@ -1907,6 +1913,9 @@ var en_US_default = {
1907
1913
  moreTags: "+{{count}}"
1908
1914
  },
1909
1915
  mcpApp: {
1916
+ openProjectFailed: "Unable to open this project.",
1917
+ refresh: "Refresh data",
1918
+ refreshFailed: "Unable to refresh data. Please try again.",
1910
1919
  loading: "Loading MCP App",
1911
1920
  fullscreen: "Open fullscreen",
1912
1921
  pictureInPicture: "Open picture in picture",
@@ -1947,7 +1956,13 @@ var en_US_default = {
1947
1956
  replied: "Replied",
1948
1957
  pending: "Pending",
1949
1958
  interrupted: "Interrupted",
1950
- timeout: "Timed out"
1959
+ timeout: "Timed out",
1960
+ business_accepted: "Accepted",
1961
+ business_already_completed: "Already completed",
1962
+ business_not_claimed: "Not claimed",
1963
+ business_blocked: "Blocked",
1964
+ business_failed: "Task failed",
1965
+ business_incomplete: "Not accepted"
1951
1966
  },
1952
1967
  counts: {
1953
1968
  messages: {
@@ -2063,7 +2078,7 @@ var en_US_default = {
2063
2078
  pause: "Pause workflow",
2064
2079
  resume: "Resume workflow",
2065
2080
  cancelRun: "Stop task",
2066
- pausing: "Saving and pausing\u2026",
2081
+ pausing: "Pausing",
2067
2082
  paused: "Workflow paused",
2068
2083
  editMessage: "Edit message",
2069
2084
  sourcePauseUnavailable: "The original task cannot be paused yet. Try again after it finishes.",
@@ -2077,7 +2092,11 @@ var en_US_default = {
2077
2092
  interrupted: "Waiting",
2078
2093
  error: "Error",
2079
2094
  running: "Running"
2080
- }
2095
+ },
2096
+ stop: "Stop",
2097
+ stopping: "Stopping",
2098
+ stopDescription: "End this run without undoing completed actions",
2099
+ pausingDescription: "Waiting for the current step and checkpoint; you can still stop the run"
2081
2100
  },
2082
2101
  fileActivity: {
2083
2102
  textLineChanges: "Text line changes",
@@ -2253,6 +2272,11 @@ var zh_CN_default = {
2253
2272
  clientCommandUnavailable: "\u672A\u914D\u7F6E\u5BA2\u6237\u7AEF\u547D\u4EE4 {{commandKey}} \u7684\u5904\u7406\u5668\u3002"
2254
2273
  },
2255
2274
  externalAssistants: {
2275
+ cancel: "\u53D6\u6D88\u6267\u884C",
2276
+ cancelRun: "\u53D6\u6D88\u6267\u884C\uFF1A{{name}}",
2277
+ cancelling: "\u6B63\u5728\u53D6\u6D88\u2026",
2278
+ cancelRequested: "\u5DF2\u8BF7\u6C42\u53D6\u6D88",
2279
+ cancelFailed: "\u53D6\u6D88\u6267\u884C\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002",
2256
2280
  title: "\u5916\u90E8\u52A9\u624B",
2257
2281
  openRun: "\u67E5\u770B\u6267\u884C\uFF1A{{name}}",
2258
2282
  back: "\u8FD4\u56DE\u6267\u884C\u5217\u8868",
@@ -2661,6 +2685,7 @@ var zh_CN_default = {
2661
2685
  select: "\u9009\u62E9\u9879\u76EE",
2662
2686
  none: "\u4E0D\u4F7F\u7528\u9879\u76EE",
2663
2687
  autoNew: "\u65B0\u9879\u76EE \xB7 \u53D1\u9001\u540E\u81EA\u52A8\u521B\u5EFA",
2688
+ confirmNew: "\u65B0\u9879\u76EE \xB7 \u786E\u8BA4\u914D\u7F6E\u540E\u521B\u5EFA",
2664
2689
  search: "\u641C\u7D22\u9879\u76EE",
2665
2690
  new: "\u65B0\u5EFA\u9879\u76EE",
2666
2691
  create: "\u521B\u5EFA",
@@ -3026,6 +3051,9 @@ var zh_CN_default = {
3026
3051
  moreTags: "+{{count}}"
3027
3052
  },
3028
3053
  mcpApp: {
3054
+ openProjectFailed: "\u6682\u65F6\u65E0\u6CD5\u6253\u5F00\u6B64\u9879\u76EE\u3002",
3055
+ refresh: "\u5237\u65B0\u6570\u636E",
3056
+ refreshFailed: "\u6570\u636E\u5237\u65B0\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002",
3029
3057
  loading: "\u6B63\u5728\u52A0\u8F7D MCP App",
3030
3058
  fullscreen: "\u5168\u5C4F\u663E\u793A",
3031
3059
  pictureInPicture: "\u753B\u4E2D\u753B\u663E\u793A",
@@ -3066,7 +3094,13 @@ var zh_CN_default = {
3066
3094
  replied: "\u5DF2\u56DE\u590D",
3067
3095
  pending: "\u7B49\u5F85\u4E2D",
3068
3096
  interrupted: "\u5DF2\u4E2D\u65AD",
3069
- timeout: "\u5DF2\u8D85\u65F6"
3097
+ timeout: "\u5DF2\u8D85\u65F6",
3098
+ business_accepted: "\u5DF2\u9A8C\u6536",
3099
+ business_already_completed: "\u5DF2\u5B8C\u6210\uFF0C\u65E0\u9700\u91CD\u590D",
3100
+ business_not_claimed: "\u672A\u9886\u53D6",
3101
+ business_blocked: "\u53D7\u963B",
3102
+ business_failed: "\u4EFB\u52A1\u5931\u8D25",
3103
+ business_incomplete: "\u672A\u9A8C\u6536"
3070
3104
  },
3071
3105
  counts: {
3072
3106
  messages: {
@@ -3182,7 +3216,7 @@ var zh_CN_default = {
3182
3216
  pause: "\u6682\u505C\u6D41\u7A0B",
3183
3217
  resume: "\u6062\u590D\u6D41\u7A0B",
3184
3218
  cancelRun: "\u505C\u6B62\u4EFB\u52A1",
3185
- pausing: "\u6B63\u5728\u4FDD\u5B58\u5E76\u6682\u505C\u2026",
3219
+ pausing: "\u6B63\u5728\u6682\u505C",
3186
3220
  paused: "\u6D41\u7A0B\u5DF2\u6682\u505C",
3187
3221
  editMessage: "\u7F16\u8F91\u6D88\u606F",
3188
3222
  sourcePauseUnavailable: "\u539F\u4EFB\u52A1\u6682\u4E0D\u652F\u6301\u6682\u505C\uFF0C\u8BF7\u5728\u4EFB\u52A1\u5B8C\u6210\u540E\u91CD\u8BD5\u3002",
@@ -3196,7 +3230,11 @@ var zh_CN_default = {
3196
3230
  interrupted: "\u7B49\u5F85\u5904\u7406",
3197
3231
  error: "\u51FA\u9519",
3198
3232
  running: "\u8FD0\u884C\u4E2D"
3199
- }
3233
+ },
3234
+ stop: "\u505C\u6B62",
3235
+ stopping: "\u6B63\u5728\u505C\u6B62",
3236
+ stopDescription: "\u7EC8\u6B62\u672C\u6B21\u8FD0\u884C\uFF0C\u4E0D\u64A4\u9500\u5DF2\u7ECF\u5B8C\u6210\u7684\u64CD\u4F5C",
3237
+ pausingDescription: "\u6B63\u5728\u7B49\u5F85\u5F53\u524D\u6B65\u9AA4\u5B8C\u6210\u5E76\u4FDD\u5B58\u8FDB\u5EA6\uFF1B\u4ECD\u53EF\u505C\u6B62\u8FD0\u884C"
3200
3238
  },
3201
3239
  fileActivity: {
3202
3240
  textLineChanges: "\u6587\u672C\u884C\u53D8\u66F4",
@@ -4384,39 +4422,6 @@ var import_lucide_react5 = require("lucide-react");
4384
4422
  // src/providers/Stream.tsx
4385
4423
  var import_react4 = require("react");
4386
4424
 
4387
- // src/lib/api-config.ts
4388
- function hasConfiguredValue(value) {
4389
- return typeof value === "string" && value.trim().length > 0;
4390
- }
4391
- function getMissingApiConfigurationKind({
4392
- apiUrl,
4393
- clientSecret
4394
- }) {
4395
- const hasApiUrl = hasConfiguredValue(apiUrl);
4396
- const hasClientSecret = hasConfiguredValue(clientSecret);
4397
- if (hasApiUrl && hasClientSecret) {
4398
- return null;
4399
- }
4400
- if (!hasApiUrl && !hasClientSecret) {
4401
- return "apiUrlAndClientSecret";
4402
- }
4403
- return hasApiUrl ? "clientSecret" : "apiUrl";
4404
- }
4405
-
4406
- // src/providers/stream/context.ts
4407
- var import_react2 = require("react");
4408
- var StreamContext = (0, import_react2.createContext)(
4409
- void 0
4410
- );
4411
- var useStreamContext = () => {
4412
- const context = (0, import_react2.useContext)(StreamContext);
4413
- if (!context) {
4414
- throw new Error("useStreamContext must be used within a StreamProvider");
4415
- }
4416
- return context;
4417
- };
4418
- var context_default = StreamContext;
4419
-
4420
4425
  // src/lib/follow-ups.ts
4421
4426
  function getVisiblePendingFollowUpPriority(item) {
4422
4427
  return item.mode === "steer" || item.queuedFromSteer ? 0 : 1;
@@ -5188,6 +5193,39 @@ function agentRunLevel(run, messages) {
5188
5193
  return level;
5189
5194
  }
5190
5195
 
5196
+ // src/lib/api-config.ts
5197
+ function hasConfiguredValue(value) {
5198
+ return typeof value === "string" && value.trim().length > 0;
5199
+ }
5200
+ function getMissingApiConfigurationKind({
5201
+ apiUrl,
5202
+ clientSecret
5203
+ }) {
5204
+ const hasApiUrl = hasConfiguredValue(apiUrl);
5205
+ const hasClientSecret = hasConfiguredValue(clientSecret);
5206
+ if (hasApiUrl && hasClientSecret) {
5207
+ return null;
5208
+ }
5209
+ if (!hasApiUrl && !hasClientSecret) {
5210
+ return "apiUrlAndClientSecret";
5211
+ }
5212
+ return hasApiUrl ? "clientSecret" : "apiUrl";
5213
+ }
5214
+
5215
+ // src/providers/stream/context.ts
5216
+ var import_react2 = require("react");
5217
+ var StreamContext = (0, import_react2.createContext)(
5218
+ void 0
5219
+ );
5220
+ var useStreamContext = () => {
5221
+ const context = (0, import_react2.useContext)(StreamContext);
5222
+ if (!context) {
5223
+ throw new Error("useStreamContext must be used within a StreamProvider");
5224
+ }
5225
+ return context;
5226
+ };
5227
+ var context_default = StreamContext;
5228
+
5191
5229
  // src/lib/runtime-capabilities.ts
5192
5230
  function isRuntimeSkillSource(value) {
5193
5231
  if (!value || typeof value !== "object" || Array.isArray(value)) {
@@ -5590,12 +5628,12 @@ async function loadConversationRuntimeCapabilities({
5590
5628
  client,
5591
5629
  threadId,
5592
5630
  xpertId,
5593
- projectId,
5631
+ projectId: projectId2,
5594
5632
  capabilities
5595
5633
  }) {
5596
5634
  const conversation = await findConversationByThreadId(client, threadId, {
5597
5635
  xpertId,
5598
- projectId
5636
+ projectId: projectId2
5599
5637
  });
5600
5638
  const persistedSelection = getConversationOptions(conversation)?.runtimeCapabilities ?? null;
5601
5639
  if (!persistedSelection) {
@@ -5618,7 +5656,7 @@ async function persistConversationRuntimeCapabilities({
5618
5656
  client,
5619
5657
  threadId,
5620
5658
  xpertId,
5621
- projectId,
5659
+ projectId: projectId2,
5622
5660
  capabilities,
5623
5661
  selection
5624
5662
  }) {
@@ -5629,7 +5667,7 @@ async function persistConversationRuntimeCapabilities({
5629
5667
  const conversation = await findConversationByThreadIdWithRetry(
5630
5668
  client,
5631
5669
  threadId,
5632
- { xpertId, projectId }
5670
+ { xpertId, projectId: projectId2 }
5633
5671
  );
5634
5672
  if (!conversation?.id) {
5635
5673
  return {
@@ -5776,14 +5814,14 @@ function createAssistantThreadPayload(assistantId, threadId) {
5776
5814
  ...threadId ? { threadId, ifExists: "raise" } : {}
5777
5815
  };
5778
5816
  }
5779
- function createConversationPayload(threadId, xpertId, projectId, connectorBindingIds = [], conversationId, runtimeCapabilities) {
5817
+ function createConversationPayload(threadId, xpertId, projectId2, connectorBindingIds = [], conversationId, runtimeCapabilities) {
5780
5818
  const baseOptions = runtimeCapabilities ? { runtimeCapabilities } : void 0;
5781
5819
  const options = connectorBindingIds.length ? withConnectorBindingIds(baseOptions, connectorBindingIds) : baseOptions;
5782
5820
  return {
5783
5821
  ...conversationId ? { id: conversationId } : {},
5784
5822
  threadId,
5785
5823
  xpertId,
5786
- ...projectId ? { projectId } : {},
5824
+ ...projectId2 ? { projectId: projectId2 } : {},
5787
5825
  ...options ? { options } : {}
5788
5826
  };
5789
5827
  }
@@ -5864,7 +5902,7 @@ async function executeThreadGoalCommand({
5864
5902
  goal,
5865
5903
  threadId,
5866
5904
  assistantId,
5867
- projectId,
5905
+ projectId: projectId2,
5868
5906
  command,
5869
5907
  runtimeCapabilities,
5870
5908
  signal
@@ -5910,7 +5948,7 @@ async function executeThreadGoalCommand({
5910
5948
  const result2 = await goal.setGoal({
5911
5949
  threadId: null,
5912
5950
  assistantId,
5913
- projectId,
5951
+ projectId: projectId2,
5914
5952
  objective,
5915
5953
  runtimeCapabilities,
5916
5954
  signal
@@ -5929,7 +5967,7 @@ async function executeThreadGoalCommand({
5929
5967
  const result = await goal.setGoal({
5930
5968
  threadId: normalizedThreadId,
5931
5969
  assistantId,
5932
- projectId,
5970
+ projectId: projectId2,
5933
5971
  objective,
5934
5972
  runtimeCapabilities,
5935
5973
  signal
@@ -6581,8 +6619,8 @@ function ComputerRow({
6581
6619
  }
6582
6620
 
6583
6621
  // src/components/chat.tsx
6584
- var import_lucide_react75 = require("lucide-react");
6585
- var React123 = __toESM(require("react"), 1);
6622
+ var import_lucide_react76 = require("lucide-react");
6623
+ var React124 = __toESM(require("react"), 1);
6586
6624
 
6587
6625
  // src/lib/composer-parts.ts
6588
6626
  var COMPOSER_CAPABILITY_TOKEN_LENGTH = 1;
@@ -7605,7 +7643,7 @@ function getRemovedComposerCapabilityParts(previousParts, nextParts) {
7605
7643
  function useRuntimeCapabilitiesState({
7606
7644
  client,
7607
7645
  assistantId,
7608
- projectId,
7646
+ projectId: projectId2,
7609
7647
  threadId,
7610
7648
  disabled
7611
7649
  }) {
@@ -7641,7 +7679,7 @@ function useRuntimeCapabilitiesState({
7641
7679
  client,
7642
7680
  threadId: nextThreadId,
7643
7681
  xpertId: assistantId,
7644
- projectId,
7682
+ projectId: projectId2,
7645
7683
  capabilities: runtimeCapabilities,
7646
7684
  selection
7647
7685
  });
@@ -7656,7 +7694,7 @@ function useRuntimeCapabilitiesState({
7656
7694
  );
7657
7695
  }
7658
7696
  },
7659
- [assistantId, client, projectId, runtimeCapabilities]
7697
+ [assistantId, client, projectId2, runtimeCapabilities]
7660
7698
  );
7661
7699
  const applyExternalRuntimeCapabilities = React15.useCallback(
7662
7700
  (selection) => {
@@ -7776,7 +7814,7 @@ function useRuntimeCapabilitiesState({
7776
7814
  setRuntimeCapabilities(null);
7777
7815
  setRuntimeCapabilityPalette(null);
7778
7816
  void client.assistants.getRuntimeCapabilities(assistantId, {
7779
- ...projectId ? { projectId } : {},
7817
+ ...projectId2 ? { projectId: projectId2 } : {},
7780
7818
  signal: controller.signal
7781
7819
  }).then((payload) => {
7782
7820
  setRuntimeCapabilities(payload);
@@ -7809,7 +7847,7 @@ function useRuntimeCapabilitiesState({
7809
7847
  setRunRuntimeCapabilities(createEmptyRuntimeCapabilitiesSelection());
7810
7848
  });
7811
7849
  return () => controller.abort();
7812
- }, [assistantId, client, disabled, projectId]);
7850
+ }, [assistantId, client, disabled, projectId2]);
7813
7851
  React15.useEffect(() => {
7814
7852
  const emptyRunSelection = createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities);
7815
7853
  const pendingExternalSelection = pendingExternalRuntimeCapabilitiesRef.current;
@@ -7845,7 +7883,7 @@ function useRuntimeCapabilitiesState({
7845
7883
  client,
7846
7884
  threadId: normalizedThreadId,
7847
7885
  xpertId: assistantId,
7848
- projectId,
7886
+ projectId: projectId2,
7849
7887
  capabilities: runtimeCapabilities
7850
7888
  }).then(({ selection, missing }) => {
7851
7889
  if (cancelled || runtimeCapabilityPreferenceLoadRef.current !== requestId) {
@@ -7869,7 +7907,7 @@ function useRuntimeCapabilitiesState({
7869
7907
  }, [
7870
7908
  assistantId,
7871
7909
  client,
7872
- projectId,
7910
+ projectId2,
7873
7911
  runtimeCapabilities,
7874
7912
  runtimeCapabilitiesReady,
7875
7913
  threadId
@@ -8614,7 +8652,7 @@ function useRuntimeResources({
8614
8652
  client,
8615
8653
  enabled,
8616
8654
  assistantId,
8617
- projectId,
8655
+ projectId: projectId2,
8618
8656
  conversationId,
8619
8657
  threadId
8620
8658
  }) {
@@ -8637,8 +8675,8 @@ function useRuntimeResources({
8637
8675
  const current = ++generation.current;
8638
8676
  const pending = submission.current;
8639
8677
  const isDraft = !conversationId && !threadId;
8640
- const isHandoff = !!pending && pending.assistantId === assistantId && pending.projectId === projectId && (!!conversationId && conversationId === pending.conversationId || !!threadId && threadId === pending.threadId);
8641
- if (pending && !isHandoff && (!isDraft || pending.complete || pending.assistantId !== assistantId || pending.projectId !== projectId)) {
8678
+ const isHandoff = !!pending && pending.assistantId === assistantId && pending.projectId === projectId2 && (!!conversationId && conversationId === pending.conversationId || !!threadId && threadId === pending.threadId);
8679
+ if (pending && !isHandoff && (!isDraft || pending.complete || pending.assistantId !== assistantId || pending.projectId !== projectId2)) {
8642
8680
  submission.current = null;
8643
8681
  if (!isDraft || pending.complete) draft.current = null;
8644
8682
  }
@@ -8657,7 +8695,7 @@ function useRuntimeResources({
8657
8695
  void (async () => {
8658
8696
  const id = conversationId ?? (threadId ? (await findConversationByThreadId(client, threadId, {
8659
8697
  xpertId: assistantId,
8660
- projectId
8698
+ projectId: projectId2
8661
8699
  }))?.id : null);
8662
8700
  if (!isDraft && !id) throw new Error(conversationUnavailable);
8663
8701
  const value = id ? await client.conversations.getRuntimeResources(id) : local;
@@ -8665,7 +8703,7 @@ function useRuntimeResources({
8665
8703
  await client.assistants.validateResources(
8666
8704
  assistantId,
8667
8705
  value,
8668
- projectId ?? void 0
8706
+ projectId2 ?? void 0
8669
8707
  );
8670
8708
  if (generation.current === current) {
8671
8709
  if (isHandoff && submission.current === pending)
@@ -8687,7 +8725,7 @@ function useRuntimeResources({
8687
8725
  client,
8688
8726
  enabled,
8689
8727
  assistantId,
8690
- projectId,
8728
+ projectId2,
8691
8729
  conversationId,
8692
8730
  threadId,
8693
8731
  reload,
@@ -8717,7 +8755,7 @@ function useRuntimeResources({
8717
8755
  const saved = resolvedId ? await client.conversations.updateRuntimeResources(resolvedId, next) : await client.assistants.validateResources(
8718
8756
  assistantId,
8719
8757
  next,
8720
- projectId ?? void 0
8758
+ projectId2 ?? void 0
8721
8759
  );
8722
8760
  if (current === generation.current) {
8723
8761
  setSelection(saved);
@@ -8747,14 +8785,14 @@ function useRuntimeResources({
8747
8785
  selection,
8748
8786
  resolvedId,
8749
8787
  assistantId,
8750
- projectId
8788
+ projectId2
8751
8789
  ]
8752
8790
  );
8753
8791
  const beginSubmission = React19.useCallback(() => {
8754
8792
  if (!enabled || !assistantId || conversationId || threadId) return;
8755
8793
  const pending = {
8756
8794
  assistantId,
8757
- projectId,
8795
+ projectId: projectId2,
8758
8796
  selection,
8759
8797
  complete: false
8760
8798
  };
@@ -8772,7 +8810,7 @@ function useRuntimeResources({
8772
8810
  else submission.current = null;
8773
8811
  }
8774
8812
  };
8775
- }, [enabled, assistantId, projectId, conversationId, threadId, selection]);
8813
+ }, [enabled, assistantId, projectId2, conversationId, threadId, selection]);
8776
8814
  return {
8777
8815
  selection,
8778
8816
  busy,
@@ -9057,7 +9095,7 @@ var import_jsx_runtime24 = require("react/jsx-runtime");
9057
9095
  var ThreadMentionPalette = React21.forwardRef(function ThreadMentionPalette2({
9058
9096
  client,
9059
9097
  assistantId,
9060
- projectId,
9098
+ projectId: projectId2,
9061
9099
  threadId,
9062
9100
  query,
9063
9101
  selectedThreadIds,
@@ -9082,7 +9120,7 @@ var ThreadMentionPalette = React21.forwardRef(function ThreadMentionPalette2({
9082
9120
  const timer = setTimeout(() => {
9083
9121
  void client.conversations.search(
9084
9122
  {
9085
- where: { xpertId: assistantId, projectId: projectId ?? null },
9123
+ where: { xpertId: assistantId, projectId: projectId2 ?? null },
9086
9124
  search: query.trim(),
9087
9125
  limit: 30,
9088
9126
  order: { updatedAt: "DESC", id: "DESC" }
@@ -9100,7 +9138,7 @@ var ThreadMentionPalette = React21.forwardRef(function ThreadMentionPalette2({
9100
9138
  clearTimeout(timer);
9101
9139
  controller.abort();
9102
9140
  };
9103
- }, [client, assistantId, projectId, query]);
9141
+ }, [client, assistantId, projectId2, query]);
9104
9142
  const visible = items.filter(
9105
9143
  (item) => item.threadId && item.threadId !== threadId && !selectedThreadIds.has(item.threadId)
9106
9144
  );
@@ -11173,11 +11211,11 @@ function invalidateConnectionCatalogs(client) {
11173
11211
  notify(entry);
11174
11212
  }
11175
11213
  }
11176
- function useConnectorCatalog(client, assistantId, projectId, enabled = true) {
11214
+ function useConnectorCatalog(client, assistantId, projectId2, enabled = true) {
11177
11215
  const entry = React37.useMemo(() => {
11178
11216
  let scopes = clients.get(client);
11179
11217
  if (!scopes) clients.set(client, scopes = /* @__PURE__ */ new Map());
11180
- const key = JSON.stringify([assistantId, projectId ?? null]);
11218
+ const key = JSON.stringify([assistantId, projectId2 ?? null]);
11181
11219
  let cached = scopes.get(key);
11182
11220
  if (!cached)
11183
11221
  scopes.set(
@@ -11190,7 +11228,7 @@ function useConnectorCatalog(client, assistantId, projectId, enabled = true) {
11190
11228
  }
11191
11229
  );
11192
11230
  return cached;
11193
- }, [client, assistantId, projectId]);
11231
+ }, [client, assistantId, projectId2]);
11194
11232
  const revision = React37.useSyncExternalStore(
11195
11233
  React37.useCallback(
11196
11234
  (listener) => {
@@ -11210,7 +11248,7 @@ function useConnectorCatalog(client, assistantId, projectId, enabled = true) {
11210
11248
  notify(entry);
11211
11249
  const startedAt = entry.revision;
11212
11250
  void client.connectors.runtimeOptions(assistantId, {
11213
- projectId: projectId ?? void 0,
11251
+ projectId: projectId2 ?? void 0,
11214
11252
  includeWorkspace: true
11215
11253
  }).then((data) => {
11216
11254
  entry.data = data;
@@ -11221,7 +11259,7 @@ function useConnectorCatalog(client, assistantId, projectId, enabled = true) {
11221
11259
  entry.loaded = entry.revision === startedAt;
11222
11260
  notify(entry);
11223
11261
  });
11224
- }, [entry, client, assistantId, projectId, enabled, revision]);
11262
+ }, [entry, client, assistantId, projectId2, enabled, revision]);
11225
11263
  React37.useEffect(() => {
11226
11264
  if (!enabled) return;
11227
11265
  const refresh = () => {
@@ -11472,13 +11510,13 @@ function ConnectorMenuPanel(props) {
11472
11510
  function ConnectorList({
11473
11511
  client,
11474
11512
  xpertId,
11475
- projectId,
11513
+ projectId: projectId2,
11476
11514
  selectedBindingIds = [],
11477
11515
  onSelectionChange,
11478
11516
  apiUrl
11479
11517
  }) {
11480
11518
  const { t, i18n: i18n2 } = useChatkitTranslation();
11481
- const catalog = useConnectorCatalog(client, xpertId, projectId);
11519
+ const catalog = useConnectorCatalog(client, xpertId, projectId2);
11482
11520
  const [query, setQuery] = React39.useState("");
11483
11521
  const [target, setTarget] = React39.useState(null);
11484
11522
  const latest = React39.useRef({ selectedBindingIds, onSelectionChange });
@@ -12704,6 +12742,7 @@ function ProjectSelector({
12704
12742
  activeProjectId,
12705
12743
  selection,
12706
12744
  autoNewEnabled = false,
12745
+ autoNewMode = "on-send",
12707
12746
  allowNone = true,
12708
12747
  disabled = false,
12709
12748
  locked = false,
@@ -12996,7 +13035,7 @@ function ProjectSelector({
12996
13035
  "aria-label": t("composer.projects.select"),
12997
13036
  children: [
12998
13037
  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react27.Folder, { className: "size-3.5 shrink-0" }),
12999
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "truncate", children: activeProject?.name ?? activeLabel ?? (selection?.mode === "auto-new" ? t("composer.projects.autoNew") : selection?.mode === "none" ? t("composer.projects.none") : void 0) ?? t("composer.projects.select") }),
13038
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "truncate", children: activeProject?.name ?? activeLabel ?? (selection?.mode === "auto-new" ? t(autoNewMode === "after-confirmation" ? "composer.projects.confirmNew" : "composer.projects.autoNew") : selection?.mode === "none" ? t("composer.projects.none") : void 0) ?? t("composer.projects.select") }),
13000
13039
  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react27.ChevronDown, { className: "size-3.5 shrink-0" })
13001
13040
  ]
13002
13041
  }
@@ -13258,7 +13297,7 @@ function ProjectSelector({
13258
13297
  setOpen(false);
13259
13298
  },
13260
13299
  children: [
13261
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "flex-1", children: t("composer.projects.autoNew") }),
13300
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "flex-1", children: t(autoNewMode === "after-confirmation" ? "composer.projects.confirmNew" : "composer.projects.autoNew") }),
13262
13301
  !activeProjectId && selection?.mode === "auto-new" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react27.Check, { className: "size-4 shrink-0" }) : null
13263
13302
  ]
13264
13303
  }
@@ -13748,7 +13787,7 @@ var fullCatalog = { search: "", allPages: true };
13748
13787
  function useRuntimeResourceCatalog({
13749
13788
  client,
13750
13789
  assistantId,
13751
- projectId,
13790
+ projectId: projectId2,
13752
13791
  enabled,
13753
13792
  query,
13754
13793
  kind,
@@ -13757,7 +13796,7 @@ function useRuntimeResourceCatalog({
13757
13796
  const { t } = useChatkitTranslation();
13758
13797
  const cache = React47.useMemo(
13759
13798
  () => ({
13760
- scope: { client, assistantId, projectId },
13799
+ scope: { client, assistantId, projectId: projectId2 },
13761
13800
  entries: /* @__PURE__ */ new Map(),
13762
13801
  known: /* @__PURE__ */ new Map(),
13763
13802
  // Historical metadata is presentation-only; it is never proof of availability.
@@ -13765,7 +13804,7 @@ function useRuntimeResourceCatalog({
13765
13804
  verified: /* @__PURE__ */ new Map(),
13766
13805
  controllers: /* @__PURE__ */ new Set()
13767
13806
  }),
13768
- [client, assistantId, projectId]
13807
+ [client, assistantId, projectId2]
13769
13808
  );
13770
13809
  const [revision, redraw] = React47.useReducer((value) => value + 1, 0);
13771
13810
  const [actionError, setLoadError] = React47.useState(null);
@@ -13792,7 +13831,7 @@ function useRuntimeResourceCatalog({
13792
13831
  }, [cache, refresh]);
13793
13832
  const load = React47.useCallback(
13794
13833
  async (target, more = false) => {
13795
- const { client: client2, assistantId: assistantId2, projectId: projectId2 } = cache.scope;
13834
+ const { client: client2, assistantId: assistantId2, projectId: projectId3 } = cache.scope;
13796
13835
  const key2 = catalogKey(target);
13797
13836
  const existing = cache.entries.get(key2);
13798
13837
  if (existing?.loading || !more && (existing?.loaded || existing?.error))
@@ -13814,7 +13853,7 @@ function useRuntimeResourceCatalog({
13814
13853
  try {
13815
13854
  do {
13816
13855
  const result = await client2.assistants.getResources(assistantId2, {
13817
- projectId: projectId2 ?? void 0,
13856
+ projectId: projectId3 ?? void 0,
13818
13857
  search: target.search || void 0,
13819
13858
  kind: target.kind,
13820
13859
  offset: entry2.offset,
@@ -13886,7 +13925,7 @@ function useRuntimeResourceCatalog({
13886
13925
  { bindingId: resource.bindingId, version: resource.version }
13887
13926
  ]
13888
13927
  },
13889
- projectId ?? void 0
13928
+ projectId2 ?? void 0
13890
13929
  ).then(() => {
13891
13930
  if (!abort.signal.aborted)
13892
13931
  cache.verified.set(key2, "previous_version");
@@ -13907,7 +13946,7 @@ function useRuntimeResourceCatalog({
13907
13946
  selectedResources,
13908
13947
  client,
13909
13948
  assistantId,
13910
- projectId,
13949
+ projectId2,
13911
13950
  revision
13912
13951
  ]);
13913
13952
  const selectedItems = selectedResources.map(
@@ -13975,7 +14014,7 @@ function useCompactMenu() {
13975
14014
  function RuntimeResourceSelector({
13976
14015
  client,
13977
14016
  assistantId,
13978
- projectId,
14017
+ projectId: projectId2,
13979
14018
  selection,
13980
14019
  busy,
13981
14020
  canEditResources = true,
@@ -14012,7 +14051,7 @@ function RuntimeResourceSelector({
14012
14051
  const connectors = useConnectorCatalog(
14013
14052
  client,
14014
14053
  assistantId,
14015
- projectId,
14054
+ projectId2,
14016
14055
  connectorsEnabled && (open || expanded || connectorBindingIds.length > 0)
14017
14056
  );
14018
14057
  const latest = React48.useRef({
@@ -14030,7 +14069,7 @@ function RuntimeResourceSelector({
14030
14069
  const catalog = useRuntimeResourceCatalog({
14031
14070
  client,
14032
14071
  assistantId,
14033
- projectId,
14072
+ projectId: projectId2,
14034
14073
  enabled: open || expanded || selection.resources.length > 0,
14035
14074
  query: active || expanded ? query : rootQuery,
14036
14075
  kind: expanded ? browseKind : active ?? void 0,
@@ -14044,7 +14083,7 @@ function RuntimeResourceSelector({
14044
14083
  setQuery("");
14045
14084
  setRootQuery("");
14046
14085
  setAuthorization(null);
14047
- }, [assistantId, projectId]);
14086
+ }, [assistantId, projectId2]);
14048
14087
  const selected = new Set(selection.resources.map((item) => item.bindingId));
14049
14088
  const selectedItems = catalog.selectedItems;
14050
14089
  const selectedResources = selectedItems.filter(
@@ -14158,7 +14197,7 @@ function RuntimeResourceSelector({
14158
14197
  bindingId: item.bindingId,
14159
14198
  version: item.version,
14160
14199
  serverName,
14161
- projectId: projectId ?? void 0
14200
+ projectId: projectId2 ?? void 0
14162
14201
  }),
14163
14202
  onAuthorized: async (signal) => {
14164
14203
  let offset = 0;
@@ -14166,7 +14205,7 @@ function RuntimeResourceSelector({
14166
14205
  let fresh;
14167
14206
  do {
14168
14207
  const page = await client.assistants.getResources(assistantId, {
14169
- projectId: projectId ?? void 0,
14208
+ projectId: projectId2 ?? void 0,
14170
14209
  kind: "agent_plugin",
14171
14210
  search: item.title,
14172
14211
  signal,
@@ -14641,6 +14680,7 @@ function SendButton({
14641
14680
  stopDisabled = false,
14642
14681
  onStop,
14643
14682
  stopLabel = "Stop",
14683
+ stopIcon = "stop",
14644
14684
  showResume = false,
14645
14685
  resumeDisabled = false,
14646
14686
  onResume,
@@ -14650,7 +14690,7 @@ function SendButton({
14650
14690
  }) {
14651
14691
  if (showStop || showResume) {
14652
14692
  const label = showStop ? stopLabel : resumeLabel;
14653
- const Icon = showStop ? import_lucide_react31.Square : import_lucide_react31.Play;
14693
+ const Icon = showStop ? stopIcon === "pause" ? import_lucide_react31.Pause : import_lucide_react31.Square : import_lucide_react31.Play;
14654
14694
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14655
14695
  "button",
14656
14696
  {
@@ -14747,7 +14787,7 @@ function flattenWorkspaceFiles(files) {
14747
14787
  var WorkspaceFileMentionPalette = React49.forwardRef(function WorkspaceFileMentionPalette2({
14748
14788
  client,
14749
14789
  assistantId,
14750
- projectId,
14790
+ projectId: projectId2,
14751
14791
  query,
14752
14792
  selectedFilePaths,
14753
14793
  onSelect,
@@ -14763,7 +14803,7 @@ var WorkspaceFileMentionPalette = React49.forwardRef(function WorkspaceFileMenti
14763
14803
  const optionRefs = React49.useRef([]);
14764
14804
  const loadErrorMessage = t("composer.fileMentions.loadError");
14765
14805
  React49.useEffect(() => {
14766
- if (!client || !projectId && !assistantId) {
14806
+ if (!client || !projectId2 && !assistantId) {
14767
14807
  setFiles([]);
14768
14808
  setLoading(false);
14769
14809
  setError(null);
@@ -14772,7 +14812,7 @@ var WorkspaceFileMentionPalette = React49.forwardRef(function WorkspaceFileMenti
14772
14812
  const controller = new AbortController();
14773
14813
  setLoading(true);
14774
14814
  setError(null);
14775
- const request = projectId ? client.projects.listFiles(projectId, {
14815
+ const request = projectId2 ? client.projects.listFiles(projectId2, {
14776
14816
  depth: WORKSPACE_FILE_LIST_DEPTH,
14777
14817
  signal: controller.signal
14778
14818
  }) : client.xperts.listWorkspaceFiles(assistantId, {
@@ -14792,7 +14832,7 @@ var WorkspaceFileMentionPalette = React49.forwardRef(function WorkspaceFileMenti
14792
14832
  if (!controller.signal.aborted) setLoading(false);
14793
14833
  });
14794
14834
  return () => controller.abort();
14795
- }, [assistantId, client, loadErrorMessage, projectId]);
14835
+ }, [assistantId, client, loadErrorMessage, projectId2]);
14796
14836
  const normalizedQuery = query.trim().toLocaleLowerCase();
14797
14837
  const visibleFiles = React49.useMemo(
14798
14838
  () => files.filter((file) => {
@@ -14831,7 +14871,7 @@ var WorkspaceFileMentionPalette = React49.forwardRef(function WorkspaceFileMenti
14831
14871
  }),
14832
14872
  [onSelect, visibleFiles]
14833
14873
  );
14834
- const unavailable = !client || !projectId && !assistantId;
14874
+ const unavailable = !client || !projectId2 && !assistantId;
14835
14875
  return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
14836
14876
  "div",
14837
14877
  {
@@ -15329,7 +15369,7 @@ function ChatComposerForm({
15329
15369
  isChangingBranch,
15330
15370
  handleComposerRunControl,
15331
15371
  isRunPaused,
15332
- canRevealPausedDisplay,
15372
+ isStoppingRun,
15333
15373
  isRunPausing,
15334
15374
  isResumingRun,
15335
15375
  currentRunControl,
@@ -15545,17 +15585,18 @@ function ChatComposerForm({
15545
15585
  }
15546
15586
  }
15547
15587
  ),
15588
+ isRunPausing && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { role: "status", className: "text-xs text-muted-foreground", title: t("threadControl.pausingDescription"), children: t("threadControl.pausing") }),
15548
15589
  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
15549
15590
  SendButton,
15550
15591
  {
15551
15592
  disabled: isSendDisabled,
15552
15593
  isLoading: stream.isLoading,
15553
15594
  showStop: !isPauseActive && (stream.isLoading || canPauseRun) && (!hasComposerInput || hasPendingInteractiveRequest),
15554
- stopDisabled: isChangingBranch || !canPauseRun,
15595
+ stopDisabled: isChangingBranch || isStoppingRun || !canPauseRun,
15555
15596
  onStop: () => void handleComposerRunControl("pause"),
15556
- stopLabel: t("threadControl.pause"),
15597
+ stopLabel: t("threadControl.stop"),
15557
15598
  showResume: isPauseActive && !hasComposerInput,
15558
- resumeDisabled: !isRunPaused && !canRevealPausedDisplay || isRunPausing || isResumingRun || isChangingBranch || !currentRunControl?.pauseId && !canRevealPausedDisplay,
15599
+ resumeDisabled: !isRunPaused || isStoppingRun || isRunPausing || isResumingRun || isChangingBranch || !currentRunControl?.pauseId,
15559
15600
  onResume: () => void handleComposerRunControl("resume"),
15560
15601
  resumeLabel: t("threadControl.resume"),
15561
15602
  sendLabel: t("chat.send"),
@@ -15588,6 +15629,7 @@ function ChatComposerForm({
15588
15629
  activeProjectId,
15589
15630
  selection: projectSelection,
15590
15631
  autoNewEnabled: options?.composer?.projects?.autoNewEnabled,
15632
+ autoNewMode: options?.composer?.projects?.autoNewMode,
15591
15633
  allowNone: options?.composer?.projects?.allowNone,
15592
15634
  locked: isProjectScopeLocked,
15593
15635
  label: options?.composer?.projects?.label,
@@ -19306,6 +19348,7 @@ function useChatSubmission({
19306
19348
  composerPartsRef,
19307
19349
  stream,
19308
19350
  isRunPaused,
19351
+ clearRunControlError,
19309
19352
  planModeEnabled,
19310
19353
  getRuntimeCapabilitiesForSubmit,
19311
19354
  promptWorkflow,
@@ -19351,6 +19394,7 @@ function useChatSubmission({
19351
19394
  if (!humanInput) {
19352
19395
  return;
19353
19396
  }
19397
+ clearRunControlError();
19354
19398
  const {
19355
19399
  runtimeCapabilitiesForSubmit,
19356
19400
  runtimeCapabilityOptionsForMessage
@@ -19490,6 +19534,7 @@ function useChatSubmission({
19490
19534
  promptWorkflow,
19491
19535
  isSubmissionBlocked,
19492
19536
  isRunPaused,
19537
+ clearRunControlError,
19493
19538
  options?.request,
19494
19539
  persistSessionRuntimeCapabilities,
19495
19540
  resourcesEnabled,
@@ -20438,7 +20483,7 @@ function createXpertThreadGoalAdapter(client, scope) {
20438
20483
  async setGoal({
20439
20484
  threadId,
20440
20485
  assistantId,
20441
- projectId,
20486
+ projectId: projectId2,
20442
20487
  objective,
20443
20488
  runtimeCapabilities,
20444
20489
  signal
@@ -20458,7 +20503,7 @@ function createXpertThreadGoalAdapter(client, scope) {
20458
20503
  normalizedThreadId,
20459
20504
  {
20460
20505
  xpertId: scope.xpertId,
20461
- projectId: projectId ?? scope.projectId
20506
+ projectId: projectId2 ?? scope.projectId
20462
20507
  }
20463
20508
  );
20464
20509
  const goal = await setGoal(
@@ -20490,7 +20535,7 @@ function createXpertThreadGoalAdapter(client, scope) {
20490
20535
  },
20491
20536
  {
20492
20537
  assistantId,
20493
- projectId,
20538
+ projectId: projectId2,
20494
20539
  runtimeCapabilities,
20495
20540
  onThreadCreated: (resolvedThreadId) => {
20496
20541
  createdThreadId = resolvedThreadId;
@@ -21745,13 +21790,13 @@ var PAGE_SIZE = 50;
21745
21790
  function useMessageHistory({
21746
21791
  client,
21747
21792
  assistantId,
21748
- projectId,
21793
+ projectId: projectId2,
21749
21794
  enabled,
21750
21795
  query,
21751
21796
  scope
21752
21797
  }) {
21753
21798
  const { t } = useChatkitTranslation();
21754
- const filterProjectId = scope === "no-project" ? null : scope === "current-project" ? projectId : void 0;
21799
+ const filterProjectId = scope === "no-project" ? null : scope === "current-project" ? projectId2 : void 0;
21755
21800
  const search = query.trim();
21756
21801
  const request = React74.useMemo(
21757
21802
  () => ({
@@ -21982,7 +22027,7 @@ function useThreads(limit = DEFAULT_LIMIT, enabled = true, scope = "all") {
21982
22027
  client,
21983
22028
  threadId,
21984
22029
  assistantId,
21985
- projectId,
22030
+ projectId: projectId2,
21986
22031
  isReady,
21987
22032
  isLoading: isStreamLoading,
21988
22033
  error: streamError
@@ -21990,7 +22035,7 @@ function useThreads(limit = DEFAULT_LIMIT, enabled = true, scope = "all") {
21990
22035
  const [threadRecords, setThreadRecords] = React75.useState([]);
21991
22036
  const [isLoading, setIsLoading] = React75.useState(false);
21992
22037
  const [error, setError] = React75.useState(null);
21993
- const filterProjectId = scope === "no-project" ? null : scope === "current-project" ? projectId : void 0;
22038
+ const filterProjectId = scope === "no-project" ? null : scope === "current-project" ? projectId2 : void 0;
21994
22039
  const searchRequest = React75.useRef(null);
21995
22040
  React75.useEffect(() => {
21996
22041
  setThreadRecords([]);
@@ -22041,7 +22086,7 @@ function useThreads(limit = DEFAULT_LIMIT, enabled = true, scope = "all") {
22041
22086
  setError(null);
22042
22087
  const payload = {
22043
22088
  xpertId: assistantId,
22044
- ...projectId ? { projectId } : {}
22089
+ ...projectId2 ? { projectId: projectId2 } : {}
22045
22090
  };
22046
22091
  if (input?.recordId) payload.id = input.recordId;
22047
22092
  if (input?.threadId) payload.threadId = input.threadId;
@@ -22051,7 +22096,7 @@ function useThreads(limit = DEFAULT_LIMIT, enabled = true, scope = "all") {
22051
22096
  upsertThreadRecord(created);
22052
22097
  return created;
22053
22098
  },
22054
- [assistantId, client, projectId, upsertThreadRecord]
22099
+ [assistantId, client, projectId2, upsertThreadRecord]
22055
22100
  );
22056
22101
  const updateThread = React75.useCallback(
22057
22102
  async (recordId, payload) => {
@@ -22141,7 +22186,7 @@ function useThreads(limit = DEFAULT_LIMIT, enabled = true, scope = "all") {
22141
22186
  client,
22142
22187
  isReady,
22143
22188
  isStreamLoading,
22144
- projectId,
22189
+ projectId2,
22145
22190
  threadId,
22146
22191
  upsertThreadRecord
22147
22192
  ]);
@@ -22687,7 +22732,7 @@ function ThreadHistoryStatus({
22687
22732
  }
22688
22733
 
22689
22734
  // src/components/thread/MessageList.tsx
22690
- var import_chatkit_types29 = require("@xpert-ai/chatkit-types");
22735
+ var import_chatkit_types30 = require("@xpert-ai/chatkit-types");
22691
22736
 
22692
22737
  // src/components/thread/messages/call-ended.tsx
22693
22738
  var import_lucide_react52 = require("lucide-react");
@@ -23216,8 +23261,8 @@ function getBubbleCompletionStatus(status) {
23216
23261
  }
23217
23262
 
23218
23263
  // src/components/thread/MessageList.tsx
23219
- var import_chatkit_types30 = require("@xpert-ai/chatkit-types");
23220
- var import_lucide_react72 = require("lucide-react");
23264
+ var import_chatkit_types31 = require("@xpert-ai/chatkit-types");
23265
+ var import_lucide_react73 = require("lucide-react");
23221
23266
 
23222
23267
  // src/lib/assistant-presentation.ts
23223
23268
  var import_chatkit_types22 = require("@xpert-ai/chatkit-types");
@@ -25533,7 +25578,7 @@ function getVisibleHumanAttachments(attachments, references) {
25533
25578
  }
25534
25579
 
25535
25580
  // src/components/thread/messages/assistant-blocks.tsx
25536
- var React101 = __toESM(require("react"), 1);
25581
+ var React102 = __toESM(require("react"), 1);
25537
25582
  var import_lucide_react65 = require("lucide-react");
25538
25583
 
25539
25584
  // src/lib/scroll.ts
@@ -26831,7 +26876,7 @@ function formatStepDuration2(durationMs) {
26831
26876
  }
26832
26877
  return `${minutes}m ${seconds}s`;
26833
26878
  }
26834
- function getAgentRunStatusConfig(status, hasReply = false) {
26879
+ function getAgentRunStatusConfig(status, hasReply = false, outcome) {
26835
26880
  const normalized = normalizeRunStatus(status);
26836
26881
  if (normalized === "running") {
26837
26882
  return {
@@ -26841,6 +26886,14 @@ function getAgentRunStatusConfig(status, hasReply = false) {
26841
26886
  spin: true
26842
26887
  };
26843
26888
  }
26889
+ if ((normalized === "success" || normalized === "succeeded") && outcome) {
26890
+ return {
26891
+ icon: outcome.accepted ? import_lucide_react62.CheckCircle2 : outcome.status === "failed" ? import_lucide_react62.XCircle : import_lucide_react62.Info,
26892
+ iconClass: outcome.accepted ? "text-muted-foreground" : "text-destructive",
26893
+ labelKey: `business_${outcome.status}`,
26894
+ spin: false
26895
+ };
26896
+ }
26844
26897
  if (normalized === "success" || normalized === "succeeded") {
26845
26898
  return {
26846
26899
  icon: import_lucide_react62.CheckCircle2,
@@ -26943,7 +26996,8 @@ function AgentRunGroup({
26943
26996
  const counts = getAgentRunCounts(node);
26944
26997
  const statusConfig = getAgentRunStatusConfig(
26945
26998
  node.info.status,
26946
- counts.text > 0
26999
+ counts.text > 0,
27000
+ node.info.businessOutcome
26947
27001
  );
26948
27002
  const StatusIcon = statusConfig.icon;
26949
27003
  const isRunning = isRunningRunStatus(node.info.status);
@@ -27596,10 +27650,10 @@ function hasLegacySurface(surface) {
27596
27650
  }
27597
27651
 
27598
27652
  // src/components/thread/messages/mcp-app.tsx
27599
- var import_chatkit_types26 = require("@xpert-ai/chatkit-types");
27653
+ var import_chatkit_types27 = require("@xpert-ai/chatkit-types");
27600
27654
  var import_lodash_es2 = require("lodash-es");
27601
27655
  var import_lucide_react64 = require("lucide-react");
27602
- var React100 = __toESM(require("react"), 1);
27656
+ var React101 = __toESM(require("react"), 1);
27603
27657
 
27604
27658
  // src/components/thread/messages/mcp-app/resource/values.ts
27605
27659
  function isRecord6(value) {
@@ -27855,6 +27909,7 @@ function normalizeMcpAppResourceResponse(value, data) {
27855
27909
  html,
27856
27910
  appInstanceToken: readString4(raw.appInstanceToken),
27857
27911
  resourceUri: readString4(raw.resourceUri),
27912
+ refresh: readRefresh(raw.refresh),
27858
27913
  title: resourceInfo.title,
27859
27914
  description: resourceInfo.description,
27860
27915
  icon: resourceInfo.icon,
@@ -27872,6 +27927,13 @@ function normalizeMcpAppResourceResponse(value, data) {
27872
27927
  function isMcpAppComponentData(data) {
27873
27928
  return isRecord6(data) && data.type === "McpApp" && typeof data.appInstanceId === "string" && typeof data.resourceUri === "string";
27874
27929
  }
27930
+ function readRefresh(value) {
27931
+ const raw = readRecord(value);
27932
+ const toolName = raw && readString4(raw.toolName);
27933
+ if (!raw || !toolName) return void 0;
27934
+ if (raw.arguments !== void 0 && !isRecord6(raw.arguments)) return void 0;
27935
+ return { toolName, arguments: readRecord(raw.arguments) };
27936
+ }
27875
27937
 
27876
27938
  // src/components/thread/messages/mcp-app/sandbox/policy.ts
27877
27939
  function domains(values) {
@@ -28422,7 +28484,27 @@ function useMcpAppApprovals({
28422
28484
  return { clearPendingApproval, dispatchHostRpc, resolvePendingApproval };
28423
28485
  }
28424
28486
 
28487
+ // src/components/thread/messages/mcp-app/bridge/project-link.ts
28488
+ var import_zod2 = require("zod");
28489
+ var projectId = import_zod2.z.string().uuid();
28490
+ function parseMcpAppProjectLink(href) {
28491
+ try {
28492
+ const url = new URL(href);
28493
+ if (url.protocol !== "xpert:" || url.hostname !== "project" || url.username || url.password || url.port || url.hash)
28494
+ return null;
28495
+ const id = projectId.safeParse(decodeURIComponent(url.pathname.slice(1)));
28496
+ const viewKey = url.searchParams.get("viewKey");
28497
+ if (!id.success || !viewKey || !/^[\w.-]+__[\w.-]+$/.test(viewKey))
28498
+ return null;
28499
+ if (url.searchParams.size !== 1) return null;
28500
+ return { projectId: id.data, viewKey };
28501
+ } catch {
28502
+ return null;
28503
+ }
28504
+ }
28505
+
28425
28506
  // src/components/thread/messages/mcp-app/bridge/useMcpAppBridge.ts
28507
+ var import_chatkit_types26 = require("@xpert-ai/chatkit-types");
28426
28508
  var React96 = __toESM(require("react"), 1);
28427
28509
 
28428
28510
  // src/components/thread/messages/mcp-app/sandbox/html.ts
@@ -28576,6 +28658,10 @@ function buildMcpAppTheme(element) {
28576
28658
  "--mcp-app-font-mono": sanitizeCssValue(
28577
28659
  readHostCssVariable(source, "--font-mono") || "ui-monospace, SFMono-Regular, Menlo, monospace"
28578
28660
  ),
28661
+ // Resolve rem-based host typography before crossing the iframe boundary.
28662
+ "--mcp-app-font-size": sanitizeCssValue(
28663
+ window.getComputedStyle(document.documentElement).fontSize || "16px"
28664
+ ),
28579
28665
  "--mcp-app-radius": sanitizeCssValue(
28580
28666
  readHostCssVariable(source, "--radius") || "0.5rem"
28581
28667
  )
@@ -28594,7 +28680,7 @@ function buildMcpAppTheme(element) {
28594
28680
  }
28595
28681
  function injectMcpAppTheme(html, theme) {
28596
28682
  const declarations = Object.entries(theme.cssVariables).map(([name, value]) => `${name}: ${sanitizeCssValue(value)};`).join("");
28597
- const style = `<style id="mcp-app-host-theme">:root{font-size:14px;color-scheme:${theme.mode};${declarations}}</style>`;
28683
+ const style = `<style id="mcp-app-host-theme">:root{font-size:var(--mcp-app-font-size,16px);color-scheme:${theme.mode};${declarations}}</style>`;
28598
28684
  return injectHeadContent(html, style);
28599
28685
  }
28600
28686
 
@@ -28603,6 +28689,7 @@ function standardMcpAppStyles(legacy) {
28603
28689
  const mapping = {
28604
28690
  "--font-sans": "--mcp-app-font-sans",
28605
28691
  "--font-mono": "--mcp-app-font-mono",
28692
+ "--font-text-md-size": "--mcp-app-font-size",
28606
28693
  "--border-radius-md": "--mcp-app-radius",
28607
28694
  "--color-background-primary": "--mcp-app-color-background",
28608
28695
  "--color-background-secondary": "--mcp-app-color-card",
@@ -28615,7 +28702,9 @@ function standardMcpAppStyles(legacy) {
28615
28702
  "--color-border-primary": "--mcp-app-color-border",
28616
28703
  "--color-ring-primary": "--mcp-app-color-ring"
28617
28704
  };
28618
- return Object.fromEntries(Object.entries(mapping).filter(([, source]) => legacy[source]).map(([key, source]) => [key, legacy[source]]));
28705
+ return Object.fromEntries(
28706
+ Object.entries(mapping).filter(([, source]) => legacy[source]).map(([key, source]) => [key, legacy[source]])
28707
+ );
28619
28708
  }
28620
28709
 
28621
28710
  // src/components/thread/messages/mcp-app/bridge/chat-input.ts
@@ -28770,6 +28859,7 @@ function useMcpAppBridge({
28770
28859
  streamIsLoading,
28771
28860
  dispatchHostRpc
28772
28861
  }) {
28862
+ const { openProject } = useWorkbench();
28773
28863
  React96.useEffect(() => {
28774
28864
  if (!initializedRef.current) return;
28775
28865
  postToApp({
@@ -28781,6 +28871,27 @@ function useMcpAppBridge({
28781
28871
  }
28782
28872
  });
28783
28873
  }, [displayMode, height, postToApp]);
28874
+ React96.useEffect(() => {
28875
+ const notifyTheme = () => {
28876
+ if (!initializedRef.current) return;
28877
+ const theme = buildMcpAppTheme(containerRef.current);
28878
+ postToApp({
28879
+ jsonrpc: "2.0",
28880
+ method: "ui/notifications/host-context-changed",
28881
+ params: {
28882
+ theme: theme.mode,
28883
+ styles: { variables: standardMcpAppStyles(theme.cssVariables) },
28884
+ themeCssVariables: theme.cssVariables
28885
+ }
28886
+ });
28887
+ };
28888
+ const observer = new MutationObserver(notifyTheme);
28889
+ observer.observe(document.documentElement, {
28890
+ attributes: true,
28891
+ attributeFilter: ["style", "class", "data-theme"]
28892
+ });
28893
+ return () => observer.disconnect();
28894
+ }, [postToApp]);
28784
28895
  React96.useEffect(() => {
28785
28896
  const handleMessage = async (event) => {
28786
28897
  if (event.source !== iframeRef.current?.contentWindow) {
@@ -28857,7 +28968,18 @@ function useMcpAppBridge({
28857
28968
  initializedRef.current = true;
28858
28969
  const permissions = resource?.permissions ?? data.permissions;
28859
28970
  const csp = resource?.csp ?? data.csp;
28860
- const toolInfo = resource?.toolInfo ?? normalizeMcpAppToolInfo(void 0, data);
28971
+ const rawToolInfo = resource?.toolInfo ?? normalizeMcpAppToolInfo(void 0, data);
28972
+ const toolInfo = {
28973
+ ...rawToolInfo,
28974
+ tool: {
28975
+ ...rawToolInfo.tool,
28976
+ title: (0, import_chatkit_types26.resolveLocalizedText)(rawToolInfo.tool.title, i18n2.language) ?? rawToolInfo.tool.name,
28977
+ description: (0, import_chatkit_types26.resolveLocalizedText)(
28978
+ rawToolInfo.tool.description,
28979
+ i18n2.language
28980
+ ) ?? void 0
28981
+ }
28982
+ };
28861
28983
  const theme = buildMcpAppTheme(containerRef.current);
28862
28984
  const hostLocale = normalizeHostLocale(i18n2.language);
28863
28985
  const hostLanguage = getLocaleLanguage(hostLocale);
@@ -28874,6 +28996,7 @@ function useMcpAppBridge({
28874
28996
  serverTools: {},
28875
28997
  serverResources: {},
28876
28998
  openLinks: {},
28999
+ ...openProject ? { experimental: { "xpert/workbench": { openProject: true } } } : {},
28877
29000
  logging: {},
28878
29001
  message: {
28879
29002
  text: {},
@@ -28941,6 +29064,28 @@ function useMcpAppBridge({
28941
29064
  }
28942
29065
  if (request.method === "ui/open-link") {
28943
29066
  const href = isRecord6(request.params) && typeof request.params.url === "string" ? request.params.url : isRecord6(request.params) && typeof request.params.href === "string" ? request.params.href : null;
29067
+ const projectLink = href ? parseMcpAppProjectLink(href) : null;
29068
+ if (projectLink) {
29069
+ try {
29070
+ const response = await openProject?.(
29071
+ projectLink.projectId,
29072
+ projectLink.viewKey
29073
+ );
29074
+ if (!isRecord6(response) || response.success !== true) {
29075
+ postToApp(
29076
+ jsonRpcError(
29077
+ request.id,
29078
+ i18n2.t("message.mcpApp.openProjectFailed")
29079
+ )
29080
+ );
29081
+ } else {
29082
+ postToApp(jsonRpcResult(request.id, {}));
29083
+ }
29084
+ } catch (cause) {
29085
+ postToApp(jsonRpcError(request.id, getErrorMessage2(cause)));
29086
+ }
29087
+ return;
29088
+ }
28944
29089
  if (!href || !isHttpUrl(href)) {
28945
29090
  if (request.id !== void 0) {
28946
29091
  postToApp(jsonRpcError(request.id, "Invalid URL"));
@@ -29044,6 +29189,7 @@ function useMcpAppBridge({
29044
29189
  client,
29045
29190
  data,
29046
29191
  dispatchHostRpc,
29192
+ openProject,
29047
29193
  displayMode,
29048
29194
  i18n2.language,
29049
29195
  messageId,
@@ -29061,8 +29207,68 @@ function useMcpAppBridge({
29061
29207
  ]);
29062
29208
  }
29063
29209
 
29064
- // src/components/thread/messages/mcp-app/resource/useMcpAppResource.ts
29210
+ // src/components/thread/messages/mcp-app/resource/useMcpAppRefresh.ts
29065
29211
  var React97 = __toESM(require("react"), 1);
29212
+ function useMcpAppRefresh(options) {
29213
+ const [refreshing, setRefreshing] = React97.useState(false);
29214
+ const [error, setError] = React97.useState(null);
29215
+ const active = React97.useRef(null);
29216
+ React97.useEffect(() => {
29217
+ active.current = null;
29218
+ setRefreshing(false);
29219
+ setError(null);
29220
+ return () => {
29221
+ active.current = null;
29222
+ };
29223
+ }, [options.identity]);
29224
+ const refresh = async () => {
29225
+ if (!options.refresh || !options.ready.current || active.current) return;
29226
+ const operation = /* @__PURE__ */ Symbol();
29227
+ active.current = operation;
29228
+ setRefreshing(true);
29229
+ setError(null);
29230
+ try {
29231
+ const response = await options.call({
29232
+ jsonrpc: "2.0",
29233
+ id: `refresh-${Date.now()}`,
29234
+ method: "tools/call",
29235
+ params: {
29236
+ name: options.refresh.toolName,
29237
+ arguments: options.refresh.arguments ?? {}
29238
+ }
29239
+ });
29240
+ if (active.current !== operation) return;
29241
+ if (!isRecord6(response) || response.error || !("result" in response))
29242
+ throw Error(options.failureMessage);
29243
+ const result = normalizeCallToolResult(response.result);
29244
+ if (result.isError) {
29245
+ const text = result.content.find(
29246
+ (item) => item.type === "text" && typeof item.text === "string"
29247
+ )?.text;
29248
+ throw Error(typeof text === "string" ? text : options.failureMessage);
29249
+ }
29250
+ options.post({
29251
+ jsonrpc: "2.0",
29252
+ method: "ui/notifications/tool-result",
29253
+ params: result
29254
+ });
29255
+ } catch (cause) {
29256
+ if (active.current === operation)
29257
+ setError(
29258
+ cause instanceof Error ? cause.message : options.failureMessage
29259
+ );
29260
+ } finally {
29261
+ if (active.current === operation) {
29262
+ active.current = null;
29263
+ setRefreshing(false);
29264
+ }
29265
+ }
29266
+ };
29267
+ return { refresh, refreshing, error };
29268
+ }
29269
+
29270
+ // src/components/thread/messages/mcp-app/resource/useMcpAppResource.ts
29271
+ var React98 = __toESM(require("react"), 1);
29066
29272
  function useMcpAppResource({
29067
29273
  initializedRef,
29068
29274
  sentInitialResultRef,
@@ -29088,7 +29294,7 @@ function useMcpAppResource({
29088
29294
  i18n: i18n2,
29089
29295
  containerRef
29090
29296
  }) {
29091
- const sendInitialToolNotifications = React97.useCallback(() => {
29297
+ const sendInitialToolNotifications = React98.useCallback(() => {
29092
29298
  if (!initializedRef.current || sentInitialResultRef.current || !resource) {
29093
29299
  return;
29094
29300
  }
@@ -29115,7 +29321,7 @@ function useMcpAppResource({
29115
29321
  }
29116
29322
  });
29117
29323
  }, [data.toolCallId, data.toolName, postToApp, resource]);
29118
- React97.useEffect(() => {
29324
+ React98.useEffect(() => {
29119
29325
  const controller = new AbortController();
29120
29326
  initializedRef.current = false;
29121
29327
  sentInitialResultRef.current = false;
@@ -29184,37 +29390,37 @@ function useMcpAppResource({
29184
29390
  }
29185
29391
 
29186
29392
  // src/components/thread/messages/mcp-app/session/useMcpAppState.ts
29187
- var React98 = __toESM(require("react"), 1);
29393
+ var React99 = __toESM(require("react"), 1);
29188
29394
  function useMcpAppState({ data }) {
29189
- const iframeRef = React98.useRef(null);
29190
- const appWindowRef = React98.useRef(null);
29191
- const containerRef = React98.useRef(null);
29192
- const initializedRef = React98.useRef(false);
29193
- const sentInitialResultRef = React98.useRef(false);
29194
- const modelContextRef = React98.useRef(null);
29195
- const pendingApprovalRef = React98.useRef(null);
29196
- const approvalActionRef = React98.useRef(null);
29197
- const runtimeAppInstanceTokenRef = React98.useRef(
29395
+ const iframeRef = React99.useRef(null);
29396
+ const appWindowRef = React99.useRef(null);
29397
+ const containerRef = React99.useRef(null);
29398
+ const initializedRef = React99.useRef(false);
29399
+ const sentInitialResultRef = React99.useRef(false);
29400
+ const modelContextRef = React99.useRef(null);
29401
+ const pendingApprovalRef = React99.useRef(null);
29402
+ const approvalActionRef = React99.useRef(null);
29403
+ const runtimeAppInstanceTokenRef = React99.useRef(
29198
29404
  data.appInstanceToken
29199
29405
  );
29200
- const teardownGenerationRef = React98.useRef(0);
29201
- const teardownStartedRef = React98.useRef(false);
29202
- const activeAppInstanceIdRef = React98.useRef(data.appInstanceId);
29203
- const [resource, setResource] = React98.useState(null);
29204
- const [runtimeAppInstanceToken, setRuntimeAppInstanceToken] = React98.useState(data.appInstanceToken);
29205
- const [srcDoc, setSrcDoc] = React98.useState(null);
29206
- const [height, setHeight] = React98.useState(420);
29207
- const [displayMode, setDisplayMode] = React98.useState("inline");
29208
- const [pendingApproval, setPendingApproval] = React98.useState(null);
29209
- const [approvalAction, setApprovalAction] = React98.useState(null);
29210
- const [approvalError, setApprovalError] = React98.useState(null);
29211
- const [error, setError] = React98.useState(null);
29212
- const [isLoading, setIsLoading] = React98.useState(true);
29213
- const [isTornDown, setIsTornDown] = React98.useState(false);
29214
- React98.useEffect(() => {
29406
+ const teardownGenerationRef = React99.useRef(0);
29407
+ const teardownStartedRef = React99.useRef(false);
29408
+ const activeAppInstanceIdRef = React99.useRef(data.appInstanceId);
29409
+ const [resource, setResource] = React99.useState(null);
29410
+ const [runtimeAppInstanceToken, setRuntimeAppInstanceToken] = React99.useState(data.appInstanceToken);
29411
+ const [srcDoc, setSrcDoc] = React99.useState(null);
29412
+ const [height, setHeight] = React99.useState(420);
29413
+ const [displayMode, setDisplayMode] = React99.useState("inline");
29414
+ const [pendingApproval, setPendingApproval] = React99.useState(null);
29415
+ const [approvalAction, setApprovalAction] = React99.useState(null);
29416
+ const [approvalError, setApprovalError] = React99.useState(null);
29417
+ const [error, setError] = React99.useState(null);
29418
+ const [isLoading, setIsLoading] = React99.useState(true);
29419
+ const [isTornDown, setIsTornDown] = React99.useState(false);
29420
+ React99.useEffect(() => {
29215
29421
  runtimeAppInstanceTokenRef.current = runtimeAppInstanceToken;
29216
29422
  }, [runtimeAppInstanceToken]);
29217
- const bindIframeRef = React98.useCallback(
29423
+ const bindIframeRef = React99.useCallback(
29218
29424
  (iframe) => {
29219
29425
  iframeRef.current = iframe;
29220
29426
  if (iframe?.contentWindow) {
@@ -29263,7 +29469,7 @@ function useMcpAppState({ data }) {
29263
29469
  }
29264
29470
 
29265
29471
  // src/components/thread/messages/mcp-app/session/useMcpAppTeardown.ts
29266
- var React99 = __toESM(require("react"), 1);
29472
+ var React100 = __toESM(require("react"), 1);
29267
29473
  function useMcpAppTeardown({
29268
29474
  teardownGenerationRef,
29269
29475
  activeAppInstanceIdRef,
@@ -29276,11 +29482,11 @@ function useMcpAppTeardown({
29276
29482
  teardownStartedRef,
29277
29483
  client
29278
29484
  }) {
29279
- const isSupersededStrictModeTeardown = React99.useCallback(
29485
+ const isSupersededStrictModeTeardown = React100.useCallback(
29280
29486
  (generation, appInstanceId) => teardownGenerationRef.current !== generation && activeAppInstanceIdRef.current === appInstanceId,
29281
29487
  []
29282
29488
  );
29283
- React99.useEffect(() => {
29489
+ React100.useEffect(() => {
29284
29490
  const generation = ++teardownGenerationRef.current;
29285
29491
  activeAppInstanceIdRef.current = data.appInstanceId;
29286
29492
  return () => {
@@ -29337,7 +29543,7 @@ function McpAppMessage({
29337
29543
  className,
29338
29544
  mcpApps
29339
29545
  }) {
29340
- const dataRef = React100.useRef(incomingData);
29546
+ const dataRef = React101.useRef(incomingData);
29341
29547
  if (!(0, import_lodash_es2.isEqual)(dataRef.current, incomingData)) dataRef.current = incomingData;
29342
29548
  const data = dataRef.current;
29343
29549
  const { i18n: i18n2 } = useChatkitTranslation();
@@ -29349,11 +29555,11 @@ function McpAppMessage({
29349
29555
  conversationId
29350
29556
  } = useStreamContext();
29351
29557
  const state = useMcpAppState({ data });
29352
- const sandboxProxy = React100.useMemo(
29558
+ const sandboxProxy = React101.useMemo(
29353
29559
  () => resolveMcpAppSandboxProxy(mcpApps, state.resource?.domain ?? data.domain),
29354
29560
  [data.domain, mcpApps, state.resource?.domain]
29355
29561
  );
29356
- const postToApp = React100.useCallback(
29562
+ const postToApp = React101.useCallback(
29357
29563
  (message) => {
29358
29564
  state.iframeRef.current?.contentWindow?.postMessage(
29359
29565
  message,
@@ -29362,7 +29568,7 @@ function McpAppMessage({
29362
29568
  },
29363
29569
  [sandboxProxy?.origin]
29364
29570
  );
29365
- const callHostRpc = React100.useCallback(
29571
+ const callHostRpc = React101.useCallback(
29366
29572
  async (request) => {
29367
29573
  return client.mcp.apps.rpc(
29368
29574
  data.appInstanceId,
@@ -29380,6 +29586,14 @@ function McpAppMessage({
29380
29586
  },
29381
29587
  [client, data, messageId, state.runtimeAppInstanceToken]
29382
29588
  );
29589
+ const refresh = useMcpAppRefresh({
29590
+ identity: data.appInstanceId,
29591
+ refresh: state.resource?.refresh,
29592
+ ready: state.initializedRef,
29593
+ call: callHostRpc,
29594
+ post: postToApp,
29595
+ failureMessage: i18n2.t("message.mcpApp.refreshFailed")
29596
+ });
29383
29597
  const approvals = useMcpAppApprovals({
29384
29598
  ...state,
29385
29599
  postToApp,
@@ -29398,7 +29612,7 @@ function McpAppMessage({
29398
29612
  });
29399
29613
  useMcpAppTeardown({ ...state, data, sandboxProxy, messageId, client });
29400
29614
  useMcpAppApprovalExpiry({ ...state, ...approvals, postToApp });
29401
- React100.useEffect(() => {
29615
+ React101.useEffect(() => {
29402
29616
  resourceLifecycle.sendInitialToolNotifications();
29403
29617
  }, [resourceLifecycle.sendInitialToolNotifications]);
29404
29618
  useMcpAppBridge({
@@ -29418,14 +29632,14 @@ function McpAppMessage({
29418
29632
  streamIsLoading
29419
29633
  });
29420
29634
  const iframePermissions = state.resource?.permissions ?? data.permissions;
29421
- const iframeAllow = React100.useMemo(
29635
+ const iframeAllow = React101.useMemo(
29422
29636
  () => buildIframeAllow(iframePermissions),
29423
29637
  [iframePermissions]
29424
29638
  );
29425
29639
  const sandbox = sandboxProxy ? "allow-scripts allow-same-origin" : buildSandboxAttribute();
29426
29640
  const prefersBorder = state.resource?.prefersBorder ?? data.prefersBorder ?? true;
29427
- const displayTitle = (0, import_chatkit_types26.resolveLocalizedText)(state.resource?.title ?? data.title, i18n2.language) ?? data.toolName;
29428
- const displayDescription = (0, import_chatkit_types26.resolveLocalizedText)(
29641
+ const displayTitle = (0, import_chatkit_types27.resolveLocalizedText)(state.resource?.title ?? data.title, i18n2.language) ?? data.toolName;
29642
+ const displayDescription = (0, import_chatkit_types27.resolveLocalizedText)(
29429
29643
  state.resource?.description ?? data.description,
29430
29644
  i18n2.language
29431
29645
  );
@@ -29472,6 +29686,24 @@ function McpAppMessage({
29472
29686
  ] })
29473
29687
  ] }),
29474
29688
  /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
29689
+ state.resource?.refresh ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
29690
+ Button,
29691
+ {
29692
+ type: "button",
29693
+ variant: "ghost",
29694
+ size: "icon-xs",
29695
+ title: i18n2.t("message.mcpApp.refresh"),
29696
+ "aria-label": i18n2.t("message.mcpApp.refresh"),
29697
+ disabled: state.isLoading || refresh.refreshing || !!state.pendingApproval,
29698
+ onClick: () => void refresh.refresh(),
29699
+ children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
29700
+ import_lucide_react64.RefreshCw,
29701
+ {
29702
+ className: cn(refresh.refreshing && "animate-spin")
29703
+ }
29704
+ )
29705
+ }
29706
+ ) : null,
29475
29707
  state.displayMode !== "fullscreen" ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
29476
29708
  Button,
29477
29709
  {
@@ -29510,6 +29742,7 @@ function McpAppMessage({
29510
29742
  ) : null
29511
29743
  ] })
29512
29744
  ] }),
29745
+ refresh.error ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { role: "alert", className: "px-3 py-2 text-sm text-destructive", children: refresh.error }) : null,
29513
29746
  state.pendingApproval ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
29514
29747
  "div",
29515
29748
  {
@@ -29688,11 +29921,11 @@ function ReasoningBlock({
29688
29921
  isReasoning = false
29689
29922
  }) {
29690
29923
  const { t } = useChatkitTranslation();
29691
- const [expanded, setExpanded] = React101.useState(isReasoning);
29692
- React101.useEffect(() => {
29924
+ const [expanded, setExpanded] = React102.useState(isReasoning);
29925
+ React102.useEffect(() => {
29693
29926
  setExpanded(isReasoning);
29694
29927
  }, [isReasoning]);
29695
- const contentId = React101.useId();
29928
+ const contentId = React102.useId();
29696
29929
  const blocks = reasoning.filter((item) => item.text?.trim());
29697
29930
  if (blocks.length === 0) return null;
29698
29931
  return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "space-y-2 px-1 py-1", children: [
@@ -29796,11 +30029,11 @@ function formatStepDuration3(durationMs) {
29796
30029
  }
29797
30030
  function ComponentBlock({ content }) {
29798
30031
  const { i18n: i18n2 } = useChatkitTranslation();
29799
- const [isExpanded, setIsExpanded] = React101.useState(false);
29800
- const contentRef = React101.useRef(null);
29801
- const shouldAutoScrollRef = React101.useRef(true);
29802
- const previousScrollTopRef = React101.useRef(0);
29803
- const [durationNow, setDurationNow] = React101.useState(() => Date.now());
30032
+ const [isExpanded, setIsExpanded] = React102.useState(false);
30033
+ const contentRef = React102.useRef(null);
30034
+ const shouldAutoScrollRef = React102.useRef(true);
30035
+ const previousScrollTopRef = React102.useRef(0);
30036
+ const [durationNow, setDurationNow] = React102.useState(() => Date.now());
29804
30037
  const data = getToolStepData(content);
29805
30038
  const category = data.category ?? "Component";
29806
30039
  const title = getToolActivityLabel(content, i18n2.language);
@@ -29814,10 +30047,10 @@ function ComponentBlock({ content }) {
29814
30047
  const endedAt = parseStepDate2(data.end_date);
29815
30048
  const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
29816
30049
  const durationLabel = durationMs === null ? null : formatStepDuration3(durationMs);
29817
- React101.useEffect(() => {
30050
+ React102.useEffect(() => {
29818
30051
  if (status === "running" && output !== null) setIsExpanded(true);
29819
30052
  }, [status, output]);
29820
- React101.useEffect(() => {
30053
+ React102.useEffect(() => {
29821
30054
  if (status !== "running" || createdAt === null || endedAt !== null) {
29822
30055
  return;
29823
30056
  }
@@ -29829,7 +30062,7 @@ function ComponentBlock({ content }) {
29829
30062
  window.clearInterval(timer);
29830
30063
  };
29831
30064
  }, [createdAt, endedAt, status]);
29832
- React101.useEffect(() => {
30065
+ React102.useEffect(() => {
29833
30066
  const element = contentRef.current;
29834
30067
  if (!element) return;
29835
30068
  previousScrollTopRef.current = element.scrollTop;
@@ -29851,7 +30084,7 @@ function ComponentBlock({ content }) {
29851
30084
  element.removeEventListener("scroll", updateAutoScrollState);
29852
30085
  };
29853
30086
  }, [isExpanded]);
29854
- React101.useEffect(() => {
30087
+ React102.useEffect(() => {
29855
30088
  if (status !== "running") {
29856
30089
  shouldAutoScrollRef.current = true;
29857
30090
  return;
@@ -30021,20 +30254,20 @@ function renderContentItem(content, index, message, lookupMessages, options) {
30021
30254
  }
30022
30255
 
30023
30256
  // src/components/thread/messages/ai.tsx
30024
- var React106 = require("react");
30025
- var import_lucide_react69 = require("lucide-react");
30257
+ var React107 = require("react");
30258
+ var import_lucide_react70 = require("lucide-react");
30026
30259
 
30027
30260
  // src/components/thread/messages/resource-cards.tsx
30028
- var React102 = __toESM(require("react"), 1);
30261
+ var React103 = __toESM(require("react"), 1);
30029
30262
  var import_lucide_react66 = require("lucide-react");
30030
- var import_chatkit_types27 = require("@xpert-ai/chatkit-types");
30263
+ var import_chatkit_types28 = require("@xpert-ai/chatkit-types");
30031
30264
  var import_jsx_runtime108 = require("react/jsx-runtime");
30032
30265
  function messageResourceCards(message) {
30033
30266
  if (!Array.isArray(message.content)) return [];
30034
30267
  return message.content.reduce(
30035
30268
  (cards, part) => {
30036
- const card = (0, import_chatkit_types27.parseResourceCardContent)(part);
30037
- return card ? (0, import_chatkit_types27.upsertResourceCardContent)(cards, card) : cards;
30269
+ const card = (0, import_chatkit_types28.parseResourceCardContent)(part);
30270
+ return card ? (0, import_chatkit_types28.upsertResourceCardContent)(cards, card) : cards;
30038
30271
  },
30039
30272
  []
30040
30273
  );
@@ -30045,8 +30278,8 @@ function ResourceCard({
30045
30278
  }) {
30046
30279
  const workbench = useWorkbench();
30047
30280
  const { t } = useChatkitTranslation();
30048
- const [busy, setBusy] = React102.useState(false);
30049
- const [error, setError] = React102.useState(null);
30281
+ const [busy, setBusy] = React103.useState(false);
30282
+ const [error, setError] = React103.useState(null);
30050
30283
  const available = workbench.enabled && !!workbench.openResourceCard;
30051
30284
  const open = async () => {
30052
30285
  if (!available || busy) return;
@@ -30116,54 +30349,95 @@ function MessageResourceCards({
30116
30349
  }
30117
30350
 
30118
30351
  // src/components/thread/messages/assistant-content.tsx
30119
- var React105 = require("react");
30352
+ var React106 = require("react");
30120
30353
 
30121
30354
  // src/components/thread/messages/external-assistant-run-row.tsx
30122
- var React103 = __toESM(require("react"), 1);
30355
+ var React104 = __toESM(require("react"), 1);
30356
+ var import_lucide_react68 = require("lucide-react");
30357
+
30358
+ // src/components/thread/messages/external-assistant-cancel-button.tsx
30123
30359
  var import_lucide_react67 = require("lucide-react");
30124
30360
  var import_jsx_runtime109 = require("react/jsx-runtime");
30361
+ function ExternalAssistantCancelButton({
30362
+ name,
30363
+ onCancel,
30364
+ pending,
30365
+ requested
30366
+ }) {
30367
+ const { t } = useChatkitTranslation();
30368
+ const label = t(
30369
+ pending ? "workbench.externalAssistants.cancelling" : requested ? "workbench.externalAssistants.cancelRequested" : "workbench.externalAssistants.cancel"
30370
+ );
30371
+ return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
30372
+ "button",
30373
+ {
30374
+ type: "button",
30375
+ onClick: onCancel,
30376
+ disabled: pending || requested,
30377
+ "aria-label": t("workbench.externalAssistants.cancelRun", { name }),
30378
+ title: label,
30379
+ className: "inline-flex shrink-0 items-center gap-1 rounded-md border px-2 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-destructive focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:opacity-50",
30380
+ children: [
30381
+ pending ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_lucide_react67.LoaderCircle, { className: "size-3 animate-spin", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_lucide_react67.Square, { className: "size-3", "aria-hidden": "true" }),
30382
+ label
30383
+ ]
30384
+ }
30385
+ );
30386
+ }
30387
+
30388
+ // src/components/thread/messages/external-assistant-run-row.tsx
30389
+ var import_jsx_runtime110 = require("react/jsx-runtime");
30125
30390
  function ExternalAssistantAvatar({ info }) {
30126
30391
  const { t } = useChatkitTranslation();
30127
- return info.avatar ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
30392
+ return info.avatar ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
30128
30393
  ChatkitAvatar,
30129
30394
  {
30130
30395
  avatar: info.avatar,
30131
30396
  label: getAgentRunTitle(info, t("message.agentRun.defaultTitle")) ?? "",
30132
30397
  className: "size-5 shrink-0"
30133
30398
  }
30134
- ) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_lucide_react67.Bot, { className: "size-4 shrink-0 text-muted-foreground", "aria-hidden": "true" });
30399
+ ) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react68.Bot, { className: "size-4 shrink-0 text-muted-foreground", "aria-hidden": "true" });
30135
30400
  }
30136
30401
  function AgentRunStatus({ info }) {
30137
30402
  const { t } = useChatkitTranslation();
30138
- const [now, setNow] = React103.useState(Date.now);
30403
+ const [now, setNow] = React104.useState(Date.now);
30139
30404
  const running = isRunningRunStatus(info.status);
30140
- React103.useEffect(() => {
30405
+ React104.useEffect(() => {
30141
30406
  if (!running) return;
30142
30407
  const timer = window.setInterval(() => setNow(Date.now()), 1e3);
30143
30408
  return () => window.clearInterval(timer);
30144
30409
  }, [running]);
30145
- const config = getAgentRunStatusConfig(info.status);
30410
+ const config = getAgentRunStatusConfig(
30411
+ info.status,
30412
+ false,
30413
+ info.businessOutcome
30414
+ );
30146
30415
  const StatusIcon = config.icon;
30147
30416
  const duration = getAgentRunDuration(info, now);
30148
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
30417
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
30149
30418
  "span",
30150
30419
  {
30151
30420
  className: "inline-flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground",
30152
30421
  role: "status",
30422
+ title: info.businessOutcome?.message,
30153
30423
  children: [
30154
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
30424
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
30155
30425
  StatusIcon,
30156
30426
  {
30157
- className: cn("h-3.5 w-3.5", config.spin && "animate-spin"),
30427
+ className: cn(
30428
+ "h-3.5 w-3.5",
30429
+ config.iconClass,
30430
+ config.spin && "animate-spin"
30431
+ ),
30158
30432
  "aria-hidden": "true"
30159
30433
  }
30160
30434
  ),
30161
30435
  t(`message.agentRun.status.${config.labelKey}`, {
30162
30436
  defaultValue: info.status ?? config.labelKey
30163
30437
  }),
30164
- duration !== null && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_jsx_runtime109.Fragment, { children: [
30165
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_lucide_react67.Clock3, { className: "ml-1 h-3 w-3", "aria-hidden": "true" }),
30166
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "tabular-nums", children: formatStepDuration2(duration) })
30438
+ duration !== null && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(import_jsx_runtime110.Fragment, { children: [
30439
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react68.Clock3, { className: "ml-1 h-3 w-3", "aria-hidden": "true" }),
30440
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { className: "tabular-nums", children: formatStepDuration2(duration) })
30167
30441
  ] })
30168
30442
  ]
30169
30443
  }
@@ -30171,31 +30445,45 @@ function AgentRunStatus({ info }) {
30171
30445
  }
30172
30446
  function ExternalAssistantRunRow({
30173
30447
  info,
30174
- onOpen
30448
+ onOpen,
30449
+ onCancel,
30450
+ cancelPending,
30451
+ cancelRequested
30175
30452
  }) {
30176
30453
  const { t } = useChatkitTranslation();
30177
30454
  const title = getAgentRunTitle(info, t("message.agentRun.defaultTitle"));
30178
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
30179
- "button",
30180
- {
30181
- type: "button",
30182
- onClick: () => onOpen(info.id),
30183
- "aria-label": t("workbench.externalAssistants.openRun", { name: title }),
30184
- className: "group flex w-full min-w-0 items-center gap-2 rounded-lg px-2 py-2 text-left text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
30185
- children: [
30186
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ExternalAssistantAvatar, { info }),
30187
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm font-medium", children: title }),
30188
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(AgentRunStatus, { info }),
30189
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_lucide_react67.ChevronRight, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" })
30190
- ]
30191
- }
30192
- );
30455
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
30456
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
30457
+ "button",
30458
+ {
30459
+ type: "button",
30460
+ onClick: () => onOpen(info.id),
30461
+ "aria-label": t("workbench.externalAssistants.openRun", { name: title }),
30462
+ className: "group flex min-w-0 flex-1 items-center gap-2 rounded-lg px-2 py-2 text-left text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
30463
+ children: [
30464
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(ExternalAssistantAvatar, { info }),
30465
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm font-medium", children: title }),
30466
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(AgentRunStatus, { info }),
30467
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react68.ChevronRight, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" })
30468
+ ]
30469
+ }
30470
+ ),
30471
+ onCancel && isRunningRunStatus(info.status) && /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
30472
+ ExternalAssistantCancelButton,
30473
+ {
30474
+ name: title ?? "",
30475
+ onCancel,
30476
+ pending: cancelPending,
30477
+ requested: cancelRequested
30478
+ }
30479
+ )
30480
+ ] });
30193
30481
  }
30194
30482
 
30195
30483
  // src/components/thread/messages/assistant-process.tsx
30196
- var React104 = __toESM(require("react"), 1);
30197
- var import_lucide_react68 = require("lucide-react");
30198
- var import_jsx_runtime110 = require("react/jsx-runtime");
30484
+ var React105 = __toESM(require("react"), 1);
30485
+ var import_lucide_react69 = require("lucide-react");
30486
+ var import_jsx_runtime111 = require("react/jsx-runtime");
30199
30487
  function AssistantProcess({
30200
30488
  enabled = true,
30201
30489
  renderContent,
@@ -30206,22 +30494,22 @@ function AssistantProcess({
30206
30494
  durationMs
30207
30495
  }) {
30208
30496
  const { t } = useChatkitTranslation();
30209
- const [userExpanded, setUserExpanded] = React104.useState(null);
30497
+ const [userExpanded, setUserExpanded] = React105.useState(null);
30210
30498
  const expanded = forceExpanded || (userExpanded ?? running);
30211
- const contentId = React104.useId();
30499
+ const contentId = React105.useId();
30212
30500
  const seconds = durationMs === void 0 ? null : Math.floor(durationMs / 1e3);
30213
30501
  const duration = seconds === null ? null : seconds >= 60 ? t("message.process.minutesSeconds", {
30214
30502
  minutes: Math.floor(seconds / 60),
30215
30503
  seconds: seconds % 60
30216
30504
  }) : t("message.process.seconds", { seconds });
30217
- return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
30505
+ return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
30218
30506
  "div",
30219
30507
  {
30220
30508
  className: "space-y-3 in-data-[density=compact]:space-y-2 in-data-[density=spacious]:space-y-4",
30221
30509
  "data-assistant-presentation": enabled ? "final-answer" : void 0,
30222
30510
  children: [
30223
- /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { hidden: !enabled, children: [
30224
- /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: "border-b border-border/60 pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
30511
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { hidden: !enabled, children: [
30512
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { className: "border-b border-border/60 pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
30225
30513
  "button",
30226
30514
  {
30227
30515
  type: "button",
@@ -30233,16 +30521,16 @@ function AssistantProcess({
30233
30521
  if (!forceExpanded) setUserExpanded(!expanded);
30234
30522
  },
30235
30523
  children: [
30236
- running && /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
30237
- import_lucide_react68.Loader2,
30524
+ running && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30525
+ import_lucide_react69.Loader2,
30238
30526
  {
30239
30527
  "aria-hidden": "true",
30240
30528
  className: "mr-1 h-3.5 w-3.5 animate-spin"
30241
30529
  }
30242
30530
  ),
30243
- /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { children: running ? t("message.process.running") : duration ? t("message.process.duration", { duration }) : t("message.process.title") }),
30244
- /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
30245
- import_lucide_react68.ChevronRight,
30531
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { children: running ? t("message.process.running") : duration ? t("message.process.duration", { duration }) : t("message.process.title") }),
30532
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30533
+ import_lucide_react69.ChevronRight,
30246
30534
  {
30247
30535
  "aria-hidden": "true",
30248
30536
  className: cn(
@@ -30254,9 +30542,9 @@ function AssistantProcess({
30254
30542
  ]
30255
30543
  }
30256
30544
  ) }),
30257
- /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { id: contentId, hidden: !expanded, className: "mt-3 space-y-3", children: process })
30545
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { id: contentId, hidden: !expanded, className: "mt-3 space-y-3", children: process })
30258
30546
  ] }),
30259
- renderContent ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
30547
+ renderContent ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30260
30548
  "div",
30261
30549
  {
30262
30550
  id: `${contentId}-content`,
@@ -30270,7 +30558,7 @@ function AssistantProcess({
30270
30558
  }
30271
30559
 
30272
30560
  // src/components/thread/messages/assistant-content.tsx
30273
- var import_jsx_runtime111 = require("react/jsx-runtime");
30561
+ var import_jsx_runtime112 = require("react/jsx-runtime");
30274
30562
  function groupAdjacentReasoning(units) {
30275
30563
  const groups = [];
30276
30564
  for (const unit of units) {
@@ -30296,11 +30584,11 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
30296
30584
  const bubbles = mode === "bubbles";
30297
30585
  if (unit.type === "reasoning-group") {
30298
30586
  if (bubbles) return null;
30299
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30587
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
30300
30588
  "div",
30301
30589
  {
30302
30590
  hidden: bubbles,
30303
- children: !bubbles && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30591
+ children: !bubbles && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
30304
30592
  ReasoningBlock,
30305
30593
  {
30306
30594
  reasoning: unit.items,
@@ -30317,7 +30605,7 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
30317
30605
  const hidden = bubbles && (kind === "process" || kind === "omitted");
30318
30606
  if (hidden) return null;
30319
30607
  const key = typeof content === "string" ? `text-${unit.index}` : content.id ?? `item-${unit.index}`;
30320
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30608
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
30321
30609
  MessageBubble,
30322
30610
  {
30323
30611
  mode,
@@ -30334,11 +30622,11 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
30334
30622
  );
30335
30623
  }
30336
30624
  if (bubbles && !unit.items.some(hasBubbleToolResult)) return null;
30337
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30625
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
30338
30626
  "div",
30339
30627
  {
30340
30628
  className: bubbles ? "space-y-3 empty:hidden" : void 0,
30341
- children: bubbles ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(BubbleToolResults, { items: unit.items, messageStatus: message.status }) : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30629
+ children: bubbles ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(BubbleToolResults, { items: unit.items, messageStatus: message.status }) : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
30342
30630
  ToolComponentGroup,
30343
30631
  {
30344
30632
  items: unit.items,
@@ -30368,7 +30656,7 @@ function renderEntryBatch(entries, message, lookupMessages, hasFollowingItem, op
30368
30656
  const sourceIndex = entry.index;
30369
30657
  const mapped = unit.type === "item" ? { ...unit, index: sourceIndex } : { ...unit, startIndex: sourceIndex };
30370
30658
  const key = unit.type === "item" ? `entry-${entry.source}-${typeof unit.item === "string" ? sourceIndex : unit.item.id ?? sourceIndex}` : `${unit.type}-${entry.source}-${unit.items[0]?.id ?? sourceIndex}`;
30371
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30659
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
30372
30660
  "div",
30373
30661
  {
30374
30662
  hidden: options?.hiddenOrders?.has(entry.order),
@@ -30411,12 +30699,12 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
30411
30699
  flushEntries(true);
30412
30700
  if (unit.node.info.invocationKind === "external_assistant" && options?.onOpenExternalAssistant) {
30413
30701
  rendered.push(
30414
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30702
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
30415
30703
  MessageBubble,
30416
30704
  {
30417
30705
  mode: options.mode,
30418
30706
  hidden: options.hiddenOrders?.has(unit.order),
30419
- children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30707
+ children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
30420
30708
  ExternalAssistantRunRow,
30421
30709
  {
30422
30710
  info: unit.node.info,
@@ -30430,13 +30718,13 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
30430
30718
  return;
30431
30719
  }
30432
30720
  rendered.push(
30433
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30721
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
30434
30722
  MessageBubble,
30435
30723
  {
30436
30724
  mode: options?.mode,
30437
30725
  hidden: options?.hiddenOrders?.has(unit.order),
30438
30726
  "data-quote-source": unit.node.info.xpertName ?? unit.node.info.title,
30439
- children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30727
+ children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
30440
30728
  AgentRunGroup,
30441
30729
  {
30442
30730
  mode: options?.mode,
@@ -30467,7 +30755,7 @@ function AssistantContent({
30467
30755
  const tree = buildAssistantRenderTree(message);
30468
30756
  const presentation = getAssistantPresentation(message);
30469
30757
  const canSeparate = options.mode !== "bubbles" && options.collapseProcess && presentation.canSeparate && Boolean(presentation.process.length || options.processPrefix);
30470
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
30758
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
30471
30759
  AssistantProcess,
30472
30760
  {
30473
30761
  enabled: Boolean(canSeparate),
@@ -30484,7 +30772,7 @@ function AssistantContent({
30484
30772
  }
30485
30773
 
30486
30774
  // src/components/thread/messages/ai.tsx
30487
- var import_jsx_runtime112 = require("react/jsx-runtime");
30775
+ var import_jsx_runtime113 = require("react/jsx-runtime");
30488
30776
  function AssistantStreamingIndicator({
30489
30777
  status,
30490
30778
  className
@@ -30495,7 +30783,7 @@ function AssistantStreamingIndicator({
30495
30783
  thinking: t("message.thinking"),
30496
30784
  answering: t("message.answering")
30497
30785
  };
30498
- return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
30786
+ return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
30499
30787
  "div",
30500
30788
  {
30501
30789
  className: cn(
@@ -30503,18 +30791,18 @@ function AssistantStreamingIndicator({
30503
30791
  className
30504
30792
  ),
30505
30793
  children: [
30506
- status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_lucide_react69.Loader2, { className: "h-3.5 w-3.5 animate-spin" }),
30507
- status === "thinking" && /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
30508
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
30509
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
30510
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
30794
+ status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_lucide_react70.Loader2, { className: "h-3.5 w-3.5 animate-spin" }),
30795
+ status === "thinking" && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
30796
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
30797
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
30798
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
30511
30799
  ] }),
30512
- status === "answering" && /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
30513
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
30514
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
30515
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
30800
+ status === "answering" && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
30801
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
30802
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
30803
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
30516
30804
  ] }),
30517
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { children: labelMap[status] })
30805
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { children: labelMap[status] })
30518
30806
  ]
30519
30807
  }
30520
30808
  );
@@ -30546,7 +30834,7 @@ function AssistantMessage({
30546
30834
  const isReasoning = isStreaming && message.status !== "answering" && resolvedStreamingStatus === "thinking";
30547
30835
  const lookupMessages = messages?.length ? messages : [message];
30548
30836
  const inlinePetState = resolvedStreamingStatus ? resolvedStreamingStatus === "loading" ? "running" : "review" : null;
30549
- const inlinePet = inlinePetState ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(InlinePetStatus, { pet, state: inlinePetState }) : null;
30837
+ const inlinePet = inlinePetState ? /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(InlinePetStatus, { pet, state: inlinePetState }) : null;
30550
30838
  const contentOptions = {
30551
30839
  mode,
30552
30840
  collapseProcess,
@@ -30560,7 +30848,7 @@ function AssistantMessage({
30560
30848
  apiUrl,
30561
30849
  mcpApps
30562
30850
  };
30563
- const answerNode = /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
30851
+ const answerNode = /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
30564
30852
  AssistantContent,
30565
30853
  {
30566
30854
  message,
@@ -30581,21 +30869,21 @@ function AssistantMessage({
30581
30869
  if (!hasContent && !hasReasoning && !resolvedStreamingStatus && !showCompletion)
30582
30870
  return null;
30583
30871
  const streamingClass = isStreaming ? "streaming-active" : "";
30584
- return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
30872
+ return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
30585
30873
  answerNode,
30586
- !isStreaming && /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_jsx_runtime112.Fragment, { children: [
30587
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
30874
+ !isStreaming && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
30875
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
30588
30876
  MessageBubble,
30589
30877
  {
30590
30878
  mode,
30591
30879
  hidden: !hasRenderableFileActivity(message),
30592
- children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(MessageFileActivity, { message })
30880
+ children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(MessageFileActivity, { message })
30593
30881
  }
30594
30882
  ),
30595
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(MessageResourceCards, { message, mode })
30883
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(MessageResourceCards, { message, mode })
30596
30884
  ] }),
30597
- showCompletion && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(MessageBubble, { mode, kind: "status", role: "status", children: t(`message.bubbles.${completion}`) }),
30598
- resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
30885
+ showCompletion && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(MessageBubble, { mode, kind: "status", role: "status", children: t(`message.bubbles.${completion}`) }),
30886
+ resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
30599
30887
  MessageBubble,
30600
30888
  {
30601
30889
  mode,
@@ -30603,7 +30891,7 @@ function AssistantMessage({
30603
30891
  className: "flex items-center gap-2",
30604
30892
  children: [
30605
30893
  inlinePet,
30606
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus })
30894
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus })
30607
30895
  ]
30608
30896
  }
30609
30897
  ) : null
@@ -30611,23 +30899,23 @@ function AssistantMessage({
30611
30899
  }
30612
30900
 
30613
30901
  // src/components/thread/MessageActions.tsx
30614
- var React108 = __toESM(require("react"), 1);
30615
- var import_lucide_react71 = require("lucide-react");
30902
+ var React109 = __toESM(require("react"), 1);
30903
+ var import_lucide_react72 = require("lucide-react");
30616
30904
 
30617
30905
  // src/components/thread/MessageSkills.tsx
30618
- var React107 = __toESM(require("react"), 1);
30619
- var import_lucide_react70 = require("lucide-react");
30620
- var import_chatkit_types28 = require("@xpert-ai/chatkit-types");
30621
- var import_jsx_runtime113 = require("react/jsx-runtime");
30906
+ var React108 = __toESM(require("react"), 1);
30907
+ var import_lucide_react71 = require("lucide-react");
30908
+ var import_chatkit_types29 = require("@xpert-ai/chatkit-types");
30909
+ var import_jsx_runtime114 = require("react/jsx-runtime");
30622
30910
  function MessageSkills({
30623
30911
  usages,
30624
30912
  onOpen
30625
30913
  }) {
30626
30914
  const { t } = useChatkitTranslation();
30627
- const [open, setOpen] = React107.useState(false);
30628
- const pinned = React107.useRef(false);
30629
- const timer = React107.useRef(void 0);
30630
- const titleId = React107.useId();
30915
+ const [open, setOpen] = React108.useState(false);
30916
+ const pinned = React108.useRef(false);
30917
+ const timer = React108.useRef(void 0);
30918
+ const titleId = React108.useId();
30631
30919
  const cancelClose = () => clearTimeout(timer.current);
30632
30920
  const show = () => {
30633
30921
  cancelClose();
@@ -30645,8 +30933,8 @@ function MessageSkills({
30645
30933
  if (!pinned.current) setOpen(false);
30646
30934
  }, 150);
30647
30935
  };
30648
- React107.useEffect(() => () => clearTimeout(timer.current), []);
30649
- return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
30936
+ React108.useEffect(() => () => clearTimeout(timer.current), []);
30937
+ return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(
30650
30938
  Popover,
30651
30939
  {
30652
30940
  open,
@@ -30654,7 +30942,7 @@ function MessageSkills({
30654
30942
  if (!next) close();
30655
30943
  },
30656
30944
  children: [
30657
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
30945
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
30658
30946
  "button",
30659
30947
  {
30660
30948
  type: "button",
@@ -30674,10 +30962,10 @@ function MessageSkills({
30674
30962
  show();
30675
30963
  }
30676
30964
  },
30677
- children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_lucide_react70.BookOpen, { size: 14, "aria-hidden": "true" })
30965
+ children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_lucide_react71.BookOpen, { size: 14, "aria-hidden": "true" })
30678
30966
  }
30679
30967
  ) }),
30680
- /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
30968
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(
30681
30969
  PopoverContent,
30682
30970
  {
30683
30971
  side: "top",
@@ -30690,17 +30978,17 @@ function MessageSkills({
30690
30978
  onPointerEnter: cancelClose,
30691
30979
  onPointerLeave: scheduleClose,
30692
30980
  children: [
30693
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { id: titleId, className: "mb-2 text-sm font-medium", children: t("messageActions.skills.title") }),
30694
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("ul", { className: "max-h-64 space-y-1 overflow-y-auto text-sm", children: usages.map((usage) => /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
30981
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("div", { id: titleId, className: "mb-2 text-sm font-medium", children: t("messageActions.skills.title") }),
30982
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("ul", { className: "max-h-64 space-y-1 overflow-y-auto text-sm", children: usages.map((usage) => /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(
30695
30983
  "li",
30696
30984
  {
30697
30985
  className: "flex items-start justify-between gap-4",
30698
30986
  children: [
30699
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "min-w-0 break-words", children: usage.name }),
30700
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "shrink-0 text-muted-foreground", children: t(`messageActions.skills.sources.${usage.source.type}`) })
30987
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("span", { className: "min-w-0 break-words", children: usage.name }),
30988
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("span", { className: "shrink-0 text-muted-foreground", children: t(`messageActions.skills.sources.${usage.source.type}`) })
30701
30989
  ]
30702
30990
  },
30703
- (0, import_chatkit_types28.chatSkillUsageKey)(usage)
30991
+ (0, import_chatkit_types29.chatSkillUsageKey)(usage)
30704
30992
  )) })
30705
30993
  ]
30706
30994
  }
@@ -30711,7 +30999,7 @@ function MessageSkills({
30711
30999
  }
30712
31000
 
30713
31001
  // src/components/thread/MessageTimestamp.tsx
30714
- var import_jsx_runtime114 = require("react/jsx-runtime");
31002
+ var import_jsx_runtime115 = require("react/jsx-runtime");
30715
31003
  function formatCompactTime(date, language, now = /* @__PURE__ */ new Date()) {
30716
31004
  const time = new Intl.DateTimeFormat(language, {
30717
31005
  hour: "2-digit",
@@ -30750,8 +31038,8 @@ function MessageTimestamp({
30750
31038
  timeZoneName: "short"
30751
31039
  }).format(date)
30752
31040
  });
30753
- return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(Tooltip, { children: [
30754
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
31041
+ return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(Tooltip, { children: [
31042
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
30755
31043
  "time",
30756
31044
  {
30757
31045
  dateTime: date.toISOString(),
@@ -30761,12 +31049,12 @@ function MessageTimestamp({
30761
31049
  children: formatCompactTime(date, i18n2.language)
30762
31050
  }
30763
31051
  ) }),
30764
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(TooltipContent, { side: "bottom", children: label })
31052
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(TooltipContent, { side: "bottom", children: label })
30765
31053
  ] });
30766
31054
  }
30767
31055
 
30768
31056
  // src/components/thread/MessageActions.tsx
30769
- var import_jsx_runtime115 = require("react/jsx-runtime");
31057
+ var import_jsx_runtime116 = require("react/jsx-runtime");
30770
31058
  function MessageActionButton({
30771
31059
  label,
30772
31060
  tooltip = label,
@@ -30775,7 +31063,7 @@ function MessageActionButton({
30775
31063
  className,
30776
31064
  ...props
30777
31065
  }) {
30778
- const button = /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
31066
+ const button = /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
30779
31067
  "button",
30780
31068
  {
30781
31069
  ...props,
@@ -30788,7 +31076,7 @@ function MessageActionButton({
30788
31076
  )
30789
31077
  }
30790
31078
  );
30791
- return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
31079
+ return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
30792
31080
  Tooltip,
30793
31081
  {
30794
31082
  delayDuration: 200,
@@ -30796,7 +31084,7 @@ function MessageActionButton({
30796
31084
  if (open) onTooltipOpen?.();
30797
31085
  },
30798
31086
  children: [
30799
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
31087
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
30800
31088
  "span",
30801
31089
  {
30802
31090
  tabIndex: 0,
@@ -30806,7 +31094,7 @@ function MessageActionButton({
30806
31094
  children: button
30807
31095
  }
30808
31096
  ) : button }),
30809
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
31097
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
30810
31098
  TooltipContent,
30811
31099
  {
30812
31100
  side: "bottom",
@@ -30837,7 +31125,7 @@ function MessageActions({
30837
31125
  skillUsages
30838
31126
  }) {
30839
31127
  const { t } = useChatkitTranslation();
30840
- const [copied, setCopied] = React108.useState(false);
31128
+ const [copied, setCopied] = React109.useState(false);
30841
31129
  const handleCopy = async () => {
30842
31130
  try {
30843
31131
  await navigator.clipboard.writeText(content);
@@ -30850,8 +31138,8 @@ function MessageActions({
30850
31138
  if (isStreaming) return null;
30851
31139
  const branchLabel = t("messageActions.branch");
30852
31140
  const branchTooltip = isBranching ? t("messageActions.branching") : branching && !branching.available ? `${branchLabel}\uFF1A${t(`messageActions.branchReasons.${branching.reason ?? "checkpoint_unavailable"}`)}` : branchLabel;
30853
- return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: cn("flex items-center gap-1 mt-2", className), children: [
30854
- /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
31141
+ return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: cn("flex items-center gap-1 mt-2", className), children: [
31142
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
30855
31143
  "div",
30856
31144
  {
30857
31145
  className: cn(
@@ -30859,35 +31147,35 @@ function MessageActions({
30859
31147
  !alwaysVisible && "sm:opacity-0 sm:group-hover/message:opacity-100 sm:focus-within:opacity-100"
30860
31148
  ),
30861
31149
  children: [
30862
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
31150
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
30863
31151
  MessageActionButton,
30864
31152
  {
30865
31153
  label: copied ? t("messageActions.copied") : t("messageActions.copy"),
30866
31154
  onClick: handleCopy,
30867
31155
  onTooltipOpen: onActionTooltipOpen,
30868
31156
  className: cn(copied && "text-green-500"),
30869
- children: copied ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_lucide_react71.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_lucide_react71.Copy, { size: 14 })
31157
+ children: copied ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react72.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react72.Copy, { size: 14 })
30870
31158
  }
30871
31159
  ),
30872
- !isAssistant && onEdit && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
31160
+ !isAssistant && onEdit && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
30873
31161
  MessageActionButton,
30874
31162
  {
30875
31163
  label: t("threadControl.editMessage"),
30876
31164
  onClick: onEdit,
30877
31165
  onTooltipOpen: onActionTooltipOpen,
30878
- children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_lucide_react71.Pencil, { size: 14 })
31166
+ children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react72.Pencil, { size: 14 })
30879
31167
  }
30880
31168
  ),
30881
- isAssistant && onRetry && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
31169
+ isAssistant && onRetry && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
30882
31170
  MessageActionButton,
30883
31171
  {
30884
31172
  label: t("messageActions.regenerate"),
30885
31173
  onClick: onRetry,
30886
31174
  onTooltipOpen: onActionTooltipOpen,
30887
- children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_lucide_react71.RefreshCw, { size: 14 })
31175
+ children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react72.RefreshCw, { size: 14 })
30888
31176
  }
30889
31177
  ),
30890
- isAssistant && onBranch && branching && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
31178
+ isAssistant && onBranch && branching && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
30891
31179
  MessageActionButton,
30892
31180
  {
30893
31181
  label: branchLabel,
@@ -30896,20 +31184,20 @@ function MessageActions({
30896
31184
  onTooltipOpen: onActionTooltipOpen,
30897
31185
  disabled: isBranching || branchDisabled || !branching.available,
30898
31186
  "aria-busy": isBranching,
30899
- children: isBranching ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_lucide_react71.Loader2, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_lucide_react71.GitBranch, { size: 14 })
31187
+ children: isBranching ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react72.Loader2, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react72.GitBranch, { size: 14 })
30900
31188
  }
30901
31189
  ),
30902
- isAssistant && skillUsages && skillUsages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(MessageSkills, { usages: skillUsages, onOpen: onActionTooltipOpen })
31190
+ isAssistant && skillUsages && skillUsages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(MessageSkills, { usages: skillUsages, onOpen: onActionTooltipOpen })
30903
31191
  ]
30904
31192
  }
30905
31193
  ),
30906
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(MessageTimestamp, { updatedAt })
31194
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(MessageTimestamp, { updatedAt })
30907
31195
  ] });
30908
31196
  }
30909
31197
 
30910
31198
  // src/components/thread/MessageEditor.tsx
30911
31199
  var import_react10 = require("react");
30912
- var import_jsx_runtime116 = require("react/jsx-runtime");
31200
+ var import_jsx_runtime117 = require("react/jsx-runtime");
30913
31201
  function MessageEditor({
30914
31202
  initialText,
30915
31203
  onSave,
@@ -30930,8 +31218,8 @@ function MessageEditor({
30930
31218
  setBusy(false);
30931
31219
  }
30932
31220
  }
30933
- return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: "w-full space-y-2 rounded-2xl border border-input bg-background p-3", children: [
30934
- /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
31221
+ return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "w-full space-y-2 rounded-2xl border border-input bg-background p-3", children: [
31222
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
30935
31223
  "textarea",
30936
31224
  {
30937
31225
  "aria-label": t("threadControl.editMessage"),
@@ -30943,9 +31231,9 @@ function MessageEditor({
30943
31231
  className: "w-full resize-y bg-transparent text-sm leading-relaxed text-foreground outline-none"
30944
31232
  }
30945
31233
  ),
30946
- error && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("p", { role: "alert", className: "text-xs text-destructive", children: error }),
30947
- /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: "flex justify-end gap-2", children: [
30948
- /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
31234
+ error && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("p", { role: "alert", className: "text-xs text-destructive", children: error }),
31235
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "flex justify-end gap-2", children: [
31236
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
30949
31237
  Button,
30950
31238
  {
30951
31239
  type: "button",
@@ -30956,7 +31244,7 @@ function MessageEditor({
30956
31244
  children: t("threadControl.discardEdit")
30957
31245
  }
30958
31246
  ),
30959
- /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
31247
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
30960
31248
  Button,
30961
31249
  {
30962
31250
  type: "button",
@@ -30971,7 +31259,7 @@ function MessageEditor({
30971
31259
  }
30972
31260
 
30973
31261
  // src/components/thread/MessageList.tsx
30974
- var import_jsx_runtime117 = require("react/jsx-runtime");
31262
+ var import_jsx_runtime118 = require("react/jsx-runtime");
30975
31263
  function formatMessageContent(content) {
30976
31264
  if (typeof content === "string") {
30977
31265
  return content;
@@ -31046,16 +31334,16 @@ function MessageList({
31046
31334
  const approvalIndex = foldedIndexes.has(toolAnchor) ? [...processGroups].find(
31047
31335
  ([, indexes]) => indexes.includes(toolAnchor)
31048
31336
  )?.[0] ?? lastAssistantIndex : toolAnchor >= 0 ? toolAnchor : lastAssistantIndex;
31049
- return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(PresentationScrollAnchor, { mode, children: /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
31337
+ return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(PresentationScrollAnchor, { mode, children: /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
31050
31338
  "div",
31051
31339
  {
31052
31340
  "data-slot": "chatkit-message-list",
31053
31341
  "data-message-presentation": mode,
31054
31342
  className: "space-y-4",
31055
31343
  children: [
31056
- canLoadMoreMessages && /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "flex items-center gap-3 py-1", children: [
31057
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "h-px min-w-8 flex-1 bg-border" }),
31058
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31344
+ canLoadMoreMessages && /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "flex items-center gap-3 py-1", children: [
31345
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: "h-px min-w-8 flex-1 bg-border" }),
31346
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31059
31347
  Button,
31060
31348
  {
31061
31349
  type: "button",
@@ -31067,20 +31355,20 @@ function MessageList({
31067
31355
  children: isLoadingMoreMessages ? t("chat.loadingMoreMessages") : t("chat.loadMoreMessages")
31068
31356
  }
31069
31357
  ),
31070
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "h-px min-w-8 flex-1 bg-border" })
31358
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: "h-px min-w-8 flex-1 bg-border" })
31071
31359
  ] }),
31072
31360
  messages.map((message, index) => {
31073
31361
  if (foldedIndexes.has(index)) return null;
31074
- const call = Array.isArray(message.content) ? message.content.find(import_chatkit_types29.isCallEndedContent) : void 0;
31362
+ const call = Array.isArray(message.content) ? message.content.find(import_chatkit_types30.isCallEndedContent) : void 0;
31075
31363
  if (call)
31076
- return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31364
+ return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31077
31365
  "div",
31078
31366
  {
31079
31367
  "data-message-id": message.id,
31080
31368
  ref: (node) => {
31081
31369
  if (message.id) onMessageAnchor?.(message.id, node);
31082
31370
  },
31083
- children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(CallEndedMessage, { call })
31371
+ children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(CallEndedMessage, { call })
31084
31372
  },
31085
31373
  message.id ?? index
31086
31374
  );
@@ -31130,7 +31418,7 @@ function MessageList({
31130
31418
  if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
31131
31419
  return null;
31132
31420
  }
31133
- return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31421
+ return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31134
31422
  "div",
31135
31423
  {
31136
31424
  ref: (node) => {
@@ -31152,7 +31440,7 @@ function MessageList({
31152
31440
  "group group/message flex gap-3",
31153
31441
  isHumanMessage ? "justify-end" : embedded ? "justify-start" : "justify-start -ml-1"
31154
31442
  ),
31155
- children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31443
+ children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31156
31444
  "div",
31157
31445
  {
31158
31446
  className: cn(
@@ -31162,7 +31450,7 @@ function MessageList({
31162
31450
  !embedded && "px-3",
31163
31451
  (isAssistantMessage || isEditingMessage) && "min-w-0 flex-1"
31164
31452
  ),
31165
- children: isEditingMessage && editing ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31453
+ children: isEditingMessage && editing ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31166
31454
  MessageEditor,
31167
31455
  {
31168
31456
  initialText: messageContent,
@@ -31170,8 +31458,8 @@ function MessageList({
31170
31458
  onSave: (text) => editing.onSave(humanMessage, text)
31171
31459
  },
31172
31460
  message.id
31173
- ) : /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(import_jsx_runtime117.Fragment, { children: [
31174
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31461
+ ) : /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(import_jsx_runtime118.Fragment, { children: [
31462
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31175
31463
  "div",
31176
31464
  {
31177
31465
  "data-human-bubble": isHumanMessage ? "" : void 0,
@@ -31185,12 +31473,12 @@ function MessageList({
31185
31473
  isHumanMessage ? "bg-primary text-primary-foreground px-4 py-2.5" : message.type === "system" ? "bg-muted text-muted-foreground text-xs px-4 py-2.5" : "py-1 text-chat-foreground"
31186
31474
  // AI messages: use chat-specific foreground color
31187
31475
  ),
31188
- children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31476
+ children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31189
31477
  AssistantMessage,
31190
31478
  {
31191
31479
  mode,
31192
31480
  collapseProcess,
31193
- processPrefix: processIndexes?.length ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31481
+ processPrefix: processIndexes?.length ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31194
31482
  MessageList,
31195
31483
  {
31196
31484
  messages: processIndexes.map(
@@ -31225,14 +31513,14 @@ function MessageList({
31225
31513
  pet,
31226
31514
  mcpApps
31227
31515
  }
31228
- ) : /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(import_jsx_runtime117.Fragment, { children: [
31229
- isHumanMessage && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31516
+ ) : /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(import_jsx_runtime118.Fragment, { children: [
31517
+ isHumanMessage && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31230
31518
  HumanRuntimeCapabilityChips,
31231
31519
  {
31232
31520
  options: humanRuntimeCapabilityOptions
31233
31521
  }
31234
31522
  ),
31235
- isHumanMessage && humanReferences.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31523
+ isHumanMessage && humanReferences.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31236
31524
  ReferenceChip,
31237
31525
  {
31238
31526
  reference,
@@ -31240,29 +31528,29 @@ function MessageList({
31240
31528
  },
31241
31529
  getReferenceKey(reference)
31242
31530
  )) }),
31243
- isHumanMessage && humanAttachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
31531
+ isHumanMessage && humanAttachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
31244
31532
  "div",
31245
31533
  {
31246
31534
  className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
31247
31535
  children: [
31248
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_lucide_react72.FileText, { size: 12 }),
31249
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { className: "max-w-[100px] truncate", children: file.originalName ?? file.id })
31536
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react73.FileText, { size: 12 }),
31537
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "max-w-[100px] truncate", children: file.originalName ?? file.id })
31250
31538
  ]
31251
31539
  },
31252
31540
  fileIndex
31253
31541
  )) }),
31254
- Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31542
+ Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31255
31543
  "p",
31256
31544
  {
31257
31545
  className: "wrap-break-word text-sm leading-relaxed",
31258
31546
  children: formatMessageContent(part)
31259
31547
  },
31260
31548
  `${part.type}-${partIndex}`
31261
- )) : /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
31549
+ )) : /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
31262
31550
  ] })
31263
31551
  }
31264
31552
  ),
31265
- showActions && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31553
+ showActions && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31266
31554
  MessageActions,
31267
31555
  {
31268
31556
  updatedAt: isAssistantMessage || isHumanMessage ? message.updatedAt : void 0,
@@ -31270,11 +31558,11 @@ function MessageList({
31270
31558
  message
31271
31559
  ) ?? messageContent : messageContent,
31272
31560
  isAssistant: isAssistantMessage,
31273
- skillUsages: isAssistantMessage ? (0, import_chatkit_types30.mergeChatSkillUsages)(
31561
+ skillUsages: isAssistantMessage ? (0, import_chatkit_types31.mergeChatSkillUsages)(
31274
31562
  ...(processIndexes ?? []).map(
31275
- (i) => (0, import_chatkit_types30.getMessageSkillUsages)(messages[i])
31563
+ (i) => (0, import_chatkit_types31.getMessageSkillUsages)(messages[i])
31276
31564
  ),
31277
- (0, import_chatkit_types30.getMessageSkillUsages)(message)
31565
+ (0, import_chatkit_types31.getMessageSkillUsages)(message)
31278
31566
  ) : void 0,
31279
31567
  isStreaming: isStreamingMessage,
31280
31568
  alwaysVisible: isAssistantMessage && index === lastAssistantIndex,
@@ -31287,8 +31575,8 @@ function MessageList({
31287
31575
  onRetry: onRetry && isAssistantMessage && !isLoading && index === messages.length - 1 ? () => onRetry(index) : void 0
31288
31576
  }
31289
31577
  ),
31290
- index === approvalIndex && approval && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(MessageBubble, { mode, children: approval }),
31291
- !showActions && !isStreamingMessage && (isAssistantMessage || isHumanMessage) && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(MessageTimestamp, { updatedAt: message.updatedAt })
31578
+ index === approvalIndex && approval && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(MessageBubble, { mode, children: approval }),
31579
+ !showActions && !isStreamingMessage && (isAssistantMessage || isHumanMessage) && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(MessageTimestamp, { updatedAt: message.updatedAt })
31292
31580
  ] })
31293
31581
  }
31294
31582
  )
@@ -31296,7 +31584,7 @@ function MessageList({
31296
31584
  message.id ?? `${message.type}-${index}`
31297
31585
  );
31298
31586
  }),
31299
- approvalIndex < 0 && approval && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(MessageBubble, { mode, children: approval }),
31587
+ approvalIndex < 0 && approval && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(MessageBubble, { mode, children: approval }),
31300
31588
  showLoadingDots && (() => {
31301
31589
  const lastMessage = messages[messages.length - 1];
31302
31590
  const lastMessageType = lastMessage ? String(lastMessage.type) : "";
@@ -31319,13 +31607,13 @@ function MessageList({
31319
31607
  isLoading,
31320
31608
  { now: streamingNow }
31321
31609
  );
31322
- return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31610
+ return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31323
31611
  MessageBubble,
31324
31612
  {
31325
31613
  mode,
31326
31614
  kind: "status",
31327
31615
  className: "max-w-full py-2.5",
31328
- children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
31616
+ children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31329
31617
  AssistantStreamingIndicator,
31330
31618
  {
31331
31619
  status: fallbackStreamingStatus ?? "loading"
@@ -31340,20 +31628,20 @@ function MessageList({
31340
31628
  }
31341
31629
 
31342
31630
  // src/components/thread/StartScreen.tsx
31343
- var React109 = require("react");
31344
- var import_lucide_react73 = require("lucide-react");
31345
- var import_jsx_runtime118 = require("react/jsx-runtime");
31631
+ var React110 = require("react");
31632
+ var import_lucide_react74 = require("lucide-react");
31633
+ var import_jsx_runtime119 = require("react/jsx-runtime");
31346
31634
  function getIconComponent2(icon) {
31347
31635
  const iconMap = {
31348
- "circle-question": /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react73.HelpCircle, { size: 20 }),
31349
- lightbulb: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react73.Lightbulb, { size: 20 }),
31350
- sparkle: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react73.Sparkles, { size: 20 }),
31351
- write: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react73.Pencil, { size: 20 }),
31352
- search: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react73.Search, { size: 20 }),
31353
- globe: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react73.Globe, { size: 20 }),
31354
- "book-open": /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react73.BookOpen, { size: 20 }),
31355
- compass: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react73.Compass, { size: 20 }),
31356
- bolt: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react73.Zap, { size: 20 })
31636
+ "circle-question": /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react74.HelpCircle, { size: 20 }),
31637
+ lightbulb: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react74.Lightbulb, { size: 20 }),
31638
+ sparkle: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react74.Sparkles, { size: 20 }),
31639
+ write: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react74.Pencil, { size: 20 }),
31640
+ search: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react74.Search, { size: 20 }),
31641
+ globe: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react74.Globe, { size: 20 }),
31642
+ "book-open": /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react74.BookOpen, { size: 20 }),
31643
+ compass: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react74.Compass, { size: 20 }),
31644
+ bolt: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react74.Zap, { size: 20 })
31357
31645
  };
31358
31646
  return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
31359
31647
  }
@@ -31370,7 +31658,7 @@ function StartScreen({
31370
31658
  const prompts = startScreen?.prompts ?? [];
31371
31659
  const hasPrompts = startScreen?.promptsLayout !== "list" && prompts.length > 0;
31372
31660
  const editPromptLabel = t("startScreen.editPrompt");
31373
- return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
31661
+ return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
31374
31662
  "div",
31375
31663
  {
31376
31664
  className: cn(
@@ -31378,8 +31666,8 @@ function StartScreen({
31378
31666
  className
31379
31667
  ),
31380
31668
  children: [
31381
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: cn("mb-4 text-center", hasPrompts && "mb-10"), children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("h2", { className: "mb-4 text-4xl font-semibold text-foreground", children: greeting }) }),
31382
- hasPrompts && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
31669
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: cn("mb-4 text-center", hasPrompts && "mb-10"), children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("h2", { className: "mb-4 text-4xl font-semibold text-foreground", children: greeting }) }),
31670
+ hasPrompts && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
31383
31671
  "div",
31384
31672
  {
31385
31673
  className: cn(
@@ -31388,7 +31676,7 @@ function StartScreen({
31388
31676
  "focus-within:ring-2 focus-within:ring-primary/20"
31389
31677
  ),
31390
31678
  children: [
31391
- /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
31679
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
31392
31680
  "button",
31393
31681
  {
31394
31682
  type: "button",
@@ -31399,8 +31687,8 @@ function StartScreen({
31399
31687
  "focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
31400
31688
  ),
31401
31689
  children: [
31402
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
31403
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31690
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
31691
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
31404
31692
  "div",
31405
31693
  {
31406
31694
  className: "text-sm font-medium text-foreground line-clamp-3 overflow-hidden",
@@ -31411,7 +31699,7 @@ function StartScreen({
31411
31699
  ]
31412
31700
  }
31413
31701
  ),
31414
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
31702
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
31415
31703
  "button",
31416
31704
  {
31417
31705
  type: "button",
@@ -31424,7 +31712,7 @@ function StartScreen({
31424
31712
  "rounded-r-xl transition-colors hover:bg-muted hover:text-foreground",
31425
31713
  "focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
31426
31714
  ),
31427
- children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react73.Pencil, { size: 16 })
31715
+ children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react74.Pencil, { size: 16 })
31428
31716
  }
31429
31717
  )
31430
31718
  ]
@@ -31437,7 +31725,7 @@ function StartScreen({
31437
31725
  }
31438
31726
 
31439
31727
  // src/components/chat/messages/ChatTranscript.tsx
31440
- var import_jsx_runtime119 = require("react/jsx-runtime");
31728
+ var import_jsx_runtime120 = require("react/jsx-runtime");
31441
31729
  function ChatTranscript({
31442
31730
  isInitialComposer,
31443
31731
  chatColumnStyle,
@@ -31484,7 +31772,7 @@ function ChatTranscript({
31484
31772
  const needsUserInput = Boolean(
31485
31773
  stream.pendingHITLRequest || stream.pendingRequestUserInput
31486
31774
  );
31487
- return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
31775
+ return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
31488
31776
  "div",
31489
31777
  {
31490
31778
  "data-slot": "chatkit-chat-content",
@@ -31494,23 +31782,23 @@ function ChatTranscript({
31494
31782
  ),
31495
31783
  style: chatColumnStyle,
31496
31784
  children: [
31497
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
31498
- historyError && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
31499
- conversationBranch.error && /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
31785
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
31786
+ historyError && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
31787
+ conversationBranch.error && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
31500
31788
  "div",
31501
31789
  {
31502
31790
  role: "alert",
31503
31791
  className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",
31504
31792
  children: [
31505
31793
  t("messageActions.branchFailed"),
31506
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("p", { className: "mt-1 text-xs", children: /^(?:failed to fetch|network\s*(?:request\s*)?(?:failed|error)|load failed)$/i.test(
31794
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { className: "mt-1 text-xs", children: /^(?:failed to fetch|network\s*(?:request\s*)?(?:failed|error)|load failed)$/i.test(
31507
31795
  conversationBranch.error
31508
31796
  ) ? t("messageActions.branchNetworkError") : conversationBranch.error })
31509
31797
  ]
31510
31798
  }
31511
31799
  ),
31512
- showMissingConfig && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
31513
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
31800
+ showMissingConfig && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
31801
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
31514
31802
  ThreadHistoryStatus,
31515
31803
  {
31516
31804
  state: stream.historyLoad,
@@ -31520,7 +31808,7 @@ function ChatTranscript({
31520
31808
  }
31521
31809
  }
31522
31810
  ),
31523
- !stream.threadId && messages.length === 0 && !canLoadMoreMessages ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
31811
+ !stream.threadId && messages.length === 0 && !canLoadMoreMessages ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
31524
31812
  StartScreen,
31525
31813
  {
31526
31814
  startScreen,
@@ -31530,7 +31818,7 @@ function ChatTranscript({
31530
31818
  promptEditDisabled: isPromptEditDisabled,
31531
31819
  className: "px-4 pb-4 pt-2"
31532
31820
  }
31533
- ) : /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
31821
+ ) : /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
31534
31822
  MessageList,
31535
31823
  {
31536
31824
  approval: inlineApproval.card,
@@ -31577,14 +31865,14 @@ function ChatTranscript({
31577
31865
  onMessageAnchor: setMessageNavigationAnchor
31578
31866
  }
31579
31867
  ),
31580
- needsUserInput && !stream.isDisplayPaused && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("p", { role: "status", className: "mt-3 text-sm text-muted-foreground", children: t("thread.waitingForInput") })
31868
+ needsUserInput && !stream.isDisplayPaused && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { role: "status", className: "mt-3 text-sm text-muted-foreground", children: t("thread.waitingForInput") })
31581
31869
  ]
31582
31870
  }
31583
31871
  );
31584
31872
  }
31585
31873
 
31586
31874
  // src/components/chat/messages/useChatQuotes.ts
31587
- var React110 = __toESM(require("react"), 1);
31875
+ var React111 = __toESM(require("react"), 1);
31588
31876
 
31589
31877
  // src/components/chat/messages/quote-selection.ts
31590
31878
  function getClosestQuoteContainer(node) {
@@ -31605,13 +31893,13 @@ function useChatQuotes({
31605
31893
  composerInputRef,
31606
31894
  workbench
31607
31895
  }) {
31608
- const [quoteSelection, setQuoteSelection] = React110.useState(null);
31609
- const [isOpeningSideChat, setIsOpeningSideChat] = React110.useState(false);
31610
- const [sideChatError, setSideChatError] = React110.useState(null);
31611
- const clearQuoteSelection = React110.useCallback(() => {
31896
+ const [quoteSelection, setQuoteSelection] = React111.useState(null);
31897
+ const [isOpeningSideChat, setIsOpeningSideChat] = React111.useState(false);
31898
+ const [sideChatError, setSideChatError] = React111.useState(null);
31899
+ const clearQuoteSelection = React111.useCallback(() => {
31612
31900
  setQuoteSelection(null);
31613
31901
  }, []);
31614
- const syncQuoteSelection = React110.useCallback(() => {
31902
+ const syncQuoteSelection = React111.useCallback(() => {
31615
31903
  if (surface !== "main") {
31616
31904
  clearQuoteSelection();
31617
31905
  return;
@@ -31660,13 +31948,13 @@ function useChatQuotes({
31660
31948
  left
31661
31949
  });
31662
31950
  }, [clearQuoteSelection, surface]);
31663
- React110.useEffect(() => {
31951
+ React111.useEffect(() => {
31664
31952
  document.addEventListener("selectionchange", syncQuoteSelection);
31665
31953
  return () => {
31666
31954
  document.removeEventListener("selectionchange", syncQuoteSelection);
31667
31955
  };
31668
31956
  }, [syncQuoteSelection]);
31669
- React110.useEffect(() => {
31957
+ React111.useEffect(() => {
31670
31958
  const viewport = viewportRef.current;
31671
31959
  if (!viewport) {
31672
31960
  return;
@@ -31683,10 +31971,10 @@ function useChatQuotes({
31683
31971
  window.removeEventListener("resize", handleViewportScroll);
31684
31972
  };
31685
31973
  }, [clearQuoteSelection]);
31686
- React110.useEffect(() => {
31974
+ React111.useEffect(() => {
31687
31975
  clearQuoteSelection();
31688
31976
  }, [messages.length, stream.threadId, clearQuoteSelection]);
31689
- const handleQuoteSelection = React110.useCallback(() => {
31977
+ const handleQuoteSelection = React111.useCallback(() => {
31690
31978
  if (!quoteSelection) {
31691
31979
  return;
31692
31980
  }
@@ -31699,7 +31987,7 @@ function useChatQuotes({
31699
31987
  }
31700
31988
  composerInputRef.current?.focus();
31701
31989
  }, [clearQuoteSelection, quoteSelection]);
31702
- const handleAskInSideChat = React110.useCallback(async () => {
31990
+ const handleAskInSideChat = React111.useCallback(async () => {
31703
31991
  if (!quoteSelection || !workbench.sideChatEnabled || !stream.threadId || stream.isLoading)
31704
31992
  return;
31705
31993
  setIsOpeningSideChat(true);
@@ -31731,7 +32019,7 @@ function useChatQuotes({
31731
32019
  }
31732
32020
 
31733
32021
  // src/components/chat/messages/useChatStreamingFeedback.ts
31734
- var React111 = __toESM(require("react"), 1);
32022
+ var React112 = __toESM(require("react"), 1);
31735
32023
  function useChatStreamingFeedback({
31736
32024
  surface,
31737
32025
  setStream,
@@ -31739,14 +32027,14 @@ function useChatStreamingFeedback({
31739
32027
  }) {
31740
32028
  const LOADING_DOTS_MIN_DURATION = 800;
31741
32029
  const STREAMING_STATUS_REFRESH_MS = 250;
31742
- const [showLoadingDots, setShowLoadingDots] = React111.useState(false);
31743
- const [streamingNow, setStreamingNow] = React111.useState(() => Date.now());
31744
- const loadingStartTimeRef = React111.useRef(null);
31745
- const lastStreamOutputAtRef = React111.useRef(null);
31746
- React111.useEffect(() => {
32030
+ const [showLoadingDots, setShowLoadingDots] = React112.useState(false);
32031
+ const [streamingNow, setStreamingNow] = React112.useState(() => Date.now());
32032
+ const loadingStartTimeRef = React112.useRef(null);
32033
+ const lastStreamOutputAtRef = React112.useRef(null);
32034
+ React112.useEffect(() => {
31747
32035
  if (surface === "main") setStream(stream);
31748
32036
  }, [setStream, stream, surface]);
31749
- React111.useEffect(() => {
32037
+ React112.useEffect(() => {
31750
32038
  if (stream.isLoading) {
31751
32039
  if (!loadingStartTimeRef.current) {
31752
32040
  loadingStartTimeRef.current = Date.now();
@@ -31769,7 +32057,7 @@ function useChatStreamingFeedback({
31769
32057
  }
31770
32058
  }
31771
32059
  }, [stream.isLoading]);
31772
- React111.useEffect(() => {
32060
+ React112.useEffect(() => {
31773
32061
  if (!stream.isLoading) {
31774
32062
  lastStreamOutputAtRef.current = null;
31775
32063
  setStreamingNow(Date.now());
@@ -31779,7 +32067,7 @@ function useChatStreamingFeedback({
31779
32067
  lastStreamOutputAtRef.current = now;
31780
32068
  setStreamingNow(now);
31781
32069
  }, [stream.messages, stream.isLoading]);
31782
- React111.useEffect(() => {
32070
+ React112.useEffect(() => {
31783
32071
  if (!stream.isLoading) {
31784
32072
  return;
31785
32073
  }
@@ -31792,7 +32080,7 @@ function useChatStreamingFeedback({
31792
32080
  }
31793
32081
 
31794
32082
  // src/components/chat/messages/useChatViewport.ts
31795
- var React112 = __toESM(require("react"), 1);
32083
+ var React113 = __toESM(require("react"), 1);
31796
32084
  function useChatViewport({
31797
32085
  t,
31798
32086
  assistantTitle,
@@ -31805,20 +32093,20 @@ function useChatViewport({
31805
32093
  clearQuoteSelection,
31806
32094
  setHistoryError
31807
32095
  }) {
31808
- const [isAtBottom, setIsAtBottom] = React112.useState(true);
31809
- const [hasUpdatesBelow, setHasUpdatesBelow] = React112.useState(false);
31810
- const messageNavigationAnchorsRef = React112.useRef(
32096
+ const [isAtBottom, setIsAtBottom] = React113.useState(true);
32097
+ const [hasUpdatesBelow, setHasUpdatesBelow] = React113.useState(false);
32098
+ const messageNavigationAnchorsRef = React113.useRef(
31811
32099
  /* @__PURE__ */ new Map()
31812
32100
  );
31813
- const shouldAutoScrollRef = React112.useRef(true);
31814
- const forceFollowRef = React112.useRef(false);
31815
- const previousMessageCountRef = React112.useRef(0);
31816
- const previousScrollTopRef = React112.useRef(0);
31817
- const isPrependingHistoryMessagesRef = React112.useRef(false);
31818
- const autoScrollFrameRef = React112.useRef(null);
31819
- const isPointerDownRef = React112.useRef(false);
31820
- const lastTouchYRef = React112.useRef(null);
31821
- const messageNavigationLabels = React112.useMemo(
32101
+ const shouldAutoScrollRef = React113.useRef(true);
32102
+ const forceFollowRef = React113.useRef(false);
32103
+ const previousMessageCountRef = React113.useRef(0);
32104
+ const previousScrollTopRef = React113.useRef(0);
32105
+ const isPrependingHistoryMessagesRef = React113.useRef(false);
32106
+ const autoScrollFrameRef = React113.useRef(null);
32107
+ const isPointerDownRef = React113.useRef(false);
32108
+ const lastTouchYRef = React113.useRef(null);
32109
+ const messageNavigationLabels = React113.useMemo(
31822
32110
  () => ({
31823
32111
  user: t("chat.youLabel"),
31824
32112
  assistant: assistantTitle,
@@ -31838,7 +32126,7 @@ function useChatViewport({
31838
32126
  [assistantTitle, t]
31839
32127
  );
31840
32128
  const presentationMode = resolveMessagePresentation(messagePresentation).mode;
31841
- const messageNavigationItems = React112.useMemo(
32129
+ const messageNavigationItems = React113.useMemo(
31842
32130
  () => messageNavigationEnabled ? buildMessageNavigationItems(
31843
32131
  messages,
31844
32132
  {
@@ -31863,23 +32151,23 @@ function useChatViewport({
31863
32151
  historyMessagePagination?.isLoadingMore
31864
32152
  );
31865
32153
  const canLoadMoreMessages = Boolean(historyMessagePagination?.hasMore);
31866
- const cancelPendingAutoScroll = React112.useCallback(() => {
32154
+ const cancelPendingAutoScroll = React113.useCallback(() => {
31867
32155
  if (autoScrollFrameRef.current !== null) {
31868
32156
  cancelAnimationFrame(autoScrollFrameRef.current);
31869
32157
  autoScrollFrameRef.current = null;
31870
32158
  }
31871
32159
  }, []);
31872
- const disableAutoFollow = React112.useCallback(() => {
32160
+ const disableAutoFollow = React113.useCallback(() => {
31873
32161
  forceFollowRef.current = false;
31874
32162
  shouldAutoScrollRef.current = false;
31875
32163
  cancelPendingAutoScroll();
31876
32164
  }, [cancelPendingAutoScroll]);
31877
- const enableAutoFollow = React112.useCallback(() => {
32165
+ const enableAutoFollow = React113.useCallback(() => {
31878
32166
  forceFollowRef.current = true;
31879
32167
  shouldAutoScrollRef.current = true;
31880
32168
  setHasUpdatesBelow(false);
31881
32169
  }, []);
31882
- const scrollToBottom = React112.useCallback(
32170
+ const scrollToBottom = React113.useCallback(
31883
32171
  (smooth = false, force = false) => {
31884
32172
  if (force) {
31885
32173
  enableAutoFollow();
@@ -31906,7 +32194,7 @@ function useChatViewport({
31906
32194
  },
31907
32195
  [cancelPendingAutoScroll, enableAutoFollow]
31908
32196
  );
31909
- const setMessageNavigationAnchor = React112.useCallback(
32197
+ const setMessageNavigationAnchor = React113.useCallback(
31910
32198
  (id, node) => {
31911
32199
  if (node) {
31912
32200
  messageNavigationAnchorsRef.current.set(id, node);
@@ -31916,15 +32204,15 @@ function useChatViewport({
31916
32204
  },
31917
32205
  []
31918
32206
  );
31919
- const getMessageNavigationAnchor = React112.useCallback(
32207
+ const getMessageNavigationAnchor = React113.useCallback(
31920
32208
  (item) => messageNavigationAnchorsRef.current.get(item.id) ?? null,
31921
32209
  []
31922
32210
  );
31923
- const handleMessageNavigationNavigate = React112.useCallback(() => {
32211
+ const handleMessageNavigationNavigate = React113.useCallback(() => {
31924
32212
  disableAutoFollow();
31925
32213
  clearQuoteSelection();
31926
32214
  }, [clearQuoteSelection, disableAutoFollow]);
31927
- React112.useEffect(() => {
32215
+ React113.useEffect(() => {
31928
32216
  const viewport = viewportRef.current;
31929
32217
  if (!viewport) return;
31930
32218
  previousScrollTopRef.current = viewport.scrollTop;
@@ -32005,14 +32293,14 @@ function useChatViewport({
32005
32293
  window.removeEventListener("pointercancel", stopPointerTracking);
32006
32294
  };
32007
32295
  }, [cancelPendingAutoScroll, disableAutoFollow]);
32008
- React112.useEffect(() => {
32296
+ React113.useEffect(() => {
32009
32297
  shouldAutoScrollRef.current = true;
32010
32298
  forceFollowRef.current = false;
32011
32299
  previousScrollTopRef.current = 0;
32012
32300
  setIsAtBottom(true);
32013
32301
  setHasUpdatesBelow(false);
32014
32302
  }, [stream.threadId]);
32015
- React112.useEffect(() => {
32303
+ React113.useEffect(() => {
32016
32304
  const messageCountChanged = messages.length !== previousMessageCountRef.current;
32017
32305
  previousMessageCountRef.current = messages.length;
32018
32306
  if (isPrependingHistoryMessagesRef.current) {
@@ -32029,7 +32317,7 @@ function useChatViewport({
32029
32317
  scrollToBottom();
32030
32318
  }
32031
32319
  }, [stream.isLoading, messages, scrollToBottom]);
32032
- const handleLoadMoreMessages = React112.useCallback(async () => {
32320
+ const handleLoadMoreMessages = React113.useCallback(async () => {
32033
32321
  if (!canLoadMoreMessages || isLoadingMoreMessages) {
32034
32322
  return;
32035
32323
  }
@@ -32081,7 +32369,7 @@ function useChatViewport({
32081
32369
  }
32082
32370
 
32083
32371
  // src/components/chat/models/useChatModels.ts
32084
- var React113 = __toESM(require("react"), 1);
32372
+ var React114 = __toESM(require("react"), 1);
32085
32373
 
32086
32374
  // src/components/chat/session/errors.ts
32087
32375
  function toError(value) {
@@ -32104,7 +32392,7 @@ function useChatModels({
32104
32392
  availableModels,
32105
32393
  hostedModelCatalog
32106
32394
  }) {
32107
- React113.useEffect(() => {
32395
+ React114.useEffect(() => {
32108
32396
  if (modelAssistantIdRef.current !== modelAssistantId) {
32109
32397
  modelAssistantIdRef.current = modelAssistantId;
32110
32398
  requestedModelIdRef.current = void 0;
@@ -32153,7 +32441,7 @@ function useChatModels({
32153
32441
  sendParentEvent,
32154
32442
  setSelectedModelId
32155
32443
  ]);
32156
- const handleModelSelect = React113.useCallback(
32444
+ const handleModelSelect = React114.useCallback(
32157
32445
  (modelId) => {
32158
32446
  const nextModelId = resolveSelectedModelId(availableModels, modelId);
32159
32447
  if (!nextModelId) return;
@@ -32182,22 +32470,22 @@ function useChatModels({
32182
32470
  }
32183
32471
 
32184
32472
  // src/components/chat/models/useChatModelState.ts
32185
- var React114 = __toESM(require("react"), 1);
32473
+ var React115 = __toESM(require("react"), 1);
32186
32474
  function useChatModelState({ stream }) {
32187
- const [availableModels, setAvailableModels] = React114.useState(
32475
+ const [availableModels, setAvailableModels] = React115.useState(
32188
32476
  []
32189
32477
  );
32190
- const [hostedModelCatalog, setHostedModelCatalog] = React114.useState(null);
32478
+ const [hostedModelCatalog, setHostedModelCatalog] = React115.useState(null);
32191
32479
  const modelAssistantId = stream.assistantId;
32192
32480
  const modelClient = stream.client;
32193
32481
  const selectedModelId = stream.selectedModelId;
32194
32482
  const setSelectedModelId = stream.setSelectedModelId;
32195
- const selectedModelIdRef = React114.useRef(selectedModelId);
32483
+ const selectedModelIdRef = React115.useRef(selectedModelId);
32196
32484
  selectedModelIdRef.current = selectedModelId;
32197
- const requestedModelIdRef = React114.useRef(
32485
+ const requestedModelIdRef = React115.useRef(
32198
32486
  void 0
32199
32487
  );
32200
- const modelAssistantIdRef = React114.useRef(modelAssistantId);
32488
+ const modelAssistantIdRef = React115.useRef(modelAssistantId);
32201
32489
  return {
32202
32490
  requestedModelIdRef,
32203
32491
  setSelectedModelId,
@@ -32213,24 +32501,24 @@ function useChatModelState({ stream }) {
32213
32501
  }
32214
32502
 
32215
32503
  // src/components/chat/pet/useChatPetSettings.ts
32216
- var React115 = __toESM(require("react"), 1);
32504
+ var React116 = __toESM(require("react"), 1);
32217
32505
  function useChatPetSettings({ options }) {
32218
- const [petSettingsOpen, setPetSettingsOpen] = React115.useState(false);
32219
- const [petLocalSettings, setPetLocalSettings] = React115.useState(() => readPetLocalSettings());
32506
+ const [petSettingsOpen, setPetSettingsOpen] = React116.useState(false);
32507
+ const [petLocalSettings, setPetLocalSettings] = React116.useState(() => readPetLocalSettings());
32220
32508
  const petRequired = options?.displayMode === "pet";
32221
32509
  const petDisabled = options?.pet === false && !petRequired;
32222
- const basePetSettings = React115.useMemo(
32510
+ const basePetSettings = React116.useMemo(
32223
32511
  () => derivePetLocalSettings(options?.pet),
32224
32512
  [options?.pet]
32225
32513
  );
32226
- const displayedPetSettings = React115.useMemo(
32514
+ const displayedPetSettings = React116.useMemo(
32227
32515
  () => ({
32228
32516
  ...petLocalSettings ?? basePetSettings,
32229
32517
  ...petRequired ? { enabled: true } : {}
32230
32518
  }),
32231
32519
  [basePetSettings, petLocalSettings, petRequired]
32232
32520
  );
32233
- const effectivePet = React115.useMemo(() => {
32521
+ const effectivePet = React116.useMemo(() => {
32234
32522
  if (petDisabled) return false;
32235
32523
  if (petRequired || petLocalSettings) {
32236
32524
  return buildPetOptionsFromLocalSettings(displayedPetSettings);
@@ -32243,7 +32531,7 @@ function useChatPetSettings({ options }) {
32243
32531
  petLocalSettings,
32244
32532
  petRequired
32245
32533
  ]);
32246
- const savePetLocalSettings = React115.useCallback(
32534
+ const savePetLocalSettings = React116.useCallback(
32247
32535
  (settings) => {
32248
32536
  if (petDisabled) return;
32249
32537
  const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
@@ -32252,7 +32540,7 @@ function useChatPetSettings({ options }) {
32252
32540
  },
32253
32541
  [petDisabled, petRequired]
32254
32542
  );
32255
- const handlePetCommand = React115.useCallback(
32543
+ const handlePetCommand = React116.useCallback(
32256
32544
  (mode) => {
32257
32545
  if (petDisabled) return;
32258
32546
  if (mode === "settings") {
@@ -32280,7 +32568,7 @@ function useChatPetSettings({ options }) {
32280
32568
  savePetLocalSettings
32281
32569
  ]
32282
32570
  );
32283
- const handleSetPetEnabled = React115.useCallback(
32571
+ const handleSetPetEnabled = React116.useCallback(
32284
32572
  (enabled) => {
32285
32573
  if (petRequired) return;
32286
32574
  savePetLocalSettings({ ...displayedPetSettings, enabled });
@@ -32397,7 +32685,7 @@ function useChatAssistant({
32397
32685
  }
32398
32686
 
32399
32687
  // src/components/chat/session/useChatBranchState.ts
32400
- var React116 = __toESM(require("react"), 1);
32688
+ var React117 = __toESM(require("react"), 1);
32401
32689
 
32402
32690
  // src/hooks/useThreadBranches.ts
32403
32691
  var import_react13 = require("react");
@@ -32434,6 +32722,21 @@ function useThreadBranches(client, conversationId, threadId, enabled, isLoading)
32434
32722
  generation.current += 1;
32435
32723
  };
32436
32724
  }, [refresh, isLoading]);
32725
+ (0, import_react13.useEffect)(() => {
32726
+ if (!enabled || !threadId || !["busy", "pausing"].includes(current?.status ?? ""))
32727
+ return;
32728
+ let disposed = false;
32729
+ let timer;
32730
+ const poll = async () => {
32731
+ await refresh();
32732
+ if (!disposed) timer = setTimeout(poll, 1e3);
32733
+ };
32734
+ timer = setTimeout(poll, 1e3);
32735
+ return () => {
32736
+ disposed = true;
32737
+ clearTimeout(timer);
32738
+ };
32739
+ }, [enabled, threadId, current?.status, refresh]);
32437
32740
  return { branches, current, error, refresh };
32438
32741
  }
32439
32742
 
@@ -32446,14 +32749,14 @@ function useChatBranchState({ stream }) {
32446
32749
  Boolean(stream.isReady && stream.client?.conversations?.listThreads),
32447
32750
  stream.isLoading
32448
32751
  );
32449
- const [editingMessageId, setEditingMessageId] = React116.useState(
32752
+ const [editingMessageId, setEditingMessageId] = React117.useState(
32450
32753
  null
32451
32754
  );
32452
- const editRequestRef = React116.useRef(null);
32453
- const [isChangingBranch, setIsChangingBranch] = React116.useState(false);
32454
- const activeBranchRef = React116.useRef(stream.threadId);
32755
+ const editRequestRef = React117.useRef(null);
32756
+ const [isChangingBranch, setIsChangingBranch] = React117.useState(false);
32757
+ const activeBranchRef = React117.useRef(stream.threadId);
32455
32758
  activeBranchRef.current = stream.threadId;
32456
- React116.useEffect(() => {
32759
+ React117.useEffect(() => {
32457
32760
  setEditingMessageId(null);
32458
32761
  editRequestRef.current = null;
32459
32762
  }, [stream.threadId]);
@@ -32469,7 +32772,7 @@ function useChatBranchState({ stream }) {
32469
32772
  }
32470
32773
 
32471
32774
  // src/components/chat/session/useChatConversationActions.ts
32472
- var React117 = __toESM(require("react"), 1);
32775
+ var React118 = __toESM(require("react"), 1);
32473
32776
 
32474
32777
  // src/hooks/useConversationBranch.ts
32475
32778
  var import_react14 = require("react");
@@ -32593,8 +32896,33 @@ function useChatConversationActions({
32593
32896
  setIsChangingBranch,
32594
32897
  options
32595
32898
  }) {
32596
- const handleProjectSelectionChange = React117.useCallback(
32597
- (projectId, selection) => {
32899
+ const previousProjectRef = React118.useRef(activeProjectId);
32900
+ React118.useLayoutEffect(() => {
32901
+ if (previousProjectRef.current === activeProjectId) return;
32902
+ previousProjectRef.current = activeProjectId;
32903
+ commitComposerParts(composerPartsRef.current.filter((part) => part.type === "text"), {
32904
+ resetDom: true,
32905
+ syncRemovedCapabilityTokens: false
32906
+ });
32907
+ attachmentsRef.current?.clear();
32908
+ setReferences([]);
32909
+ setReferencedWorkspaceFiles([]);
32910
+ setThreadMention(null);
32911
+ setSelectedTool(null);
32912
+ setEditingMessageId(null);
32913
+ editRequestRef.current = null;
32914
+ activeBranchRef.current = null;
32915
+ setIsChangingBranch(false);
32916
+ setHistoryError(null);
32917
+ setRuntimeCapabilityPalette(null);
32918
+ resetRunRuntimeCapabilities();
32919
+ }, [activeProjectId, commitComposerParts, resetRunRuntimeCapabilities]);
32920
+ const handleProjectSelectionChange = React118.useCallback(
32921
+ (projectId2, selection) => {
32922
+ if (stream.threadId || stream.conversationId) {
32923
+ onProjectChange?.(projectId2, selection);
32924
+ return;
32925
+ }
32598
32926
  const textParts = composerPartsRef.current.filter(
32599
32927
  (part) => part.type === "text"
32600
32928
  );
@@ -32615,7 +32943,7 @@ function useChatConversationActions({
32615
32943
  );
32616
32944
  });
32617
32945
  onConnectorsChange?.([]);
32618
- onProjectChange?.(projectId, selection);
32946
+ onProjectChange?.(projectId2, selection);
32619
32947
  },
32620
32948
  [
32621
32949
  commitComposerParts,
@@ -32650,7 +32978,7 @@ function useChatConversationActions({
32650
32978
  },
32651
32979
  refresh: refreshThreads
32652
32980
  });
32653
- const handlePromptEdit = React117.useCallback(
32981
+ const handlePromptEdit = React118.useCallback(
32654
32982
  (prompt) => {
32655
32983
  if (isPromptEditDisabled) return;
32656
32984
  setComposerText(prompt, prompt.length);
@@ -32664,7 +32992,7 @@ function useChatConversationActions({
32664
32992
  setRuntimeCapabilityPalette
32665
32993
  ]
32666
32994
  );
32667
- const loadThreadHistory = React117.useCallback(
32995
+ const loadThreadHistory = React118.useCallback(
32668
32996
  async (threadId) => {
32669
32997
  if (missingConfig) {
32670
32998
  setHistoryError(missingConfigShortMessage);
@@ -32811,7 +33139,7 @@ function useChatConversationActions({
32811
33139
  }
32812
33140
 
32813
33141
  // src/components/chat/session/useChatEnvironment.ts
32814
- var React118 = __toESM(require("react"), 1);
33142
+ var React119 = __toESM(require("react"), 1);
32815
33143
  var import_meta3 = {};
32816
33144
  var defaultApiUrl2 = import_meta3.env.VITE_XPERTAI_API_URL;
32817
33145
  function useChatEnvironment({
@@ -32839,7 +33167,7 @@ function useChatEnvironment({
32839
33167
  clientSecret: effectiveClientSecret
32840
33168
  });
32841
33169
  const missingConfig = Boolean(missingConfigKind);
32842
- const missingConfigShortMessage = React118.useMemo(() => {
33170
+ const missingConfigShortMessage = React119.useMemo(() => {
32843
33171
  switch (missingConfigKind) {
32844
33172
  case "apiUrl":
32845
33173
  return t("chat.missingApiUrlShort");
@@ -32851,7 +33179,7 @@ function useChatEnvironment({
32851
33179
  return t("chat.missingConfigShort");
32852
33180
  }
32853
33181
  }, [missingConfigKind, t]);
32854
- const missingConfigDetailMessage = React118.useMemo(() => {
33182
+ const missingConfigDetailMessage = React119.useMemo(() => {
32855
33183
  switch (missingConfigKind) {
32856
33184
  case "apiUrl":
32857
33185
  return t("chat.missingApiUrlDetail");
@@ -32865,7 +33193,7 @@ function useChatEnvironment({
32865
33193
  }, [missingConfigKind, t]);
32866
33194
  const isHistoryLoading = stream.historyLoad?.status === "loading";
32867
33195
  const isHistoryUnavailable = isHistoryLoading || stream.historyLoad?.status === "error";
32868
- const [historyError, setHistoryError] = React118.useState(null);
33196
+ const [historyError, setHistoryError] = React119.useState(null);
32869
33197
  const showMissingConfig = !isClientSecretInitializing && missingConfig;
32870
33198
  return {
32871
33199
  stream,
@@ -32894,43 +33222,49 @@ function useChatEnvironment({
32894
33222
  }
32895
33223
 
32896
33224
  // src/components/chat/session/useChatRunControl.ts
32897
- var React119 = __toESM(require("react"), 1);
33225
+ var React120 = __toESM(require("react"), 1);
32898
33226
  function useChatRunControl({
32899
33227
  branchState,
32900
33228
  stream,
32901
33229
  isChangingBranch,
32902
33230
  activeBranchRef
32903
33231
  }) {
32904
- const [runControlRequest, setRunControlRequest] = React119.useState(null);
32905
- const runControlRequestRef = React119.useRef(null);
32906
- const [runControlError, setRunControlError] = React119.useState(null);
33232
+ const [runControlRequest, setRunControlRequest] = React120.useState(null);
33233
+ const runControlRequestRef = React120.useRef(null);
33234
+ const [runControlError, setRunControlError] = React120.useState(null);
33235
+ const errorGenerationRef = React120.useRef(0);
33236
+ const clearRunControlError = React120.useCallback(() => {
33237
+ errorGenerationRef.current += 1;
33238
+ setRunControlError(null);
33239
+ }, []);
33240
+ React120.useEffect(clearRunControlError, [stream.threadId, clearRunControlError]);
32907
33241
  const currentRunControl = branchState.current?.runControl;
32908
- const pauseRunId = stream.activeRunId ?? currentRunControl?.executionId ?? stream.displayPause?.executionId ?? null;
33242
+ const pauseRunId = stream.isLoading ? stream.activeRunId ?? currentRunControl?.executionId ?? null : currentRunControl?.executionId ?? stream.activeRunId ?? null;
32909
33243
  const canPauseRun = Boolean(
32910
33244
  stream.threadId && pauseRunId && !stream.isThreadInterrupted && (stream.isLoading || currentRunControl?.state === "running")
32911
33245
  );
32912
33246
  const isRunPausing = runControlRequest?.threadId === stream.threadId && runControlRequest.action === "pause" || branchState.current?.status === "pausing";
32913
33247
  const isRunPaused = branchState.current?.status === "paused";
32914
- const canRevealPausedDisplay = Boolean(stream.displayPause) && ["idle", "error", "interrupted"].includes(
32915
- branchState.current?.status ?? ""
33248
+ const isPauseActive = isRunPausing || isRunPaused;
33249
+ const isStoppingRun = runControlRequest?.threadId === stream.threadId && runControlRequest.action === "stop";
33250
+ const canStopRun = Boolean(
33251
+ stream.threadId && pauseRunId && (stream.isLoading || ["busy", "pausing", "paused"].includes(
33252
+ branchState.current?.status ?? ""
33253
+ ))
32916
33254
  );
32917
- const isPauseActive = isRunPausing || isRunPaused || stream.isDisplayPaused;
32918
33255
  const isResumingRun = runControlRequest?.threadId === stream.threadId && runControlRequest.action === "resume";
32919
- const isVisibleStreaming = stream.isLoading && !stream.isDisplayPaused && !stream.isThreadInterrupted;
33256
+ const isVisibleStreaming = stream.isLoading && !stream.isThreadInterrupted;
32920
33257
  const handleComposerRunControl = async (action) => {
32921
33258
  const sourceThreadId = stream.threadId;
32922
- if (isChangingBranch || isRunPausing || isResumingRun) return;
32923
- if (action === "resume") {
32924
- if (!sourceThreadId || !canRevealPausedDisplay && (!isRunPaused || !currentRunControl?.pauseId))
32925
- return;
32926
- } else {
32927
- if (isRunPaused) return;
32928
- if (!sourceThreadId || !pauseRunId) return;
32929
- }
32930
- if (!sourceThreadId) return;
32931
- if (runControlRequestRef.current?.threadId === sourceThreadId) return;
33259
+ if (!sourceThreadId || !pauseRunId || isChangingBranch || isStoppingRun || isResumingRun)
33260
+ return;
33261
+ if (action === "resume" && (!isRunPaused || !currentRunControl?.pauseId))
33262
+ return;
33263
+ if (action === "pause" && (isRunPaused || isRunPausing)) return;
33264
+ if (action === "stop" && !canStopRun) return;
33265
+ if (action !== "stop" && runControlRequestRef.current?.threadId === sourceThreadId)
33266
+ return;
32932
33267
  const runId = pauseRunId;
32933
- if (!runId) return;
32934
33268
  const request = {
32935
33269
  action,
32936
33270
  threadId: sourceThreadId,
@@ -32938,26 +33272,26 @@ function useChatRunControl({
32938
33272
  };
32939
33273
  runControlRequestRef.current = request;
32940
33274
  setRunControlRequest(request);
32941
- setRunControlError(null);
33275
+ clearRunControlError();
33276
+ const errorGeneration = errorGenerationRef.current;
32942
33277
  try {
32943
- if (action === "resume" && canRevealPausedDisplay) {
32944
- await stream.resumeDisplay();
33278
+ if (action === "stop") {
33279
+ await stream.stop(request.runId);
32945
33280
  } else if (action === "resume" && currentRunControl?.pauseId) {
32946
33281
  await stream.resumeRun(request.runId, currentRunControl.pauseId);
32947
33282
  } else {
32948
33283
  await stream.pauseRun(request.runId);
32949
33284
  }
32950
- if (activeBranchRef.current === sourceThreadId) {
32951
- await branchState.refresh();
32952
- }
32953
33285
  } catch (error) {
32954
- if (activeBranchRef.current === sourceThreadId && runControlRequestRef.current === request) {
33286
+ if (activeBranchRef.current === sourceThreadId && runControlRequestRef.current === request && errorGenerationRef.current === errorGeneration) {
32955
33287
  setRunControlError({
32956
33288
  threadId: sourceThreadId,
32957
33289
  message: error instanceof Error ? error.message : String(error)
32958
33290
  });
32959
33291
  }
32960
33292
  } finally {
33293
+ if (activeBranchRef.current === sourceThreadId)
33294
+ await branchState.refresh();
32961
33295
  if (runControlRequestRef.current === request) {
32962
33296
  runControlRequestRef.current = null;
32963
33297
  setRunControlRequest(null);
@@ -32971,18 +33305,20 @@ function useChatRunControl({
32971
33305
  isVisibleStreaming,
32972
33306
  isPauseActive,
32973
33307
  runControlError,
33308
+ clearRunControlError,
32974
33309
  canPauseRun,
32975
33310
  handleComposerRunControl,
32976
- canRevealPausedDisplay,
33311
+ canStopRun,
33312
+ isStoppingRun,
32977
33313
  currentRunControl
32978
33314
  };
32979
33315
  }
32980
33316
 
32981
33317
  // src/components/chat/summary/useChatTaskSummary.ts
32982
- var React121 = __toESM(require("react"), 1);
33318
+ var React122 = __toESM(require("react"), 1);
32983
33319
 
32984
33320
  // src/hooks/useTaskSummary.ts
32985
- var React120 = __toESM(require("react"), 1);
33321
+ var React121 = __toESM(require("react"), 1);
32986
33322
  function useTaskSummary({
32987
33323
  enabled,
32988
33324
  conversationId,
@@ -32990,23 +33326,23 @@ function useTaskSummary({
32990
33326
  live,
32991
33327
  refreshVersion = 0
32992
33328
  }) {
32993
- const [loaded, setLoaded] = React120.useState(null);
32994
- const [historySections, setHistorySections] = React120.useState({});
32995
- const [historySectionsConversationId, setHistorySectionsConversationId] = React120.useState(null);
32996
- const [loadingSections, setLoadingSections] = React120.useState({});
32997
- const [error, setError] = React120.useState(null);
32998
- const [retryVersion, setRetryVersion] = React120.useState(0);
32999
- const requestVersionRef = React120.useRef(0);
33000
- const conversationIdRef = React120.useRef(conversationId);
33001
- const sectionControllersRef = React120.useRef(
33329
+ const [loaded, setLoaded] = React121.useState(null);
33330
+ const [historySections, setHistorySections] = React121.useState({});
33331
+ const [historySectionsConversationId, setHistorySectionsConversationId] = React121.useState(null);
33332
+ const [loadingSections, setLoadingSections] = React121.useState({});
33333
+ const [error, setError] = React121.useState(null);
33334
+ const [retryVersion, setRetryVersion] = React121.useState(0);
33335
+ const requestVersionRef = React121.useRef(0);
33336
+ const conversationIdRef = React121.useRef(conversationId);
33337
+ const sectionControllersRef = React121.useRef(
33002
33338
  /* @__PURE__ */ new Map()
33003
33339
  );
33004
33340
  conversationIdRef.current = conversationId;
33005
- const abortSectionRequests = React120.useCallback(() => {
33341
+ const abortSectionRequests = React121.useCallback(() => {
33006
33342
  sectionControllersRef.current.forEach((controller) => controller.abort());
33007
33343
  sectionControllersRef.current.clear();
33008
33344
  }, []);
33009
- React120.useEffect(() => {
33345
+ React121.useEffect(() => {
33010
33346
  abortSectionRequests();
33011
33347
  setHistorySections({});
33012
33348
  setHistorySectionsConversationId(conversationId);
@@ -33041,11 +33377,11 @@ function useTaskSummary({
33041
33377
  retryVersion
33042
33378
  ]);
33043
33379
  const snapshot = loaded?.conversationId === conversationId ? loaded.snapshot : null;
33044
- const activeHistorySections = React120.useMemo(
33380
+ const activeHistorySections = React121.useMemo(
33045
33381
  () => historySectionsConversationId === conversationId ? historySections : {},
33046
33382
  [conversationId, historySections, historySectionsConversationId]
33047
33383
  );
33048
- const loadSection = React120.useCallback(
33384
+ const loadSection = React121.useCallback(
33049
33385
  async (section) => {
33050
33386
  if (!enabled || !conversationId || loadingSections[section]) {
33051
33387
  return;
@@ -33123,12 +33459,12 @@ function useChatTaskSummary({
33123
33459
  }) {
33124
33460
  const taskSummaryEnabled = options?.taskSummary?.enabled === true;
33125
33461
  const taskSummaryConversationId = stream.conversationId ?? null;
33126
- const [taskSummaryDocked, setTaskSummaryDocked] = React121.useState(false);
33127
- const [taskSummaryOpen, setTaskSummaryOpen] = React121.useState(false);
33128
- const manuallyClosedTaskSummaryConversationIdsRef = React121.useRef(
33462
+ const [taskSummaryDocked, setTaskSummaryDocked] = React122.useState(false);
33463
+ const [taskSummaryOpen, setTaskSummaryOpen] = React122.useState(false);
33464
+ const manuallyClosedTaskSummaryConversationIdsRef = React122.useRef(
33129
33465
  /* @__PURE__ */ new Set()
33130
33466
  );
33131
- const liveTaskSummaryPending = React121.useMemo(() => {
33467
+ const liveTaskSummaryPending = React122.useMemo(() => {
33132
33468
  const followUps = pendingFollowUps.map((item) => ({
33133
33469
  id: `follow-up:${item.id}`,
33134
33470
  kind: "follow_up",
@@ -33163,7 +33499,7 @@ function useChatTaskSummary({
33163
33499
  stream.pendingRequestUserInput,
33164
33500
  t
33165
33501
  ]);
33166
- const liveTaskSummaryRunning = React121.useMemo(
33502
+ const liveTaskSummaryRunning = React122.useMemo(
33167
33503
  () => stream.runtimeActivities.sandboxServices.services.filter(
33168
33504
  (service) => service.status === "starting" || service.status === "running" || service.status === "stopping"
33169
33505
  ).map((service) => ({
@@ -33180,7 +33516,7 @@ function useChatTaskSummary({
33180
33516
  })),
33181
33517
  [stream.runtimeActivities.sandboxServices.services]
33182
33518
  );
33183
- const taskSummaryAgentNames = React121.useMemo(() => {
33519
+ const taskSummaryAgentNames = React122.useMemo(() => {
33184
33520
  const names = /* @__PURE__ */ new Map();
33185
33521
  runtimeCapabilityOptions.forEach((option) => {
33186
33522
  if (option.type !== "subAgent") return;
@@ -33192,7 +33528,7 @@ function useChatTaskSummary({
33192
33528
  });
33193
33529
  return names;
33194
33530
  }, [runtimeCapabilityOptions]);
33195
- const liveTaskSummary = React121.useMemo(
33531
+ const liveTaskSummary = React122.useMemo(
33196
33532
  () => collectLiveTaskSummary({
33197
33533
  messages: messages.map(
33198
33534
  (message) => ({
@@ -33230,7 +33566,7 @@ function useChatTaskSummary({
33230
33566
  live: liveTaskSummary,
33231
33567
  refreshVersion: stream.historyMessageLoadVersion
33232
33568
  });
33233
- const navigateToTaskSummaryMessage = React121.useCallback(
33569
+ const navigateToTaskSummaryMessage = React122.useCallback(
33234
33570
  async (messageId) => {
33235
33571
  try {
33236
33572
  let anchor = messageNavigationAnchorsRef.current.get(messageId);
@@ -33258,7 +33594,7 @@ function useChatTaskSummary({
33258
33594
  taskSummary.summary.outputs,
33259
33595
  taskSummaryConversationId ?? void 0
33260
33596
  );
33261
- React121.useLayoutEffect(() => {
33597
+ React122.useLayoutEffect(() => {
33262
33598
  if (characterPresentation) {
33263
33599
  setTaskSummaryDocked(true);
33264
33600
  return;
@@ -33297,7 +33633,7 @@ function useChatTaskSummary({
33297
33633
  const taskSummaryAvailable = Boolean(
33298
33634
  taskSummaryEnabled && (characterPresentation || stream.threadId && taskSummaryConversationId)
33299
33635
  );
33300
- const handleTaskSummaryOpenChange = React121.useCallback(
33636
+ const handleTaskSummaryOpenChange = React122.useCallback(
33301
33637
  (open) => {
33302
33638
  setTaskSummaryOpen(open);
33303
33639
  if (!taskSummaryConversationId) return;
@@ -33313,7 +33649,7 @@ function useChatTaskSummary({
33313
33649
  },
33314
33650
  [taskSummaryConversationId]
33315
33651
  );
33316
- React121.useEffect(() => {
33652
+ React122.useEffect(() => {
33317
33653
  if (characterPresentation) {
33318
33654
  setTaskSummaryOpen(false);
33319
33655
  return;
@@ -33322,7 +33658,7 @@ function useChatTaskSummary({
33322
33658
  setTaskSummaryOpen(false);
33323
33659
  }
33324
33660
  }, [taskSummaryDocked, characterPresentation, stream.assistantId]);
33325
- React121.useEffect(() => {
33661
+ React122.useEffect(() => {
33326
33662
  if (characterPresentation || !taskSummaryDocked || !taskSummaryAvailable || !taskSummaryConversationId || manuallyClosedTaskSummaryConversationIdsRef.current.has(
33327
33663
  taskSummaryConversationId
33328
33664
  )) {
@@ -33358,14 +33694,14 @@ function useChatTaskSummary({
33358
33694
  }
33359
33695
 
33360
33696
  // src/components/chat.tsx
33361
- var import_chatkit_types31 = require("@xpert-ai/chatkit-types");
33697
+ var import_chatkit_types32 = require("@xpert-ai/chatkit-types");
33362
33698
 
33363
33699
  // src/components/chat/header/AssistantPresence.tsx
33364
- var React122 = __toESM(require("react"), 1);
33700
+ var React123 = __toESM(require("react"), 1);
33365
33701
  var Dialog5 = __toESM(require("@radix-ui/react-dialog"), 1);
33366
- var import_lucide_react74 = require("lucide-react");
33702
+ var import_lucide_react75 = require("lucide-react");
33367
33703
  var import_framer_motion2 = require("framer-motion");
33368
- var import_jsx_runtime120 = require("react/jsx-runtime");
33704
+ var import_jsx_runtime121 = require("react/jsx-runtime");
33369
33705
  var PRESENCE_EASE = [0.22, 1, 0.36, 1];
33370
33706
  function PresenceCharacter({
33371
33707
  presence,
@@ -33373,7 +33709,7 @@ function PresenceCharacter({
33373
33709
  }) {
33374
33710
  const systemReducedMotion = (0, import_framer_motion2.useReducedMotion)();
33375
33711
  const still = presence.reducedMotion || systemReducedMotion;
33376
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
33712
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
33377
33713
  import_framer_motion2.motion.div,
33378
33714
  {
33379
33715
  "data-slot": "assistant-presence-character",
@@ -33381,7 +33717,7 @@ function PresenceCharacter({
33381
33717
  className: "relative z-10 shrink-0",
33382
33718
  style: { width: size2, height: size2 },
33383
33719
  transition: { layout: { duration: 0.34, ease: PRESENCE_EASE } },
33384
- children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(AssistantCharacter, { ...presence, size: size2 })
33720
+ children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(AssistantCharacter, { ...presence, size: size2 })
33385
33721
  }
33386
33722
  );
33387
33723
  }
@@ -33392,7 +33728,7 @@ function PresenceStatus({
33392
33728
  }) {
33393
33729
  const { t } = useChatkitTranslation();
33394
33730
  const key = waitingForInput ? "approval" : state === "failed" ? "failed" : state === "review" ? "thinking" : state === "running" ? "running" : state === "waiting" ? "loading" : "idle";
33395
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
33731
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
33396
33732
  "span",
33397
33733
  {
33398
33734
  role: "status",
@@ -33410,12 +33746,12 @@ function AssistantPresence(props) {
33410
33746
  const { t } = useChatkitTranslation();
33411
33747
  const systemReducedMotion = (0, import_framer_motion2.useReducedMotion)();
33412
33748
  const still = props.reducedMotion || systemReducedMotion;
33413
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
33749
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
33414
33750
  "div",
33415
33751
  {
33416
33752
  "data-slot": "assistant-presence",
33417
33753
  className: "chatkit-presence pointer-events-none relative z-20 col-start-1 row-start-1 flex shrink-0 flex-col items-center self-start",
33418
- children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
33754
+ children: /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
33419
33755
  "button",
33420
33756
  {
33421
33757
  id: props.motionId ? `${props.motionId}-trigger` : void 0,
@@ -33429,8 +33765,8 @@ function AssistantPresence(props) {
33429
33765
  className: "chatkit-presence-trigger pointer-events-auto grid justify-items-center rounded-2xl outline-offset-4",
33430
33766
  onClick: () => props.onOpenChange(true),
33431
33767
  children: [
33432
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "block size-20", children: !props.open && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(PresenceCharacter, { presence: props }) }),
33433
- /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
33768
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "block size-20", children: !props.open && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(PresenceCharacter, { presence: props }) }),
33769
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
33434
33770
  import_framer_motion2.motion.span,
33435
33771
  {
33436
33772
  initial: false,
@@ -33442,8 +33778,8 @@ function AssistantPresence(props) {
33442
33778
  transition: { duration: still ? 0 : 0.18, ease: PRESENCE_EASE },
33443
33779
  className: "chatkit-presence-bubble max-w-64 rounded-2xl border border-border/60 bg-popover/95 shadow-sm backdrop-blur-sm",
33444
33780
  children: [
33445
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "block truncate text-sm font-medium", children: props.name }),
33446
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(PresenceStatus, { ...props })
33781
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "block truncate text-sm font-medium", children: props.name }),
33782
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(PresenceStatus, { ...props })
33447
33783
  ]
33448
33784
  }
33449
33785
  )
@@ -33460,11 +33796,11 @@ function AssistantSummaryDialog({
33460
33796
  voice
33461
33797
  }) {
33462
33798
  const { t } = useChatkitTranslation();
33463
- const dialog = React122.useRef(null);
33464
- const opener = React122.useRef(null);
33465
- const restoreFocus = React122.useRef(true);
33466
- const wasOpen = React122.useRef(false);
33467
- React122.useLayoutEffect(() => {
33799
+ const dialog = React123.useRef(null);
33800
+ const opener = React123.useRef(null);
33801
+ const restoreFocus = React123.useRef(true);
33802
+ const wasOpen = React123.useRef(false);
33803
+ React123.useLayoutEffect(() => {
33468
33804
  if (presence.open && !wasOpen.current) {
33469
33805
  restoreFocus.current = true;
33470
33806
  const active = document.activeElement;
@@ -33478,7 +33814,7 @@ function AssistantSummaryDialog({
33478
33814
  }
33479
33815
  wasOpen.current = presence.open;
33480
33816
  }, [presence.open, presence.motionId]);
33481
- React122.useEffect(() => {
33817
+ React123.useEffect(() => {
33482
33818
  if (!presence.open || voice?.panel) return;
33483
33819
  const dismiss = () => {
33484
33820
  restoreFocus.current = false;
@@ -33487,15 +33823,15 @@ function AssistantSummaryDialog({
33487
33823
  window.addEventListener("blur", dismiss);
33488
33824
  return () => window.removeEventListener("blur", dismiss);
33489
33825
  }, [presence.open, presence.onOpenChange, voice?.panel]);
33490
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "chatkit-presence-stack pointer-events-none absolute z-30 flex max-h-[calc(100%-1.5rem)] flex-col gap-3", children: [
33826
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "chatkit-presence-stack pointer-events-none absolute z-30 flex max-h-[calc(100%-1.5rem)] flex-col gap-3", children: [
33491
33827
  voice?.panel,
33492
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
33828
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
33493
33829
  Dialog5.Root,
33494
33830
  {
33495
33831
  open: presence.open,
33496
33832
  onOpenChange: presence.onOpenChange,
33497
33833
  modal: false,
33498
- children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_framer_motion2.AnimatePresence, { initial: false, children: presence.open && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
33834
+ children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_framer_motion2.AnimatePresence, { initial: false, children: presence.open && /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
33499
33835
  PresenceDialogSurface,
33500
33836
  {
33501
33837
  presence,
@@ -33519,40 +33855,40 @@ function AssistantSummaryDialog({
33519
33855
  event.preventDefault();
33520
33856
  },
33521
33857
  children: [
33522
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Dialog5.Title, { className: "sr-only", children: t("assistantPresence.details") }),
33523
- /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "chatkit-presence-header flex shrink-0 items-start", children: [
33524
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(PresenceCharacter, { presence, size: "4rem" }),
33525
- /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "chatkit-presence-details min-w-0 flex-1", children: [
33526
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("h2", { className: "truncate font-semibold", children: presence.name }),
33527
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(PresenceStatus, { ...presence }),
33528
- presence.onCustomize && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
33858
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Dialog5.Title, { className: "sr-only", children: t("assistantPresence.details") }),
33859
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "chatkit-presence-header flex shrink-0 items-start", children: [
33860
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(PresenceCharacter, { presence, size: "4rem" }),
33861
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "chatkit-presence-details min-w-0 flex-1", children: [
33862
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("h2", { className: "truncate font-semibold", children: presence.name }),
33863
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(PresenceStatus, { ...presence }),
33864
+ presence.onCustomize && /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
33529
33865
  "button",
33530
33866
  {
33531
33867
  type: "button",
33532
33868
  className: "chatkit-presence-customize flex items-center text-xs text-muted-foreground hover:text-foreground",
33533
33869
  onClick: presence.onCustomize,
33534
33870
  children: [
33535
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react74.Pencil, { className: "size-3 shrink-0" }),
33871
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_lucide_react75.Pencil, { className: "size-3 shrink-0" }),
33536
33872
  t("assistantPresence.customize")
33537
33873
  ]
33538
33874
  }
33539
33875
  )
33540
33876
  ] }),
33541
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
33877
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
33542
33878
  "button",
33543
33879
  {
33544
33880
  type: "button",
33545
33881
  className: "chatkit-presence-close flex shrink-0 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted",
33546
33882
  "aria-label": t("assistantPresence.close"),
33547
33883
  onClick: () => presence.onOpenChange(false),
33548
- children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react74.X, { className: "size-[1.125rem]" })
33884
+ children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_lucide_react75.X, { className: "size-[1.125rem]" })
33549
33885
  }
33550
33886
  )
33551
33887
  ] }),
33552
- /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "min-h-0 overflow-auto rounded-b-3xl", children: [
33888
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "min-h-0 overflow-auto rounded-b-3xl", children: [
33553
33889
  voice?.dial,
33554
33890
  computers,
33555
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(TaskSummaryContent, { ...summary })
33891
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(TaskSummaryContent, { ...summary })
33556
33892
  ] })
33557
33893
  ]
33558
33894
  },
@@ -33562,11 +33898,11 @@ function AssistantSummaryDialog({
33562
33898
  )
33563
33899
  ] });
33564
33900
  }
33565
- var PresenceDialogSurface = React122.forwardRef(function PresenceDialogSurface2({ presence, children, ...props }, ref) {
33901
+ var PresenceDialogSurface = React123.forwardRef(function PresenceDialogSurface2({ presence, children, ...props }, ref) {
33566
33902
  const isPresent = (0, import_framer_motion2.useIsPresent)();
33567
33903
  const systemReducedMotion = (0, import_framer_motion2.useReducedMotion)();
33568
33904
  const still = presence.reducedMotion || systemReducedMotion;
33569
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
33905
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
33570
33906
  Dialog5.Content,
33571
33907
  {
33572
33908
  ...props,
@@ -33574,7 +33910,7 @@ var PresenceDialogSurface = React122.forwardRef(function PresenceDialogSurface2(
33574
33910
  asChild: true,
33575
33911
  ref,
33576
33912
  inert: !isPresent || void 0,
33577
- children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
33913
+ children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
33578
33914
  import_framer_motion2.motion.div,
33579
33915
  {
33580
33916
  "data-slot": "assistant-summary-dialog",
@@ -33603,7 +33939,7 @@ var PresenceDialogSurface = React122.forwardRef(function PresenceDialogSurface2(
33603
33939
  });
33604
33940
 
33605
33941
  // src/components/chat.tsx
33606
- var import_jsx_runtime121 = require("react/jsx-runtime");
33942
+ var import_jsx_runtime122 = require("react/jsx-runtime");
33607
33943
  function Chat({
33608
33944
  className,
33609
33945
  options,
@@ -33662,19 +33998,19 @@ function Chat({
33662
33998
  options
33663
33999
  });
33664
34000
  const modelState = useChatModelState({ ...session });
33665
- const [planModeEnabled, setPlanModeEnabled] = React123.useState(false);
34001
+ const [planModeEnabled, setPlanModeEnabled] = React124.useState(false);
33666
34002
  const pet = useChatPetSettings({ options });
33667
- const headerMoreButtonRef = React123.useRef(null);
33668
- const restoreHeaderFocus = React123.useCallback((event) => {
34003
+ const headerMoreButtonRef = React124.useRef(null);
34004
+ const restoreHeaderFocus = React124.useCallback((event) => {
33669
34005
  if (headerMoreButtonRef.current) {
33670
34006
  event.preventDefault();
33671
34007
  headerMoreButtonRef.current.focus();
33672
34008
  }
33673
34009
  }, []);
33674
- const [hasSelectableProjects, setHasSelectableProjects] = React123.useState(false);
34010
+ const [hasSelectableProjects, setHasSelectableProjects] = React124.useState(false);
33675
34011
  const files = useChatFiles({ ...draft, ...session, referenceRequest });
33676
- const viewportRef = React123.useRef(null);
33677
- const messages = React123.useMemo(
34012
+ const viewportRef = React124.useRef(null);
34013
+ const messages = React124.useMemo(
33678
34014
  () => mergeCompletedCalls(
33679
34015
  session.stream.messages ?? [],
33680
34016
  options?.realtimeVoice?.completed,
@@ -33702,7 +34038,7 @@ function Chat({
33702
34038
  messages,
33703
34039
  viewportRef
33704
34040
  });
33705
- const chatColumnRef = React123.useRef(null);
34041
+ const chatColumnRef = React124.useRef(null);
33706
34042
  const capabilities = useChatCapabilities({
33707
34043
  ...runtime,
33708
34044
  ...draft,
@@ -33764,7 +34100,7 @@ function Chat({
33764
34100
  options,
33765
34101
  messages
33766
34102
  });
33767
- const pendingFollowUps = React123.useMemo(
34103
+ const pendingFollowUps = React124.useMemo(
33768
34104
  () => sortVisiblePendingFollowUps(session.stream.pendingFollowUps ?? []),
33769
34105
  [session.stream.pendingFollowUps]
33770
34106
  );
@@ -33784,7 +34120,10 @@ function Chat({
33784
34120
  const inputPlaceholder = draft.selectedTool?.placeholderOverride ?? session.composer?.placeholder ?? assistant.resolvedPlaceholder;
33785
34121
  const isInitialComposer = !session.stream.threadId && messages.length === 0 && !viewport.canLoadMoreMessages && !session.stream.isLoading;
33786
34122
  const hasPendingFollowUps = pendingFollowUps.length > 0;
33787
- const isProjectSelectionLocked = Boolean(session.stream.threadId || session.stream.conversationId) || messages.length > 0 || viewport.canLoadMoreMessages;
34123
+ const hasConversationId = Boolean(
34124
+ session.stream.threadId || session.stream.conversationId
34125
+ );
34126
+ const isProjectSelectionLocked = hasConversationId ? !onProjectChange : messages.length > 0 || viewport.canLoadMoreMessages;
33788
34127
  const isProjectScopeLocked = Boolean(session.activeProjectId) && (isProjectSelectionLocked || options?.composer?.projects?.locked === true);
33789
34128
  const isFileSelectorVisible = Boolean(
33790
34129
  session.xpertPlatformClient && (session.activeProjectId || session.stream.assistantId)
@@ -33827,7 +34166,7 @@ function Chat({
33827
34166
  canUploadAttachments
33828
34167
  });
33829
34168
  const streamErrorMessage = session.stream.error instanceof Error ? session.stream.error.message : void 0;
33830
- const threadErrorMessage = React123.useMemo(() => {
34169
+ const threadErrorMessage = React124.useMemo(() => {
33831
34170
  if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
33832
34171
  if (historyState.currentThread?.status !== "error") return void 0;
33833
34172
  const message = historyState.currentThread.error?.trim();
@@ -33857,14 +34196,14 @@ function Chat({
33857
34196
  historyMessageLoadVersion: session.stream.historyMessageLoadVersion ?? 0,
33858
34197
  fallbackTitle: session.t("history.threadFallback")
33859
34198
  });
33860
- const chatColumnStyle = React123.useMemo(() => {
34199
+ const chatColumnStyle = React124.useMemo(() => {
33861
34200
  if (layoutMaxWidth === void 0 || layoutMaxWidth === null || layoutMaxWidth === "") {
33862
34201
  return void 0;
33863
34202
  }
33864
34203
  return { maxWidth: layoutMaxWidth };
33865
34204
  }, [layoutMaxWidth]);
33866
34205
  const waitingForInput = !!(session.stream.pendingHITLRequest || session.stream.pendingRequestUserInput);
33867
- const presenceMotionId = React123.useId();
34206
+ const presenceMotionId = React124.useId();
33868
34207
  const presence = {
33869
34208
  motionId: presenceMotionId,
33870
34209
  avatar: assistant.assistantAvatar,
@@ -33879,19 +34218,19 @@ function Chat({
33879
34218
  host.parentMessenger.sendEvent("public_event", [
33880
34219
  "effect",
33881
34220
  {
33882
- name: import_chatkit_types31.CHATKIT_ASSISTANT_CUSTOMIZE_EFFECT,
34221
+ name: import_chatkit_types32.CHATKIT_ASSISTANT_CUSTOMIZE_EFFECT,
33883
34222
  data: { assistantId: session.stream.assistantId }
33884
34223
  }
33885
34224
  ]);
33886
34225
  } : void 0
33887
34226
  };
33888
- return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
34227
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
33889
34228
  "div",
33890
34229
  {
33891
34230
  className: "relative flex h-full w-full min-w-0 bg-background",
33892
34231
  "data-task-summary-layout": summary.taskSummaryDocked ? "docked" : "popover",
33893
34232
  children: [
33894
- /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
34233
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
33895
34234
  UploadDroppedFiles,
33896
34235
  {
33897
34236
  ref: viewportRef,
@@ -33906,13 +34245,13 @@ function Chat({
33906
34245
  className
33907
34246
  ),
33908
34247
  children: [
33909
- /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
34248
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
33910
34249
  "div",
33911
34250
  {
33912
34251
  "data-window-drag-scope": "",
33913
34252
  className: characterPresentation ? "pointer-events-none sticky top-0 z-10 grid w-full shrink-0" : "contents",
33914
34253
  children: [
33915
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34254
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
33916
34255
  ChatHeader,
33917
34256
  {
33918
34257
  characterPresentation,
@@ -33932,11 +34271,11 @@ function Chat({
33932
34271
  restoreHeaderFocus
33933
34272
  }
33934
34273
  ),
33935
- characterPresentation && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(AssistantPresence, { ...presence })
34274
+ characterPresentation && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(AssistantPresence, { ...presence })
33936
34275
  ]
33937
34276
  }
33938
34277
  ),
33939
- viewport.showMessageNavigation && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34278
+ viewport.showMessageNavigation && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
33940
34279
  MessageNavigator,
33941
34280
  {
33942
34281
  items: viewport.messageNavigationItems,
@@ -33947,7 +34286,7 @@ function Chat({
33947
34286
  tagsOverflowLabel: (count) => session.t("message.navigation.moreTags", { count })
33948
34287
  }
33949
34288
  ),
33950
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34289
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
33951
34290
  ChatTranscript,
33952
34291
  {
33953
34292
  ...session,
@@ -33973,8 +34312,8 @@ function Chat({
33973
34312
  messagePresentation
33974
34313
  }
33975
34314
  ),
33976
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ChatQuoteActions, { ...quotes, ...session }),
33977
- /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
34315
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(ChatQuoteActions, { ...quotes, ...session }),
34316
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
33978
34317
  "div",
33979
34318
  {
33980
34319
  "data-slot": "chatkit-chat-composer",
@@ -33985,13 +34324,13 @@ function Chat({
33985
34324
  ),
33986
34325
  style: chatColumnStyle,
33987
34326
  children: [
33988
- runControl.runControlError?.threadId === session.stream.threadId && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("p", { role: "alert", className: "text-xs text-destructive", children: runControl.runControlError.message }),
33989
- !viewport.isAtBottom && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34327
+ runControl.runControlError?.threadId === session.stream.threadId && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("p", { role: "alert", className: "text-xs text-destructive", children: runControl.runControlError.message }),
34328
+ !viewport.isAtBottom && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
33990
34329
  "div",
33991
34330
  {
33992
34331
  "data-slot": "scroll-to-bottom",
33993
34332
  className: "pointer-events-none absolute left-1/2 top-0 z-20 flex -translate-x-1/2 -translate-y-full justify-center",
33994
- children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34333
+ children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
33995
34334
  Button,
33996
34335
  {
33997
34336
  type: "button",
@@ -34004,14 +34343,14 @@ function Chat({
34004
34343
  onClick: () => viewport.scrollToBottom(true, true),
34005
34344
  "aria-label": session.t("chat.scrollToBottom"),
34006
34345
  title: session.t("chat.scrollToBottom"),
34007
- children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_lucide_react75.ArrowDown, { size: 16 })
34346
+ children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react76.ArrowDown, { size: 16 })
34008
34347
  }
34009
34348
  )
34010
34349
  }
34011
34350
  ),
34012
- threadErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "mb-3 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive overflow-auto", children: threadErrorMessage }),
34013
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ChatGoalStatus, { ...goal, ...session, ...draft }),
34014
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34351
+ threadErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "mb-3 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive overflow-auto", children: threadErrorMessage }),
34352
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(ChatGoalStatus, { ...goal, ...session, ...draft }),
34353
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
34015
34354
  ChatPendingActions,
34016
34355
  {
34017
34356
  ...session,
@@ -34022,7 +34361,7 @@ function Chat({
34022
34361
  pendingFollowUps
34023
34362
  }
34024
34363
  ),
34025
- isInitialComposer && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34364
+ isInitialComposer && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
34026
34365
  PromptWorkflowShortcuts,
34027
34366
  {
34028
34367
  commands: capabilities.promptWorkflow.commands,
@@ -34036,8 +34375,8 @@ function Chat({
34036
34375
  onBack: capabilities.promptWorkflow.showPrompts
34037
34376
  }
34038
34377
  ),
34039
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ChatComposerAttachments, { ...files, ...session }),
34040
- draft.threadMention && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34378
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(ChatComposerAttachments, { ...files, ...session }),
34379
+ draft.threadMention && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
34041
34380
  ThreadMentionPalette,
34042
34381
  {
34043
34382
  ref: draft.threadMentionPaletteRef,
@@ -34057,7 +34396,7 @@ function Chat({
34057
34396
  onSelect: draft.selectThreadMention
34058
34397
  }
34059
34398
  ),
34060
- runtime.runtimeCapabilityPalette && !draft.threadMention && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34399
+ runtime.runtimeCapabilityPalette && !draft.threadMention && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
34061
34400
  SlashPalette,
34062
34401
  {
34063
34402
  palette: runtime.runtimeCapabilityPalette,
@@ -34071,7 +34410,7 @@ function Chat({
34071
34410
  onSelect: commands.selectSlashPaletteOption
34072
34411
  }
34073
34412
  ),
34074
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34413
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
34075
34414
  ChatComposerForm,
34076
34415
  {
34077
34416
  ...commands,
@@ -34110,7 +34449,7 @@ function Chat({
34110
34449
  runtimeResources
34111
34450
  }
34112
34451
  ),
34113
- isInitialComposer && session.startScreen?.promptsLayout === "list" && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34452
+ isInitialComposer && session.startScreen?.promptsLayout === "list" && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
34114
34453
  StarterPromptSuggestions,
34115
34454
  {
34116
34455
  prompts: session.startScreen.prompts ?? [],
@@ -34120,7 +34459,7 @@ function Chat({
34120
34459
  promptEditDisabled: isPromptEditDisabled
34121
34460
  }
34122
34461
  ),
34123
- session.disclaimer?.text && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34462
+ session.disclaimer?.text && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
34124
34463
  "p",
34125
34464
  {
34126
34465
  className: cn(
@@ -34133,7 +34472,7 @@ function Chat({
34133
34472
  ]
34134
34473
  }
34135
34474
  ),
34136
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34475
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
34137
34476
  SettingsSheet,
34138
34477
  {
34139
34478
  open: !pet.petDisabled && pet.petSettingsOpen,
@@ -34144,17 +34483,17 @@ function Chat({
34144
34483
  onSave: pet.savePetLocalSettings
34145
34484
  }
34146
34485
  ),
34147
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(PetBridge, { pet: pet.effectivePet, state: petAutoState })
34486
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(PetBridge, { pet: pet.effectivePet, state: petAutoState })
34148
34487
  ]
34149
34488
  }
34150
34489
  ),
34151
- characterPresentation && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34490
+ characterPresentation && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
34152
34491
  AssistantSummaryDialog,
34153
34492
  {
34154
34493
  presence,
34155
34494
  voice,
34156
34495
  summary: summary.taskSummaryProps,
34157
- computers: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34496
+ computers: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
34158
34497
  AssistantComputers,
34159
34498
  {
34160
34499
  computers: options?.header?.character?.computers,
@@ -34173,7 +34512,7 @@ function Chat({
34173
34512
  )
34174
34513
  }
34175
34514
  ),
34176
- !characterPresentation && summary.taskSummaryAvailable && summary.taskSummaryDocked && summary.taskSummaryOpen && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "pointer-events-none absolute right-5 top-3 z-20 max-h-[calc(100%-1.5rem)] w-80", children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
34515
+ !characterPresentation && summary.taskSummaryAvailable && summary.taskSummaryDocked && summary.taskSummaryOpen && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "pointer-events-none absolute right-5 top-3 z-20 max-h-[calc(100%-1.5rem)] w-80", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
34177
34516
  TaskSummaryPanel,
34178
34517
  {
34179
34518
  ...summary.taskSummaryProps,