@xpert-ai/chatkit-ui 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/dist/app/assets/{_baseUniq-DxHYvQh5.js → _baseUniq-CAxobs9N.js} +1 -1
  2. package/dist/app/assets/{abap-DVajZIEh.js → abap-wdK8JaHa.js} +1 -1
  3. package/dist/app/assets/{abnf-46NjTOlf.js → abnf-B4QVrCDX.js} +1 -1
  4. package/dist/app/assets/{actionscript-CQpj0cg3.js → actionscript-BbKSvJrq.js} +1 -1
  5. package/dist/app/assets/{ada-C-kX0zii.js → ada-BkwiItKH.js} +1 -1
  6. package/dist/app/assets/{agda-CCA_JAgT.js → agda-BHGf_Fgl.js} +1 -1
  7. package/dist/app/assets/{al-Dnw0hERO.js → al-CpdhQzD9.js} +1 -1
  8. package/dist/app/assets/{antlr4-vIL0hfzJ.js → antlr4-CLQ7xEno.js} +1 -1
  9. package/dist/app/assets/{apacheconf-CsWzUs9D.js → apacheconf-6iBdrfFM.js} +1 -1
  10. package/dist/app/assets/{apex-QViHF4AC.js → apex-DBXBvaz5.js} +1 -1
  11. package/dist/app/assets/{apl-J2xZukMp.js → apl-D8vc149P.js} +1 -1
  12. package/dist/app/assets/{applescript-B3WjGs4M.js → applescript-BTZUYWS_.js} +1 -1
  13. package/dist/app/assets/{aql-NAU-bvN_.js → aql-BxB6KDJQ.js} +1 -1
  14. package/dist/app/assets/{arc-B8hwrBK1.js → arc-CNi1G9DJ.js} +1 -1
  15. package/dist/app/assets/{architectureDiagram-Q4EWVU46-CpVpAf2q.js → architectureDiagram-Q4EWVU46-BL0mPAR9.js} +1 -1
  16. package/dist/app/assets/{arduino-CHYJARcG.js → arduino-Cx04QCrp.js} +1 -1
  17. package/dist/app/assets/{arff-DqAcq_Jd.js → arff-MqnrnEC8.js} +1 -1
  18. package/dist/app/assets/{asciidoc-DXFN4u3C.js → asciidoc-sz7M5yXr.js} +1 -1
  19. package/dist/app/assets/{asm6502-yvmvLNPw.js → asm6502-BZ8xfWko.js} +1 -1
  20. package/dist/app/assets/{asmatmel-BNt_bXxW.js → asmatmel-D-cI_as7.js} +1 -1
  21. package/dist/app/assets/{aspnet-BMD5jkWc.js → aspnet-wNdsZF1M.js} +1 -1
  22. package/dist/app/assets/{autohotkey-CHZS5zbL.js → autohotkey-CERdGivs.js} +1 -1
  23. package/dist/app/assets/{autoit-DLLmQkuM.js → autoit-CQsoUza0.js} +1 -1
  24. package/dist/app/assets/{avisynth-C8BxdbSe.js → avisynth-DMTk2nsi.js} +1 -1
  25. package/dist/app/assets/{avro-idl-C6pwRw5e.js → avro-idl-VdXZfwVL.js} +1 -1
  26. package/dist/app/assets/{bash-CMOTacbo.js → bash-BKoQnhB6.js} +1 -1
  27. package/dist/app/assets/{basic-TZKBsQ-m.js → basic-BvRsQ9vo.js} +1 -1
  28. package/dist/app/assets/{batch-CaE8zhSL.js → batch-DkZb4POU.js} +1 -1
  29. package/dist/app/assets/{bbcode-DcenEstk.js → bbcode-BkkYngk6.js} +1 -1
  30. package/dist/app/assets/{bicep-M0WBFGSH.js → bicep-DY62eX6n.js} +1 -1
  31. package/dist/app/assets/{birb-EkEU1ZCa.js → birb-Cf3Wn8DP.js} +1 -1
  32. package/dist/app/assets/{bison-M-w8qpdO.js → bison-CMVsgR8E.js} +1 -1
  33. package/dist/app/assets/{blockDiagram-DXYQGD6D-Cb71R9Wk.js → blockDiagram-DXYQGD6D-DdgOXTCq.js} +1 -1
  34. package/dist/app/assets/{bnf-BnYdZYNM.js → bnf-C53AC5ba.js} +1 -1
  35. package/dist/app/assets/{brainfuck-BjHrlOp6.js → brainfuck-DBcYtGip.js} +1 -1
  36. package/dist/app/assets/{brightscript-D2KWeGkG.js → brightscript-uWYyj7Le.js} +1 -1
  37. package/dist/app/assets/{bro-Cm3J_z1e.js → bro-Bnqn5jLn.js} +1 -1
  38. package/dist/app/assets/{bsl-aaIhCboX.js → bsl-eeHcx6I3.js} +1 -1
  39. package/dist/app/assets/{c-Cromo6GX.js → c-Y_E2ZZ8h.js} +1 -1
  40. package/dist/app/assets/{c4Diagram-AHTNJAMY-CzSUyxD_.js → c4Diagram-AHTNJAMY-BAZeiIaA.js} +1 -1
  41. package/dist/app/assets/{cfscript-DjqhIng2.js → cfscript-swSriW5q.js} +1 -1
  42. package/dist/app/assets/{chaiscript-Vo_Ts9eo.js → chaiscript-BHR5pIfl.js} +1 -1
  43. package/dist/app/assets/channel-C4IK_RZn.js +1 -0
  44. package/dist/app/assets/{chunk-4BX2VUAB-aAUlAQil.js → chunk-4BX2VUAB-Deyo77pg.js} +1 -1
  45. package/dist/app/assets/{chunk-4TB4RGXK-8S_2Lm6g.js → chunk-4TB4RGXK-BSgPz1Fn.js} +1 -1
  46. package/dist/app/assets/{chunk-55IACEB6-Dz5quBWg.js → chunk-55IACEB6-DekOqO8-.js} +1 -1
  47. package/dist/app/assets/{chunk-EDXVE4YY-BhH3k95q.js → chunk-EDXVE4YY-VI2aoR3H.js} +1 -1
  48. package/dist/app/assets/{chunk-FMBD7UC4-BYUrcbwm.js → chunk-FMBD7UC4-DVPMFZIh.js} +1 -1
  49. package/dist/app/assets/{chunk-OYMX7WX6-DTytW7cJ.js → chunk-OYMX7WX6-C_5OySCp.js} +1 -1
  50. package/dist/app/assets/{chunk-QZHKN3VN-DCg0fs-A.js → chunk-QZHKN3VN-CQ4PJ94U.js} +1 -1
  51. package/dist/app/assets/{chunk-YZCP3GAM-Ck9WxSs5.js → chunk-YZCP3GAM-40VMFur6.js} +1 -1
  52. package/dist/app/assets/{cil-Dy9yDCJC.js → cil-BlB-Qnhz.js} +1 -1
  53. package/dist/app/assets/classDiagram-6PBFFD2Q-LicCc7Qv.js +1 -0
  54. package/dist/app/assets/classDiagram-v2-HSJHXN6E-LicCc7Qv.js +1 -0
  55. package/dist/app/assets/{clike-B3pqz2AZ.js → clike-cGW_OpAz.js} +1 -1
  56. package/dist/app/assets/{clojure-DVRtvSwX.js → clojure-BwM8_y2w.js} +1 -1
  57. package/dist/app/assets/clone-BC1Apkgy.js +1 -0
  58. package/dist/app/assets/{cmake-13muG7rK.js → cmake-B_tPIs0N.js} +1 -1
  59. package/dist/app/assets/{cobol-Jbr347RJ.js → cobol-awMTn3SL.js} +1 -1
  60. package/dist/app/assets/{coffeescript-B3DOm1Ne.js → coffeescript-BdPUATdq.js} +1 -1
  61. package/dist/app/assets/{concurnas-CNySoRHf.js → concurnas-DD4NroNG.js} +1 -1
  62. package/dist/app/assets/{coq-K-m5AUlH.js → coq-WP9t6Mya.js} +1 -1
  63. package/dist/app/assets/{core-BPN6CWxM.js → core-Dl1d1z_B.js} +1 -1
  64. package/dist/app/assets/{cose-bilkent-S5V4N54A-Dr0iADox.js → cose-bilkent-S5V4N54A-CIsQWWLS.js} +1 -1
  65. package/dist/app/assets/{cpp-BCnzQvRU.js → cpp-DRq2558J.js} +1 -1
  66. package/dist/app/assets/{crystal-PCOcWoSI.js → crystal-CmMEvlYk.js} +1 -1
  67. package/dist/app/assets/{csharp-8stZQY6C.js → csharp-CmdWJQ_7.js} +1 -1
  68. package/dist/app/assets/{cshtml-DoI3CcDS.js → cshtml-D-PG0yKy.js} +1 -1
  69. package/dist/app/assets/{csp-BKUbys7F.js → csp-CoYEQK4_.js} +1 -1
  70. package/dist/app/assets/{css-extras-BjUA2auB.js → css-extras-CvcfPwL5.js} +1 -1
  71. package/dist/app/assets/{css-0jn1p1e6.js → css-qzCJaYzE.js} +1 -1
  72. package/dist/app/assets/{csv-ChtyJ7Mw.js → csv-BOSHHM-P.js} +1 -1
  73. package/dist/app/assets/{cypher-BSoDMy4m.js → cypher-DF-LRYf2.js} +1 -1
  74. package/dist/app/assets/{d-CAzhRG-Z.js → d-DT7HGItG.js} +1 -1
  75. package/dist/app/assets/{dagre-KV5264BT-BSVO3dNV.js → dagre-KV5264BT-BXDHR3FY.js} +1 -1
  76. package/dist/app/assets/{dart-C8bLX20e.js → dart-C53tv9tc.js} +1 -1
  77. package/dist/app/assets/{dataweave-Dmo6CZIu.js → dataweave-DfVl-B8U.js} +1 -1
  78. package/dist/app/assets/{dax-CmqnMRUH.js → dax-CtLDIvLu.js} +1 -1
  79. package/dist/app/assets/{dhall-QKB0WE21.js → dhall-B4vfpjKK.js} +1 -1
  80. package/dist/app/assets/{diagram-5BDNPKRD-r0Fz26nD.js → diagram-5BDNPKRD-C2jQZSnh.js} +1 -1
  81. package/dist/app/assets/{diagram-G4DWMVQ6-tVV9XZ9V.js → diagram-G4DWMVQ6-DkBF8pst.js} +1 -1
  82. package/dist/app/assets/{diagram-MMDJMWI5-B9rbYdY4.js → diagram-MMDJMWI5-DkBy1EJI.js} +1 -1
  83. package/dist/app/assets/{diagram-TYMM5635-Dsm73wxz.js → diagram-TYMM5635-BG7IFHFj.js} +1 -1
  84. package/dist/app/assets/{diff-PAv23eqQ.js → diff-CAGXr455.js} +1 -1
  85. package/dist/app/assets/{django-BIrl2Lvz.js → django-Bt-Xandi.js} +1 -1
  86. package/dist/app/assets/{dns-zone-file-ClLpdqMT.js → dns-zone-file-CUQqHN_u.js} +1 -1
  87. package/dist/app/assets/{docker-BDozNG3x.js → docker-Cmx-jfGB.js} +1 -1
  88. package/dist/app/assets/{dot-I-WZKdgb.js → dot-CtNw9lX4.js} +1 -1
  89. package/dist/app/assets/{ebnf-DkRUuKnr.js → ebnf-Dl_Q5Or1.js} +1 -1
  90. package/dist/app/assets/{editorconfig-BmLG6Etr.js → editorconfig-DZYXnV_C.js} +1 -1
  91. package/dist/app/assets/{eiffel-Bm2GdSQ2.js → eiffel-CgccC4xz.js} +1 -1
  92. package/dist/app/assets/{ejs-C48N5ZIG.js → ejs-Cj1dQzfI.js} +1 -1
  93. package/dist/app/assets/{elixir-CdyVGNb8.js → elixir-B3SWPivz.js} +1 -1
  94. package/dist/app/assets/{elm-CkQhPVjT.js → elm-Bp_TQfaA.js} +1 -1
  95. package/dist/app/assets/{erDiagram-SMLLAGMA-Hyk82Vhv.js → erDiagram-SMLLAGMA-Cby23XmU.js} +1 -1
  96. package/dist/app/assets/{erb-BX1eAGBM.js → erb-Cb-K6pZE.js} +1 -1
  97. package/dist/app/assets/{erlang-Czbnuk55.js → erlang-F72Fjwv2.js} +1 -1
  98. package/dist/app/assets/{etlua-i8hW4tPr.js → etlua-DFUJG9GZ.js} +1 -1
  99. package/dist/app/assets/{excel-formula-CyZOfUTa.js → excel-formula-B8hn4WlO.js} +1 -1
  100. package/dist/app/assets/{factor-AjGk3DF8.js → factor-BlEqbeI0.js} +1 -1
  101. package/dist/app/assets/{false-GhEvxGmO.js → false-DMURsqlU.js} +1 -1
  102. package/dist/app/assets/{firestore-security-rules-BjwnXyDp.js → firestore-security-rules-DswDVNNa.js} +1 -1
  103. package/dist/app/assets/{flow-h4-WME33.js → flow-C4reo-gu.js} +1 -1
  104. package/dist/app/assets/{flowDiagram-DWJPFMVM-BHEn2Y5w.js → flowDiagram-DWJPFMVM-BxNNsar9.js} +1 -1
  105. package/dist/app/assets/{fortran-8lcbfijs.js → fortran-BAmD5KHF.js} +1 -1
  106. package/dist/app/assets/{fsharp-x47H8jRh.js → fsharp-CPq2O12L.js} +1 -1
  107. package/dist/app/assets/{ftl-DBidAr07.js → ftl-Cgbeq2-z.js} +1 -1
  108. package/dist/app/assets/{ganttDiagram-T4ZO3ILL-eZ852Es7.js → ganttDiagram-T4ZO3ILL-BLd3DH-5.js} +1 -1
  109. package/dist/app/assets/{gap-gWkYaxLH.js → gap-Bge3tvcZ.js} +1 -1
  110. package/dist/app/assets/{gcode-C-XTnxAD.js → gcode-CAVcsFdN.js} +1 -1
  111. package/dist/app/assets/{gdscript-D4fLzJ7v.js → gdscript-nkDP0xMM.js} +1 -1
  112. package/dist/app/assets/{gedcom-D1MSjhRT.js → gedcom-BA8GnDnW.js} +1 -1
  113. package/dist/app/assets/{gherkin-BO4O8Wru.js → gherkin-DvBWzm8E.js} +1 -1
  114. package/dist/app/assets/{git-ClZL4XcF.js → git-LJ9ums7L.js} +1 -1
  115. package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-C8frR-gR.js → gitGraphDiagram-UUTBAWPF-JZEE6gBT.js} +1 -1
  116. package/dist/app/assets/{glsl-BqI-_xG4.js → glsl-D4U4_9LH.js} +1 -1
  117. package/dist/app/assets/{gml-0_OiiWgt.js → gml-CQtoiCZT.js} +1 -1
  118. package/dist/app/assets/{gn-D1DB4wuu.js → gn-DxTb0Jqi.js} +1 -1
  119. package/dist/app/assets/{go-DRI0xPfv.js → go-D7ELL60F.js} +1 -1
  120. package/dist/app/assets/{go-module-BPPYgWaf.js → go-module-Ck8j-Kcm.js} +1 -1
  121. package/dist/app/assets/{graph-jtjuwIYJ.js → graph-pBSG-4mT.js} +1 -1
  122. package/dist/app/assets/{graphql-B8Ir2w1r.js → graphql-C-10AxQD.js} +1 -1
  123. package/dist/app/assets/{groovy-CmNBOym9.js → groovy-SpWCEWzX.js} +1 -1
  124. package/dist/app/assets/{haml-Bj89_11G.js → haml-C2aM6_El.js} +1 -1
  125. package/dist/app/assets/{handlebars-bpf-b1uX.js → handlebars-ChMYyLZl.js} +1 -1
  126. package/dist/app/assets/{haskell-BmbX5r9j.js → haskell-DagwvSeE.js} +1 -1
  127. package/dist/app/assets/{haxe-KC1m6Yfs.js → haxe-BG5B6d9K.js} +1 -1
  128. package/dist/app/assets/{hcl-CauJ5syT.js → hcl-B8Gd__02.js} +1 -1
  129. package/dist/app/assets/{hlsl-E3IzTavQ.js → hlsl-CSu8CgjO.js} +1 -1
  130. package/dist/app/assets/{hoon-DYduWlDF.js → hoon-BUjyY25K.js} +1 -1
  131. package/dist/app/assets/{hpkp-CPZobS10.js → hpkp-C5yMlUDS.js} +1 -1
  132. package/dist/app/assets/{hsts-CdUv0r9h.js → hsts-DzNiiTKI.js} +1 -1
  133. package/dist/app/assets/{http-UkfqLxHn.js → http-DYWI6rav.js} +1 -1
  134. package/dist/app/assets/{ichigojam-BXaYi-NN.js → ichigojam-DrBDAbYO.js} +1 -1
  135. package/dist/app/assets/{icon-DVY6xV3b.js → icon-BezsFCDL.js} +1 -1
  136. package/dist/app/assets/{icu-message-format-CvZ8c2Q6.js → icu-message-format-BCSOltos.js} +1 -1
  137. package/dist/app/assets/{idris-BzuUwcAy.js → idris-B8Tj6LSh.js} +1 -1
  138. package/dist/app/assets/{iecst-CIwIsrrB.js → iecst-CfA7HSP8.js} +1 -1
  139. package/dist/app/assets/{ignore-CE_RoV3v.js → ignore-E_v5CiMN.js} +1 -1
  140. package/dist/app/assets/index-BojjVNpv.css +1 -0
  141. package/dist/app/assets/{index-K4ACjQ4z.js → index-CAv2vOlh.js} +183 -183
  142. package/dist/app/assets/{infoDiagram-42DDH7IO-jLRXuR7y.js → infoDiagram-42DDH7IO-eZsn31yB.js} +1 -1
  143. package/dist/app/assets/{inform7-2Ky29vPV.js → inform7-Dj75C-lM.js} +1 -1
  144. package/dist/app/assets/{ini-pzovWlWw.js → ini-DnYgp5_G.js} +1 -1
  145. package/dist/app/assets/{io-DbXj-2n3.js → io-D59cMlU5.js} +1 -1
  146. package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-CqnaMA1B.js → ishikawaDiagram-UXIWVN3A-Cb8G56a8.js} +1 -1
  147. package/dist/app/assets/{j-BTi0-Ndk.js → j-CuOplqKY.js} +1 -1
  148. package/dist/app/assets/{java-D3h3eulz.js → java-DiKpa4Y3.js} +1 -1
  149. package/dist/app/assets/{javadoc-BcY94P5A.js → javadoc-DshvkFVS.js} +1 -1
  150. package/dist/app/assets/{javadoclike-B-oibrTg.js → javadoclike-Dl0yZMbR.js} +1 -1
  151. package/dist/app/assets/{javascript-BO58mIYT.js → javascript-C3lRkH0T.js} +1 -1
  152. package/dist/app/assets/{javastacktrace-D4LNuQQI.js → javastacktrace-BAZDNyis.js} +1 -1
  153. package/dist/app/assets/{jexl-BYTP-082.js → jexl-BvqPLTYh.js} +1 -1
  154. package/dist/app/assets/{jolie-DT19e3xU.js → jolie-DXjsE0XX.js} +1 -1
  155. package/dist/app/assets/{journeyDiagram-VCZTEJTY-CcMgjqdN.js → journeyDiagram-VCZTEJTY-9aLWSRay.js} +1 -1
  156. package/dist/app/assets/{jq-BKWCQVpC.js → jq-CLFx4HBH.js} +1 -1
  157. package/dist/app/assets/{js-extras-DpgaBeGa.js → js-extras-D33J2WNl.js} +1 -1
  158. package/dist/app/assets/{js-templates-xh0zMX88.js → js-templates-DlMN6fgo.js} +1 -1
  159. package/dist/app/assets/{jsdoc-C-GvvPlU.js → jsdoc-CGVgLZ2j.js} +1 -1
  160. package/dist/app/assets/{json-B-VU32ZP.js → json-BTnVvJgU.js} +1 -1
  161. package/dist/app/assets/{json5-ghPj_aB9.js → json5-BW8yCajk.js} +1 -1
  162. package/dist/app/assets/{jsonp-CA6i5De0.js → jsonp-iQTQx19C.js} +1 -1
  163. package/dist/app/assets/{jsstacktrace-C7QFMHEB.js → jsstacktrace-DXxcFNfy.js} +1 -1
  164. package/dist/app/assets/{jsx-nL-WQ214.js → jsx-D1npDekI.js} +1 -1
  165. package/dist/app/assets/{julia-Be5ZIobg.js → julia-E711iN6A.js} +1 -1
  166. package/dist/app/assets/{kanban-definition-6JOO6SKY-Cq35Qt7t.js → kanban-definition-6JOO6SKY-COnahS5T.js} +1 -1
  167. package/dist/app/assets/{keepalived-D6qmVKo9.js → keepalived-Da5-tKqr.js} +1 -1
  168. package/dist/app/assets/{keyman-DnTqkRT5.js → keyman-CR_is7Lf.js} +1 -1
  169. package/dist/app/assets/{kotlin-DB6tjcPY.js → kotlin-6F8UihuI.js} +1 -1
  170. package/dist/app/assets/{kumir-BjeRoKMR.js → kumir-BGVXhhZU.js} +1 -1
  171. package/dist/app/assets/{kusto-kCMj8FOy.js → kusto-xzJ5QDBT.js} +1 -1
  172. package/dist/app/assets/{latex-BISFNoUQ.js → latex-jsq1GqdL.js} +1 -1
  173. package/dist/app/assets/{latte-B_3smOZu.js → latte-CqObxNvY.js} +1 -1
  174. package/dist/app/assets/{layout-UzqCfMri.js → layout-Od8azvI5.js} +1 -1
  175. package/dist/app/assets/{less-qcoyfYC_.js → less-vdQIwlhr.js} +1 -1
  176. package/dist/app/assets/{lilypond-BGKf1i8c.js → lilypond-CYhZp9Do.js} +1 -1
  177. package/dist/app/assets/{linear-C8-0wxbN.js → linear-BVmuh868.js} +1 -1
  178. package/dist/app/assets/{liquid-VrWadSAy.js → liquid-CF_8y_W1.js} +1 -1
  179. package/dist/app/assets/{lisp-BTjWqNUW.js → lisp-DqmYhGox.js} +1 -1
  180. package/dist/app/assets/{livescript-vNFWwp4N.js → livescript-DEuoDOv7.js} +1 -1
  181. package/dist/app/assets/{llvm-WK7Im8Mx.js → llvm-DlajzOZN.js} +1 -1
  182. package/dist/app/assets/{log-DMYT40mt.js → log-CU2WH4Lm.js} +1 -1
  183. package/dist/app/assets/{lolcode-CXH2FuUZ.js → lolcode-CDbraZlO.js} +1 -1
  184. package/dist/app/assets/{lua-DTO5WHxq.js → lua-C7PRrDvP.js} +1 -1
  185. package/dist/app/assets/{magma-C6sMADdo.js → magma-CEu2U_uQ.js} +1 -1
  186. package/dist/app/assets/{makefile-MHxAMV3D.js → makefile-BpvnX-Nx.js} +1 -1
  187. package/dist/app/assets/{markdown-DdIbK-8L.js → markdown-BTkzQyNu.js} +1 -1
  188. package/dist/app/assets/{markup-BpeZ9wWy.js → markup-Dje0J_2C.js} +1 -1
  189. package/dist/app/assets/{markup-templating-XqCbme63.js → markup-templating-cYyMwZ4b.js} +1 -1
  190. package/dist/app/assets/{matlab-CHbXjcdv.js → matlab-RV1EEhcL.js} +1 -1
  191. package/dist/app/assets/{maxscript-BRuyQF1I.js → maxscript-Bo7lyT0p.js} +1 -1
  192. package/dist/app/assets/{mel-BcIjgiPy.js → mel-kP-zTDHf.js} +1 -1
  193. package/dist/app/assets/{mermaid-BwSr1PTU.js → mermaid-D1yX-Bwv.js} +1 -1
  194. package/dist/app/assets/{min-0Lnqk-bR.js → min-z4SxYbt2.js} +1 -1
  195. package/dist/app/assets/{mindmap-definition-QFDTVHPH-Czt6NaQN.js → mindmap-definition-QFDTVHPH-Dm1nn9t1.js} +1 -1
  196. package/dist/app/assets/{mizar-CJjkeZOv.js → mizar-DD-lNTs3.js} +1 -1
  197. package/dist/app/assets/{mongodb-Bvun4Ap6.js → mongodb-By_x69ne.js} +1 -1
  198. package/dist/app/assets/{monkey-DM3r0SVF.js → monkey-CQneMnOq.js} +1 -1
  199. package/dist/app/assets/{moonscript-D3eFbTEw.js → moonscript-Cv1IiKWR.js} +1 -1
  200. package/dist/app/assets/{n1ql-BZE9FAr-.js → n1ql-BZ-dWxn_.js} +1 -1
  201. package/dist/app/assets/{n4js-CCsMwPzQ.js → n4js-aHhU-EQW.js} +1 -1
  202. package/dist/app/assets/{nand2tetris-hdl-CLHhLnG9.js → nand2tetris-hdl-Ct9NqibY.js} +1 -1
  203. package/dist/app/assets/{naniscript-FORkZo6J.js → naniscript-jrYYiXE3.js} +1 -1
  204. package/dist/app/assets/{nasm-BVjxa0dX.js → nasm-CR4fygO0.js} +1 -1
  205. package/dist/app/assets/{neon-BerzZa9H.js → neon-Bn9xaC-T.js} +1 -1
  206. package/dist/app/assets/{nevod-C36hu5IO.js → nevod-DwwkUQZl.js} +1 -1
  207. package/dist/app/assets/{nginx-DLJurC-F.js → nginx-CxzxW55o.js} +1 -1
  208. package/dist/app/assets/{nim-NwqzdBl9.js → nim-_ziHrYai.js} +1 -1
  209. package/dist/app/assets/{nix-BMYba5OL.js → nix-CnfynVyh.js} +1 -1
  210. package/dist/app/assets/{nsis-Ujsj5qWO.js → nsis-CTa60cBQ.js} +1 -1
  211. package/dist/app/assets/{objectivec-D9Q7nqP2.js → objectivec-CxzV-EqQ.js} +1 -1
  212. package/dist/app/assets/{ocaml-0Gb9yc-E.js → ocaml-CXQfo6wC.js} +1 -1
  213. package/dist/app/assets/{opencl-d0g4CU-6.js → opencl-CdW2Jum5.js} +1 -1
  214. package/dist/app/assets/{openqasm-DNBbFf10.js → openqasm-99txnqqb.js} +1 -1
  215. package/dist/app/assets/{oz-DeAjfWVk.js → oz-CIEq0aNc.js} +1 -1
  216. package/dist/app/assets/{parigp-Cw6GMagO.js → parigp-D9vfJxo4.js} +1 -1
  217. package/dist/app/assets/{parser-Ba1N4m09.js → parser-DndpAxSG.js} +1 -1
  218. package/dist/app/assets/{pascal-BljwjmQz.js → pascal-RZKxz-_c.js} +1 -1
  219. package/dist/app/assets/{pascaligo-VB7Esces.js → pascaligo-B7sniYrp.js} +1 -1
  220. package/dist/app/assets/{pcaxis-DHF2QJXb.js → pcaxis-B5p4fAPz.js} +1 -1
  221. package/dist/app/assets/{peoplecode-BQEEpmUe.js → peoplecode-fCeRfJQ5.js} +1 -1
  222. package/dist/app/assets/{perl-DrBS0LCy.js → perl-CYh0437K.js} +1 -1
  223. package/dist/app/assets/{php-extras-CwDe0jZp.js → php-extras-DCzP567Q.js} +1 -1
  224. package/dist/app/assets/{php-D370JUMP.js → php-rTdvXKxw.js} +1 -1
  225. package/dist/app/assets/{phpdoc-CiOrW7MP.js → phpdoc-BLbjAEWJ.js} +1 -1
  226. package/dist/app/assets/{pieDiagram-DEJITSTG-BRjK7KVl.js → pieDiagram-DEJITSTG-BuH3UT8S.js} +1 -1
  227. package/dist/app/assets/{plsql-xdpA00BW.js → plsql-B9JKIw1T.js} +1 -1
  228. package/dist/app/assets/{powerquery-jWWzzeeK.js → powerquery-Beeqnhtp.js} +1 -1
  229. package/dist/app/assets/{powershell-8uimM5sM.js → powershell-DofDkeyl.js} +1 -1
  230. package/dist/app/assets/{processing-QSbqrBCn.js → processing-C-Nru_27.js} +1 -1
  231. package/dist/app/assets/{prolog-DL94VsoQ.js → prolog-Blc4S8Hs.js} +1 -1
  232. package/dist/app/assets/{promql-CzzP70Zz.js → promql-BsC9xRrD.js} +1 -1
  233. package/dist/app/assets/{properties-qQG5igrW.js → properties-BNFVcgDb.js} +1 -1
  234. package/dist/app/assets/{protobuf-BMTN4S9X.js → protobuf-BlpX_T1K.js} +1 -1
  235. package/dist/app/assets/{psl-D-6m76lq.js → psl-D2Hoa7_4.js} +1 -1
  236. package/dist/app/assets/{pug-DuQ38-Bu.js → pug-DBlY2nRe.js} +1 -1
  237. package/dist/app/assets/{puppet-C9WbrmQV.js → puppet-BfKwQiWD.js} +1 -1
  238. package/dist/app/assets/{pure-4TCyYwSK.js → pure-CgWRG2Cz.js} +1 -1
  239. package/dist/app/assets/{purebasic-CFKj-9Sf.js → purebasic-C4IB7b6g.js} +1 -1
  240. package/dist/app/assets/{purescript-C9U7bAYn.js → purescript-DpbOv2_5.js} +1 -1
  241. package/dist/app/assets/{q-CvrKcy9d.js → q-Bhw7S_Ff.js} +1 -1
  242. package/dist/app/assets/{qml-BW7AUG_7.js → qml-BCy5slwb.js} +1 -1
  243. package/dist/app/assets/{qore-DRUD9M-d.js → qore-C00kyzGf.js} +1 -1
  244. package/dist/app/assets/{qsharp-D39YPxDq.js → qsharp-CN2CDpkI.js} +1 -1
  245. package/dist/app/assets/{quadrantDiagram-34T5L4WZ-DS1LrnIG.js → quadrantDiagram-34T5L4WZ-DF36QwGT.js} +1 -1
  246. package/dist/app/assets/{r-CEg2k6Yb.js → r-B_BK6AZu.js} +1 -1
  247. package/dist/app/assets/{racket-DRPtpMsj.js → racket-ByLawBwM.js} +1 -1
  248. package/dist/app/assets/{reason-B-qXU4Et.js → reason-BDBRcGMx.js} +1 -1
  249. package/dist/app/assets/{regex-CsSf1Cfz.js → regex-ChgfKyvR.js} +1 -1
  250. package/dist/app/assets/{rego-VXXsVyGE.js → rego-D_XvU-HX.js} +1 -1
  251. package/dist/app/assets/{renpy-DWC5VEN0.js → renpy-5nIbfjm_.js} +1 -1
  252. package/dist/app/assets/{requirementDiagram-MS252O5E-D1yFOIdt.js → requirementDiagram-MS252O5E-DoM__lrz.js} +1 -1
  253. package/dist/app/assets/{rest-pDe65Ctt.js → rest-D0kyBqSB.js} +1 -1
  254. package/dist/app/assets/{rip-CorRnEGq.js → rip-CYiR9G3s.js} +1 -1
  255. package/dist/app/assets/{roboconf-X3eSl5BY.js → roboconf-NbRqT12s.js} +1 -1
  256. package/dist/app/assets/{robotframework-CLWOblVK.js → robotframework-DVLdugea.js} +1 -1
  257. package/dist/app/assets/{ruby-BhHizLUq.js → ruby-CXYqjyLr.js} +1 -1
  258. package/dist/app/assets/{rust-KwCeAwDB.js → rust-DtiosDKR.js} +1 -1
  259. package/dist/app/assets/{sankeyDiagram-XADWPNL6-CS4A3riG.js → sankeyDiagram-XADWPNL6-DAGXEQXz.js} +1 -1
  260. package/dist/app/assets/{sas-BmKpi8uz.js → sas-CBuO0A4r.js} +1 -1
  261. package/dist/app/assets/{sass-CLAJxgWV.js → sass-DAOC_JY6.js} +1 -1
  262. package/dist/app/assets/{scala-4qkXqdFC.js → scala-DrjxfsaL.js} +1 -1
  263. package/dist/app/assets/{scheme-CTDiZrIF.js → scheme-Dqq_pAgd.js} +1 -1
  264. package/dist/app/assets/{scss-DsALC5OO.js → scss-Cs8enbPf.js} +1 -1
  265. package/dist/app/assets/{sequenceDiagram-FGHM5R23-DSBN2T81.js → sequenceDiagram-FGHM5R23-D_580_d2.js} +1 -1
  266. package/dist/app/assets/{shell-session-CqKsOgW8.js → shell-session-jQLXH-IX.js} +1 -1
  267. package/dist/app/assets/{smali-CYK2pUFw.js → smali-BjlQ2Fb8.js} +1 -1
  268. package/dist/app/assets/{smalltalk-DISzpnYr.js → smalltalk-CvvaQ-vE.js} +1 -1
  269. package/dist/app/assets/{smarty-B918-r7L.js → smarty-CuW15FKs.js} +1 -1
  270. package/dist/app/assets/{sml-Bw6IzkGv.js → sml-C2rZNwaS.js} +1 -1
  271. package/dist/app/assets/{solidity-DEB3Gm9H.js → solidity-Bz0UCY5q.js} +1 -1
  272. package/dist/app/assets/{solution-file-D2zyqypa.js → solution-file-DY6Szhc0.js} +1 -1
  273. package/dist/app/assets/{soy-CpF2ALZg.js → soy-DupXqVr6.js} +1 -1
  274. package/dist/app/assets/{sparql-Dqur228Z.js → sparql-CKXEGfsk.js} +1 -1
  275. package/dist/app/assets/{splunk-spl-BO5UN_pw.js → splunk-spl-ylrNAn0q.js} +1 -1
  276. package/dist/app/assets/{sqf-sPq7XmN4.js → sqf-lJvrZCtE.js} +1 -1
  277. package/dist/app/assets/{sql-BBIgkG9I.js → sql-B7hLAkUR.js} +1 -1
  278. package/dist/app/assets/{squirrel-C3Y2wlu3.js → squirrel-BH1Y674s.js} +1 -1
  279. package/dist/app/assets/{stan-CkTG-keH.js → stan-fR7Qg8Ut.js} +1 -1
  280. package/dist/app/assets/{stateDiagram-FHFEXIEX-BYk7Q44w.js → stateDiagram-FHFEXIEX-B8jUR8FD.js} +1 -1
  281. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-ByxORwfu.js +1 -0
  282. package/dist/app/assets/{stylus-DP6fiucU.js → stylus-s7kCNuJK.js} +1 -1
  283. package/dist/app/assets/{swift-BcIJhU7i.js → swift-CCtYkHCf.js} +1 -1
  284. package/dist/app/assets/{systemd-Bj9qapvn.js → systemd-BCElHahC.js} +1 -1
  285. package/dist/app/assets/{t4-cs-BTnkg25r.js → t4-cs-H1_QKrKm.js} +1 -1
  286. package/dist/app/assets/{t4-templating-DiW6oGqQ.js → t4-templating-6bPJc-Uq.js} +1 -1
  287. package/dist/app/assets/{t4-vb-UTyjg4tp.js → t4-vb-DJucVBb5.js} +1 -1
  288. package/dist/app/assets/{tap-Ed_xTklo.js → tap-B_SCHNXn.js} +1 -1
  289. package/dist/app/assets/{tcl-Bk-ZoOG4.js → tcl-BNEpqSgM.js} +1 -1
  290. package/dist/app/assets/{textile-CZj_khpd.js → textile-uWVZjI0f.js} +1 -1
  291. package/dist/app/assets/{timeline-definition-GMOUNBTQ-CeAunyIF.js → timeline-definition-GMOUNBTQ-pCO1IuTh.js} +1 -1
  292. package/dist/app/assets/{toml-DYW5oVzI.js → toml-IfqaxX6C.js} +1 -1
  293. package/dist/app/assets/{tremor-DqPTkwAU.js → tremor-CXc27b0y.js} +1 -1
  294. package/dist/app/assets/{tt2-BD6llK6C.js → tt2-CSiBMY4w.js} +1 -1
  295. package/dist/app/assets/{turtle-D_VxYd_W.js → turtle-BG1NGns7.js} +1 -1
  296. package/dist/app/assets/{twig-Dp8VfvZl.js → twig-BApA7lBN.js} +1 -1
  297. package/dist/app/assets/{typescript-BflqNmQF.js → typescript-CRhq3lVo.js} +1 -1
  298. package/dist/app/assets/{typoscript-DtJO34ZB.js → typoscript-CbCyspbX.js} +1 -1
  299. package/dist/app/assets/{unrealscript-C8jPXtsj.js → unrealscript-C0oIJrK_.js} +1 -1
  300. package/dist/app/assets/{uorazor-CFPzPUXg.js → uorazor-CCeC8ukV.js} +1 -1
  301. package/dist/app/assets/{uri-DkdlxU1G.js → uri-BbJq2oKI.js} +1 -1
  302. package/dist/app/assets/{v-DTkby2kG.js → v-DWbZTbl1.js} +1 -1
  303. package/dist/app/assets/{vala-CMDYTOwJ.js → vala-cNE5mkqv.js} +1 -1
  304. package/dist/app/assets/{vbnet-C_hZunWX.js → vbnet-C4ps1ulT.js} +1 -1
  305. package/dist/app/assets/{velocity-CnCTb2IA.js → velocity-BqiV4VvP.js} +1 -1
  306. package/dist/app/assets/{vennDiagram-DHZGUBPP-RtCFamqG.js → vennDiagram-DHZGUBPP-DsozMeQe.js} +1 -1
  307. package/dist/app/assets/{verilog-Czz1q-oU.js → verilog-uM22GI8M.js} +1 -1
  308. package/dist/app/assets/{vhdl-BdvfiRn7.js → vhdl-CjipXQit.js} +1 -1
  309. package/dist/app/assets/{vim-BAHRwEe_.js → vim-DAu-IiFJ.js} +1 -1
  310. package/dist/app/assets/{visual-basic-ncSLJSP6.js → visual-basic-CdGIHeQV.js} +1 -1
  311. package/dist/app/assets/{wardley-RL74JXVD-CHg_zFkP.js → wardley-RL74JXVD-oEncjGLp.js} +1 -1
  312. package/dist/app/assets/{wardleyDiagram-NUSXRM2D-Dqzg24WO.js → wardleyDiagram-NUSXRM2D-DNMPqgtw.js} +1 -1
  313. package/dist/app/assets/{warpscript-DCQ764w0.js → warpscript-ijeKRGom.js} +1 -1
  314. package/dist/app/assets/{wasm-DljWD0od.js → wasm-CyK5pI_Y.js} +1 -1
  315. package/dist/app/assets/{web-idl-CThAM-QS.js → web-idl-3RbxQwXD.js} +1 -1
  316. package/dist/app/assets/{wiki-C3uvDTr2.js → wiki-Vqqp-2xX.js} +1 -1
  317. package/dist/app/assets/{wolfram-WsMOhYXr.js → wolfram-Bsi7joP0.js} +1 -1
  318. package/dist/app/assets/{wren-DZHglD0d.js → wren-WQYmqFb4.js} +1 -1
  319. package/dist/app/assets/{xeora-CAu8qySL.js → xeora-D38FYsRy.js} +1 -1
  320. package/dist/app/assets/{xml-doc-hgEvDErD.js → xml-doc-wUzx0i81.js} +1 -1
  321. package/dist/app/assets/{xojo-DaKqUssi.js → xojo-CGKogxG9.js} +1 -1
  322. package/dist/app/assets/{xquery-BHjeD6a0.js → xquery-Dv5QvWSQ.js} +1 -1
  323. package/dist/app/assets/{xychartDiagram-5P7HB3ND-DT88cvNy.js → xychartDiagram-5P7HB3ND-BsbjEvIN.js} +1 -1
  324. package/dist/app/assets/{yaml-BIt0fEmx.js → yaml-BGAxdcfl.js} +1 -1
  325. package/dist/app/assets/{yang-DXnDsOeM.js → yang-DbR14Qhe.js} +1 -1
  326. package/dist/app/assets/{zig-DcqFuGKI.js → zig-BZnMCGLn.js} +1 -1
  327. package/dist/app/index.html +2 -2
  328. package/dist/index.cjs +1748 -732
  329. package/dist/index.js +1728 -697
  330. package/package.json +3 -3
  331. package/dist/app/assets/channel-B4rIZFfB.js +0 -1
  332. package/dist/app/assets/classDiagram-6PBFFD2Q-BOgbMClZ.js +0 -1
  333. package/dist/app/assets/classDiagram-v2-HSJHXN6E-BOgbMClZ.js +0 -1
  334. package/dist/app/assets/clone-Bdj7TN-g.js +0 -1
  335. package/dist/app/assets/index-Cbwlowa6.css +0 -1
  336. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-Dr657chO.js +0 -1
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  // src/components/chat.tsx
2
- import * as React43 from "react";
2
+ import * as React44 from "react";
3
3
  import {
4
4
  ArrowDown as ArrowDown2,
5
5
  FileText as FileText3,
6
6
  ImageIcon,
7
- Loader2 as Loader25,
7
+ Loader2 as Loader26,
8
8
  Pencil as Pencil4,
9
9
  Quote,
10
10
  RefreshCw as RefreshCw2,
@@ -30,6 +30,12 @@ var THEME_PANEL_RADIUS_PRESET_CLASS = {
30
30
  soft: "rounded-lg",
31
31
  sharp: "rounded-none"
32
32
  };
33
+ var THEME_COMPOSER_INPUT_RADIUS_PRESET_CLASS = {
34
+ pill: "rounded-3xl",
35
+ round: "rounded-xl",
36
+ soft: "rounded-lg",
37
+ sharp: "rounded-none"
38
+ };
33
39
  var THEME_MENU_ITEM_RADIUS_PRESET_CLASS = {
34
40
  pill: "rounded-xl",
35
41
  round: "rounded-lg",
@@ -42,6 +48,13 @@ function getRoundedClass(themeRadius, fallback = "rounded-full") {
42
48
  function getPanelRoundedClass(themeRadius, fallback = "soft") {
43
49
  return THEME_PANEL_RADIUS_PRESET_CLASS[themeRadius ?? fallback];
44
50
  }
51
+ function getComposerInputRoundedClass(themeRadius, options = {}) {
52
+ const radius = themeRadius ?? options.fallback ?? "round";
53
+ if (radius === "pill" && options.isEmpty && !options.isStacked) {
54
+ return "rounded-full";
55
+ }
56
+ return THEME_COMPOSER_INPUT_RADIUS_PRESET_CLASS[radius];
57
+ }
45
58
  function getMenuItemRoundedClass(themeRadius, fallback = "soft") {
46
59
  return THEME_MENU_ITEM_RADIUS_PRESET_CLASS[themeRadius ?? fallback];
47
60
  }
@@ -132,7 +145,7 @@ import {
132
145
  } from "@xpert-ai/xpert-sdk";
133
146
  import "@langchain/core/messages/tool";
134
147
  import {
135
- ChatMessageEventTypeEnum,
148
+ ChatMessageEventTypeEnum as ChatMessageEventTypeEnum2,
136
149
  ChatMessageTypeEnum,
137
150
  REQUEST_USER_INPUT_RESULT_PURPOSE_IMPLEMENTATION_CONFIRMATION,
138
151
  REQUEST_USER_INPUT_RESULT_PURPOSE_PLAN_CLARIFICATION,
@@ -142,6 +155,26 @@ import {
142
155
  isClientToolRequest as isClientToolRequest2
143
156
  } from "@xpert-ai/chatkit-types";
144
157
 
158
+ // src/lib/agent-runs.ts
159
+ import {
160
+ ChatMessageEventTypeEnum
161
+ } from "@xpert-ai/chatkit-types";
162
+ function isAgentEventContent(content) {
163
+ return content.type === "agent_event";
164
+ }
165
+ function readContentExecutionId(content) {
166
+ if (!content || typeof content === "string") return void 0;
167
+ return typeof content.executionId === "string" && content.executionId.trim() ? content.executionId.trim() : void 0;
168
+ }
169
+ function readContentParentExecutionId(content) {
170
+ if (!content || typeof content === "string") return void 0;
171
+ return typeof content.parentExecutionId === "string" && content.parentExecutionId.trim() ? content.parentExecutionId.trim() : void 0;
172
+ }
173
+ function readContentAgentKey(content) {
174
+ if (!content || typeof content === "string") return void 0;
175
+ return typeof content.agentKey === "string" && content.agentKey.trim() ? content.agentKey.trim() : void 0;
176
+ }
177
+
145
178
  // src/lib/api-config.ts
146
179
  function hasConfiguredValue(value) {
147
180
  return typeof value === "string" && value.trim().length > 0;
@@ -266,6 +299,11 @@ function useStreamManager() {
266
299
  };
267
300
  }
268
301
 
302
+ // src/lib/message-metadata.ts
303
+ import {
304
+ isClientToolRequest
305
+ } from "@xpert-ai/chatkit-types";
306
+
269
307
  // src/lib/references.ts
270
308
  function isObjectLike(value) {
271
309
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -562,6 +600,33 @@ function buildHumanMessageInputPayload(source) {
562
600
  };
563
601
  }
564
602
 
603
+ // src/lib/message-metadata.ts
604
+ function isObjectRecord(value) {
605
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
606
+ }
607
+ function isStringArray(value) {
608
+ return Array.isArray(value) && value.every((item) => typeof item === "string");
609
+ }
610
+ function isSkillSelection(value) {
611
+ if (!isObjectRecord(value)) {
612
+ return false;
613
+ }
614
+ return isStringArray(value.ids) && (value.workspaceId === void 0 || typeof value.workspaceId === "string");
615
+ }
616
+ function isNodeKeySelection(value) {
617
+ return isObjectRecord(value) && isStringArray(value.nodeKeys);
618
+ }
619
+ function isRuntimeCapabilitiesSelectionSet(value) {
620
+ return isObjectRecord(value) && isSkillSelection(value.skills) && isNodeKeySelection(value.plugins) && (value.subAgents === void 0 || isNodeKeySelection(value.subAgents));
621
+ }
622
+ function isRuntimeCapabilitiesSelection(value) {
623
+ if (!isObjectRecord(value)) {
624
+ return false;
625
+ }
626
+ const selection = value;
627
+ return selection.mode === "allowlist" && isRuntimeCapabilitiesSelectionSet(selection) && (selection.recommended === void 0 || isRuntimeCapabilitiesSelectionSet(selection.recommended));
628
+ }
629
+
565
630
  // src/providers/ParentMessenger.tsx
566
631
  import { jsx } from "react/jsx-runtime";
567
632
  var handledSendUserMessageNonces = /* @__PURE__ */ new Set();
@@ -681,12 +746,14 @@ function ParentMessengerProvider({
681
746
  }
682
747
  return;
683
748
  }
684
- const requestHumanInput = params.planMode === true || params.state?.[STATE_VARIABLE_HUMAN2]?.planMode === true || params.runtimeCapabilities || params.state?.[STATE_VARIABLE_HUMAN2]?.runtimeCapabilities ? {
749
+ const runtimeCapabilitiesCandidate = params.runtimeCapabilities ?? params.state?.[STATE_VARIABLE_HUMAN2]?.runtimeCapabilities;
750
+ const runtimeCapabilities = isRuntimeCapabilitiesSelection(
751
+ runtimeCapabilitiesCandidate
752
+ ) ? runtimeCapabilitiesCandidate : void 0;
753
+ const requestHumanInput = params.planMode === true || params.state?.[STATE_VARIABLE_HUMAN2]?.planMode === true || runtimeCapabilities ? {
685
754
  ...humanInput,
686
755
  ...params.planMode === true || params.state?.[STATE_VARIABLE_HUMAN2]?.planMode === true ? { planMode: true } : {},
687
- ...params.runtimeCapabilities ? { runtimeCapabilities: params.runtimeCapabilities } : params.state?.[STATE_VARIABLE_HUMAN2]?.runtimeCapabilities ? {
688
- runtimeCapabilities: params.state[STATE_VARIABLE_HUMAN2].runtimeCapabilities
689
- } : {}
756
+ ...runtimeCapabilities ? { runtimeCapabilities } : {}
690
757
  } : humanInput;
691
758
  const newMessage = {
692
759
  id: createMessageId(),
@@ -694,7 +761,8 @@ function ParentMessengerProvider({
694
761
  content: prompt,
695
762
  submittedInput: humanInput.input,
696
763
  ...humanInput.referenceComposition ? { referenceComposition: humanInput.referenceComposition } : {},
697
- ...references.length > 0 ? { references } : {}
764
+ ...references.length > 0 ? { references } : {},
765
+ ...runtimeCapabilities ? { runtimeCapabilities } : {}
698
766
  };
699
767
  const stream = streamRef2.current;
700
768
  const activeFollowUpMode = stream?.isLoading ? params.followUpMode && params.followUpMode !== "default" ? params.followUpMode : stream.followUpBehavior ?? "queue" : void 0;
@@ -984,32 +1052,6 @@ function resolveUsedContextSize(options) {
984
1052
  return normalizeContextUsageNumber(options.fallbackUsedTokens) ?? 0;
985
1053
  }
986
1054
 
987
- // src/lib/message-metadata.ts
988
- import {
989
- isClientToolRequest
990
- } from "@xpert-ai/chatkit-types";
991
- function isObjectRecord(value) {
992
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
993
- }
994
- function isStringArray(value) {
995
- return Array.isArray(value) && value.every((item) => typeof item === "string");
996
- }
997
- function isSkillSelection(value) {
998
- if (!isObjectRecord(value)) {
999
- return false;
1000
- }
1001
- return isStringArray(value.ids) && (value.workspaceId === void 0 || typeof value.workspaceId === "string");
1002
- }
1003
- function isNodeKeySelection(value) {
1004
- return isObjectRecord(value) && isStringArray(value.nodeKeys);
1005
- }
1006
- function isRuntimeCapabilitiesSelection(value) {
1007
- if (!isObjectRecord(value)) {
1008
- return false;
1009
- }
1010
- return value.mode === "allowlist" && isSkillSelection(value.skills) && isNodeKeySelection(value.plugins) && (value.subAgents === void 0 || isNodeKeySelection(value.subAgents));
1011
- }
1012
-
1013
1055
  // src/lib/follow-ups.ts
1014
1056
  function getComposerFollowUpShortcutLabels(queueShortcutLabel) {
1015
1057
  return {
@@ -1469,6 +1511,38 @@ var en_US_default = {
1469
1511
  option: "Option",
1470
1512
  other: "Other"
1471
1513
  },
1514
+ agentRun: {
1515
+ defaultTitle: "Sub-agent",
1516
+ inputLabel: "Input",
1517
+ errorLabel: "Error",
1518
+ status: {
1519
+ running: "Running",
1520
+ success: "Done",
1521
+ error: "Error",
1522
+ replied: "Replied",
1523
+ pending: "Pending",
1524
+ interrupted: "Interrupted",
1525
+ timeout: "Timed out"
1526
+ },
1527
+ counts: {
1528
+ messages: {
1529
+ one: "{{count}} message",
1530
+ other: "{{count}} messages"
1531
+ },
1532
+ tools: {
1533
+ one: "{{count}} tool",
1534
+ other: "{{count}} tools"
1535
+ },
1536
+ events: {
1537
+ one: "{{count}} event",
1538
+ other: "{{count}} events"
1539
+ },
1540
+ children: {
1541
+ one: "{{count}} child agent",
1542
+ other: "{{count}} child agents"
1543
+ }
1544
+ }
1545
+ },
1472
1546
  toolGroup: {
1473
1547
  status: {
1474
1548
  running: "Processing",
@@ -1481,6 +1555,7 @@ var en_US_default = {
1481
1555
  jsonTitle: "JSON",
1482
1556
  jsonTree: "Tree",
1483
1557
  jsonRaw: "Raw",
1558
+ sourcesTitle: "Sources",
1484
1559
  copy: "Copy",
1485
1560
  copied: "Copied",
1486
1561
  separator: ", ",
@@ -1761,6 +1836,38 @@ var zh_CN_default = {
1761
1836
  option: "\u9009\u9879",
1762
1837
  other: "\u5176\u4ED6"
1763
1838
  },
1839
+ agentRun: {
1840
+ defaultTitle: "\u5B50\u667A\u80FD\u4F53",
1841
+ inputLabel: "\u8F93\u5165",
1842
+ errorLabel: "\u9519\u8BEF",
1843
+ status: {
1844
+ running: "\u8FD0\u884C\u4E2D",
1845
+ success: "\u5DF2\u5B8C\u6210",
1846
+ error: "\u9519\u8BEF",
1847
+ replied: "\u5DF2\u56DE\u590D",
1848
+ pending: "\u7B49\u5F85\u4E2D",
1849
+ interrupted: "\u5DF2\u4E2D\u65AD",
1850
+ timeout: "\u5DF2\u8D85\u65F6"
1851
+ },
1852
+ counts: {
1853
+ messages: {
1854
+ one: "{{count}} \u6761\u6D88\u606F",
1855
+ other: "{{count}} \u6761\u6D88\u606F"
1856
+ },
1857
+ tools: {
1858
+ one: "{{count}} \u4E2A\u5DE5\u5177",
1859
+ other: "{{count}} \u4E2A\u5DE5\u5177"
1860
+ },
1861
+ events: {
1862
+ one: "{{count}} \u4E2A\u4E8B\u4EF6",
1863
+ other: "{{count}} \u4E2A\u4E8B\u4EF6"
1864
+ },
1865
+ children: {
1866
+ one: "{{count}} \u4E2A\u5B50\u667A\u80FD\u4F53",
1867
+ other: "{{count}} \u4E2A\u5B50\u667A\u80FD\u4F53"
1868
+ }
1869
+ }
1870
+ },
1764
1871
  toolGroup: {
1765
1872
  status: {
1766
1873
  running: "\u6B63\u5728\u5904\u7406",
@@ -1773,6 +1880,7 @@ var zh_CN_default = {
1773
1880
  jsonTitle: "JSON",
1774
1881
  jsonTree: "\u6811\u5F62",
1775
1882
  jsonRaw: "\u539F\u59CB",
1883
+ sourcesTitle: "\u4FE1\u606F\u6E90",
1776
1884
  copy: "\u590D\u5236",
1777
1885
  copied: "\u5DF2\u590D\u5236",
1778
1886
  separator: "\uFF0C",
@@ -2211,6 +2319,39 @@ function uniqueStrings(values) {
2211
2319
  new Set(values.map((value) => value.trim()).filter(Boolean))
2212
2320
  );
2213
2321
  }
2322
+ function getRuntimeCapabilitiesSelectionSet(selection) {
2323
+ return {
2324
+ skills: {
2325
+ ...selection?.skills.workspaceId ? { workspaceId: selection.skills.workspaceId } : {},
2326
+ ids: uniqueStrings(selection?.skills.ids ?? [])
2327
+ },
2328
+ plugins: {
2329
+ nodeKeys: uniqueStrings(selection?.plugins.nodeKeys ?? [])
2330
+ },
2331
+ subAgents: {
2332
+ nodeKeys: uniqueStrings(selection?.subAgents?.nodeKeys ?? [])
2333
+ }
2334
+ };
2335
+ }
2336
+ function mergeRuntimeCapabilitiesSelectionSets(capabilities, ...sets) {
2337
+ const workspaceId = sets.find((set) => set?.skills.workspaceId)?.skills.workspaceId ?? capabilities.skills[0]?.workspaceId;
2338
+ return {
2339
+ skills: {
2340
+ ...workspaceId ? { workspaceId } : {},
2341
+ ids: uniqueStrings(sets.flatMap((set) => set?.skills.ids ?? []))
2342
+ },
2343
+ plugins: {
2344
+ nodeKeys: uniqueStrings(
2345
+ sets.flatMap((set) => set?.plugins.nodeKeys ?? [])
2346
+ )
2347
+ },
2348
+ subAgents: {
2349
+ nodeKeys: uniqueStrings(
2350
+ sets.flatMap((set) => set?.subAgents?.nodeKeys ?? [])
2351
+ )
2352
+ }
2353
+ };
2354
+ }
2214
2355
  function createEmptyRuntimeCapabilitiesSelection(capabilities) {
2215
2356
  const workspaceId = capabilities?.skills[0]?.workspaceId;
2216
2357
  return {
@@ -2246,25 +2387,56 @@ function createDefaultRuntimeCapabilitiesSelection(capabilities) {
2246
2387
  };
2247
2388
  }
2248
2389
  function mergeRuntimeCapabilitiesSelections(capabilities, ...selections) {
2249
- const workspaceId = selections.find((selection) => selection?.skills.workspaceId)?.skills.workspaceId ?? capabilities.skills[0]?.workspaceId;
2390
+ const merged = mergeRuntimeCapabilitiesSelectionSets(
2391
+ capabilities,
2392
+ ...selections.map(
2393
+ (selection) => selection ? getRuntimeCapabilitiesSelectionSet(selection) : null
2394
+ )
2395
+ );
2396
+ const recommended = mergeRuntimeCapabilitiesSelectionSets(
2397
+ capabilities,
2398
+ ...selections.map((selection) => selection?.recommended)
2399
+ );
2250
2400
  return {
2251
2401
  mode: "allowlist",
2252
- skills: {
2253
- ...workspaceId ? { workspaceId } : {},
2254
- ids: uniqueStrings(
2255
- selections.flatMap((selection) => selection?.skills.ids ?? [])
2256
- )
2257
- },
2258
- plugins: {
2259
- nodeKeys: uniqueStrings(
2260
- selections.flatMap((selection) => selection?.plugins.nodeKeys ?? [])
2261
- )
2262
- },
2263
- subAgents: {
2264
- nodeKeys: uniqueStrings(
2265
- selections.flatMap((selection) => selection?.subAgents?.nodeKeys ?? [])
2266
- )
2267
- }
2402
+ ...merged,
2403
+ ...hasRuntimeCapabilitySelectionSet(recommended) ? { recommended } : {}
2404
+ };
2405
+ }
2406
+ function createRuntimeCapabilitiesForSubmit({
2407
+ capabilities,
2408
+ available,
2409
+ recommended
2410
+ }) {
2411
+ const recommendedSet = mergeRuntimeCapabilitiesSelectionSets(
2412
+ capabilities,
2413
+ recommended,
2414
+ recommended?.recommended
2415
+ );
2416
+ const merged = mergeRuntimeCapabilitiesSelectionSets(
2417
+ capabilities,
2418
+ available,
2419
+ recommendedSet
2420
+ );
2421
+ return {
2422
+ mode: "allowlist",
2423
+ ...merged,
2424
+ ...hasRuntimeCapabilitySelectionSet(recommendedSet) ? { recommended: recommendedSet } : {}
2425
+ };
2426
+ }
2427
+ function getRecommendedRuntimeCapabilitiesSelection(selection) {
2428
+ if (!selection?.recommended) {
2429
+ return null;
2430
+ }
2431
+ return {
2432
+ mode: "allowlist",
2433
+ ...getRuntimeCapabilitiesSelectionSet(selection.recommended)
2434
+ };
2435
+ }
2436
+ function getAvailableRuntimeCapabilitiesSelection(selection) {
2437
+ return {
2438
+ mode: "allowlist",
2439
+ ...getRuntimeCapabilitiesSelectionSet(selection)
2268
2440
  };
2269
2441
  }
2270
2442
  function toggleRuntimeCapabilitySelection(selection, type, id, selected) {
@@ -2323,6 +2495,12 @@ function getRuntimeCapabilityOptions(capabilities) {
2323
2495
  }))
2324
2496
  ];
2325
2497
  }
2498
+ function hasRuntimeCapabilitySelectionSet(selection) {
2499
+ if (!selection) {
2500
+ return false;
2501
+ }
2502
+ return selection.skills.ids.length > 0 || selection.plugins.nodeKeys.length > 0 || (selection.subAgents?.nodeKeys.length ?? 0) > 0;
2503
+ }
2326
2504
  function isRuntimeCapabilitySelected(selection, type, id) {
2327
2505
  if (type === "skill") {
2328
2506
  return selection.skills.ids.includes(id);
@@ -3343,7 +3521,17 @@ function SlashPalette({
3343
3521
  }
3344
3522
  ),
3345
3523
  /* @__PURE__ */ jsxs6("span", { className: "flex min-w-0 flex-1 items-baseline gap-2", children: [
3346
- /* @__PURE__ */ jsx13("span", { className: "shrink-0 truncate font-medium", children: option.label }),
3524
+ /* @__PURE__ */ jsxs6("span", { className: "flex min-w-0 shrink-0 items-baseline gap-1.5", children: [
3525
+ /* @__PURE__ */ jsx13("span", { className: "truncate font-medium", children: option.label }),
3526
+ option.kind === "command" && option.capabilityType && typeof option.childCount === "number" ? /* @__PURE__ */ jsx13(
3527
+ "span",
3528
+ {
3529
+ "data-slot": "slash-palette-child-count",
3530
+ className: "inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-muted px-1 text-[10px] font-medium leading-none text-muted-foreground",
3531
+ children: option.childCount
3532
+ }
3533
+ ) : null
3534
+ ] }),
3347
3535
  option.description && /* @__PURE__ */ jsx13("span", { className: "min-w-0 flex-1 truncate text-muted-foreground", children: option.description })
3348
3536
  ] }),
3349
3537
  option.kind === "command" && option.capabilityType ? /* @__PURE__ */ jsx13("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-muted-foreground", children: option.expanded ? /* @__PURE__ */ jsx13(ChevronDown, { size: 14 }) : /* @__PURE__ */ jsx13(ChevronRight2, { size: 14 }) }) : null
@@ -6015,19 +6203,22 @@ function resolveRuntimeCapabilityPalette(value, selectionStart) {
6015
6203
  return null;
6016
6204
  }
6017
6205
  const beforeCaret = value.slice(0, selectionStart);
6018
- const match = /(^|\s)\/([^\s/]*)$/.exec(beforeCaret);
6206
+ const match = /(^|\s)([/$])([^\s/]*)$/.exec(beforeCaret);
6019
6207
  if (!match) {
6020
6208
  return null;
6021
6209
  }
6022
- const query = match[2] ?? "";
6210
+ const trigger = match[2];
6211
+ const query = match[3] ?? "";
6023
6212
  const start = beforeCaret.length - query.length - 1;
6024
6213
  const beforeTrigger = beforeCaret.slice(0, start);
6025
6214
  return {
6215
+ trigger,
6026
6216
  query,
6027
6217
  start,
6028
6218
  end: selectionStart,
6029
6219
  activeIndex: 0,
6030
- atMessageStart: beforeTrigger.trim().length === 0
6220
+ atMessageStart: beforeTrigger.trim().length === 0,
6221
+ ...trigger === "$" ? { capabilityTypes: ["skill"] } : {}
6031
6222
  };
6032
6223
  }
6033
6224
  function matchesQuery(values, query) {
@@ -6064,7 +6255,11 @@ function matchesCapability(option, query, capabilityTypes) {
6064
6255
  if (capabilityTypes?.length && !capabilityTypes.includes(option.type)) {
6065
6256
  return false;
6066
6257
  }
6067
- return matchesQuery([option.label, option.description, option.type], query);
6258
+ const skillAliases = option.type === "skill" ? [`$${option.id}`, `$${option.label}`] : [];
6259
+ return matchesQuery(
6260
+ [option.id, option.label, option.description, option.type, ...skillAliases],
6261
+ query
6262
+ );
6068
6263
  }
6069
6264
  function getCommandPaletteOption(command) {
6070
6265
  const capabilityType = CAPABILITY_GROUP_COMMANDS[command.name];
@@ -6083,7 +6278,7 @@ function createSlashPaletteOptions({
6083
6278
  runtimeCapabilitiesReady,
6084
6279
  runtimeCapabilityOptions,
6085
6280
  runtimeCapabilities,
6086
- effectiveRuntimeCapabilitiesForSubmit
6281
+ recommendedRuntimeCapabilities
6087
6282
  }) {
6088
6283
  if (!palette) {
6089
6284
  return [];
@@ -6093,7 +6288,7 @@ function createSlashPaletteOptions({
6093
6288
  const expandedCapabilityTypes = new Set(
6094
6289
  palette.expandedCapabilityTypes ?? []
6095
6290
  );
6096
- const selection = effectiveRuntimeCapabilitiesForSubmit ?? createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities);
6291
+ const selection = recommendedRuntimeCapabilities ?? createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities);
6097
6292
  const getCapabilityOptions = (capabilityTypes, capabilityQuery = query) => runtimeCapabilitiesReady ? runtimeCapabilityOptions.filter(
6098
6293
  (option) => matchesCapability(option, capabilityQuery, capabilityTypes) && !isRuntimeCapabilitySelected(selection, option.type, option.id)
6099
6294
  ) : [];
@@ -6329,7 +6524,7 @@ function useSlashCommands({
6329
6524
  runtimeCapabilities,
6330
6525
  runtimeCapabilitiesReady,
6331
6526
  runtimeCapabilityOptions,
6332
- effectiveRuntimeCapabilitiesForSubmit,
6527
+ recommendedRuntimeCapabilities,
6333
6528
  draft,
6334
6529
  palette,
6335
6530
  setPalette,
@@ -6374,12 +6569,12 @@ function useSlashCommands({
6374
6569
  runtimeCapabilitiesReady,
6375
6570
  runtimeCapabilityOptions,
6376
6571
  runtimeCapabilities,
6377
- effectiveRuntimeCapabilitiesForSubmit
6572
+ recommendedRuntimeCapabilities
6378
6573
  }),
6379
6574
  [
6380
- effectiveRuntimeCapabilitiesForSubmit,
6381
6575
  localizedResolvedCommands,
6382
6576
  palette,
6577
+ recommendedRuntimeCapabilities,
6383
6578
  runtimeCapabilities,
6384
6579
  runtimeCapabilitiesReady,
6385
6580
  runtimeCapabilityOptions
@@ -6611,13 +6806,284 @@ function useSlashCommands({
6611
6806
  }
6612
6807
 
6613
6808
  // src/components/thread/messages/ai.tsx
6614
- import * as React30 from "react";
6809
+ import * as React31 from "react";
6615
6810
  import {
6616
6811
  ChevronDown as ChevronDown4,
6617
- Clock3,
6618
- Loader2 as Loader24
6812
+ Clock3 as Clock32,
6813
+ Loader2 as Loader25
6619
6814
  } from "lucide-react";
6620
6815
 
6816
+ // src/lib/agent-run-render-tree.ts
6817
+ function isTextContent(content) {
6818
+ return content.type === "text";
6819
+ }
6820
+ function isReasoningContent(content) {
6821
+ return content.type === "reasoning";
6822
+ }
6823
+ function isComponentContent(content) {
6824
+ return content.type === "component";
6825
+ }
6826
+ function parseDateValue(value) {
6827
+ if (value instanceof Date) {
6828
+ const timestamp2 = value.getTime();
6829
+ return Number.isNaN(timestamp2) ? null : timestamp2;
6830
+ }
6831
+ if (typeof value !== "string") {
6832
+ return null;
6833
+ }
6834
+ const timestamp = Date.parse(value);
6835
+ return Number.isNaN(timestamp) ? null : timestamp;
6836
+ }
6837
+ function readContentTitle(content) {
6838
+ if (typeof content === "string") return void 0;
6839
+ if (typeof content.xpertName === "string" && content.xpertName.trim()) {
6840
+ return content.xpertName.trim();
6841
+ }
6842
+ return void 0;
6843
+ }
6844
+ function readContentStringField(content, field) {
6845
+ if (typeof content === "string") return void 0;
6846
+ const value = content[field];
6847
+ return typeof value === "string" && value.trim() ? value.trim() : void 0;
6848
+ }
6849
+ function normalizeRunStatus(status) {
6850
+ return typeof status === "string" && status.trim() ? status.trim().toLowerCase() : "pending";
6851
+ }
6852
+ function isRunningRunStatus(status) {
6853
+ return normalizeRunStatus(status) === "running";
6854
+ }
6855
+ function isFailedRunStatus(status) {
6856
+ const normalized = normalizeRunStatus(status);
6857
+ return normalized === "error" || normalized === "fail" || normalized === "failed";
6858
+ }
6859
+ function hasVisibleAgentRunDetails(info) {
6860
+ return info.error !== void 0;
6861
+ }
6862
+ function getAgentRunTitle(info, fallback) {
6863
+ return info.title?.trim() || info.xpertName?.trim() || info.agentKey?.trim() || fallback || null;
6864
+ }
6865
+ function getAgentRunDuration(info) {
6866
+ if (typeof info.elapsedTime === "number" && Number.isFinite(info.elapsedTime)) {
6867
+ return info.elapsedTime;
6868
+ }
6869
+ const startedAt = parseDateValue(info.startedAt) ?? parseDateValue(info.createdAt);
6870
+ const endedAt = parseDateValue(info.endedAt) ?? parseDateValue(info.updatedAt);
6871
+ if (startedAt === null || endedAt === null) return null;
6872
+ return Math.max(0, endedAt - startedAt);
6873
+ }
6874
+ function getAgentRunCounts(node) {
6875
+ let text = 0;
6876
+ let tools = 0;
6877
+ let events = 0;
6878
+ for (const entry of node.entries) {
6879
+ const item = entry.item;
6880
+ if (typeof item === "string") {
6881
+ if (item.trim()) text += 1;
6882
+ continue;
6883
+ }
6884
+ if (isTextContent(item) || isReasoningContent(item)) {
6885
+ if (item.text?.trim()) text += 1;
6886
+ continue;
6887
+ }
6888
+ if (isComponentContent(item)) {
6889
+ tools += 1;
6890
+ continue;
6891
+ }
6892
+ if (isAgentEventContent(item)) {
6893
+ events += 1;
6894
+ }
6895
+ }
6896
+ return {
6897
+ text,
6898
+ tools,
6899
+ events,
6900
+ children: node.children.length
6901
+ };
6902
+ }
6903
+ function createAgentRunNode(nodes, id, info, order) {
6904
+ const existing = nodes.get(id);
6905
+ if (existing) {
6906
+ existing.info = {
6907
+ ...existing.info,
6908
+ ...info,
6909
+ id,
6910
+ parentId: info.parentId ?? existing.info.parentId,
6911
+ parentExecutionId: info.parentExecutionId ?? existing.info.parentExecutionId,
6912
+ agentKey: info.agentKey ?? existing.info.agentKey,
6913
+ xpertName: info.xpertName ?? existing.info.xpertName,
6914
+ title: info.title ?? existing.info.title,
6915
+ status: info.status ?? existing.info.status,
6916
+ elapsedTime: info.elapsedTime ?? existing.info.elapsedTime,
6917
+ error: info.error ?? existing.info.error,
6918
+ inputs: info.inputs ?? existing.info.inputs
6919
+ };
6920
+ existing.firstOrder = Math.min(existing.firstOrder, order);
6921
+ return existing;
6922
+ }
6923
+ const node = {
6924
+ id,
6925
+ info: { ...info, id },
6926
+ entries: [],
6927
+ children: [],
6928
+ firstOrder: order
6929
+ };
6930
+ nodes.set(id, node);
6931
+ return node;
6932
+ }
6933
+ function findFallbackRunByAgentKey(runs, agentKey, rootExecutionId) {
6934
+ if (!agentKey) return null;
6935
+ const candidates = runs.filter(
6936
+ (run) => run.agentKey === agentKey && run.id !== rootExecutionId
6937
+ );
6938
+ if (candidates.length === 0) return null;
6939
+ for (let index = candidates.length - 1; index >= 0; index -= 1) {
6940
+ if (isRunningRunStatus(candidates[index].status)) {
6941
+ return candidates[index];
6942
+ }
6943
+ }
6944
+ return candidates[candidates.length - 1];
6945
+ }
6946
+ function getEntryRunTarget(entry, runs, rootExecutionId) {
6947
+ const item = entry.item;
6948
+ const executionId = readContentExecutionId(item);
6949
+ const parentExecutionId = readContentParentExecutionId(item);
6950
+ const agentKey = readContentAgentKey(item);
6951
+ if (executionId) {
6952
+ return {
6953
+ executionId,
6954
+ parentExecutionId,
6955
+ agentKey
6956
+ };
6957
+ }
6958
+ const fallbackRun = findFallbackRunByAgentKey(
6959
+ runs,
6960
+ agentKey,
6961
+ rootExecutionId
6962
+ );
6963
+ if (!fallbackRun) return null;
6964
+ return {
6965
+ executionId: fallbackRun.id,
6966
+ parentExecutionId: fallbackRun.parentId ?? fallbackRun.parentExecutionId,
6967
+ agentKey
6968
+ };
6969
+ }
6970
+ function createInfoFromEntry(id, entry, parentExecutionId) {
6971
+ return {
6972
+ id,
6973
+ ...parentExecutionId ? { parentId: parentExecutionId, parentExecutionId } : {},
6974
+ ...readContentAgentKey(entry.item) ? { agentKey: readContentAgentKey(entry.item) } : {},
6975
+ ...readContentTitle(entry.item) ? { xpertName: readContentTitle(entry.item) } : {},
6976
+ ...readContentStringField(entry.item, "runId") ? { runId: readContentStringField(entry.item, "runId") } : {}
6977
+ };
6978
+ }
6979
+ function normalizeAssistantEntries(message) {
6980
+ const entries = [];
6981
+ if (typeof message.content === "string") {
6982
+ if (message.content.trim()) {
6983
+ entries.push({
6984
+ item: message.content,
6985
+ index: 0,
6986
+ source: "content",
6987
+ order: 0
6988
+ });
6989
+ }
6990
+ } else if (Array.isArray(message.content)) {
6991
+ message.content.forEach((item, index) => {
6992
+ entries.push({
6993
+ item,
6994
+ index,
6995
+ source: "content",
6996
+ order: index
6997
+ });
6998
+ });
6999
+ }
7000
+ const contentCount = entries.length;
7001
+ (message.reasoning ?? []).forEach((item, index) => {
7002
+ entries.push({
7003
+ item,
7004
+ index,
7005
+ source: "reasoning",
7006
+ order: contentCount + index
7007
+ });
7008
+ });
7009
+ return entries;
7010
+ }
7011
+ function refreshAgentNodeOrder(node) {
7012
+ let order = node.firstOrder;
7013
+ for (const child of node.children) {
7014
+ order = Math.min(order, refreshAgentNodeOrder(child));
7015
+ }
7016
+ node.firstOrder = order;
7017
+ node.children.sort((a, b) => a.firstOrder - b.firstOrder);
7018
+ return order;
7019
+ }
7020
+ function buildAssistantRenderTree(message) {
7021
+ const rootExecutionId = message.executionId;
7022
+ const runs = message.agentRuns ?? [];
7023
+ const entries = normalizeAssistantEntries(message);
7024
+ const nodes = /* @__PURE__ */ new Map();
7025
+ const rootEntries = [];
7026
+ const rootReasoning = [];
7027
+ const baseOrder = entries.length + 1;
7028
+ runs.forEach((run, index) => {
7029
+ createAgentRunNode(nodes, run.id, run, baseOrder + index / 1e3);
7030
+ });
7031
+ for (const entry of entries) {
7032
+ const target = getEntryRunTarget(entry, runs, rootExecutionId);
7033
+ const shouldGroup = Boolean(target?.executionId) && (target?.executionId !== rootExecutionId || Boolean(target?.parentExecutionId));
7034
+ if (!target || !shouldGroup) {
7035
+ if (entry.source === "reasoning" && typeof entry.item !== "string") {
7036
+ rootReasoning.push(entry.item);
7037
+ } else {
7038
+ rootEntries.push(entry);
7039
+ }
7040
+ continue;
7041
+ }
7042
+ const node = createAgentRunNode(
7043
+ nodes,
7044
+ target.executionId,
7045
+ createInfoFromEntry(target.executionId, entry, target.parentExecutionId),
7046
+ entry.order
7047
+ );
7048
+ node.entries.push(entry);
7049
+ node.firstOrder = Math.min(node.firstOrder, entry.order);
7050
+ }
7051
+ const roots = [];
7052
+ for (const node of nodes.values()) {
7053
+ if (node.id === rootExecutionId && !node.info.parentId) {
7054
+ continue;
7055
+ }
7056
+ const parentId = node.info.parentId ?? node.info.parentExecutionId;
7057
+ if (parentId && parentId !== rootExecutionId && parentId !== node.id) {
7058
+ const parent = nodes.get(parentId);
7059
+ if (parent) {
7060
+ parent.children.push(node);
7061
+ continue;
7062
+ }
7063
+ }
7064
+ roots.push(node);
7065
+ }
7066
+ roots.forEach(refreshAgentNodeOrder);
7067
+ roots.sort((a, b) => a.firstOrder - b.firstOrder);
7068
+ const units = [
7069
+ ...rootEntries.map((entry) => ({
7070
+ type: "entry",
7071
+ entry,
7072
+ order: entry.order
7073
+ })),
7074
+ ...roots.map((node) => ({
7075
+ type: "agent",
7076
+ node,
7077
+ order: node.firstOrder
7078
+ }))
7079
+ ].sort((a, b) => a.order - b.order);
7080
+ return {
7081
+ units,
7082
+ rootReasoning,
7083
+ hasAgentRuns: roots.length > 0
7084
+ };
7085
+ }
7086
+
6621
7087
  // src/components/ui/badge.tsx
6622
7088
  import * as React24 from "react";
6623
7089
  import { jsx as jsx24 } from "react/jsx-runtime";
@@ -7832,26 +8298,436 @@ var MarkdownTextImpl = ({ children }) => {
7832
8298
  };
7833
8299
  var MarkdownText = memo(MarkdownTextImpl);
7834
8300
 
7835
- // src/components/thread/messages/tool-component-group.tsx
8301
+ // src/components/thread/messages/agent-run-group.tsx
7836
8302
  import * as React28 from "react";
7837
8303
  import {
7838
- BookOpen,
7839
- Brain as Brain3,
7840
- Building2,
7841
- Check as Check3,
8304
+ Bot as Bot3,
8305
+ Braces,
7842
8306
  CheckCircle2 as CheckCircle22,
7843
8307
  ChevronRight as ChevronRight6,
8308
+ Clock3,
8309
+ GitBranch,
8310
+ Info as Info4,
8311
+ Loader2 as Loader23,
8312
+ MessageSquareText,
8313
+ Wrench,
8314
+ XCircle
8315
+ } from "lucide-react";
8316
+ import { jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
8317
+ function safeJson2(value) {
8318
+ try {
8319
+ return JSON.stringify(value, null, 2);
8320
+ } catch {
8321
+ return String(value);
8322
+ }
8323
+ }
8324
+ function formatDisplayValue2(value) {
8325
+ return typeof value === "string" ? value : safeJson2(value);
8326
+ }
8327
+ function formatStepDuration(durationMs) {
8328
+ if (durationMs < 1e3) {
8329
+ return `${durationMs}ms`;
8330
+ }
8331
+ if (durationMs < 1e4) {
8332
+ return `${(durationMs / 1e3).toFixed(1)}s`;
8333
+ }
8334
+ if (durationMs < 6e4) {
8335
+ return `${Math.round(durationMs / 1e3)}s`;
8336
+ }
8337
+ const hours = Math.floor(durationMs / 36e5);
8338
+ const minutes = Math.floor(durationMs % 36e5 / 6e4);
8339
+ const seconds = Math.floor(durationMs % 6e4 / 1e3);
8340
+ if (hours > 0) {
8341
+ return `${hours}h ${minutes}m ${seconds}s`;
8342
+ }
8343
+ return `${minutes}m ${seconds}s`;
8344
+ }
8345
+ function getAgentRunStatusConfig(status, hasReply = false) {
8346
+ const normalized = normalizeRunStatus(status);
8347
+ if (normalized === "running") {
8348
+ return {
8349
+ icon: Loader23,
8350
+ iconClass: "text-blue-700",
8351
+ labelKey: "running",
8352
+ spin: true
8353
+ };
8354
+ }
8355
+ if (normalized === "success" || normalized === "succeeded") {
8356
+ return {
8357
+ icon: CheckCircle22,
8358
+ iconClass: "text-green-700",
8359
+ labelKey: "success",
8360
+ spin: false
8361
+ };
8362
+ }
8363
+ if (isFailedRunStatus(normalized)) {
8364
+ return {
8365
+ icon: XCircle,
8366
+ iconClass: "text-red-700",
8367
+ labelKey: "error",
8368
+ spin: false
8369
+ };
8370
+ }
8371
+ if (normalized === "pending" && hasReply) {
8372
+ return {
8373
+ icon: CheckCircle22,
8374
+ iconClass: "text-green-700",
8375
+ labelKey: "replied",
8376
+ spin: false
8377
+ };
8378
+ }
8379
+ return {
8380
+ icon: Clock3,
8381
+ iconClass: "text-muted-foreground",
8382
+ labelKey: normalized,
8383
+ spin: false
8384
+ };
8385
+ }
8386
+ function AgentRunHeaderMetric({
8387
+ icon: Icon,
8388
+ label,
8389
+ value,
8390
+ children
8391
+ }) {
8392
+ return /* @__PURE__ */ jsxs19(Tooltip, { children: [
8393
+ /* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs19(
8394
+ "span",
8395
+ {
8396
+ "aria-label": label,
8397
+ className: "inline-flex shrink-0 items-center gap-1 rounded-sm text-[11px] text-muted-foreground/60 transition-colors group-hover/agent:text-muted-foreground",
8398
+ children: [
8399
+ /* @__PURE__ */ jsx31(Icon, { className: "h-3.5 w-3.5" }),
8400
+ value !== void 0 ? /* @__PURE__ */ jsx31("span", { children: value }) : null
8401
+ ]
8402
+ }
8403
+ ) }),
8404
+ /* @__PURE__ */ jsx31(TooltipContent, { side: "top", sideOffset: 6, className: "max-w-80 text-left", children })
8405
+ ] });
8406
+ }
8407
+ function getAgentNodeUnits(node) {
8408
+ return [
8409
+ ...node.entries.map((entry) => ({
8410
+ type: "entry",
8411
+ entry,
8412
+ order: entry.order
8413
+ })),
8414
+ ...node.children.map((child) => ({
8415
+ type: "agent",
8416
+ node: child,
8417
+ order: child.firstOrder
8418
+ }))
8419
+ ].sort((a, b) => a.order - b.order);
8420
+ }
8421
+ function AgentEventRow({ content }) {
8422
+ const label = content.title?.trim() || content.message?.trim() || content.event?.trim() || "Event";
8423
+ const detail = content.title?.trim() && content.message?.trim() ? content.message.trim() : null;
8424
+ const isError = content.error !== void 0 || isFailedRunStatus(content.status);
8425
+ return /* @__PURE__ */ jsxs19(
8426
+ "div",
8427
+ {
8428
+ className: cn(
8429
+ "flex items-start gap-2 rounded-md px-2 py-1.5 text-xs leading-5",
8430
+ isError ? "bg-destructive/10 text-destructive" : "bg-muted/40 text-muted-foreground"
8431
+ ),
8432
+ children: [
8433
+ /* @__PURE__ */ jsx31(Info4, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
8434
+ /* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1", children: [
8435
+ /* @__PURE__ */ jsx31("div", { className: "truncate font-medium", children: label }),
8436
+ detail ? /* @__PURE__ */ jsx31("div", { className: "wrap-break-word", children: detail }) : null,
8437
+ content.error !== void 0 ? /* @__PURE__ */ jsx31("pre", { className: "mt-1 whitespace-pre-wrap wrap-break-word", children: formatDisplayValue2(content.error) }) : null
8438
+ ] })
8439
+ ]
8440
+ }
8441
+ );
8442
+ }
8443
+ function AgentRunGroup({
8444
+ node,
8445
+ hasFollowingItem,
8446
+ depth,
8447
+ renderUnits
8448
+ }) {
8449
+ const { t } = useChatkitTranslation();
8450
+ const counts = getAgentRunCounts(node);
8451
+ const statusConfig = getAgentRunStatusConfig(
8452
+ node.info.status,
8453
+ counts.text > 0
8454
+ );
8455
+ const StatusIcon = statusConfig.icon;
8456
+ const isRunning = isRunningRunStatus(node.info.status);
8457
+ const [isExpanded, setIsExpanded] = React28.useState(
8458
+ () => isRunning || !hasFollowingItem
8459
+ );
8460
+ const title = getAgentRunTitle(node.info, t("message.agentRun.defaultTitle"));
8461
+ const duration = getAgentRunDuration(node.info);
8462
+ const statusLabel = t(`message.agentRun.status.${statusConfig.labelKey}`, {
8463
+ defaultValue: node.info.status ?? statusConfig.labelKey
8464
+ });
8465
+ const detailsId = React28.useId();
8466
+ React28.useEffect(() => {
8467
+ if (isRunning) {
8468
+ setIsExpanded(true);
8469
+ return;
8470
+ }
8471
+ setIsExpanded(!hasFollowingItem);
8472
+ }, [hasFollowingItem, isRunning]);
8473
+ const countItems = [
8474
+ counts.text > 0 ? {
8475
+ icon: MessageSquareText,
8476
+ count: counts.text,
8477
+ label: t(
8478
+ `message.agentRun.counts.messages.${counts.text === 1 ? "one" : "other"}`,
8479
+ { count: counts.text }
8480
+ )
8481
+ } : null,
8482
+ counts.tools > 0 ? {
8483
+ icon: Wrench,
8484
+ count: counts.tools,
8485
+ label: t(
8486
+ `message.agentRun.counts.tools.${counts.tools === 1 ? "one" : "other"}`,
8487
+ { count: counts.tools }
8488
+ )
8489
+ } : null,
8490
+ counts.events > 0 ? {
8491
+ icon: Info4,
8492
+ count: counts.events,
8493
+ label: t(
8494
+ `message.agentRun.counts.events.${counts.events === 1 ? "one" : "other"}`,
8495
+ { count: counts.events }
8496
+ )
8497
+ } : null,
8498
+ counts.children > 0 ? {
8499
+ icon: GitBranch,
8500
+ count: counts.children,
8501
+ label: t(
8502
+ `message.agentRun.counts.children.${counts.children === 1 ? "one" : "other"}`,
8503
+ { count: counts.children }
8504
+ )
8505
+ } : null
8506
+ ].filter(
8507
+ (item) => Boolean(item)
8508
+ );
8509
+ return /* @__PURE__ */ jsxs19("div", { className: cn("border-l border-border/70 pl-2", depth > 0 ? "ml-1" : "-mx-2.5"), children: [
8510
+ /* @__PURE__ */ jsxs19(
8511
+ "button",
8512
+ {
8513
+ type: "button",
8514
+ className: "group/agent group-agent flex w-full items-start justify-between gap-2 rounded-md px-0 py-1.5 text-left",
8515
+ "aria-expanded": isExpanded,
8516
+ "aria-controls": detailsId,
8517
+ onClick: () => setIsExpanded((prev) => !prev),
8518
+ children: [
8519
+ /* @__PURE__ */ jsx31("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs19("div", { className: "flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1", children: [
8520
+ /* @__PURE__ */ jsx31(Bot3, { className: "h-4 w-4 shrink-0 text-muted-foreground/55 transition-colors group-hover/agent:text-muted-foreground" }),
8521
+ /* @__PURE__ */ jsx31("span", { className: "min-w-0 max-w-[16rem] truncate text-sm font-medium text-foreground/65 transition-colors group-hover/agent:text-foreground", children: title }),
8522
+ /* @__PURE__ */ jsxs19("span", { className: "inline-flex shrink-0 items-center gap-1 text-[11px] text-muted-foreground/65 transition-colors group-hover/agent:text-muted-foreground", children: [
8523
+ /* @__PURE__ */ jsx31(
8524
+ StatusIcon,
8525
+ {
8526
+ className: cn(
8527
+ "h-3.5 w-3.5",
8528
+ statusConfig.iconClass,
8529
+ statusConfig.spin && "animate-spin"
8530
+ )
8531
+ }
8532
+ ),
8533
+ statusLabel
8534
+ ] }),
8535
+ duration !== null ? /* @__PURE__ */ jsxs19("span", { className: "inline-flex shrink-0 items-center gap-1 text-[11px] text-muted-foreground/60 tabular-nums transition-colors group-hover/agent:text-muted-foreground", children: [
8536
+ /* @__PURE__ */ jsx31(Clock3, { className: "h-3 w-3" }),
8537
+ formatStepDuration(duration)
8538
+ ] }) : null,
8539
+ node.info.inputs !== void 0 ? /* @__PURE__ */ jsx31(
8540
+ AgentRunHeaderMetric,
8541
+ {
8542
+ icon: Braces,
8543
+ label: t("message.agentRun.inputLabel"),
8544
+ children: /* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
8545
+ /* @__PURE__ */ jsx31("div", { className: "font-medium", children: t("message.agentRun.inputLabel") }),
8546
+ /* @__PURE__ */ jsx31("pre", { className: "max-h-64 overflow-auto whitespace-pre-wrap wrap-break-word text-xs", children: formatDisplayValue2(node.info.inputs) })
8547
+ ] })
8548
+ }
8549
+ ) : null,
8550
+ countItems.map((item) => {
8551
+ const CountIcon = item.icon;
8552
+ return /* @__PURE__ */ jsx31(
8553
+ AgentRunHeaderMetric,
8554
+ {
8555
+ icon: CountIcon,
8556
+ label: item.label,
8557
+ value: item.count,
8558
+ children: /* @__PURE__ */ jsx31("span", { children: item.label })
8559
+ },
8560
+ item.label
8561
+ );
8562
+ })
8563
+ ] }) }),
8564
+ /* @__PURE__ */ jsx31(
8565
+ ChevronRight6,
8566
+ {
8567
+ "aria-hidden": "true",
8568
+ className: cn(
8569
+ "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground/55 opacity-0 transition-[color,transform] group-hover/agent:text-muted-foreground group-hover/agent:opacity-100",
8570
+ isExpanded && "rotate-90"
8571
+ )
8572
+ }
8573
+ )
8574
+ ]
8575
+ }
8576
+ ),
8577
+ isExpanded ? /* @__PURE__ */ jsxs19("div", { id: detailsId, className: "mt-2 space-y-3", children: [
8578
+ hasVisibleAgentRunDetails(node.info) ? /* @__PURE__ */ jsx31("div", { className: "space-y-2 rounded-md bg-muted/30 px-2 py-2 text-xs text-muted-foreground", children: node.info.error !== void 0 ? /* @__PURE__ */ jsxs19("div", { children: [
8579
+ /* @__PURE__ */ jsx31("div", { className: "mb-1 font-medium text-destructive", children: t("message.agentRun.errorLabel") }),
8580
+ /* @__PURE__ */ jsx31("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue2(node.info.error) })
8581
+ ] }) : null }) : null,
8582
+ renderUnits(getAgentNodeUnits(node), depth + 1)
8583
+ ] }) : null
8584
+ ] });
8585
+ }
8586
+
8587
+ // src/components/thread/messages/web-search-component-renderer.tsx
8588
+ import { jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
8589
+ var webSearchComponentRenderer = {
8590
+ id: "computer-web-search-sources",
8591
+ presentation: "grouped-step",
8592
+ match: isComputerWebSearchComponent,
8593
+ hasDetails: hasWebSearchSources,
8594
+ renderDetails: WebSearchToolCallOutput
8595
+ };
8596
+ function normalizeToolToken(value) {
8597
+ if (typeof value !== "string") return null;
8598
+ const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
8599
+ return normalized || null;
8600
+ }
8601
+ function readOptionalString(value) {
8602
+ if (typeof value !== "string") return void 0;
8603
+ const trimmed = value.trim();
8604
+ return trimmed || void 0;
8605
+ }
8606
+ function normalizeWebSearchSource(value) {
8607
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
8608
+ return null;
8609
+ }
8610
+ const candidate = value;
8611
+ const title = readOptionalString(candidate.title);
8612
+ const url = readOptionalString(candidate.url);
8613
+ if (!title || !url) return null;
8614
+ const content = readOptionalString(candidate.content);
8615
+ const description = readOptionalString(candidate.description);
8616
+ const publishedDate = readOptionalString(
8617
+ candidate.publishedDate ?? candidate.published_date ?? candidate.publishedAt
8618
+ );
8619
+ const author = readOptionalString(candidate.author);
8620
+ return {
8621
+ title,
8622
+ url,
8623
+ ...content ? { content } : {},
8624
+ ...description ? { description } : {},
8625
+ ...publishedDate ? { publishedDate } : {},
8626
+ ...author ? { author } : {}
8627
+ };
8628
+ }
8629
+ function getWebSearchSources(data) {
8630
+ if (!Array.isArray(data.data)) return [];
8631
+ return data.data.flatMap((item) => {
8632
+ const source = normalizeWebSearchSource(item);
8633
+ return source ? [source] : [];
8634
+ });
8635
+ }
8636
+ function hasWebSearchSources(_content, data) {
8637
+ return getWebSearchSources(data).length > 0;
8638
+ }
8639
+ function isComputerWebSearchComponent(_content, data) {
8640
+ const isComputer = data.category === "Computer";
8641
+ const isWebSearch = normalizeToolToken(data.type) === "web_search";
8642
+ if (!isComputer || !isWebSearch) return false;
8643
+ return normalizeToolToken(data.tool) === "web_search" || getWebSearchSources(data).length > 0;
8644
+ }
8645
+ function getSourceHost(url) {
8646
+ try {
8647
+ return new URL(url).hostname.replace(/^www\./, "") || null;
8648
+ } catch {
8649
+ return null;
8650
+ }
8651
+ }
8652
+ function WebSearchToolCallOutput({
8653
+ data
8654
+ }) {
8655
+ const { t } = useChatkitTranslation();
8656
+ const sources = getWebSearchSources(data);
8657
+ if (sources.length === 0 || data.error !== void 0) return null;
8658
+ return /* @__PURE__ */ jsxs20("div", { className: "space-y-2", children: [
8659
+ /* @__PURE__ */ jsx32("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.sourcesTitle") }),
8660
+ /* @__PURE__ */ jsx32("div", { className: "space-y-2", children: sources.map((source, index) => {
8661
+ const sourceHost = getSourceHost(source.url);
8662
+ const snippet = source.content ?? source.description;
8663
+ const metaParts = [
8664
+ sourceHost,
8665
+ source.publishedDate,
8666
+ source.author
8667
+ ].filter((item) => Boolean(item));
8668
+ return /* @__PURE__ */ jsxs20(
8669
+ "div",
8670
+ {
8671
+ className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2",
8672
+ children: [
8673
+ metaParts.length > 0 ? /* @__PURE__ */ jsx32("div", { className: "mb-1 truncate text-[11px] text-muted-foreground", children: metaParts.join(" / ") }) : null,
8674
+ /* @__PURE__ */ jsx32(
8675
+ "a",
8676
+ {
8677
+ href: source.url,
8678
+ target: "_blank",
8679
+ rel: "noreferrer",
8680
+ className: "block min-w-0 line-clamp-2 text-sm font-medium leading-5 text-foreground hover:underline",
8681
+ children: source.title
8682
+ }
8683
+ ),
8684
+ snippet ? /* @__PURE__ */ jsx32("p", { className: "mt-1 line-clamp-3 text-xs leading-5 text-muted-foreground", children: snippet }) : null
8685
+ ]
8686
+ },
8687
+ `${source.url}-${index}`
8688
+ );
8689
+ }) })
8690
+ ] });
8691
+ }
8692
+
8693
+ // src/components/thread/messages/component-message-renderers.tsx
8694
+ var COMPONENT_MESSAGE_RENDERERS = [
8695
+ webSearchComponentRenderer
8696
+ ];
8697
+ function getComponentMessageRenderer(content, data) {
8698
+ return COMPONENT_MESSAGE_RENDERERS.find(
8699
+ (renderer) => renderer.match(content, data)
8700
+ ) ?? null;
8701
+ }
8702
+ function getComponentMessagePresentation(content, data) {
8703
+ return getComponentMessageRenderer(content, data)?.presentation ?? null;
8704
+ }
8705
+ function hasComponentMessageRendererDetails(renderer, content, data) {
8706
+ if (!renderer?.renderDetails) return false;
8707
+ return renderer.hasDetails?.(content, data) ?? true;
8708
+ }
8709
+
8710
+ // src/components/thread/messages/tool-component-group.tsx
8711
+ import * as React29 from "react";
8712
+ import {
8713
+ BookOpen,
8714
+ Brain as Brain3,
8715
+ Building2,
8716
+ Check as Check3,
8717
+ CheckCircle2 as CheckCircle23,
8718
+ ChevronRight as ChevronRight7,
7844
8719
  CircleHelp,
7845
8720
  Copy,
7846
8721
  FileText as FileText2,
7847
8722
  Files,
7848
- Loader2 as Loader23,
8723
+ Loader2 as Loader24,
7849
8724
  ListTodo as ListTodo2,
7850
8725
  Network,
7851
8726
  Repeat2,
8727
+ Search as Search2,
7852
8728
  SquareTerminal,
7853
- Wrench,
7854
- XCircle
8729
+ Wrench as Wrench2,
8730
+ XCircle as XCircle2
7855
8731
  } from "lucide-react";
7856
8732
 
7857
8733
  // src/i18n/localized-text.ts
@@ -7904,19 +8780,19 @@ function resolveLocalizedText(value, language) {
7904
8780
  }
7905
8781
 
7906
8782
  // src/components/thread/messages/tool-component-group.tsx
7907
- import { jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
8783
+ import { jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
7908
8784
  var toolStatusConfig = {
7909
8785
  success: {
7910
8786
  iconClass: "border-green-500 text-green-700",
7911
- icon: CheckCircle22
8787
+ icon: CheckCircle23
7912
8788
  },
7913
8789
  fail: {
7914
8790
  iconClass: "border-red-500 text-red-700",
7915
- icon: XCircle
8791
+ icon: XCircle2
7916
8792
  },
7917
8793
  running: {
7918
8794
  iconClass: "border-blue-500 text-blue-700",
7919
- icon: Loader23
8795
+ icon: Loader24
7920
8796
  }
7921
8797
  };
7922
8798
  var TOOL_GROUP_CATEGORY_ORDER = [
@@ -7952,6 +8828,7 @@ var TOOL_GROUP_TOKEN_CATEGORY = {
7952
8828
  tool: "tools",
7953
8829
  tools: "tools"
7954
8830
  };
8831
+ var TOOL_CALL_ROW_TEXT_CLASS = "text-xs leading-5 in-data-[density=compact]:text-[11px] in-data-[density=compact]:leading-4 in-data-[density=spacious]:text-[13px] in-data-[density=spacious]:leading-5";
7955
8832
  var TOOL_CALL_OUTPUT_RENDERERS = {};
7956
8833
  function normalizeStepCategory(category) {
7957
8834
  if (typeof category !== "string" || category.trim() === "") {
@@ -7990,7 +8867,7 @@ function getEffectiveToolStepStatus(data, isThreadRunning) {
7990
8867
  }
7991
8868
  return data.status;
7992
8869
  }
7993
- function formatStepDuration(durationMs) {
8870
+ function formatStepDuration2(durationMs) {
7994
8871
  if (durationMs < 1e3) {
7995
8872
  return `${durationMs}ms`;
7996
8873
  }
@@ -8009,10 +8886,10 @@ function formatStepDuration(durationMs) {
8009
8886
  return `${minutes}m ${seconds}s`;
8010
8887
  }
8011
8888
  function useFrozenTimestamp(shouldFreeze) {
8012
- const [frozenAt, setFrozenAt] = React28.useState(
8889
+ const [frozenAt, setFrozenAt] = React29.useState(
8013
8890
  () => shouldFreeze ? Date.now() : null
8014
8891
  );
8015
- React28.useEffect(() => {
8892
+ React29.useEffect(() => {
8016
8893
  if (shouldFreeze) {
8017
8894
  setFrozenAt((current) => current ?? Date.now());
8018
8895
  return;
@@ -8022,12 +8899,12 @@ function useFrozenTimestamp(shouldFreeze) {
8022
8899
  return frozenAt;
8023
8900
  }
8024
8901
  function useToolStepDurationLabel(data, options) {
8025
- const [durationNow, setDurationNow] = React28.useState(() => Date.now());
8902
+ const [durationNow, setDurationNow] = React29.useState(() => Date.now());
8026
8903
  const createdAt = parseStepDate(data.created_date);
8027
8904
  const explicitEndedAt = parseStepDate(data.end_date);
8028
8905
  const status = options?.status ?? data.status;
8029
8906
  const endedAt = explicitEndedAt ?? (status !== "running" ? options?.fallbackEndedAt ?? null : null);
8030
- React28.useEffect(() => {
8907
+ React29.useEffect(() => {
8031
8908
  if (status !== "running" || createdAt === null || endedAt !== null) {
8032
8909
  return;
8033
8910
  }
@@ -8041,43 +8918,47 @@ function useToolStepDurationLabel(data, options) {
8041
8918
  }, [createdAt, endedAt, status]);
8042
8919
  if (createdAt === null) return null;
8043
8920
  const durationMs = Math.max(0, (endedAt ?? durationNow) - createdAt);
8044
- return formatStepDuration(durationMs);
8921
+ return formatStepDuration2(durationMs);
8045
8922
  }
8046
- function isComponentContent(content) {
8923
+ function isComponentContent2(content) {
8047
8924
  return content.type === "component";
8048
8925
  }
8049
- function isTextContent(content) {
8926
+ function isTextContent2(content) {
8050
8927
  return content.type === "text";
8051
8928
  }
8052
- function isReasoningContent(content) {
8929
+ function isReasoningContent2(content) {
8053
8930
  return content.type === "reasoning";
8054
8931
  }
8055
8932
  function isWidgetComponent(content) {
8056
8933
  const data = content.data;
8057
8934
  return data?.type === "Widget" && Array.isArray(data.widgets);
8058
8935
  }
8059
- function isGroupableToolComponent(content) {
8936
+ function isGroupableStepComponent(content) {
8060
8937
  if (!content || typeof content === "string") return false;
8061
- return isComponentContent(content) && !isWidgetComponent(content) && getToolStepData(content).category === "Tool";
8938
+ if (!isComponentContent2(content) || isWidgetComponent(content)) return false;
8939
+ const data = getToolStepData(content);
8940
+ const renderer = getComponentMessageRenderer(content, data);
8941
+ if (renderer) return renderer.presentation === "grouped-step";
8942
+ return data.category === "Tool";
8062
8943
  }
8063
8944
  function isSkippableToolGroupSeparator(content) {
8064
8945
  if (typeof content === "string") return !content.trim();
8065
8946
  if (!content) return true;
8066
- if (isTextContent(content)) {
8947
+ if (isTextContent2(content)) {
8067
8948
  return !content.text?.trim();
8068
8949
  }
8069
- if (isReasoningContent(content)) {
8950
+ if (isReasoningContent2(content)) {
8070
8951
  return !content.text?.trim();
8071
8952
  }
8072
8953
  return false;
8073
8954
  }
8074
- function normalizeToolToken(value) {
8955
+ function normalizeToolToken2(value) {
8075
8956
  if (typeof value !== "string") return null;
8076
8957
  const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
8077
8958
  return normalized || null;
8078
8959
  }
8079
8960
  function classifyToolToken(value) {
8080
- const normalized = normalizeToolToken(
8961
+ const normalized = normalizeToolToken2(
8081
8962
  typeof value === "string" ? value : resolveLocalizedText(value, "en-US")
8082
8963
  );
8083
8964
  if (!normalized) return null;
@@ -8106,15 +8987,6 @@ function getToolGroupCategoryCounts(items) {
8106
8987
  return counts;
8107
8988
  }, {});
8108
8989
  }
8109
- function getEffectiveToolGroupDisplayStatus(items, isThreadRunning) {
8110
- if (items.some((item) => {
8111
- const data = getToolStepData(item);
8112
- return getEffectiveToolStepStatus(data, isThreadRunning) === "fail" || Boolean(data.error);
8113
- })) {
8114
- return "fail";
8115
- }
8116
- return "success";
8117
- }
8118
8990
  function getToolActivityLabel(content, language, statusOverride) {
8119
8991
  const data = getToolStepData(content);
8120
8992
  const status = statusOverride ?? data.status;
@@ -8125,8 +8997,8 @@ function getToolActivityLabel(content, language, statusOverride) {
8125
8997
  if (status === "running") {
8126
8998
  return message ?? title ?? tool ?? type ?? "Tool";
8127
8999
  }
8128
- const titleToken = normalizeToolToken(title);
8129
- const genericTitle = titleToken !== null && [tool, type].map((candidate) => normalizeToolToken(candidate)).some((candidate) => candidate === titleToken);
9000
+ const titleToken = normalizeToolToken2(title);
9001
+ const genericTitle = titleToken !== null && [tool, type].map((candidate) => normalizeToolToken2(candidate)).some((candidate) => candidate === titleToken);
8130
9002
  if (message && (!title || genericTitle)) {
8131
9003
  return message;
8132
9004
  }
@@ -8145,7 +9017,7 @@ function buildToolComponentRenderUnits(content, options) {
8145
9017
  const units = [];
8146
9018
  const pendingTools = [];
8147
9019
  content.forEach((item, index) => {
8148
- if (isGroupableToolComponent(item) && options?.shouldGroupComponent?.(item) !== false) {
9020
+ if (isGroupableStepComponent(item) && options?.shouldGroupComponent?.(item) !== false) {
8149
9021
  pendingTools.push({ item, index });
8150
9022
  return;
8151
9023
  }
@@ -8210,13 +9082,13 @@ function createToolsetAvatarUrl(toolsetId, apiUrl) {
8210
9082
  }
8211
9083
  }
8212
9084
  function shouldUseToolsetAvatar(toolset) {
8213
- const normalized = normalizeToolToken(toolset);
9085
+ const normalized = normalizeToolToken2(toolset);
8214
9086
  return normalized === "mcp" || normalized === "openapi";
8215
9087
  }
8216
9088
  function useToolsetAvatar(toolsetId, enabled, apiUrl) {
8217
9089
  const avatarUrl = enabled ? createToolsetAvatarUrl(toolsetId, apiUrl) : null;
8218
- const [avatar, setAvatar] = React28.useState(null);
8219
- React28.useEffect(() => {
9090
+ const [avatar, setAvatar] = React29.useState(null);
9091
+ React29.useEffect(() => {
8220
9092
  if (!avatarUrl) {
8221
9093
  setAvatar(null);
8222
9094
  return;
@@ -8248,7 +9120,7 @@ function ToolAvatarIcon({
8248
9120
  className
8249
9121
  }) {
8250
9122
  if (avatar.url) {
8251
- return /* @__PURE__ */ jsx31(
9123
+ return /* @__PURE__ */ jsx33(
8252
9124
  "img",
8253
9125
  {
8254
9126
  alt: "",
@@ -8261,7 +9133,7 @@ function ToolAvatarIcon({
8261
9133
  }
8262
9134
  const emoji = unicodeFromUnified2(avatar.emoji?.unified);
8263
9135
  if (emoji) {
8264
- return /* @__PURE__ */ jsx31(
9136
+ return /* @__PURE__ */ jsx33(
8265
9137
  "span",
8266
9138
  {
8267
9139
  "aria-hidden": "true",
@@ -8276,7 +9148,7 @@ function ToolAvatarIcon({
8276
9148
  }
8277
9149
  );
8278
9150
  }
8279
- return /* @__PURE__ */ jsx31(
9151
+ return /* @__PURE__ */ jsx33(
8280
9152
  CircleHelp,
8281
9153
  {
8282
9154
  className,
@@ -8286,7 +9158,7 @@ function ToolAvatarIcon({
8286
9158
  );
8287
9159
  }
8288
9160
  function getKnownToolsetIcon(toolset) {
8289
- const normalized = normalizeToolToken(toolset);
9161
+ const normalized = normalizeToolToken2(toolset);
8290
9162
  if (!normalized) return null;
8291
9163
  switch (normalized) {
8292
9164
  case "project":
@@ -8301,7 +9173,7 @@ function getKnownToolsetIcon(toolset) {
8301
9173
  case "memories":
8302
9174
  return Brain3;
8303
9175
  case "workflow_agent_tool":
8304
- return Wrench;
9176
+ return Wrench2;
8305
9177
  case "workflow_task":
8306
9178
  return Network;
8307
9179
  default:
@@ -8309,7 +9181,7 @@ function getKnownToolsetIcon(toolset) {
8309
9181
  }
8310
9182
  }
8311
9183
  function getStepTypeIcon(type) {
8312
- const normalized = normalizeToolToken(type);
9184
+ const normalized = normalizeToolToken2(type);
8313
9185
  if (!normalized) return null;
8314
9186
  switch (normalized) {
8315
9187
  case "file":
@@ -8318,6 +9190,8 @@ function getStepTypeIcon(type) {
8318
9190
  return Files;
8319
9191
  case "program":
8320
9192
  return SquareTerminal;
9193
+ case "web_search":
9194
+ return Search2;
8321
9195
  case "knowledges":
8322
9196
  return BookOpen;
8323
9197
  default:
@@ -8337,12 +9211,12 @@ function ToolStepIcon({
8337
9211
  apiUrl
8338
9212
  );
8339
9213
  const iconUrl = createToolsetIconUrl(data.toolset, organizationId, apiUrl);
8340
- const [failedIconUrl, setFailedIconUrl] = React28.useState(null);
8341
- React28.useEffect(() => {
9214
+ const [failedIconUrl, setFailedIconUrl] = React29.useState(null);
9215
+ React29.useEffect(() => {
8342
9216
  setFailedIconUrl(null);
8343
9217
  }, [iconUrl]);
8344
9218
  if (avatar) {
8345
- return /* @__PURE__ */ jsx31(
9219
+ return /* @__PURE__ */ jsx33(
8346
9220
  ToolAvatarIcon,
8347
9221
  {
8348
9222
  avatar,
@@ -8352,7 +9226,7 @@ function ToolStepIcon({
8352
9226
  );
8353
9227
  }
8354
9228
  if (iconUrl && failedIconUrl !== iconUrl) {
8355
- return /* @__PURE__ */ jsx31(
9229
+ return /* @__PURE__ */ jsx33(
8356
9230
  "img",
8357
9231
  {
8358
9232
  alt: "",
@@ -8366,7 +9240,7 @@ function ToolStepIcon({
8366
9240
  }
8367
9241
  const TypeIcon = getStepTypeIcon(data.type);
8368
9242
  if (TypeIcon) {
8369
- return /* @__PURE__ */ jsx31(
9243
+ return /* @__PURE__ */ jsx33(
8370
9244
  TypeIcon,
8371
9245
  {
8372
9246
  className,
@@ -8377,7 +9251,7 @@ function ToolStepIcon({
8377
9251
  }
8378
9252
  const ToolsetIcon = getKnownToolsetIcon(data.toolset);
8379
9253
  if (ToolsetIcon) {
8380
- return /* @__PURE__ */ jsx31(
9254
+ return /* @__PURE__ */ jsx33(
8381
9255
  ToolsetIcon,
8382
9256
  {
8383
9257
  className,
@@ -8387,7 +9261,7 @@ function ToolStepIcon({
8387
9261
  );
8388
9262
  }
8389
9263
  if (usesToolsetAvatar) {
8390
- return /* @__PURE__ */ jsx31(
9264
+ return /* @__PURE__ */ jsx33(
8391
9265
  CircleHelp,
8392
9266
  {
8393
9267
  className,
@@ -8396,7 +9270,7 @@ function ToolStepIcon({
8396
9270
  }
8397
9271
  );
8398
9272
  }
8399
- return /* @__PURE__ */ jsx31(
9273
+ return /* @__PURE__ */ jsx33(
8400
9274
  CircleHelp,
8401
9275
  {
8402
9276
  className,
@@ -8407,15 +9281,15 @@ function ToolStepIcon({
8407
9281
  }
8408
9282
  function ToolCallCopyButton({ value }) {
8409
9283
  const { t } = useChatkitTranslation();
8410
- const [isCopied, setIsCopied] = React28.useState(false);
8411
- const resetTimeoutRef = React28.useRef(null);
8412
- const clearResetTimeout = React28.useCallback(() => {
9284
+ const [isCopied, setIsCopied] = React29.useState(false);
9285
+ const resetTimeoutRef = React29.useRef(null);
9286
+ const clearResetTimeout = React29.useCallback(() => {
8413
9287
  if (resetTimeoutRef.current === null) return;
8414
9288
  window.clearTimeout(resetTimeoutRef.current);
8415
9289
  resetTimeoutRef.current = null;
8416
9290
  }, []);
8417
- React28.useEffect(() => clearResetTimeout, [clearResetTimeout]);
8418
- const handleCopy = React28.useCallback(() => {
9291
+ React29.useEffect(() => clearResetTimeout, [clearResetTimeout]);
9292
+ const handleCopy = React29.useCallback(() => {
8419
9293
  if (typeof navigator === "undefined" || !navigator.clipboard) return;
8420
9294
  void navigator.clipboard.writeText(value).then(() => {
8421
9295
  setIsCopied(true);
@@ -8427,7 +9301,7 @@ function ToolCallCopyButton({ value }) {
8427
9301
  }).catch(() => void 0);
8428
9302
  }, [clearResetTimeout, value]);
8429
9303
  const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
8430
- return /* @__PURE__ */ jsx31(
9304
+ return /* @__PURE__ */ jsx33(
8431
9305
  "button",
8432
9306
  {
8433
9307
  type: "button",
@@ -8435,7 +9309,7 @@ function ToolCallCopyButton({ value }) {
8435
9309
  "aria-label": label,
8436
9310
  title: label,
8437
9311
  onClick: handleCopy,
8438
- children: isCopied ? /* @__PURE__ */ jsx31(Check3, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx31(Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
9312
+ children: isCopied ? /* @__PURE__ */ jsx33(Check3, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx33(Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
8439
9313
  }
8440
9314
  );
8441
9315
  }
@@ -8446,28 +9320,28 @@ function ToolCallValueBlock({
8446
9320
  const { t } = useChatkitTranslation();
8447
9321
  const detected = detectJsonValue(value);
8448
9322
  if (detected.kind === "text") {
8449
- return /* @__PURE__ */ jsxs19("div", { className: "min-w-0 space-y-1", children: [
8450
- /* @__PURE__ */ jsx31("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx31(ToolCallCopyButton, { value: detected.text }) }),
8451
- /* @__PURE__ */ jsx31(PlainTextBlock, { value: detected.text, destructive })
9323
+ return /* @__PURE__ */ jsxs21("div", { className: "min-w-0 space-y-1", children: [
9324
+ /* @__PURE__ */ jsx33("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx33(ToolCallCopyButton, { value: detected.text }) }),
9325
+ /* @__PURE__ */ jsx33(PlainTextBlock, { value: detected.text, destructive })
8452
9326
  ] });
8453
9327
  }
8454
- return /* @__PURE__ */ jsxs19(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
8455
- /* @__PURE__ */ jsxs19("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
8456
- /* @__PURE__ */ jsxs19("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
9328
+ return /* @__PURE__ */ jsxs21(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
9329
+ /* @__PURE__ */ jsxs21("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
9330
+ /* @__PURE__ */ jsxs21("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
8457
9331
  t("message.toolGroup.jsonTitle"),
8458
9332
  " \xB7 ",
8459
9333
  getJsonValueSummary(detected.value)
8460
9334
  ] }),
8461
- /* @__PURE__ */ jsxs19("div", { className: "flex shrink-0 items-center gap-1", children: [
8462
- /* @__PURE__ */ jsx31(ToolCallCopyButton, { value: detected.raw }),
8463
- /* @__PURE__ */ jsxs19(TabsList, { className: "rounded-md p-0.5", children: [
8464
- /* @__PURE__ */ jsx31(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
8465
- /* @__PURE__ */ jsx31(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
9335
+ /* @__PURE__ */ jsxs21("div", { className: "flex shrink-0 items-center gap-1", children: [
9336
+ /* @__PURE__ */ jsx33(ToolCallCopyButton, { value: detected.raw }),
9337
+ /* @__PURE__ */ jsxs21(TabsList, { className: "rounded-md p-0.5", children: [
9338
+ /* @__PURE__ */ jsx33(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
9339
+ /* @__PURE__ */ jsx33(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
8466
9340
  ] })
8467
9341
  ] })
8468
9342
  ] }),
8469
- /* @__PURE__ */ jsx31(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ jsx31(JsonTreeView, { value: detected.value }) }),
8470
- /* @__PURE__ */ jsx31(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ jsx31(RawJsonBlock, { raw: detected.raw }) })
9343
+ /* @__PURE__ */ jsx33(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ jsx33(JsonTreeView, { value: detected.value }) }),
9344
+ /* @__PURE__ */ jsx33(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ jsx33(RawJsonBlock, { raw: detected.raw }) })
8471
9345
  ] });
8472
9346
  }
8473
9347
  function DefaultToolCallOutput({ data }) {
@@ -8475,31 +9349,37 @@ function DefaultToolCallOutput({ data }) {
8475
9349
  const output = data.output ?? null;
8476
9350
  const error = data.error ?? null;
8477
9351
  if (error) {
8478
- return /* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
8479
- /* @__PURE__ */ jsx31("div", { className: "text-[11px] font-medium text-destructive", children: t("message.toolGroup.errorTitle") }),
8480
- /* @__PURE__ */ jsx31(ToolCallValueBlock, { value: error, destructive: true })
9352
+ return /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
9353
+ /* @__PURE__ */ jsx33("div", { className: "text-[11px] font-medium text-destructive", children: t("message.toolGroup.errorTitle") }),
9354
+ /* @__PURE__ */ jsx33(ToolCallValueBlock, { value: error, destructive: true })
8481
9355
  ] });
8482
9356
  }
8483
9357
  if (output === null) return null;
8484
- return /* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
8485
- /* @__PURE__ */ jsx31("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.outputTitle") }),
8486
- /* @__PURE__ */ jsx31(ToolCallValueBlock, { value: output })
9358
+ return /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
9359
+ /* @__PURE__ */ jsx33("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.outputTitle") }),
9360
+ /* @__PURE__ */ jsx33(ToolCallValueBlock, { value: output })
8487
9361
  ] });
8488
9362
  }
8489
9363
  function ToolCallDetails({ content }) {
8490
9364
  const { t } = useChatkitTranslation();
8491
9365
  const data = getToolStepData(content);
9366
+ const renderer = getComponentMessageRenderer(content, data);
9367
+ const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
9368
+ const CustomDetailsRenderer = hasCustomDetails ? renderer?.renderDetails : void 0;
9369
+ if (CustomDetailsRenderer) {
9370
+ return /* @__PURE__ */ jsx33("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 text-xs text-muted-foreground", children: /* @__PURE__ */ jsx33(CustomDetailsRenderer, { content, data }) });
9371
+ }
8492
9372
  const OutputRenderer = getToolCallOutputRenderer(data);
8493
9373
  const hasInput = data.input !== void 0 && data.input !== null;
8494
9374
  const hasOutput = data.error !== void 0 || data.output !== void 0;
8495
9375
  if (!hasInput && !hasOutput) return null;
8496
- return /* @__PURE__ */ jsxs19("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 px-3 py-2 text-xs text-muted-foreground", children: [
8497
- hasInput && /* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
8498
- /* @__PURE__ */ jsx31("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.inputTitle") }),
8499
- /* @__PURE__ */ jsx31(ToolCallValueBlock, { value: data.input })
9376
+ return /* @__PURE__ */ jsxs21("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 px-3 py-2 text-xs text-muted-foreground", children: [
9377
+ hasInput && /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
9378
+ /* @__PURE__ */ jsx33("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.inputTitle") }),
9379
+ /* @__PURE__ */ jsx33(ToolCallValueBlock, { value: data.input })
8500
9380
  ] }),
8501
- hasInput && hasOutput ? /* @__PURE__ */ jsx31("div", { className: "h-2" }) : null,
8502
- hasOutput ? /* @__PURE__ */ jsx31(OutputRenderer, { content, data }) : null
9381
+ hasInput && hasOutput ? /* @__PURE__ */ jsx33("div", { className: "h-2" }) : null,
9382
+ hasOutput ? /* @__PURE__ */ jsx33(OutputRenderer, { content, data }) : null
8503
9383
  ] });
8504
9384
  }
8505
9385
  function areToolCallRowPropsEqual(previous, next) {
@@ -8514,12 +9394,12 @@ function ToolCallRowContent({
8514
9394
  const { i18n: i18n2 } = useChatkitTranslation();
8515
9395
  const data = getToolStepData(content);
8516
9396
  const status = getEffectiveToolStepStatus(data, isThreadRunning);
8517
- const itemConfig = status ? toolStatusConfig[status] : null;
8518
- const ItemStatusIcon = itemConfig?.icon;
8519
9397
  const hasError = status === "fail" || Boolean(data.error);
8520
9398
  const label = getToolActivityLabel(content, i18n2.language, status);
8521
- const detailsId = React28.useId();
8522
- const hasDetails = data.input !== void 0 || data.error !== void 0 || data.output !== void 0;
9399
+ const detailsId = React29.useId();
9400
+ const renderer = getComponentMessageRenderer(content, data);
9401
+ const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
9402
+ const hasDetails = data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || hasCustomDetails;
8523
9403
  const fallbackEndedAt = useFrozenTimestamp(
8524
9404
  data.status === "running" && status === "fail"
8525
9405
  );
@@ -8527,19 +9407,20 @@ function ToolCallRowContent({
8527
9407
  status,
8528
9408
  fallbackEndedAt
8529
9409
  });
8530
- const [isExpanded, setIsExpanded] = React28.useState(false);
8531
- React28.useEffect(() => {
9410
+ const [isExpanded, setIsExpanded] = React29.useState(false);
9411
+ React29.useEffect(() => {
8532
9412
  if (status === "running" && data.output !== void 0) {
8533
9413
  setIsExpanded(true);
8534
9414
  }
8535
9415
  }, [data.output, status]);
8536
- return /* @__PURE__ */ jsxs19("li", { className: "min-w-0", children: [
8537
- /* @__PURE__ */ jsxs19(
9416
+ return /* @__PURE__ */ jsxs21("li", { className: "min-w-0", children: [
9417
+ /* @__PURE__ */ jsxs21(
8538
9418
  "button",
8539
9419
  {
8540
9420
  type: "button",
8541
9421
  className: cn(
8542
- "group/tool-call flex w-full min-w-0 items-center gap-2 text-left text-sm leading-6 text-muted-foreground",
9422
+ "group/tool-call flex w-full min-w-0 items-center gap-2 text-left text-muted-foreground",
9423
+ TOOL_CALL_ROW_TEXT_CLASS,
8543
9424
  hasDetails && "cursor-pointer hover:text-foreground",
8544
9425
  hasError && "text-destructive hover:text-destructive"
8545
9426
  ),
@@ -8550,16 +9431,7 @@ function ToolCallRowContent({
8550
9431
  if (hasDetails) setIsExpanded((prev) => !prev);
8551
9432
  },
8552
9433
  children: [
8553
- status === "running" && ItemStatusIcon ? /* @__PURE__ */ jsx31(
8554
- ItemStatusIcon,
8555
- {
8556
- className: cn(
8557
- "h-3.5 w-3.5 shrink-0",
8558
- itemConfig?.iconClass,
8559
- "animate-spin"
8560
- )
8561
- }
8562
- ) : status ? /* @__PURE__ */ jsx31(
9434
+ status ? /* @__PURE__ */ jsx33(
8563
9435
  ToolStepIcon,
8564
9436
  {
8565
9437
  data,
@@ -8570,11 +9442,21 @@ function ToolCallRowContent({
8570
9442
  hasError ? "text-destructive" : "text-muted-foreground"
8571
9443
  )
8572
9444
  }
8573
- ) : /* @__PURE__ */ jsx31("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
8574
- /* @__PURE__ */ jsx31("span", { className: "min-w-0 truncate", title: label, children: label }),
8575
- durationLabel ? /* @__PURE__ */ jsx31("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground/80", children: durationLabel }) : null,
8576
- hasDetails ? /* @__PURE__ */ jsx31(
8577
- ChevronRight6,
9445
+ ) : /* @__PURE__ */ jsx33("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
9446
+ /* @__PURE__ */ jsx33(
9447
+ "span",
9448
+ {
9449
+ className: cn(
9450
+ "min-w-0 truncate",
9451
+ status === "running" && "ck-tool-call-running-text"
9452
+ ),
9453
+ title: label,
9454
+ children: label
9455
+ }
9456
+ ),
9457
+ durationLabel ? /* @__PURE__ */ jsx33("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground/80", children: durationLabel }) : null,
9458
+ hasDetails ? /* @__PURE__ */ jsx33(
9459
+ ChevronRight7,
8578
9460
  {
8579
9461
  "aria-hidden": "true",
8580
9462
  className: cn(
@@ -8586,10 +9468,10 @@ function ToolCallRowContent({
8586
9468
  ]
8587
9469
  }
8588
9470
  ),
8589
- hasDetails && isExpanded ? /* @__PURE__ */ jsx31("div", { id: detailsId, children: /* @__PURE__ */ jsx31(ToolCallDetails, { content }) }) : null
9471
+ hasDetails && isExpanded ? /* @__PURE__ */ jsx33("div", { id: detailsId, children: /* @__PURE__ */ jsx33(ToolCallDetails, { content }) }) : null
8590
9472
  ] });
8591
9473
  }
8592
- var ToolCallRow = React28.memo(ToolCallRowContent, areToolCallRowPropsEqual);
9474
+ var ToolCallRow = React29.memo(ToolCallRowContent, areToolCallRowPropsEqual);
8593
9475
  ToolCallRow.displayName = "ToolCallRow";
8594
9476
  function ToolComponentGroup({
8595
9477
  items,
@@ -8599,9 +9481,8 @@ function ToolComponentGroup({
8599
9481
  apiUrl
8600
9482
  }) {
8601
9483
  const { t } = useChatkitTranslation();
8602
- const contentId = React28.useId();
8603
- const groupStatus = getEffectiveToolGroupDisplayStatus(items, isThreadRunning);
8604
- const [isExpanded, setIsExpanded] = React28.useState(!hasFollowingItem);
9484
+ const contentId = React29.useId();
9485
+ const [isExpanded, setIsExpanded] = React29.useState(!hasFollowingItem);
8605
9486
  const categoryCounts = getToolGroupCategoryCounts(items);
8606
9487
  const categorySummary = TOOL_GROUP_CATEGORY_ORDER.flatMap((category) => {
8607
9488
  const count = categoryCounts[category] ?? 0;
@@ -8613,14 +9494,14 @@ function ToolComponentGroup({
8613
9494
  )
8614
9495
  ];
8615
9496
  }).join(t("message.toolGroup.separator"));
8616
- const summary = `${t(`message.toolGroup.status.${groupStatus}`)} ${categorySummary}`;
8617
- const config = toolStatusConfig[groupStatus];
9497
+ const summary = `${t("message.toolGroup.status.success")} ${categorySummary}`;
9498
+ const config = toolStatusConfig.success;
8618
9499
  const StatusIcon = config.icon;
8619
- React28.useEffect(() => {
9500
+ React29.useEffect(() => {
8620
9501
  setIsExpanded(!hasFollowingItem);
8621
9502
  }, [hasFollowingItem, items.length]);
8622
- return /* @__PURE__ */ jsxs19("div", { className: "px-1 py-1", children: [
8623
- /* @__PURE__ */ jsxs19(
9503
+ return /* @__PURE__ */ jsxs21("div", { className: "px-1 py-1", children: [
9504
+ /* @__PURE__ */ jsxs21(
8624
9505
  "button",
8625
9506
  {
8626
9507
  type: "button",
@@ -8629,8 +9510,8 @@ function ToolComponentGroup({
8629
9510
  "aria-controls": contentId,
8630
9511
  onClick: () => setIsExpanded((prev) => !prev),
8631
9512
  children: [
8632
- /* @__PURE__ */ jsxs19("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-muted-foreground", children: [
8633
- /* @__PURE__ */ jsx31(
9513
+ /* @__PURE__ */ jsxs21("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-muted-foreground", children: [
9514
+ /* @__PURE__ */ jsx33(
8634
9515
  StatusIcon,
8635
9516
  {
8636
9517
  className: cn(
@@ -8639,10 +9520,10 @@ function ToolComponentGroup({
8639
9520
  )
8640
9521
  }
8641
9522
  ),
8642
- /* @__PURE__ */ jsx31("span", { className: "truncate", children: summary })
9523
+ /* @__PURE__ */ jsx33("span", { className: "truncate", children: summary })
8643
9524
  ] }),
8644
- /* @__PURE__ */ jsx31(
8645
- ChevronRight6,
9525
+ /* @__PURE__ */ jsx33(
9526
+ ChevronRight7,
8646
9527
  {
8647
9528
  "aria-hidden": "true",
8648
9529
  className: cn(
@@ -8654,7 +9535,7 @@ function ToolComponentGroup({
8654
9535
  ]
8655
9536
  }
8656
9537
  ),
8657
- isExpanded && /* @__PURE__ */ jsx31("ul", { id: contentId, className: "mt-2 space-y-1.5 overflow-y-auto pr-1", children: items.map((item, index) => /* @__PURE__ */ jsx31(
9538
+ isExpanded && /* @__PURE__ */ jsx33("ul", { id: contentId, className: "mt-2 space-y-1.5 overflow-y-auto pr-1", children: items.map((item, index) => /* @__PURE__ */ jsx33(
8658
9539
  ToolCallRow,
8659
9540
  {
8660
9541
  content: item,
@@ -8673,8 +9554,8 @@ import {
8673
9554
  REQUEST_USER_INPUT_RESULT_TYPE as REQUEST_USER_INPUT_RESULT_TYPE2,
8674
9555
  REQUEST_USER_INPUT_TOOL_NAME as REQUEST_USER_INPUT_TOOL_NAME2
8675
9556
  } from "@xpert-ai/chatkit-types";
8676
- import { CheckCircle2 as CheckCircle23 } from "lucide-react";
8677
- import { jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
9557
+ import { CheckCircle2 as CheckCircle24 } from "lucide-react";
9558
+ import { jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
8678
9559
  function isRecord2(value) {
8679
9560
  return !!value && typeof value === "object" && !Array.isArray(value);
8680
9561
  }
@@ -8786,7 +9667,7 @@ function RequestUserInputResultCard({
8786
9667
  className
8787
9668
  }) {
8788
9669
  const { t } = useChatkitTranslation();
8789
- return /* @__PURE__ */ jsxs20(
9670
+ return /* @__PURE__ */ jsxs22(
8790
9671
  "section",
8791
9672
  {
8792
9673
  "aria-label": t("message.requestUserInputResult.title"),
@@ -8795,23 +9676,23 @@ function RequestUserInputResultCard({
8795
9676
  className
8796
9677
  ),
8797
9678
  children: [
8798
- /* @__PURE__ */ jsxs20("div", { className: "mb-2 flex items-center gap-2 text-sm font-semibold text-foreground", children: [
8799
- /* @__PURE__ */ jsx32(CheckCircle23, { className: "h-4 w-4 text-primary" }),
8800
- /* @__PURE__ */ jsx32("span", { children: t("message.requestUserInputResult.title") })
9679
+ /* @__PURE__ */ jsxs22("div", { className: "mb-2 flex items-center gap-2 text-sm font-semibold text-foreground", children: [
9680
+ /* @__PURE__ */ jsx34(CheckCircle24, { className: "h-4 w-4 text-primary" }),
9681
+ /* @__PURE__ */ jsx34("span", { children: t("message.requestUserInputResult.title") })
8801
9682
  ] }),
8802
- /* @__PURE__ */ jsx32("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ jsxs20(
9683
+ /* @__PURE__ */ jsx34("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ jsxs22(
8803
9684
  "div",
8804
9685
  {
8805
9686
  className: "rounded-md bg-background/70 px-2.5 py-2",
8806
9687
  children: [
8807
- /* @__PURE__ */ jsx32("div", { className: "text-xs font-medium leading-5 text-muted-foreground", children: answer.question }),
8808
- /* @__PURE__ */ jsxs20("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5", children: [
8809
- /* @__PURE__ */ jsx32("span", { className: "min-w-0 wrap-break-word text-sm font-semibold text-foreground", children: answer.label ?? answer.value }),
8810
- /* @__PURE__ */ jsx32("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: t(
9688
+ /* @__PURE__ */ jsx34("div", { className: "text-xs font-medium leading-5 text-muted-foreground", children: answer.question }),
9689
+ /* @__PURE__ */ jsxs22("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5", children: [
9690
+ /* @__PURE__ */ jsx34("span", { className: "min-w-0 wrap-break-word text-sm font-semibold text-foreground", children: answer.label ?? answer.value }),
9691
+ /* @__PURE__ */ jsx34("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: t(
8811
9692
  answer.type === "other" ? "message.requestUserInputResult.other" : "message.requestUserInputResult.option"
8812
9693
  ) })
8813
9694
  ] }),
8814
- answer.description ? /* @__PURE__ */ jsx32("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
9695
+ answer.description ? /* @__PURE__ */ jsx34("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
8815
9696
  ]
8816
9697
  },
8817
9698
  `${answer.id}-${index}`
@@ -8823,18 +9704,18 @@ function RequestUserInputResultCard({
8823
9704
 
8824
9705
  // src/components/thread/messages/widget.tsx
8825
9706
  import { SurfaceRenderer } from "@xpert-ai/a2ui-react";
8826
- import { jsx as jsx33 } from "react/jsx-runtime";
9707
+ import { jsx as jsx35 } from "react/jsx-runtime";
8827
9708
  function WidgetMessage({ messageId, data }) {
8828
9709
  const widgets = Array.isArray(data.widgets) ? data.widgets : [];
8829
9710
  if (widgets.length === 0) return null;
8830
9711
  const baseSurfaceId = `widget-${messageId}`;
8831
- return /* @__PURE__ */ jsx33("div", { className: "space-y-3", children: widgets.map((widget, index) => {
9712
+ return /* @__PURE__ */ jsx35("div", { className: "space-y-3", children: widgets.map((widget, index) => {
8832
9713
  const config = widget?.config;
8833
9714
  if (!config || typeof config !== "object") {
8834
9715
  return null;
8835
9716
  }
8836
9717
  const surfaceId = widgets.length > 1 ? `${baseSurfaceId}-${index}` : baseSurfaceId;
8837
- return /* @__PURE__ */ jsx33(
9718
+ return /* @__PURE__ */ jsx35(
8838
9719
  SurfaceRenderer,
8839
9720
  {
8840
9721
  surfaceId,
@@ -8846,17 +9727,18 @@ function WidgetMessage({ messageId, data }) {
8846
9727
  }
8847
9728
 
8848
9729
  // src/components/thread/messages/ai.tsx
8849
- import { jsx as jsx34, jsxs as jsxs21 } from "react/jsx-runtime";
8850
- function isTextContent2(content) {
9730
+ import { jsx as jsx36, jsxs as jsxs23 } from "react/jsx-runtime";
9731
+ var assistantMessageStackClassName = "space-y-3 in-data-[density=compact]:space-y-2 in-data-[density=spacious]:space-y-4";
9732
+ function isTextContent3(content) {
8851
9733
  return content.type === "text";
8852
9734
  }
8853
- function isReasoningContent2(content) {
9735
+ function isReasoningContent3(content) {
8854
9736
  return content.type === "reasoning";
8855
9737
  }
8856
9738
  function isImageContent(content) {
8857
9739
  return content.type === "image_url";
8858
9740
  }
8859
- function isComponentContent2(content) {
9741
+ function isComponentContent3(content) {
8860
9742
  return content.type === "component";
8861
9743
  }
8862
9744
  function isWidgetComponent2(content) {
@@ -8866,24 +9748,24 @@ function isWidgetComponent2(content) {
8866
9748
  function isMemoryContent(content) {
8867
9749
  return content.type === "memory";
8868
9750
  }
8869
- function safeJson2(value) {
9751
+ function safeJson3(value) {
8870
9752
  try {
8871
9753
  return JSON.stringify(value, null, 2);
8872
9754
  } catch {
8873
9755
  return String(value);
8874
9756
  }
8875
9757
  }
8876
- function formatDisplayValue2(value) {
8877
- return typeof value === "string" ? value : safeJson2(value);
9758
+ function formatDisplayValue3(value) {
9759
+ return typeof value === "string" ? value : safeJson3(value);
8878
9760
  }
8879
9761
  function ReasoningBlock({ reasoning }) {
8880
9762
  const blocks = reasoning.filter((item) => item.text?.trim());
8881
9763
  if (blocks.length === 0) return null;
8882
- return /* @__PURE__ */ jsx34("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ jsx34(
9764
+ return /* @__PURE__ */ jsx36("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ jsx36(
8883
9765
  "div",
8884
9766
  {
8885
9767
  className: "rounded-lg border bg-muted/40 p-3 text-xs text-muted-foreground",
8886
- children: /* @__PURE__ */ jsx34("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
9768
+ children: /* @__PURE__ */ jsx36("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
8887
9769
  },
8888
9770
  item.id ?? `reasoning-${index}`
8889
9771
  )) });
@@ -8891,20 +9773,20 @@ function ReasoningBlock({ reasoning }) {
8891
9773
  function ImageBlock({ content }) {
8892
9774
  const imageUrl = typeof content.image_url === "string" ? content.image_url : typeof content.image_url?.url === "string" ? content.image_url.url : null;
8893
9775
  if (!imageUrl) {
8894
- return /* @__PURE__ */ jsxs21(Card, { children: [
8895
- /* @__PURE__ */ jsx34(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ jsx34(CardTitle, { className: "text-sm", children: "Image" }) }),
8896
- /* @__PURE__ */ jsx34(CardContent, { className: "text-xs text-muted-foreground", children: safeJson2(content) })
9776
+ return /* @__PURE__ */ jsxs23(Card, { children: [
9777
+ /* @__PURE__ */ jsx36(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ jsx36(CardTitle, { className: "text-sm", children: "Image" }) }),
9778
+ /* @__PURE__ */ jsx36(CardContent, { className: "text-xs text-muted-foreground", children: safeJson3(content) })
8897
9779
  ] });
8898
9780
  }
8899
- return /* @__PURE__ */ jsx34("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ jsx34("img", { src: imageUrl, alt: "Assistant output", className: "h-auto w-full object-cover" }) });
9781
+ return /* @__PURE__ */ jsx36("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ jsx36("img", { src: imageUrl, alt: "Assistant output", className: "h-auto w-full object-cover" }) });
8900
9782
  }
8901
9783
  function MemoryBlock({ content }) {
8902
- return /* @__PURE__ */ jsxs21(Card, { children: [
8903
- /* @__PURE__ */ jsxs21(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
8904
- /* @__PURE__ */ jsx34(CardTitle, { className: "text-sm", children: "Memory" }),
8905
- /* @__PURE__ */ jsx34(Badge, { variant: "secondary", children: "Memory" })
9784
+ return /* @__PURE__ */ jsxs23(Card, { children: [
9785
+ /* @__PURE__ */ jsxs23(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
9786
+ /* @__PURE__ */ jsx36(CardTitle, { className: "text-sm", children: "Memory" }),
9787
+ /* @__PURE__ */ jsx36(Badge, { variant: "secondary", children: "Memory" })
8906
9788
  ] }),
8907
- /* @__PURE__ */ jsx34(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx34("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson2(content.data ?? []) }) })
9789
+ /* @__PURE__ */ jsx36(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx36("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson3(content.data ?? []) }) })
8908
9790
  ] });
8909
9791
  }
8910
9792
  function parseStepDate2(value) {
@@ -8918,7 +9800,7 @@ function parseStepDate2(value) {
8918
9800
  const timestamp = Date.parse(value);
8919
9801
  return Number.isNaN(timestamp) ? null : timestamp;
8920
9802
  }
8921
- function formatStepDuration2(durationMs) {
9803
+ function formatStepDuration3(durationMs) {
8922
9804
  if (durationMs < 1e3) {
8923
9805
  return `${durationMs}ms`;
8924
9806
  }
@@ -8938,11 +9820,11 @@ function formatStepDuration2(durationMs) {
8938
9820
  }
8939
9821
  function ComponentBlock({ content }) {
8940
9822
  const { i18n: i18n2 } = useChatkitTranslation();
8941
- const [isExpanded, setIsExpanded] = React30.useState(false);
8942
- const contentRef = React30.useRef(null);
8943
- const shouldAutoScrollRef = React30.useRef(true);
8944
- const previousScrollTopRef = React30.useRef(0);
8945
- const [durationNow, setDurationNow] = React30.useState(() => Date.now());
9823
+ const [isExpanded, setIsExpanded] = React31.useState(false);
9824
+ const contentRef = React31.useRef(null);
9825
+ const shouldAutoScrollRef = React31.useRef(true);
9826
+ const previousScrollTopRef = React31.useRef(0);
9827
+ const [durationNow, setDurationNow] = React31.useState(() => Date.now());
8946
9828
  const data = getToolStepData(content);
8947
9829
  const category = data.category ?? "Component";
8948
9830
  const title = getToolActivityLabel(content, i18n2.language);
@@ -8955,11 +9837,11 @@ function ComponentBlock({ content }) {
8955
9837
  const createdAt = parseStepDate2(data.created_date);
8956
9838
  const endedAt = parseStepDate2(data.end_date);
8957
9839
  const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
8958
- const durationLabel = durationMs === null ? null : formatStepDuration2(durationMs);
8959
- React30.useEffect(() => {
9840
+ const durationLabel = durationMs === null ? null : formatStepDuration3(durationMs);
9841
+ React31.useEffect(() => {
8960
9842
  if (status === "running" && output !== null) setIsExpanded(true);
8961
9843
  }, [status, output]);
8962
- React30.useEffect(() => {
9844
+ React31.useEffect(() => {
8963
9845
  if (status !== "running" || createdAt === null || endedAt !== null) {
8964
9846
  return;
8965
9847
  }
@@ -8971,7 +9853,7 @@ function ComponentBlock({ content }) {
8971
9853
  window.clearInterval(timer);
8972
9854
  };
8973
9855
  }, [createdAt, endedAt, status]);
8974
- React30.useEffect(() => {
9856
+ React31.useEffect(() => {
8975
9857
  const element = contentRef.current;
8976
9858
  if (!element) return;
8977
9859
  previousScrollTopRef.current = element.scrollTop;
@@ -8991,7 +9873,7 @@ function ComponentBlock({ content }) {
8991
9873
  element.removeEventListener("scroll", updateAutoScrollState);
8992
9874
  };
8993
9875
  }, [isExpanded]);
8994
- React30.useEffect(() => {
9876
+ React31.useEffect(() => {
8995
9877
  if (status !== "running") {
8996
9878
  shouldAutoScrollRef.current = true;
8997
9879
  return;
@@ -9004,24 +9886,24 @@ function ComponentBlock({ content }) {
9004
9886
  }, [isExpanded, output, status]);
9005
9887
  const config = status ? toolStatusConfig[status] : null;
9006
9888
  const StatusIcon = config?.icon;
9007
- return /* @__PURE__ */ jsxs21(Card, { children: [
9008
- /* @__PURE__ */ jsxs21(CardHeader, { className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer", onClick: () => setIsExpanded(!isExpanded), children: [
9009
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
9010
- status && StatusIcon && /* @__PURE__ */ jsx34(StatusIcon, { className: cn("h-4 w-4", config?.iconClass, status === "running" && "animate-spin") }),
9011
- /* @__PURE__ */ jsx34(CardTitle, { className: "text-sm truncate", children: title })
9889
+ return /* @__PURE__ */ jsxs23(Card, { children: [
9890
+ /* @__PURE__ */ jsxs23(CardHeader, { className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer", onClick: () => setIsExpanded(!isExpanded), children: [
9891
+ /* @__PURE__ */ jsxs23("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
9892
+ status && StatusIcon && /* @__PURE__ */ jsx36(StatusIcon, { className: cn("h-4 w-4", config?.iconClass, status === "running" && "animate-spin") }),
9893
+ /* @__PURE__ */ jsx36(CardTitle, { className: "text-sm truncate", children: title })
9012
9894
  ] }),
9013
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
9014
- durationLabel && /* @__PURE__ */ jsxs21("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
9015
- /* @__PURE__ */ jsx34(Clock3, { className: "h-3 w-3" }),
9016
- /* @__PURE__ */ jsx34("span", { children: durationLabel })
9895
+ /* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
9896
+ durationLabel && /* @__PURE__ */ jsxs23("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
9897
+ /* @__PURE__ */ jsx36(Clock32, { className: "h-3 w-3" }),
9898
+ /* @__PURE__ */ jsx36("span", { children: durationLabel })
9017
9899
  ] }),
9018
- /* @__PURE__ */ jsx34(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
9019
- /* @__PURE__ */ jsx34(
9900
+ /* @__PURE__ */ jsx36(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
9901
+ /* @__PURE__ */ jsx36(
9020
9902
  "button",
9021
9903
  {
9022
9904
  className: "text-muted-foreground hover:text-foreground transition-colors",
9023
9905
  "aria-label": isExpanded ? "Collapse" : "Expand",
9024
- children: /* @__PURE__ */ jsx34(
9906
+ children: /* @__PURE__ */ jsx36(
9025
9907
  ChevronDown4,
9026
9908
  {
9027
9909
  className: cn("h-4 w-4 transition-transform", isExpanded && "rotate-180")
@@ -9031,61 +9913,82 @@ function ComponentBlock({ content }) {
9031
9913
  )
9032
9914
  ] })
9033
9915
  ] }),
9034
- isExpanded && /* @__PURE__ */ jsxs21(CardContent, { ref: contentRef, className: "text-xs text-muted-foreground max-h-60 overflow-auto", children: [
9035
- data.input && /* @__PURE__ */ jsx34("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue2(data.input) }),
9036
- error ? /* @__PURE__ */ jsx34("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue2(error) }) : hasOutput && /* @__PURE__ */ jsx34("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue2(fallback) })
9916
+ isExpanded && /* @__PURE__ */ jsxs23(CardContent, { ref: contentRef, className: "text-xs text-muted-foreground max-h-60 overflow-auto", children: [
9917
+ data.input && /* @__PURE__ */ jsx36("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(data.input) }),
9918
+ error ? /* @__PURE__ */ jsx36("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue3(error) }) : hasOutput && /* @__PURE__ */ jsx36("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(fallback) })
9037
9919
  ] })
9038
9920
  ] });
9039
9921
  }
9040
9922
  function UnknownBlock({ content }) {
9041
- return /* @__PURE__ */ jsxs21(Card, { children: [
9042
- /* @__PURE__ */ jsxs21(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
9043
- /* @__PURE__ */ jsx34(CardTitle, { className: "text-sm", children: "Assistant Content" }),
9044
- /* @__PURE__ */ jsx34(Badge, { variant: "outline", children: content.type ?? "unknown" })
9923
+ return /* @__PURE__ */ jsxs23(Card, { children: [
9924
+ /* @__PURE__ */ jsxs23(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
9925
+ /* @__PURE__ */ jsx36(CardTitle, { className: "text-sm", children: "Assistant Content" }),
9926
+ /* @__PURE__ */ jsx36(Badge, { variant: "outline", children: content.type ?? "unknown" })
9045
9927
  ] }),
9046
- /* @__PURE__ */ jsx34(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx34("pre", { className: "whitespace-pre-wrap break-words", children: safeJson2(content) }) })
9928
+ /* @__PURE__ */ jsx36(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx36("pre", { className: "whitespace-pre-wrap break-words", children: safeJson3(content) }) })
9047
9929
  ] });
9048
9930
  }
9049
- function renderContentItem(content, index, message, lookupMessages) {
9931
+ function renderContentItem(content, index, message, lookupMessages, options) {
9050
9932
  const messageId = message.id;
9933
+ const textClassName = options?.isAgentOutput ? "text-sm [&_.markdown-content_p]:!leading-6" : void 0;
9051
9934
  if (typeof content === "string") {
9052
- return /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(MarkdownText, { children: content }) }, `text-${index}`);
9935
+ return /* @__PURE__ */ jsx36("div", { className: textClassName, children: /* @__PURE__ */ jsx36(MarkdownText, { children: content }) }, `text-${index}`);
9053
9936
  }
9054
- if (isTextContent2(content)) {
9055
- return /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
9937
+ if (isTextContent3(content)) {
9938
+ return /* @__PURE__ */ jsx36("div", { className: textClassName, children: /* @__PURE__ */ jsx36(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
9056
9939
  }
9057
- if (isReasoningContent2(content)) {
9058
- return /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
9940
+ if (isReasoningContent3(content)) {
9941
+ return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
9059
9942
  }
9060
9943
  if (isImageContent(content)) {
9061
- return /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(ImageBlock, { content }) }, content.id ?? `image-${index}`);
9944
+ return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(ImageBlock, { content }) }, content.id ?? `image-${index}`);
9062
9945
  }
9063
- if (isComponentContent2(content)) {
9946
+ if (isComponentContent3(content)) {
9064
9947
  const requestUserInputResult = getRequestUserInputResultCardData(
9065
9948
  content,
9066
9949
  lookupMessages
9067
9950
  );
9068
9951
  if (requestUserInputResult) {
9069
- return /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
9952
+ return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
9070
9953
  }
9071
9954
  if (isWidgetComponent2(content)) {
9072
- return /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
9955
+ return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
9956
+ }
9957
+ if (getComponentMessagePresentation(content, getToolStepData(content)) === "grouped-step") {
9958
+ return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(
9959
+ ToolComponentGroup,
9960
+ {
9961
+ items: [content],
9962
+ hasFollowingItem: false,
9963
+ isThreadRunning: options?.isThreadRunning,
9964
+ organizationId: options?.organizationId,
9965
+ apiUrl: options?.apiUrl
9966
+ }
9967
+ ) }, content.id ?? `component-group-${index}`);
9073
9968
  }
9074
- return /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
9969
+ return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
9075
9970
  }
9076
9971
  if (isMemoryContent(content)) {
9077
- return /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
9972
+ return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
9973
+ }
9974
+ if (isAgentEventContent(content)) {
9975
+ return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(AgentEventRow, { content }) }, content.id ?? `agent-event-${index}`);
9078
9976
  }
9079
- return /* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
9977
+ return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
9080
9978
  }
9081
9979
  function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, options) {
9082
9980
  if (unit.type === "item") {
9083
- return renderContentItem(unit.item, unit.index, message, lookupMessages);
9981
+ return renderContentItem(unit.item, unit.index, message, lookupMessages, {
9982
+ isThreadRunning: options?.isThreadRunning,
9983
+ organizationId: options?.organizationId,
9984
+ apiUrl: options?.apiUrl,
9985
+ isAgentOutput: options?.isAgentOutput
9986
+ });
9084
9987
  }
9085
- return /* @__PURE__ */ jsx34(
9988
+ return /* @__PURE__ */ jsx36(
9086
9989
  "div",
9087
9990
  {
9088
- children: /* @__PURE__ */ jsx34(
9991
+ children: /* @__PURE__ */ jsx36(
9089
9992
  ToolComponentGroup,
9090
9993
  {
9091
9994
  items: unit.items,
@@ -9099,17 +10002,91 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
9099
10002
  `tool-group-${unit.startIndex}-${unit.items[0]?.id ?? "tool"}-${unit.items.length}`
9100
10003
  );
9101
10004
  }
10005
+ function renderEntryBatch(entries, message, lookupMessages, hasFollowingItem, options) {
10006
+ if (entries.length === 0) return null;
10007
+ const renderUnits = buildToolComponentRenderUnits(
10008
+ entries.map((entry) => entry.item),
10009
+ {
10010
+ shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null
10011
+ }
10012
+ );
10013
+ return renderUnits.map(
10014
+ (unit, index) => renderContentUnit(
10015
+ unit,
10016
+ message,
10017
+ lookupMessages,
10018
+ index < renderUnits.length - 1 || hasFollowingItem,
10019
+ options
10020
+ )
10021
+ );
10022
+ }
10023
+ function renderAssistantRenderUnits(units, message, lookupMessages, options, depth = 0) {
10024
+ const rendered = [];
10025
+ let entryBatch = [];
10026
+ const flushEntries = (hasFollowingItem) => {
10027
+ if (entryBatch.length === 0) return;
10028
+ const batch = entryBatch;
10029
+ entryBatch = [];
10030
+ rendered.push(
10031
+ /* @__PURE__ */ jsx36(React31.Fragment, { children: renderEntryBatch(batch, message, lookupMessages, hasFollowingItem, {
10032
+ ...options,
10033
+ isAgentOutput: depth > 0
10034
+ }) }, `entries-${batch[0]?.order ?? rendered.length}`)
10035
+ );
10036
+ };
10037
+ units.forEach((unit, index) => {
10038
+ const hasFollowingItem = index < units.length - 1;
10039
+ if (unit.type === "entry") {
10040
+ entryBatch.push(unit.entry);
10041
+ if (!hasFollowingItem) {
10042
+ flushEntries(false);
10043
+ }
10044
+ return;
10045
+ }
10046
+ flushEntries(true);
10047
+ rendered.push(
10048
+ /* @__PURE__ */ jsx36(
10049
+ AgentRunGroup,
10050
+ {
10051
+ node: unit.node,
10052
+ hasFollowingItem,
10053
+ depth,
10054
+ renderUnits: (childUnits, nextDepth) => renderAssistantRenderUnits(
10055
+ childUnits,
10056
+ message,
10057
+ lookupMessages,
10058
+ options,
10059
+ nextDepth
10060
+ )
10061
+ },
10062
+ unit.node.id
10063
+ )
10064
+ );
10065
+ });
10066
+ return rendered;
10067
+ }
9102
10068
  function renderContent(message, lookupMessages, options) {
10069
+ const renderTree = buildAssistantRenderTree(
10070
+ message
10071
+ );
10072
+ if (renderTree.hasAgentRuns) {
10073
+ return /* @__PURE__ */ jsx36("div", { className: assistantMessageStackClassName, children: renderAssistantRenderUnits(
10074
+ renderTree.units,
10075
+ message,
10076
+ lookupMessages,
10077
+ options
10078
+ ) });
10079
+ }
9103
10080
  const content = message.content;
9104
10081
  if (typeof content === "string") {
9105
10082
  if (!content.trim()) return null;
9106
- return /* @__PURE__ */ jsx34(MarkdownText, { children: content });
10083
+ return /* @__PURE__ */ jsx36(MarkdownText, { children: content });
9107
10084
  }
9108
10085
  if (!Array.isArray(content) || content.length === 0) return null;
9109
10086
  const renderUnits = buildToolComponentRenderUnits(content, {
9110
10087
  shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null
9111
10088
  });
9112
- return /* @__PURE__ */ jsx34("div", { className: "space-y-3", children: renderUnits.map(
10089
+ return /* @__PURE__ */ jsx36("div", { className: "space-y-3", children: renderUnits.map(
9113
10090
  (unit, index) => renderContentUnit(
9114
10091
  unit,
9115
10092
  message,
@@ -9129,20 +10106,29 @@ function AssistantStreamingIndicator({
9129
10106
  thinking: t("message.thinking"),
9130
10107
  answering: t("message.answering")
9131
10108
  };
9132
- return /* @__PURE__ */ jsxs21("div", { className: cn("flex items-center gap-2 text-xs text-muted-foreground", className), children: [
9133
- status === "loading" && /* @__PURE__ */ jsx34(Loader24, { className: "h-3.5 w-3.5 animate-spin" }),
9134
- status === "thinking" && /* @__PURE__ */ jsxs21("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
9135
- /* @__PURE__ */ jsx34("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
9136
- /* @__PURE__ */ jsx34("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
9137
- /* @__PURE__ */ jsx34("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
9138
- ] }),
9139
- status === "answering" && /* @__PURE__ */ jsxs21("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
9140
- /* @__PURE__ */ jsx34("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
9141
- /* @__PURE__ */ jsx34("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
9142
- /* @__PURE__ */ jsx34("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
9143
- ] }),
9144
- /* @__PURE__ */ jsx34("span", { children: labelMap[status] })
9145
- ] });
10109
+ return /* @__PURE__ */ jsxs23(
10110
+ "div",
10111
+ {
10112
+ className: cn(
10113
+ "flex items-center gap-2 text-xs text-muted-foreground",
10114
+ className
10115
+ ),
10116
+ children: [
10117
+ status === "loading" && /* @__PURE__ */ jsx36(Loader25, { className: "h-3.5 w-3.5 animate-spin" }),
10118
+ status === "thinking" && /* @__PURE__ */ jsxs23("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
10119
+ /* @__PURE__ */ jsx36("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
10120
+ /* @__PURE__ */ jsx36("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
10121
+ /* @__PURE__ */ jsx36("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
10122
+ ] }),
10123
+ status === "answering" && /* @__PURE__ */ jsxs23("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
10124
+ /* @__PURE__ */ jsx36("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
10125
+ /* @__PURE__ */ jsx36("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
10126
+ /* @__PURE__ */ jsx36("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
10127
+ ] }),
10128
+ /* @__PURE__ */ jsx36("span", { children: labelMap[status] })
10129
+ ]
10130
+ }
10131
+ );
9146
10132
  }
9147
10133
  function AssistantMessage({
9148
10134
  message,
@@ -9155,8 +10141,12 @@ function AssistantMessage({
9155
10141
  apiUrl
9156
10142
  }) {
9157
10143
  const { t } = useChatkitTranslation();
9158
- const hasContent = hasRenderableMessageContent(message.content);
9159
- const hasReasoning = hasRenderableReasoning(message.reasoning);
10144
+ const renderTree = buildAssistantRenderTree(
10145
+ message
10146
+ );
10147
+ const rootReasoning = renderTree.hasAgentRuns ? renderTree.rootReasoning : message.reasoning;
10148
+ const hasContent = hasRenderableMessageContent(message.content) || renderTree.hasAgentRuns;
10149
+ const hasReasoning = hasRenderableReasoning(rootReasoning);
9160
10150
  const resolvedStreamingStatus = streamingStatus ?? getAssistantStreamingStatus(message, isStreaming);
9161
10151
  const lookupMessages = messages?.length ? messages : [message];
9162
10152
  const answerNode = renderContent(message, lookupMessages, {
@@ -9164,42 +10154,42 @@ function AssistantMessage({
9164
10154
  organizationId,
9165
10155
  apiUrl
9166
10156
  });
9167
- const reasoningNode = hasReasoning ? /* @__PURE__ */ jsx34(ReasoningBlock, { reasoning: message.reasoning ?? [] }) : null;
9168
- if (!hasRenderableAssistantMessage(message) && !resolvedStreamingStatus) return null;
10157
+ const reasoningNode = hasReasoning ? /* @__PURE__ */ jsx36(ReasoningBlock, { reasoning: rootReasoning ?? [] }) : null;
10158
+ if (!hasContent && !hasReasoning && !resolvedStreamingStatus) return null;
9169
10159
  const streamingClass = isStreaming ? "streaming-active" : "";
9170
- if (!hasRenderableAssistantMessage(message) && resolvedStreamingStatus) {
9171
- return /* @__PURE__ */ jsx34("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ jsx34(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
10160
+ if (!hasContent && !hasReasoning && resolvedStreamingStatus) {
10161
+ return /* @__PURE__ */ jsx36("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ jsx36(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
9172
10162
  }
9173
10163
  if (hasContent && hasReasoning) {
9174
- return /* @__PURE__ */ jsxs21("div", { className: cn("space-y-3", streamingClass, className), children: [
9175
- /* @__PURE__ */ jsxs21(
10164
+ return /* @__PURE__ */ jsxs23("div", { className: cn("space-y-3", streamingClass, className), children: [
10165
+ /* @__PURE__ */ jsxs23(
9176
10166
  Tabs,
9177
10167
  {
9178
10168
  defaultValue: message.status === "reasoning" ? "reasoning" : "answer",
9179
10169
  className: "w-full",
9180
10170
  children: [
9181
- /* @__PURE__ */ jsxs21(TabsList, { className: "", children: [
9182
- /* @__PURE__ */ jsx34(TabsTrigger, { value: "answer", children: t("message.answer") }),
9183
- /* @__PURE__ */ jsx34(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
10171
+ /* @__PURE__ */ jsxs23(TabsList, { className: "", children: [
10172
+ /* @__PURE__ */ jsx36(TabsTrigger, { value: "answer", children: t("message.answer") }),
10173
+ /* @__PURE__ */ jsx36(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
9184
10174
  ] }),
9185
- /* @__PURE__ */ jsx34(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
9186
- /* @__PURE__ */ jsx34(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
10175
+ /* @__PURE__ */ jsx36(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
10176
+ /* @__PURE__ */ jsx36(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
9187
10177
  ]
9188
10178
  }
9189
10179
  ),
9190
- resolvedStreamingStatus ? /* @__PURE__ */ jsx34(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
10180
+ resolvedStreamingStatus ? /* @__PURE__ */ jsx36(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
9191
10181
  ] });
9192
10182
  }
9193
- return /* @__PURE__ */ jsxs21("div", { className: cn("space-y-3", streamingClass, className), children: [
10183
+ return /* @__PURE__ */ jsxs23("div", { className: cn("space-y-3", streamingClass, className), children: [
9194
10184
  hasReasoning ? reasoningNode : answerNode,
9195
- resolvedStreamingStatus ? /* @__PURE__ */ jsx34(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
10185
+ resolvedStreamingStatus ? /* @__PURE__ */ jsx36(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
9196
10186
  ] });
9197
10187
  }
9198
10188
 
9199
10189
  // src/components/thread/MessageActions.tsx
9200
- import * as React31 from "react";
10190
+ import * as React32 from "react";
9201
10191
  import { Check as Check4, Copy as Copy2, RefreshCw } from "lucide-react";
9202
- import { jsx as jsx35, jsxs as jsxs22 } from "react/jsx-runtime";
10192
+ import { jsx as jsx37, jsxs as jsxs24 } from "react/jsx-runtime";
9203
10193
  function MessageActions({
9204
10194
  content,
9205
10195
  isAssistant = false,
@@ -9208,7 +10198,7 @@ function MessageActions({
9208
10198
  className
9209
10199
  }) {
9210
10200
  const { t } = useChatkitTranslation();
9211
- const [copied, setCopied] = React31.useState(false);
10201
+ const [copied, setCopied] = React32.useState(false);
9212
10202
  const handleCopy = async () => {
9213
10203
  try {
9214
10204
  await navigator.clipboard.writeText(content);
@@ -9221,7 +10211,7 @@ function MessageActions({
9221
10211
  if (isStreaming) {
9222
10212
  return null;
9223
10213
  }
9224
- return /* @__PURE__ */ jsxs22(
10214
+ return /* @__PURE__ */ jsxs24(
9225
10215
  "div",
9226
10216
  {
9227
10217
  className: cn(
@@ -9229,7 +10219,7 @@ function MessageActions({
9229
10219
  className
9230
10220
  ),
9231
10221
  children: [
9232
- /* @__PURE__ */ jsx35(
10222
+ /* @__PURE__ */ jsx37(
9233
10223
  "button",
9234
10224
  {
9235
10225
  type: "button",
@@ -9239,17 +10229,17 @@ function MessageActions({
9239
10229
  copied && "text-green-500"
9240
10230
  ),
9241
10231
  title: copied ? t("messageActions.copied") : t("messageActions.copy"),
9242
- children: copied ? /* @__PURE__ */ jsx35(Check4, { size: 14 }) : /* @__PURE__ */ jsx35(Copy2, { size: 14 })
10232
+ children: copied ? /* @__PURE__ */ jsx37(Check4, { size: 14 }) : /* @__PURE__ */ jsx37(Copy2, { size: 14 })
9243
10233
  }
9244
10234
  ),
9245
- isAssistant && onRetry && /* @__PURE__ */ jsx35(
10235
+ isAssistant && onRetry && /* @__PURE__ */ jsx37(
9246
10236
  "button",
9247
10237
  {
9248
10238
  type: "button",
9249
10239
  onClick: onRetry,
9250
10240
  className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
9251
10241
  title: t("messageActions.regenerate"),
9252
- children: /* @__PURE__ */ jsx35(RefreshCw, { size: 14 })
10242
+ children: /* @__PURE__ */ jsx37(RefreshCw, { size: 14 })
9253
10243
  }
9254
10244
  )
9255
10245
  ]
@@ -9266,22 +10256,22 @@ import {
9266
10256
  HelpCircle,
9267
10257
  Lightbulb as Lightbulb2,
9268
10258
  Pencil as Pencil3,
9269
- Search as Search2,
10259
+ Search as Search3,
9270
10260
  Sparkles as Sparkles3,
9271
10261
  Zap
9272
10262
  } from "lucide-react";
9273
- import { jsx as jsx36, jsxs as jsxs23 } from "react/jsx-runtime";
10263
+ import { jsx as jsx38, jsxs as jsxs25 } from "react/jsx-runtime";
9274
10264
  function getIconComponent2(icon) {
9275
10265
  const iconMap = {
9276
- "circle-question": /* @__PURE__ */ jsx36(HelpCircle, { size: 20 }),
9277
- "lightbulb": /* @__PURE__ */ jsx36(Lightbulb2, { size: 20 }),
9278
- "sparkle": /* @__PURE__ */ jsx36(Sparkles3, { size: 20 }),
9279
- "write": /* @__PURE__ */ jsx36(Pencil3, { size: 20 }),
9280
- "search": /* @__PURE__ */ jsx36(Search2, { size: 20 }),
9281
- "globe": /* @__PURE__ */ jsx36(Globe2, { size: 20 }),
9282
- "book-open": /* @__PURE__ */ jsx36(BookOpen2, { size: 20 }),
9283
- "compass": /* @__PURE__ */ jsx36(Compass, { size: 20 }),
9284
- "bolt": /* @__PURE__ */ jsx36(Zap, { size: 20 })
10266
+ "circle-question": /* @__PURE__ */ jsx38(HelpCircle, { size: 20 }),
10267
+ "lightbulb": /* @__PURE__ */ jsx38(Lightbulb2, { size: 20 }),
10268
+ "sparkle": /* @__PURE__ */ jsx38(Sparkles3, { size: 20 }),
10269
+ "write": /* @__PURE__ */ jsx38(Pencil3, { size: 20 }),
10270
+ "search": /* @__PURE__ */ jsx38(Search3, { size: 20 }),
10271
+ "globe": /* @__PURE__ */ jsx38(Globe2, { size: 20 }),
10272
+ "book-open": /* @__PURE__ */ jsx38(BookOpen2, { size: 20 }),
10273
+ "compass": /* @__PURE__ */ jsx38(Compass, { size: 20 }),
10274
+ "bolt": /* @__PURE__ */ jsx38(Zap, { size: 20 })
9285
10275
  };
9286
10276
  return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
9287
10277
  }
@@ -9289,9 +10279,9 @@ function StartScreen({ startScreen, onPromptClick, className }) {
9289
10279
  const { t } = useChatkitTranslation();
9290
10280
  const greeting = startScreen?.greeting ?? t("startScreen.greeting");
9291
10281
  const prompts = startScreen?.prompts ?? [];
9292
- return /* @__PURE__ */ jsxs23("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
9293
- /* @__PURE__ */ jsx36("div", { className: "mb-8 text-center", children: /* @__PURE__ */ jsx36("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
9294
- prompts.length > 0 && /* @__PURE__ */ jsx36("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ jsx36("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ jsxs23(
10282
+ return /* @__PURE__ */ jsxs25("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
10283
+ /* @__PURE__ */ jsx38("div", { className: "mb-8 text-center", children: /* @__PURE__ */ jsx38("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
10284
+ prompts.length > 0 && /* @__PURE__ */ jsx38("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ jsx38("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ jsxs25(
9295
10285
  "button",
9296
10286
  {
9297
10287
  type: "button",
@@ -9302,8 +10292,8 @@ function StartScreen({ startScreen, onPromptClick, className }) {
9302
10292
  "focus:outline-none focus:ring-2 focus:ring-primary/20"
9303
10293
  ),
9304
10294
  children: [
9305
- /* @__PURE__ */ jsx36("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
9306
- /* @__PURE__ */ jsx36("span", { className: "text-sm font-medium text-foreground", children: item.label })
10295
+ /* @__PURE__ */ jsx38("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
10296
+ /* @__PURE__ */ jsx38("span", { className: "text-sm font-medium text-foreground", children: item.label })
9307
10297
  ]
9308
10298
  },
9309
10299
  `prompt-${index}`
@@ -9312,7 +10302,7 @@ function StartScreen({ startScreen, onPromptClick, className }) {
9312
10302
  }
9313
10303
 
9314
10304
  // src/hooks/useThreads.ts
9315
- import * as React33 from "react";
10305
+ import * as React34 from "react";
9316
10306
  var DEFAULT_LIMIT = 50;
9317
10307
  var getThreadTitle = (threadRecord) => {
9318
10308
  const title = threadRecord.title?.trim();
@@ -9365,16 +10355,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
9365
10355
  isLoading: isStreamLoading,
9366
10356
  error: streamError
9367
10357
  } = useStreamContext();
9368
- const [threadRecords, setThreadRecords] = React33.useState([]);
9369
- const [isLoading, setIsLoading] = React33.useState(false);
9370
- const [error, setError] = React33.useState(null);
9371
- const upsertThreadRecord = React33.useCallback((threadRecord) => {
10358
+ const [threadRecords, setThreadRecords] = React34.useState([]);
10359
+ const [isLoading, setIsLoading] = React34.useState(false);
10360
+ const [error, setError] = React34.useState(null);
10361
+ const upsertThreadRecord = React34.useCallback((threadRecord) => {
9372
10362
  setThreadRecords((prev) => {
9373
10363
  const next = prev.filter((item) => item.id !== threadRecord.id);
9374
10364
  return sortThreadRecords([threadRecord, ...next]);
9375
10365
  });
9376
10366
  }, []);
9377
- const refreshThreads = React33.useCallback(async () => {
10367
+ const refreshThreads = React34.useCallback(async () => {
9378
10368
  setIsLoading(true);
9379
10369
  setError(null);
9380
10370
  try {
@@ -9390,7 +10380,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
9390
10380
  setIsLoading(false);
9391
10381
  }
9392
10382
  }, [client, limit, assistantId]);
9393
- const createThread = React33.useCallback(
10383
+ const createThread = React34.useCallback(
9394
10384
  async (input) => {
9395
10385
  setError(null);
9396
10386
  const payload = {};
@@ -9404,7 +10394,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
9404
10394
  },
9405
10395
  [client, upsertThreadRecord]
9406
10396
  );
9407
- const updateThread = React33.useCallback(
10397
+ const updateThread = React34.useCallback(
9408
10398
  async (recordId, payload) => {
9409
10399
  setError(null);
9410
10400
  const updated = await client.conversations.update(recordId, payload);
@@ -9413,7 +10403,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
9413
10403
  },
9414
10404
  [client, upsertThreadRecord]
9415
10405
  );
9416
- const deleteThread = React33.useCallback(
10406
+ const deleteThread = React34.useCallback(
9417
10407
  async (recordId) => {
9418
10408
  setError(null);
9419
10409
  await client.conversations.delete(recordId);
@@ -9421,11 +10411,11 @@ function useThreads(limit = DEFAULT_LIMIT) {
9421
10411
  },
9422
10412
  [client]
9423
10413
  );
9424
- React33.useEffect(() => {
10414
+ React34.useEffect(() => {
9425
10415
  if (!isReady) return;
9426
10416
  void refreshThreads();
9427
10417
  }, [refreshThreads, isReady]);
9428
- React33.useEffect(() => {
10418
+ React34.useEffect(() => {
9429
10419
  if (!threadId || !isStreamLoading) return;
9430
10420
  const now = (/* @__PURE__ */ new Date()).toISOString();
9431
10421
  const busyStatus = "busy";
@@ -9446,7 +10436,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
9446
10436
  return changed ? sortThreadRecords(next) : prev;
9447
10437
  });
9448
10438
  }, [threadId, isStreamLoading]);
9449
- React33.useEffect(() => {
10439
+ React34.useEffect(() => {
9450
10440
  const message = getErrorMessage(streamError)?.trim();
9451
10441
  if (!threadId || !message) return;
9452
10442
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -9468,7 +10458,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
9468
10458
  return changed ? sortThreadRecords(next) : prev;
9469
10459
  });
9470
10460
  }, [threadId, streamError]);
9471
- React33.useEffect(() => {
10461
+ React34.useEffect(() => {
9472
10462
  if (!isReady || !threadId || isStreamLoading) return;
9473
10463
  let cancelled = false;
9474
10464
  void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
@@ -9482,7 +10472,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
9482
10472
  cancelled = true;
9483
10473
  };
9484
10474
  }, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
9485
- const threads = React33.useMemo(
10475
+ const threads = React34.useMemo(
9486
10476
  () => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
9487
10477
  [threadRecords]
9488
10478
  );
@@ -9499,10 +10489,10 @@ function useThreads(limit = DEFAULT_LIMIT) {
9499
10489
  }
9500
10490
 
9501
10491
  // src/components/thread/context-usage-indicator.tsx
9502
- import * as React34 from "react";
10492
+ import * as React35 from "react";
9503
10493
 
9504
10494
  // src/components/ui/progress-circle.tsx
9505
- import { jsx as jsx37, jsxs as jsxs24 } from "react/jsx-runtime";
10495
+ import { jsx as jsx39, jsxs as jsxs26 } from "react/jsx-runtime";
9506
10496
  function clamp2(input, a, b) {
9507
10497
  return Math.max(Math.min(input, Math.max(a, b)), Math.min(a, b));
9508
10498
  }
@@ -9525,7 +10515,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
9525
10515
  return (
9526
10516
  // biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
9527
10517
  // biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
9528
- /* @__PURE__ */ jsxs24(
10518
+ /* @__PURE__ */ jsxs26(
9529
10519
  "svg",
9530
10520
  {
9531
10521
  role: "progressbar",
@@ -9536,8 +10526,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
9536
10526
  "aria-valuemax": 100,
9537
10527
  ...restSvgProps,
9538
10528
  children: [
9539
- /* @__PURE__ */ jsx37("circle", { ...commonParams, className: "stroke-current/25" }),
9540
- /* @__PURE__ */ jsx37(
10529
+ /* @__PURE__ */ jsx39("circle", { ...commonParams, className: "stroke-current/25" }),
10530
+ /* @__PURE__ */ jsx39(
9541
10531
  "circle",
9542
10532
  {
9543
10533
  ...commonParams,
@@ -9556,7 +10546,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
9556
10546
  };
9557
10547
 
9558
10548
  // src/components/thread/context-usage-indicator.tsx
9559
- import { jsx as jsx38, jsxs as jsxs25 } from "react/jsx-runtime";
10549
+ import { jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
9560
10550
  var kNumberFormatter = new Intl.NumberFormat("en-US", {
9561
10551
  minimumFractionDigits: 0,
9562
10552
  maximumFractionDigits: 1
@@ -9589,20 +10579,20 @@ function ContextUsageIndicator({
9589
10579
  }) {
9590
10580
  const { t } = useChatkitTranslation();
9591
10581
  const stream = useStreamContext();
9592
- const [maxContextSize, setMaxContextSize] = React34.useState(null);
9593
- const [usedContextSize, setUsedContextSize] = React34.useState(null);
9594
- const [assistantAgentKey, setAssistantAgentKey] = React34.useState(null);
9595
- const latestRealtimeUsageRef = React34.useRef({
10582
+ const [maxContextSize, setMaxContextSize] = React35.useState(null);
10583
+ const [usedContextSize, setUsedContextSize] = React35.useState(null);
10584
+ const [assistantAgentKey, setAssistantAgentKey] = React35.useState(null);
10585
+ const latestRealtimeUsageRef = React35.useRef({
9596
10586
  threadId: null,
9597
10587
  agentKey: null,
9598
10588
  usedTokens: null
9599
10589
  });
9600
- const realtimeUsage = React34.useMemo(
10590
+ const realtimeUsage = React35.useMemo(
9601
10591
  () => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
9602
10592
  [assistantAgentKey, stream.contextUsageByAgentKey]
9603
10593
  );
9604
10594
  const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
9605
- React34.useEffect(() => {
10595
+ React35.useEffect(() => {
9606
10596
  if (!stream.client || !stream.assistantId) {
9607
10597
  setMaxContextSize(null);
9608
10598
  setAssistantAgentKey(null);
@@ -9622,18 +10612,18 @@ function ContextUsageIndicator({
9622
10612
  cancelled = true;
9623
10613
  };
9624
10614
  }, [stream.client, stream.assistantId]);
9625
- React34.useEffect(() => {
10615
+ React35.useEffect(() => {
9626
10616
  latestRealtimeUsageRef.current = {
9627
10617
  threadId: stream.threadId ?? null,
9628
10618
  agentKey: assistantAgentKey,
9629
10619
  usedTokens: realtimeUsedContextSize
9630
10620
  };
9631
10621
  }, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
9632
- React34.useEffect(() => {
10622
+ React35.useEffect(() => {
9633
10623
  if (realtimeUsedContextSize == null) return;
9634
10624
  setUsedContextSize(realtimeUsedContextSize);
9635
10625
  }, [realtimeUsedContextSize]);
9636
- React34.useEffect(() => {
10626
+ React35.useEffect(() => {
9637
10627
  if (!stream.client) {
9638
10628
  setUsedContextSize(null);
9639
10629
  return;
@@ -9698,8 +10688,8 @@ function ContextUsageIndicator({
9698
10688
  });
9699
10689
  const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
9700
10690
  const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
9701
- return /* @__PURE__ */ jsxs25(Tooltip, { children: [
9702
- /* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(
10691
+ return /* @__PURE__ */ jsxs27(Tooltip, { children: [
10692
+ /* @__PURE__ */ jsx40(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx40(
9703
10693
  "button",
9704
10694
  {
9705
10695
  type: "button",
@@ -9708,31 +10698,31 @@ function ContextUsageIndicator({
9708
10698
  className
9709
10699
  ),
9710
10700
  "aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
9711
- children: /* @__PURE__ */ jsx38(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
10701
+ children: /* @__PURE__ */ jsx40(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
9712
10702
  }
9713
10703
  ) }),
9714
- /* @__PURE__ */ jsxs25(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
9715
- /* @__PURE__ */ jsx38("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
9716
- /* @__PURE__ */ jsx38("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
9717
- /* @__PURE__ */ jsx38("div", { className: "text-sm font-semibold", children: usageTokensLabel })
10704
+ /* @__PURE__ */ jsxs27(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
10705
+ /* @__PURE__ */ jsx40("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
10706
+ /* @__PURE__ */ jsx40("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
10707
+ /* @__PURE__ */ jsx40("div", { className: "text-sm font-semibold", children: usageTokensLabel })
9718
10708
  ] })
9719
10709
  ] });
9720
10710
  }
9721
10711
 
9722
10712
  // src/components/pet/PetBridge.tsx
9723
- import * as React35 from "react";
10713
+ import * as React36 from "react";
9724
10714
  import { normalizePetOptions } from "@xpert-ai/chatkit-types";
9725
10715
  function PetBridge({ pet, state }) {
9726
10716
  const parentMessenger = useParentMessenger();
9727
10717
  const sendEvent = parentMessenger?.sendEvent;
9728
- const options = React35.useMemo(() => normalizePetOptions(pet), [pet]);
9729
- React35.useEffect(() => {
10718
+ const options = React36.useMemo(() => normalizePetOptions(pet), [pet]);
10719
+ React36.useEffect(() => {
9730
10720
  if (!sendEvent) {
9731
10721
  return;
9732
10722
  }
9733
10723
  sendEvent("pet_options_change", { pet: pet ?? null });
9734
10724
  }, [sendEvent, pet]);
9735
- React35.useEffect(() => {
10725
+ React36.useEffect(() => {
9736
10726
  if (!sendEvent || !options) {
9737
10727
  return;
9738
10728
  }
@@ -9742,15 +10732,15 @@ function PetBridge({ pet, state }) {
9742
10732
  }
9743
10733
 
9744
10734
  // src/components/settings/SettingsSheet.tsx
9745
- import * as React42 from "react";
10735
+ import * as React43 from "react";
9746
10736
  import { PawPrint, Settings } from "lucide-react";
9747
10737
 
9748
10738
  // src/components/ui/input.tsx
9749
- import * as React36 from "react";
9750
- import { jsx as jsx39 } from "react/jsx-runtime";
9751
- var Input = React36.forwardRef(
10739
+ import * as React37 from "react";
10740
+ import { jsx as jsx41 } from "react/jsx-runtime";
10741
+ var Input = React37.forwardRef(
9752
10742
  ({ className, type, ...props }, ref) => {
9753
- return /* @__PURE__ */ jsx39(
10743
+ return /* @__PURE__ */ jsx41(
9754
10744
  "input",
9755
10745
  {
9756
10746
  ref,
@@ -9770,17 +10760,17 @@ Input.displayName = "Input";
9770
10760
  import "react";
9771
10761
  import { Select as SelectPrimitive } from "radix-ui";
9772
10762
  import { ChevronDownIcon as ChevronDownIcon2, CheckIcon as CheckIcon4, ChevronUpIcon } from "lucide-react";
9773
- import { jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
10763
+ import { jsx as jsx42, jsxs as jsxs28 } from "react/jsx-runtime";
9774
10764
  function Select({
9775
10765
  ...props
9776
10766
  }) {
9777
- return /* @__PURE__ */ jsx40(SelectPrimitive.Root, { "data-slot": "select", ...props });
10767
+ return /* @__PURE__ */ jsx42(SelectPrimitive.Root, { "data-slot": "select", ...props });
9778
10768
  }
9779
10769
  function SelectGroup({
9780
10770
  className,
9781
10771
  ...props
9782
10772
  }) {
9783
- return /* @__PURE__ */ jsx40(
10773
+ return /* @__PURE__ */ jsx42(
9784
10774
  SelectPrimitive.Group,
9785
10775
  {
9786
10776
  "data-slot": "select-group",
@@ -9792,7 +10782,7 @@ function SelectGroup({
9792
10782
  function SelectValue({
9793
10783
  ...props
9794
10784
  }) {
9795
- return /* @__PURE__ */ jsx40(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
10785
+ return /* @__PURE__ */ jsx42(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
9796
10786
  }
9797
10787
  function SelectTrigger({
9798
10788
  className,
@@ -9800,7 +10790,7 @@ function SelectTrigger({
9800
10790
  children,
9801
10791
  ...props
9802
10792
  }) {
9803
- return /* @__PURE__ */ jsxs26(
10793
+ return /* @__PURE__ */ jsxs28(
9804
10794
  SelectPrimitive.Trigger,
9805
10795
  {
9806
10796
  "data-slot": "select-trigger",
@@ -9812,7 +10802,7 @@ function SelectTrigger({
9812
10802
  ...props,
9813
10803
  children: [
9814
10804
  children,
9815
- /* @__PURE__ */ jsx40(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx40(ChevronDownIcon2, { className: "pointer-events-none size-4 text-muted-foreground" }) })
10805
+ /* @__PURE__ */ jsx42(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx42(ChevronDownIcon2, { className: "pointer-events-none size-4 text-muted-foreground" }) })
9816
10806
  ]
9817
10807
  }
9818
10808
  );
@@ -9824,7 +10814,7 @@ function SelectContent({
9824
10814
  align = "center",
9825
10815
  ...props
9826
10816
  }) {
9827
- return /* @__PURE__ */ jsx40(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs26(
10817
+ return /* @__PURE__ */ jsx42(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs28(
9828
10818
  SelectPrimitive.Content,
9829
10819
  {
9830
10820
  "data-slot": "select-content",
@@ -9834,8 +10824,8 @@ function SelectContent({
9834
10824
  align,
9835
10825
  ...props,
9836
10826
  children: [
9837
- /* @__PURE__ */ jsx40(SelectScrollUpButton, {}),
9838
- /* @__PURE__ */ jsx40(
10827
+ /* @__PURE__ */ jsx42(SelectScrollUpButton, {}),
10828
+ /* @__PURE__ */ jsx42(
9839
10829
  SelectPrimitive.Viewport,
9840
10830
  {
9841
10831
  "data-position": position,
@@ -9846,7 +10836,7 @@ function SelectContent({
9846
10836
  children
9847
10837
  }
9848
10838
  ),
9849
- /* @__PURE__ */ jsx40(SelectScrollDownButton, {})
10839
+ /* @__PURE__ */ jsx42(SelectScrollDownButton, {})
9850
10840
  ]
9851
10841
  }
9852
10842
  ) });
@@ -9856,7 +10846,7 @@ function SelectItem({
9856
10846
  children,
9857
10847
  ...props
9858
10848
  }) {
9859
- return /* @__PURE__ */ jsxs26(
10849
+ return /* @__PURE__ */ jsxs28(
9860
10850
  SelectPrimitive.Item,
9861
10851
  {
9862
10852
  "data-slot": "select-item",
@@ -9866,8 +10856,8 @@ function SelectItem({
9866
10856
  ),
9867
10857
  ...props,
9868
10858
  children: [
9869
- /* @__PURE__ */ jsx40("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx40(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx40(CheckIcon4, { className: "pointer-events-none" }) }) }),
9870
- /* @__PURE__ */ jsx40(SelectPrimitive.ItemText, { children })
10859
+ /* @__PURE__ */ jsx42("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx42(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx42(CheckIcon4, { className: "pointer-events-none" }) }) }),
10860
+ /* @__PURE__ */ jsx42(SelectPrimitive.ItemText, { children })
9871
10861
  ]
9872
10862
  }
9873
10863
  );
@@ -9876,7 +10866,7 @@ function SelectScrollUpButton({
9876
10866
  className,
9877
10867
  ...props
9878
10868
  }) {
9879
- return /* @__PURE__ */ jsx40(
10869
+ return /* @__PURE__ */ jsx42(
9880
10870
  SelectPrimitive.ScrollUpButton,
9881
10871
  {
9882
10872
  "data-slot": "select-scroll-up-button",
@@ -9885,7 +10875,7 @@ function SelectScrollUpButton({
9885
10875
  className
9886
10876
  ),
9887
10877
  ...props,
9888
- children: /* @__PURE__ */ jsx40(
10878
+ children: /* @__PURE__ */ jsx42(
9889
10879
  ChevronUpIcon,
9890
10880
  {}
9891
10881
  )
@@ -9896,7 +10886,7 @@ function SelectScrollDownButton({
9896
10886
  className,
9897
10887
  ...props
9898
10888
  }) {
9899
- return /* @__PURE__ */ jsx40(
10889
+ return /* @__PURE__ */ jsx42(
9900
10890
  SelectPrimitive.ScrollDownButton,
9901
10891
  {
9902
10892
  "data-slot": "select-scroll-down-button",
@@ -9905,7 +10895,7 @@ function SelectScrollDownButton({
9905
10895
  className
9906
10896
  ),
9907
10897
  ...props,
9908
- children: /* @__PURE__ */ jsx40(
10898
+ children: /* @__PURE__ */ jsx42(
9909
10899
  ChevronDownIcon2,
9910
10900
  {}
9911
10901
  )
@@ -9914,9 +10904,9 @@ function SelectScrollDownButton({
9914
10904
  }
9915
10905
 
9916
10906
  // src/components/ui/slider.tsx
9917
- import * as React38 from "react";
10907
+ import * as React39 from "react";
9918
10908
  import { Slider as SliderPrimitive } from "radix-ui";
9919
- import { jsx as jsx41, jsxs as jsxs27 } from "react/jsx-runtime";
10909
+ import { jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
9920
10910
  function Slider({
9921
10911
  className,
9922
10912
  defaultValue,
@@ -9925,11 +10915,11 @@ function Slider({
9925
10915
  max = 100,
9926
10916
  ...props
9927
10917
  }) {
9928
- const _values = React38.useMemo(
10918
+ const _values = React39.useMemo(
9929
10919
  () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
9930
10920
  [value, defaultValue, min, max]
9931
10921
  );
9932
- return /* @__PURE__ */ jsxs27(
10922
+ return /* @__PURE__ */ jsxs29(
9933
10923
  SliderPrimitive.Root,
9934
10924
  {
9935
10925
  "data-slot": "slider",
@@ -9943,12 +10933,12 @@ function Slider({
9943
10933
  ),
9944
10934
  ...props,
9945
10935
  children: [
9946
- /* @__PURE__ */ jsx41(
10936
+ /* @__PURE__ */ jsx43(
9947
10937
  SliderPrimitive.Track,
9948
10938
  {
9949
10939
  "data-slot": "slider-track",
9950
10940
  className: "relative grow overflow-hidden rounded-full bg-muted data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",
9951
- children: /* @__PURE__ */ jsx41(
10941
+ children: /* @__PURE__ */ jsx43(
9952
10942
  SliderPrimitive.Range,
9953
10943
  {
9954
10944
  "data-slot": "slider-range",
@@ -9957,7 +10947,7 @@ function Slider({
9957
10947
  )
9958
10948
  }
9959
10949
  ),
9960
- Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx41(
10950
+ Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx43(
9961
10951
  SliderPrimitive.Thumb,
9962
10952
  {
9963
10953
  "data-slot": "slider-thumb",
@@ -9971,7 +10961,7 @@ function Slider({
9971
10961
  }
9972
10962
 
9973
10963
  // src/components/ui/toggle-group.tsx
9974
- import * as React40 from "react";
10964
+ import * as React41 from "react";
9975
10965
  import "class-variance-authority";
9976
10966
  import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
9977
10967
 
@@ -9979,7 +10969,7 @@ import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
9979
10969
  import "react";
9980
10970
  import { cva as cva2 } from "class-variance-authority";
9981
10971
  import { Toggle as TogglePrimitive } from "radix-ui";
9982
- import { jsx as jsx42 } from "react/jsx-runtime";
10972
+ import { jsx as jsx44 } from "react/jsx-runtime";
9983
10973
  var toggleVariants = cva2(
9984
10974
  "group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
9985
10975
  {
@@ -10002,8 +10992,8 @@ var toggleVariants = cva2(
10002
10992
  );
10003
10993
 
10004
10994
  // src/components/ui/toggle-group.tsx
10005
- import { jsx as jsx43 } from "react/jsx-runtime";
10006
- var ToggleGroupContext = React40.createContext({
10995
+ import { jsx as jsx45 } from "react/jsx-runtime";
10996
+ var ToggleGroupContext = React41.createContext({
10007
10997
  size: "default",
10008
10998
  variant: "default",
10009
10999
  spacing: 0,
@@ -10018,7 +11008,7 @@ function ToggleGroup({
10018
11008
  children,
10019
11009
  ...props
10020
11010
  }) {
10021
- return /* @__PURE__ */ jsx43(
11011
+ return /* @__PURE__ */ jsx45(
10022
11012
  ToggleGroupPrimitive.Root,
10023
11013
  {
10024
11014
  "data-slot": "toggle-group",
@@ -10032,7 +11022,7 @@ function ToggleGroup({
10032
11022
  className
10033
11023
  ),
10034
11024
  ...props,
10035
- children: /* @__PURE__ */ jsx43(
11025
+ children: /* @__PURE__ */ jsx45(
10036
11026
  ToggleGroupContext.Provider,
10037
11027
  {
10038
11028
  value: { variant, size: size2, spacing, orientation },
@@ -10049,8 +11039,8 @@ function ToggleGroupItem({
10049
11039
  size: size2 = "default",
10050
11040
  ...props
10051
11041
  }) {
10052
- const context = React40.useContext(ToggleGroupContext);
10053
- return /* @__PURE__ */ jsx43(
11042
+ const context = React41.useContext(ToggleGroupContext);
11043
+ return /* @__PURE__ */ jsx45(
10054
11044
  ToggleGroupPrimitive.Item,
10055
11045
  {
10056
11046
  "data-slot": "toggle-group-item",
@@ -10290,7 +11280,7 @@ import {
10290
11280
  } from "@xpert-ai/chatkit-types";
10291
11281
 
10292
11282
  // src/components/pet/PetPreview.tsx
10293
- import { jsx as jsx44 } from "react/jsx-runtime";
11283
+ import { jsx as jsx46 } from "react/jsx-runtime";
10294
11284
  function escapeCssUrl(value) {
10295
11285
  return value.replace(/["\\]/g, "\\$&");
10296
11286
  }
@@ -10298,7 +11288,7 @@ function PetPreview({ src, label, className }) {
10298
11288
  const scale = 0.13;
10299
11289
  const width = petSpriteAtlas.cellWidth;
10300
11290
  const height = petSpriteAtlas.cellHeight;
10301
- return /* @__PURE__ */ jsx44(
11291
+ return /* @__PURE__ */ jsx46(
10302
11292
  "span",
10303
11293
  {
10304
11294
  className: cn(
@@ -10307,7 +11297,7 @@ function PetPreview({ src, label, className }) {
10307
11297
  ),
10308
11298
  "aria-hidden": "true",
10309
11299
  title: label,
10310
- children: /* @__PURE__ */ jsx44(
11300
+ children: /* @__PURE__ */ jsx46(
10311
11301
  "span",
10312
11302
  {
10313
11303
  className: "absolute left-1/2 top-1/2 block",
@@ -10329,7 +11319,7 @@ function PetPreview({ src, label, className }) {
10329
11319
  }
10330
11320
 
10331
11321
  // src/components/settings/SettingsSheet.tsx
10332
- import { jsx as jsx45, jsxs as jsxs28 } from "react/jsx-runtime";
11322
+ import { jsx as jsx47, jsxs as jsxs30 } from "react/jsx-runtime";
10333
11323
  var CHARACTER_TYPES2 = [
10334
11324
  "builtin",
10335
11325
  "atlas"
@@ -10345,13 +11335,13 @@ function SettingsSheet({
10345
11335
  onSave
10346
11336
  }) {
10347
11337
  const { t } = useChatkitTranslation();
10348
- const [draft, setDraft] = React42.useState(settings);
10349
- React42.useEffect(() => {
11338
+ const [draft, setDraft] = React43.useState(settings);
11339
+ React43.useEffect(() => {
10350
11340
  if (open) {
10351
11341
  setDraft(petRequired ? { ...settings, enabled: true } : settings);
10352
11342
  }
10353
11343
  }, [open, petRequired, settings]);
10354
- const updateDraft = React42.useCallback(
11344
+ const updateDraft = React43.useCallback(
10355
11345
  (patch) => {
10356
11346
  setDraft((previous) => ({ ...previous, ...patch }));
10357
11347
  },
@@ -10369,23 +11359,23 @@ function SettingsSheet({
10369
11359
  defaultValue: selectedBuiltinPet.label
10370
11360
  }
10371
11361
  );
10372
- return /* @__PURE__ */ jsx45(Sheet, { open, onOpenChange, children: /* @__PURE__ */ jsxs28(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
10373
- /* @__PURE__ */ jsx45(SheetHeader, { children: /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", children: [
10374
- /* @__PURE__ */ jsx45("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ jsx45(Settings, { size: 16 }) }),
10375
- /* @__PURE__ */ jsx45(SheetTitle, { children: t("settings.title") })
11362
+ return /* @__PURE__ */ jsx47(Sheet, { open, onOpenChange, children: /* @__PURE__ */ jsxs30(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
11363
+ /* @__PURE__ */ jsx47(SheetHeader, { children: /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
11364
+ /* @__PURE__ */ jsx47("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ jsx47(Settings, { size: 16 }) }),
11365
+ /* @__PURE__ */ jsx47(SheetTitle, { children: t("settings.title") })
10376
11366
  ] }) }),
10377
- /* @__PURE__ */ jsxs28("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
10378
- /* @__PURE__ */ jsxs28("section", { className: "space-y-5", children: [
10379
- /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", children: [
10380
- /* @__PURE__ */ jsx45("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx45(PawPrint, { size: 15 }) }),
10381
- /* @__PURE__ */ jsx45("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
11367
+ /* @__PURE__ */ jsxs30("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
11368
+ /* @__PURE__ */ jsxs30("section", { className: "space-y-5", children: [
11369
+ /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
11370
+ /* @__PURE__ */ jsx47("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx47(PawPrint, { size: 15 }) }),
11371
+ /* @__PURE__ */ jsx47("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
10382
11372
  ] }),
10383
- /* @__PURE__ */ jsxs28("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
10384
- /* @__PURE__ */ jsxs28("span", { className: "min-w-0", children: [
10385
- /* @__PURE__ */ jsx45("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
10386
- petRequired && /* @__PURE__ */ jsx45("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
11373
+ /* @__PURE__ */ jsxs30("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
11374
+ /* @__PURE__ */ jsxs30("span", { className: "min-w-0", children: [
11375
+ /* @__PURE__ */ jsx47("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
11376
+ petRequired && /* @__PURE__ */ jsx47("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
10387
11377
  ] }),
10388
- /* @__PURE__ */ jsx45(
11378
+ /* @__PURE__ */ jsx47(
10389
11379
  "button",
10390
11380
  {
10391
11381
  type: "button",
@@ -10398,7 +11388,7 @@ function SettingsSheet({
10398
11388
  draft.enabled ? "bg-primary" : "bg-muted-foreground/20",
10399
11389
  petRequired ? "cursor-not-allowed opacity-70" : ""
10400
11390
  ].join(" "),
10401
- children: /* @__PURE__ */ jsx45(
11391
+ children: /* @__PURE__ */ jsx47(
10402
11392
  "span",
10403
11393
  {
10404
11394
  className: [
@@ -10411,9 +11401,9 @@ function SettingsSheet({
10411
11401
  )
10412
11402
  ] })
10413
11403
  ] }),
10414
- /* @__PURE__ */ jsxs28("div", { className: "space-y-2", children: [
10415
- /* @__PURE__ */ jsx45("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
10416
- /* @__PURE__ */ jsx45(
11404
+ /* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
11405
+ /* @__PURE__ */ jsx47("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
11406
+ /* @__PURE__ */ jsx47(
10417
11407
  ToggleGroup,
10418
11408
  {
10419
11409
  id: "chatkit-pet-type",
@@ -10428,7 +11418,7 @@ function SettingsSheet({
10428
11418
  variant: "outline",
10429
11419
  spacing: 2,
10430
11420
  className: "!w-full",
10431
- children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ jsx45(
11421
+ children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ jsx47(
10432
11422
  ToggleGroupItem,
10433
11423
  {
10434
11424
  value: type,
@@ -10440,8 +11430,8 @@ function SettingsSheet({
10440
11430
  }
10441
11431
  )
10442
11432
  ] }),
10443
- draft.characterType === "builtin" && /* @__PURE__ */ jsxs28("div", { className: "space-y-2", children: [
10444
- /* @__PURE__ */ jsx45(
11433
+ draft.characterType === "builtin" && /* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
11434
+ /* @__PURE__ */ jsx47(
10445
11435
  "label",
10446
11436
  {
10447
11437
  htmlFor: "chatkit-pet-builtin",
@@ -10449,7 +11439,7 @@ function SettingsSheet({
10449
11439
  children: t("pet.settings.builtin")
10450
11440
  }
10451
11441
  ),
10452
- /* @__PURE__ */ jsxs28(
11442
+ /* @__PURE__ */ jsxs30(
10453
11443
  Select,
10454
11444
  {
10455
11445
  value: selectedBuiltinPet.id,
@@ -10460,26 +11450,26 @@ function SettingsSheet({
10460
11450
  }
10461
11451
  },
10462
11452
  children: [
10463
- /* @__PURE__ */ jsx45(
11453
+ /* @__PURE__ */ jsx47(
10464
11454
  SelectTrigger,
10465
11455
  {
10466
11456
  id: "chatkit-pet-builtin",
10467
11457
  className: "min-h-12 w-full px-3 py-2",
10468
- children: /* @__PURE__ */ jsx45(SelectValue, { placeholder: selectedBuiltinPetLabel })
11458
+ children: /* @__PURE__ */ jsx47(SelectValue, { placeholder: selectedBuiltinPetLabel })
10469
11459
  }
10470
11460
  ),
10471
- /* @__PURE__ */ jsx45(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ jsx45(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
11461
+ /* @__PURE__ */ jsx47(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ jsx47(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
10472
11462
  const label = t(`pet.settings.builtins.${pet.id}`, {
10473
11463
  defaultValue: pet.label
10474
11464
  });
10475
- return /* @__PURE__ */ jsx45(
11465
+ return /* @__PURE__ */ jsx47(
10476
11466
  SelectItem,
10477
11467
  {
10478
11468
  value: pet.id,
10479
11469
  className: "min-h-10 py-1.5 pl-2 pr-8",
10480
- children: /* @__PURE__ */ jsxs28("span", { className: "flex min-w-0 items-center gap-2", children: [
10481
- /* @__PURE__ */ jsx45(PetPreview, { src: pet.previewSrc, label }),
10482
- /* @__PURE__ */ jsx45("span", { className: "min-w-0 truncate", children: label })
11470
+ children: /* @__PURE__ */ jsxs30("span", { className: "flex min-w-0 items-center gap-2", children: [
11471
+ /* @__PURE__ */ jsx47(PetPreview, { src: pet.previewSrc, label }),
11472
+ /* @__PURE__ */ jsx47("span", { className: "min-w-0 truncate", children: label })
10483
11473
  ] })
10484
11474
  },
10485
11475
  pet.id
@@ -10489,8 +11479,8 @@ function SettingsSheet({
10489
11479
  }
10490
11480
  )
10491
11481
  ] }),
10492
- draft.characterType === "atlas" && /* @__PURE__ */ jsxs28("div", { className: "space-y-2", children: [
10493
- /* @__PURE__ */ jsx45(
11482
+ draft.characterType === "atlas" && /* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
11483
+ /* @__PURE__ */ jsx47(
10494
11484
  "label",
10495
11485
  {
10496
11486
  className: "text-sm font-medium",
@@ -10498,7 +11488,7 @@ function SettingsSheet({
10498
11488
  children: t("pet.settings.atlasUrl")
10499
11489
  }
10500
11490
  ),
10501
- /* @__PURE__ */ jsx45(
11491
+ /* @__PURE__ */ jsx47(
10502
11492
  Input,
10503
11493
  {
10504
11494
  id: "chatkit-pet-atlas",
@@ -10508,15 +11498,15 @@ function SettingsSheet({
10508
11498
  }
10509
11499
  )
10510
11500
  ] }),
10511
- /* @__PURE__ */ jsxs28("div", { className: "space-y-2", children: [
10512
- /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between gap-4", children: [
10513
- /* @__PURE__ */ jsx45("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
10514
- /* @__PURE__ */ jsxs28("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
11501
+ /* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
11502
+ /* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between gap-4", children: [
11503
+ /* @__PURE__ */ jsx47("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
11504
+ /* @__PURE__ */ jsxs30("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
10515
11505
  draft.scale.toFixed(2),
10516
11506
  "x"
10517
11507
  ] })
10518
11508
  ] }),
10519
- /* @__PURE__ */ jsx45(
11509
+ /* @__PURE__ */ jsx47(
10520
11510
  Slider,
10521
11511
  {
10522
11512
  id: "chatkit-pet-scale",
@@ -10530,8 +11520,8 @@ function SettingsSheet({
10530
11520
  }
10531
11521
  )
10532
11522
  ] }),
10533
- /* @__PURE__ */ jsxs28("label", { className: "flex items-center gap-2 text-sm", children: [
10534
- /* @__PURE__ */ jsx45(
11523
+ /* @__PURE__ */ jsxs30("label", { className: "flex items-center gap-2 text-sm", children: [
11524
+ /* @__PURE__ */ jsx47(
10535
11525
  "input",
10536
11526
  {
10537
11527
  type: "checkbox",
@@ -10542,8 +11532,8 @@ function SettingsSheet({
10542
11532
  ),
10543
11533
  t("pet.settings.draggable")
10544
11534
  ] }),
10545
- /* @__PURE__ */ jsxs28("label", { className: "flex items-center gap-2 text-sm", children: [
10546
- /* @__PURE__ */ jsx45(
11535
+ /* @__PURE__ */ jsxs30("label", { className: "flex items-center gap-2 text-sm", children: [
11536
+ /* @__PURE__ */ jsx47(
10547
11537
  "input",
10548
11538
  {
10549
11539
  type: "checkbox",
@@ -10554,8 +11544,8 @@ function SettingsSheet({
10554
11544
  ),
10555
11545
  t("pet.settings.persistPosition")
10556
11546
  ] }),
10557
- /* @__PURE__ */ jsxs28("div", { className: "flex justify-end gap-2 pt-2", children: [
10558
- /* @__PURE__ */ jsx45(
11547
+ /* @__PURE__ */ jsxs30("div", { className: "flex justify-end gap-2 pt-2", children: [
11548
+ /* @__PURE__ */ jsx47(
10559
11549
  Button,
10560
11550
  {
10561
11551
  type: "button",
@@ -10564,7 +11554,7 @@ function SettingsSheet({
10564
11554
  children: t("pet.settings.cancel")
10565
11555
  }
10566
11556
  ),
10567
- /* @__PURE__ */ jsx45(Button, { type: "submit", children: t("pet.settings.save") })
11557
+ /* @__PURE__ */ jsx47(Button, { type: "submit", children: t("pet.settings.save") })
10568
11558
  ] })
10569
11559
  ] })
10570
11560
  ] }) });
@@ -10595,10 +11585,12 @@ function splitByAvailability(values, availableValues) {
10595
11585
  }
10596
11586
  return { found, missing };
10597
11587
  }
10598
- function hasMissingRuntimeCapabilityReferences(missing) {
10599
- return missing.skillIds.length > 0 || missing.pluginNodeKeys.length > 0 || missing.subAgentNodeKeys.length > 0;
11588
+ function uniqueStrings2(values) {
11589
+ return Array.from(
11590
+ new Set(values.map((value) => value.trim()).filter(Boolean))
11591
+ );
10600
11592
  }
10601
- function getRuntimeCapabilitiesSelectionAvailability(selection, capabilities) {
11593
+ function getAvailableSelectionSet(selection, capabilities) {
10602
11594
  const skillIds = splitByAvailability(
10603
11595
  selection.skills.ids,
10604
11596
  capabilities.skills.map((skill) => skill.id)
@@ -10632,6 +11624,42 @@ function getRuntimeCapabilitiesSelectionAvailability(selection, capabilities) {
10632
11624
  }
10633
11625
  };
10634
11626
  }
11627
+ function hasMissingRuntimeCapabilityReferences(missing) {
11628
+ return missing.skillIds.length > 0 || missing.pluginNodeKeys.length > 0 || missing.subAgentNodeKeys.length > 0;
11629
+ }
11630
+ function getRuntimeCapabilitiesSelectionAvailability(selection, capabilities) {
11631
+ const available = getAvailableSelectionSet(selection, capabilities);
11632
+ const recommended = selection.recommended ? getAvailableSelectionSet(selection.recommended, capabilities) : null;
11633
+ return {
11634
+ selection: {
11635
+ mode: "allowlist",
11636
+ skills: available.selection.skills,
11637
+ plugins: available.selection.plugins,
11638
+ subAgents: available.selection.subAgents,
11639
+ ...recommended && hasRuntimeCapabilitySelectionSet(recommended.selection) ? {
11640
+ recommended: {
11641
+ skills: recommended.selection.skills,
11642
+ plugins: recommended.selection.plugins,
11643
+ subAgents: recommended.selection.subAgents
11644
+ }
11645
+ } : {}
11646
+ },
11647
+ missing: {
11648
+ skillIds: uniqueStrings2([
11649
+ ...available.missing.skillIds,
11650
+ ...recommended?.missing.skillIds ?? []
11651
+ ]),
11652
+ pluginNodeKeys: uniqueStrings2([
11653
+ ...available.missing.pluginNodeKeys,
11654
+ ...recommended?.missing.pluginNodeKeys ?? []
11655
+ ]),
11656
+ subAgentNodeKeys: uniqueStrings2([
11657
+ ...available.missing.subAgentNodeKeys,
11658
+ ...recommended?.missing.subAgentNodeKeys ?? []
11659
+ ])
11660
+ }
11661
+ };
11662
+ }
10635
11663
  async function findConversationByThreadId(client, threadId) {
10636
11664
  const normalizedThreadId = threadId.trim();
10637
11665
  if (!normalizedThreadId) {
@@ -10702,7 +11730,9 @@ async function persistConversationRuntimeCapabilities({
10702
11730
  await client.conversations.update(conversation.id, {
10703
11731
  options: {
10704
11732
  ...conversation.options ?? {},
10705
- runtimeCapabilities: availability.selection
11733
+ runtimeCapabilities: getAvailableRuntimeCapabilitiesSelection(
11734
+ availability.selection
11735
+ )
10706
11736
  }
10707
11737
  });
10708
11738
  return {
@@ -11030,7 +12060,7 @@ function findDomPointForComposerOffset(root, offset) {
11030
12060
  }
11031
12061
 
11032
12062
  // src/components/chat.tsx
11033
- import { Fragment as Fragment6, jsx as jsx46, jsxs as jsxs29 } from "react/jsx-runtime";
12063
+ import { Fragment as Fragment7, jsx as jsx48, jsxs as jsxs31 } from "react/jsx-runtime";
11034
12064
  var defaultApiUrl2 = import.meta.env.VITE_XPERTAI_API_URL;
11035
12065
  var COMPOSER_INPUT_MAX_HEIGHT = 128;
11036
12066
  var LONG_TEXT_REFERENCE_THRESHOLD = 5e3;
@@ -11163,7 +12193,7 @@ function ReferenceChip({
11163
12193
  const metaLine = getReferenceMetaLine(reference);
11164
12194
  const isComposer = variant === "composer";
11165
12195
  const Icon = reference.type === "quote" ? Quote : reference.type === "image" ? ImageIcon : FileText3;
11166
- return /* @__PURE__ */ jsxs29(
12196
+ return /* @__PURE__ */ jsxs31(
11167
12197
  "div",
11168
12198
  {
11169
12199
  className: cn(
@@ -11172,7 +12202,7 @@ function ReferenceChip({
11172
12202
  ),
11173
12203
  title: getReferenceTitle(reference),
11174
12204
  children: [
11175
- /* @__PURE__ */ jsx46(
12205
+ /* @__PURE__ */ jsx48(
11176
12206
  Icon,
11177
12207
  {
11178
12208
  size: isComposer ? 14 : 12,
@@ -11182,8 +12212,8 @@ function ReferenceChip({
11182
12212
  )
11183
12213
  }
11184
12214
  ),
11185
- /* @__PURE__ */ jsxs29("div", { className: "min-w-0 flex-1", children: [
11186
- /* @__PURE__ */ jsx46(
12215
+ /* @__PURE__ */ jsxs31("div", { className: "min-w-0 flex-1", children: [
12216
+ /* @__PURE__ */ jsx48(
11187
12217
  "div",
11188
12218
  {
11189
12219
  className: cn(
@@ -11193,7 +12223,7 @@ function ReferenceChip({
11193
12223
  children: getReferenceLabel(reference)
11194
12224
  }
11195
12225
  ),
11196
- metaLine && /* @__PURE__ */ jsx46(
12226
+ metaLine && /* @__PURE__ */ jsx48(
11197
12227
  "div",
11198
12228
  {
11199
12229
  className: cn(
@@ -11204,7 +12234,7 @@ function ReferenceChip({
11204
12234
  }
11205
12235
  )
11206
12236
  ] }),
11207
- onRemove && removeLabel && /* @__PURE__ */ jsx46(
12237
+ onRemove && removeLabel && /* @__PURE__ */ jsx48(
11208
12238
  "button",
11209
12239
  {
11210
12240
  type: "button",
@@ -11215,7 +12245,7 @@ function ReferenceChip({
11215
12245
  ),
11216
12246
  title: removeLabel,
11217
12247
  "aria-label": removeLabel,
11218
- children: /* @__PURE__ */ jsx46(X5, { size: 12 })
12248
+ children: /* @__PURE__ */ jsx48(X5, { size: 12 })
11219
12249
  }
11220
12250
  )
11221
12251
  ]
@@ -11239,20 +12269,20 @@ function Chat({
11239
12269
  const { setStream } = useStreamManager();
11240
12270
  const stream = useStreamContext();
11241
12271
  const { theme } = useTheme();
11242
- const [isHistoryLoading, setIsHistoryLoading] = React43.useState(false);
11243
- const [historyError, setHistoryError] = React43.useState(null);
11244
- const [assistantName, setAssistantName] = React43.useState(null);
11245
- const [assistantAvatar, setAssistantAvatar] = React43.useState(null);
12272
+ const [isHistoryLoading, setIsHistoryLoading] = React44.useState(false);
12273
+ const [historyError, setHistoryError] = React44.useState(null);
12274
+ const [assistantName, setAssistantName] = React44.useState(null);
12275
+ const [assistantAvatar, setAssistantAvatar] = React44.useState(null);
11246
12276
  const LOADING_DOTS_MIN_DURATION = 800;
11247
12277
  const STREAMING_STATUS_REFRESH_MS = 250;
11248
- const [showLoadingDots, setShowLoadingDots] = React43.useState(false);
11249
- const [streamingNow, setStreamingNow] = React43.useState(() => Date.now());
11250
- const loadingStartTimeRef = React43.useRef(null);
11251
- const lastStreamOutputAtRef = React43.useRef(null);
11252
- React43.useEffect(() => {
12278
+ const [showLoadingDots, setShowLoadingDots] = React44.useState(false);
12279
+ const [streamingNow, setStreamingNow] = React44.useState(() => Date.now());
12280
+ const loadingStartTimeRef = React44.useRef(null);
12281
+ const lastStreamOutputAtRef = React44.useRef(null);
12282
+ React44.useEffect(() => {
11253
12283
  setStream(stream);
11254
12284
  }, [setStream, stream]);
11255
- React43.useEffect(() => {
12285
+ React44.useEffect(() => {
11256
12286
  if (stream.isLoading) {
11257
12287
  if (!loadingStartTimeRef.current) {
11258
12288
  loadingStartTimeRef.current = Date.now();
@@ -11275,7 +12305,7 @@ function Chat({
11275
12305
  }
11276
12306
  }
11277
12307
  }, [stream.isLoading]);
11278
- React43.useEffect(() => {
12308
+ React44.useEffect(() => {
11279
12309
  if (!stream.isLoading) {
11280
12310
  lastStreamOutputAtRef.current = null;
11281
12311
  setStreamingNow(Date.now());
@@ -11285,7 +12315,7 @@ function Chat({
11285
12315
  lastStreamOutputAtRef.current = now;
11286
12316
  setStreamingNow(now);
11287
12317
  }, [stream.messages, stream.isLoading]);
11288
- React43.useEffect(() => {
12318
+ React44.useEffect(() => {
11289
12319
  if (!stream.isLoading) {
11290
12320
  return;
11291
12321
  }
@@ -11294,74 +12324,74 @@ function Chat({
11294
12324
  }, STREAMING_STATUS_REFRESH_MS);
11295
12325
  return () => window.clearInterval(timer);
11296
12326
  }, [stream.isLoading]);
11297
- const [composerParts, setComposerParts] = React43.useState([]);
11298
- const [renderedComposerParts, setRenderedComposerParts] = React43.useState([]);
11299
- const [composerDomVersion, setComposerDomVersion] = React43.useState(0);
11300
- const [selectedTool, setSelectedTool] = React43.useState(
12327
+ const [composerParts, setComposerParts] = React44.useState([]);
12328
+ const [renderedComposerParts, setRenderedComposerParts] = React44.useState([]);
12329
+ const [composerDomVersion, setComposerDomVersion] = React44.useState(0);
12330
+ const [selectedTool, setSelectedTool] = React44.useState(
11301
12331
  null
11302
12332
  );
11303
- const [planModeEnabled, setPlanModeEnabled] = React43.useState(false);
11304
- const [petSettingsOpen, setPetSettingsOpen] = React43.useState(false);
11305
- const [petLocalSettings, setPetLocalSettings] = React43.useState(() => readPetLocalSettings());
11306
- const [runtimeCapabilities, setRuntimeCapabilities] = React43.useState(null);
11307
- const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React43.useState(false);
11308
- const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React43.useState(
12333
+ const [planModeEnabled, setPlanModeEnabled] = React44.useState(false);
12334
+ const [petSettingsOpen, setPetSettingsOpen] = React44.useState(false);
12335
+ const [petLocalSettings, setPetLocalSettings] = React44.useState(() => readPetLocalSettings());
12336
+ const [runtimeCapabilities, setRuntimeCapabilities] = React44.useState(null);
12337
+ const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React44.useState(false);
12338
+ const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React44.useState(
11309
12339
  () => createEmptyRuntimeCapabilitiesSelection()
11310
12340
  );
11311
- const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React43.useState(
12341
+ const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React44.useState(
11312
12342
  () => createEmptyRuntimeCapabilitiesSelection()
11313
12343
  );
11314
- const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React43.useState(null);
11315
- const [attachments, setAttachments] = React43.useState([]);
11316
- const [references, setReferences] = React43.useState([]);
11317
- const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React43.useState(false);
11318
- const [quoteSelection, setQuoteSelection] = React43.useState(null);
11319
- const [isAtBottom, setIsAtBottom] = React43.useState(true);
11320
- const [hasUpdatesBelow, setHasUpdatesBelow] = React43.useState(false);
12344
+ const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React44.useState(null);
12345
+ const [attachments, setAttachments] = React44.useState([]);
12346
+ const [references, setReferences] = React44.useState([]);
12347
+ const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React44.useState(false);
12348
+ const [quoteSelection, setQuoteSelection] = React44.useState(null);
12349
+ const [isAtBottom, setIsAtBottom] = React44.useState(true);
12350
+ const [hasUpdatesBelow, setHasUpdatesBelow] = React44.useState(false);
11321
12351
  const {
11322
12352
  threads,
11323
12353
  deleteThread,
11324
12354
  refreshThreads,
11325
12355
  isLoading: isThreadsLoading
11326
12356
  } = useThreads();
11327
- const viewportRef = React43.useRef(null);
11328
- const fileInputRef = React43.useRef(null);
11329
- const composerInputRef = React43.useRef(null);
11330
- const slashPaletteRef = React43.useRef(null);
11331
- const slashPaletteOptionRefs = React43.useRef(
12357
+ const viewportRef = React44.useRef(null);
12358
+ const fileInputRef = React44.useRef(null);
12359
+ const composerInputRef = React44.useRef(null);
12360
+ const slashPaletteRef = React44.useRef(null);
12361
+ const slashPaletteOptionRefs = React44.useRef(
11332
12362
  []
11333
12363
  );
11334
- const composerPartsRef = React43.useRef([]);
11335
- const pendingComposerCaretOffsetRef = React43.useRef(null);
11336
- const shouldAutoScrollRef = React43.useRef(true);
11337
- const forceFollowRef = React43.useRef(false);
11338
- const previousMessageCountRef = React43.useRef(0);
11339
- const previousScrollTopRef = React43.useRef(0);
11340
- const autoScrollFrameRef = React43.useRef(null);
11341
- const isPointerDownRef = React43.useRef(false);
11342
- const lastTouchYRef = React43.useRef(null);
11343
- const runtimeCapabilityPreferenceLoadRef = React43.useRef(0);
12364
+ const composerPartsRef = React44.useRef([]);
12365
+ const pendingComposerCaretOffsetRef = React44.useRef(null);
12366
+ const shouldAutoScrollRef = React44.useRef(true);
12367
+ const forceFollowRef = React44.useRef(false);
12368
+ const previousMessageCountRef = React44.useRef(0);
12369
+ const previousScrollTopRef = React44.useRef(0);
12370
+ const autoScrollFrameRef = React44.useRef(null);
12371
+ const isPointerDownRef = React44.useRef(false);
12372
+ const lastTouchYRef = React44.useRef(null);
12373
+ const runtimeCapabilityPreferenceLoadRef = React44.useRef(0);
11344
12374
  const resolvedTitle = title ?? t("chat.title");
11345
12375
  const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
11346
12376
  const petRequired = options?.displayMode === "pet";
11347
- const basePetSettings = React43.useMemo(
12377
+ const basePetSettings = React44.useMemo(
11348
12378
  () => derivePetLocalSettings(options?.pet),
11349
12379
  [options?.pet]
11350
12380
  );
11351
- const displayedPetSettings = React43.useMemo(
12381
+ const displayedPetSettings = React44.useMemo(
11352
12382
  () => ({
11353
12383
  ...petLocalSettings ?? basePetSettings,
11354
12384
  ...petRequired ? { enabled: true } : {}
11355
12385
  }),
11356
12386
  [basePetSettings, petLocalSettings, petRequired]
11357
12387
  );
11358
- const effectivePet = React43.useMemo(() => {
12388
+ const effectivePet = React44.useMemo(() => {
11359
12389
  if (petRequired || petLocalSettings) {
11360
12390
  return buildPetOptionsFromLocalSettings(displayedPetSettings);
11361
12391
  }
11362
12392
  return options?.pet ?? null;
11363
12393
  }, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
11364
- const savePetLocalSettings = React43.useCallback(
12394
+ const savePetLocalSettings = React44.useCallback(
11365
12395
  (settings) => {
11366
12396
  const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
11367
12397
  setPetLocalSettings(nextSettings);
@@ -11369,7 +12399,7 @@ function Chat({
11369
12399
  },
11370
12400
  [petRequired]
11371
12401
  );
11372
- const handlePetCommand = React43.useCallback(
12402
+ const handlePetCommand = React44.useCallback(
11373
12403
  (mode) => {
11374
12404
  if (mode === "settings") {
11375
12405
  setPetSettingsOpen(true);
@@ -11391,18 +12421,23 @@ function Chat({
11391
12421
  [displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
11392
12422
  );
11393
12423
  const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
11394
- const messages = React43.useMemo(
12424
+ const messages = React44.useMemo(
11395
12425
  () => stream.messages ?? [],
11396
12426
  [stream.messages]
11397
12427
  );
11398
- const draft = React43.useMemo(
12428
+ const draft = React44.useMemo(
11399
12429
  () => getComposerPlainText(composerParts),
11400
12430
  [composerParts]
11401
12431
  );
11402
12432
  const trimmedDraft = draft.trim();
11403
12433
  const hasReferences = references.length > 0;
11404
12434
  const isComposerStacked = planModeEnabled || Boolean(selectedTool);
11405
- const pendingFollowUps = React43.useMemo(
12435
+ const isComposerInputEmpty = getComposerEditingLength(composerParts) === 0;
12436
+ const composerInputRoundedClass = getComposerInputRoundedClass(theme.radius, {
12437
+ isEmpty: isComposerInputEmpty,
12438
+ isStacked: isComposerStacked
12439
+ });
12440
+ const pendingFollowUps = React44.useMemo(
11406
12441
  () => [...stream.pendingFollowUps ?? []].sort(
11407
12442
  (a, b) => a.createdAt - b.createdAt
11408
12443
  ),
@@ -11413,31 +12448,18 @@ function Chat({
11413
12448
  const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
11414
12449
  const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
11415
12450
  const hasPendingTodos = Boolean(stream.todos?.items.length);
11416
- const runtimeCapabilityOptions = React43.useMemo(
12451
+ const runtimeCapabilityOptions = React44.useMemo(
11417
12452
  () => getRuntimeCapabilityOptions(runtimeCapabilities),
11418
12453
  [runtimeCapabilities]
11419
12454
  );
11420
- const effectiveSessionRuntimeCapabilities = React43.useMemo(
12455
+ const effectiveSessionRuntimeCapabilities = React44.useMemo(
11421
12456
  () => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
11422
12457
  runtimeCapabilities,
11423
12458
  sessionRuntimeCapabilities
11424
12459
  ) : null,
11425
12460
  [runtimeCapabilities, runtimeCapabilitiesReady, sessionRuntimeCapabilities]
11426
12461
  );
11427
- const effectiveRuntimeCapabilitiesForSubmit = React43.useMemo(
11428
- () => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
11429
- runtimeCapabilities,
11430
- sessionRuntimeCapabilities,
11431
- runRuntimeCapabilities
11432
- ) : null,
11433
- [
11434
- runtimeCapabilities,
11435
- runtimeCapabilitiesReady,
11436
- runRuntimeCapabilities,
11437
- sessionRuntimeCapabilities
11438
- ]
11439
- );
11440
- const runRuntimeCapabilityOptions = React43.useMemo(
12462
+ const runRuntimeCapabilityOptions = React44.useMemo(
11441
12463
  () => runtimeCapabilityOptions.filter(
11442
12464
  (option) => isRuntimeCapabilitySelected(
11443
12465
  runRuntimeCapabilities,
@@ -11447,11 +12469,11 @@ function Chat({
11447
12469
  ),
11448
12470
  [runRuntimeCapabilities, runtimeCapabilityOptions]
11449
12471
  );
11450
- const composerRuntimeCapabilitySelectionKeys = React43.useMemo(
12472
+ const composerRuntimeCapabilitySelectionKeys = React44.useMemo(
11451
12473
  () => getComposerCapabilitySelectionKeys(composerParts),
11452
12474
  [composerParts]
11453
12475
  );
11454
- const detachedRunRuntimeCapabilityOptions = React43.useMemo(
12476
+ const detachedRunRuntimeCapabilityOptions = React44.useMemo(
11455
12477
  () => runRuntimeCapabilityOptions.filter(
11456
12478
  (option) => !composerRuntimeCapabilitySelectionKeys.has(
11457
12479
  getRuntimeCapabilityOptionKey(option)
@@ -11459,7 +12481,7 @@ function Chat({
11459
12481
  ),
11460
12482
  [composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
11461
12483
  );
11462
- const persistSessionRuntimeCapabilities = React43.useCallback(
12484
+ const persistSessionRuntimeCapabilities = React44.useCallback(
11463
12485
  async (threadId, selection) => {
11464
12486
  if (!runtimeCapabilities || !selection) {
11465
12487
  return;
@@ -11484,10 +12506,10 @@ function Chat({
11484
12506
  },
11485
12507
  [runtimeCapabilities, stream.client]
11486
12508
  );
11487
- const clearQuoteSelection = React43.useCallback(() => {
12509
+ const clearQuoteSelection = React44.useCallback(() => {
11488
12510
  setQuoteSelection(null);
11489
12511
  }, []);
11490
- const commitComposerParts = React43.useCallback(
12512
+ const commitComposerParts = React44.useCallback(
11491
12513
  (nextParts, options2) => {
11492
12514
  const normalized = normalizeComposerParts(nextParts);
11493
12515
  const previous = composerPartsRef.current;
@@ -11523,7 +12545,7 @@ function Chat({
11523
12545
  },
11524
12546
  []
11525
12547
  );
11526
- const setComposerText = React43.useCallback(
12548
+ const setComposerText = React44.useCallback(
11527
12549
  (text, caretOffset = text.length) => {
11528
12550
  commitComposerParts(createComposerTextParts(text), {
11529
12551
  caretOffset,
@@ -11533,7 +12555,7 @@ function Chat({
11533
12555
  },
11534
12556
  [commitComposerParts]
11535
12557
  );
11536
- const focusComposerAt = React43.useCallback((position) => {
12558
+ const focusComposerAt = React44.useCallback((position) => {
11537
12559
  const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
11538
12560
  pendingComposerCaretOffsetRef.current = nextPosition;
11539
12561
  requestAnimationFrame(() => {
@@ -11545,7 +12567,7 @@ function Chat({
11545
12567
  });
11546
12568
  }, []);
11547
12569
  const parentMessenger = useParentMessenger({
11548
- onSetComposerValue: React43.useCallback(
12570
+ onSetComposerValue: React44.useCallback(
11549
12571
  (payload) => {
11550
12572
  if (!payload) {
11551
12573
  return;
@@ -11568,10 +12590,10 @@ function Chat({
11568
12590
  },
11569
12591
  [composer?.tools, setComposerText]
11570
12592
  ),
11571
- onFocusComposer: React43.useCallback(() => {
12593
+ onFocusComposer: React44.useCallback(() => {
11572
12594
  composerInputRef.current?.focus();
11573
12595
  }, []),
11574
- onSetPetEnabled: React43.useCallback(
12596
+ onSetPetEnabled: React44.useCallback(
11575
12597
  (enabled) => {
11576
12598
  if (petRequired) {
11577
12599
  return;
@@ -11584,7 +12606,7 @@ function Chat({
11584
12606
  [displayedPetSettings, petRequired, savePetLocalSettings]
11585
12607
  )
11586
12608
  });
11587
- const syncQuoteSelection = React43.useCallback(() => {
12609
+ const syncQuoteSelection = React44.useCallback(() => {
11588
12610
  if (typeof window === "undefined") {
11589
12611
  clearQuoteSelection();
11590
12612
  return;
@@ -11629,23 +12651,23 @@ function Chat({
11629
12651
  left
11630
12652
  });
11631
12653
  }, [clearQuoteSelection]);
11632
- const cancelPendingAutoScroll = React43.useCallback(() => {
12654
+ const cancelPendingAutoScroll = React44.useCallback(() => {
11633
12655
  if (autoScrollFrameRef.current !== null) {
11634
12656
  cancelAnimationFrame(autoScrollFrameRef.current);
11635
12657
  autoScrollFrameRef.current = null;
11636
12658
  }
11637
12659
  }, []);
11638
- const disableAutoFollow = React43.useCallback(() => {
12660
+ const disableAutoFollow = React44.useCallback(() => {
11639
12661
  forceFollowRef.current = false;
11640
12662
  shouldAutoScrollRef.current = false;
11641
12663
  cancelPendingAutoScroll();
11642
12664
  }, [cancelPendingAutoScroll]);
11643
- const enableAutoFollow = React43.useCallback(() => {
12665
+ const enableAutoFollow = React44.useCallback(() => {
11644
12666
  forceFollowRef.current = true;
11645
12667
  shouldAutoScrollRef.current = true;
11646
12668
  setHasUpdatesBelow(false);
11647
12669
  }, []);
11648
- const scrollToBottom = React43.useCallback(
12670
+ const scrollToBottom = React44.useCallback(
11649
12671
  (smooth = false, force = false) => {
11650
12672
  if (force) {
11651
12673
  enableAutoFollow();
@@ -11672,7 +12694,7 @@ function Chat({
11672
12694
  },
11673
12695
  [cancelPendingAutoScroll, enableAutoFollow]
11674
12696
  );
11675
- React43.useEffect(() => {
12697
+ React44.useEffect(() => {
11676
12698
  const viewport = viewportRef.current;
11677
12699
  if (!viewport) return;
11678
12700
  previousScrollTopRef.current = viewport.scrollTop;
@@ -11753,14 +12775,14 @@ function Chat({
11753
12775
  window.removeEventListener("pointercancel", stopPointerTracking);
11754
12776
  };
11755
12777
  }, [cancelPendingAutoScroll, disableAutoFollow]);
11756
- React43.useEffect(() => {
12778
+ React44.useEffect(() => {
11757
12779
  shouldAutoScrollRef.current = true;
11758
12780
  forceFollowRef.current = false;
11759
12781
  previousScrollTopRef.current = 0;
11760
12782
  setIsAtBottom(true);
11761
12783
  setHasUpdatesBelow(false);
11762
12784
  }, [stream.threadId]);
11763
- React43.useEffect(() => {
12785
+ React44.useEffect(() => {
11764
12786
  const messageCountChanged = messages.length !== previousMessageCountRef.current;
11765
12787
  previousMessageCountRef.current = messages.length;
11766
12788
  if (!shouldAutoScrollRef.current) {
@@ -11779,7 +12801,7 @@ function Chat({
11779
12801
  clientSecret: effectiveClientSecret
11780
12802
  });
11781
12803
  const missingConfig = Boolean(missingConfigKind);
11782
- const missingConfigShortMessage = React43.useMemo(() => {
12804
+ const missingConfigShortMessage = React44.useMemo(() => {
11783
12805
  switch (missingConfigKind) {
11784
12806
  case "apiUrl":
11785
12807
  return t("chat.missingApiUrlShort");
@@ -11791,7 +12813,7 @@ function Chat({
11791
12813
  return t("chat.missingConfigShort");
11792
12814
  }
11793
12815
  }, [missingConfigKind, t]);
11794
- const missingConfigDetailMessage = React43.useMemo(() => {
12816
+ const missingConfigDetailMessage = React44.useMemo(() => {
11795
12817
  switch (missingConfigKind) {
11796
12818
  case "apiUrl":
11797
12819
  return t("chat.missingApiUrlDetail");
@@ -11806,7 +12828,7 @@ function Chat({
11806
12828
  const showMissingConfig = !isClientSecretInitializing && missingConfig;
11807
12829
  const hasUploadingFiles = attachments.some((a) => a.status === "uploading");
11808
12830
  const isSendDisabled = !trimmedDraft && !hasReferences || hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
11809
- const resizeComposerInput = React43.useCallback(() => {
12831
+ const resizeComposerInput = React44.useCallback(() => {
11810
12832
  const input = composerInputRef.current;
11811
12833
  if (!input) {
11812
12834
  return;
@@ -11814,7 +12836,7 @@ function Chat({
11814
12836
  input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
11815
12837
  input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
11816
12838
  }, []);
11817
- React43.useLayoutEffect(() => {
12839
+ React44.useLayoutEffect(() => {
11818
12840
  composerPartsRef.current = composerParts;
11819
12841
  resizeComposerInput();
11820
12842
  const caretOffset = pendingComposerCaretOffsetRef.current;
@@ -11826,13 +12848,13 @@ function Chat({
11826
12848
  }
11827
12849
  }
11828
12850
  }, [composerDomVersion, composerParts, resizeComposerInput]);
11829
- React43.useEffect(() => {
12851
+ React44.useEffect(() => {
11830
12852
  document.addEventListener("selectionchange", syncQuoteSelection);
11831
12853
  return () => {
11832
12854
  document.removeEventListener("selectionchange", syncQuoteSelection);
11833
12855
  };
11834
12856
  }, [syncQuoteSelection]);
11835
- React43.useEffect(() => {
12857
+ React44.useEffect(() => {
11836
12858
  const viewport = viewportRef.current;
11837
12859
  if (!viewport) {
11838
12860
  return;
@@ -11849,14 +12871,14 @@ function Chat({
11849
12871
  window.removeEventListener("resize", handleViewportScroll);
11850
12872
  };
11851
12873
  }, [clearQuoteSelection]);
11852
- React43.useEffect(() => {
12874
+ React44.useEffect(() => {
11853
12875
  clearQuoteSelection();
11854
12876
  }, [messages.length, stream.threadId, clearQuoteSelection]);
11855
- React43.useEffect(() => {
12877
+ React44.useEffect(() => {
11856
12878
  if (missingConfig) return;
11857
12879
  void refreshThreads();
11858
12880
  }, [missingConfig, refreshThreads]);
11859
- React43.useEffect(() => {
12881
+ React44.useEffect(() => {
11860
12882
  if (missingConfig || !stream.client || !stream.assistantId) {
11861
12883
  setAssistantName(null);
11862
12884
  setAssistantAvatar(null);
@@ -11879,7 +12901,7 @@ function Chat({
11879
12901
  cancelled = true;
11880
12902
  };
11881
12903
  }, [missingConfig, stream.client, stream.assistantId]);
11882
- React43.useEffect(() => {
12904
+ React44.useEffect(() => {
11883
12905
  if (missingConfig || !stream.client || !stream.assistantId) {
11884
12906
  setRuntimeCapabilities(null);
11885
12907
  setRuntimeCapabilitiesReady(false);
@@ -11926,7 +12948,7 @@ function Chat({
11926
12948
  });
11927
12949
  return () => controller.abort();
11928
12950
  }, [missingConfig, stream.client, stream.assistantId]);
11929
- React43.useEffect(() => {
12951
+ React44.useEffect(() => {
11930
12952
  setRunRuntimeCapabilities(
11931
12953
  createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
11932
12954
  );
@@ -11983,7 +13005,7 @@ function Chat({
11983
13005
  mimetype: a.storageFile?.mimetype ?? a.file.type,
11984
13006
  size: a.storageFile?.size ?? a.file.size
11985
13007
  }));
11986
- const handleSessionRuntimeCapabilityToggle = React43.useCallback(
13008
+ const handleSessionRuntimeCapabilityToggle = React44.useCallback(
11987
13009
  (type, id, selected) => {
11988
13010
  setSessionRuntimeCapabilities((previous) => {
11989
13011
  const nextSelection = toggleRuntimeCapabilitySelection(
@@ -12001,7 +13023,7 @@ function Chat({
12001
13023
  },
12002
13024
  [persistSessionRuntimeCapabilities, stream.threadId]
12003
13025
  );
12004
- const updateRuntimeCapabilityPalette = React43.useCallback(
13026
+ const updateRuntimeCapabilityPalette = React44.useCallback(
12005
13027
  (parts, selectionStart) => {
12006
13028
  const input = composerInputRef.current;
12007
13029
  const editingText = getComposerEditingText(parts);
@@ -12013,7 +13035,7 @@ function Chat({
12013
13035
  },
12014
13036
  []
12015
13037
  );
12016
- const syncComposerInputFromElement = React43.useCallback(
13038
+ const syncComposerInputFromElement = React44.useCallback(
12017
13039
  (input) => {
12018
13040
  const previousCapabilities = getComposerCapabilityPartMap(
12019
13041
  composerPartsRef.current
@@ -12031,25 +13053,25 @@ function Chat({
12031
13053
  },
12032
13054
  [commitComposerParts, updateRuntimeCapabilityPalette]
12033
13055
  );
12034
- const handleComposerInput = React43.useCallback(
13056
+ const handleComposerInput = React44.useCallback(
12035
13057
  (event) => {
12036
13058
  syncComposerInputFromElement(event.currentTarget);
12037
13059
  },
12038
13060
  [syncComposerInputFromElement]
12039
13061
  );
12040
- const handleComposerCompositionEnd = React43.useCallback(
13062
+ const handleComposerCompositionEnd = React44.useCallback(
12041
13063
  (event) => {
12042
13064
  syncComposerInputFromElement(event.currentTarget);
12043
13065
  },
12044
13066
  [syncComposerInputFromElement]
12045
13067
  );
12046
- const handleComposerSelect = React43.useCallback(() => {
13068
+ const handleComposerSelect = React44.useCallback(() => {
12047
13069
  updateRuntimeCapabilityPalette(
12048
13070
  composerPartsRef.current,
12049
13071
  composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
12050
13072
  );
12051
13073
  }, [updateRuntimeCapabilityPalette]);
12052
- const removeRunRuntimeCapability = React43.useCallback(
13074
+ const removeRunRuntimeCapability = React44.useCallback(
12053
13075
  (option) => {
12054
13076
  setRunRuntimeCapabilities(
12055
13077
  (previous) => toggleRuntimeCapabilitySelection(
@@ -12069,7 +13091,7 @@ function Chat({
12069
13091
  },
12070
13092
  [commitComposerParts]
12071
13093
  );
12072
- const submitDraft = React43.useCallback(
13094
+ const submitDraft = React44.useCallback(
12073
13095
  (optionsOrFollowUp) => {
12074
13096
  if (isSendDisabled) return;
12075
13097
  const submitOptions = typeof optionsOrFollowUp === "string" ? { followUpOverride: optionsOrFollowUp } : optionsOrFollowUp ?? {};
@@ -12085,13 +13107,20 @@ function Chat({
12085
13107
  if (!humanInput) {
12086
13108
  return;
12087
13109
  }
12088
- const runtimeCapabilitiesForSubmit = submitOptions.runtimeCapabilities && runtimeCapabilities && runtimeCapabilitiesReady ? mergeRuntimeCapabilitiesSelections(
13110
+ const recommendedRuntimeCapabilitiesForSubmit = submitOptions.runtimeCapabilities && runtimeCapabilities && runtimeCapabilitiesReady ? mergeRuntimeCapabilitiesSelections(
12089
13111
  runtimeCapabilities,
12090
- effectiveRuntimeCapabilitiesForSubmit,
13112
+ runRuntimeCapabilities,
12091
13113
  submitOptions.runtimeCapabilities
12092
- ) : effectiveRuntimeCapabilitiesForSubmit;
13114
+ ) : runRuntimeCapabilities;
13115
+ const runtimeCapabilitiesForSubmit = runtimeCapabilities && runtimeCapabilitiesReady ? createRuntimeCapabilitiesForSubmit({
13116
+ capabilities: runtimeCapabilities,
13117
+ available: effectiveSessionRuntimeCapabilities,
13118
+ recommended: recommendedRuntimeCapabilitiesForSubmit
13119
+ }) : null;
12093
13120
  const runtimeCapabilityOptionsForMessage = getSelectedRuntimeCapabilityOptions(
12094
- runtimeCapabilitiesForSubmit,
13121
+ getRecommendedRuntimeCapabilitiesSelection(
13122
+ runtimeCapabilitiesForSubmit
13123
+ ),
12095
13124
  runtimeCapabilityOptions
12096
13125
  );
12097
13126
  const displayContent = submitOptions.displayText || contentToSubmit || (referencesToSend ? t("chat.referencedContentOnly") : "");
@@ -12167,7 +13196,6 @@ function Chat({
12167
13196
  setRuntimeCapabilityPalette(null);
12168
13197
  },
12169
13198
  [
12170
- effectiveRuntimeCapabilitiesForSubmit,
12171
13199
  effectiveSessionRuntimeCapabilities,
12172
13200
  isSendDisabled,
12173
13201
  options?.request,
@@ -12176,6 +13204,7 @@ function Chat({
12176
13204
  runtimeCapabilities,
12177
13205
  runtimeCapabilitiesReady,
12178
13206
  runtimeCapabilityOptions,
13207
+ runRuntimeCapabilities,
12179
13208
  scrollToBottom,
12180
13209
  selectedTool,
12181
13210
  commitComposerParts,
@@ -12186,7 +13215,7 @@ function Chat({
12186
13215
  t
12187
13216
  ]
12188
13217
  );
12189
- const addRunRuntimeCapabilities = React43.useCallback(
13218
+ const addRunRuntimeCapabilities = React44.useCallback(
12190
13219
  (selection) => {
12191
13220
  setRunRuntimeCapabilities(
12192
13221
  (previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
@@ -12198,7 +13227,7 @@ function Chat({
12198
13227
  },
12199
13228
  [runtimeCapabilities]
12200
13229
  );
12201
- const insertComposerCapabilityToken = React43.useCallback(
13230
+ const insertComposerCapabilityToken = React44.useCallback(
12202
13231
  (capability, range) => {
12203
13232
  const token = createComposerCapabilityPart(capability, createMessageId());
12204
13233
  const currentParts = composerPartsRef.current;
@@ -12239,7 +13268,7 @@ function Chat({
12239
13268
  runtimeCapabilities,
12240
13269
  runtimeCapabilitiesReady,
12241
13270
  runtimeCapabilityOptions,
12242
- effectiveRuntimeCapabilitiesForSubmit,
13271
+ recommendedRuntimeCapabilities: runRuntimeCapabilities,
12243
13272
  draft,
12244
13273
  palette: runtimeCapabilityPalette,
12245
13274
  setPalette: setRuntimeCapabilityPalette,
@@ -12269,7 +13298,7 @@ function Chat({
12269
13298
  plugin: t("composer.slashCommands.empty.loadingCapabilities"),
12270
13299
  subAgent: t("composer.slashCommands.empty.loadingCapabilities")
12271
13300
  };
12272
- React43.useEffect(() => {
13301
+ React44.useEffect(() => {
12273
13302
  if (!runtimeCapabilityPalette) {
12274
13303
  return;
12275
13304
  }
@@ -12288,7 +13317,7 @@ function Chat({
12288
13317
  );
12289
13318
  }
12290
13319
  }, [slashPaletteOptions.length, runtimeCapabilityPalette]);
12291
- React43.useLayoutEffect(() => {
13320
+ React44.useLayoutEffect(() => {
12292
13321
  if (!runtimeCapabilityPalette) {
12293
13322
  return;
12294
13323
  }
@@ -12312,7 +13341,7 @@ function Chat({
12312
13341
  }
12313
13342
  submitDraft();
12314
13343
  };
12315
- const handleEditPendingFollowUp = React43.useCallback(
13344
+ const handleEditPendingFollowUp = React44.useCallback(
12316
13345
  (id) => {
12317
13346
  const item = pendingFollowUps.find(
12318
13347
  (entry) => entry.id === id && entry.mode === "queue"
@@ -12339,7 +13368,7 @@ function Chat({
12339
13368
  },
12340
13369
  [pendingFollowUps, setComposerText, stream]
12341
13370
  );
12342
- const handleQuoteSelection = React43.useCallback(() => {
13371
+ const handleQuoteSelection = React44.useCallback(() => {
12343
13372
  if (!quoteSelection) {
12344
13373
  return;
12345
13374
  }
@@ -12355,7 +13384,7 @@ function Chat({
12355
13384
  const handleAttachmentClick = () => {
12356
13385
  fileInputRef.current?.click();
12357
13386
  };
12358
- const uploadContextFile = React43.useCallback(
13387
+ const uploadContextFile = React44.useCallback(
12359
13388
  (file) => stream.client.contexts.uploadFile(file),
12360
13389
  [stream.client]
12361
13390
  );
@@ -12459,7 +13488,7 @@ function Chat({
12459
13488
  }
12460
13489
  submitDraft();
12461
13490
  };
12462
- const handleComposerPaste = React43.useCallback(
13491
+ const handleComposerPaste = React44.useCallback(
12463
13492
  (event) => {
12464
13493
  const clipboardData = event.clipboardData;
12465
13494
  if (!clipboardData) {
@@ -12558,18 +13587,18 @@ function Chat({
12558
13587
  uploadContextFile
12559
13588
  ]
12560
13589
  );
12561
- const alternateFollowUpShortcutLabel = React43.useMemo(() => {
13590
+ const alternateFollowUpShortcutLabel = React44.useMemo(() => {
12562
13591
  if (typeof navigator === "undefined") {
12563
13592
  return "\u2318Enter";
12564
13593
  }
12565
13594
  const platform = navigator.platform || navigator.userAgent;
12566
13595
  return /Mac|iPhone|iPad|iPod/i.test(platform) ? "\u2318Enter" : "Ctrl+Enter";
12567
13596
  }, []);
12568
- const followUpShortcutLabels = React43.useMemo(
13597
+ const followUpShortcutLabels = React44.useMemo(
12569
13598
  () => getComposerFollowUpShortcutLabels(alternateFollowUpShortcutLabel),
12570
13599
  [alternateFollowUpShortcutLabel]
12571
13600
  );
12572
- const uploadFile = React43.useCallback(
13601
+ const uploadFile = React44.useCallback(
12573
13602
  async (localId, file) => {
12574
13603
  try {
12575
13604
  const result = await uploadContextFile(file);
@@ -12592,7 +13621,7 @@ function Chat({
12592
13621
  },
12593
13622
  [uploadContextFile]
12594
13623
  );
12595
- const handleRetryUpload = React43.useCallback(
13624
+ const handleRetryUpload = React44.useCallback(
12596
13625
  (localId) => {
12597
13626
  const attachment = attachments.find((a) => a.localId === localId);
12598
13627
  if (!attachment || attachment.status !== "error") return;
@@ -12691,7 +13720,7 @@ function Chat({
12691
13720
  );
12692
13721
  scrollToBottom(true, true);
12693
13722
  };
12694
- const loadConversationMessages = React43.useCallback(
13723
+ const loadConversationMessages = React44.useCallback(
12695
13724
  async (recordId) => {
12696
13725
  if (missingConfig) {
12697
13726
  setHistoryError(missingConfigShortMessage);
@@ -12786,12 +13815,12 @@ function Chat({
12786
13815
  }
12787
13816
  };
12788
13817
  const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
12789
- const currentThread = React43.useMemo(
13818
+ const currentThread = React44.useMemo(
12790
13819
  () => threads.find((item) => item.id === stream.threadId),
12791
13820
  [threads, stream.threadId]
12792
13821
  );
12793
13822
  const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
12794
- const threadErrorMessage = React43.useMemo(() => {
13823
+ const threadErrorMessage = React44.useMemo(() => {
12795
13824
  if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
12796
13825
  if (currentThread?.status !== "error") return void 0;
12797
13826
  const message = currentThread.error?.trim();
@@ -12822,7 +13851,7 @@ function Chat({
12822
13851
  fallbackTitle: t("history.threadFallback")
12823
13852
  });
12824
13853
  const assistantTitle = assistantName || resolvedTitle;
12825
- return /* @__PURE__ */ jsxs29(
13854
+ return /* @__PURE__ */ jsxs31(
12826
13855
  "div",
12827
13856
  {
12828
13857
  ref: viewportRef,
@@ -12832,10 +13861,10 @@ function Chat({
12832
13861
  className
12833
13862
  ),
12834
13863
  children: [
12835
- /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between border-b p-2 sticky top-0 z-10 bg-background", children: [
12836
- /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-3 overflow-hidden", children: [
12837
- /* @__PURE__ */ jsxs29("div", { className: "relative shrink-0", children: [
12838
- /* @__PURE__ */ jsx46(
13864
+ /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between border-b p-2 sticky top-0 z-10 bg-background", children: [
13865
+ /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-3 overflow-hidden", children: [
13866
+ /* @__PURE__ */ jsxs31("div", { className: "relative shrink-0", children: [
13867
+ /* @__PURE__ */ jsx48(
12839
13868
  ChatkitAvatar,
12840
13869
  {
12841
13870
  avatar: assistantAvatar,
@@ -12843,10 +13872,10 @@ function Chat({
12843
13872
  label: assistantTitle
12844
13873
  }
12845
13874
  ),
12846
- /* @__PURE__ */ jsx46("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
13875
+ /* @__PURE__ */ jsx48("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
12847
13876
  ] }),
12848
- /* @__PURE__ */ jsxs29("div", { className: "truncate", children: [
12849
- /* @__PURE__ */ jsx46(
13877
+ /* @__PURE__ */ jsxs31("div", { className: "truncate", children: [
13878
+ /* @__PURE__ */ jsx48(
12850
13879
  "h2",
12851
13880
  {
12852
13881
  className: "text-lg font-semibold truncate",
@@ -12854,12 +13883,12 @@ function Chat({
12854
13883
  children: assistantTitle
12855
13884
  }
12856
13885
  ),
12857
- /* @__PURE__ */ jsx46("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
13886
+ /* @__PURE__ */ jsx48("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
12858
13887
  ] })
12859
13888
  ] }),
12860
- /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-1", children: [
12861
- /* @__PURE__ */ jsxs29(Tooltip, { children: [
12862
- /* @__PURE__ */ jsx46(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx46("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx46(
13889
+ /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-1", children: [
13890
+ /* @__PURE__ */ jsxs31(Tooltip, { children: [
13891
+ /* @__PURE__ */ jsx48(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx48("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx48(
12863
13892
  "button",
12864
13893
  {
12865
13894
  type: "button",
@@ -12870,14 +13899,14 @@ function Chat({
12870
13899
  "transition-colors duration-150"
12871
13900
  ),
12872
13901
  "aria-label": t("settings.open"),
12873
- children: /* @__PURE__ */ jsx46(Settings2, { size: 16 })
13902
+ children: /* @__PURE__ */ jsx48(Settings2, { size: 16 })
12874
13903
  }
12875
13904
  ) }) }),
12876
- /* @__PURE__ */ jsx46(TooltipContent, { side: "bottom", children: t("settings.open") })
13905
+ /* @__PURE__ */ jsx48(TooltipContent, { side: "bottom", children: t("settings.open") })
12877
13906
  ] }),
12878
- history?.enabled !== false && /* @__PURE__ */ jsxs29(Fragment6, { children: [
12879
- /* @__PURE__ */ jsxs29(Tooltip, { children: [
12880
- /* @__PURE__ */ jsx46(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx46("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx46(
13907
+ history?.enabled !== false && /* @__PURE__ */ jsxs31(Fragment7, { children: [
13908
+ /* @__PURE__ */ jsxs31(Tooltip, { children: [
13909
+ /* @__PURE__ */ jsx48(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx48("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx48(
12881
13910
  "button",
12882
13911
  {
12883
13912
  type: "button",
@@ -12890,12 +13919,12 @@ function Chat({
12890
13919
  "disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
12891
13920
  ),
12892
13921
  "aria-label": t("history.newThread"),
12893
- children: /* @__PURE__ */ jsx46(Pencil4, { size: 16 })
13922
+ children: /* @__PURE__ */ jsx48(Pencil4, { size: 16 })
12894
13923
  }
12895
13924
  ) }) }),
12896
- /* @__PURE__ */ jsx46(TooltipContent, { side: "bottom", children: t("history.newThread") })
13925
+ /* @__PURE__ */ jsx48(TooltipContent, { side: "bottom", children: t("history.newThread") })
12897
13926
  ] }),
12898
- /* @__PURE__ */ jsx46(
13927
+ /* @__PURE__ */ jsx48(
12899
13928
  HistorySidebar,
12900
13929
  {
12901
13930
  threads,
@@ -12910,18 +13939,18 @@ function Chat({
12910
13939
  ] })
12911
13940
  ] })
12912
13941
  ] }),
12913
- /* @__PURE__ */ jsxs29("div", { className: "flex-1 p-4", children: [
12914
- errorMessage && /* @__PURE__ */ jsx46("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
12915
- historyError && /* @__PURE__ */ jsx46("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
12916
- showMissingConfig && /* @__PURE__ */ jsx46("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
12917
- isHistoryLoading && /* @__PURE__ */ jsx46("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
12918
- messages.length === 0 ? /* @__PURE__ */ jsx46(
13942
+ /* @__PURE__ */ jsxs31("div", { className: "flex-1 p-4", children: [
13943
+ errorMessage && /* @__PURE__ */ jsx48("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
13944
+ historyError && /* @__PURE__ */ jsx48("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
13945
+ showMissingConfig && /* @__PURE__ */ jsx48("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
13946
+ isHistoryLoading && /* @__PURE__ */ jsx48("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
13947
+ messages.length === 0 ? /* @__PURE__ */ jsx48(
12919
13948
  StartScreen,
12920
13949
  {
12921
13950
  startScreen,
12922
13951
  onPromptClick: handlePromptClick
12923
13952
  }
12924
- ) : /* @__PURE__ */ jsxs29("div", { className: "space-y-4", children: [
13953
+ ) : /* @__PURE__ */ jsxs31("div", { className: "space-y-4", children: [
12925
13954
  messages.map((message, index) => {
12926
13955
  const messageType = String(message.type);
12927
13956
  const isAssistantMessage = messageType === "assistant" || messageType === "ai";
@@ -12943,7 +13972,9 @@ function Chat({
12943
13972
  const humanReferences = humanMessage.references ?? [];
12944
13973
  const humanAttachments = humanMessage.attachments ?? [];
12945
13974
  const humanRuntimeCapabilityOptions = message.type === "human" ? humanMessage.runtimeCapabilityOptions ?? getSelectedRuntimeCapabilityOptions(
12946
- humanMessage.runtimeCapabilities,
13975
+ getRecommendedRuntimeCapabilitiesSelection(
13976
+ humanMessage.runtimeCapabilities
13977
+ ),
12947
13978
  runtimeCapabilityOptions
12948
13979
  ) : [];
12949
13980
  const hasHumanAttachments = message.type === "human" && humanAttachments.length > 0;
@@ -12952,7 +13983,7 @@ function Chat({
12952
13983
  if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
12953
13984
  return null;
12954
13985
  }
12955
- return /* @__PURE__ */ jsx46(
13986
+ return /* @__PURE__ */ jsx48(
12956
13987
  "div",
12957
13988
  {
12958
13989
  className: cn(
@@ -12960,8 +13991,8 @@ function Chat({
12960
13991
  message.type === "human" ? "justify-end" : "justify-start -ml-1"
12961
13992
  // AI messages: slightly closer to left
12962
13993
  ),
12963
- children: /* @__PURE__ */ jsxs29("div", { className: "flex flex-col px-3 overflow-hidden", children: [
12964
- /* @__PURE__ */ jsx46(
13994
+ children: /* @__PURE__ */ jsxs31("div", { className: "flex flex-col px-3 overflow-hidden", children: [
13995
+ /* @__PURE__ */ jsx48(
12965
13996
  "div",
12966
13997
  {
12967
13998
  ...canQuoteMessage ? {
@@ -12973,7 +14004,7 @@ function Chat({
12973
14004
  message.type === "human" ? "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"
12974
14005
  // AI messages: use chat-specific foreground color
12975
14006
  ),
12976
- children: isAssistantMessage ? /* @__PURE__ */ jsx46(
14007
+ children: isAssistantMessage ? /* @__PURE__ */ jsx48(
12977
14008
  AssistantMessage,
12978
14009
  {
12979
14010
  message: {
@@ -12992,25 +14023,25 @@ function Chat({
12992
14023
  organizationId: stream.organizationId,
12993
14024
  apiUrl: stream.apiUrl
12994
14025
  }
12995
- ) : /* @__PURE__ */ jsxs29(Fragment6, { children: [
12996
- message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsx46("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs29(
14026
+ ) : /* @__PURE__ */ jsxs31(Fragment7, { children: [
14027
+ message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsx48("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs31(
12997
14028
  "span",
12998
14029
  {
12999
14030
  className: "inline-flex max-w-full items-center gap-1 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs font-medium text-primary-foreground",
13000
14031
  children: [
13001
- /* @__PURE__ */ jsx46(
14032
+ /* @__PURE__ */ jsx48(
13002
14033
  RuntimeCapabilityIcon,
13003
14034
  {
13004
14035
  option,
13005
14036
  variant: "chip"
13006
14037
  }
13007
14038
  ),
13008
- /* @__PURE__ */ jsx46("span", { className: "max-w-[9rem] truncate", children: option.label })
14039
+ /* @__PURE__ */ jsx48("span", { className: "max-w-[9rem] truncate", children: option.label })
13009
14040
  ]
13010
14041
  },
13011
14042
  `${option.type}:${option.id}`
13012
14043
  )) }),
13013
- message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ jsx46("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ jsx46(
14044
+ message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ jsx48("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ jsx48(
13014
14045
  ReferenceChip,
13015
14046
  {
13016
14047
  reference,
@@ -13018,29 +14049,29 @@ function Chat({
13018
14049
  },
13019
14050
  getReferenceKey(reference)
13020
14051
  )) }),
13021
- message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ jsx46("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ jsxs29(
14052
+ message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ jsx48("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ jsxs31(
13022
14053
  "div",
13023
14054
  {
13024
14055
  className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
13025
14056
  children: [
13026
- /* @__PURE__ */ jsx46(FileText3, { size: 12 }),
13027
- /* @__PURE__ */ jsx46("span", { className: "max-w-[100px] truncate", children: file.originalName })
14057
+ /* @__PURE__ */ jsx48(FileText3, { size: 12 }),
14058
+ /* @__PURE__ */ jsx48("span", { className: "max-w-[100px] truncate", children: file.originalName })
13028
14059
  ]
13029
14060
  },
13030
14061
  fileIndex
13031
14062
  )) }),
13032
- Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ jsx46(
14063
+ Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ jsx48(
13033
14064
  "p",
13034
14065
  {
13035
14066
  className: "wrap-break-word text-sm leading-relaxed",
13036
14067
  children: formatMessageContent(part)
13037
14068
  },
13038
14069
  `${part.type}-${partIndex}`
13039
- )) : /* @__PURE__ */ jsx46("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
14070
+ )) : /* @__PURE__ */ jsx48("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
13040
14071
  ] })
13041
14072
  }
13042
14073
  ),
13043
- /* @__PURE__ */ jsx46(
14074
+ /* @__PURE__ */ jsx48(
13044
14075
  MessageActions,
13045
14076
  {
13046
14077
  content: messageContent,
@@ -13076,7 +14107,7 @@ function Chat({
13076
14107
  stream.isLoading,
13077
14108
  { now: streamingNow }
13078
14109
  );
13079
- return /* @__PURE__ */ jsx46("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ jsx46("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ jsx46(
14110
+ return /* @__PURE__ */ jsx48("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ jsx48("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ jsx48(
13080
14111
  AssistantStreamingIndicator,
13081
14112
  {
13082
14113
  status: fallbackStreamingStatus ?? "loading"
@@ -13085,7 +14116,7 @@ function Chat({
13085
14116
  })()
13086
14117
  ] })
13087
14118
  ] }),
13088
- !isAtBottom && messages.length > 0 && /* @__PURE__ */ jsx46("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ jsx46(
14119
+ !isAtBottom && messages.length > 0 && /* @__PURE__ */ jsx48("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ jsx48(
13089
14120
  Button,
13090
14121
  {
13091
14122
  type: "button",
@@ -13098,10 +14129,10 @@ function Chat({
13098
14129
  onClick: () => scrollToBottom(true, true),
13099
14130
  "aria-label": t("chat.scrollToBottom"),
13100
14131
  title: t("chat.scrollToBottom"),
13101
- children: /* @__PURE__ */ jsx46(ArrowDown2, { size: 16 })
14132
+ children: /* @__PURE__ */ jsx48(ArrowDown2, { size: 16 })
13102
14133
  }
13103
14134
  ) }),
13104
- quoteSelection && /* @__PURE__ */ jsx46(
14135
+ quoteSelection && /* @__PURE__ */ jsx48(
13105
14136
  "div",
13106
14137
  {
13107
14138
  className: "pointer-events-none fixed z-50",
@@ -13110,7 +14141,7 @@ function Chat({
13110
14141
  left: `${quoteSelection.left}px`,
13111
14142
  transform: "translateX(-50%)"
13112
14143
  },
13113
- children: /* @__PURE__ */ jsxs29(
14144
+ children: /* @__PURE__ */ jsxs31(
13114
14145
  Button,
13115
14146
  {
13116
14147
  type: "button",
@@ -13122,16 +14153,16 @@ function Chat({
13122
14153
  "aria-label": t("composer.quoteSelection"),
13123
14154
  title: t("composer.quoteSelection"),
13124
14155
  children: [
13125
- /* @__PURE__ */ jsx46(Quote, { size: 14 }),
14156
+ /* @__PURE__ */ jsx48(Quote, { size: 14 }),
13126
14157
  t("composer.quoteSelection")
13127
14158
  ]
13128
14159
  }
13129
14160
  )
13130
14161
  }
13131
14162
  ),
13132
- /* @__PURE__ */ jsxs29("div", { className: "p-2 sticky bottom-0 z-10 bg-background", children: [
13133
- threadErrorMessage && /* @__PURE__ */ jsx46("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 }),
13134
- /* @__PURE__ */ jsx46(
14163
+ /* @__PURE__ */ jsxs31("div", { className: "p-2 sticky bottom-0 z-10 bg-background", children: [
14164
+ threadErrorMessage && /* @__PURE__ */ jsx48("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 }),
14165
+ /* @__PURE__ */ jsx48(
13135
14166
  "input",
13136
14167
  {
13137
14168
  ref: fileInputRef,
@@ -13142,7 +14173,7 @@ function Chat({
13142
14173
  className: "hidden"
13143
14174
  }
13144
14175
  ),
13145
- attachments.length > 0 && /* @__PURE__ */ jsx46("div", { className: "mb-3 flex flex-wrap gap-2", children: attachments.map((item) => /* @__PURE__ */ jsxs29(
14176
+ attachments.length > 0 && /* @__PURE__ */ jsx48("div", { className: "mb-3 flex flex-wrap gap-2", children: attachments.map((item) => /* @__PURE__ */ jsxs31(
13146
14177
  "div",
13147
14178
  {
13148
14179
  className: cn(
@@ -13150,16 +14181,16 @@ function Chat({
13150
14181
  item.status === "error" ? "bg-destructive/10 border border-destructive/30" : "bg-muted"
13151
14182
  ),
13152
14183
  children: [
13153
- item.status === "uploading" && /* @__PURE__ */ jsx46(
13154
- Loader25,
14184
+ item.status === "uploading" && /* @__PURE__ */ jsx48(
14185
+ Loader26,
13155
14186
  {
13156
14187
  size: 14,
13157
14188
  className: "animate-spin text-muted-foreground"
13158
14189
  }
13159
14190
  ),
13160
- item.status === "success" && /* @__PURE__ */ jsx46(FileText3, { size: 14, className: "text-muted-foreground" }),
13161
- item.status === "error" && /* @__PURE__ */ jsx46(FileText3, { size: 14, className: "text-destructive" }),
13162
- /* @__PURE__ */ jsx46(
14191
+ item.status === "success" && /* @__PURE__ */ jsx48(FileText3, { size: 14, className: "text-muted-foreground" }),
14192
+ item.status === "error" && /* @__PURE__ */ jsx48(FileText3, { size: 14, className: "text-destructive" }),
14193
+ /* @__PURE__ */ jsx48(
13163
14194
  "span",
13164
14195
  {
13165
14196
  className: cn(
@@ -13169,17 +14200,17 @@ function Chat({
13169
14200
  children: item.file.name
13170
14201
  }
13171
14202
  ),
13172
- item.status === "error" && /* @__PURE__ */ jsx46(
14203
+ item.status === "error" && /* @__PURE__ */ jsx48(
13173
14204
  "button",
13174
14205
  {
13175
14206
  type: "button",
13176
14207
  onClick: () => handleRetryUpload(item.localId),
13177
14208
  className: "ml-1 rounded-full p-0.5 text-destructive hover:bg-destructive/20",
13178
14209
  title: t("chat.retryUpload"),
13179
- children: /* @__PURE__ */ jsx46(RefreshCw2, { size: 12 })
14210
+ children: /* @__PURE__ */ jsx48(RefreshCw2, { size: 12 })
13180
14211
  }
13181
14212
  ),
13182
- /* @__PURE__ */ jsx46(
14213
+ /* @__PURE__ */ jsx48(
13183
14214
  "button",
13184
14215
  {
13185
14216
  type: "button",
@@ -13188,14 +14219,14 @@ function Chat({
13188
14219
  "ml-1 rounded-full p-0.5",
13189
14220
  item.status === "error" ? "text-destructive hover:bg-destructive/20" : "hover:bg-muted-foreground/20"
13190
14221
  ),
13191
- children: /* @__PURE__ */ jsx46(X5, { size: 12 })
14222
+ children: /* @__PURE__ */ jsx48(X5, { size: 12 })
13192
14223
  }
13193
14224
  )
13194
14225
  ]
13195
14226
  },
13196
14227
  item.localId
13197
14228
  )) }),
13198
- references.length > 0 && /* @__PURE__ */ jsx46("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ jsx46(
14229
+ references.length > 0 && /* @__PURE__ */ jsx48("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ jsx48(
13199
14230
  ReferenceChip,
13200
14231
  {
13201
14232
  reference,
@@ -13209,16 +14240,16 @@ function Chat({
13209
14240
  },
13210
14241
  getReferenceKey(reference)
13211
14242
  )) }),
13212
- detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsxs29("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
13213
- /* @__PURE__ */ jsx46("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
13214
- detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs29(
14243
+ detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsxs31("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
14244
+ /* @__PURE__ */ jsx48("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
14245
+ detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs31(
13215
14246
  "span",
13216
14247
  {
13217
14248
  className: "inline-flex max-w-full items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",
13218
14249
  children: [
13219
- /* @__PURE__ */ jsx46(RuntimeCapabilityIcon, { option, variant: "chip" }),
13220
- /* @__PURE__ */ jsx46("span", { className: "max-w-40 truncate", children: option.label }),
13221
- /* @__PURE__ */ jsx46(
14250
+ /* @__PURE__ */ jsx48(RuntimeCapabilityIcon, { option, variant: "chip" }),
14251
+ /* @__PURE__ */ jsx48("span", { className: "max-w-40 truncate", children: option.label }),
14252
+ /* @__PURE__ */ jsx48(
13222
14253
  "button",
13223
14254
  {
13224
14255
  type: "button",
@@ -13226,7 +14257,7 @@ function Chat({
13226
14257
  className: "rounded-full p-0.5 hover:bg-primary/15",
13227
14258
  title: t("composer.capabilities.removeRunCapability"),
13228
14259
  "aria-label": t("composer.capabilities.removeRunCapability"),
13229
- children: /* @__PURE__ */ jsx46(X5, { size: 11 })
14260
+ children: /* @__PURE__ */ jsx48(X5, { size: 11 })
13230
14261
  }
13231
14262
  )
13232
14263
  ]
@@ -13234,7 +14265,7 @@ function Chat({
13234
14265
  `${option.type}:${option.id}`
13235
14266
  ))
13236
14267
  ] }),
13237
- /* @__PURE__ */ jsx46(
14268
+ /* @__PURE__ */ jsx48(
13238
14269
  PendingRuntimeServices,
13239
14270
  {
13240
14271
  state: stream.runtimeActivities.sandboxServices,
@@ -13243,7 +14274,7 @@ function Chat({
13243
14274
  className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
13244
14275
  }
13245
14276
  ),
13246
- /* @__PURE__ */ jsx46(
14277
+ /* @__PURE__ */ jsx48(
13247
14278
  PendingTodos,
13248
14279
  {
13249
14280
  snapshot: stream.todos,
@@ -13251,7 +14282,7 @@ function Chat({
13251
14282
  className: hasPendingFollowUps ? "mb-2" : void 0
13252
14283
  }
13253
14284
  ),
13254
- /* @__PURE__ */ jsx46(
14285
+ /* @__PURE__ */ jsx48(
13255
14286
  PendingFollowUps,
13256
14287
  {
13257
14288
  items: pendingFollowUps,
@@ -13266,7 +14297,7 @@ function Chat({
13266
14297
  attachToComposer: true
13267
14298
  }
13268
14299
  ),
13269
- /* @__PURE__ */ jsx46(
14300
+ /* @__PURE__ */ jsx48(
13270
14301
  RequestUserInputPanel,
13271
14302
  {
13272
14303
  request: stream.pendingRequestUserInput,
@@ -13275,7 +14306,7 @@ function Chat({
13275
14306
  attachToComposer: true
13276
14307
  }
13277
14308
  ),
13278
- /* @__PURE__ */ jsx46(
14309
+ /* @__PURE__ */ jsx48(
13279
14310
  HITLApprovalPanel,
13280
14311
  {
13281
14312
  request: stream.pendingHITLRequest,
@@ -13284,7 +14315,7 @@ function Chat({
13284
14315
  attachToComposer: true
13285
14316
  }
13286
14317
  ),
13287
- runtimeCapabilityPalette && /* @__PURE__ */ jsx46(
14318
+ runtimeCapabilityPalette && /* @__PURE__ */ jsx48(
13288
14319
  SlashPalette,
13289
14320
  {
13290
14321
  palette: runtimeCapabilityPalette,
@@ -13298,21 +14329,21 @@ function Chat({
13298
14329
  onSelect: selectSlashPaletteOption
13299
14330
  }
13300
14331
  ),
13301
- /* @__PURE__ */ jsx46("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs29(
14332
+ /* @__PURE__ */ jsx48("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs31(
13302
14333
  "div",
13303
14334
  {
13304
14335
  "data-slot": "composer-input-shell",
13305
14336
  "data-layout": isComposerStacked ? "stacked" : "inline",
13306
14337
  className: cn(
13307
- "relative flex flex-1 overflow-hidden rounded-xl",
14338
+ "relative flex flex-1 overflow-hidden",
13308
14339
  "bg-background border border-border shadow-sm",
13309
14340
  isComposerStacked ? "min-h-[5.5rem] px-1.5 pt-1.5 pb-12" : "min-h-12 px-1.5 py-1",
13310
14341
  "focus-within:border-muted-foreground/30 focus-within:shadow-md",
13311
- "transition-[min-height,padding,box-shadow,border-color] duration-300 ease-[cubic-bezier(0.2,0.8,0.2,1)]",
13312
- getRoundedClass(theme.radius)
14342
+ "transition-[min-height,padding,border-radius,box-shadow,border-color] duration-300 ease-[cubic-bezier(0.2,0.8,0.2,1)]",
14343
+ composerInputRoundedClass
13313
14344
  ),
13314
14345
  children: [
13315
- /* @__PURE__ */ jsx46(
14346
+ /* @__PURE__ */ jsx48(
13316
14347
  "div",
13317
14348
  {
13318
14349
  ref: composerInputRef,
@@ -13334,7 +14365,7 @@ function Chat({
13334
14365
  (missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
13335
14366
  ),
13336
14367
  children: renderedComposerParts.map(
13337
- (part, index) => part.type === "text" ? /* @__PURE__ */ jsx46(React43.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ jsxs29(
14368
+ (part, index) => part.type === "text" ? /* @__PURE__ */ jsx48(React44.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ jsxs31(
13338
14369
  "span",
13339
14370
  {
13340
14371
  "data-composer-capability-key": part.key,
@@ -13343,14 +14374,14 @@ function Chat({
13343
14374
  contentEditable: false,
13344
14375
  className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
13345
14376
  children: [
13346
- /* @__PURE__ */ jsx46(
14377
+ /* @__PURE__ */ jsx48(
13347
14378
  RuntimeCapabilityIcon,
13348
14379
  {
13349
14380
  option: part.capability,
13350
14381
  variant: "chip"
13351
14382
  }
13352
14383
  ),
13353
- /* @__PURE__ */ jsx46("span", { className: "truncate", children: part.capability.label })
14384
+ /* @__PURE__ */ jsx48("span", { className: "truncate", children: part.capability.label })
13354
14385
  ]
13355
14386
  },
13356
14387
  part.key
@@ -13359,14 +14390,14 @@ function Chat({
13359
14390
  },
13360
14391
  composerDomVersion
13361
14392
  ),
13362
- /* @__PURE__ */ jsxs29(
14393
+ /* @__PURE__ */ jsxs31(
13363
14394
  "div",
13364
14395
  {
13365
14396
  "data-slot": "composer-action-bar",
13366
14397
  className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
13367
14398
  children: [
13368
- /* @__PURE__ */ jsxs29("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
13369
- /* @__PURE__ */ jsx46("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ jsx46(
14399
+ /* @__PURE__ */ jsxs31("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
14400
+ /* @__PURE__ */ jsx48("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ jsx48(
13370
14401
  ComposerMenu,
13371
14402
  {
13372
14403
  composer,
@@ -13381,20 +14412,20 @@ function Chat({
13381
14412
  disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
13382
14413
  }
13383
14414
  ) }),
13384
- selectedTool && /* @__PURE__ */ jsxs29("span", { className: "pointer-events-auto inline-flex h-8 min-w-0 max-w-[14rem] shrink items-center gap-1.5 rounded-full bg-primary/10 px-2 text-xs font-medium text-primary transition-all duration-200", children: [
13385
- /* @__PURE__ */ jsx46("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
13386
- /* @__PURE__ */ jsx46(
14415
+ selectedTool && /* @__PURE__ */ jsxs31("span", { className: "pointer-events-auto inline-flex h-8 min-w-0 max-w-[14rem] shrink items-center gap-1.5 rounded-full bg-primary/10 px-2 text-xs font-medium text-primary transition-all duration-200", children: [
14416
+ /* @__PURE__ */ jsx48("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
14417
+ /* @__PURE__ */ jsx48(
13387
14418
  "button",
13388
14419
  {
13389
14420
  type: "button",
13390
14421
  onClick: () => setSelectedTool(null),
13391
14422
  className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
13392
- children: /* @__PURE__ */ jsx46(X5, { size: 12 })
14423
+ children: /* @__PURE__ */ jsx48(X5, { size: 12 })
13393
14424
  }
13394
14425
  )
13395
14426
  ] })
13396
14427
  ] }),
13397
- /* @__PURE__ */ jsx46("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ jsx46(
14428
+ /* @__PURE__ */ jsx48("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ jsx48(
13398
14429
  SendButton,
13399
14430
  {
13400
14431
  disabled: isSendDisabled,
@@ -13421,7 +14452,7 @@ function Chat({
13421
14452
  ]
13422
14453
  }
13423
14454
  ) }),
13424
- disclaimer?.text && /* @__PURE__ */ jsx46(
14455
+ disclaimer?.text && /* @__PURE__ */ jsx48(
13425
14456
  "p",
13426
14457
  {
13427
14458
  className: cn(
@@ -13431,12 +14462,12 @@ function Chat({
13431
14462
  children: disclaimer.text
13432
14463
  }
13433
14464
  ),
13434
- /* @__PURE__ */ jsxs29("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
13435
- /* @__PURE__ */ jsx46("span", { children: t("chat.poweredBy") }),
13436
- /* @__PURE__ */ jsx46(ContextUsageIndicator, { className: "absolute right-4" })
14465
+ /* @__PURE__ */ jsxs31("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
14466
+ /* @__PURE__ */ jsx48("span", { children: t("chat.poweredBy") }),
14467
+ /* @__PURE__ */ jsx48(ContextUsageIndicator, { className: "absolute right-4" })
13437
14468
  ] })
13438
14469
  ] }),
13439
- /* @__PURE__ */ jsx46(
14470
+ /* @__PURE__ */ jsx48(
13440
14471
  SettingsSheet,
13441
14472
  {
13442
14473
  open: petSettingsOpen,
@@ -13446,17 +14477,17 @@ function Chat({
13446
14477
  onSave: savePetLocalSettings
13447
14478
  }
13448
14479
  ),
13449
- /* @__PURE__ */ jsx46(PetBridge, { pet: effectivePet, state: petAutoState })
14480
+ /* @__PURE__ */ jsx48(PetBridge, { pet: effectivePet, state: petAutoState })
13450
14481
  ]
13451
14482
  }
13452
14483
  );
13453
14484
  }
13454
14485
 
13455
14486
  // src/components/ui/separator.tsx
13456
- import * as React44 from "react";
13457
- import { jsx as jsx47 } from "react/jsx-runtime";
13458
- var Separator = React44.forwardRef(
13459
- ({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx47(
14487
+ import * as React45 from "react";
14488
+ import { jsx as jsx49 } from "react/jsx-runtime";
14489
+ var Separator = React45.forwardRef(
14490
+ ({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx49(
13460
14491
  "div",
13461
14492
  {
13462
14493
  ref,